(function(e){function t(t){for(var n,i,s=t[0],l=t[1],c=t[2],d=0,p=[];d()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$)/;return t>0&&a.test(e)}),V=function(e,t){return!e||null!==e.match(t)},Y=function(e){var t=/^(?=.*\d)(?=.*[A-z])[A-z0-9-!$%^&*()_+|~=`{}[:;<>?,.@#\]]{6,14}$/;return V(e,t)},W=function(e){var t=!1,a=document.createElement("textarea");return a.value=e,a.style.position="absolute",a.style.left="-9999px",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.execCommand("copy")&&(t=!0),document.body.removeChild(a),t},G=function(e){if(e.selection){var t=document.body.createTextRange();t.moveToElementText(e),t.select()}else if(window.getSelection){var a=document.createRange();a.selectNodeContents(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}var n=!1;return document.execCommand("copy"),document.execCommand("copy")&&(n=!0),n},Q={props:{visible:{type:Boolean,default:!1}},data:function(){return{formLabelWidth:"134px",submitting:!1,formData:{currentPassword:"",newPassword:"",confirmPassword:""}}},computed:Object(F["a"])({},Object(U["d"])("user",["userInfo"])),methods:{initFormData:function(){this.formData.currentPassword="",this.formData.newPassword="",this.formData.confirmPassword=""},checkForm:function(){if(this.formData.currentPassword)if(this.formData.currentPassword.length<6||this.formData.currentPassword.length>14)this.$message.error(this.$t("Length should between 6 and 14"));else if(this.formData.newPassword)if(this.formData.newPassword.length<6||this.formData.newPassword.length>14)this.$message.error(this.$t("Length should between 6 and 14"));else if(this.formData.confirmPassword)if(this.formData.confirmPassword===this.formData.newPassword){if(Y(this.formData.newPassword))return!0;this.$message.error(this.$t("Alphanumeric, between 6 to 14 digits, cannot be too simple"))}else this.$message.error(this.$t("Confirm password is not match the new password"));else this.$message.error(this.$t("Please enter {0}",[this.$t("Confirm Password")]));else this.$message.error(this.$t("Please enter {0}",[this.$t("New Password")]));else this.$message.error(this.$t("Please enter {0}",[this.$t("Current Password")]))},closeModel:function(){this.showPasswordReset=!1,this.$emit("update:visible",!1)},updateVisible:function(e){this.$emit("update:visible",e)},submitForm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.checkForm()){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,e.submitting=!0,t.next=6,e.$api.common.passwordReset({email:e.userInfo&&e.userInfo.email,current_password:e.formData.currentPassword,changed_password:e.formData.newPassword,confirmed_password:e.formData.confirmPassword});case 6:e.updateVisible(!1),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](2),t.t0&&(a="",t.t0.changed_password&&t.t0.changed_password.length?a=e.$t(t.t0.changed_password[0]):t.t0.confirmed_password&&t.t0.confirmed_password.length?a=e.$t(t.t0.confirmed_password[0]):t.t0.current_password&&t.t0.current_password.length&&(a=e.$t(t.t0.current_password[0])),e.$message({type:"error",dangerouslyUseHTMLString:!0,message:a}));case 12:return t.prev=12,e.submitting=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[2,9,12,15]])})))()}},watch:{visible:function(e,t){e&&this.initFormData()}}},J=Q,X=Object(R["a"])(J,H,B,!1,null,null,null),Z=X.exports,ee=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"close-on-click-modal":!1,visible:e.visible,width:"600px","append-to-body":""},on:{"update:visible":e.updateVisible}},[e.timezone?a("div",{staticClass:"tz-list"},[e._v(" "+e._s(e.timezone.code)+" "+e._s(e.timezone.meta[e.lang])+" ")]):e._e()])},te=[],ae={props:{visible:{type:Boolean,default:!1}},data:function(){return{lang:"",submitting:!1,currentTimezone:null}},computed:Object(F["a"])({},Object(U["c"])("chatbotSetup",["timezone"])),methods:{updateVisible:function(e){this.$emit("update:visible",e)}},watch:{visible:function(e,t){e&&(this.lang=this.$env.getLocale(),this.timezone&&(this.currentTimezone=this.timezone.id))}}},ne=ae,re=Object(R["a"])(ne,ee,te,!1,null,null,null),oe=re.exports,ie=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"agent-stats"},[a("el-popover",{attrs:{placement:"bottom",width:"200",trigger:"click"},model:{value:e.isShowAgentPopover,callback:function(t){e.isShowAgentPopover=t},expression:"isShowAgentPopover"}},[a("div",{staticClass:"agent-select"},[a("el-input",{attrs:{size:"small",placeholder:"Name"},model:{value:e.agentSearchWords,callback:function(t){e.agentSearchWords=t},expression:"agentSearchWords"}}),a("div",{staticClass:"agent-list"},e._l(e.filteredAgents,(function(t){return a("div",{key:t.id,staticClass:"agent-list-item",on:{click:function(a){return e.onAgentItemClick(t)}}},[e._v(" "+e._s(t.first_name)+" "+e._s(t.last_name)+" ")])})),0)],1),a("div",{attrs:{slot:"reference"},slot:"reference"},[a("div",{staticClass:"stats-item online-agent",class:{active:e.filterAgent},on:{click:function(t){return t.stopPropagation(),e.onFilterAgentClick.apply(null,arguments)}}},[a("div",{staticClass:"stats-num"},[e._v(" "+e._s(e.stats.agent)+" ")]),a("div",{staticClass:"stats-desc"},[a("span",{domProps:{innerHTML:e._s(e.$t("Online
Agent"))}})])])])]),a("el-tooltip",{attrs:{disabled:e.currentStats!==e.STATS_TYPES.STARTED_CHATBOT,content:"Filter status",placement:"bottom"}},[a("div",{staticClass:"stats-item started-chatbot",class:{active:e.currentStats===e.STATS_TYPES.STARTED_CHATBOT},on:{click:function(t){return e.onStatsClick(e.STATS_TYPES.STARTED_CHATBOT)}}},[a("div",{staticClass:"stats-num"},[e._v(" "+e._s(e.stats.green)+" ")]),a("div",{staticClass:"stats-desc"},[a("span",{domProps:{innerHTML:e._s(e.$t("Started
Chatbot"))}})])])]),a("el-tooltip",{attrs:{disabled:e.currentStats!==e.STATS_TYPES.AI_HANDLING,content:"Filter status",placement:"bottom"}},[a("div",{staticClass:"stats-item ai-handling",class:{active:e.currentStats===e.STATS_TYPES.AI_HANDLING},on:{click:function(t){return e.onStatsClick(e.STATS_TYPES.AI_HANDLING)}}},[a("div",{staticClass:"stats-num"},[e._v(" "+e._s(e.stats.purple)+" ")]),a("div",{staticClass:"stats-desc"},[a("span",{domProps:{innerHTML:e._s(e.$t("AI
Handling"))}})])])]),a("el-tooltip",{attrs:{disabled:e.currentStats!==e.STATS_TYPES.AGENT_HANDLING,content:"Filter status",placement:"bottom"}},[a("div",{staticClass:"stats-item agent-handling",class:{active:e.currentStats===e.STATS_TYPES.AGENT_HANDLING},on:{click:function(t){return e.onStatsClick(e.STATS_TYPES.AGENT_HANDLING)}}},[a("div",{staticClass:"stats-num"},[e._v(" "+e._s(e.stats.yellow)+" ")]),a("div",{staticClass:"stats-desc"},[a("span",{domProps:{innerHTML:e._s(e.$t("Agent
Handling"))}})])])]),a("el-tooltip",{attrs:{disabled:e.currentStats!==e.STATS_TYPES.REQUEST_AGENT,content:"Filter status",placement:"bottom"}},[a("div",{staticClass:"stats-item request-agent",class:{active:e.currentStats===e.STATS_TYPES.REQUEST_AGENT},on:{click:function(t){return e.onStatsClick(e.STATS_TYPES.REQUEST_AGENT)}}},[a("div",{staticClass:"stats-num"},[e._v(" "+e._s(e.stats.red)+" ")]),a("div",{staticClass:"stats-desc"},[a("span",{domProps:{innerHTML:e._s(e.$t("Request
Agent"))}})])])])],1)},se=[],le=(a("4de4"),{ONLINE_AGENT:"ONLINE_AGENT",STARTED_CHATBOT:"STARTED_CHATBOT",AI_HANDLING:"AI_HANDLING",AGENT_HANDLING:"AGENT_HANDLING",REQUEST_AGENT:"REQUEST_AGENT"}),ce={ID:"ID",CLIENT:"Client",MESSAGE:"Message",TAG:"Tag"},ue={DFT:"Draft",ACT:"Show",REV:"Review",DCT:"Hide",SDT:"Sold Out",EXP:"Expired",ACT_ADS:"Exclusive",DCT_ADS:"Deactivated Ads",DET:"Delete"},de={TKT:"Ticket",TOR:"Tour",RNT:"Rental",LGG:"Luggage",DEI:"Delivery",ACM:"Hotel",RTR:"Restaurant"},pe={Ticket:"TKT",Tour:"TOR",Rental:"RNT",Luggage:"LGG",Delivery:"DEI",Hotel:"ACM",Restaurant:"RTR"},me={EC:"E-Code",EP:"Voucher",PA:"Paper",CD:"Code",ETC:"Others",DEI:"Delivery2"},fe={0:"Payment Waiting",1:"Payment Completed",2:"Reservation Declined",3:"Refund Waiting",4:"Refund Completed",5:"Refund Declined",6:"Partial Refund Waiting",7:"Partial Refund Completed",8:"Partial Refund Decline"},ge={0:"Payment processing",1:"Payment declined",2:"Order info requested",3:"Order waiting",4:"Order processing",5:"Order completed",6:"Order failed",7:"Refund requested",8:"Refund processing",9:"Refund confirmation",10:"Refund completed",11:"Refund declined",12:"Refund error"},he={booking_id:"Booking ID",id:"Payment ID",product_id:"Product ID",product_sn:"Product SN",product_name__icontains:"Product name"},_e={meta__user_name__icontains:"Name",meta__user_email__icontains:"Email",meta__user_phone__icontains:"Phone number",user__name__icontains:"User name",user__email__icontains:"User email",user__phone__icontains:"User phone number",supplier_product_sn:"Supplier product SN",track_number:"Tracking number"},ve={ACT:"Available",DCT:"Expired",RMD:"Redeemed",RFD:"Refunded",FRZ:"Frozen"},be={ACT:"Valid",DCT:"Invalid",REV:"Review"},ye={ACT:"Valid",DCT:"Invalid",USD:"Used",FRZ:"Frozen"},Ce={code:"Code",name:"Name",id:"Batch id",create_agent:"Creater",coupon_id:"Coupon id",user_id:"User id",user_email:"User email",user_phone:"User phone"},ke={coupon_id:"Coupon id",order_id:"Order ID",user_id:"User id",user_email:"User email",user_phone:"User phone"},we={0:"Discount amount",1:"Percentage"},$e={HKD:"HKD",TWD:"TWD",USD:"USD",CNY:"CNY",KRW:"KRW"},Se={0:"No limit",1:"Specific amount",2:"Specific quantity"},xe={0:"All",2:"Specific type/category",1:"Specific product"},Te={0:"No limit",1:"Limit number"},De={0:"Specific days",1:"Specific peroid"},Pe={0:"General code",1:"8 random code",2:"12 random code"},Oe={"Main Page":0,Restaurant:1,Delivery:2},Ie={Product:0,Restaurant:1,Delivery:2},Re={0:"Specific period",1:"Specific date",2:"Specific time"},Ee={create:"create",update:"update",delete:"delete"},Me={coupon:"coupon",product:"product",order:"order",tagsystem:"tagsystem",poi:"poi"},Ne={TV:"Travel",EC:"E-Commerce"},je={0:"EMPTY",1:"NATIVE_WC",2:"JSAPI_WC",3:"APP_WC",4:"FACEBOOK_WD",5:"WEB_ALIPAY",6:"WAP_ALIPAY",7:"WEB_PAYPAL",8:"SAMSUNG_RCS",9:"WEB_ALIPAYHK",10:"WAP_ALIPAYHK",11:"PAYME"},Ae={DFT:"Draft",ACT:"Show",REV:"Review",DCT:"Hide",EXP:"Expired",ACT_ADS:"Exclusive",DCT_ADS:"Deactivated Ads"},Le={wechatpay:"WeChat pay","wechatpay-oa":"WeChat official account","wechatpay-mp":"WeChat mini program","alipay-web":"Alipay web","alipay-wap":"Alipay mobile","alipayhk-web":"Alipay HK web","alipayhk-wap":"Alipay HK mobile",paypal:"Paypal",payme:"Payme","stripe-card":"Credit card"},Fe={ACT:"Valid",DCT:"Invalid",EXP:"Expired"},Ue={ACT:"Active",USD:"Used",DCT:"Deactivated"},ze={0:"Produdct",1:"One Image",2:"Two Images",3:"Three Images"},qe={name:"Promotion name",point_id:"Promotion ID",create_agent:"Creater",booking_sn:"Booking ID",payment_sn:"Payment ID",product_id:"Product ID",point_promo:"Right ID"},He={1:"Payment Incomplete",2:"Send Processing",3:"Send Success",4:"Send Fail"},Be={data:function(){return{STATS_TYPES:le,agentSearchWords:"",isShowAgentPopover:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{agents:function(e){return e.agents},stats:function(e){return e.stats},currentStats:function(e){return e.currentStats},filterAgent:function(e){return e.filterAgent}})),{},{filteredAgents:function(){var e=this;return this.agentSearchWords?this.agents.filter((function(t){return"".concat(t.first_name," ").concat(t.last_name).toLowerCase().indexOf(e.agentSearchWords.toLowerCase())>-1})):this.agents}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["getStats","setCurrentStats","setFilterAgent","getAllAgents"])),{},{onStatsClick:function(e){e===this.currentStats?this.setCurrentStats(null):this.setCurrentStats(e)},onFilterAgentClick:function(){this.isShowAgentPopover?this.isShowAgentPopover=!1:this.filterAgent?(this.setFilterAgent(null),this.setCurrentStats(null)):(this.getAllAgents(),this.isShowAgentPopover=!0)},onAgentItemClick:function(e){this.setCurrentStats(le.ONLINE_AGENT),this.setFilterAgent(e),this.isShowAgentPopover=!1}}),created:function(){this.getStats()}},Ke=Be,Ve=(a("02fb9"),Object(R["a"])(Ke,ie,se,!1,null,"43808b22",null)),Ye=Ve.exports,We={components:{DialogPasswordReset:Z,DialogTimezoneSelector:oe,AppTopLeftNav:Ye},data:function(){return{pwdResetDialogVisible:!1,tzSelectorDialogVisible:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("user",["userInfo"])),Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["platforms"])),{},{userName:function(){return this.userInfo?"".concat(this.userInfo.first_name," ").concat(this.userInfo.last_name):""},platformValue:function(){var e=this;return null!==this.platform&&void 0!==this.platform?this.platforms.find((function(t){return t.code===e.platform})).value:""},hidePlatform:function(){var e=this;return["/product-manage","/poi","/tag-manage","/financial","/order-manage","/marketing","/operation-center","/booking-code"].some((function(t){return e.$route.path.indexOf(t)>-1}))}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("chatbotSetup",["updatePlatform"])),{},{onSettingCommand:function(e){switch(e){case"en_US":case"zh_HK":case"zh_CN":this.changeLanguage(e);break;case"PasswordReset":this.pwdResetDialogVisible=!0;break;case"Timezone":this.tzSelectorDialogVisible=!0;break;case"Logout":window.localStorage.removeItem("token"),window.localStorage.removeItem("vendor"),window.localStorage.removeItem("uid"),window.location.href="/auth/login";break;default:break}},changeLanguage:function(e){this.$i18n.locale=e,this.$env.setLocale(e)},onPlatformSelected:function(e){e!==this.platform&&this.updatePlatform(e)}})},Ge=We,Qe=(a("b025"),Object(R["a"])(Ge,z,q,!1,null,"4cc7fb6b",null)),Je=Qe.exports,Xe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-side-nav",style:e.style},[a("div",{staticClass:"logo"},[e.isAppSideNavCollapse?a("div",{staticClass:"small",style:{backgroundImage:"url("+e.log+")"}}):a("div",{staticClass:"normal",style:{backgroundImage:"url("+e.log+")"}})]),a("div",{staticClass:"side-nav-menus"},[e.availableServices&&!e.isTopas?a("el-menu",{attrs:{"default-active":e.activeRoute,"background-color":"#161D28","text-color":"#9B9B9B","unique-opened":"",router:"",collapse:e.isAppSideNavCollapse}},[a("el-submenu",{attrs:{index:"Chatbot"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-message"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Chatbot")))])]),e.availableServices.faq?a("el-menu-item",{attrs:{index:"Faq",route:{name:"Faq"}}},[e._v(e._s(e.$t("sidebar.FAQ")))]):e._e(),e.availableServices.message_center?a("el-menu-item",{attrs:{index:"MessageCenter",route:{name:"MessageCenter"}}},[e._v(e._s(e.$t("sidebar.Message record")))]):e._e(),e.availableServices.chatbot_setting?a("el-menu-item",{attrs:{index:"ChatbotSetupBasic",route:{name:"ChatbotSetupBasic"}}},[e._v(e._s(e.$t("sidebar.AI setting")))]):e._e()],2),e.availableServices.agent_platform?a("el-menu-item",{attrs:{index:"Agent",route:{name:"Agent"}}},[a("i",{staticClass:"iconfont icon-pongo"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Agent platform")))])]):e._e(),e.availableServices.order_management?a("el-submenu",{attrs:{index:"OrderManage"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-order"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Order Mgmt")))])]),a("el-menu-item",{attrs:{index:"Orders",route:{name:"Orders"}}},[e._v(e._s(e.$t("sidebar.Travel and goods")))]),a("el-menu-item",{attrs:{index:"ReservationList",route:{name:"ReservationList"}}},[e._v(e._s(e.$t("sidebar.Rest reserve")))]),a("el-menu-item",{attrs:{index:"BookingCodeList",route:{name:"BookingCodeIndex"}}},[e._v(e._s(e.$t("sidebar.Rest E-code")))])],2):e._e(),e.availableServices.ec_product_uploader||e.availableServices.restaurant_order_management?a("el-submenu",{attrs:{index:"ProductManage"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-TF_icon_product"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Product Mgmt")))])]),e.availableServices.ec_product_uploader?a("el-menu-item",{attrs:{index:"TravelAndDelivery",route:{name:"TravelAndDelivery"}}},[e._v(e._s(e.$t("sidebar.Travel / Shopping")))]):e._e(),e.availableServices.restaurant_order_management?a("el-menu-item",{attrs:{index:"RestaurantProduct",route:{name:"RestaurantProduct"}}},[e._v(e._s(e.$t("sidebar.Restaurant")))]):e._e(),e.availableServices.ec_product_uploader?a("el-menu-item",{attrs:{index:"BulkUpload",route:{name:"BulkUpload"}}},[e._v(e._s(e.$t("Bulk upload")))]):e._e()],2):e._e(),e.availableServices.marketing_management?a("el-submenu",{attrs:{index:"OperationCenter"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-menu-icon"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Op center")))])]),a("el-menu-item",{attrs:{index:"OperationMKPHomepage",route:{name:"OperationMKPHomepage"}}},[e._v(e._s(e.$t("sidebar.MKP homepage")))]),a("el-menu-item",{attrs:{index:"OperationRestChannel",route:{name:"OperationRestChannel"}}},[e._v(e._s(e.$t("sidebar.Rest channel")))]),a("el-menu-item",{attrs:{index:"OperationDeliveryChannel",route:{name:"OperationDeliveryChannel"}}},[e._v(e._s(e.$t("sidebar.Shopping channel")))])],2):e._e(),e.availableServices.point_of_intest?a("el-menu-item",{attrs:{index:"PoiList",route:{name:"Poi"}}},[a("i",{staticClass:"iconfont icon-TF_icon_POI"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.POI")))])]):e._e(),e.availableServices.tag_management?a("el-menu-item",{attrs:{index:"TagManageBasic",route:{name:"TagManage"}}},[a("i",{staticClass:"iconfont icon-tag"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Tag Mgmt")))])]):e._e(),e.availableServices.currency_setting?a("el-submenu",{attrs:{index:"Financial"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-Dollar_financial"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Revenue Mgmt")))])]),a("el-menu-item",{attrs:{index:"FinancialCurrency",route:{name:"FinancialCurrency"}}},[e._v(e._s(e.$t("sidebar.Currency")))])],2):e._e(),e.availableServices.coupon_management?a("el-submenu",{attrs:{index:"Marketing"}},[a("template",{slot:"title"},[a("i",{staticClass:"iconfont icon-martketingmanagement"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("sidebar.Marketing")))])]),a("el-menu-item",{attrs:{index:"CouponList",route:{name:"CouponList"}}},[e._v(e._s(e.$t("sidebar.Coupon")))]),a("el-menu-item",{attrs:{index:"EventList",route:{name:"EventList"}}},[e._v(e._s(e.$t("sidebar.Event")))]),a("el-menu-item",{attrs:{index:"PromotionList",route:{name:"PromotionList"}}},[e._v(e._s(e.$t("Mylink Promotion")))])],2):e._e()],1):e._e(),e.isTopas?a("el-menu",{attrs:{"default-active":e.activeRoute,"background-color":"#161D28","text-color":"#9B9B9B",router:"",collapse:e.isAppSideNavCollapse}},[a("el-menu-item",{attrs:{index:"OrderManage",route:{name:"OrderManage"}}},[a("i",{staticClass:"iconfont icon-order"}),a("span",{attrs:{slot:"title"},slot:"title"},[e._v("Order Management")])])],1):e._e()],1),a("div",{staticClass:"toggle-button",on:{click:e.toggleClick}},[e.isAppSideNavCollapse?a("i",{staticClass:"el-icon-d-arrow-right"}):a("i",{staticClass:"el-icon-d-arrow-left"})])])},Ze=[],et=a("ffba"),tt=a.n(et),at={data:function(){return{log:tt.a}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("user",["userInfo"])),Object(U["d"])(["isAppSideNavCollapse"])),Object(U["c"])({availableServices:"chatbotSetup/availableServices"})),{},{style:function(){var e="230px";return this.isAppSideNavCollapse&&(e="64px"),{width:e}},activeRoute:function(){var e="";return this.$route.matched.length>0&&(e=this.$route.matched[this.$route.matched.length-1].name),["OperationMKPHomepage","OperationBannerMKPHomepage"].indexOf(e)>-1&&(e="OperationMKPHomepage"),["OperationRestChannel","OperationRestPromotion","OperationRestThemeList","OperationBannerRestChannel","OperationRestBottomTag"].indexOf(e)>-1&&(e="OperationRestChannel"),["OperationDeliveryChannel","OperationDeliveryPromotion","OperationDeliveryThemeList","OperationBannerDeliveryChannel","OperationDeliveryBottomTag"].indexOf(e)>-1&&(e="OperationDeliveryChannel"),"FinancialCurrencyEdit"===e&&(e="FinancialCurrency"),["CouponAdd","CouponInfo"].indexOf(e)>-1&&(e="CouponList"),["EventEdit"].indexOf(e)>-1&&(e="EventList"),["PromotionInfo","PromotionAdd"].indexOf(e)>-1&&(e="PromotionList"),["PoiInformation"].indexOf(e)>-1&&(e="PoiList"),["RestaurantProductInfo"].indexOf(e)>-1&&(e="RestaurantProduct"),["Operation"].indexOf(e)>-1&&(e="TravelAndDelivery"),["OrderDetail"].indexOf(e)>-1&&(e="Orders"),e},isTopas:function(){return this.userInfo&&"topas"===this.userInfo.vendor}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])(["toggleAppSideNavCollapse"])),{},{toggleClick:function(){this.toggleAppSideNavCollapse()}})},nt=at,rt=(a("6b3d"),Object(R["a"])(nt,Xe,Ze,!1,null,"ac0a6bb4",null)),ot=rt.exports,it={components:{AppSideNav:ot,AppTopBar:Je},data:function(){return{authChecked:!1}},computed:{hideTopbar:function(){return this.$route.meta&&this.$route.meta.hideTopbar}},methods:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["b"])(["getCountries"])),Object(U["b"])("user",["getUserInfo"])),Object(U["b"])("chatbotSetup",["getSettings"])),{},{checkUserAuth:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getUserInfo();case 3:return t.next=5,e.getSettings();case 5:e.authChecked=!0,t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),e.$route.name?window.location.href="/auth/login?refer=".concat(encodeURIComponent(e.$route.fullPath)):window.location.href="/auth/login";case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))()}}),created:function(){this.checkUserAuth(),this.getCountries()}},st=it,lt=(a("bf60"),Object(R["a"])(st,j,A,!1,null,"9b567c6c",null)),ct=lt.exports,ut=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"home"})},dt=[],pt=(a("5319"),{computed:Object(F["a"])({},Object(U["d"])("user",["userInfo"])),mounted:function(){this.userInfo&&"topas"===this.userInfo.vendor?this.$router.replace({name:"OrderManage"}):this.$router.replace({name:"Faq"})}}),mt=pt,ft=Object(R["a"])(mt,ut,dt,!1,null,null,null),gt=ft.exports,ht=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"chatbot-setup"},[a("div",{staticClass:"inner"},[a("div",{staticClass:"navigations"},[a("router-link",{attrs:{"active-class":"active",to:{name:"ChatbotSetupBasic"}}},[e._v(e._s(e.$t("Basic setting")))]),a("router-link",{attrs:{"active-class":"active",to:{name:"ChatbotSetupFunctions"}}},[e._v(e._s(e.$t("Function setting")))]),a("router-link",{attrs:{"active-class":"active",to:{name:"ChatbotSetupBanner"}}},[e._v(e._s(e.$t("Chatroom banner")))]),a("router-link",{attrs:{"active-class":"active",to:{name:"ChatbotSetupAgent"}}},[e._v(e._s(e.$t("Agent setting")))]),a("router-link",{attrs:{"active-class":"active",to:{name:"ChatbotSetupFnRule"}}},[e._v(e._s(e.$t("Function rules")))])],1),a("div",{staticClass:"page-content"},[a("router-view")],1)])])},_t=[],vt=(a("3a38"),{}),bt=Object(R["a"])(vt,ht,_t,!1,null,"6e76957e",null),yt=bt.exports,Ct=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"basic-setting"},[e.isEditMode?a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",on:{click:e.onSaveClick}},[e._v(e._s(e.$t("Save")))]),a("button",{on:{click:e.onCancelClick}},[e._v(e._s(e.$t("Cancel")))])]):a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",attrs:{disabled:!e.welcomeMessage&&!e.unknownMessage&&!e.csMessage},on:{click:e.onEditClick}},[e._v(e._s(e.$t("Edit")))])]),a("div",{staticClass:"title"},[a("span",[e._v(e._s(e.$t("Welcome message")))]),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$t("Once user came in, chatbot will sent this automatically."),placement:"right"}},[a("span",{staticClass:"iconfont icon-info"})])],1),a("div",{staticClass:"message-settings"},[e.languages.en_US?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.en_US")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.welcomeMsgModel.en_US,expression:"welcomeMsgModel.en_US"}],attrs:{disabled:!e.welcomeMessage},domProps:{value:e.welcomeMsgModel.en_US},on:{input:function(t){t.target.composing||e.$set(e.welcomeMsgModel,"en_US",t.target.value)}}}):a("span",[e._v(e._s(e.welcomeMsgModel.en_US))])])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_CN")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.welcomeMsgModel.zh_CN,expression:"welcomeMsgModel.zh_CN"}],attrs:{disabled:!e.welcomeMessage},domProps:{value:e.welcomeMsgModel.zh_CN},on:{input:function(t){t.target.composing||e.$set(e.welcomeMsgModel,"zh_CN",t.target.value)}}}):a("span",[e._v(e._s(e.welcomeMsgModel.zh_CN))])])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_HK")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.welcomeMsgModel.zh_HK,expression:"welcomeMsgModel.zh_HK"}],attrs:{disabled:!e.welcomeMessage},domProps:{value:e.welcomeMsgModel.zh_HK},on:{input:function(t){t.target.composing||e.$set(e.welcomeMsgModel,"zh_HK",t.target.value)}}}):a("span",[e._v(e._s(e.welcomeMsgModel.zh_HK))])])]):e._e()]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Unknown reply"))+" "),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$t("When AI does not understand, will reply this."),placement:"right"}},[a("span",{staticClass:"iconfont icon-info"})])],1),a("div",{staticClass:"message-settings"},[e.languages.en_US?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.en_US")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.unknownMsgModel.en_US,expression:"unknownMsgModel.en_US"}],attrs:{disabled:!e.unknownMessage},domProps:{value:e.unknownMsgModel.en_US},on:{input:function(t){t.target.composing||e.$set(e.unknownMsgModel,"en_US",t.target.value)}}}):a("span",[e._v(e._s(e.unknownMsgModel.en_US))])])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_CN")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.unknownMsgModel.zh_CN,expression:"unknownMsgModel.zh_CN"}],attrs:{disabled:!e.unknownMessage},domProps:{value:e.unknownMsgModel.zh_CN},on:{input:function(t){t.target.composing||e.$set(e.unknownMsgModel,"zh_CN",t.target.value)}}}):a("span",[e._v(e._s(e.unknownMsgModel.zh_CN))])])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_HK")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.unknownMsgModel.zh_HK,expression:"unknownMsgModel.zh_HK"}],attrs:{disabled:!e.unknownMessage},domProps:{value:e.unknownMsgModel.zh_HK},on:{input:function(t){t.target.composing||e.$set(e.unknownMsgModel,"zh_HK",t.target.value)}}}):a("span",[e._v(e._s(e.unknownMsgModel.zh_HK))])])]):e._e()]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Agent online auto reply"))+" ")]),a("div",{staticClass:"message-settings"},[e.languages.en_US?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.en_US")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.en_US.online,expression:"csMsgModel.en_US.online"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.en_US.online},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.en_US,"online",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.en_US.online))])])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_CN")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.zh_CN.online,expression:"csMsgModel.zh_CN.online"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.zh_CN.online},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.zh_CN,"online",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.zh_CN.online))])])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_HK")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.zh_HK.online,expression:"csMsgModel.zh_HK.online"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.zh_HK.online},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.zh_HK,"online",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.zh_HK.online))])])]):e._e()]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Agent offline auto reply"))+" ")]),a("div",{staticClass:"message-settings"},[e.languages.en_US?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.en_US")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.en_US.offline,expression:"csMsgModel.en_US.offline"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.en_US.offline},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.en_US,"offline",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.en_US.offline))])])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_CN")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.zh_CN.offline,expression:"csMsgModel.zh_CN.offline"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.zh_CN.offline},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.zh_CN,"offline",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.zh_CN.offline))])])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"message-item"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_HK")))]),a("span",{staticClass:"required"},[e._v("*")])]),a("div",{staticClass:"message-content"},[e.isEditMode?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.csMsgModel.zh_HK.offline,expression:"csMsgModel.zh_HK.offline"}],attrs:{disabled:!e.csMessage},domProps:{value:e.csMsgModel.zh_HK.offline},on:{input:function(t){t.target.composing||e.$set(e.csMsgModel.zh_HK,"offline",t.target.value)}}}):a("span",[e._v(e._s(e.csMsgModel.zh_HK.offline))])])]):e._e()])])},kt=[],wt=a("53ca"),$t=(a("159b"),a("b64b"),a("e9c4"),{data:function(){return{isEditMode:!1,welcomeMsgModel:{en_US:"",zh_CN:"",zh_HK:""},unknownMsgModel:{en_US:"",zh_CN:"",zh_HK:""},csMsgModel:{en_US:{offline:"",online:""},zh_CN:{offline:"",online:""},zh_HK:{offline:"",online:""}},pending:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["welcomeMessage","unknownMessage","csMessage","languages"])),mounted:function(){this.syncWelcomeMessage(),this.syncUnknownMessage(),this.syncCsMessage()},watch:{platform:function(){this.isEditMode=!1,this.syncWelcomeMessage(),this.syncUnknownMessage(),this.syncCsMessage()}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("chatbotSetup",["updateWelcomeMessageTemplate","updateUnknownMessageTemplate","updateCsMessageTemplate"])),{},{syncWelcomeMessage:function(){var e={en_US:"",zh_CN:"",zh_HK:""};this.welcomeMessage?Object.assign(this.welcomeMsgModel,e,this.welcomeMessage.meta):Object.assign(this.welcomeMsgModel,e)},syncUnknownMessage:function(){var e=this,t={en_US:"",zh_CN:"",zh_HK:""};this.unknownMessage?Object.assign(this.unknownMsgModel,t,this.unknownMessage.meta):Object.assign(this.unknownMsgModel,t),Object.keys(this.unknownMsgModel).forEach((function(t){"object"===Object(wt["a"])(e.unknownMsgModel[t])&&(e.unknownMsgModel[t]=JSON.stringify(e.unknownMsgModel[t]))}))},syncCsMessage:function(){var e=this,t={en_US:{offline:"",online:""},zh_CN:{offline:"",online:""},zh_HK:{offline:"",online:""}};Object.keys(this.languages).forEach((function(a){e.csMessage?Object.assign(e.csMsgModel[a],t[a],e.csMessage.meta[a]):Object.assign(e.csMsgModel[a],t[a]),"object"===Object(wt["a"])(e.csMsgModel[a].offline)&&(e.csMsgModel[a].offline=JSON.stringify(e.csMsgModel[a].offline)),"object"===Object(wt["a"])(e.csMsgModel[a].online)&&(e.csMsgModel[a].online=JSON.stringify(e.csMsgModel[a].online))}))},onEditClick:function(){this.isEditMode=!0},onCancelClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$confirm(e.$t("Sure to cancel?"),"",{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),type:"warning"});case 2:e.syncWelcomeMessage(),e.syncUnknownMessage(),e.syncCsMessage(),e.isEditMode=!1;case 6:case"end":return t.stop()}}),t)})))()},onSaveClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.languages.zh_CN){t.next=16;break}if(e.welcomeMsgModel.zh_CN){t.next=4;break}return e.$message.error("".concat(e.$t("Please enter welcome message"),"(").concat(e.$t("lang.zh_CN"),")")),t.abrupt("return");case 4:if(e.unknownMsgModel.zh_CN){t.next=7;break}return e.$message.error("".concat(e.$t("Please enter unknown reply"),"(").concat(e.$t("lang.zh_CN"),")")),t.abrupt("return");case 7:if(e.unknownMsgModel.zh_CN){t.next=10;break}return e.$message.error("".concat(e.$t("Please enter unknown reply"),"(").concat(e.$t("lang.zh_CN"),")")),t.abrupt("return");case 10:if(e.csMsgModel.zh_CN.offline){t.next=13;break}return e.$message.error("".concat(e.$t("Please enter agent offline auto reply"),"(").concat(e.$t("lang.zh_CN"),")")),t.abrupt("return");case 13:if(e.csMsgModel.zh_CN.online){t.next=16;break}return e.$message.error("".concat(e.$t("Please enter agent online auto reply"),"(").concat(e.$t("lang.zh_CN"),")")),t.abrupt("return");case 16:if(!e.languages.en_US){t.next=29;break}if(e.welcomeMsgModel.en_US){t.next=20;break}return e.$message.error("".concat(e.$t("Please enter welcome message"),"(").concat(e.$t("lang.en_US"),")")),t.abrupt("return");case 20:if(e.unknownMsgModel.en_US){t.next=23;break}return e.$message.error("".concat(e.$t("Please enter unknown reply"),"(").concat(e.$t("lang.en_US"),")")),t.abrupt("return");case 23:if(e.csMsgModel.en_US.offline){t.next=26;break}return e.$message.error("".concat(e.$t("Please enter agent offline auto reply"),"(").concat(e.$t("lang.en_US"),")")),t.abrupt("return");case 26:if(e.csMsgModel.en_US.online){t.next=29;break}return e.$message.error("".concat(e.$t("Please enter agent online auto reply"),"(").concat(e.$t("lang.en_US"),")")),t.abrupt("return");case 29:if(!e.languages.zh_HK){t.next=42;break}if(e.welcomeMsgModel.zh_HK){t.next=33;break}return e.$message.error("".concat(e.$t("Please enter welcome message"),"(").concat(e.$t("lang.zh_HK"),")")),t.abrupt("return");case 33:if(e.unknownMsgModel.zh_HK){t.next=36;break}return e.$message.error("".concat(e.$t("Please enter unknown reply"),"(").concat(e.$t("lang.zh_HK"),")")),t.abrupt("return");case 36:if(e.csMsgModel.zh_HK.offline){t.next=39;break}return e.$message.error("".concat(e.$t("Please enter agent offline auto reply"),"(").concat(e.$t("lang.zh_HK"),")")),t.abrupt("return");case 39:if(e.csMsgModel.zh_HK.online){t.next=42;break}return e.$message.error("".concat(e.$t("Please enter agent online auto reply"),"(").concat(e.$t("lang.zh_HK"),")")),t.abrupt("return");case 42:return t.prev=42,a={},n={},r={},Object.keys(e.languages).forEach((function(t){a[t]=e.welcomeMsgModel[t],n[t]=e.unknownMsgModel[t],r[t]=e.csMsgModel[t];try{n[t]=JSON.parse(n[t]),r[t].offline=JSON.parse(r[t].offline),r[t].online=JSON.parse(r[t].online)}catch(o){}})),t.next=49,e.updateWelcomeMessageTemplate({meta:a});case 49:return t.next=51,e.updateUnknownMessageTemplate({meta:n});case 51:return t.next=53,e.updateCsMessageTemplate({meta:r});case 53:e.$message.success(e.$t("Save successfully")),e.isEditMode=!1,t.next=60;break;case 57:t.prev=57,t.t0=t["catch"](42),e.$message.error(e.$t("Save failed"));case 60:case"end":return t.stop()}}),t,null,[[42,57]])})))()}})}),St=$t,xt=(a("7625"),Object(R["a"])(St,Ct,kt,!1,null,"c3681876",null)),Tt=xt.exports,Dt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"banner-setting"},[a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Banner"))+" "),a("div",{staticClass:"suggest-size"},[e._v(" "+e._s(e.$t("Suggest size 748 x 260px"))+" ")])]),e.languages.en_US?a("div",{staticClass:"banner-image-setting"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.en_US")))])]),a("div",{staticClass:"banner-image"},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isUploading.en_US,expression:"isUploading.en_US"}],staticClass:"image-viewer",class:{"no-image":!e.enUsBanner&&!e.isUploading.en_US},style:e.enUsImageViewerStyle,on:{click:function(t){return e.onViewerClick("en_US")}}}),a("div",{staticClass:"image-actions"},[a("button",{staticClass:"primary",on:{click:function(t){return e.onUploadClick("en_US")}}},[e._v(e._s(e.$t("Upload")))]),a("button",{on:{click:function(t){return e.onRemoveClick("en_US")}}},[e._v(e._s(e.$t("Remove")))])])])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"banner-image-setting"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_CN")))])]),a("div",{staticClass:"banner-image"},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isUploading.zh_CN,expression:"isUploading.zh_CN"}],staticClass:"image-viewer",class:{"no-image":!e.zhCnBanner&&!e.isUploading.zh_CN},style:e.zhCnImageViewerStyle,on:{click:function(t){return e.onViewerClick("zh_CN")}}}),a("div",{staticClass:"image-actions"},[a("button",{staticClass:"primary",on:{click:function(t){return e.onUploadClick("zh_CN")}}},[e._v(e._s(e.$t("Upload")))]),a("button",{on:{click:function(t){return e.onRemoveClick("zh_CN")}}},[e._v(e._s(e.$t("Remove")))])])])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"banner-image-setting"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("lang.zh_HK")))])]),a("div",{staticClass:"banner-image"},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isUploading.zh_HK,expression:"isUploading.zh_HK"}],staticClass:"image-viewer",class:{"no-image":!e.zhHkBanner&&!e.isUploading.zh_HK},style:e.zhHkImageViewerStyle,on:{click:function(t){return e.onViewerClick("zh_HK")}}}),a("div",{staticClass:"image-actions"},[a("button",{staticClass:"primary",on:{click:function(t){return e.onUploadClick("zh_HK")}}},[e._v(e._s(e.$t("Upload")))]),a("button",{on:{click:function(t){return e.onRemoveClick("zh_HK")}}},[e._v(e._s(e.$t("Remove")))])])])]):e._e(),a("div",{staticClass:"banner-image-setting"},[a("div",{staticClass:"label"},[a("span",[e._v(e._s(e.$t("Trigger Link")))])]),a("div",{staticClass:"trigger-link"},[a("div",{staticClass:"link-input"},[a("el-input",{model:{value:e.redirectUrlModel,callback:function(t){e.redirectUrlModel=t},expression:"redirectUrlModel"}},[a("template",{slot:"prepend"},[e._v("https://")])],2)],1),a("div",{staticClass:"image-actions"},[a("button",{staticClass:"primary",on:{click:function(t){return e.onSaveRedirectUrlClick()}}},[e._v(e._s(e.$t("Save")))])])])]),a("input",{ref:"imageFileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*"},on:{change:e.onImageFileChange}})])},Pt=[],Ot=a("ade3"),It={data:function(){return{bannerLang:null,isUploading:{en_US:!1,zh_CN:!1,zh_HK:!1},redirectUrlModel:""}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])("chatbotSetup",["banner","languages"])),{},{redirectUrl:function(){return this.banner?this.banner.direct_url:null},enUsBanner:function(){return this.banner?this.banner.meta.en_US:null},zhCnBanner:function(){return this.banner?this.banner.meta.zh_CN:null},zhHkBanner:function(){return this.banner?this.banner.meta.zh_HK:null},enUsImageViewerStyle:function(){return this.enUsBanner?{backgroundImage:'url("'.concat(this.enUsBanner,'")')}:null},zhCnImageViewerStyle:function(){return this.zhCnBanner?{backgroundImage:'url("'.concat(this.zhCnBanner,'")')}:null},zhHkImageViewerStyle:function(){return this.zhHkBanner?{backgroundImage:'url("'.concat(this.zhHkBanner,'")')}:null}}),mounted:function(){this.redirectUrlModel=this.redirectUrl.replace(/https?:\/\//g,"")},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("chatbotSetup",["updateBanner"])),{},{onViewerClick:function(e){this.banner&&this.banner.meta[e]||this.onUploadClick(e)},onSaveRedirectUrlClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.redirectUrlModel){t.next=3;break}return e.$message.error(e.$t("Please enter trigger link")),t.abrupt("return");case 3:if(/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/.test(e.redirectUrlModel)){t.next=6;break}return e.$message.error(e.$t("Please enter the valid link")),t.abrupt("return");case 6:return t.prev=6,t.next=9,e.updateBanner(Object.assign({},e.banner,{direct_url:"https://"+e.redirectUrlModel}));case 9:e.$message.success(e.$t("Save successfully")),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](6),e.$message.error(e.$t("Save failed"));case 15:case"end":return t.stop()}}),t,null,[[6,12]])})))()},onUploadClick:function(e){this.bannerLang=e,this.$refs.imageFileInput.click()},onRemoveClick:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,n=Object.assign({},t.banner.meta,Object(Ot["a"])({},e,null)),a.next=4,t.updateBanner(Object.assign({},t.banner,{meta:n}));case 4:t.$message.success(t.$t("Remove successfully")),a.next=10;break;case 7:a.prev=7,a.t0=a["catch"](0),t.$message.error(t.$t("Remove failed"));case 10:case"end":return a.stop()}}),a,null,[[0,7]])})))()},onImageFileChange:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.$refs.imageFileInput.files,a.length){t.next=3;break}return t.abrupt("return");case 3:return n=new FormData,n.append("file",a[0]),e.isUploading[e.bannerLang]=!0,t.prev=6,t.next=9,e.$api.common.uploadFile(n);case 9:if(r=t.sent,!r||!r.file.length){t.next=14;break}return o=Object.assign({},e.banner.meta,Object(Ot["a"])({},e.bannerLang,r.file[0].url)),t.next=14,e.updateBanner(Object.assign({},e.banner,{meta:o}));case 14:e.$message.success(e.$t("Upload successfully")),t.next=20;break;case 17:t.prev=17,t.t0=t["catch"](6),e.$message.error(e.$t("Upload failed"));case 20:return t.prev=20,e.isUploading[e.bannerLang]=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[6,17,20,23]])})))()}}),watch:{redirectUrl:function(e){this.redirectUrlModel=e.replace(/https?:\/\//g,"")}}},Rt=It,Et=(a("efcf"),Object(R["a"])(Rt,Dt,Pt,!1,null,"0ccfacc8",null)),Mt=Et.exports,Nt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"function-setting"},[e.isEditMode?a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",on:{click:e.onSaveClick}},[e._v(e._s(e.$t("Save")))]),a("button",{on:{click:e.onCancelClick}},[e._v(e._s(e.$t("Cancel")))])]):a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",on:{click:e.onEditClick}},[e._v(e._s(e.$t("Edit")))])]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Function and buttons"))+" "),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$t("Control the function and their button wording"),placement:"right"}},[a("span",{staticClass:"iconfont icon-info"})])],1),a("div",{staticClass:"function-list"},[a("div",{staticClass:"list-row head"},[a("div",{staticClass:"list-col"},[e._v(e._s(e.$t("Function")))]),e.languages.en_US?a("div",{staticClass:"list-col"},[e._v(e._s(e.$t("lang.en_US")))]):e._e(),e.languages.zh_CN?a("div",{staticClass:"list-col"},[e._v(e._s(e.$t("lang.zh_CN")))]):e._e(),e.languages.zh_HK?a("div",{staticClass:"list-col"},[e._v(e._s(e.$t("lang.zh_HK")))]):e._e(),a("div",{staticClass:"list-col col-operation"},[e._v(e._s(e.$t("Operation")))])]),a("draggable",{attrs:{disabled:!e.isEditMode,group:"functions",animation:200,handle:".handle"},on:{start:function(t){e.dragging=!0},end:function(t){e.dragging=!1}},model:{value:e.functionsModel,callback:function(t){e.functionsModel=t},expression:"functionsModel"}},e._l(e.functionsModel,(function(t){return a("div",{key:t.function,staticClass:"list-row"},[a("div",{staticClass:"list-col"},[a("span",[e._v(e._s(t.function))])]),e.languages.en_US?a("div",{staticClass:"list-col"},[e.isEditMode?a("input",{directives:[{name:"model",rawName:"v-model",value:t.meta.en_US,expression:"item.meta.en_US"}],staticClass:"list-input",attrs:{type:"text"},domProps:{value:t.meta.en_US},on:{input:function(a){a.target.composing||e.$set(t.meta,"en_US",a.target.value)}}}):a("span",[e._v(e._s(t.meta.en_US))])]):e._e(),e.languages.zh_CN?a("div",{staticClass:"list-col"},[e.isEditMode?a("input",{directives:[{name:"model",rawName:"v-model",value:t.meta.zh_CN,expression:"item.meta.zh_CN"}],staticClass:"list-input",attrs:{type:"text"},domProps:{value:t.meta.zh_CN},on:{input:function(a){a.target.composing||e.$set(t.meta,"zh_CN",a.target.value)}}}):a("span",[e._v(e._s(t.meta.zh_CN))])]):e._e(),e.languages.zh_HK?a("div",{staticClass:"list-col"},[e.isEditMode?a("input",{directives:[{name:"model",rawName:"v-model",value:t.meta.zh_HK,expression:"item.meta.zh_HK"}],staticClass:"list-input",attrs:{type:"text"},domProps:{value:t.meta.zh_HK},on:{input:function(a){a.target.composing||e.$set(t.meta,"zh_HK",a.target.value)}}}):a("span",[e._v(e._s(t.meta.zh_HK))])]):e._e(),a("div",{staticClass:"list-col col-operation"},[a("el-switch",{attrs:{disabled:!e.isEditMode,"active-value":1,"inactive-value":0},model:{value:t.status,callback:function(a){e.$set(t,"status",a)},expression:"item.status"}}),e.isEditMode?a("div",{staticClass:"moveable handle"}):e._e()],1)])})),0)],1)])},jt=[],At=(a("d81d"),a("a9e3"),a("b76a")),Lt=a.n(At),Ft={components:{draggable:Lt.a},data:function(){return{isEditMode:!1,functionsModel:[],dragging:!1}},computed:Object(F["a"])({},Object(U["c"])("chatbotSetup",["functions","languages"])),mounted:function(){this.syncFunctions()},watch:{functions:function(e){this.syncFunctions()},platform:function(){this.isEditMode=!1}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("chatbotSetup",["updateFunctionSettings"])),{},{syncFunctions:function(){this.functionsModel=this.functions.map((function(e){return Object.assign({},e,{meta:Object.assign({},e.meta)})}))},onEditClick:function(){this.isEditMode=!0},onCancelClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$confirm(e.$t("Sure to cancel?"),"",{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),type:"warning"});case 3:e.syncFunctions(),e.isEditMode=!1,t.next=9;break;case 7:t.prev=7,t.t0=t["catch"](0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})))()},onSaveClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:a="",n=30,r=0;case 3:if(!(rn)){t.next=13;break}return a=e.$t("no more than 15 Chinese or 30 alphabetic characters",[o.function,e.$t("lang.en_US")]),t.abrupt("break",30);case 13:if(!e.languages.zh_CN){t.next=20;break}if(o.meta.zh_CN){t.next=17;break}return a=e.$t("Please enter display text",[o.function,e.$t("lang.zh_CN")]),t.abrupt("break",30);case 17:if(!(o.meta.zh_CN.replace(/[^\x00-\xff]/g,"**").length>n)){t.next=20;break}return a=e.$t("no more than 15 Chinese or 30 alphabetic characters",[o.function,e.$t("lang.zh_CN")]),t.abrupt("break",30);case 20:if(!e.languages.zh_HK){t.next=27;break}if(o.meta.zh_HK){t.next=24;break}return a=e.$t("Please enter display text",[o.function,e.$t("lang.zh_HK")]),t.abrupt("break",30);case 24:if(!(o.meta.zh_HK.replace(/[^\x00-\xff]/g,"**").length>n)){t.next=27;break}return a=e.$t("no more than 15 Chinese or 30 alphabetic characters",[o.function,e.$t("lang.zh_HK")]),t.abrupt("break",30);case 27:r++,t.next=3;break;case 30:if(!a){t.next=33;break}return e.$message.error(a),t.abrupt("return");case 33:return t.prev=33,t.next=36,e.updateFunctionSettings(e.functionsModel);case 36:e.$message.success(e.$t("Save successfully")),e.isEditMode=!1,t.next=43;break;case 40:t.prev=40,t.t0=t["catch"](33),e.$message.error(e.$t("Save failed"));case 43:case"end":return t.stop()}}),t,null,[[33,40]])})))()}})},Ut=Ft,zt=(a("047d"),Object(R["a"])(Ut,Nt,jt,!1,null,"23fc0414",null)),qt=zt.exports,Ht=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"agent-setting"},[a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",attrs:{disabled:10===e.agentSettings.length},on:{click:e.onAddClick}},[e.agentSettings.length<10?a("span",[e._v(e._s(e.$t("Add")))]):a("span",[e._v(e._s(e.$t("Maximum 10 period")))])])]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Working hours"))+" ")]),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.agentSettingsFormatted,stripe:""}},[a("el-table-column",{attrs:{prop:"type_name",label:e.$t("Type name"),width:"180px"}}),a("el-table-column",{attrs:{prop:"periodDisplay",label:e.$t("Period"),"show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:e.$t("Online time"),width:"200px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.is_online?a("span",[e._v(e._s(t.row.start_time))]):e._e(),e._v(" - "),t.row.is_online?a("span",[e._v(e._s(t.row.end_time))]):e._e()]}}])}),a("el-table-column",{attrs:{label:e.$t("Status"),width:"80px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.is_online?a("span",[e._v(e._s(e.$t("Online")))]):a("span",{staticClass:"offline-label"},[e._v(e._s(e.$t("Offline")))])]}}])}),a("el-table-column",{attrs:{label:e.$t("Action"),width:"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.onEditClick(t.row)}}},[e._v(e._s(e.$t("Edit")))]),a("span",{staticClass:"spliter"},[e._v("|")]),a("el-popover",{attrs:{placement:"top"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete ?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{type:"default",size:"mini"},on:{click:e.onDelCancelClick}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.onDelConfirm(t.row)}}},[e._v(e._s(e.$t("Ok")))])],1),a("el-button",{attrs:{slot:"reference",type:"text",size:"small"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)]}}])})],1),a("DialogAgentSettingForm",{attrs:{setting:e.currentSetting,visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},submitted:e.onAgentSettingSubmitted}})],1)},Bt=[],Kt=(a("a15b"),a("c1df")),Vt=a.n(Kt),Yt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.$t("Working hours"),"close-on-click-modal":!1,visible:e.visible,width:"700px","append-to-body":""},on:{"update:visible":e.updateVisible}},[a("el-form",{ref:"formData",attrs:{model:e.formData,rules:e.rules,"show-message":!1}},[a("el-form-item",{attrs:{label:e.$t("Type name"),prop:"type_name","label-width":e.formLabelWidth}},[a("el-input",{model:{value:e.formData.type_name,callback:function(t){e.$set(e.formData,"type_name",t)},expression:"formData.type_name"}})],1),a("el-form-item",{attrs:{label:e.$t("Period"),prop:"period","label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.formData.is_date,callback:function(t){e.$set(e.formData,"is_date",t)},expression:"formData.is_date"}},[a("el-radio",{attrs:{label:!1}},[e._v(e._s(e.$t("By week")))]),a("el-radio",{attrs:{label:!0}},[e._v(e._s(e.$t("By date")))])],1),e.formData.is_date?a("div",[a("el-date-picker",{staticClass:"period-dates",attrs:{type:"dates","value-format":"yyyy-MM-dd"},model:{value:e.formData.period,callback:function(t){e.$set(e.formData,"period",t)},expression:"formData.period"}})],1):a("el-checkbox-group",{model:{value:e.formData.period,callback:function(t){e.$set(e.formData,"period",t)},expression:"formData.period"}},[a("el-checkbox",{attrs:{label:0}},[e._v(e._s(e.$t("weekDays.Monday")))]),a("el-checkbox",{attrs:{label:1}},[e._v(e._s(e.$t("weekDays.Tuesday")))]),a("el-checkbox",{attrs:{label:2}},[e._v(e._s(e.$t("weekDays.Wednesday")))]),a("el-checkbox",{attrs:{label:3}},[e._v(e._s(e.$t("weekDays.Thursday")))]),a("el-checkbox",{attrs:{label:4}},[e._v(e._s(e.$t("weekDays.Friday")))]),a("el-checkbox",{attrs:{label:5}},[e._v(e._s(e.$t("weekDays.Saturday")))]),a("el-checkbox",{attrs:{label:6}},[e._v(e._s(e.$t("weekDays.Sunday")))])],1)],1),a("el-form-item",{attrs:{label:e.$t("Status"),prop:"timeRange","label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.formData.is_online,callback:function(t){e.$set(e.formData,"is_online",t)},expression:"formData.is_online"}},[a("el-radio",{attrs:{label:!0}},[e._v(e._s(e.$t("Online")))]),a("el-radio",{attrs:{label:!1}},[e._v(e._s(e.$t("Offline")))])],1)],1),e.formData.is_online?a("el-form-item",{attrs:{"label-width":e.formLabelWidth}},[a("el-time-picker",{attrs:{"is-range":"",clearable:"",format:"HH:mm","value-format":"HH:mm","range-separator":"~","start-placeholder":"","end-placeholder":"",placeholder:""},model:{value:e.formData.timeRange,callback:function(t){e.$set(e.formData,"timeRange",t)},expression:"formData.timeRange"}})],1):e._e()],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",disabled:!e.isFromValidate},on:{click:e.submitForm}},[e._v(e._s(e.$t("Save")))])],1)],1)},Wt=[],Gt=a("15fd"),Qt=a("bc3a"),Jt=a.n(Qt),Xt=window.location.host,Zt=Xt.indexOf("localhost")>-1,ea=Zt||Xt.indexOf("alpha")>-1,ta=!ea,aa=Xt.indexOf("travelflan.com.cn")>-1,na=Zt||!aa,ra=Zt||Xt.indexOf("uno-hk.travelflan.com")>-1,oa=Xt.indexOf("demo-uno-hk")>-1,ia="uno-hk.travelflan.com"===Xt,sa="",la="",ca="",ua="";ea?(sa="https://alpha-ara.travelflan.com",aa?(ua="https://api.travelflan.com.cn/main-development",ca="wss://api.travelflan.com.cn/ws-development/",la="https://alpha-marketplace.travelflan.com.cn"):ra?(ua="https://mars-test-hk.travelflan.com/flanb",ca="wss://mars-test-hk.travelflan.com/ws/",la="https://alpha.travelflan.com"):oa?(ua="https://mars-test-hk.travelflan.com/flanb-demo",ca="wss://mars-test-hk.travelflan.com/ws/",la="https://demo-marketplace.travelflan.com"):(ua="https://flanb-test.travelflan.com",ca="wss://flanb-ws-test.travelflan.com/",la="https://alpha.travelflan.com")):(sa="https://ara.travelflan.com",aa?(ua="https://mars.travelflan.com.cn/flanb",ca="wss://mars.travelflan.com.cn/ws/",la="https://marketplace.travelflan.com.cn"):oa?(ua="https://mars-test-hk.travelflan.com/flanb-demo",ca="wss://mars-test-hk.travelflan.com/ws/",la="https://demo-marketplace.travelflan.com"):ia?(ua="https://mars-hk.travelflan.com/flanb",ca="wss://mars-hk.travelflan.com/ws/",la="https://www.travelflan.com"):(ua="https://flanb.travelflan.com",ca="wss://flanb-ws.travelflan.com/",la="https://www.travelflan.com"));var da=window.localStorage.getItem("token")||null,pa=window.localStorage.getItem("uid")||null,ma=window.localStorage.getItem("vendor")||null,fa=window.localStorage.getItem("locale")||"en_US",ga={isLocal:Zt,isCn:aa,isCom:na,isAlpha:ea,isProduction:ta,rcsUrl:sa,mkpUrl:la,wssUrl:ca,apiUrl:ua,isHKTest:ra,isComDemo:oa,isHKCom:ia,setToken:function(e){da=e,window.localStorage.setItem("token",e)},getToken:function(){return da},setUserId:function(e){pa=e,window.localStorage.setItem("uid",e)},getUserId:function(){return pa},setVendor:function(e){ma=e,window.localStorage.setItem("vendor",e)},getVendor:function(){return ma},setLocale:function(e){fa=e,window.localStorage.setItem("locale",e)},getLocale:function(){return fa},getOrderManageUrl:function(){var e="manager2.travelflan.com";return aa&&(e+=".cn"),e=ta?"https://"+e:"https://alpha-"+e,"".concat(e,"?token=").concat(da,"&userId=").concat(pa,"&vendor=").concat(ma,"&locale=").concat(fa.toLowerCase())}},ha=ga.apiUrl;Jt.a.defaults.baseURL=ha;var _a=Jt.a.create({baseURL:ha});_a.interceptors.request.use((function(e){var t=ga.getToken();return t&&(e.headers.Authorization="Bearer "+t||!1),e})),_a.interceptors.response.use((function(e){return e.data}),(function(e){return e.response?Promise.reject(e.response.data):Promise.reject(e)}));var va=_a;function ba(e,t){return va.post("/file_upload",e,t)}function ya(e){return va.post("/aaa/password_reset",e)}function Ca(){return va.get("/locale/timezone?page_size=100")}function ka(e){return va.get("/consumer_request",{params:e})}function wa(){return va.get("/".concat(ga.getVendor(),"/uno_settings"))}function $a(e){return va.post("/".concat(ga.getVendor(),"/uno_settings"),e)}function Sa(e,t){return va.patch("/".concat(ga.getVendor(),"/templates/").concat(e),t)}function xa(e){return va.post("/".concat(ga.getVendor(),"/chatbot/agent_settings"),e)}function Ta(e){return va.get("/".concat(ga.getVendor(),"/chatbot/function_rules?platform=").concat(e))}function Da(e){return va.post("/".concat(ga.getVendor(),"/chatbot/function_rules"),e)}function Pa(e){return va.delete("/".concat(ga.getVendor(),"/chatbot/agent_settings"),{data:e})}function Oa(e){return va.delete("/".concat(ga.getVendor(),"/chatbot/function_rules"),{data:e})}function Ia(){return va.get("/".concat(ga.getVendor(),"/accounts/").concat(ga.getUserId(),"/privacy"))}function Ra(e){return va.post("/".concat(ga.getVendor(),"/accounts/").concat(ga.getUserId(),"/privacy"),e)}function Ea(e){return va.post("/aaa/token_for_vendor",e)}function Ma(e){return va.post("/aaa/token_for_vendor_refresh",e)}function Na(e){return va.get("/".concat(ga.getVendor(),"/chatbot/message_center"),{params:e})}function ja(e){return va.get("/travelflan/uno_product",{params:e})}function Aa(e){return va.post("/travelflan/uno_product",e)}function La(e,t){return va.put("/travelflan/uno_product/".concat(e),t)}function Fa(){return va.get("/package/supplier")}function Ua(e){return va.get("/simplified_data",{params:Object(F["a"])(Object(F["a"])({},e),{},{big_category:"Attraction",page_size:20})})}function za(e){return va.get("/tag_type_categories",{params:e})}function qa(e){return va.get("/travelflan/uno_product/".concat(e.productId))}function Ha(e){return va.put("/travelflan/uno_product",e)}function Ba(e){return va.delete("/travelflan/uno_product",{data:e})}function Ka(e){return va.post("/travelflan/uno_product/".concat(e.product_id,"/option"),e.data)}function Va(e){return va.delete("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id))}function Ya(e){return va.put("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id),e.data)}function Wa(e){return va.post("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id,"/sub_option"),e.data)}function Ga(e){return va.put("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id,"/sub_option/").concat(e.sub_option_id),e.data)}function Qa(e){return va.delete("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id,"/sub_option/").concat(e.sub_option_id),e.data)}function Ja(e){return va.put("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id,"/sub_option/").concat(e.sub_option_id,"/inventory"),e.data)}function Xa(e){return va.get("/travelflan/uno_product/".concat(e.product_id,"/option/").concat(e.option_id,"/sub_option/").concat(e.sub_option_id,"/inventory"))}function Za(e,t){return va.post("/travelflan/uno_product/".concat(e,"/batch_operate"),t)}function en(e,t){return va.put("/travelflan/uno_ec_product/".concat(e),t)}function tn(e){return va.post("/travelflan/uno_product/copy",e)}function an(e){return va.get("/travelflan/product/payment",{params:e})}function nn(e){return va.get("/travelflan/uno_product/detail/".concat(e))}function rn(e){return va.get("/".concat(ga.getVendor(),"/faq"),{params:e})}function on(e){return va.get("/".concat(ga.getVendor(),"/faq/qna"),{params:e})}function sn(e){return va.post("/".concat(ga.getVendor(),"/faq/category/bulk"),e)}function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return va.get("/".concat(ga.getVendor(),"/tag_type_categories?ordering=used_count&parent__parent__in=1&depth=3&page_size=").concat(t,"&name__icontains=").concat(e))}function cn(e){return va.post("/".concat(ga.getVendor(),"/faq/qna"),e)}function un(e,t){return va.put("/".concat(ga.getVendor(),"/faq/qna/").concat(e),t)}function dn(e,t){return va.delete("/".concat(ga.getVendor(),"/faq/qna/").concat(e),{data:t})}function pn(e){return va.post("/".concat(ga.getVendor(),"/faq/qna/bulk"),e)}function mn(e){return va.get("/poi",{params:Object.assign({is_high_level:!1},e)})}function fn(e){return va.get("/poi",{params:Object(F["a"])(Object(F["a"])({},e),{},{is_high_level:!0})})}function gn(e){return va.get("/poi/".concat(e.poi_id))}function hn(e){return va.post("/poi",e)}function _n(e){return va.delete("/poi",{data:e})}function vn(e){return va.put("/poi/".concat(e.poi_id),e.data)}function bn(e){return va.put("/poi",e)}function yn(e){return va.get("/locale/cities",{params:e})}function Cn(e){return va.get("/locale/districts",{params:e})}function kn(e){return va.get("/tagsystem/tree",{params:e})}function wn(e){return va.get("/tagsystem/".concat(e.tag_id))}function $n(e){return va.put("/tagsystem/".concat(e.tag_id),e.data)}function Sn(e){return va.post("/tagsystem",e)}function xn(e){return va.delete("/tagsystem/".concat(e.tag_id))}function Tn(e){return va.get("/tagsystem",{params:e})}function Dn(e){return va.put("/tagsystem",e)}function Pn(e){return va.get("/".concat(ga.getVendor(),"/accounts"),{params:e})}function On(e){return va.get("/".concat(ga.getVendor(),"/tag_type_categories"),{params:e})}function In(e,t){return va.post("/".concat(ga.getVendor(),"/accounts/").concat(e,"/tag_type_categories"),t)}function Rn(e,t){return va.delete("/".concat(ga.getVendor(),"/accounts/").concat(e,"/tag_type_categories/").concat(t))}function En(e){return va.get("/".concat(ga.getVendor(),"/messages"),{params:e})}function Mn(e){return va.post("/".concat(ga.getVendor(),"/messages"),e)}function Nn(e){return va.post("accounts/".concat(e,"/messages/read"))}function jn(){return va.get("/".concat(ga.getVendor(),"/pongo_statistics"))}function An(e,t){return va.put("/".concat(ga.getVendor(),"/accounts/").concat(e,"/lock"),t)}function Ln(e,t){return va.put("/".concat(ga.getVendor(),"/accounts/").concat(e,"/assign/").concat(t))}function Fn(e){return va.get("/".concat(ga.getVendor(),"/sreplys"),{params:e})}function Un(e){return va.delete("/".concat(ga.getVendor(),"/sreplys/").concat(e))}function zn(e){return va.post("/".concat(ga.getVendor(),"/sreplys"),e)}function qn(e,t){return va.put("/".concat(ga.getVendor(),"/sreplys/").concat(e),t)}function Hn(e,t){return va.patch("/".concat(ga.getVendor(),"/accounts/").concat(e),t)}function Bn(e){return va.get("/".concat(ga.getVendor(),"/accounts/").concat(e,"/note"),{params:{ordering:"-id"}})}function Kn(e,t){return va.post("/".concat(ga.getVendor(),"/accounts/").concat(e,"/note"),t)}function Vn(e){return va.get("/".concat(ga.getVendor(),"/messages/excel"),{responseType:"blob",params:e})}function Yn(e){return va.get("/currency",{params:e})}function Wn(e){return va.get("/currency/".concat(e))}function Gn(e){return va.post("/currency",e)}function Qn(e,t){return va.put("/currency/".concat(e),t)}function Jn(e){return va.delete("/currency/".concat(e))}function Xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t={page_size:e,category:"Country",summary:!0,ordering:"id"};return va.get("/pogs",{params:t})}function Zn(e,t){var a={page_size:t,parent__id:e,category:"City",summary:!0,ordering:"id"};return va.get("/pogs",{params:a})}function er(e,t){var a={page_size:t,parent__id:e,category:"Dist",summary:!0};return va.get("/pogs",{params:a})}function tr(e){return va.get("/pois",{params:e})}function ar(e){return va.put("/pois",e)}function nr(e){return va.delete("/pois",{data:e})}function rr(e){return va.get("/poi/".concat(e.poi_id))}function or(e){return va.post("/pois",e)}function ir(e,t){return va.put("/poi/".concat(e),t)}function sr(e){return va.get("/travelflan/uno/product/payment",{params:e})}function lr(e,t){return va.get("/travelflan/uno/product/payment/".concat(e),{params:t})}function cr(e){return va.put("/travelflan/uno/product/payment/".concat(e.id),e)}function ur(e){return va.put("/travelflan/uno/product/booking/".concat(e.id),e)}function dr(e){return va.put("/travelflan/uno/product/booking/".concat(e.id),e)}function pr(e){return va.put("/travelflan/uno/product/payment/".concat(e.id),e)}function mr(e){return va.put("/travelflan/uno/product/payment/".concat(e.id),e)}function fr(e){return va.put("/travelflan/uno/product/payment/".concat(e.id),e)}function gr(e){return va.get("/travelflan/uno/product/payment/excel",{responseType:"blob",params:e})}function hr(e){return va.put("/travelflan/uno/product/booking/".concat(e.id),e)}function _r(e){return va.put("/travelflan/uno/product/booking/".concat(e.id),e)}function vr(){return va.get("/package/warehouse")}function br(e){return va.get("/travelflan/uno/base_coupon",{params:e})}function yr(e){return va.post("/travelflan/uno/base_coupon",e)}function Cr(e){return va.get("/travelflan/uno/base_coupon/".concat(e.couponId))}function kr(e,t){return va.get("/travelflan/uno/base_coupon/".concat(e,"/coupon"),{params:t})}function wr(e,t){return va.get("/travelflan/uno/base_coupon/".concat(e,"/excel"),{responseType:"blob",params:t})}function $r(e,t){return va.get("/travelflan/uno_product/".concat(e,"/coupon"),{params:t})}function Sr(e){return va.get("/category/tree",{params:e})}function xr(e){return va.get("/travelflan/uno/banner",{params:e})}function Tr(e,t){return va.post("/travelflan/uno/banner",e,{params:t})}function Dr(e){return va.get("/travelflan/uno/collection",{params:e})}function Pr(e,t){return va.post("/travelflan/uno/collection",e,{params:t})}function Or(e){return va.get("/travelflan/uno/collection",{params:e})}function Ir(e,t){return va.post("/travelflan/uno/collection",e,{params:t})}function Rr(e){return va.get("/travelflan/uno/mkp_config",{params:e})}function Er(e,t){return va.post("/travelflan/uno/mkp_config",e,{params:t})}function Mr(e){return va.get("/booking_codes",{params:e})}function Nr(e){return va.get("booking_codes/excel",{responseType:"blob",params:e})}function jr(e,t){return va.get("/event/".concat(e),{params:t})}function Ar(e){return va.get("/".concat(ga.getVendor(),"/uno/theme"),{params:e})}function Lr(e){return va.post("/".concat(ga.getVendor(),"/uno/theme"),e)}function Fr(e){return va.get("/".concat(ga.getVendor(),"/uno/theme/").concat(e))}function Ur(e){return va.put("/".concat(ga.getVendor(),"/uno/theme/").concat(e.id),e)}function zr(e){return va.get("/travelflan/uno/mylink/points",{params:e})}function qr(e){return va.post("/travelflan/uno/mylink/points",e)}function Hr(e,t){return va.put("/travelflan/uno/mylink/points/".concat(e),t)}function Br(e){return va.get("/travelflan/uno/mylink/points/".concat(e))}function Kr(e,t){return va.get("/travelflan/uno/mylink/points/".concat(e,"/booking"),{params:t})}function Vr(e,t){return va.post("/travelflan/uno/mylink/points/".concat(e,"/booking"),null,{responseType:"blob",params:t})}function Yr(e,t){return va.get("/travelflan/uno_product/".concat(e,"/voucher"),{params:t})}function Wr(e,t,a){return va.put("/travelflan/uno_product/".concat(e,"/voucher/").concat(t),a)}function Gr(e,t){return va.post("/travelflan/uno_product/".concat(e,"/voucher"),t)}var Qr={common:n,setting:r,user:o,message:i,product:s,faq:l,point:c,tag:u,agent:d,currency:p,pog:m,poi:f,order:g,warehouse:h,coupon:_,category:v,operation:b,bookingCode:y,events:C,theme:k,promotion:w,voucher:$},Jr=["timeRange"],Xr={props:{visible:{type:Boolean,default:!1},setting:{type:Object,default:null}},data:function(){return{formLabelWidth:"100px",formData:{type_name:"",is_date:!1,period:[],is_online:!0,timeRange:null},rules:{type_name:[{required:!0}],period:[{required:!0}],timeRange:[{required:!0}]},pending:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["timezoneOffset"])),{},{isFromValidate:function(){var e=this.formData.type_name&&this.formData.period.length;return this.formData.is_online&&(e=e&&this.formData.timeRange&&this.formData.timeRange.length),e}}),watch:{visible:function(e,t){e&&this.initFormData()},"formData.is_date":function(e){this.formData.period=[],this.setting&&this.setting.is_date===e?this.formData.period=this.setting.period:this.formData.period=[]}},methods:{initFormData:function(){var e=this;this.setting?(this.formData.type_name=this.setting.type_name,this.formData.is_date=this.setting.is_date,this.formData.is_online=this.setting.is_online,this.setting.start_time&&this.setting.end_time?this.formData.timeRange=[this.setting.start_time,this.setting.end_time]:this.formData.timeRange=null,this.$nextTick((function(){e.formData.period=e.setting.period}))):(this.formData.type_name="",this.formData.is_date=!1,this.formData.period=[],this.formData.is_online=1,this.formData.timeRange=null)},updateVisible:function(e){this.$emit("update:visible",e)},submitForm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.pending&&e.isFromValidate){t.next=2;break}return t.abrupt("return");case 2:return e.pending=!0,t.prev=3,a=e.formData,n=a.timeRange,r=Object(Gt["a"])(a,Jr),o=Object(F["a"])(Object(F["a"])({},r),{},{status:1,platform:e.platform}),e.formData.is_online&&(o.start_time=Vt.a.utc("2019-11-20 ".concat(n[0],":00")).add(e.timezoneOffset,"minutes").format("HH:mm"),o.end_time=Vt.a.utc("2019-11-20 ".concat(n[1],":00")).add(e.timezoneOffset,"minutes").format("HH:mm")),e.setting&&(o.id=e.setting.id,o.status=e.setting.status),t.next=10,Qr.setting.updateAgentSettings(o);case 10:i=t.sent,e.$emit("submitted",i),e.updateVisible(!1),t.next=18;break;case 15:t.prev=15,t.t0=t["catch"](3),e.$message.error(t.t0.message);case 18:return t.prev=18,e.pending=!1,t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[3,15,18,21]])})))()}}},Zr=Xr,eo=(a("c4f3"),Object(R["a"])(Zr,Yt,Wt,!1,null,"cdbfd094",null)),to=eo.exports,ao={components:{DialogAgentSettingForm:to},data:function(){return{dialogVisible:!1,currentSetting:null}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["agentSettings","timezoneOffset"])),{},{weekDays:function(){return[this.$t("weekDays.Monday"),this.$t("weekDays.Tuesday"),this.$t("weekDays.Wednesday"),this.$t("weekDays.Thursday"),this.$t("weekDays.Friday"),this.$t("weekDays.Saturday"),this.$t("weekDays.Sunday")]},agentSettingsFormatted:function(){var e=this;return this.agentSettings.map((function(t){var a="",n="",r="";return a=t.is_date?t.period.join(", "):t.period.map((function(t){return e.weekDays[t]})).join(", "),t.start_time&&(n=Vt.a.utc("2019-11-20 ".concat(t.start_time,":00")).add(0-e.timezoneOffset,"minutes").format("HH:mm")),t.end_time&&(r=Vt.a.utc("2019-11-20 ".concat(t.end_time,":00")).add(0-e.timezoneOffset,"minutes").format("HH:mm")),Object.assign({},t,{periodDisplay:a,start_time:n,end_time:r})}))}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("chatbotSetup",["updateFunctionSettings","getSettings"])),{},{onAddClick:function(){this.currentSetting=null,this.dialogVisible=!0},onEditClick:function(e){this.currentSetting=e,this.dialogVisible=!0},onAgentSettingSubmitted:function(){this.getSettings()},onDelCancelClick:function(){this.closeDelConfirmPop()},closeDelConfirmPop:function(){window.document.body.click()},onDelConfirm:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.closeDelConfirmPop(),a.next=3,t.$api.setting.deleteAgentSetting({id:e.id,platform:t.platform});case 3:t.getSettings();case 4:case"end":return a.stop()}}),a)})))()}})},no=ao,ro=(a("ea8b"),Object(R["a"])(no,Ht,Bt,!1,null,"37a613e5",null)),oo=ro.exports,io=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"fn-rule-setting"},[a("div",{staticClass:"setting-actions"},[a("button",{staticClass:"primary",attrs:{disabled:10===e.functionRules.length},on:{click:e.onAddClick}},[e.functionRules.length<10?a("span",[e._v(e._s(e.$t("Add")))]):a("span",[e._v(e._s(e.$t("Maximum 10 period")))])])]),a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Function rules"))+" "),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$t("Some situations when trigger accumulated time, can trigger Agent and/or messages."),placement:"right"}},[a("span",{staticClass:"iconfont icon-info"})])],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.functionRules,stripe:""}},[a("el-table-column",{attrs:{prop:"function_name",width:"120px",label:e.$t("Function")}}),a("el-table-column",{attrs:{prop:"trigger_times",width:"120px",label:e.$t("Trigger Times"),align:"center"}}),a("el-table-column",{attrs:{label:e.$t("Trigger Agent"),width:"120px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.need_agent?a("span",[e._v(e._s(e.$t("Yes")))]):a("span",[e._v(e._s(e.$t("No")))])]}}])}),e.languages.en_US?a("el-table-column",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.en_US")+")","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.template.meta.en_US))])]}}],null,!1,1760817593)}):e._e(),e.languages.zh_HK?a("el-table-column",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.zh_HK")+")","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.template.meta.zh_HK))])]}}],null,!1,3630008581)}):e._e(),e.languages.zh_CN?a("el-table-column",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.zh_CN")+")","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.template.meta.zh_CN))])]}}],null,!1,1333114219)}):e._e(),a("el-table-column",{attrs:{label:e.$t("Action"),width:"120px",align:"center",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.onEditClick(t.row)}}},[e._v(e._s(e.$t("Edit")))]),a("span",{staticClass:"spliter"},[e._v("|")]),a("el-popover",{attrs:{placement:"top"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete ?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{type:"default",size:"mini"},on:{click:e.onDelCancelClick}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.onDelConfirm(t.row)}}},[e._v(e._s(e.$t("Ok")))])],1),a("el-button",{attrs:{slot:"reference",type:"text",size:"small"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)]}}])})],1),a("DialogFunctionRuleForm",{attrs:{setting:e.currentSetting,visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t},submitted:e.onSettingSubmitted}})],1)},so=[],lo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.$t("Function rules"),"close-on-click-modal":!1,visible:e.visible,width:"700px","append-to-body":""},on:{"update:visible":e.updateVisible}},[a("el-form",{ref:"formData",attrs:{model:e.formData,rules:e.rules,"show-message":!1}},[a("el-form-item",{attrs:{label:e.$t("Function"),prop:"function_name","label-width":e.formLabelWidth}},[a("el-select",{attrs:{placeholder:""},model:{value:e.formData.function_name,callback:function(t){e.$set(e.formData,"function_name",t)},expression:"formData.function_name"}},[a("el-option",{attrs:{label:"image",value:"image"}}),a("el-option",{attrs:{label:"emoji",value:"emoji"}})],1)],1),a("el-form-item",{attrs:{label:e.$t("Trigger Times"),prop:"trigger_times","label-width":e.formLabelWidth}},[a("el-select",{attrs:{placeholder:""},model:{value:e.formData.trigger_times,callback:function(t){e.$set(e.formData,"trigger_times",t)},expression:"formData.trigger_times"}},e._l(10,(function(e){return a("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1),a("el-form-item",{attrs:{label:e.$t("Trigger Agent"),prop:"need_agent","label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.formData.need_agent,callback:function(t){e.$set(e.formData,"need_agent",t)},expression:"formData.need_agent"}},[a("el-radio",{attrs:{label:!0}},[e._v(e._s(e.$t("Yes")))]),a("el-radio",{attrs:{label:!1}},[e._v(e._s(e.$t("No")))])],1)],1),e.languages.en_US?a("el-form-item",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.en_US")+")",prop:"replyEN","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.formData.replyEN,callback:function(t){e.$set(e.formData,"replyEN",t)},expression:"formData.replyEN"}})],1):e._e(),e.languages.zh_HK?a("el-form-item",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.zh_HK")+")",prop:"replyHK","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.formData.replyHK,callback:function(t){e.$set(e.formData,"replyHK",t)},expression:"formData.replyHK"}})],1):e._e(),e.languages.zh_CN?a("el-form-item",{attrs:{label:e.$t("Reply")+"("+e.$t("lang.zh_CN")+")",prop:"replyCN","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.formData.replyCN,callback:function(t){e.$set(e.formData,"replyCN",t)},expression:"formData.replyCN"}})],1):e._e()],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",disabled:!e.isFromValidate},on:{click:e.submitForm}},[e._v(e._s(e.$t("Save")))])],1)],1)},co=[],uo=["replyEN","replyHK","replyCN"],po={props:{visible:{type:Boolean,default:!1},setting:{type:Object,default:null}},data:function(){return{formLabelWidth:"120px",formData:{function_name:"",trigger_times:1,need_agent:!1,replyEN:"",replyHK:"",replyCN:""},rules:{function_name:[{required:!0}],trigger_times:[{required:!0}],need_agent:[{required:!0}],replyEN:[{required:!0}],replyHK:[{required:!0}],replyCN:[{required:!0}]},pending:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["banner","languages"])),{},{isFromValidate:function(){var e=this.formData.function_name;return this.languages.en_US&&(e=e&&this.formData.replyEN),this.languages.zh_HK&&(e=e&&this.formData.replyHK),this.languages.zh_CN&&(e=e&&this.formData.replyCN),e}}),watch:{visible:function(e,t){e&&this.initFormData()}},methods:{initFormData:function(){this.setting?(this.formData.function_name=this.setting.function_name,this.formData.trigger_times=this.setting.trigger_times,this.formData.need_agent=this.setting.need_agent,this.languages.en_US?this.formData.replyEN=this.setting.template.meta.en_US:this.formData.replyEN="",this.languages.zh_HK?this.formData.replyHK=this.setting.template.meta.zh_HK:this.formData.replyHK="",this.languages.zh_CN?this.formData.replyCN=this.setting.template.meta.zh_CN:this.formData.replyCN=""):(this.formData.function_name="",this.formData.trigger_times=1,this.formData.need_agent=!1,this.formData.replyEN="",this.formData.replyHK="",this.formData.replyCN="")},updateVisible:function(e){this.$emit("update:visible",e)},submitForm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.pending&&e.isFromValidate){t.next=2;break}return t.abrupt("return");case 2:return e.pending=!0,t.prev=3,a=e.formData,a.replyEN,a.replyHK,a.replyCN,n=Object(Gt["a"])(a,uo),r=Object(F["a"])(Object(F["a"])({},n),{},{platform:e.platform,template_meta:{},status:1}),e.languages.en_US&&(r.template_meta.en_US=e.formData.replyEN),e.languages.zh_HK&&(r.template_meta.zh_HK=e.formData.replyHK),e.languages.zh_CN&&(r.template_meta.zh_CN=e.formData.replyCN),e.setting&&(r.id=e.setting.id,r.status=e.setting.status),t.next=12,Qr.setting.updateFunctionRule(r);case 12:o=t.sent,e.$emit("submitted",o),e.updateVisible(!1),t.next=20;break;case 17:t.prev=17,t.t0=t["catch"](3),e.$message.error(t.t0.message);case 20:return t.prev=20,e.pending=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[3,17,20,23]])})))()}}},mo=po,fo=(a("481f"),Object(R["a"])(mo,lo,co,!1,null,"41781e9e",null)),go=fo.exports,ho={components:{DialogFunctionRuleForm:go},data:function(){return{dialogVisible:!1,currentSetting:null,functionRules:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])("chatbotSetup",["banner","languages"])),Object(U["d"])("chatbotSetup",["platform"])),watch:{platform:function(){this.getFunctionRules()}},methods:{getFunctionRules:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.setting.getFunctionRules(e.platform);case 2:a=t.sent,e.functionRules=a;case 4:case"end":return t.stop()}}),t)})))()},onAddClick:function(){this.currentSetting=null,this.dialogVisible=!0},onEditClick:function(e){this.currentSetting=e,this.dialogVisible=!0},onSettingSubmitted:function(){this.getFunctionRules()},onDelCancelClick:function(){this.closeDelConfirmPop()},closeDelConfirmPop:function(){window.document.body.click()},onDelConfirm:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.closeDelConfirmPop(),a.next=3,t.$api.setting.deleteFunctionRule({id:e.id,platform:t.platform});case 3:t.getFunctionRules();case 4:case"end":return a.stop()}}),a)})))()}},created:function(){this.getFunctionRules()}},_o=ho,vo=(a("092c"),Object(R["a"])(_o,io,so,!1,null,"2fbcbccc",null)),bo=vo.exports,yo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-center"},[a("div",{staticClass:"message-list"},[a("el-form",{attrs:{size:"small",inline:!0,model:e.searchForm}},[a("el-form-item",{attrs:{label:e.$t("Range")}},[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"~"},model:{value:e.searchForm.range,callback:function(t){e.$set(e.searchForm,"range",t)},expression:"searchForm.range"}})],1),a("el-form-item",{attrs:{label:e.$t("Type")}},[a("el-select",{attrs:{placeholder:"",clearable:!1},model:{value:e.searchForm.category,callback:function(t){e.$set(e.searchForm,"category",t)},expression:"searchForm.category"}},[a("el-option",{attrs:{label:"all",value:"all"}}),a("el-option",{attrs:{label:"unknown",value:"unknown"}})],1)],1),a("el-form-item",{attrs:{label:e.$t("Keyword")}},[a("el-input",{model:{value:e.searchForm.keyword,callback:function(t){e.$set(e.searchForm,"keyword",t)},expression:"searchForm.keyword"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSearch}},[e._v(e._s(e.$t("Search")))])],1)],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.messages,stripe:""},on:{"sort-change":e.onSortChange}},[a("el-table-column",{attrs:{prop:"flan__ai_category",label:e.$t("Type"),width:"180px"}}),a("el-table-column",{attrs:{prop:"used_count",sortable:"custom",label:e.$t("Count"),width:"180px"}}),a("el-table-column",{attrs:{prop:"user_count",sortable:"custom",label:e.$t("Users"),width:"180px"}}),a("el-table-column",{attrs:{prop:"message",label:e.$t("Message"),"show-overflow-tooltip":""}})],1),a("el-pagination",{staticClass:"pagination",attrs:{"hide-on-single-page":"","page-size":e.pageSize,"current-page":e.currentPage,layout:"prev, pager, next",total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"current-change":e.onPageChange}})],1)])},Co=[],ko={data:function(){return{messages:[],searchForm:{range:[],keyword:"",category:"all"},total:0,currentPage:1,pageSize:15,ordering:"-used_count"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["c"])("chatbotSetup",["timezoneOffset"])),watch:{platform:function(){this.getMessages()}},methods:{getMessages:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={platform:e.platform,page:e.currentPage,page_size:e.pageSize},e.searchForm.range.length>1&&(n=[e.searchForm.range[0],Vt()(e.searchForm.range[1]).add(1,"day")],a.timestamp__range=n.map((function(e){return Vt()(e).format("YYYY-MM-DD HH:mm:SS")})).join(",")),e.searchForm.keyword&&(a.message__contains=e.searchForm.keyword),e.ordering&&(a.ordering=e.ordering),e.searchForm.category&&"all"!==e.searchForm.category&&(a.ai_category=e.searchForm.category),t.next=7,e.$api.message.getMessageStats(a);case 7:r=t.sent,e.messages=r.results,e.total=r.count;case 10:case"end":return t.stop()}}),t)})))()},onSearch:function(){this.currentPage=1,this.getMessages()},onPageChange:function(){this.getMessages()},onSortChange:function(e){var t="descending"===e.order?"-":"";this.ordering=t+e.prop,this.getMessages()}},created:function(){this.getMessages()}},wo=ko,$o=(a("73ba"),Object(R["a"])(wo,yo,Co,!1,null,"74fc309b",null)),So=$o.exports,xo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"agent-page"},[a("div",{staticClass:"clients"},[a("Clients")],1),a("div",{staticClass:"chat"},[a("Chat")],1),a("div",{staticClass:"assist"},[a("right-moudle")],1)])},To=[],Do=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"chat-container"},[a("ChatHead"),a("ChatMessageList"),a("ChatInput")],1)},Po=[],Oo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"chat-head"},[a("div",{staticClass:"status",class:"status-"+e.colorStatus}),a("div",{staticClass:"user-info"},[e._m(0),a("span",{staticClass:"user-name"},[e._v(e._s(e.clientName))]),a("span",{staticClass:"platform"},[e._v("- "+e._s(e.clientProviderName))])]),a("div",{staticClass:"actions"},[a("el-select",{staticClass:"agent-select",attrs:{size:"small",filterable:"",placeholder:e.$t("Assign to agent")},on:{change:e.onAssignAgentChange,"visible-change":e.onSelectVisibleChange},model:{value:e.assignAgent,callback:function(t){e.assignAgent=t},expression:"assignAgent"}},e._l(e.agents,(function(e){return a("el-option",{key:e.id,attrs:{label:e.first_name+" "+e.last_name,value:e.id}})})),1),e.isAssignToMe?a("button",{staticClass:"iconfont icon-icon_rate",on:{click:e.onRatingClick}}):a("button",{staticClass:"iconfont icon-export",on:{click:e.exportData}}),a("button",{staticClass:"iconfont icon-close-chat",on:{click:e.onCloseChatClick}})],1)])},Io=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"avatar"},[a("span",{staticClass:"iconfont icon-chat-client"})])}],Ro=a("aeb1"),Eo=a.n(Ro),Mo={data:function(){return{assignAgent:null,exportLoading:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{agents:function(e){return e.agents},currentClient:function(e){return e.currentClient}})),Object(U["c"])("agent",["currentClient","currentClientId","isAssignToMe"])),{},{colorStatus:function(){return this.currentClient?this.currentClient.color_status:""},clientName:function(){return this.currentClient?this.currentClient.first_name?this.currentClient.first_name+" "+this.currentClient.last_name:this.currentClient.nick_name||this.currentClient.id:""},clientProvider:function(){return this.currentClient?this.currentClient.provider:null},clientProviderName:function(){var e="";switch(this.clientProvider){case 0:e="travelflan";break;case 1:case 300:case 301:case 302:e="facebook";break;case 2:e="wechat";break;case 3:e="samsung";break;case 4:e="bixbyMobile";break;case 10:case 13:case 17:e="widget";break;case 14:e="widgetSA";break;case 15:e="widgetMP";break;default:break}return e}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["getAllAgents"])),{},{onCloseChatClick:function(){this.isAssignToMe&&this.$api.agent.lockClient(this.currentClientId,{lock_action:5})},onRatingClick:function(){this.isAssignToMe&&this.$api.agent.lockClient(this.currentClientId,{lock_action:3})},onAssignAgentChange:function(){this.$api.agent.assignClient(this.currentClientId,this.assignAgent)},onSelectVisibleChange:function(e){e&&this.getAllAgents()},exportData:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exportLoading){t.next=2;break}return t.abrupt("return");case 2:return e.exportLoading=!0,t.prev=3,a={user_id:e.currentClientId},n=e.currentClientId,e.currentClient.first_name&&(n+="-"+e.currentClient.first_name),n+=".xlsx",t.next=10,e.$api.agent.exportMessages(a);case 10:r=t.sent,Eo()(r,n);case 12:return t.prev=12,e.exportLoading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[3,,12,15]])})))()}}),watch:{currentClient:function(){this.currentClient?this.assignAgent=this.currentClient.locked_agent:this.assignAgent=null}}},No=Mo,jo=(a("95de"),Object(R["a"])(No,Oo,Io,!1,null,"342d61ef",null)),Ao=jo.exports,Lo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"chat-message-list",attrs:{id:"chat-message-list"},on:{scroll:e.checkScrollPosition}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"loading"}),e._l(e.messages,(function(t,n){return a("div",{key:n,staticClass:"message-item"},[1===t.source||2===t.source?[a("BotMessage",{attrs:{date:t.timestamp,agent:t.agent_detail}},[0===t.attachment_type?a("BotTextMessage",{attrs:{message:t}}):7===t.attachment_type?a("BotLogMessage",{attrs:{message:t}}):1===t.attachment_type?a("BotImageMessage",{attrs:{message:t}}):4===t.attachment_type?a("BotFileMessage",{attrs:{message:t}}):2===t.attachment_type?a("BotAudioMessage",{attrs:{message:t}}):t.attachment_payload&&"button"===t.attachment_payload.template_type?a("ButtonWidget",{attrs:{message:t}}):t.attachment_payload&&"restaurant"===t.attachment_payload.template_type?a("RestaurantWidget",{attrs:{message:t}}):t.attachment_payload&&"weather"===t.attachment_payload.template_type?a("WeatherWidget",{attrs:{message:t}}):t.attachment_payload&&"coupon"===t.attachment_payload.template_type?a("CouponWidget",{attrs:{message:t}}):!t.attachment_payload||"itinerary"!==t.attachment_payload.template_type&&"attraction"!==t.attachment_payload.template_type?t.attachment_payload&&"hotel"===t.attachment_payload.template_type?a("HotelWidget",{attrs:{message:t}}):t.attachment_payload&&"rating"===t.attachment_payload.template_type?a("RatingWidget",{attrs:{message:t}}):e._e():a("ItineraryWidget",{attrs:{message:t}})],1)]:e._e(),0===t.source?[a("UserMessage",{attrs:{date:t.timestamp}},[0===t.attachment_type?a("UserTextMessage",{attrs:{message:t}}):1===t.attachment_type?a("UserImageMessage",{attrs:{message:t}}):e._e()],1)]:e._e()],2)}))],2)},Fo=[],Uo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-item"},[a("BotAvatar"),a("div",{staticClass:"message-content"},[a("div",{staticClass:"date"},[e._v(" "+e._s(e._f("autoDate")(e.date))+" ")]),a("div",{staticClass:"name"},[e._v(" "+e._s(e.agentName)+" ")]),e._t("default")],2)],1)},zo=[],qo=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},Ho=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"avatar"},[a("span",{staticClass:"iconfont icon-chat-client"})])}],Bo={},Ko=Bo,Vo=(a("f68f"),Object(R["a"])(Ko,qo,Ho,!1,null,"7eda39a5",null)),Yo=Vo.exports,Wo={components:{BotAvatar:Yo},props:{date:String,agent:{type:Object,default:null}},computed:{agentName:function(){return this.agent?"".concat(this.agent.first_name," ").concat(this.agent.last_name):"AI"}}},Go=Wo,Qo=(a("9fac"),Object(R["a"])(Go,Uo,zo,!1,null,"2b303eb4",null)),Jo=Qo.exports,Xo=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"text-message"},[a("div",{staticClass:"message-box message-box-bot"},[a("span",{domProps:{innerHTML:e._s(e.messageText)}})]),e.quickReplies.length?a("div",{staticClass:"action-list"},e._l(e.quickReplies,(function(t,n){return a("div",{key:n,staticClass:"action-item"},[e._v(" "+e._s(t.title)+" ")])})),0):e._e()])},Zo=[],ei={props:{message:{type:Object,default:null}},computed:{messageText:function(){return this.message?this.message.message:""},quickReplies:function(){return this.message.quick_replies?JSON.parse(this.message.quick_replies):[]}}},ti=ei,ai=(a("1898"),Object(R["a"])(ti,Xo,Zo,!1,null,"9522f6d6",null)),ni=ai.exports,ri=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"image-message"},[a("img",{attrs:{src:e.imageUrl,alt:""}})])},oi=[],ii={props:{message:{type:Object,default:null}},computed:{imageUrl:function(){return encodeURI(this.message.attachment_payload.url)}}},si=ii,li=(a("0006"),Object(R["a"])(si,ri,oi,!1,null,"4f92cba4",null)),ci=li.exports,ui=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-item"},[a("UserAvatar"),a("div",{staticClass:"message-content"},[a("div",{staticClass:"date"},[e._v(" "+e._s(e._f("date")(e.date,"HH:mm"))+" ")]),e._t("default")],2)],1)},di=[],pi=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},mi=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"avatar"},[a("span",{staticClass:"iconfont icon-chat-client"})])}],fi={},gi=fi,hi=(a("ca1f"),Object(R["a"])(gi,pi,mi,!1,null,"2634f91e",null)),_i=hi.exports,vi={components:{UserAvatar:_i},props:{date:String}},bi=vi,yi=(a("4744"),Object(R["a"])(bi,ui,di,!1,null,"70626ce9",null)),Ci=yi.exports,ki=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content message-box"},[a("span",{domProps:{innerHTML:e._s(e.messageText)}})])},wi=[],$i={props:{message:{type:Object,default:null}},computed:{messageText:function(){return this.message.message},date:function(){return this.message?this.message.timestamp:null}}},Si=$i,xi=(a("ce83"),Object(R["a"])(Si,ki,wi,!1,null,"c8631224",null)),Ti=xi.exports,Di=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"image-message"},[a("img",{attrs:{src:e.imageUrl,alt:""}})])},Pi=[],Oi={props:{message:{type:Object,default:null}},computed:{imageUrl:function(){return encodeURI(this.message.attachment_payload.url)}}},Ii=Oi,Ri=(a("577ed"),Object(R["a"])(Ii,Di,Pi,!1,null,"70666aaa",null)),Ei=Ri.exports,Mi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"widget-container"},[a("div",{staticClass:"message-box message-box-bot"},[a("span",[e._v(e._s(e.message.attachment_payload.text))])]),a("div",{staticClass:"action-list"},[e._l(e.postbacks,(function(t,n){return a("button",{key:n,staticClass:"action-item"},[e._v(" "+e._s(t.title)+" ")])})),e._l(e.webUrls,(function(t,n){return a("a",{key:n,staticClass:"action-item",attrs:{href:t.url,target:"_blank"}},[e._v(" "+e._s(t.title)+" ")])}))],2)])},Ni=[],ji={props:{message:{type:Object,default:null}},computed:{postbacks:function(){return this.message?this.message.attachment_payload.buttons.filter((function(e){return"postback"===e.type})):[]},webUrls:function(){return this.message?this.message.attachment_payload.buttons.filter((function(e){return"web_url"===e.type})):[]}}},Ai=ji,Li=(a("788d"),Object(R["a"])(Ai,Mi,Ni,!1,null,"e5c0dec6",null)),Fi=Li.exports,Ui=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-box message-box-bot widget-result-wrapper"},[a("div",{staticClass:"widget-result"},[a("div",{staticClass:"restaurant-list"},e._l(e.restaurantResults,(function(t){return a("div",{key:t.title,staticClass:"restaurant-item"},[a("a",{attrs:{href:t.buttons[0].url,target:"_blank"}},[a("div",{staticClass:"restaurant-image",style:{backgroundImage:"url('"+t.image_url+"')"}}),a("div",{staticClass:"restaurant-name"},[e._v(" "+e._s(t.title)+" ")]),a("div",{staticClass:"restaurant-rating"},[a("span",{staticClass:"iconfont icon-star"}),e._v(" "+e._s(t.rate)+" "),e._l(t.priceLevel,(function(t){return a("span",{key:t,staticClass:"price-level"},[e._v("¥")])}))],2),a("div",{staticClass:"restaurant-desc"},[e._v(" "+e._s(t.subtitle)+" ")])])])})),0)])])},zi=[],qi={props:{message:{type:Object,default:null}},computed:{restaurantResults:function(){return this.message?this.message.attachment_payload.elements.map((function(e){var t=parseInt(e.priceLevel.substr(2));return Object.assign({},e,{priceLevel:t})})):[]}}},Hi=qi,Bi=(a("b1cb"),Object(R["a"])(Hi,Ui,zi,!1,null,"fea2d818",null)),Ki=Bi.exports,Vi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"text-message"},[a("div",{staticClass:"message-box message-box-bot"},[a("span",{domProps:{innerHTML:e._s(e.messageText)}})])])},Yi=[],Wi={props:{message:{type:Object,default:null}},computed:{messageText:function(){if(!this.message)return"";var e=this.message.attachment_payload.template_type,t=this.message.attachment_payload.loads.locale;return'AI Log: Opened '.concat(e,' webview in ').concat(t,"...")}}},Gi=Wi,Qi=(a("f875"),Object(R["a"])(Gi,Vi,Yi,!1,null,"5527a0ff",null)),Ji=Qi.exports,Xi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"widget-container"},[a("div",{staticClass:"message-box message-box-bot weather-result"},[a("span",[e._v(e._s(e.message.attachment_payload.results.location)+e._s(e.$t("weatherResult.weatherIs")))]),a("span",{staticClass:"weather-temp"},[e._v(e._s(e.weatherFormatted.temperature)+"˚C")]),a("span",{staticClass:"weather-text"},[e._v(e._s(e.weatherFormatted.text))]),a("div",{staticClass:"weather-graph"},[a("span",{staticClass:"weather-temp-plus"},[e._v(e._s(e.weatherFormatted.temperature)+"˚C")]),a("span",{staticClass:"weather-icon iconfont",class:"icon-weather-"+e.weatherFormatted.iconCode})])]),a("div",{staticClass:"weather-forecast"},[a("div",{staticClass:"weather-forecast-list"},e._l(e.weatherForecast,(function(t){return a("div",{key:t.date,staticClass:"weather-forecast-item"},[a("div",{staticClass:"date"},[e._v(" "+e._s(t.date)+" ")]),a("div",{staticClass:"icon"},[a("span",{staticClass:"weather-forecast-icon iconfont",class:"icon-weather-"+t.iconCode})]),a("div",{staticClass:"text"},[e._v(" "+e._s(t.text)+" ")]),a("div",{staticClass:"temperature"},[e._v(" "+e._s(t.temperature.high)+"˚C "),a("span",{staticClass:"temp-bar"}),e._v(" "+e._s(t.temperature.low)+"˚C ")])])})),0)])])},Zi=[],es={props:{message:{type:Object,default:null}},computed:{weatherFormatted:function(){if(!this.message)return{};var e=this.message.attachment_payload.results.current,t=e.climate_code,a=e.temperature,n=this.getWeatherIconCode(t),r=this.getWeatherName(t),o=this.$t("weatherResult.".concat(r));return{code:t,iconCode:n,text:o||r,temperature:a}},weatherForecast:function(){var e=this,t=this.message.attachment_payload.results.forecast;return t.map((function(t){var a=e.getWeatherIconCode(t.climate_code),n=e.getWeatherName(t.climate_code),r=e.$t("weatherResult.".concat(n));return{code:t.climate_code,date:t.date,iconCode:a,text:r||n,temperature:t.temperature}}))}},methods:{getWeatherIconCode:function(e){switch(e){case"32":case"34":return"01";case"31":case"33":return"02";case"28":return"03";case"27":return"04";case"30":return"05";case"29":return"06";case"36":return"07";case"19":case"22":return"08";case"26":return"09";case"20":case"21":return"10";case"0":case"2":return"11";case"25":return"12";case"11":case"12":return"13";case"40":return"14";case"42":return"15";case"9":return"16";case"23":case"24":return"17";case"18":return"18";case"14":return"19";case"16":return"20";case"13":case"43":return"21";case"8":return"22";case"6":return"23";case"7":return"24";case"1":case"4":case"37":case"38":case"39":case"47":return"25";case"3":case"45":return"26";case"17":case"10":return"27";case"35":return"28";case"5":case"46":return"29";default:return null}},getWeatherName:function(e){switch(e){case"0":return"Tornado";case"1":return"Tropical";case"2":return"Hurricane";case"3":return"Severe thunder storms";case"4":return"Thunder storms";case"5":return"Mixed rain snow";case"6":return"Mixed rain sleet";case"7":return"Mixed snow sleet";case"8":return"Freezing drizzle";case"9":return"Drizzle";case"10":return"Freezing rain";case"11":return"Showers";case"12":return"Showers";case"13":return"Snow flurries";case"14":return"Light snow showers";case"15":return"Blowing snow";case"16":return"Snow";case"17":return"Hail";case"18":return"Sleet";case"19":return"Dust";case"20":return"Foggy";case"21":return"Haze";case"22":return"Smoky";case"23":return"Blustery";case"24":return"Windy";case"25":return"Cold";case"26":return"Cloudy";case"27":return"Mostly cloudy at Night";case"28":return"Mostly cloudy at Day";case"29":return"Partly cloudy at night";case"30":return"Partly cloudy at day";case"31":return"Clear at night";case"32":return"Sunny";case"33":return"Fair at night";case"34":return"Fair at day";case"35":return"Mixed rain and hail";case"36":return"Hot";case"37":return"Isolated thunder storms";case"38":return"Scattered thunder storms";case"39":return"Scattered thunder storms";case"40":return"Scattered showers";case"41":return"Heavy snow";case"42":return"Scattered snow showers";case"43":return"Heavy snow";case"44":return"Partly cloudy";case"45":return"Thunder showers";case"46":return"Snow showers";case"47":return"Isolated thunder showers";case"48":return"Not available";default:return"Not available"}}}},ts=es,as=(a("872f"),Object(R["a"])(ts,Xi,Zi,!1,null,"64fedde8",null)),ns=as.exports,rs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-box message-box-bot widget-result-wrapper"},[a("div",{staticClass:"widget-result"},[a("div",{staticClass:"coupon-list"},e._l(e.coupons,(function(t){return a("a",{key:t.title,staticClass:"coupon-item",attrs:{href:t.buttons[0].url,target:"_blank"}},[a("div",{staticClass:"coupon-image",style:e.getCouponImageStyle(t)}),a("div",{staticClass:"coupon-name"},[e._v(" "+e._s(t.title)+" ")]),a("div",{staticClass:"coupon-info"},[e._v(" "+e._s(t.subtitle)+" ")]),a("div",{staticClass:"coupon-info"},[a("span",{staticClass:"location"},[e._v(e._s(t.location))]),a("span",{staticClass:"exp-date"},[e._v("Exp: "+e._s(e._f("date")(t.expired_date,"YYYY.MM.DD")))])])])})),0)])])},os=[],is={props:{message:{type:Object,default:null}},computed:{coupons:function(){return this.message.attachment_payload.elements}},methods:{getCouponImageStyle:function(e){var t={};return e.image_url&&(t.backgroundImage='url("'.concat(e.image_url,'")')),t}}},ss=is,ls=(a("afd0"),Object(R["a"])(ss,rs,os,!1,null,"10547d14",null)),cs=ls.exports,us=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-box message-box-bot widget-result-wrapper"},[a("div",{staticClass:"widget-result"},[e.itineraryResultDays.length?a("div",{staticClass:"result-day-options"},e._l(e.itineraryResultDays,(function(t){return a("div",{key:t,staticClass:"result-day-option-item",class:{selected:t===e.currentDay},on:{click:function(a){return e.onResultDayOptionClick(t)}}},[e._v(" Day "+e._s(t)+" ")])})),0):e._e(),a("div",{ref:"itineraryList",staticClass:"itinerary-list"},e._l(e.currentItineraries,(function(t){return a("div",{key:t.title,staticClass:"itinerary-item"},[t.webUrl?a("a",{attrs:{href:t.webUrl.url,target:"_blank"}},[a("div",{staticClass:"itinerary-image",style:{backgroundImage:"url('"+t.image_url+"')"}}),a("div",{staticClass:"itinerary-name"},[e._v(" "+e._s(t.title)+" ")]),a("div",{staticClass:"itinerary-rating"},[a("span",{staticClass:"iconfont icon-star"}),e._v(" "+e._s(t.rate)+" ")]),a("div",{staticClass:"itinerary-desc"},[e._v(" "+e._s(t.subtitle)+" ")])]):e._e(),t.postback?a("a",{staticClass:"itinerary-link",on:{click:function(a){return e.onPostbackClick(t.postback)}}},[e._v(e._s(e.$t("Related products")))]):e._e()])})),0)])])},ds=[],ps={props:{message:{type:Object,default:null}},data:function(){return{currentDay:"1"}},computed:{itineraryResultDays:function(){return this.isRecommandItineraries?[]:Object.keys(this.itineraryResults).map((function(e){return e.substr(4)}))},itineraryResults:function(){return this.message.attachment_payload.elements},isRecommandItineraries:function(){return this.itineraryResults instanceof Array},currentItineraries:function(){var e=[];return e=this.isRecommandItineraries?this.itineraryResults:this.itineraryResults["day-"+this.currentDay],e.forEach((function(e){e.postback=e.buttons.find((function(e){return"postback"===e.type})),e.webUrl=e.buttons.find((function(e){return"web_url"===e.type}))})),e}},methods:{onResultDayOptionClick:function(e){this.currentDay=e,this.$refs.itineraryList.scrollLeft=0}}},ms=ps,fs=(a("37e0"),Object(R["a"])(ms,us,ds,!1,null,"137a0579",null)),gs=fs.exports,hs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-box message-box-bot widget-result-wrapper"},[a("div",{staticClass:"widget-result"},[a("a",{attrs:{href:e.message.attachment_payload.buttons[0].url,target:"_blank"}},[e._v(e._s(e.$t("Click here to check out hotel that fits you")))])])])},_s=[],vs={props:{message:{type:Object,default:null}}},bs=vs,ys=(a("8198"),Object(R["a"])(bs,hs,_s,!1,null,"1b362d79",null)),Cs=ys.exports,ks=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"text-message"},[a("div",{staticClass:"message-box message-box-bot"},[a("span",{staticClass:"iconfont icon-file"}),a("span",[e._v(e._s(e.fileName))]),a("a",{staticClass:"iconfont icon-download",attrs:{href:e.fileUrl,target:"_blank"}})])])},ws=[],$s={props:{message:{type:Object,default:null}},computed:{fileName:function(){return this.message?this.message.attachment_payload.name:""},fileUrl:function(){return this.message?this.message.attachment_payload.url:""}}},Ss=$s,xs=(a("8f0b"),Object(R["a"])(Ss,ks,ws,!1,null,"2d1d1f1c",null)),Ts=xs.exports,Ds=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"text-message"},[a("div",{staticClass:"message-box message-box-bot"},[a("audio",{attrs:{src:e.audioUrl,controls:""}})])])},Ps=[],Os={props:{message:{type:Object,default:null}},computed:{audioUrl:function(){return this.message?this.message.attachment_payload.url:""}}},Is=Os,Rs=(a("11a2"),Object(R["a"])(Is,Ds,Ps,!1,null,"39667118",null)),Es=Rs.exports,Ms=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"message-box message-box-bot widget-result-wrapper"},[a("span",[e._v(e._s(e.message.attachment_payload.text||"Do you like our recommendation?"))])])},Ns=[],js={props:{message:{type:Object,default:null}}},As=js,Ls=(a("8473"),Object(R["a"])(As,Ms,Ns,!1,null,"986fc47c",null)),Fs=Ls.exports,Us={components:{BotMessage:Jo,ButtonWidget:Fi,BotTextMessage:ni,BotImageMessage:ci,UserMessage:Ci,UserTextMessage:Ti,UserImageMessage:Ei,RestaurantWidget:Ki,BotLogMessage:Ji,WeatherWidget:ns,CouponWidget:cs,ItineraryWidget:gs,HotelWidget:Cs,BotFileMessage:Ts,BotAudioMessage:Es,RatingWidget:Fs},data:function(){return{ws:null,loading:!1,scrollTop:0,scrollHeight:0}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])("agent",["currentClientId"])),Object(U["d"])("agent",{messages:function(e){return e.messages.list}})),{},{messageCount:function(){return this.messages.length}}),methods:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["clearMessages","loadMessages","appendMessage"])),Object(U["b"])("pongo",["messageUserReceived","messageReceived","updateStatus"])),{},{checkScrollPosition:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.loading){t.next=2;break}return t.abrupt("return");case 2:if(!(e.$el.scrollTop>10)){t.next=4;break}return t.abrupt("return");case 4:return e.scrollTop=e.$el.scrollTop,e.scrollHeight=e.$el.scrollHeight,e.loading=!0,t.prev=7,t.next=10,e.loadMessages({user:e.currentClientId,ordering:"-timestamp"});case 10:e.$nextTick((function(){e.$el.scrollTop+=e.$el.scrollHeight-e.scrollHeight}));case 11:return t.prev=11,e.loading=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[7,,11,14]])})))()}}),watch:{currentClientId:function(e){e&&(this.clearMessages(),this.checkScrollPosition())},messageCount:function(e,t){var a=this;e>t&&this.$el.scrollHeight-this.$el.offsetHeight-this.$el.scrollTop<100&&this.$nextTick((function(){a.$el.scrollTop=a.$el.scrollHeight}))}}},zs=Us,qs=(a("06b5"),Object(R["a"])(zs,Lo,Fo,!1,null,"65bed8ca",null)),Hs=qs.exports,Bs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"chat-input"},[a("div",{staticClass:"shortcuts"},[e.isAssignToMe?[a("el-popover",{attrs:{"popper-class":"emoji-popover",placement:"top-start","visible-arrow":!1,trigger:"click"},model:{value:e.isEmojiPopShow,callback:function(t){e.isEmojiPopShow=t},expression:"isEmojiPopShow"}},[a("div",{staticClass:"emoji-list"},e._l(e.emojis,(function(t){return a("div",{key:t,staticClass:"emoji-item",on:{click:function(a){return e.onEmojiClick(t)}}},[a("img",{attrs:{src:"/static/emoji/"+t+".png"}})])})),0),a("button",{staticClass:"iconfont icon-emoji",attrs:{slot:"reference"},slot:"reference"})]),a("button",{staticClass:"iconfont icon-image",on:{click:e.onImageShortcutClick}}),a("button",{staticClass:"iconfont icon-file",on:{click:e.onFileShortcutClick}}),a("button",{staticClass:"iconfont icon-media",on:{click:e.onAudioShortcutClick}})]:e._e()],2),a("div",{staticClass:"input-wrapper",class:{disabled:!e.isAssignToMe}},[e.isAssignToMe?a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.messageText,expression:"messageText"}],ref:"inputText",domProps:{value:e.messageText},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onInputEnter.apply(null,arguments)},input:function(t){t.target.composing||(e.messageText=t.target.value)}}}):a("button",{staticClass:"button-assign",on:{click:e.onAssignToMeClick}},[e._v(e._s(e.$t("Assign to me")))])]),e.isAssignToMe?a("div",{staticClass:"input-tips"},[e._v(" "+e._s(e.$t("Please use shift + enter key to send message"))+" ")]):e._e(),e.isAssignToMe?a("button",{staticClass:"button-send",on:{click:e.onSendClick}},[e._v("Send")]):e._e(),a("input",{ref:"inputAuidoFiles",staticClass:"hide",attrs:{type:"file",accept:e.acceptedAudioFormat},on:{change:function(t){return e.fileChange(t.target.files,2)}}}),a("input",{ref:"inputFiles",staticClass:"hide",attrs:{type:"file"},on:{change:function(t){return e.fileChange(t.target.files,4)}}}),a("input",{ref:"inputImageFiles",staticClass:"hide",attrs:{type:"file",accept:"image/*"},on:{change:function(t){return e.fileChange(t.target.files,1)}}})])},Ks=[],Vs=(a("f6d6"),a("fb6a"),["1f600","1f62c","1f601","1f602","1f603","1f604","1f605","1f606","1f607","1f609","1f60a","1f642","1f632","263a","1f60b","1f60c","1f60d","1f618","1f617","1f619","1f61a","1f61c","1f61d","1f61b","1f60e","1f60f","1f636","1f610","1f611","1f612","1f633","1f61e","1f61f","1f620","1f621","1f614","1f615","1f623","1f616","1f62b","1f629","1f624","1f62e","1f631","1f628","1f630","1f62f","1f626","1f627","1f625","1f622","1f62a","1f613","1f62d","1f635","1f637","1f634","1f4a4","1f4a9","1f608","1f47f","1f479","1f47a","1f480","1f47b","1f47d","1f63a","1f638","1f639","1f63b","1f63c","1f63d","1f640","1f63f","1f63e","1f64c","1f44f","1f44b","1f44d","1f44e","1f44a","270a","270c","1f44c","270b","1f450","1f4aa","1f64f","261d","1f446","1f447","1f448","1f449","1f485","1f444","1f445","1f442","1f443","1f440","1f464","1f465","1f476","1f466","1f467","1f468","1f469","1f471","1f474","1f475","1f472","1f473","1f46e","1f477","1f482","1f385","1f47c","1f478","1f470","1f6b6","1f3c3","1f483","1f46f","1f46b","1f46c","1f46d","1f647","1f481","1f645","1f646","1f64b","1f64e","1f64d","1f487","1f486","1f491","1f48f","1f46a","1f45a","1f455","1f456","1f454","1f457","1f459","1f458","1f484","1f48b","1f463","1f460","1f461","1f462","1f45e","1f45f","1f452","1f3a9","1f393","1f451","1f392","1f45d","1f45b","1f45c","1f4bc","1f453","1f48d","1f302"]),Ys={data:function(){return{messageText:"",emojis:Vs,isEmojiPopShow:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{selectedQuickReply:function(e){return e.selectedQuickReply}})),Object(U["c"])("agent",["isAssignToMe","currentClient","currentClientId"])),{},{isWechat:function(){return!!this.currentClient&&2===this.currentClient.provider},acceptedAudioFormat:function(){return this.isWechat?".mp3":"audio/*"}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["getHistoryMessage","appendMessage","setSelectedQuickReply","markAsRead"])),{},{onInputEnter:function(e){e.shiftKey&&(e.preventDefault(),this.sendTextMessage())},onSendClick:function(){this.sendTextMessage()},sendTextMessage:function(){this.messageText&&(this.$api.agent.sendMessage({message:this.messageText,provider:this.currentClient.provider,source:2,user:this.currentClientId}),this.messageText="")},onImageShortcutClick:function(){this.$refs.inputImageFiles.click()},onFileShortcutClick:function(){this.$refs.inputFiles.click()},onAudioShortcutClick:function(){this.$refs.inputAuidoFiles.click()},fileChange:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o,i,s,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.length){n.next=2;break}return n.abrupt("return");case 2:if(r=e[0],!(r.size>20971520)){n.next=6;break}return window.alert("File size can not over 20M"),n.abrupt("return");case 6:return o=new FormData,o.append("file",r),n.prev=8,n.next=11,a.$api.common.uploadFile(o);case 11:i=n.sent,i&&i.file.length&&(s=i.file[0],s.filename=s.name,l={provider:a.currentClient.provider,source:2,user:a.currentClientId,attachment_type:t,attachment_payload:s},a.$api.agent.sendMessage(l));case 13:return n.prev=13,a.$refs.inputAuidoFiles.value=null,a.$refs.inputFiles.value=null,a.$refs.inputImageFiles.value=null,n.finish(13);case 18:case"end":return n.stop()}}),n,null,[[8,,13,18]])})))()},onAssignToMeClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.agent.lockClient(e.currentClientId,{lock_action:1});case 2:e.markAsRead(e.currentClientId),e.messageText="";case 4:case"end":return t.stop()}}),t)})))()},onEmojiClick:function(e){var t=this,a=this.$refs.inputText.selectionStart,n=String.fromCodePoint("0x".concat(e));a>=0?this.messageText=this.messageText.slice(0,a)+n+this.messageText.slice(a,this.messageText.length):this.messageText+=String.fromCodePoint("0x".concat(e)),setTimeout((function(){t.$refs.inputText.setSelectionRange(a+2,a+2)}),0)}}),watch:{selectedQuickReply:function(e){e&&(this.messageText=e.content_text,this.setSelectedQuickReply(null))}}},Ws=Ys,Gs=(a("be66"),a("8b0a"),Object(R["a"])(Ws,Bs,Ks,!1,null,"7aaeba0e",null)),Qs=Gs.exports,Js={components:{ChatHead:Ao,ChatMessageList:Hs,ChatInput:Qs}},Xs=Js,Zs=(a("dbf4"),a("0118"),Object(R["a"])(Xs,Do,Po,!1,null,"0c60b8cf",null)),el=Zs.exports,tl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"clients-container"},[a("ClientTab"),a("ClientSearch"),a("ClientList")],1)},al=[],nl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-tab-wrapper"},[a("div",{staticClass:"client-tab"},[e._l(e.tabs,(function(t){return a("div",{key:t.value,ref:t.value,refInFor:!0,staticClass:"client-tab-item",class:{active:e.currentTab===t.value},on:{click:function(a){return e.onTabClick(t.value)}}},[a("span",[e._v(e._s(t.name))]),e.currentTab!==t.value&&(e.isAllClientHasNew||e.isMyClientHasNew)?a("div",{staticClass:"dot-new"}):e._e()])})),a("div",{staticClass:"tab-active-line",style:{width:e.activeLineWidth+"px",transform:"translateX("+e.activeLineOffset+"px)"}})],2),a("el-tooltip",{attrs:{content:e.toggleTagTip,placement:"bottom"}},[a("button",{staticClass:"iconfont icon-tag",class:{active:e.showClientTag},on:{click:e.onTagToggleClick}})])],1)},rl=[],ol={data:function(){return{activeLineWidth:0,activeLineOffset:0}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{showClientTag:function(e){return e.showClientTag},currentTab:function(e){return e.clientTab},isAllClientHasNew:function(e){return e.isAllClientHasNew},isMyClientHasNew:function(e){return e.isMyClientHasNew}})),{},{tabs:function(){return[{name:this.$t("All client"),value:"all-client"},{name:this.$t("My client"),value:"my-client"}]},toggleTagTip:function(){return this.showClientTag?"Hide tags":"Show tags"}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["setClientTab","setShowClientTag"])),{},{onTabClick:function(e){this.currentTab!==e&&this.setClientTab(e)},moveActiveLine:function(){if(this.currentTab&&this.$refs&&this.$refs[this.currentTab]&&this.$refs[this.currentTab][0]){var e=this.$refs[this.currentTab][0];this.activeLineWidth=e.clientWidth,this.activeLineOffset=e.offsetLeft}},onTagToggleClick:function(){this.setShowClientTag(!this.showClientTag),window.localStorage.setItem("agent_show_tags",this.showClientTag?"1":"0")}}),mounted:function(){this.moveActiveLine();var e=window.localStorage.getItem("agent_show_tags");e&&"1"!==e?this.setShowClientTag(!1):this.setShowClientTag(!0)},watch:{currentTab:function(){this.moveActiveLine()}}},il=ol,sl=(a("89cd"),Object(R["a"])(il,nl,rl,!1,null,"1eefa42d",null)),ll=sl.exports,cl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-list",on:{scroll:e.checkScrollPosition}},[e._l(e.clients.list,(function(e){return a("ClientListItem",{key:e.id+"_"+(e.last_message_detail.id||""),attrs:{client:e}})})),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"loading"})],2)},ul=[],dl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-list-item",class:{active:e.isActive},on:{click:e.onClientClick}},[a("div",{staticClass:"status-color",class:"status-"+e.colorStatus}),a("div",{staticClass:"avatar",class:{online:e.client.is_online}},[a("i",{staticClass:"iconfont icon-chat-client"}),e.client.waitingSeconds>0?a("div",{staticClass:"waiting-secs"},[e._v(" "+e._s(e._f("secondFormat")(e.client.waitingSeconds))+" ")]):e._e()]),a("div",{staticClass:"client-info"},[a("div",{staticClass:"client-name"},[a("span",{domProps:{innerHTML:e._s(e.clientNameHtml)}}),a("span",{staticClass:"provider"},[e._v("-"+e._s(e.clientProviderName))])]),a("div",{staticClass:"last-message"},[a("span",[e._v(e._s(e.lastMessageSource)+": ")]),a("span",{directives:[{name:"plaintext",rawName:"v-plaintext.search",value:e.messageSearchText,expression:"messageSearchText",modifiers:{search:!0}}],domProps:{innerHTML:e._s(e.lastMessageText)}})]),e.showClientTag&&e.tags.length?a("div",{staticClass:"tag-list"},e._l(e.tags,(function(t){return a("div",{key:t.id,staticClass:"tag-list-item",class:"tag-color-"+t.color},[e._v(e._s(t.name))])})),0):e._e()]),a("div",{staticClass:"message-date"},[a("div",[e._v(e._s(e._f("autoDate")(e.client.last_message_detail.timestamp)))]),a("div",{staticClass:"unread"},[e._v(e._s(e.unreadMessageCount))])])])},pl=[],ml=(a("4d63"),a("c607"),a("2c3e"),a("25f0"),{props:{client:{type:Object}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{showClientTag:function(e){return e.showClientTag},currentClient:function(e){return e.currentClient},clientSearch:function(e){return e.clientSearch}})),Object(U["c"])("agent",["isAssignToMe","currentClient","currentClientId"])),{},{messageSearchText:function(){return this.clientSearch.type===ce.MESSAGE?this.clientSearch.searchText:""},clientSearchText:function(){return this.clientSearch.type===ce.CLIENT?this.clientSearch.searchText:""},isActive:function(){return this.currentClient&&this.currentClient.id===this.client.id},colorStatus:function(){return this.client?this.client.color_status:""},clientName:function(){return this.client?this.client.first_name?this.client.first_name+" "+this.client.last_name:this.client.nick_name||this.client.id:""},clientNameHtml:function(){if(this.clientSearchText){var e=new RegExp("(".concat(this.clientSearchText,")"),"ig");return this.clientName.replace(e,'$1')}return this.clientName},clientProvider:function(){return this.client?this.client.provider:null},clientProviderName:function(){var e="";switch(this.clientProvider){case 0:e="TF";break;case 1:case 300:case 301:case 302:e="FB";break;case 2:e="WC";break;case 3:e="SG";break;case 4:e="RCS";break;case 10:case 13:case 17:e="WG";break;case 14:e="WG-SA";break;case 15:e="WG-MP";break;default:break}return e},lastMessageSource:function(){var e="";switch(this.client.last_message_detail.source){case 0:e="Client";break;case 1:e="AI";break;case 2:e="Agent";break;default:break}return e},lastMessageText:function(){return this.client.last_message_detail.message},unreadMessageCount:function(){return this.client.unread_messages_count_detail>9?"9+":this.client.unread_messages_count_detail||""},tags:function(){if(!this.client||!this.client.tag_type_categories_detail)return[];var e=["VIP","Investor","Charter Service","USJ Express","Self-Driving","Offline BKG"];return this.client.tag_type_categories_detail.filter((function(t){return e.indexOf(t.name<0)}))}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["setCurrentClient","markAsRead"])),{},{onClientClick:function(){this.setCurrentClient(this.client),this.isAssignToMe&&this.markAsRead(this.currentClientId)}}),filters:{secondFormat:function(e){var t=e%60,a=Math.floor(e/60);return t<10&&(t="0"+t),a<10&&(a="0"+a),"".concat(a,":").concat(t)}}}),fl=ml,gl=(a("812a"),Object(R["a"])(fl,dl,pl,!1,null,"d8fd6e72",null)),hl=gl.exports,_l={components:{ClientListItem:hl},data:function(){return{loading:!1,audio:null,isAudioPlaying:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{clients:function(e){return e.clients},currentTab:function(e){return e.clientTab},currentStats:function(e){return e.currentStats},clientSearchText:function(e){return e.clientSearch.searchText},clientSearchType:function(e){return e.clientSearch.type}})),{},{totalUrgentMessageCount:function(){return this.clients.list.filter((function(e){return 2===e.color_status})).reduce((function(e,t){return e+(t.unread_messages_count_detail||0)}),0)}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["loadClients","clearClients","initWaitingTimer"])),{},{checkScrollPosition:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.loading){t.next=2;break}return t.abrupt("return");case 2:if(!(e.$el.scrollTop+e.$el.offsetHeight0?"Travelflan (".concat(e,")"):"Travelflan",e>t&&(this.isAudioPlaying=!0,this.audio=new Audio("/static/notify.mp3"),this.audio.addEventListener("ended",(function(){a.audio=null,a.isAudioPlaying=!1})),this.audio.addEventListener("error",(function(){a.audio=null,a.isAudioPlaying=!1})),this.audio.play())}}},vl=_l,bl=(a("1230"),Object(R["a"])(vl,cl,ul,!1,null,"687706b1",null)),yl=bl.exports,Cl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-search"},[a("el-dropdown",{staticClass:"select-search-type",on:{command:e.onSearchTypeCommand}},[a("div",{staticClass:"search-type"},[a("span",{staticClass:"el-icon-arrow-down"}),a("span",[e._v(e._s(e.searchType))])]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"ID"}},[e._v("ID")]),a("el-dropdown-item",{attrs:{command:"Tag"}},[e._v("Tag")]),a("el-dropdown-item",{attrs:{command:"Client"}},[e._v("Client")]),a("el-dropdown-item",{attrs:{command:"Message"}},[e._v("Message")])],1)],1),"Tag"===e.searchType?a("el-select",{staticClass:"tag-select",attrs:{size:"small",filterable:"",remote:"","reserve-keyword":"",placeholder:e.$t("Search"),"remote-method":e.searchTags,loading:e.tagSearching},on:{focus:e.onSelectFocus,change:e.onTagSelectChange},model:{value:e.selectedTag,callback:function(t){e.selectedTag=t},expression:"selectedTag"}},e._l(e.tags,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1):a("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],staticClass:"search-input",attrs:{type:"text",placeholder:e.$t("Search")},domProps:{value:e.searchText},on:{input:function(t){t.target.composing||(e.searchText=t.target.value)}}}),e.searchText||e.selectedTag?a("button",{staticClass:"button-clear-search el-icon-circle-close",on:{click:e.onClearSearchClick}}):e._e()],1)},kl=[],wl=a("b012"),$l=a.n(wl),Sl={data:function(){return{selectedTag:null,tags:[],searchText:"",searchType:"Message",searchResultList:[],tagSearching:!1}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["setClientSearch"])),{},{onSearchTypeCommand:function(e){this.searchType!==e&&(this.searchResultList=[]),this.searchType=e},onSearchChanged:function(){this.setClientSearch({searchText:this.searchText,searchType:this.searchType})},onClearSearchClick:function(){"Tag"===this.searchType&&(this.selectedTag=null,this.onSearchChanged()),this.searchText=""},onSelectFocus:function(){this.searchTags()},searchTags:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={ordering:"-used_count",parent_parent_id:1,depth:3,page_size:5},e&&(n.name__icontains=e),a.prev=2,t.tagSearching=!0,a.next=6,t.$api.agent.getTags(n);case 6:r=a.sent,t.tags=r.results.map((function(e){return{id:e[0].children[0].children[0].id,name:e[0].children[0].children[0].data.name}}));case 8:return a.prev=8,t.tagSearching=!1,a.finish(8);case 11:case"end":return a.stop()}}),a,null,[[2,,8,11]])})))()},onTagSelectChange:function(e){this.setClientSearch({searchText:e,searchType:this.searchType})}}),watch:{searchText:function(){this.onSearchChanged()},searchType:function(e){this.selectedTag=null,this.searchText="","Tag"!==e&&this.setClientSearch({searchText:this.searchText,searchType:this.searchType})}},created:function(){this.onSearchChanged=$l()(this.onSearchChanged,300)}},xl=Sl,Tl=(a("cadd"),Object(R["a"])(xl,Cl,kl,!1,null,"0a2e42ba",null)),Dl=Tl.exports,Pl={components:{ClientTab:ll,ClientList:yl,ClientSearch:Dl}},Ol=Pl,Il=(a("d006"),Object(R["a"])(Ol,tl,al,!1,null,"a1755b3e",null)),Rl=Il.exports,El=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"right-moudle-box"},[a("Tab",{model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}}),"client-info"===e.currentTab&&e.currentClient?[a("ClientInfo"),a("ClientTags"),a("ClientNotes")]:e._e(),"quick-reply"===e.currentTab?a("QuickReply"):e._e()],2)},Ml=[],Nl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"assist-tabs"},[a("div",{staticClass:"tab-item",class:{selected:"client-info"===e.value},on:{click:function(t){return e.onTabSelected("client-info")}}},[e._v(" "+e._s(e.$t("Client info"))+" ")]),a("div",{staticClass:"tab-item",class:{selected:"quick-reply"===e.value},on:{click:function(t){return e.onTabSelected("quick-reply")}}},[e._v(" "+e._s(e.$t("Quick reply"))+" ")])])},jl=[],Al={props:{value:{type:String}},methods:{onTabSelected:function(e){this.$emit("input",e)}}},Ll=Al,Fl=(a("064d"),Object(R["a"])(Ll,Nl,jl,!1,null,"66af41f7",null)),Ul=Fl.exports,zl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-info"},[a("div",{staticClass:"basic-info"},[a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Information"))+" "),e.editMode?[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:e.onSaveClick}},[e._v(e._s(e.$t("Save")))]),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){e.editMode=!1}}},[e._v(e._s(e.$t("Cancel")))])]:a("el-button",{attrs:{size:"mini",type:"text"},on:{click:e.onEditClick}},[e._v(e._s(e.$t("Edit")))])],2),a("div",{staticClass:"info-item"},[a("label",[e._v(e._s(e.$t("Name")))]),e.editMode?a("div",{staticClass:"info-val"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.first_name,expression:"formData.first_name"}],staticClass:"half",attrs:{type:"text"},domProps:{value:e.formData.first_name},on:{input:function(t){t.target.composing||e.$set(e.formData,"first_name",t.target.value)}}}),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.last_name,expression:"formData.last_name"}],staticClass:"half",attrs:{type:"text"},domProps:{value:e.formData.last_name},on:{input:function(t){t.target.composing||e.$set(e.formData,"last_name",t.target.value)}}})]):a("div",{staticClass:"info-val"},[e._v(" "+e._s(e.currentClient.first_name)+" "+e._s(e.currentClient.last_name)+" ")])]),a("div",{staticClass:"info-item"},[a("label",[e._v(e._s(e.$t("Email")))]),e.editMode?a("div",{staticClass:"info-val"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.email,expression:"formData.email"}],attrs:{type:"text"},domProps:{value:e.formData.email},on:{input:function(t){t.target.composing||e.$set(e.formData,"email",t.target.value)}}})]):a("div",{staticClass:"info-val"},[e._v(" "+e._s(e.currentClient.email)+" ")])]),a("div",{staticClass:"info-item"},[a("label",[e._v("ID")]),a("div",{staticClass:"info-val"},[e._v(" "+e._s(e.currentClient.id)+" ")])]),a("div",{staticClass:"info-item"},[a("label",[e._v(e._s(e.$t("Lang")))]),e.editMode?a("div",{staticClass:"info-val"},[a("select",{directives:[{name:"model",rawName:"v-model",value:e.formData.locale,expression:"formData.locale"}],on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.formData,"locale",t.target.multiple?a:a[0])}}},[a("option",{attrs:{value:""}},[e._v(e._s(e.$t("Language unknown")))]),a("option",{attrs:{value:"zh_CN"}},[e._v(e._s(e.$t("Simplified Chinese")))]),a("option",{attrs:{value:"zh_HK"}},[e._v(e._s(e.$t("Traditional Chinese")))]),a("option",{attrs:{value:"en_US"}},[e._v(e._s(e.$t("English")))]),a("option",{attrs:{value:"kr_KO"}},[e._v(e._s(e.$t("Korean")))])])]):a("div",{staticClass:"info-val"},[e._v(" "+e._s(e._f("localeName")(e.currentClient.locale))+" ")])]),a("div",{staticClass:"info-item"},[a("label",[e._v(e._s(e.$t("Phone")))]),e.editMode?a("div",{staticClass:"info-val"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.phone,expression:"formData.phone"}],attrs:{type:"text"},domProps:{value:e.formData.phone},on:{input:function(t){t.target.composing||e.$set(e.formData,"phone",t.target.value)}}}),a("div",{staticClass:"tips"},[e._v(e._s(e.$t("Please include dialing code (e.g. +86)")))])]):e.currentClient.phone?a("div",{staticClass:"info-val"},[e._v(" "+e._s(e.currentClient.phone.country_code)+e._s(e.currentClient.phone.national_number)+" ")]):e._e()])])])},ql=[],Hl={data:function(){return{editMode:!1,formData:{first_name:"",last_name:"",email:"",locale:null,phone:""}}},computed:Object(F["a"])({},Object(U["c"])("agent",["currentClient"])),filters:{localeName:function(e){if(!e)return"Language unknown";switch(e.toLowerCase()){case"en_us":return"English";case"zh_cn":return"Simplified Chinese";case"zh_tw":case"zh_hk":return"Traditional Chinese";case"kr_ko":return"Korean";default:return"Language unknown"}}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["updateClientInfo"])),{},{onEditClick:function(){this.formData.first_name=this.currentClient.first_name,this.formData.last_name=this.currentClient.last_name,this.formData.email=this.currentClient.email,this.formData.locale=this.currentClient.locale,this.currentClient.phone?this.formData.phone=this.currentClient.phone.country_code+this.currentClient.phone.national_number:this.formData.phone="",this.editMode=!0},onSaveClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=Object.assign({},e.formData,{user_id:e.currentClient.id}),t.prev=1,t.next=4,e.updateClientInfo(a);case 4:e.editMode=!1,t.next=12;break;case 7:t.prev=7,t.t0=t["catch"](1),n="",t.t0&&(r=Object.keys(t.t0),r.length&&(n=t.t0[r[0]][0])),e.$message.error(n||"Save failed! ");case 12:case"end":return t.stop()}}),t,null,[[1,7]])})))()}}),watch:{currentClient:function(){this.editMode=!1}}},Bl=Hl,Kl=(a("6f2f"),Object(R["a"])(Bl,zl,ql,!1,null,"43fd0c82",null)),Vl=Kl.exports,Yl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-tags"},[a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Client tags"))+" ")]),a("el-select",{staticClass:"tag-select",attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:e.$t("Search Tags"),"remote-method":e.searchTags,loading:e.loading},on:{focus:e.onSelectFocus,change:e.onTagSelectChange},model:{value:e.selectedTag,callback:function(t){e.selectedTag=t},expression:"selectedTag"}},e._l(e.tags,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),e.clientTags.length?a("div",{staticClass:"tag-list"},e._l(e.clientTags,(function(t){return a("div",{key:t.id,staticClass:"tag-list-item",class:"tag-color-"+t.color},[e._v(" "+e._s(t.name)+" "),a("button",{staticClass:"button-remove-tag el-icon-circle-close",on:{click:function(a){return e.onRemoveTagClick(t.id)}}})])})),0):e._e()],1)},Wl=[],Gl=(a("c740"),{data:function(){return{loading:!1,selectedTag:null,tags:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])("agent",["currentClient"])),{},{clientTags:function(){if(!this.currentClient||!this.currentClient.tag_type_categories_detail)return[];var e=["VIP","Investor","Charter Service","USJ Express","Self-Driving","Offline BKG"];return this.currentClient.tag_type_categories_detail.filter((function(t){return e.indexOf(t.name<0)}))}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["addTagToCurrentClient","removeTagFromCurrentClient"])),{},{onSelectFocus:function(){this.searchTags()},searchTags:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={ordering:"-used_count",parent_parent_id:1,depth:3,page_size:5},e&&(n.name__icontains=e),a.prev=2,t.loading=!0,a.next=6,t.$api.agent.getTags(n);case 6:r=a.sent,t.tags=r.results.map((function(e){return{id:e[0].children[0].children[0].id,name:e[0].children[0].children[0].data.name}}));case 8:return a.prev=8,t.loading=!1,a.finish(8);case 11:case"end":return a.stop()}}),a,null,[[2,,8,11]])})))()},onTagSelectChange:function(e){this.selectedTag=null,e&&(this.clientTags.findIndex((function(t){return t.id===e}))>=0||this.addTagToCurrentClient({tag_type_categories:[e]}))},onRemoveTagClick:function(e){this.removeTagFromCurrentClient(e)}})}),Ql=Gl,Jl=(a("9de2"),Object(R["a"])(Ql,Yl,Wl,!1,null,"26b3abdf",null)),Xl=Jl.exports,Zl=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"client-notes"},[a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Consultation note"))+" "),a("el-button",{staticClass:"button-refresh",attrs:{type:"text"},on:{click:e.getClientNotes}},[e._v(e._s(e.$t("Refresh")))])],1),a("div",{staticClass:"note-list"},e._l(e.clientNotes,(function(t){return a("div",{key:t.id,staticClass:"note-list-item",class:{"self-note":t.user===e.currentClientId}},[e._m(0,!0),a("div",{staticClass:"note-detail"},[a("div",{staticClass:"note-date"},[t.user!==e.currentClientId?a("span",{staticClass:"agent-name"},[e._v(e._s(t.update_agent_detail.first_name))]):e._e(),a("span",[e._v(e._s(e._f("date")(t.create_dt,"MM-DD HH:mm")))])]),a("div",{staticClass:"note-content"},[a("span",{domProps:{innerHTML:e._s(t.note)}})])])])})),0),a("div",{staticClass:"note-input-wrapper"},[a("el-input",{attrs:{placeholder:e.$t("Type notice here...")},nativeOn:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.onInputEnter.apply(null,arguments))}},model:{value:e.inputNote,callback:function(t){e.inputNote=t},expression:"inputNote"}})],1)])},ec=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"avatar"},[a("span",{staticClass:"iconfont icon-chat-client"})])}],tc={data:function(){return{loading:!1,inputNote:"",clientNotes:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("user",["userInfo"])),Object(U["c"])("agent",["currentClientId"])),methods:{getClientNotes:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.agent.getClientNotes(e.currentClientId);case 2:a=t.sent,a.results.forEach((function(e){e.note=e.note.replace(new RegExp(/(?:@)[^\s|,]+/,"ig"),(function(e){return''.concat(e,"")}))})),e.clientNotes=a.results.reverse();case 5:case"end":return t.stop()}}),t)})))()},onInputEnter:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.inputNote){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.$api.agent.createClientNote(e.currentClientId,{note:e.inputNote,update_agent:e.userInfo.user_id,user:e.currentClientId});case 4:e.inputNote="",e.getClientNotes();case 6:case"end":return t.stop()}}),t)})))()}},mounted:function(){this.getClientNotes()},watch:{currentClientId:function(){this.clientNotes=[],this.getClientNotes()}}},ac=tc,nc=(a("3f0c"),Object(R["a"])(ac,Zl,ec,!1,null,"6588b74e",null)),rc=nc.exports,oc=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"qr-container"},[a("div",{staticClass:"search"},[a("el-input",{attrs:{size:"small","prefix-icon":"el-icon-search"},model:{value:e.searchWords,callback:function(t){e.searchWords=t},expression:"searchWords"}}),a("button",{staticClass:"iconfont icon-icon_add_branch",on:{click:e.onCreateQrClick}})],1),e.searchWords.length?a("div",{staticClass:"qr-item-list"},e._l(e.filteredQuickReplies,(function(t){return a("div",{key:t.id,staticClass:"qr-item no-collapse",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0):a("el-collapse",{attrs:{accordion:""},model:{value:e.selectedQuickReply,callback:function(t){e.selectedQuickReply=t},expression:"selectedQuickReply"}},[a("el-collapse-item",{attrs:{title:e.$t("Welcome"),name:3}},[a("div",{staticClass:"qr-item-list"},e._l(e.welcomeQR,(function(t){return a("div",{key:t.id,staticClass:"qr-item",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0)]),a("el-collapse-item",{attrs:{title:e.$t("Common"),name:0}},[a("div",{staticClass:"qr-item-list"},e._l(e.commonQR,(function(t){return a("div",{key:t.id,staticClass:"qr-item",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0)]),a("el-collapse-item",{attrs:{title:e.$t("Upselling"),name:2}},[a("div",{staticClass:"qr-item-list"},e._l(e.upsellingQR,(function(t){return a("div",{key:t.id,staticClass:"qr-item",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0)]),a("el-collapse-item",{attrs:{title:e.$t("User acquisition"),name:1}},[a("div",{staticClass:"qr-item-list"},e._l(e.userAcquisitionQR,(function(t){return a("div",{key:t.id,staticClass:"qr-item",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0)]),a("el-collapse-item",{attrs:{title:e.$t("Promotion"),name:4}},[a("div",{staticClass:"qr-item-list"},e._l(e.promotionQR,(function(t){return a("div",{key:t.id,staticClass:"qr-item",on:{click:function(a){return e.setSelectedQuickReply(t)}}},[a("span",{staticClass:"title",domProps:{innerHTML:e._s(t.title_display)}}),a("span",{staticClass:"content",domProps:{innerHTML:e._s(t.content_text_display)}}),a("div",{staticClass:"actions"},[a("button",{staticClass:"iconfont icon-icon_edit1",on:{click:function(a){return a.stopPropagation(),e.onEditQrClick(t)}}}),a("el-popconfirm",{attrs:{confirmButtonText:e.$t("Yes"),cancelButtonText:e.$t("No"),title:e.$t("Are you sure to delete ?")},on:{onConfirm:function(a){return e.onDeleteQrClick(t)}}},[a("button",{staticClass:"iconfont icon-icon_minus_branch",attrs:{slot:"reference"},on:{click:function(e){e.stopPropagation()}},slot:"reference"})])],1)])})),0)])],1),a("el-dialog",{attrs:{title:e.$t("Quick reply"),visible:e.dialogQuickReplyVisible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogQuickReplyVisible=t}}},[a("el-form",{ref:"quickReplyForm",attrs:{model:e.formData,rules:e.rules}},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"title"}},[a("el-input",{attrs:{placeholder:e.$t("Enter title")},model:{value:e.formData.title,callback:function(t){e.$set(e.formData,"title",t)},expression:"formData.title"}})],1)],1),a("el-col",{attrs:{span:11,offset:1}},[a("el-form-item",{attrs:{prop:"type"}},[a("el-select",{attrs:{placeholder:e.$t("Select category")},model:{value:e.formData.type,callback:function(t){e.$set(e.formData,"type",t)},expression:"formData.type"}},[a("el-option",{attrs:{label:e.$t("Welcome"),value:3}}),a("el-option",{attrs:{label:e.$t("Common"),value:0}}),a("el-option",{attrs:{label:e.$t("Upselling"),value:2}}),a("el-option",{attrs:{label:e.$t("User acquisition"),value:1}}),a("el-option",{attrs:{label:e.$t("Promotion"),value:4}})],1)],1)],1)],1),a("el-form-item",{attrs:{prop:"content_text"}},[a("el-input",{attrs:{type:"textarea",placeholder:e.$t("Input content"),rows:5},model:{value:e.formData.content_text,callback:function(t){e.$set(e.formData,"content_text",t)},expression:"formData.content_text"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.saveQuickReply}},[e._v(e._s(e.$t("Save")))])],1)],1)],1)},ic=[],sc={data:function(){return{selectedQuickReply:1,searchWords:"",dialogQuickReplyVisible:!1,editQuickReply:null,formData:{title:"",type:null,content_text:""}}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])("agent",{quickReplies:function(e){return e.quickReplies}})),{},{filteredQuickReplies:function(){var e=this,t=[];return t=this.searchWords?this.quickReplies.filter((function(t){return t.title.indexOf(e.searchWords)>-1||t.content_text.indexOf(e.searchWords)>-1})):this.quickReplies,t.map((function(t){if(!e.searchWords)return Object.assign({},t,{title_display:t.title,content_text_display:t.content_text});var a=new RegExp("(".concat(e.searchWords,")"),"ig");return Object.assign({},t,{title_display:t.title.replace(a,'$1'),content_text_display:t.content_text.replace(a,'$1')})}))},welcomeQR:function(){return this.filteredQuickReplies.filter((function(e){return 3===e.type}))},commonQR:function(){return this.filteredQuickReplies.filter((function(e){return 0===e.type}))},upsellingQR:function(){return this.filteredQuickReplies.filter((function(e){return 2===e.type}))},userAcquisitionQR:function(){return this.filteredQuickReplies.filter((function(e){return 1===e.type}))},promotionQR:function(){return this.filteredQuickReplies.filter((function(e){return 4===e.type}))},rules:function(){return{title:[{required:!0,message:this.$t("Please enter title"),trigger:"blur"}],type:[{required:!0,message:this.$t("Please select category"),trigger:"change"}],content_text:[{required:!0,message:this.$t("Please enter content"),trigger:"blur"}]}}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["getQuickReplies","setSelectedQuickReply","addQuickReply","updateQuickReply","removeQuickReply"])),{},{saveQuickReply:function(){var e=this;this.$refs.quickReplyForm.validate((function(t){if(t){var a=new FormData;a.append("title",e.formData.title),a.append("content_text",e.formData.content_text),a.append("type",e.formData.type),e.editQuickReply?e.modifyQuickReply(e.editQuickReply.id,a):e.createQuickReply(a)}}))},createQuickReply:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$api.agent.createQuickReply(e);case 3:n=a.sent,t.$message.success(t.$t("Save successfully!")),t.addQuickReply(n),t.dialogQuickReplyVisible=!1,a.next=12;break;case 9:a.prev=9,a.t0=a["catch"](0),a.t0&&a.t0.title&&a.t0.title.length?t.$message.error(a.t0.title[0]):t.$message.error(t.$t("Save failed!"));case 12:case"end":return a.stop()}}),a,null,[[0,9]])})))()},modifyQuickReply:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,a.$api.agent.updateQuickReply(e,t);case 3:r=n.sent,a.$message.success(a.$t("Save successfully!")),a.updateQuickReply(r),a.dialogQuickReplyVisible=!1,n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](0),n.t0&&n.t0.title&&n.t0.title.length?a.$message.error(n.t0.title[0]):a.$message.error(a.$t("Save failed!"));case 12:case"end":return n.stop()}}),n,null,[[0,9]])})))()},onCreateQrClick:function(){this.editQuickReply=null,this.formData.title="",this.formData.type=null,this.formData.content_text="",this.dialogQuickReplyVisible=!0},onEditQrClick:function(e){this.editQuickReply=e,this.formData.title=e.title,this.formData.type=e.type,this.formData.content_text=e.content_text,this.dialogQuickReplyVisible=!0},onDeleteQrClick:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.agent.deleteQuickReply(e.id);case 2:t.removeQuickReply(e.id);case 3:case"end":return a.stop()}}),a)})))()}}),created:function(){this.getQuickReplies()}},lc=sc,cc=(a("1f39"),Object(R["a"])(lc,oc,ic,!1,null,"6a707714",null)),uc=cc.exports,dc={components:{Tab:Ul,ClientInfo:Vl,QuickReply:uc,ClientTags:Xl,ClientNotes:rc},data:function(){return{currentTab:"client-info"}},computed:Object(F["a"])({},Object(U["c"])("agent",["currentClient"]))},pc=dc,mc=(a("7b7e"),Object(R["a"])(pc,El,Ml,!1,null,"2e133b02",null)),fc=mc.exports,gc={data:function(){return{ws:null}},components:{Chat:el,rightMoudle:fc,Clients:Rl},beforeDestroy:function(){this.ws&&(this.ws.onmessage=null,this.ws.onclose=null,this.ws.close(),this.ws=null)},computed:Object(F["a"])({},Object(U["c"])("agent",["currentClient","currentClientId"])),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("agent",["messageReceived","appendMessage","messageDashboardReceived","messageUserReceived","messageOnOfflineReceived","getAllAgents"])),{},{initWebsocket:function(){var e=this,t=this.$env.wssUrl+this.$env.getVendor(),a=window.localStorage.getItem("token");a&&(this.ws&&(this.ws.onmessage=null,this.ws.onclose=null,this.ws.close()),this.ws=new WebSocket("".concat(t,"?token=").concat(a)),this.ws.onmessage=function(t){if(t.target===e.ws){var a=JSON.parse(t.data);e.onWsMessageReceived(a)}},this.ws.onclose=function(){e.initWebsocket()})},onWsMessageReceived:function(e){if("message"===e.cmd){var t=document.getElementById("chat-message-list"),a=t.scrollHeight-t.scrollTop-t.clientHeight<10;this.messageReceived(e),e.user===this.currentClientId&&(this.appendMessage(e),this.$nextTick((function(){a&&(t.scrollTop=t.scrollHeight)})))}else"user"===e.cmd?this.messageUserReceived(e):"offline"===e.cmd||"online"===e.cmd?this.messageOnOfflineReceived(e):"dashboard"===e.cmd?this.messageDashboardReceived(e):"token_expired"===e.cmd&&this.refreshToken()},refreshToken:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=window.localStorage.getItem("token"),window.localStorage.removeItem("token"),t.next=4,e.$api.user.refreshToken({token:a});case 4:n=t.sent,e.$env.setToken(n.token),window.localStorage.setItem("token",n.token),e.initWebsocket();case 8:case"end":return t.stop()}}),t)})))()}}),mounted:function(){this.getAllAgents(),this.initWebsocket()}},hc=gc,_c=(a("149a"),Object(R["a"])(hc,xo,To,!1,null,"b1c8a052",null)),vc=_c.exports,bc=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"order-manage-page"},[a("router-view")],1)},yc=[],Cc={},kc=Cc,wc=(a("b126"),Object(R["a"])(kc,bc,yc,!1,null,"434dc24c",null)),$c=wc.exports,Sc=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"login-container"},[a("div",{staticClass:"form-container"},[e._m(0),a("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules}},[a("el-form-item",{staticClass:"login-form-item",attrs:{prop:"username"}},[a("i",{staticClass:"iconfont icon-user"}),a("el-input",{attrs:{type:"text",placeholder:e.placeholder.email},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),a("el-form-item",{staticClass:"login-form-item",attrs:{prop:"password"}},[a("i",{staticClass:"iconfont icon-password"}),a("el-input",{attrs:{type:"password",maxlength:"14",placeholder:e.placeholder.password},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin.apply(null,arguments)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),a("el-form-item",{staticClass:"login-form-item actions"},[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:e.pending},on:{click:e.handleLogin}},[e.isCn?a("span",[e._v("登录")]):a("span",[e._v("Login")])])],1)],1)],1)])},xc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"logo-container"},[n("img",{staticClass:"logo",attrs:{src:a("0f37"),alt:""}})])}],Tc=(a("d9e2"),{data:function(){var e,t=this.$env.isCn;e=this.$env.isCn?{email:{required:"请输入邮箱",format:"邮箱格式不正确"},password:{required:"请输入密码",format:"密码格式不正确"},failed:"邮箱或密码不正确"}:{email:{required:"Email is required",format:"Invalid email format"},password:{required:"Password is required",format:"Invalid password format"},failed:"Invalid email or password"};var a=function(t,a,n){K(a)?n():n(new Error(e.email.format))},n=function(t,a,n){Y(a)?n():n(new Error(e.password.format))},r={username:[{required:!0,trigger:"blur",message:e.email.required},{validator:a,trigger:"change",message:e.email.format}],password:[{required:!0,trigger:"blur",message:e.password.required},{validator:n,trigger:"change",message:e.password.format}]};return{isCn:t,loginForm:{username:"",password:"",provider:"-1"},pending:!1,loginRules:r,errMessages:e,placeholder:{email:t?"邮箱":"Email",password:t?"密码":"Password"}}},methods:{handleLogin:function(){var e=this;this.$refs.loginForm.validate(function(){var t=Object(L["a"])(regeneratorRuntime.mark((function t(a){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=18;break}return e.pending=!0,t.prev=2,t.next=5,Qr.user.login(e.loginForm);case 5:n=t.sent,window.localStorage.setItem("token",n.token),window.localStorage.setItem("vendor",n.vendor),window.localStorage.setItem("uid",n.user_id),e.$route.query.refer?window.location.href=e.$route.query.refer:window.location.href="/",t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](2),e.$message.error(e.errMessages.failed);case 15:return t.prev=15,e.pending=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})));return function(e){return t.apply(this,arguments)}}())}}}),Dc=Tc,Pc=(a("7eff"),Object(R["a"])(Dc,Sc,xc,!1,null,"f3439666",null)),Oc=Pc.exports,Ic=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-manage"},[a("router-view")],1)},Rc=[],Ec=(a("d2bf"),{}),Mc=Object(R["a"])(Ec,Ic,Rc,!1,null,"6081f9f4",null),Nc=Mc.exports,jc=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-manage-basic"},[a("div",{staticClass:"line-layout"},[a("el-form",{ref:"searchForm",attrs:{size:"small",inline:!0,model:e.searchForm,rules:e.productIdRules,"validate-on-rule-change":!0}},[a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("productmanage.common.Country"),clearable:!1},on:{change:function(t){return e.change("country")}},model:{value:e.searchForm.country_id,callback:function(t){e.$set(e.searchForm,"country_id",t)},expression:"searchForm.country_id"}},e._l(e.getRes(e.countryList),(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("productmanage.common.City"),clearable:!1},on:{change:e.change},model:{value:e.searchForm.city_id,callback:function(t){e.$set(e.searchForm,"city_id",t)},expression:"searchForm.city_id"}},e._l(e.getRes(e.cityList),(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.table.Type"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.searchForm.itemType,callback:function(t){e.$set(e.searchForm,"itemType",t)},expression:"searchForm.itemType"}},e._l(e.getData("productType"),(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("Supplier"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.searchForm.vendor,callback:function(t){e.$set(e.searchForm,"vendor",t)},expression:"searchForm.vendor"}},e._l(e.vendorList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.common.Status"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status",t)},expression:"searchForm.status"}},e._l(e.getData("status"),(function(e){return a("el-option",{directives:[{name:"show",rawName:"v-show",value:"DET"!==e.value,expression:"item.value !== 'DET'"}],key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.common.Platform"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.searchForm.platform,callback:function(t){e.$set(e.searchForm,"platform",t)},expression:"searchForm.platform"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Warehouse"),clearable:!1,"collapse-tags":""},model:{value:e.searchForm.warehouse,callback:function(t){e.$set(e.searchForm,"warehouse",t)},expression:"searchForm.warehouse"}},e._l(e.warehouseList,(function(t){return a("el-option",{key:t.id,attrs:{label:e._f("lang")(t.information.name,e.$i18n.locale),value:t.id}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Overdue status"),clearable:""},model:{value:e.searchForm.expired_type,callback:function(t){e.$set(e.searchForm,"expired_type",t)},expression:"searchForm.expired_type"}},[a("el-option",{attrs:{label:e.$t("Expire in a week"),value:"future"}}),a("el-option",{attrs:{label:e.$t("Expired"),value:"history"}})],1)],1),a("el-form-item",{attrs:{prop:"value"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.searchForm.value,callback:function(t){e.$set(e.searchForm,"value",t)},expression:"searchForm.value"}},[a("el-form-item",{attrs:{slot:"prepend"},slot:"prepend"},[a("el-select",{style:{width:"120px"},on:{change:e.onKeywordTypeChange},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type",t)},expression:"searchForm.type"}},[a("el-option",{attrs:{label:e.$t("productmanage.common.ProductID"),value:"id"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.ProductSN"),value:"sn"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.ProductName"),value:"details__title__icontains"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.SupplierProductID"),value:"supplier_product_sn__icontains"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.OptionName"),value:"options__details__title__icontains"}}),a("el-option",{attrs:{label:"POI ID",value:"pois__id"}}),a("el-option",{attrs:{label:e.$t("POI name"),value:"pois__name__in"}})],1)],1)],1)],1),a("el-form-item",[a("div",{staticClass:"line-layout"},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isSearchDisabled,expression:"isSearchDisabled"}],attrs:{size:"small",disabled:!0}},[e._v(e._s(e.$t("productmanage.common.Search")))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.searchForm.value||e.searchForm.itemType.length||e.searchForm.status.length||e.searchForm.platform.length||e.searchForm.warehouse||e.searchForm.expired_type||e.searchForm.vendor.length,expression:"searchForm.value || searchForm.itemType.length || searchForm.status.length || searchForm.platform.length || searchForm.warehouse || searchForm.expired_type || searchForm.vendor.length"}],attrs:{size:"small",type:"primary"},on:{click:e.getTable}},[e._v(e._s(e.$t("productmanage.common.Search")))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.searchForm.country_id||e.searchForm.city_id||e.searchForm.value||e.searchForm.itemType.length||e.searchForm.status.length||e.searchForm.platform.length||e.searchForm.warehouse||e.searchForm.expired_type||e.searchForm.vendor.length,expression:"searchForm.country_id || searchForm.city_id || searchForm.value || searchForm.itemType.length || searchForm.status.length || searchForm.platform.length || searchForm.warehouse || searchForm.expired_type || searchForm.vendor.length"}],on:{click:e.handleClear}},[e._v(e._s(e.$t("productmanage.table.Clear")))])],1)])],1)],1),a("tablePage",{ref:"tableModule",attrs:{from:e.searchForm}})],1)},Ac=[],Lc=(a("1276"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-container"},[a("div",{staticClass:"cond-box"},[a("el-row",[a("el-col",{attrs:{span:18}},[a("el-button-group",[e._l(e.productStatus,(function(t){return a("el-button",{key:t.value,attrs:{disabled:!e.isOption,type:"default",size:"mini"},on:{click:function(a){return e.handleStatus(t.value)}}},[e._v(e._s(t.text))])})),a("el-button",{attrs:{type:"default",disabled:!e.isOption,size:"mini"},on:{click:function(t){return e.handleStatus("copy")}}},[e._v(e._s(e.$t("productmanage.copy")))])],2),a("el-popconfirm",{attrs:{placement:"bottom",width:"180",title:e.$t("Are you sure to delete ?")},on:{onConfirm:e.handleDet}},[a("el-button",{staticClass:"button-delete",attrs:{slot:"reference",disabled:!e.isOption,plain:"",type:"danger",size:"mini"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)],1),a("el-col",{staticStyle:{"text-align":"right"},attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.jump({name:"Operation",query:{type:"add"}})}}},[e._v(e._s(e.$t("Add")))])],1)],1)],1),a("div",{staticClass:"table-cont2"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"multipleTable",staticClass:"uno-table",staticStyle:{width:"100%"},attrs:{size:"medium",border:"",data:e.tableList,"tooltip-effect":"dark",stripe:"","header-row-class-name":"table-header"},on:{"selection-change":e.handleSelectionChange,"header-click":e.handlePage}},[a("el-table-column",{attrs:{type:"selection",width:"45",fixed:""}}),a("el-table-column",{attrs:{prop:"order",width:"120",sortable:"",fixed:"",label:e.$t("productmanage.table.ID/SN")},scopedSlots:e._u([{key:"default",fn:function(t){return[3!==e.getShow(t.row)?a("el-button",{staticStyle:{padding:"0"},attrs:{slot:"reference",type:"text"},on:{click:function(a){e.jumpOther(e.getShow(t.row),t.row)}},slot:"reference"},[e._v(e._s(t.row.id))]):e._e(),3===e.getShow(t.row)?a("el-popover",{attrs:{placement:"bottom",width:"260",trigger:"click"}},[a("div",{staticStyle:{"text-align":"center"}},[a("div",[e._v(e._s(e.$t("productmanage.common.WhichGo")))]),a("div",{staticStyle:{"margin-top":"10px"}},[a("el-button",{staticStyle:{background:"#1989FA",color:"#fff"},attrs:{size:"small"},on:{click:function(a){return e.jumpOther(1,t.row)}}},[e._v("RCS")]),a("el-button",{staticStyle:{background:"#FF5A60",color:"#fff"},attrs:{size:"small"},on:{click:function(a){return e.jumpOther(2,t.row)}}},[e._v("Marketplace")])],1)]),a("el-button",{staticStyle:{padding:"0"},attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(t.row.id))])],1):e._e(),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",placement:"top-start"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v(" "+e._s(t.row.id)),a("br"),e._v(e._s(t.row.sn)+" ")]),a("div",{staticClass:"cont-btn",on:{click:e.onProductSNClick}},[e._v(" "+e._s(t.row.sn)+" ")])])]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.City"),width:"100","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.pog_cities,(function(t,n){return a("span",{key:t.id},[e._v(e._s((0===n?"":",")+t.name[e.$i18n.locale]))])}))}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.Image"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"img",staticStyle:{"max-height":"34px","max-width":"48px"},attrs:{src:e.row.images.base?e.row.images.base.title:"",alt:""}})]}}])}),a("el-table-column",{attrs:{prop:"type",width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.table.Type")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reverseType(t.row.type))+" ")]}}])}),a("el-table-column",{attrs:{width:"230","min-width":"160","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{on:{click:e.onProductNameClick}},[e._v(e._s(e.countName(t.row.details)))])]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.filterHandlerName}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.table.Name"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{class:{active:"en_US"===e.nameType},attrs:{command:"en_US"}},[e._v(e._s(e.$t("lang.en_US")))]),a("el-dropdown-item",{class:{active:"zh_CN"===e.nameType},attrs:{command:"zh_CN"}},[e._v(e._s(e.$t("lang.zh_CN")))]),a("el-dropdown-item",{class:{active:"zh_HK"===e.nameType},attrs:{command:"zh_HK"}},[e._v(e._s(e.$t("lang.zh_HK")))]),a("el-dropdown-item",{class:{active:"ko_KR"===e.nameType},attrs:{command:"ko_KR"}},[e._v(e._s(e.$t("lang.ko_KR")))])],1)],1)],1)],2),a("el-table-column",{attrs:{width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.priceType+" "+(t.row.mkp_display_price[e.priceType]||""))+" ")]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.filterHandlerPrice}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.common.Price"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.currencies,(function(t){return a("el-dropdown-item",{key:t.id,attrs:{command:t.code}},[e._v(e._s(e.$t(t.code)))])})),1)],1)],1)],2),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reverseStatus(t.row.status))+" ")]}}])}),a("el-table-column",{attrs:{prop:"supplier.name","show-overflow-tooltip":"",label:e.$t("Supplier")}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:e.$t("productmanage.common.Platform")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reversePlatform(t.row.supporting_provider))+" ")]}}])}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:e.$t("Warehouse"),"min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("lang")(t.row.warehouse&&t.row.warehouse.information.name,e.$i18n.locale))+" ")]}}])}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",fixed:"right",align:"center",width:"70px"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"edit",on:{click:function(a){return e.jump({name:"Operation",query:{type:"edit",product_id:t.row.id}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))]),t.row.options&&t.row.options.length>0?a("span",{staticClass:"option",on:{click:function(a){return e.toogleExpand(t.row)}}},[e._v(e._s(e.$t("productmanage.common.Option"))+" "),a("i",{class:t.row.class||"el-icon-arrow-down"})]):e._e()]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])}),Fc=[],Uc=(a("a434"),{data:function(){return{currencies:[],hidden:!1,visible:!1,pictLoading:!0,priceType:"HKD",nameType:"",currentPage:1,page_size:10,total:0,current_size:0,tableList:[],multipleSelection:[],isSend:!0}},props:{from:{type:Object,default:function(){return{}}}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{productStatus:function(){var e=this;return Object.keys(ue).filter((function(e){return"DET"!==e})).map((function(t){return{text:e.$t(ue[t]),value:t}}))},isOption:function(){return this.multipleSelection.length>0},type:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.productType.".concat(t)),value:t.split("|")[1]}}))},reverseType:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},price:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.priceType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.priceType.".concat(t)),value:t}}))},status:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.status.".concat(t)),value:t.split("|")[1]}}))},reverseStatus:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},reversePlatform:function(){return function(e){var t=this,a=[];return e.forEach((function(e){t.platformsMapping[e]&&a.push(t.$t("platform.".concat(t.platformsMapping[e])))})),a.join(",")}},countName:function(){return function(e){var t=this.nameType||this.$i18n.locale,a={en_US:(e.en_US||{}).title,zh_HK:(e.zh_HK||{}).title,zh_CN:(e.zh_CN||{}).title,ko_KR:(e.ko_KR||{}).title};return a[t]||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR}}}),mounted:function(){this.getCurrencies()},methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},onProductSNClick:function(e){G(e.target)&&this.$notify({title:this.$t("Copied"),message:this.$t("Copied SN successfully"),type:"success"})},onProductNameClick:function(e){G(e.target)&&this.$notify({title:this.$t("Copied"),message:this.$t("Copied name successfully"),type:"success"})},handleSelectionChange:function(e){this.multipleSelection=e},handleSizeChange:function(e){this.page_size=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},toogleExpand:function(e){var t=this.$refs.multipleTable;t.toggleRowExpansion(e),e.class="el-icon-arrow-up"===e.class?"el-icon-arrow-down":"el-icon-arrow-up"},getShow:function(e){var t=e.supporting_provider.indexOf(3)>-1||e.supporting_provider.indexOf(4)>-1,a=e.supporting_provider.indexOf(0)>-1||e.supporting_provider.indexOf(2)>-1||e.supporting_provider.indexOf(10)>-1||e.supporting_provider.indexOf(14)>-1||e.supporting_provider.indexOf(15)>-1||e.supporting_provider.indexOf(300)>-1;return t&&a?3:t?1:2},tableChildRes:function(e){var t=[];return e.options.forEach((function(e,a){var n=e.sub_options;n.forEach((function(e,t){"DCT"===e.status&&n.splice(t,1)})),e.matchLength=e.sub_options.length||1,0===e.sub_options.length?(e.option_id="",e.sub_option_id="",e.sub_details={en_US:{title:""},zh_CN:{title:""},zh_HK:{title:""}},e.max_quantity_per_sub_option="",e.sub_price={CNY:"",HKD:"",KRW:"",TWD:"",USD:""},t.push(e)):e.sub_options.forEach((function(a,n){0===n?(e.option_id=e.id,e.sub_option_id=a.id,e.sub_details=a.details,e.max_quantity_per_sub_option=a.max_quantity_per_sub_option,e.sub_price=a.price,t.push(e)):(a.option_id=e.id,a.sub_option_id=a.id,a.sub_price=a.price,a.sub_details=a.details,t.push(a))}))})),t},handlePage:function(e,t){},jump:function(e){var t=this.$router.resolve({name:e.name,query:e.query});window.open(t.href,"_blank")},jumpOther:function(e,t){switch(e){case 1:window.open("".concat(this.$env.rcsUrl,"/products/").concat(t.id),"_blank");break;case 2:window.open("".concat(this.$env.mkpUrl,"/product/").concat(t.seo_sn,"/").concat(t.id),"_blank");break}},clearFilter:function(){this.$refs.multipleTable.clearFilter()},filterHandlerType:function(e,t,a){return t.type===e},filterHandlerPrice:function(e,t,a){this.priceType=e},filterHandlerName:function(e,t,a){this.nameType=e},filterHandlerStatus:function(e,t,a){return t.status===e},filterHandlerPlatform:function(e,t,a){return t.supporting_provider.indexOf(e-0)>-1},getBtnList:function(){var e=this.$i18n.messages.en_US.productmanage.status,t=Object.keys(e);return t.map((function(e,t){return"Delete|DET"!==e?{text:e.split("|")[0],value:e.split("|")[1]}:{type:"pop",text:e.split("|")[0],value:e.split("|")[1]}}))},getList:function(e){var t=this;this.pictLoading=!0,this.currentPage=e||this.currentPage;var a={scope:"TV",pog_countries__id:this.from.country_id||"",pog_cities__id:this.from.city_id||""};this.from.type&&(a[this.from.type]=this.from.value||""),this.from.itemType.length&&(a.type__in=1===this.from.itemType.length?"".concat(this.from.itemType[0],","):this.from.itemType.join(",")),this.from.status.length&&(a.status__in=1===this.from.status.length?"".concat(this.from.status[0],","):this.from.status.join(",")),this.from.platform.length&&(a.platforms__in=this.from.platform.join(",")),this.from.warehouse&&(a.warehouse=this.from.warehouse),this.from.expired_type&&(a.expired_type=this.from.expired_type,"future"===this.from.expired_type&&(a.expire_days=7)),this.from.vendor.length&&(1===this.from.vendor.length?a.supplier__in="".concat(this.from.vendor[0]):a.supplier__in=this.from.vendor.join(",")),this.$api.product.productList(Object(F["a"])(Object(F["a"])({},a),{},{ordering:"-id",page_size:this.page_size,page:this.currentPage})).then((function(e){t.tableList=e.results,t.total=e.count,t.pictLoading=!1,t.current_size=e.results.length}))},handleDet:function(){var e=this;this.$api.product.DetStatus({product_ids:this.multipleSelection.map((function(e){return e.id}))}).then((function(t){e.$message({message:e.$t("successfully"),type:"success",duration:500,onClose:function(){e.getList()}})}))},handleStatus:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if("copy"!==e){a.next=13;break}return n=t.multipleSelection.map((function(e){return e.id})),t.pictLoading=!0,a.prev=3,a.next=6,t.$api.product.copyProducts({product_ids:n});case 6:t.currentPage=1,t.getList();case 8:return a.prev=8,t.pictLoading=!1,a.finish(8);case 11:a.next=14;break;case 13:t.$api.product.putStatus({product_ids:t.multipleSelection.map((function(e){return e.id})),status:e}).then((function(e){t.$message({message:t.$t("successfully"),type:"success",duration:500,onClose:function(){t.getList()}})}));case 14:case"end":return a.stop()}}),a,null,[[3,,8,11]])})))()},objectSpanMethod:function(e){var t=e.row,a=(e.column,e.rowIndex,e.columnIndex);if(0===a){var n=t.matchLength?t.matchLength:0,r=n>0?1:0;return{rowspan:n,colspan:r}}}}}),zc=Uc,qc=(a("56af"),a("6f74"),Object(R["a"])(zc,Lc,Fc,!1,null,"1eaba50c",null)),Hc=qc.exports,Bc={data:function(){return{searchForm:{country_id:"",city_id:"",value:"",itemType:[],status:[],platform:[],type:"details__title__icontains",vendor:[],warehouse:null,expired_type:null},warehouseList:[],countryList:[],cityList:[],vendorList:[]}},components:{tablePage:Hc},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{productIdRules:function(){var e=this,t={},a=function(t){return function(a,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[t])))}},n=this.searchForm.type;return"id"===n?t.value=[{validator:a(this.$t("Product ID")),trigger:"change"},{validator:a(this.$t("Product ID")),trigger:"blur"}]:"pois__id"===n&&(t.value=[{validator:a(this.$t("poi.POIID")),trigger:"change"},{validator:a(this.$t("poi.POIID")),trigger:"blur"}]),t},getRes:function(){var e=this.$i18n.locale;return function(t){var a=this;return t.map((function(t){var n=t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR;return n||(n=a.$options.filters.lang(t.details,a.$i18n.locale,"title")),{label:n,value:t.id}}))}},getData:function(){return function(e){var t=this.$t("productmanage.".concat(e)),a=Object.keys(t);return a.map((function(e){return{label:t[e],value:e.split("|")[1]}}))}},isSearchDisabled:function(){return!this.searchForm.value&&!this.searchForm.itemType.length&&!this.searchForm.status.length&&!this.searchForm.warehouse&&!this.searchForm.expired_type&&!this.searchForm.platform.length&&!this.searchForm.vendor.length}}),methods:{onKeywordTypeChange:function(){this.$refs.searchForm.clearValidate()},getWarehouses:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.warehouse.getWarehouseList();case 2:e.warehouseList=t.sent;case 3:case"end":return t.stop()}}),t)})))()},resetForm:function(e){this.$refs[e].resetFields()},getCountry:function(){var e=this;this.$api.pog.getCountries(1e3).then((function(t){e.countryList=t.results}))},getCity:function(){var e=this;this.$api.pog.getCities(this.searchForm.country_id,1e3).then((function(t){e.cityList=t.results}))},change:function(e){"country"===e&&(this.searchForm.city_id="",this.getCity()),this.getTable()},handleClear:function(){this.searchForm.country_id="",this.searchForm.city_id="",this.searchForm.value="",this.searchForm.itemType=[],this.searchForm.status=[],this.searchForm.platform=[],this.searchForm.warehouse=null,this.searchForm.vendor=[],this.searchForm.vendor=[],this.searchForm.expired_type=null,this.clearCookie("search_data"),this.$refs.tableModule.getList(1)},getTable:function(e){var t=this;this.$refs.searchForm.validate((function(e){if(e){var a=JSON.stringify(t.searchForm);t.setCookie("search_data",a,1/6),t.$refs.tableModule.getList(1)}}))},getVendor:function(){var e=this;this.$api.product.getVendor().then((function(t){e.vendorList=t.map((function(e){return{label:e.name,value:e.id,id:e.id}}))}))},setCookie:function(e,t,a){var n=new Date;n.setTime(n.getTime()+24*a*60*60*1e3);var r="expires="+n.toUTCString();document.cookie="".concat(e,"=").concat(t,";").concat(r,";path=/")},getCookie:function(e){for(var t=e+"=",a=document.cookie.split(";"),n=0;n-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("en_US")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.en_US,callback:function(t){e.$set(e.imageCaptions,"en_US",t)},expression:"imageCaptions.en_US"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"zh_CN"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("zh_CN")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.zh_CN,callback:function(t){e.$set(e.imageCaptions,"zh_CN",t)},expression:"imageCaptions.zh_CN"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"zh_HK"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("zh_HK")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.zh_HK,callback:function(t){e.$set(e.imageCaptions,"zh_HK",t)},expression:"imageCaptions.zh_HK"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"ko_KR"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("ko_KR")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.ko_KR,callback:function(t){e.$set(e.imageCaptions,"ko_KR",t)},expression:"imageCaptions.ko_KR"}})],1):e._e()]),a("button",{staticClass:"button-image-arrow iconfont icon-arrow-left",attrs:{type:"button"},on:{click:e.onImageArrowLeft}}),a("button",{staticClass:"button-image-arrow iconfont icon-arrow-right",attrs:{type:"button"},on:{click:e.onImageArrowRight}})])],2)],1),"ACM"===e.editForm.type?a("el-row",[a("el-col",{attrs:{span:8}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.ContactNumber")+":",prop:"contactNumber"}},[a("el-input",{attrs:{placeholder:e.$t("productmanage.common.ContactNumber")},model:{value:e.editForm.contactNumber,callback:function(t){e.$set(e.editForm,"contactNumber",t)},expression:"editForm.contactNumber"}})],1)],1)]),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.Email")+":",prop:"email"}},[a("el-input",{attrs:{placeholder:e.$t("productmanage.common.Email")},model:{value:e.editForm.email,callback:function(t){e.$set(e.editForm,"email",t)},expression:"editForm.email"}})],1)],1)])],1):e._e(),a("el-row",[a("el-col",{attrs:{span:8}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.Position")+":",prop:"location"}},[a("el-input",{attrs:{placeholder:e.locationPlaceholder},on:{input:function(t){e.editForm.location=e.editForm.location.replace(/[^\d\-,,.]*/g,"").replace(/,/g,",")}},model:{value:e.editForm.location,callback:function(t){e.$set(e.editForm,"location",t)},expression:"editForm.location"}})],1)],1)])],1),e.sensitives.length?a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.SensitiveWording")+":"}},e._l(e.sensitives,(function(t){return a("div",{key:t.lang,staticClass:"sensitives"},[a("div",[e._v(" "+e._s(e.$t("lang."+t.lang))+" ")]),a("div",e._l(t.items,(function(t){return a("span",{key:t.field},[e._v(" ["+e._s(e.feildNames[t.field])+"] "+e._s(t.words)+"; ")])})),0)])})),0)],1)])],1):e._e(),e.snapshotDiffs.length?a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.APIUpdate")+":"}},e._l(e.snapshotDiffs,(function(t){return a("div",{key:t.lang,staticClass:"sensitives"},[a("div",[e._v(" "+e._s(e.$t("lang."+t.lang))+" ")]),a("div",e._l(t.items,(function(t){return a("span",{key:t},[e._v(e._s(e.feildNames[t])+"; ")])})),0)])})),0)],1)])],1):e._e(),a("div",{staticClass:"tab-box"},[a("div",{staticClass:"fold"},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.isFold=!e.isFold}}},[e._v(e._s(e.isFold?e.$t("productmanage.option.Expand"):e.$t("productmanage.common.Fold"))),a("i",{class:e.isFold?"el-icon-arrow-down el-icon--right":"el-icon-arrow-up el-icon--right"})])],1),a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name,closable:e.editableTabs.length>1}},[a("div",{staticClass:"product-box",class:{active:e.isFold}},[e.showInfo?a("product-info",e._b({ref:"productInfo",refInFor:!0,attrs:{"product-type":e.editForm.type,id:t.title,lang:e.editableTabs[e.getIndex]}},"product-info",e.editableTabs[e.getIndex].content,!1,!0)):e._e()],1)])})),e.getPageList.length?a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("productmanage.common.AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)]):e._e()],2)],1),"TKT"===e.editForm.type||"TOR"===e.editForm.type?a("el-form-item",{attrs:{label:e.$t("Time selection")+":"}},[a("el-time-select",{staticStyle:{"margin-right":"10px"},attrs:{"picker-options":{maxTime:e.editForm.book_end_time,format:"HH:mm",start:"00:00",step:"00:15",end:"23:59"},size:"small",placeholder:e.$t("Start time")},model:{value:e.editForm.book_start_time,callback:function(t){e.$set(e.editForm,"book_start_time",t)},expression:"editForm.book_start_time"}}),a("el-time-select",{staticStyle:{"margin-right":"10px"},attrs:{"picker-options":{minTime:e.editForm.book_start_time,format:"HH:mm",start:"00:00",step:"00:15",end:"23:59"},size:"small",placeholder:e.$t("End time")},model:{value:e.editForm.book_end_time,callback:function(t){e.$set(e.editForm,"book_end_time",t)},expression:"editForm.book_end_time"}}),a("el-select",{attrs:{size:"small",placeholder:e.$t("Interval")},model:{value:e.editForm.book_time_interval,callback:function(t){e.$set(e.editForm,"book_time_interval",t)},expression:"editForm.book_time_interval"}},e._l(e.validTimeIntervals,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),a("el-form-item",{attrs:{label:e.$t("Customer note")+":",prop:"has_remark"}},[a("el-radio",{attrs:{label:!1},model:{value:e.editForm.has_remark,callback:function(t){e.$set(e.editForm,"has_remark",t)},expression:"editForm.has_remark"}},[e._v(e._s(e.$t("Customer note no show")))]),a("el-radio",{attrs:{label:!0},model:{value:e.editForm.has_remark,callback:function(t){e.$set(e.editForm,"has_remark",t)},expression:"editForm.has_remark"}},[e._v(e._s(e.$t("Customer note show")))])],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Refundable")+":",prop:"is_cancelable"}},[a("el-radio",{attrs:{label:!1},model:{value:e.editForm.is_cancelable,callback:function(t){e.$set(e.editForm,"is_cancelable",t)},expression:"editForm.is_cancelable"}},[e._v(e._s(e.$t("productmanage.common.NonRefundable")))]),a("el-radio",{attrs:{label:!0},model:{value:e.editForm.is_cancelable,callback:function(t){e.$set(e.editForm,"is_cancelable",t)},expression:"editForm.is_cancelable"}},[e._v(e._s(e.$t("productmanage.common.Refundable")))])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.editForm.internalPlatforms,callback:function(t){e.$set(e.editForm,"internalPlatforms",t)},expression:"editForm.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.editForm.externalPlatforms,callback:function(t){e.$set(e.editForm,"externalPlatforms",t)},expression:"editForm.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Status")+":",prop:"status"}},e._l(e.radios,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.editForm.status,callback:function(t){e.$set(e.editForm,"status",t)},expression:"editForm.status"}},[e._v(e._s(e.$t("productmanage.status."+t.label+"|"+t.value)))])})),1),"edit"===e.pageType?a("el-form-item",{attrs:{label:e.$t("productmanage.common.CreateInfo")+":"}},[a("span",[e._v(e._s(e.createTime))])]):e._e(),"edit"===e.pageType?a("el-form-item",{attrs:{label:e.$t("productmanage.common.UpdateInfo")+":"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showUpdateInfo=!0}}},[e._v(e._s(e.updateTime))])],1):e._e()],1),a("div",{staticClass:"tab-box"},[a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(e._s("add"===e.pageType?e.$t("productmanage.common.SaveAndNext"):e.$t("Save")))])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.product,watchObject:e.$route.query.product_id}}):e._e()],1)],1)},Jc=[],Xc=a("2909"),Zc=(a("b680"),a("a4d3"),a("e01a"),a("bf19"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"productinfo",staticClass:"product-manage-info"},[a("el-form",{ref:"ruleForm",attrs:{model:e.ruleForm,size:"small",rules:e.rules,"label-position":"top"}},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.ProductName"),prop:"title"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.title,callback:function(t){e.$set(e.ruleForm,"title",t)},expression:"ruleForm.title"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.SubTitle"),prop:"sub_description"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.sub_description,callback:function(t){e.$set(e.ruleForm,"sub_description",t)},expression:"ruleForm.sub_description"}})],1),a("el-form-item",{attrs:{label:e.$t("Keyword setting title"),prop:"seo_title"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.seo_title,callback:function(t){e.$set(e.ruleForm,"seo_title",t)},expression:"ruleForm.seo_title"}})],1),a("el-form-item",{attrs:{label:e.$t("Keyword setting description"),prop:"seo_description"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.seo_description,callback:function(t){e.$set(e.ruleForm,"seo_description",t)},expression:"ruleForm.seo_description"}})],1),"ACM"===e.productType?a("el-form-item",{attrs:{label:e.$t("productmanage.common.HotelAddress"),prop:"address"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.address,callback:function(t){e.$set(e.ruleForm,"address",t)},expression:"ruleForm.address"}})],1):e._e(),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Brief"),prop:"brief"}},[a("editor",{attrs:{id:e.id+"0"},on:{onGetContent:function(t){return e.getCont("brief",t)}},model:{value:e.ruleForm.brief,callback:function(t){e.$set(e.ruleForm,"brief",t)},expression:"ruleForm.brief"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Description"),prop:"description"}},[a("editor",{attrs:{id:e.id+"1"},on:{onGetContent:function(t){return e.getCont("description",t)}},model:{value:e.ruleForm.description,callback:function(t){e.$set(e.ruleForm,"description",t)},expression:"ruleForm.description"}})],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"ACM"===e.productType,expression:"productType === 'ACM'"}],attrs:{label:e.$t("productmanage.common.Surrounding"),prop:"extra"}},[a("editor",{attrs:{id:e.id+"7"},on:{onGetContent:function(t){return e.getCont("extra",t)}},model:{value:e.ruleForm.extra,callback:function(t){e.$set(e.ruleForm,"extra",t)},expression:"ruleForm.extra"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.FeeInlcude"),prop:"fee_include"}},[a("editor",{attrs:{id:e.id+"2"},on:{onGetContent:function(t){return e.getCont("fee_include",t)}},model:{value:e.ruleForm.fee_include,callback:function(t){e.$set(e.ruleForm,"fee_include",t)},expression:"ruleForm.fee_include"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.FeeNotInlcude"),prop:"fee_not_include"}},[a("editor",{attrs:{id:e.id+"3"},on:{onGetContent:function(t){return e.getCont("fee_not_include",t)}},model:{value:e.ruleForm.fee_not_include,callback:function(t){e.$set(e.ruleForm,"fee_not_include",t)},expression:"ruleForm.fee_not_include"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Precautions"),prop:"precautions"}},[a("editor",{attrs:{id:e.id+"4"},on:{onGetContent:function(t){return e.getCont("precautions",t)}},model:{value:e.ruleForm.precautions,callback:function(t){e.$set(e.ruleForm,"precautions",t)},expression:"ruleForm.precautions"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.OrderDetail"),prop:"order_detail"}},[a("editor",{attrs:{id:e.id+"5"},on:{onGetContent:function(t){return e.getCont("order_detail",t)}},model:{value:e.ruleForm.order_detail,callback:function(t){e.$set(e.ruleForm,"order_detail",t)},expression:"ruleForm.order_detail"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.RefundPolicy"),prop:"refund_policy"}},[a("editor",{attrs:{id:e.id+"6"},on:{onGetContent:function(t){return e.getCont("refund_policy",t)}},model:{value:e.ruleForm.refund_policy,callback:function(t){e.$set(e.ruleForm,"refund_policy",t)},expression:"ruleForm.refund_policy"}})],1)],1)],1)}),eu=[],tu=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("editor",{attrs:{id:e.id,init:e.init},on:{onGetContent:e.onGetContent},model:{value:e.text,callback:function(t){e.text=t},expression:"text"}}),e.showPictrueUploader?a("dialog-images-uploader",{on:{insert:e.imagesInsert,close:function(t){e.showPictrueUploader=!1}}}):e._e()],1)},au=[],nu=(a("e562"),a("ca72")),ru=(a("ec27"),a("0d68"),a("3aea"),a("07d1"),a("0902"),a("2fec"),a("84ec"),a("4237"),a("4ea8"),a("c3d7"),a("62e5"),a("0efa"),a("64d8"),a("3154"),a("840a"),a("0a9d"),a("d2dc"),a("4bd0"),a("0aa0"),a("fbbd"),a("855b"),a("365e"),a("0335"),a("07d7"),a("2b07"),a("ebac"),a("eda9"),a("ef37"),a("8863"),a("78e4"),a("cfb0"),a("69e4"),a("ffbe"),a("7193"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.$t("Upload images"),"close-on-click-modal":!1,visible:!0,width:"800px","append-to-body":"","before-close":e.close}},[a("el-upload",{staticClass:"upload-demo",attrs:{drag:"",multiple:"",accept:"image/jpeg,image/gif,image/png,image/bmp",action:e.$env.rcsUrl+"/file_upload","http-request":e.request,"on-success":e.success,"before-upload":e.beforeUpload,"on-error":e.error,"on-change":e.change,"file-list":e.fileList,"auto-upload":!0,"list-type":"picture-card"},scopedSlots:e._u([{key:"file",fn:function(t){var n=t.file;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:!n.loaded,expression:"!file.loaded"}],key:n.id,staticClass:"image-item",style:{backgroundImage:"url('"+n.url+"')"}},[n.loaded?e._e():a("i",{staticClass:"image-cancel el-icon-close",on:{click:function(t){return e.cancel(n)}}}),a("span",{staticClass:"el-upload-list__item-actions"},[a("span",{staticClass:"el-upload-list__item-delete",on:{click:function(t){return e.handleRemove(n)}}},[a("i",{staticClass:"el-icon-delete"})])])])}}])},[a("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"})]),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",disabled:!e.valid},on:{click:e.insert}},[e._v(e._s(e.$t("Insert")))])],1)],1)}),ou=[],iu=(a("3ca3"),a("ddb0"),a("2b3d"),a("9861"),{props:{path:{type:String,default:"product"}},data:function(){return{id:this.getId(),fileList:[]}},computed:{valid:function(){return this.fileList.length&&this.fileList.every((function(e){return e.loaded}))}},methods:{getId:function(){return this.id=+new Date,this.id},cancel:function(e){e.raw.cancelflightRequest&&e.raw.cancelflightRequest()},change:function(e,t){this.fileList=t},beforeUpload:function(e){e.id=this.getId()},handleRemove:function(e){var t=this.fileList.findIndex((function(t){return t.raw.id===e.raw.id}));t>-1&&this.fileList.splice(t,1)},success:function(e,t){t.path=e,t.loaded=!0;var a=this.fileList.findIndex((function(e){return e.raw.id===t.raw.id}));a>-1&&this.fileList.splice(a,1,t)},error:function(e){"Cancel"!==e.constructor.name&&this.$message.error(this.$t("Upload failed"))},getBlob:function(e){return new Promise((function(t,a){var n=URL.createObjectURL(e),r=new XMLHttpRequest;r.open("GET",n),r.responseType="blob",r.onload=function(){t(this.response)},r.onerror=a,r.send()}))},request:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=new FormData,a.next=3,t.getBlob(e.file);case 3:return r=a.sent,n.append("file",r,e.file.name),n.append("path",t.path),o=t.$api.common.uploadFile(n,{cancelToken:new Jt.a.CancelToken((function(t){e.file.cancelflightRequest=t}))}),o.finally((function(){e.file.cancelflightRequest=null})),a.abrupt("return",o.then((function(e){return(new Image).src=e.file[0].url,e.file[0].url})));case 9:case"end":return a.stop()}}),a)})))()},close:function(){this.$emit("close")},insert:function(){this.$emit("insert",this.fileList.map((function(e){return{url:e.path}}))),this.close()}}}),su=iu,lu=(a("52f4"),Object(R["a"])(su,ru,ou,!1,null,"4b476520",null)),cu=lu.exports,uu=750,du={props:{id:{type:String},path:{type:String,default:"product"},minHeight:{type:Number,default:160},maxHeight:{type:Number,default:300},value:{type:String,default:""}},components:{Editor:nu["a"],DialogImagesUploader:cu},data:function(){var e=this;return{text:this.value||"",showPictrueUploader:!1,fileList:[],editor:null,init:{language_url:"/tinymce/langs/".concat(e.$i18n.locale,".js"),language:e.$i18n.locale,skin_url:"/tinymce/skins/ui/oxide",min_height:e.minHeight,max_height:e.maxHeight,menubar:!1,statusbar:!1,elementpath:!1,paste_data_images:!0,image_uploadtab:!0,automatic_uploads:!0,branding:!1,image_title:!1,toolbar_mode:"sliding",plugins:["link","charmap","fullscreen","image","lists","autoresize","code"],fontsize_formats:"8px 10px 12px 14px 15px 16px 18px 24px 36px",font_formats:"Noto Sans;Noto Sans kr;Helvetica Neue;PingFang SC;sans-serif;Microsoft YaHei;simsun;serif;FangSong;SimHei;Arial;avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal;monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;zapf dingbats;",toolbar:"undo redo | styleselect | fontselect | fontsizeselect | bold italic | forecolor | underline | image | batch-image | link | alignleft aligncenter alignright alignjustify | bullist numlist | strikethrough | charmap | code | fullscreen",setup:function(t){e.editor=t,t.ui.registry.addIcon("images",''),t.ui.registry.addButton("batch-image",{tooltip:"自定义工具栏按钮",icon:"images",onAction:function(){e.showPictrueUploader=!0}}),t.on("input change undo redo",(function(){t.getContent()})),t.on("OpenWindow",(function(e){var t=e.dialog;e.target;t.originalSetData||(t.originalSetData=t.setData),t.setData=function(e){var a=e.dimensions;if(a){var n=a.width,r=a.height;n&&r&&(e.dimensions={width:uu+"",height:"auto"})}t.originalSetData(e)}}))},images_upload_handler:function(t,a,n){var r=new FormData;r.append("file",t.blob()),r.append("path",e.path),e.$api.common.uploadFile(r).then((function(e){a(e.file[0].url)}))}}}},methods:{onGetContent:function(e){this.$emit("onGetContent"),this.$emit("input",this.text)},imagesInsert:function(e){this.editor.insertContent(e.map((function(e){return'
')})).join(""))}},watch:{text:function(e,t){e!==t&&this.$emit("input",this.text)},value:function(e,t){e!==t&&(this.text=e)}}},pu=du,mu=Object(R["a"])(pu,tu,au,!1,null,null,null),fu=mu.exports,gu={data:function(){return{ruleForm:{title:"",brief:"",description:"",fee_include:"",fee_not_include:"",precautions:"",order_detail:"",refund_policy:"",sub_description:"",seo_title:"",seo_description:"",address:"",extra:""},isFirst:!0}},props:["title","brief","description","seo_title","seo_description","fee_include","fee_not_include","precautions","order_detail","refund_policy","id","sub_description","productType","extra","address"],components:{Editor:fu},computed:{rules:function(){var e=this,t=function(t,a,n){a?a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n():n(new Error(e.$t("productmanage.common.EnterSomething")))},a=function(t,a,n){a&&a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n()},n={title:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],brief:[{required:!0,trigger:"blur",validator:t}],description:[{required:!0,trigger:"blur",validator:t}],order_detail:[{required:!0,trigger:"blur",validator:t}],refund_policy:[{required:!0,trigger:"blur",validator:t}],fee_include:[{trigger:"blur",validator:a}],fee_not_include:[{trigger:"blur",validator:a}],precautions:[{trigger:"blur",validator:a}],seo_title:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],seo_description:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}]};return"ACM"===this.productType&&(n.address=[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],n.extra=[{trigger:"blur",validator:a}]),n}},watch:{title:{handler:function(e){this.ruleForm.title=e||""}},brief:{handler:function(e){this.ruleForm.brief=e||""}},description:{handler:function(e){this.ruleForm.description=e||""}},address:{handler:function(e){this.ruleForm.address=e||""}},fee_include:{handler:function(e){this.ruleForm.fee_include=e||""}},fee_not_include:{handler:function(e){this.ruleForm.fee_not_include=e||""}},precautions:{handler:function(e){this.ruleForm.precautions=e||""}},order_detail:{handler:function(e){this.ruleForm.order_detail=e||""}},refund_policy:{handler:function(e){this.ruleForm.refund_policy=e||""}},sub_description:{handler:function(e){this.ruleForm.sub_description=e||""}},seo_title:{handler:function(e){this.ruleForm.seo_title=e||""}},seo_description:{handler:function(e){this.ruleForm.seo_description=e||""}},extra:{handler:function(e){this.ruleForm.extra=e||""}}},methods:{checkAll:function(){var e=this;return new Promise((function(t,a){e.$refs.ruleForm&&e.$refs.ruleForm.validate((function(e){t(!!e)}))}))},checkValue:function(e){this.$refs.ruleForm&&("all"===e?(this.$refs.ruleForm.validateField("brief"),this.$refs.ruleForm.validateField("description"),this.$refs.ruleForm.validateField("seo_title"),this.$refs.ruleForm.validateField("seo_description"),this.$refs.ruleForm.validateField("order_detail"),this.$refs.ruleForm.validateField("refund_policy"),"ACM"===this.productType&&this.$refs.ruleForm.validateField("address")):void 0!==e&&this.$refs.ruleForm.validateField(e))},getCont:function(e){var t=this;setTimeout((function(){t.$emit("update:title",t.ruleForm.title),t.$emit("update:brief",t.ruleForm.brief),t.$emit("update:description",t.ruleForm.description),t.$emit("update:fee_include",t.ruleForm.fee_include),t.$emit("update:fee_not_include",t.ruleForm.fee_not_include),t.$emit("update:precautions",t.ruleForm.precautions),t.$emit("update:order_detail",t.ruleForm.order_detail),t.$emit("update:refund_policy",t.ruleForm.refund_policy),t.$emit("update:sub_description",t.ruleForm.sub_description),t.$emit("update:seo_title",t.ruleForm.seo_title),t.$emit("update:seo_description",t.ruleForm.seo_description),"ACM"===t.productType&&(t.$emit("update:address",t.ruleForm.address),t.$emit("update:extra",t.ruleForm.extra)),t.checkValue(e)}))},change:function(){this.$emit("update:title",this.ruleForm.title),this.$emit("update:sub_description",this.ruleForm.sub_description),this.$emit("update:seo_title",this.ruleForm.seo_title),this.$emit("update:seo_description",this.ruleForm.seo_description),"ACM"===this.productType&&this.$emit("update:address",this.ruleForm.address)}},beforeMount:function(){this.ruleForm.title=this.title,this.ruleForm.brief=this.brief,this.ruleForm.description=this.description,this.ruleForm.fee_include=this.fee_include,this.ruleForm.fee_not_include=this.fee_not_include,this.ruleForm.precautions=this.precautions,this.ruleForm.order_detail=this.order_detail,this.ruleForm.refund_policy=this.refund_policy,this.ruleForm.sub_description=this.sub_description,this.ruleForm.seo_title=this.seo_title,this.ruleForm.seo_description=this.seo_description,"ACM"===this.productType&&(this.ruleForm.address=this.address,this.ruleForm.extra=this.extra)}},hu=gu,_u=(a("66db"),Object(R["a"])(hu,Zc,eu,!1,null,"6fbeefa6",null)),vu=_u.exports,bu=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"event-wrapper"},[a("el-timeline",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},e._l(e.mappedEvents,(function(t,n){return a("el-timeline-item",{key:n,attrs:{timestamp:t.timestamp,size:"normal","hide-timestamp":!0,type:e.getEventType(t)}},[t.operateType===e.EVENT_OPERATION_TYPE.update?e._l(t.changed,(function(t,n){return a("div",{key:n,staticClass:"event-info"},[e.messages(t,n)?[a("span",{staticClass:"event-info-change-label"},[e._v(e._s(e.messages(t,n).changeLabel))]),a("span",{staticClass:"event-info-field"},[e._v(e._s(e.messages(t,n).field))]),a("span",{staticClass:"event-info-from-label"},[e._v(e._s(e.messages(t,n).fromLabel))]),a("span",{staticClass:"event-info-from-value"},[e._v(e._s(e.messages(t,n).fromValue))]),a("span",{staticClass:"event-info-to-label"},[e._v(e._s(e.messages(t,n).toLabel))]),a("span",{staticClass:"event-info-to-value"},[e._v(e._s(e.messages(t,n).toValue))])]:e._e()],2)})):e._e(),t.operateType===e.EVENT_OPERATION_TYPE.create||t.operateType===e.EVENT_OPERATION_TYPE.delete?[a("div",{staticClass:"event-info"},[e._v(" "+e._s(t.operateTypeName)+" "+e._s(e.objectName))])]:e._e(),a("div",{staticClass:"event-time"},[e._v(e._s(e._f("date")(t.timestamp,"YYYY-MM-DD HH:mm:ss"))+" "),t.operateAgentId?[e._v(e._s(t.operateAgentName))]:[e._v("["+e._s(e.$t("System"))+"]")]],2)],2)})),1),e.loading||e.mappedEvents.length?e._e():a("div",{staticClass:"empty-tip"},[e._v(e._s(e.$t("NoData")))])],1)},yu=[],Cu=a("9558"),ku=Object(Cu["a"])(/(en_US|zh_CN|zh_HK)/,{lang:1}),wu=Object(Cu["a"])(/(HKD|TWD|USD|CNY|KRW)/,{currency:1}),$u=/(?:variants:)(\d+)/,Su=/(?:options:)(\d+)/,xu=/(?:sub_options:)(\d+)/,Tu=/(?:bookings:)(\d+)/,Du=[ku,wu,$u,Su,xu,Tu],Pu=function(e,t){return t.$t("lang.".concat(e))},Ou=function(e,t){return t.$t("".concat(e))},Iu=function(e,t,a){var n=[e],r={};Du.forEach((function(e){var n=e.exec(t);if(n){var o=n[1];switch(e){case ku:t=t.replace(e,"{lang}"),Object.assign(r,{lang:Pu(o,a)});break;case wu:t=t.replace(e,"{currency}"),Object.assign(r,{currency:Ou(o,a)});break;case $u:t=t.replace(e,"variants:{variantId}"),Object.assign(r,{variantId:o});break;case Su:t=t.replace(e,"options:{optionId}"),Object.assign(r,{optionId:o});break;case xu:t=t.replace(e,"sub_options:{suboptionId}"),Object.assign(r,{suboptionId:o});break;case Tu:t=t.replace(e,"bookings:{bookingId}"),Object.assign(r,{bookingId:o});break;default:break}}}));var o=[],i=t.split(":");for(var s in i){var l=i[s];n.push(l),a.$i18n.te(n.join(":"),a.$i18n.locale,r)&&o.push(a.$i18n.t(n.join(":"),a.$i18n.locale,r))}return o.join(":")},Ru=function e(t,a){var n=a;if("[object Object]"===Object.prototype.toString.call(a))for(var r in n={},a)"[object Object]"===Object.prototype.toString.call(a[r])?(n[r]={},n[r]=e(t,a[r])):t[r]?n[r]=t[r](a[r]):n[r]=a[r];return n},Eu=function(e,t,a,n){if("boolean"===typeof a)return n.$t(a.toString());var r=Tu.test(t),o={scope:function(e){return n.$t(Ne[e])},supporting_provider:function(e){var t="";return t=Array.isArray(e)?e.map((function(e){return n.platforms.find((function(t){return t.value===e}))})).filter((function(e){return e})).map((function(e){return n.$t(e.name)})).join(","):n.$t(Ne[e]),t},is_cancelable:function(e){return e?n.$t("productmanage.common.Refundable"):n.$t("productmanage.common.NonRefundable")}};switch(e){case Me.product:Object.assign(o,{status:function(e){return n.$t(ue[e])},type:function(e){return n.$t(de[e])},categories:function(e){if(!e||!e.length)return"[]";var t=[];for(var a in e)t.push(n.$options.filters.lang(e[a].name,n.$i18n.locale));return"[".concat(t.join(","),"]")}});break;case Me.coupon:Object.assign(o,{status:function(e){return n.$t(be[e])}});break;case Me.order:Object.assign(o,{status:function(e){return n.$t(fe[e])},trade_type:function(e){return n.$t(je[e])}}),r&&Object.assign(o,{status:function(e){return n.$t(ge[e])}});break;case Me.tagsystem:break;case Me.poi:Object.assign(o,{status:function(e){return n.$t(ue[e])}});break}var i=t.lastIndexOf(":"),s=t;return i>-1&&(s=t.substring(i+1)),o[s]&&(a=o[s](a)),"[object Object]"===Object.prototype.toString.call(a)&&(a=Ru(o,a)),JSON.stringify(a)},Mu={props:{type:{type:String,required:!0},watchObject:{type:[String,Number]},operateAgent:{type:[String,Number]},operateType:{type:[String,Number]},owner:{type:[String,Number]}},data:function(){return{EVENT_OPERATION_TYPE:Ee,loading:!1,eventsList:[],page:1,noMore:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{objectName:function(){return this.$t("event.".concat(Me[this.type]))},mappedEvents:function(){var e=this;return this.eventsList.map((function(t){return{timestamp:Vt()(t.operate_dt).toDate().toString(),operateAgentName:t.operate_agent_name,operateAgentId:t.operate_agent,operateTypeName:e.$t(t.operate_type),operateType:t.operate_type,changed:t.update_records,snapshot:t.snapshot,owner:t.owner,watchObject:t.watch_object}}))},messages:function(){var e=this;return function(t,a){var n=e.$t("Change"),r=e.$t("from"),o=e.$t("to"),i=Eu(e.type,a,t[0],e),s=Eu(e.type,a,t[1],e),l=Iu(e.type,a,e);return{changeLabel:n,fromLabel:r,toLabel:o,field:l,fromValue:i,toValue:s}}}}),methods:{getEventType:function(e){var t="info";switch(e.operateType){case Ee.update:t="warning";break;case Ee.create:t="primary";break;case Ee.delete:t="danger";break}return t},loadMore:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.page=e.page+1,t.next=3,e.getEvents();case 3:case"end":return t.stop()}}),t)})))()},getEvents:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.watchObject,n=e.operateAgent,r=e.operateType,o=e.owner,i=e.page,s={page_size:10,page:i,ordering:"-operate_dt"},a&&(s.watch_object=a),n&&(s.operate_agent=n),r&&(s.operate_type=r),o&&(s.owner=o),e.loading=!0,t.prev=7,t.next=10,e.$api.events.getEvents(e.type,s);case 10:l=t.sent,e.eventsList=l.results,e.noMore=null!==l.next;case 13:return t.prev=13,e.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[7,,13,16]])})))()}},created:function(){this.page=1,this.getEvents()}},Nu=Mu,ju=(a("4af7"),Object(R["a"])(Nu,bu,yu,!1,null,"fbb3b0fa",null)),Au=ju.exports,Lu=["externalPlatforms","internalPlatforms","limitPurchasedDateRange"],Fu=["language","title"],Uu=1,zu=function(e,t){return Math.random()*(t-e)+e},qu={data:function(){var e=this;return{tagsSet:["Instant Confirmation","Mobile Voucher","Hotel Pick Up","Skip the Line","Free Cancellation","Free Parking","Open Dated Voucher","Audio Guide","Wheel Chair Accessible","Best Seller","Exclusive Travelflan Offer","COVID-19 Safety Measures","Valid during EID Holidays","Authorised Reseller","Official Reseller","500+ Bought","1K+ Bought","1.5K+ Bought","2K+ Bought","3K+ Bought"],EVENT_TYPE:Me,showUpdateInfo:!1,categories:[],displayTagLoading:!1,searchableTagLoading:!1,snapshotDiffs:[],sensitives:[],actionUrl:this.$env.apiUrl+"/file_upload",dialogVisible:!1,isFold:!1,pageType:"add",productId:"",loading:!1,showInfo:!0,editForm:{categories_ids:[],sn:"",type:"",vendor:"",vendor_link:"",has_remark:!1,is_promotion:!1,is_limit_purchased:!1,limit_purchased_num:null,limit_purchased_start_date:null,limit_purchased_end_date:null,limitPurchasedDateRange:null,supplier_product_sn:"",status:"DFT",is_cancelable:!1,pog_country_ids:"",pog_city_ids:[],flan:{priority:5,star_ratings:+zu(4,5).toFixed(1),views:+zu(1e3,3e3).toFixed(0)},tags:[],searchable_tags_ids:[],images:null,location:"",pois_ids:[],display_price:{HKD:0,TWD:0,USD:0,CNY:0},display_discounted_price:{HKD:0,TWD:0,USD:0,CNY:0},acmStar:null,contactNumber:null,email:null,internalPlatforms:[],externalPlatforms:[],warehouse:null,book_start_time:null,book_end_time:null,book_time_interval:null},createTime:"",updateTime:"",dialogImageUrl:"",disabled:!1,countryList:[],cityList:[],vendorList:[],dispalyTagList:[],searchableTagList:[],poiList:[],filstList:[],editableTabs:[],tagPageList:["en_US","zh_CN","zh_HK","ko_KR"],editableTabsValue:e.$i18n.messages.en_US.lang[e.$i18n.locale],checkList:[],isSend:!1,imageCaptions:{en_US:"",zh_CN:"",zh_HK:"",ko_KR:""},currentImageItem:null,warehouseList:[],pickerOptions:{disabledDate:function(e){return e.getTime()-1||t.push(a)})),t},feildNames:function(){return{brief:this.$t("productmanage.common.Brief"),description:this.$t("productmanage.common.Description"),seo_title:this.$t("Keyword setting title"),seo_description:this.$t("Keyword setting description"),fee_include:this.$t("productmanage.common.FeeInlcude"),fee_not_include:this.$t("productmanage.common.FeeNotInlcude"),order_detail:this.$t("productmanage.common.OrderDetail"),precautions:this.$t("productmanage.common.Precautions"),refund_policy:this.$t("productmanage.common.RefundPolicy"),sub_description:this.$t("poi.SubDescription"),title:this.$t("productmanage.common.ProductName"),address:this.$t("productmanage.common.HotelAddress"),extra:this.$t("productmanage.common.Surrounding")}},locationPlaceholder:function(){return this.$t('Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude')}}),methods:{getWarehouses:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.warehouse.getWarehouseList();case 2:e.warehouseList=t.sent;case 3:case"end":return t.stop()}}),t)})))()},onProductTypeChange:function(){this.editForm.categories_ids=[]},getCateogries:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.category.getTree({status:"ACT",depth:1});case 2:a=t.sent,a.results.length&&(e.categories=a.results);case 4:case"end":return t.stop()}}),t)})))()},validatePosition:function(e,t,a){t||a(),/^-?[0-9]+(\.[0-9]{1,4}){0,1},-?[0-9]+(\.[0-9]{1,4}){0,1}$/.test(t)||a(new Error(this.$t("Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths"))),a()},onImageArrowLeft:function(){var e=this,t=this.$refs.upload.uploadFiles.findIndex((function(t){return t.uuid===e.currentImageItem.uuid}));if(t>0){Object.assign(this.currentImageItem.captions,this.imageCaptions);var a=this.filstList.find((function(t){return t.uuid===e.currentImageItem.uuid}));a&&Object.assign(a.captions,this.imageCaptions),this.currentImageItem=this.$refs.upload.uploadFiles[t-1],this.dialogImageUrl=this.currentImageItem.cloundUrl,Object.assign(this.imageCaptions,this.currentImageItem.captions)}},onImageArrowRight:function(){var e=this,t=this.$refs.upload.uploadFiles.findIndex((function(t){return t.uuid===e.currentImageItem.uuid}));if(t0&&t0&&e.editForm[d]>=e.maxSubOptionPurchaseQuantity||"vendor"===d&&e.editForm[d]||"pog_city_ids"===d&&e.editForm[d]&&e.editForm[d].length>0||("location"!==d||e.editForm[d]&&!/^-?[0-9]+(\.[0-9]{1,4}){0,1},-?[0-9]+(\.[0-9]{1,4}){0,1}$/.test(e.editForm[d]))&&("sn"===d&&e.editForm[d]||"images"===d&&e.editForm[d]&&e.editForm[d].base||"acmStar"===d&&null!==e.editForm[d]||("en_US"===a?n||(n="Save failed! Some required fields are not filled in
"):"zh_CN"===a?n||(n="保存失败!以下有必填项未填
"):"zh_HK"===a&&(n||(n="保存失敗!以下有必填項未填
")),n+="[".concat(u[d],"]
"))));return!s.is_limit_purchased||e.editForm.limitPurchasedDateRange&&e.editForm.limitPurchasedDateRange.length||("en_US"===a?n||(n="Save failed! Some required fields are not filled in
"):"zh_CN"===a?n||(n="保存失败!以下有必填项未填
"):"zh_HK"===a&&(n||(n="保存失敗!以下有必填項未填
")),n+="[".concat(e.$t("Restricted period"),"]
")),c.length>0&&c.forEach((function(t,r){"en_US"===a?(n||(n="Save failed! Some required fields are not filled in
"),n+="[".concat(e.$t("lang."+t.language),"]
")):"zh_CN"===a?(n||(n="保存失败!以下有必填项未填
"),n+="[".concat(e.$t("lang."+t.language),"]
")):"zh_HK"===a&&(n||(n="保存失敗!以下有必填項未填
"),n+="[".concat(e.$t("lang."+t.language),"]
"))})),n?(e.$message({dangerouslyUseHTMLString:!0,message:n,type:"error"}),e.isSend=!1,!1):!(!t||!r)&&(e.isSend=!0,s.pog_country_ids=[e.editForm.pog_country_ids],s.pog_city_ids=e.editForm.pog_city_ids,s.display_price=e.editForm.display_discounted_price,s.display_discounted_price=e.editForm.display_price,s.supplier_additional_info={url:e.editForm.vendor_link},"ACM"===e.editForm.type&&(s.flan.acm_star=s.acmStar,s.supplier_additional_info.email=s.email,s.supplier_additional_info.contact_number=s.contactNumber,delete s.acmStar,delete s.email,delete s.contactNumber),delete s.vendor_link,void(s.product_id?(s.supplier_additional_info.count=e.editForm.count,e.$api.product.updateProduct(e.$route.query.product_id,s).then((function(t){e.$message.success(e.$t("Save successfully")),e.isSend=!1}),(function(t){t.sn?e.$message.error(e.$t("productmanage.common.SnErr")):e.$message.error(e.$t("Save failed")),e.isSend=!1}))):e.$api.product.createProduct(s).then((function(t){e.$message.success(e.$t("Save successfully")),window.localStorage.setItem("product_type",s.type),window.localStorage.setItem("supporting_provider",s.supporting_provider),e.$router.push({name:"Operation",query:{type:"add",step:"option",product_id:t.id,lang:e.editableTabs.map((function(e){return e.content.language})).join(",")}}),e.$emit("update:active_name","option"),e.editForm.product_id=t.id,e.isSend=!1}),(function(t){e.isSend=!1,t.sn&&e.$message.error(e.$t("productmanage.common.SnErr"))}))))}));case 8:case"end":return t.stop()}}),t)})))()},getCountry:function(){var e=this;this.$api.pog.getCountries(1e3).then((function(t){e.countryList=t.results}))},getCity:function(){var e=this;this.$api.pog.getCities(this.editForm.pog_country_ids,1e3).then((function(t){e.cityList=t.results}))},getVendor:function(){var e=this;this.$api.product.getVendor().then((function(t){e.vendorList=t.map((function(e){return{label:e.name,value:e.id}}))}))},remoteMethod:function(e,t){var a=this;if(""!==e||t){var n={category__in:"ATR,RTR"};t?n["id__in"]=t:n["details__title__icontains"]=e,this.loading=!0,this.$api.poi.getPois(n).then((function(e){a.loading=!1,e.results&&(a.poiList=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e})))}))}else this.poiList=[]},displayTagRemoteSearch:function(e,t){var a=this;if(""!==e||t){var n={status:"ACT",page_size:100,page:1};t?n["id__in"]=t:n["synonyms__name__icontains"]=e,this.displayTagLoading=!0,this.$api.tag.getList(n).then((function(e){a.displayTagLoading=!1,e.results&&(a.dispalyTagList=e.results.map((function(e){for(var t in e.meta={},e.name)e.meta[t]=e.tag_path[t]+" - "+e.name[t];return e})))}))}else this.dispalyTagList=[]},searchableTagRemoteSearch:function(e,t){var a=this;if(""!==e||t){var n={status:"ACT",page_size:100,page:1};t?n["id__in"]=t:n["synonyms__name__icontains"]=e,this.searchableTagLoading=!0,this.$api.tag.getList(n).then((function(e){a.searchableTagLoading=!1,e.results&&(a.searchableTagList=e.results.map((function(e){for(var t in e.meta={},e.name)e.meta[t]=e.tag_path[t]+" - "+e.name[t];return e})))}))}else this.searchableTagList=[]},formatDate:function(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")},getDetail:function(){var e=this;this.$api.product.getProductDetail({productId:this.$route.query.product_id}).then((function(t){var a,n;e.createTime=t.create_dt?e.formatDate(t.create_dt):"",e.updateTime=t.update_dt?e.formatDate(t.update_dt):"",e.productId=t.id,e.editForm.sn=t.sn,e.editForm.has_remark=!!t.has_remark,e.editForm.type=t.type,e.editForm.product_id=t.id,e.editForm.vendor=(t.supplier||{}).id,e.editForm.status=t.status,e.editForm.is_cancelable=t.is_cancelable,e.editForm.is_promotion=t.is_promotion,e.editForm.is_limit_purchased=t.is_limit_purchased,e.editForm.limit_purchased_num=t.limit_purchased_num,e.editForm.limit_purchased_start_date=t.limit_purchased_start_date,e.editForm.limit_purchased_end_date=t.limit_purchased_end_date,e.editForm.limit_purchased_start_date||e.editForm.limit_purchased_end_date?e.editForm.limitPurchasedDateRange=[e.editForm.limit_purchased_start_date,e.editForm.limit_purchased_end_date]:e.editForm.limitPurchasedDateRange=null,e.editForm.pog_country_ids=t.pog_countries[0]?t.pog_countries[0].id:"",e.editForm.flan.priority=t.flan.priority-0,e.editForm.flan.star_ratings=t.flan.star_ratings-0,e.editForm.flan.views=t.flan.views-0,e.editForm.location=t.position?t.position.coordinates.join(","):"",e.editForm.supplier_product_sn=t.supplier_product_sn,e.editForm.pog_city_ids=t.pog_cities.map((function(e){return e.id})),e.editForm.pois_ids=t.pois.map((function(e){return e.id})),e.editForm.warehouse=t.warehouse&&t.warehouse.id,e.editForm.book_start_time=t.book_start_time,e.editForm.book_end_time=t.book_end_time,e.editForm.book_time_interval=t.book_time_interval,e.editForm.tags=t.tags,t.supporting_provider.forEach((function(t){e.internalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.editForm.internalPlatforms.push(t),e.externalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.editForm.externalPlatforms.push(t)})),e.editForm.searchable_tags_ids=t.searchable_tags.map((function(e){return e.id})),e.editForm.vendor_link=t.supplier_additional_info.url,e.editForm.count=t.supplier_additional_info.count,t.categories&&(e.editForm.categories_ids=t.categories.map((function(e){return e.id}))),"ACM"===t.type&&(e.editForm.acmStar=t.flan.acm_star,e.editForm.email=t.supplier_additional_info.email,e.editForm.contactNumber=t.supplier_additional_info.contact_number),e.remoteMethod("",e.editForm.pois_ids.join(",")),e.searchableTagRemoteSearch("",e.editForm.searchable_tags_ids.join(",")),e.poiList=(t.data||[]).map((function(e){return Object.keys(e.meta).forEach((function(t){e.meta[t]=e.meta[t].name})),e})),e.$emit("update:product_type",t.type),Object.keys(t.details).forEach((function(a,n){if(0===n&&(e.$emit("update:product_name",t.details[a].title),e.editableTabsValue=a),e.editableTabs.push({title:a,name:a,content:{language:a,title:t.details[a].title,brief:t.details[a].meta.brief,description:t.details[a].meta.description,seo_title:t.details[a].meta.seo_title,seo_description:t.details[a].meta.seo_description,fee_include:t.details[a].meta.fee_include,fee_not_include:t.details[a].meta.fee_not_include,precautions:t.details[a].meta.precautions,order_detail:t.details[a].meta.order_detail,refund_policy:t.details[a].meta.refund_policy,sub_description:t.details[a].meta.sub_description||"",address:t.details[a].meta.address,extra:t.details[a].meta.extra}}),t.details[a].additional_info&&t.details[a].additional_info.sensitive_result){var r=t.details[a].additional_info.sensitive_result,o=[];Object.keys(r).forEach((function(e){r[e].length&&o.push({field:e,words:r[e].join(",")})})),e.sensitives.push({lang:a,items:o})}if(t.details[a].additional_info&&t.details[a].additional_info.snapshot_diff&&t.details[a].additional_info.snapshot_diff.length){var i=t.details[a].additional_info.snapshot_diff;e.snapshotDiffs.push({lang:a,items:i})}}));var r="",o=t.images.base.title,i=t.images.base.backgrounds.map((function(e,a){0===a&&(r=e);var n={en_US:"",zh_CN:"",zh_HK:"",ko_KR:""};return t.images.captions&&t.images.captions.backgrounds&&t.images.captions.backgrounds.length>a&&Object.assign(n,t.images.captions.backgrounds[a]),{uuid:Uu++,cloundUrl:e,url:e,captions:n}}));if(o&&o!==r){var s={en_US:"",zh_CN:"",zh_HK:"",ko_KR:""};t.images.captions&&t.images.captions.title&&Object.assign(s,t.images.captions.title),i.unshift({uuid:Uu++,cloundUrl:t.images.base.title,url:t.images.base.title,captions:s})}(a=e.filstList).push.apply(a,Object(Xc["a"])(i)),(n=e.$refs.upload.uploadFiles).push.apply(n,Object(Xc["a"])(i)),e.handleImage(),e.getCity(),t.options.forEach((function(t){t.sub_options.forEach((function(t){e.maxSubOptionPurchaseQuantity=Math.max(e.maxSubOptionPurchaseQuantity,t.max_purchase_quantity)}))}))}))},fillDefaultContent:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.product.getDefaultContent(e);case 2:for(n=a.sent,t.defaultContent=n,r=function(e){var a=t.editableTabs[e],r=n.meta[a.name];Object.keys(r).forEach((function(e){a.content[e]=r[e]}))},o=0;o1?a("el-button",{staticStyle:{"margin-right":"15px"},attrs:{type:"text"},on:{click:e.onOptionSortingShow}},[e._v(e._s(e.$t("Sorting")))]):e._e(),a("el-button",{attrs:{type:"text"},on:{click:e.switchChage}},[e._v(e._s(e.advanceValue?e.$t("productmanage.common.Fold"):e.$t("productmanage.option.Expand"))),a("i",{class:e.advanceValue?"el-icon-arrow-up el-icon--right":"el-icon-arrow-down el-icon--right"})]),a("el-dropdown",{attrs:{"split-button":"",plain:"",size:"small"},on:{click:e.handleClick,command:e.handleCommand}},[e._v(" "+e._s(e.$t("Add"))+" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"copy"}},[e._v(e._s(e.$t("productmanage.option.DuplicateCurrentOption")))]),a("el-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:!("DCT"===e.getCurrentTab.status||"EXP"===e.getCurrentTab.status),expression:"!(getCurrentTab.status === 'DCT' || getCurrentTab.status === 'EXP')"}],attrs:{command:"DCT"}},[e._v(e._s(e.$t("productmanage.option.HideCurrentOption")))]),a("el-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:"DCT"===e.getCurrentTab.status||"EXP"===e.getCurrentTab.status,expression:"getCurrentTab.status === 'DCT' || getCurrentTab.status === 'EXP'"}],attrs:{command:"ACT"}},[e._v(e._s(e.$t("productmanage.option.ShowCurrentOption")))])],1)],1)],1)])],1),a("div",{staticClass:"cont"},e._l(e.getCurrentTab.option,(function(t,n){return a("div",{key:n,staticClass:"list-box"},[a("div",{staticClass:"list_item"},[a("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:e.$t("productmanage.table.Name")+":",prop:"name","label-width":"122px",rules:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}]}},[a("div",{staticClass:"grid-content bg-purple"},[a("el-form-item",{attrs:{prop:"voucher_type"}},[a("el-input",{attrs:{placeholder:e.$t("productmanage.common.OptionName"),size:"small"},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"item.name"}},[a("template",{slot:"prepend"},[e._v(e._s(t.title))])],2)],1)],1)])],1),a("transition",{attrs:{name:"fade"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.advanceValue,expression:"advanceValue"}],key:n,staticClass:"edit"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.Note")+":",error:e.isDescriptionHasError(t.description),"label-width":"122px"}},[e.advanceValue2?a("div",[a("editor",{model:{value:t.description,callback:function(a){e.$set(t,"description",a)},expression:"item.description"}})],1):e._e()])],1)])],1)})),0),a("el-row",{staticClass:"select-box"},[a("el-col",{attrs:{span:7}},[a("div",{staticClass:"voucher",class:{title:e.$t("productmanage.option.RedeemMethod").indexOf("
")>-1}},[a("el-form-item",{attrs:{prop:"voucher_type",rules:[{required:!0,message:e.$t("ItsRequired"),trigger:"change"}],"label-width":"122px"}},[a("template",{slot:"label"},[a("span",{domProps:{innerHTML:e._s(e.$t("productmanage.option.RedeemMethod")+":")}})]),a("el-select",{model:{value:e.getCurrentTab.voucher_type,callback:function(t){e.$set(e.getCurrentTab,"voucher_type",t)},expression:"getCurrentTab.voucher_type"}},e._l(e.getVoucherType,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],2)],1)]),a("el-col",{attrs:{span:7}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"DEI"!==e.showDate,expression:"showDate !== 'DEI'"}],attrs:{prop:"book_date_required",label:e.$t("productmanage.option.SpecificDate")+":"}},[a("el-select",{model:{value:e.getCurrentTab.book_date_required,callback:function(t){e.$set(e.getCurrentTab,"book_date_required",t)},expression:"getCurrentTab.book_date_required"}},[a("el-option",{attrs:{label:"Yes",value:!0}}),a("el-option",{attrs:{label:"No",value:!1}})],1)],1)],1)],1),a("el-row",{staticClass:"select-box"},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"date",label:e.$t("productmanage.option.SellPeriod")+":","label-width":"122px"}},[a("el-date-picker",{attrs:{type:"daterange",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd","range-separator":"to","picker-options":e.pickerOptions,"start-placeholder":e.$t("productmanage.option.StartDate"),"end-placeholder":e.$t("productmanage.option.EndDate")},model:{value:e.getCurrentTab.option_date,callback:function(t){e.$set(e.getCurrentTab,"option_date",t)},expression:"getCurrentTab.option_date"}})],1)],1)],1),a("el-divider"),a("div",{staticClass:"sub-option"},[a("div",{staticClass:"sub-tabs"},[a("el-row",[a("el-col",{attrs:{span:16}},[a("el-tabs",{ref:"subOptionTab",attrs:{type:"card",closable:e.getSubCloseStatus},on:{edit:e.handleSubTabsEdit,"tab-click":e.subTabClick},model:{value:e.editableTabs[e.getCurrentIndex].sub_option.activeName,callback:function(t){e.$set(e.editableTabs[e.getCurrentIndex].sub_option,"activeName",t)},expression:"editableTabs[getCurrentIndex].sub_option.activeName"}},e._l(e.editableTabs[e.getCurrentIndex].sub_option.option,(function(t,n){return a("el-tab-pane",{key:t.name+"-",attrs:{label:t.title,name:t.name}},[a("template",{slot:"label"},[a("span",[a("el-popover",{attrs:{placement:"bottom",width:"180",trigger:"manual"},model:{value:t.visible,callback:function(a){e.$set(t,"visible",a)},expression:"item.visible"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete ?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){t.visible=!1}}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.removeSub(t,n)}}},[e._v(e._s(e.$t("Confirm")))])],1),a("div",{staticClass:"title-label",attrs:{slot:"reference"},slot:"reference"},[a("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:"DCT"===t.status,expression:"item.status === 'DCT'"}],staticClass:"item",attrs:{effect:"dark",content:"hidden",placement:"bottom"}},[a("el-button",{staticClass:"hidden-btn"})],1),e._v(e._s(e.getSubTitle(n)||t.title))],1)])],1)])],2)})),1)],1),a("el-col",{attrs:{span:8}},[a("div",{staticClass:"right-btn"},[e.editableTabs[e.getCurrentIndex]&&e.editableTabs[e.getCurrentIndex].sub_option.option.length>1?a("el-button",{staticStyle:{"margin-right":"15px"},attrs:{type:"text"},on:{click:e.onSuboptionSortingShow}},[e._v(e._s(e.$t("Sorting")))]):e._e(),a("el-dropdown",{attrs:{"split-button":"",plain:"",size:"small"},on:{click:e.handleSubClick,command:e.handleSubCommand}},[e._v(" "+e._s(e.$t("Edit"))+" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"add"}},[e._v(e._s(e.$t("productmanage.option.AddNewSub")))]),a("el-dropdown-item",{attrs:{command:"copy"}},[e._v(e._s(e.$t("productmanage.option.DuplicateCurrentSub")))]),"ACT"===e.getCurrentSubOption.status?a("el-dropdown-item",{attrs:{command:"hide"}},[e._v(e._s(e.$t("productmanage.option.HideCurrentSub")))]):e._e(),"DCT"===e.getCurrentSubOption.status?a("el-dropdown-item",{attrs:{command:"hide"}},[e._v(e._s(e.$t("productmanage.option.ShowCurrentSub")))]):e._e()],1)],1)],1)])],1)],1),"DEI"!==e.showDate&&e.getCurrentTab.book_date_required?a("div",{staticClass:"date-box"},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("div",{staticClass:"cont-box"},[a("el-calendar",{attrs:{disabledDate:""},scopedSlots:e._u([{key:"dateCell",fn:function(t){t.date;var n=t.data;return[a("p",{staticClass:"calendar-date-title",class:{disable:e.getDisable(n.day)}},[e._v(e._s(n.day.split("-").slice(1).join("-")))]),a("div",{class:{disable:e.getDisable(n.day)||0==e.getCurrentSubOption.cont.max_quantity_per_sub_option}},[a("p",{directives:[{name:"loading",rawName:"v-loading",value:e.currenciesLoading,expression:"currenciesLoading"}],staticClass:"calendar-date-title"},[e._v(e._s(1===e.getDayStatus(n.day)?e.getCurrentSymbol()+e.getCurrentSubOption.cont.price[e.getCurrentSubOption.currencyType]:""))]),1===e.getDayStatus(n.day)&&0==e.getCurrentSubOption.cont.max_quantity_per_sub_option?a("p",{staticClass:"calendar-date-title red"},[e._v(e._s(e.$t("productmanage.option.SoldOut")))]):e._e()])]}}],null,!1,2612286813),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1),a("div",{staticClass:"right-select"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handlePrice}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.priceType."+e.getCurrentSubOption.currencyType))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPrice,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t.value}},[e._v(e._s(t.text))])})),1)],1),a("el-button",{staticClass:"mult-btn",attrs:{size:"small"},on:{click:e.handleDialog}},[e._v(e._s(e.$t("productmanage.option.MultiSetting")))])],1)])]),a("el-col",{staticClass:"right-cont",attrs:{span:6}},[a("div",{staticClass:"grid-content bordertop"},[a("div",{staticClass:"cont-box margintop right"},[a("p",{staticClass:"date-title"},[e._v(e._s(e.formDate(e.value)))]),a("div",{staticClass:"date-item currency-item"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.Price")))]),a("div",{staticClass:"price-list"},e._l(e.getCurrentSubOption.cont.price,(function(t,n){return a("p",{key:n,staticClass:"info"},[e._v(e._s(n)+" "+e._s(t))])})),0)]),a("div",{staticClass:"date-item stock-item"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.Stock")))]),a("div",{staticClass:"title num",class:{red:0===e.getCurrentSubOption.cont.max_quantity_per_sub_option}},[e._v(e._s(-1===e.getCurrentSubOption.cont.max_quantity_per_sub_option?e.$t("productmanage.option.Unlimited"):0==e.getCurrentSubOption.cont.max_quantity_per_sub_option?"Sold out":e.getCurrentSubOption.cont.max_quantity_per_sub_option))])]),a("div",{staticClass:"date-item status-item"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.Status")))]),a("div",[a("el-radio-group",{attrs:{disabled:e.getDisable(e.formDate(e.value))},on:{change:e.change},model:{value:e.getRadioStatus,callback:function(t){e.getRadioStatus=t},expression:"getRadioStatus"}},[a("p",{staticClass:"info sale"},[a("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("productmanage.option.ForSale")))])],1),a("p",{staticClass:"info"},[a("el-radio",{attrs:{label:2}},[e._v(e._s(e.$t("productmanage.option.NotForSale")))])],1)])],1)])])])])],1)],1):a("div",{staticClass:"price-box"},[a("el-row",[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"date-item currency-item"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.Price")))]),a("div",{staticClass:"price-list"},e._l(e.getCurrentSubOption.cont.price,(function(t,n){return a("p",{key:n,staticClass:"info"},[e._v(e._s(n)+" "+e._s(t))])})),0)])]),a("el-col",{attrs:{span:6}},[a("div",{staticClass:"date-item stock-item"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.Stock")))]),a("div",{staticClass:"title num",class:{red:0===e.getCurrentSubOption.cont.max_quantity_per_sub_option}},[e._v(e._s(-1===e.getCurrentSubOption.cont.max_quantity_per_sub_option?e.$t("productmanage.option.Unlimited"):0==e.getCurrentSubOption.cont.max_quantity_per_sub_option?e.$t("productmanage.option.SoldOut"):e.getCurrentSubOption.cont.max_quantity_per_sub_option))])])])],1)],1)])],1):e._e(),e.dialogTableVisible?a("sub-set",e._b({attrs:{visible:e.dialogTableVisible,show:e.getCurrentTab.book_date_required,suboption:e.getCurrentSubOption,add:e.getCurrentTab.sub_option.option.slice(-1)[0].name-0+1+"",lang:e.lang,"click-type":e.clickType,limit:e.limit},on:{"update:visible":function(t){e.dialogTableVisible=t},save:e.confirm}},"sub-set",e.getCurrentSubOption,!1,!0)):e._e(),a("rank-date",{attrs:{visible:e.dialogDate},on:{"update:visible":function(t){e.dialogDate=t},save:e.handleDate}}),"add"===e.$route.query.type?a("div",[a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.save("DFT")}}},[e._v(e._s(e.$t("productmanage.option.SaveToDraft")))]),a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.save("REV")}}},[e._v(e._s(e.$t("productmanage.option.SaveToReview")))]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.save("ACT")}}},[e._v(e._s(e.$t("productmanage.option.SaveToShow")))])],1):e._e(),"edit"===e.$route.query.type?a("div",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.save(e.status)}}},[e._v(e._s(e.$t("Save")))])],1):e._e(),a("el-dialog",{attrs:{title:e.$t("Option sorting"),visible:e.dialogOptionSortingVisible,width:"500"},on:{"update:visible":function(t){e.dialogOptionSortingVisible=t}}},[a("div",{ref:"OptionSorting",staticClass:"option-name-list"},e._l(e.editableTabs,(function(t,n){return a("div",{key:t.name,staticClass:"option-name-item"},[e._v(" "+e._s(e.getTitle(n)||t.title)+" "),a("div",{staticClass:"moveable handle"})])})),0)]),a("el-dialog",{attrs:{title:e.$t("Suboption sorting"),visible:e.dialogSuboptionSortingVisible,width:"500"},on:{"update:visible":function(t){e.dialogSuboptionSortingVisible=t}}},[e.editableTabs[e.getCurrentIndex]?a("div",{ref:"SuboptionSorting",staticClass:"option-name-list"},e._l(e.editableTabs[e.getCurrentIndex].sub_option.option,(function(t,n){return a("div",{key:t.name+"-",staticClass:"option-name-item"},[e._v(" "+e._s(e.getSubTitle(n)||t.title)+" "),a("div",{staticClass:"moveable handle"})])})),0):e._e()])],1)},Yu=[],Wu=a("aa47"),Gu=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sub-setting"},[a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.currenciesLoading,expression:"currenciesLoading"}],attrs:{title:e.getTitle,visible:e.visibleData},on:{"update:visible":function(t){e.visibleData=t}}},[a("el-form",{ref:"form",attrs:{model:e.fromData,"label-width":"120px",size:"small",rules:e.rules}},[a("el-row",{staticClass:"mg20",attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content bg-purple"},[a("el-form-item",{attrs:{label:"ID:"}},[e._v(e._s(e.fromData.id||"-"))])],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content bg-purple",class:{Vendor:e.$t("SupplierSuboptionSN").indexOf("
")>-1}},[a("el-form-item",[a("template",{slot:"label"},[a("span",{domProps:{innerHTML:e._s(e.$t("SupplierSuboptionSN")+":")}})]),a("el-input",{attrs:{placeholder:"Option"},model:{value:e.fromData.supplier_sub_option_sn,callback:function(t){e.$set(e.fromData,"supplier_sub_option_sn",t)},expression:"fromData.supplier_sub_option_sn"}})],2)],1)])],1),a("el-form-item",{staticClass:"mg15",attrs:{label:e.$t("productmanage.option.QuickSetup")+":"}},[a("div",{staticClass:"quick"},[a("el-select",{attrs:{placeholder:"select"},on:{change:e.handleAge},model:{value:e.fromData.ageType,callback:function(t){e.$set(e.fromData,"ageType",t)},expression:"fromData.ageType"}},e._l(e.getPeopleType,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("div",{staticClass:"quick"},[a("el-select",{attrs:{placeholder:"select"},model:{value:e.fromData.minAge,callback:function(t){e.$set(e.fromData,"minAge",t)},expression:"fromData.minAge"}},[a("el-option",{attrs:{label:"-",value:"-"}}),e._l(100,(function(e,t){return a("el-option",{key:t,attrs:{label:t,value:t}})}))],2)],1),e._v(" "+e._s(e.$t("productmanage.option.to"))+" "),a("div",{staticClass:"quick"},[a("el-select",{attrs:{placeholder:"select"},model:{value:e.fromData.maxAge,callback:function(t){e.$set(e.fromData,"maxAge",t)},expression:"fromData.maxAge"}},[a("el-option",{attrs:{label:"-",value:"-"}}),e._l(99,(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:e}})}))],2)],1),a("div",{staticClass:"quick"},[a("el-button",{attrs:{type:"text"},on:{click:e.fill}},[e._v(e._s(e.$t("productmanage.option.FillIn")))])],1)]),a("el-form-item",{staticClass:"mg15 price",attrs:{label:e.$t("productmanage.table.Name")+":",prop:"price_title"}},e._l(e.fromData.lang,(function(t,n){return a("el-row",{key:n,attrs:{gutter:0}},[a("el-col",{attrs:{span:11}},[a("div",{staticClass:"grid-content bg-purple",staticStyle:{width:"360px"}},[a("el-form-item",{staticClass:"mg15",attrs:{prop:"name."+t.language}},[a("el-input",{attrs:{placeholder:e.$t("productmanage.table.SuboptionName"),size:"small"},model:{value:e.fromData.name[t.language],callback:function(a){e.$set(e.fromData.name,t.language,a)},expression:"fromData.name[item.language]"}},[a("template",{slot:"prepend"},[e._v(e._s(t.name))])],2)],1)],1)]),a("el-col",{attrs:{span:13}},[a("div",{staticClass:"grid-content bg-purple"},[a("el-input",{attrs:{placeholder:e.$t("productmanage.option.Note(optional)"),size:"small"},model:{value:t.brief,callback:function(a){e.$set(t,"brief",a)},expression:"item.brief"}})],1)])],1)})),1),a("el-form-item",{staticClass:"mg15",attrs:{label:e.$t("productmanage.option.MinBuy")+":",prop:"min_purchase_quantity"}},[a("div",{staticClass:"w110"},[a("el-input",{attrs:{placeholder:e.$t("productmanage.option.MinNumber"),size:"small"},model:{value:e.fromData.min_purchase_quantity,callback:function(t){e.$set(e.fromData,"min_purchase_quantity",e._n(t))},expression:"fromData.min_purchase_quantity"}})],1)]),a("el-form-item",{staticClass:"mg24",attrs:{label:e.$t("productmanage.option.MaxBuy")+":",prop:"max_purchase_quantity"}},[a("div",{staticClass:"w110"},[a("el-input",{attrs:{placeholder:e.$t("productmanage.option.MaxNumber"),size:"small"},model:{value:e.fromData.max_purchase_quantity,callback:function(t){e.$set(e.fromData,"max_purchase_quantity",e._n(t))},expression:"fromData.max_purchase_quantity"}})],1)]),e.show?a("el-form-item",{staticClass:"mg15",class:{before:"en_US"===e.$i18n.locale},attrs:{prop:"book_n_days_before_book_date"}},[a("template",{slot:"label"},[a("span",{domProps:{innerHTML:e._s(e.$t("productmanage.option.BookBefore")+":")}})]),a("div",{staticClass:"w180"},[a("el-input",{attrs:{placeholder:e.$t("productmanage.option.AdvanceBookingDays"),size:"small"},model:{value:e.fromData.book_n_days_before_book_date,callback:function(t){e.$set(e.fromData,"book_n_days_before_book_date",e._n(t))},expression:"fromData.book_n_days_before_book_date"}})],1)],2):e._e(),e.show?a("el-form-item",{staticClass:"mg20",class:{before:"en_US"===e.$i18n.locale},attrs:{prop:"cancel_n_days_before_book_date"}},[a("template",{slot:"label"},[a("span",{domProps:{innerHTML:e._s(e.$t("productmanage.option.CancelBefore")+":")}})]),a("div",{staticClass:"w180"},[a("el-input",{attrs:{placeholder:e.$t("productmanage.option.CancelDaysLimit"),size:"small"},model:{value:e.fromData.cancel_n_days_before_book_date,callback:function(t){e.$set(e.fromData,"cancel_n_days_before_book_date",e._n(t))},expression:"fromData.cancel_n_days_before_book_date"}})],1)],2):e._e(),a("el-form-item",{staticClass:"mg20",attrs:{label:e.$t("productmanage.option.StockType")+":",prop:"max_quantity_per_sub_option"}},[a("div",[a("el-select",{staticClass:"w140",attrs:{placeholder:e.$t("productmanage.option.TotalStock")},on:{change:e.handleStock},model:{value:e.fromData.max_quantity_per_sub_option1,callback:function(t){e.$set(e.fromData,"max_quantity_per_sub_option1",t)},expression:"fromData.max_quantity_per_sub_option1"}},[a("el-option",{attrs:{label:e.$t("productmanage.option.NoLimits"),value:-1}}),a("el-option",{attrs:{label:e.$t("productmanage.option.TotalStock"),value:0}})],1),0===e.fromData.max_quantity_per_sub_option1?[a("el-select",{directives:[{name:"show",rawName:"v-show",value:e.childStock,expression:"childStock"}],staticClass:"w100 mgl20",attrs:{placeholder:e.$t("productmanage.option.TotalStock")},model:{value:e.fromData.type,callback:function(t){e.$set(e.fromData,"type",t)},expression:"fromData.type"}},[a("el-option",{attrs:{label:e.$t("productmanage.option.Increase"),value:"Increase"}}),a("el-option",{attrs:{label:e.$t("productmanage.option.Decrease"),value:"Decrease"}}),a("el-option",{attrs:{label:e.$t("productmanage.option.Equal"),value:"Equal"}})],1),a("el-input",{directives:[{name:"show",rawName:"v-show",value:e.childStock,expression:"childStock"}],staticClass:"w140 mgl10",attrs:{size:"small"},model:{value:e.fromData.stockNum,callback:function(t){e.$set(e.fromData,"stockNum",t)},expression:"fromData.stockNum"}})]:e._e()],2)]),a("el-row",{staticClass:"bottom-input",staticStyle:{"margin-bottom":"15px"}},[a("el-col",{staticClass:"constprice",staticStyle:{"padding-right":"10px"},attrs:{span:12}},[a("el-form-item",{staticClass:"mg0 price vendor-price",attrs:{prop:"vendor_recommended.input"}},[a("template",{slot:"label"},[a("span",{domProps:{innerHTML:e._s(e.$t("productmanage.option.VendorSuggestPrice")+":")}})]),a("el-input",{staticClass:"input-with-select",model:{value:e.fromData.vendor_recommended.input,callback:function(t){e.$set(e.fromData.vendor_recommended,"input",t)},expression:"fromData.vendor_recommended.input"}},[a("el-select",{attrs:{slot:"prepend"},slot:"prepend",model:{value:e.fromData.vendor_recommended.select,callback:function(t){e.$set(e.fromData.vendor_recommended,"select",t)},expression:"fromData.vendor_recommended.select"}},e._l(e.currencies,(function(t){return a("el-option",{key:t.id,attrs:{label:e.$t(t.code),value:t.code}})})),1)],1)],2)],1),a("el-col",{staticClass:"constprice",staticStyle:{"padding-right":"10px"},attrs:{span:12}},[a("el-form-item",{staticClass:"mg0 price",attrs:{label:e.$t("productmanage.option.CostPrice")+":","label-width":"110px",prop:"constPrice.input"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.fromData.constPrice.input,callback:function(t){e.$set(e.fromData.constPrice,"input",t)},expression:"fromData.constPrice.input"}},[a("el-select",{attrs:{slot:"prepend"},slot:"prepend",model:{value:e.fromData.constPrice.select,callback:function(t){e.$set(e.fromData.constPrice,"select",t)},expression:"fromData.constPrice.select"}},e._l(e.currencies,(function(t){return a("el-option",{key:t.id,attrs:{label:e.$t(t.code),value:t.code}})})),1)],1)],1)],1)],1),a("el-row",{staticClass:"bottom-input"},[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticClass:"mg15 price",attrs:{label:e.$t("productmanage.option.SellPrice")+":",prop:"price_title"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.fromData.price_title,expression:"fromData.price_title"}],attrs:{type:"hidden",prop:"price_title"},domProps:{value:e.fromData.price_title},on:{input:function(t){t.target.composing||e.$set(e.fromData,"price_title",t.target.value)}}}),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:22}},[a("div",{staticClass:"grid-content bg-purple"},e._l(e.currencies,(function(t){return a("el-form-item",{key:t.id,staticClass:"mg15 price",attrs:{prop:"price."+t.code}},[a("el-input",{attrs:{size:"small"},model:{value:e.fromData.price[t.code],callback:function(a){e.$set(e.fromData.price,t.code,a)},expression:"fromData.price[currency.code]"}},[a("template",{slot:"prepend"},[e._v(e._s(e.$t(t.code)))]),"HKD"===t.code?a("template",{slot:"append"},[a("div",{staticClass:"sychronize-btn",on:{click:e.sychronizePrice}},[e._v(e._s(e.$t("Synchronize")))])]):e._e()],2)],1)})),1)])],1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{staticClass:"mg15 price",attrs:{label:e.$t("productmanage.option.OrigianlPrice")+":","label-width":"110px"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:22}},[a("div",{staticClass:"grid-content bg-purple"},e._l(e.currencies,(function(t){return a("el-form-item",{key:t.id,staticClass:"mg15 price",attrs:{prop:"original_price."+t.code}},[a("el-input",{attrs:{size:"small"},model:{value:e.fromData.original_price[t.code],callback:function(a){e.$set(e.fromData.original_price,t.code,a)},expression:"fromData.original_price[currency.code]"}},[a("template",{slot:"prepend"},[e._v(e._s(e.$t(t.code)))]),"HKD"===t.code?a("template",{slot:"append"},[a("div",{staticClass:"sychronize-btn",on:{click:e.sychronizeOrignalPrice}},[e._v(e._s(e.$t("Synchronize")))])]):e._e()],2)],1)})),1)])],1)],1)],1),a("el-col",{staticClass:"constprice",attrs:{span:8}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],1)],1)},Qu=[],Ju=(a("498a"),a("cb29"),{watch:{currencies:function(e,t){if(e!==t&&e){var a=e.map((function(e){return e.code})),n={};a.forEach((function(e){n[e]=0})),this.fromData.price=Object(F["a"])({},n),this.fromData.original_price=Object(F["a"])({},n),this.fromData.supplier_recommended_price=Object(F["a"])({},n),this.fromData.cost=Object(F["a"])({},n)}},"fromData.price.KRW":function(e){void 0!==e&&null!==e&&("string"===typeof e&&""===e.trim()||"number"===typeof e&&0===e||isNaN(1*e)||(1*e).toFixed(0)!==1*e&&(this.fromData.price.KRW=+(1*e).toFixed(0)))},"fromData.original_price.KRW":function(e){void 0!==e&&null!==e&&("string"===typeof e&&""===e.trim()||"number"===typeof e&&0===e||isNaN(1*e)||(1*e).toFixed(0)!==1*e&&(this.fromData.original_price.KRW=+(1*e).toFixed(0)))},"fromData.min_purchase_quantity":function(){this.fromData.min_purchase_quantity&&this.$refs.form.validateField("min_purchase_quantity"),this.fromData.max_purchase_quantity&&this.$refs.form.validateField("max_purchase_quantity")},"fromData.max_purchase_quantity":function(){this.fromData.min_purchase_quantity&&this.$refs.form.validateField("min_purchase_quantity"),this.fromData.max_purchase_quantity&&this.$refs.form.validateField("max_purchase_quantity")}},data:function(){return{currencies:[],currenciesLoading:!1,fromData:{ageType:"",minAge:"",maxAge:"",lang:[],supplier_sub_option_sn:"",min_purchase_quantity:"",max_purchase_quantity:"",book_n_days_before_book_date:5,cancel_n_days_before_book_date:0,book_date_required:!0,max_quantity_per_sub_option:"",max_quantity_per_sub_option1:"",stockNum:"",price_title:"title",nametitle:"title",name:{},price:{HKD:0,TWD:0,USD:0,CNY:0,KRW:0},original_price:{HKD:"",TWD:"",USD:"",CNY:"",KRW:""},constPrice:{select:"HKD",input:""},vendor_recommended:{select:"HKD",input:""},supplier_recommended_price:{HKD:"",TWD:"",USD:"",CNY:"",KRW:""},cost:{HKD:"",TWD:"",USD:"",CNY:"",KRW:""},type:""},childStock:!1}},props:["lang","suboption","visible","title","stock","details","max_quantity_per_sub_option","clickType","add","show","limit"],computed:{visibleData:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}},getPeopleType:function(){var e=this,t=this.$i18n.locale,a=Object.keys(this.$i18n.messages[t].productmanage.peopleType);return a.map((function(a){return{label:e.$i18n.messages[t].productmanage.peopleType[a],value:a.split("|")[0]}}))},getTitle:function(){return"add"===this.clickType?"sub_".concat(this.add):this.title},rules:function(){var e=this,t={};return this.currencies.forEach((function(a){t["price.".concat(a.code)]=[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"blur"},{validator:e.validatePass,trigger:"blur"}],t["original_price.".concat(a.code)]=[{validator:e.validatePass5,trigger:"blur"}]})),Object(F["a"])({min_purchase_quantity:[{required:!0,message:e.$t("productmanage.common.RequiredAndMustBeMin"),trigger:"blur"},{validator:e.validatePass1,trigger:"blur"}],max_purchase_quantity:[{required:!0,message:e.$t("productmanage.common.RequiredAndMustBeMax"),trigger:"blur"},{validator:e.validatePass2,trigger:"blur"}],max_quantity_per_sub_common:[{required:!0,message:e.$t("productmanage.option.ItsRequired"),trigger:"change"}],price_title:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"blur"}]},t)}},methods:{sychronizePrice:function(){if(this.currencies.length){var e=this.fromData.price.HKD;if(e){var t={},a=this;Object.keys(a.fromData.price).forEach((function(n){var r=a.currencies.find((function(e){return e.code===n}));"HKD"!==n&&r&&(t[n]="KRW"===n?+(e*r.internal_ex_rate).toFixed(0):+(e*r.internal_ex_rate).toFixed(2))})),a.fromData.price=Object(F["a"])(Object(F["a"])({},a.fromData.price),t)}}},sychronizeOrignalPrice:function(){if(this.currencies.length){var e=this.fromData.original_price.HKD;if(e){var t={},a=this;Object.keys(a.fromData.original_price).forEach((function(n){var r=a.currencies.find((function(e){return e.code===n}));"HKD"!==n&&r&&(t[n]="KRW"===n?+(e*r.internal_ex_rate).toFixed(0):+(e*r.internal_ex_rate).toFixed(2))})),a.fromData.original_price=Object(F["a"])(Object(F["a"])({},a.fromData.original_price),t)}}},getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},handleAge:function(e){var t=Object.keys(this.$i18n.messages[this.$i18n.locale].productmanage.peopleType).find((function(t){return t.indexOf(e)>-1}));this.fromData.minAge=t.split("|")[1],this.fromData.maxAge=t.split("|")[2]},fill:function(e){var t=this;if("init"!==e&&(!this.fromData.id||this.fromData.ageType||this.fromData.minAge||this.fromData.maxAge)){var a=null,n="";this.fromData.lang.forEach((function(e){for(var r in a="ko_KR"!==e.language?t.$i18n.messages[e.language].productmanage.peopleType:{"Adult|13|59":"대인","Child|3|12":"소인","Senior|60|99":"시니어","Infant|0|2":"소아","Student|-|-":"학생","All|-|-":"수량"},a)if(r.indexOf(t.fromData.ageType)>-1){n=a[r];break}"-"!==t.fromData.minAge&&"-"!==t.fromData.maxAge?(e.title="".concat(n," (ages ").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")"),"zh_CN"===e.language?e.title="".concat(n," (").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")岁"):"zh_HK"===e.language?e.title="".concat(n," (").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")歲"):"ko_KR"===e.language&&(e.title="".concat(n," (").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")세"))):"-"===t.fromData.minAge&&"-"===t.fromData.maxAge?e.title=n:"-"===t.fromData.minAge?(e.title="".concat(n," (aged under and ").concat(t.fromData.maxAge,")"),"zh_CN"===e.language?e.title="".concat(n," (").concat(t.fromData.maxAge,"岁及以下)"):"zh_HK"===e.language?e.title="".concat(n," (").concat(t.fromData.maxAge,"歲及以下)"):"ko_KR"===e.language&&(e.title="".concat(n," (").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")세 이하"))):(e.title="".concat(n," (aged ").concat(t.fromData.minAge," and above)"),"zh_CN"===e.language?e.title="".concat(n," (").concat(t.fromData.minAge,"岁及以上)"):"zh_HK"===e.language?e.title="".concat(n," (").concat(t.fromData.minAge,"歲及以上)"):"ko_KR"===e.language&&(e.title="".concat(n," (").concat(t.fromData.minAge,"-").concat(t.fromData.maxAge,")세 이상"))),t.fromData.name[e.language]=e.title,e.ages=[],e.ages.push(t.fromData.minAge,t.fromData.maxAge)}))}},handleStock:function(e){this.childStock=-1!==e},validatePass:function(e,t,a){t<=0||isNaN(t)||"number"!==typeof(t-0)?a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0"))):a()},validatePass1:function(e,t,a){"number"!==typeof t||this.fromData.max_purchase_quantity&&t>this.fromData.max_purchase_quantity?a(new Error(this.$t("productmanage.common.RequiredAndMustBeMin"))):this.limit>0&&t>this.limit?a(new Error(this.$t("Can not greater than maximun purchase per account"))):a()},validatePass2:function(e,t,a){"number"!==typeof t||this.fromData.min_purchase_quantity&&t0&&t>this.limit?a(new Error(this.$t("Can not greater than maximun purchase per account"))):a()},validatePass3:function(e,t,a){"number"!==typeof t||t<0||t>99?a(new Error(this.$t("productmanage.common.Mustbeadigitbetween0and99"))):a()},validatePass4:function(e,t,a){"number"!==typeof t||t<0||t>99?a(new Error(this.$t("productmanage.common.Mustbeadigitbetween0and99"))):a()},validatePass5:function(e,t,a){""!==t&&void 0!==t&&(t<=0||isNaN(t)||"number"!==typeof(t-0))?a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0"))):a()},validatePass6:function(e,t,a){t?a():a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0")))},save:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;if(e.fromData.title=e.getTitle.title,-1!==e.fromData.max_quantity_per_sub_option1&&e.fromData.type){if(""!==e.fromData.stockNum&&void 0!==e.fromData.stockNum){var a=-1===e.suboption.cont.max_quantity_per_sub_option?0:e.suboption.cont.max_quantity_per_sub_option;switch(e.fromData.stockNum=isNaN(e.fromData.stockNum)?0:e.fromData.stockNum,e.fromData.type){case"Increase":e.fromData.max_quantity_per_sub_option=a+(e.fromData.stockNum-0);break;case"Decrease":e.fromData.max_quantity_per_sub_option=a-e.fromData.stockNum-0;break;case"Equal":e.fromData.max_quantity_per_sub_option=e.fromData.stockNum-0;break}e.fromData.max_quantity_per_sub_option<0&&(e.fromData.max_quantity_per_sub_option=0)}}else e.fromData.max_quantity_per_sub_option=e.fromData.max_quantity_per_sub_option1;for(var n in e.fromData.details={},e.fromData.lang.forEach((function(t){t.title=e.fromData.name[t.language],t.ages=t.ages||["-","-"],"-"!==t.ages[0]&&(t.ages[0]=t.ages[0]-0),"-"!==t.ages[1]&&(t.ages[1]=t.ages[1]-0),e.fromData.details[t.language]={meta:{brief:t.brief,ages:t.ages},title:t.title}})),e.fromData.price)e.fromData.price[n]=e.fromData.price[n]-0;for(var r in e.fromData.original_price)""!==e.fromData.original_price[r]&&void 0!==e.fromData.original_price[r]&&(e.fromData.original_price[r]=e.fromData.original_price[r]-0);void 0!==e.fromData.constPrice.input&&(e.fromData.constPrice.input=e.fromData.constPrice.input-0),""!==e.fromData.vendor_recommended.input&&void 0!==e.fromData.vendor_recommended.input&&(e.fromData.vendor_recommended.input=e.fromData.vendor_recommended.input-0),e.fromData.cost=Object(Ot["a"])({},e.fromData.constPrice.select,+e.fromData.constPrice.input),e.fromData.supplier_recommended_price[e.fromData.vendor_recommended.select]=e.fromData.vendor_recommended.input,e.$emit("save",e.fromData),e.$emit("update:visible",!1)}))}},beforeMount:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getCurrencies();case 2:a=e.$i18n.locale,n=Object.keys(e.$i18n.messages[a].productmanage.peopleType)[0].split("|"),r=e.suboption,e.fromData.ageType=n[0],e.fromData.minAge=n[1],e.fromData.maxAge=n[2],e.fromData.type="Equal",e.show&&(e.$set(e.rules,"book_n_days_before_book_date",[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"blur"},{validator:e.validatePass3,trigger:"blur"}]),e.$set(e.rules,"cancel_n_days_before_book_date",[{required:!0,validator:e.validatePass4,trigger:"blur"}])),"add"===e.clickType&&(r={title:"sub_1",name:"1",visible:!1,currencyType:"HKD",status:"ACT",dateStatus:{},statusObj:{},cont:{supplier_sub_option_sn:"",price:{},cancel_n_days_before_book_date:"",book_n_days_before_book_date:5,max_quantity_per_sub_option:0,max_quantity_per_sub_option1:-1,quantity:"",min_purchase_quantity:"",max_purchase_quantity:"",ageType:"",minAge:"",maxAge:"",details:{},original_price:{},cost:{}},rank:{weeks:[],date_list:[],status:1}}),r.cont.details[e.lang[0]]&&r.cont.details[e.lang[0]].title&&(o="",o="ko_KR"!==e.lang[0]?e.$i18n.messages[e.lang[0]].productmanage.peopleType:{"Adult|13|59":"대인","Child|3|12":"소인","Senior|60|99":"시니어","Infant|0|2":"소아","Student|-|-":"학생","All|-|-":"수량"},i="Adult|",Object.keys(o).forEach((function(t){r.cont.details[e.lang[0]].title.indexOf(o[t])>-1&&(i=t)})),s=r.cont.details[e.lang[0]].meta.ages||["",""],e.fromData.ageType=i.split("|")[0],e.fromData.minAge=s[0],e.fromData.maxAge=s[1]),e.lang.forEach((function(t){var a=r.cont.details[t];e.fromData.lang.push({name:t,language:t,title:a?a.title:"",brief:a?a.meta.brief:"",ages:a?a.meta.ages:""}),e.$set(e.fromData.name,t,a?a.title:""),e.$set(e.rules,"name."+t,[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"blur"}])})),e.fromData.id=r.id,e.fromData.supplier_sub_option_sn=r.cont.supplier_sub_option_sn,e.fromData.min_purchase_quantity=r.cont.min_purchase_quantity,e.fromData.max_purchase_quantity=r.cont.max_purchase_quantity,e.fromData.stockNum=r.cont.max_quantity_per_sub_option,e.fromData.max_quantity_per_sub_option1=-1===r.cont.max_quantity_per_sub_option||"add"===e.clickType?-1:0,e.fromData.book_n_days_before_book_date=r.cont.book_n_days_before_book_date,e.fromData.cancel_n_days_before_book_date=r.cont.cancel_n_days_before_book_date,e.currencies.forEach((function(t){"add"===e.clickType?(e.fromData.price[t.code]=0,e.fromData.original_price[t.code]=""):(e.fromData.price[t.code]=r.cont.price[t.code],e.fromData.original_price[t.code]=r.cont.original_price[t.code]),r.cont.cost.hasOwnProperty(t.code)&&(e.fromData.constPrice.select=t.code,e.fromData.constPrice.input=0===r.cont.cost[t.code]?"":r.cont.cost[t.code]),r.cont.supplier_recommended_price&&r.cont.supplier_recommended_price[t.code]&&(e.fromData.vendor_recommended.select=t.code,e.fromData.vendor_recommended.input=r.cont.supplier_recommended_price[t.code])})),e.childStock=""!==r.cont.max_quantity_per_sub_option&&-1!==r.cont.max_quantity_per_sub_option,e.fill("init");case 24:case"end":return t.stop()}}),t)})))()}}),Xu=Ju,Zu=(a("74c1"),a("e5eb"),Object(R["a"])(Xu,Gu,Qu,!1,null,"25d3b20e",null)),ed=Zu.exports,td=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"rank-date"},[a("el-dialog",{attrs:{title:e.$t("productmanage.option.MultiSetting"),visible:e.visibleData},on:{"update:visible":function(t){e.visibleData=t}}},[a("el-form",{ref:"form",attrs:{model:e.fromData,"label-width":"112px",size:"small"}},[a("div",{staticClass:"cont"},[e._l(e.date,(function(t,n){return a("div",{key:n,staticClass:"date-box"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.Range")+(n+1)+":",prop:"value["+n+"]",rules:[{required:!0,message:e.$t("productmanage.common.AtLeastOneRange"),trigger:"blur"}]}},[a("el-date-picker",{attrs:{type:"daterange","value-format":"yyyy-MM-dd","range-separator":"to","start-placeholder":"Start date","end-placeholder":"End date","picker-options":e.pickerOptions,size:"small"},model:{value:e.fromData.value[n],callback:function(t){e.$set(e.fromData.value,n,t)},expression:"fromData.value[index]"}}),a("i",{directives:[{name:"show",rawName:"v-show",value:0!==n,expression:"index !== 0"}],staticClass:"icon el-icon-close",on:{click:function(t){return e.crease(n)}}}),a("i",{directives:[{name:"show",rawName:"v-show",value:n===e.date.length-1,expression:"index === date.length - 1"}],staticClass:"icon el-icon-plus",on:{click:e.add}})],1)],1)})),a("div",{staticClass:"week-box"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.Week")+":",prop:"checkedWeeks",rules:[{required:!0,message:e.$t("productmanage.common.WeekIsRequired"),trigger:"change"}]}},[a("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v(e._s(e.$t("productmanage.option.All")))]),a("el-checkbox-group",{on:{change:e.handleCheckedCitiesChange},model:{value:e.fromData.checkedWeeks,callback:function(t){e.$set(e.fromData,"checkedWeeks",t)},expression:"fromData.checkedWeeks"}},e._l(e.weeks,(function(t,n){return a("el-checkbox",{key:t,attrs:{label:n}},[e._v(e._s(t))])})),1)],1)],1)],2)]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.save(1)}}},[e._v(e._s(e.$t("productmanage.option.ForSale")))]),a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.save(2)}}},[e._v(e._s(e.$t("productmanage.option.NotForSale")))])],1)],1)],1)},ad=[],nd={data:function(){return{date:[{value:""}],checkAll:!0,weeks:[],isIndeterminate:!0,fromData:{checkedWeeks:[],value:[]},pickerOptions:{disabledDate:function(e){return e.getTime()0&&t1},getSubCloseStatus:function(){return this.editableTabs[this.getCurrentIndex].sub_option.option.length>1},getPrice:function(){var e=this,t=this.$i18n.messages.en_US.productmanage.priceType,a=Object.keys(t);return a.map((function(a){return{text:e.$t("productmanage.priceType.".concat(a)),value:t[a]}}))},getCurrentSubOption:function(){var e=this.editableTabs[this.getCurrentIndex].sub_option;return e.option[this.getCurrentSubIndex]},getVoucherType:function(){var e=this.$i18n.messages[this.$i18n.locale].productmanage.voucherType,t=Object.keys(e);return"DEI"===this.type&&(t=t.filter((function(e){return"DEI"===e.split("|")[1]}))),t.map((function(t){return{label:e[t],value:t.split("|")[1]}}))},getDayStatus:function(){return function(e){return this.getCurrentSubOption.id,this.getCurrentSubOption.dateStatus[e]||this.$set(this.getCurrentSubOption.dateStatus,e,2),this.getCurrentSubOption.dateStatus[e]}},getRadioStatus:{get:function(){return this.getCurrentSubOption.id,this.getCurrentSubOption.dateStatus[this.formDate(this.value)]||this.$set(this.getCurrentSubOption.dateStatus,this.formDate(this.value),2),this.getCurrentSubOption.dateStatus[this.formDate(this.value)]},set:function(e,t){this.$set(this.getCurrentSubOption.dateStatus,this.formDate(this.value),e)}},getTitle:function(){return function(e){var t=this.$i18n.locale,a={en_US:"",zh_HK:"",zh_CN:"",ko_KR:""},n="";return this.editableTabs[e].option.forEach((function(e){e.title===t&&(n=e.name),a[e.title]=e.name})),n||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR||""}},getSubTitle:function(){return function(e){var t=this.$i18n.locale,a=this.editableTabs[this.getCurrentIndex].sub_option.option[e].cont.details,n={en_US:"",zh_HK:"",zh_CN:"",ko_KR:""},r="";for(var o in a)o===t&&(r=a[o].title),n[o]=a[o].title;return r||n.en_US||n.zh_HK||n.zh_CN||n.ko_KR||""}}},methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},getCurrentSymbol:function(){var e,t=this,a=null===(e=this.currencies)||void 0===e?void 0:e.find((function(e){var a;return e.code===(null===(a=t.getCurrentSubOption)||void 0===a?void 0:a.currencyType)}));return a?a.symbol:""},isDescriptionHasError:function(e){return e&&e.length>1e5?this.$t("The content exceeds 100,000 characters, please check and edit agian."):""},onSuboptionSortingShow:function(){var e=this;this.dialogSuboptionSortingVisible=!0,this.$nextTick((function(){e.initSubOptionTabDrag()}))},onOptionSortingShow:function(){var e=this;this.dialogOptionSortingVisible=!0,this.$nextTick((function(){e.initTabDrag()}))},handleCommand:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if("copy"!==e){a.next=7;break}return a.delegateYield(regeneratorRuntime.mark((function e(){var a,n,r,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.getCurrentTab.id){e.next=2;break}return e.abrupt("return",{v:void 0});case 2:a=Math.max.apply(Math,Object(Xc["a"])(t.editableTabs.map((function(e){return Number(e.name)}))))+1+"",n=JSON.parse(JSON.stringify(t.getCurrentTab)),n.name=a,r=regeneratorRuntime.mark((function e(a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$api.product.getSaleStatus({product_id:t.$route.query.product_id,option_id:n.id,sub_option_id:n.sub_option.option[a].id}).then((function(e){e.forEach((function(e){n.sub_option.option[a].dateStatus[e.date]||t.$set(n.sub_option.option[a].dateStatus,e.date,e.status),n.sub_option.option[a].statusObj[e.date]||(n.sub_option.option[a].statusObj[e.date]=e.status)}))}));case 2:case"end":return e.stop()}}),e)})),o=0;case 7:if(!(o=0){var o=a.getFullYear(),i=1===(a.getMonth()+1).toString().length?"0"+(parseInt(a.getMonth().toString(),10)+1):a.getMonth()+1,s=1===a.getDate().toString().length?"0"+a.getDate():a.getDate();r.push(o+"-"+i+"-"+s),a.setDate(a.getDate()+1)}return r},handleDate:function(e){var t=this;this.getCurrentSubOption.rank.push(e);var a=[];this.getCurrentSubOption.dateStatus=this.getCurrentSubOption.dateStatus||{},e.date_list.forEach((function(e){a.push(t.getDiffDate(e.start_date,e.end_date))})),a.forEach((function(a){a.forEach((function(a){e.weeks.indexOf(new Date(new Date(a)-864e5).getDay())>-1&&t.$set(t.getCurrentSubOption.dateStatus,a,e.status)}))}))},tabClick:function(){this.editableTabs.forEach((function(e){e.visible=!1})),this.subTabClick()},subTabClick:function(e){var t=this;!Object.keys(this.getCurrentSubOption.dateStatus).length&&this.getCurrentSubOption.id&&this.$api.product.getSaleStatus({product_id:this.$route.query.product_id,option_id:this.getCurrentTab.id,sub_option_id:this.getCurrentSubOption.id}).then((function(e){e.forEach((function(e){t.$set(t.getCurrentSubOption.dateStatus,e.date,e.status)}))}))},formDate:function(e){return e.getFullYear()+"-"+(e.getMonth()>8?e.getMonth()+1:"0"+(e.getMonth()+1))+"-"+(e.getDate()>9?e.getDate():"0"+e.getDate())},getDisable:function(e){var t=this.formDate(new Date).split("-").join(""),a=e.split("-").join("");return t>a},remove:function(e){var t=this;e.visible=!1;var a=this.editableTabs,n=this.editableTabsValue;if(!e.id)return n===e.name&&a.forEach((function(t,r){if(t.name===e.name){var o=a[r+1]||a[r-1];o&&(n=o.name)}})),this.editableTabsValue=n,void(this.editableTabs=a.filter((function(t){return t.name!==e.name})));this.$api.product.DetOption({product_id:this.$route.query.product_id,option_id:e.id}).then((function(r){n===e.name&&a.forEach((function(t,r){if(t.name===e.name){var o=a[r+1]||a[r-1];o&&(n=o.name)}})),t.editableTabsValue=n,t.editableTabs=a.filter((function(t){return t.name!==e.name}))}))},removeSub:function(e,t){var a=this;if(e.visible=!1,this.getCurrentSubOption.id)this.$api.product.DetSubOption({product_id:this.$route.query.product_id,option_id:this.getCurrentTab.id,sub_option_id:e.id}).then((function(n){var r=a.editableTabs[a.getCurrentIndex].sub_option,o=r.option,i=r.activeName;i===e.name&&o.forEach((function(t,a){if(t.name===e.name){var n=o[a+1]||o[a-1];n&&(i=n.name)}})),r.activeName=i,a.editableTabs[a.getCurrentIndex].sub_option.option.splice(t,1)}));else{var n=this.editableTabs[this.getCurrentIndex].sub_option,r=n.option,o=n.activeName;o===e.name&&r.forEach((function(t,a){if(t.name===e.name){var n=r[a+1]||r[a-1];n&&(o=n.name)}})),n.activeName=o,this.editableTabs[this.getCurrentIndex].sub_option.option.splice(t,1)}},handleTabsEdit:function(e,t){if("remove"===t){var a=this.editableTabs.findIndex((function(t){return t.name===e}));this.editableTabs.forEach((function(e){e.visible=!1})),this.editableTabs[a].visible=!0}},handleSubTabsEdit:function(e,t){if("remove"===t){var a=this.editableTabs[this.getCurrentIndex].sub_option.option,n=a.findIndex((function(t){return t.name===e}));a.forEach((function(e){e.visible=!1})),a[n].visible=!0}},confirm:function(e){var t=this,a=this.getCurrentTab.sub_option.option,n=Math.max.apply(Math,Object(Xc["a"])(a.map((function(e){return Number(e.name)}))))+1+"",r=this.editableTabs[this.getCurrentIndex].sub_option,o=e.lang.find((function(e){return e.language===t.$i18n.locale}));e.title=o?o.title:e.lang[0].title,"add"===this.clickType?(r.option.push({title:e.title||"sub_".concat(n),name:n,visible:!1,currencyType:"HKD",status:"ACT",dateStatus:{},statusObj:{},cont:JSON.parse(JSON.stringify(e)),rank:[]}),r.activeName=n):(this.getCurrentSubOption.title=e.title,this.getCurrentSubOption.cont=Object.assign(this.getCurrentSubOption.cont,e))},switchChage:function(){this.advanceValue=!this.advanceValue},handlePrice:function(e){this.getCurrentSubOption.currencyType=e},handleDialog:function(){this.dialogDate=!0},modifyStatus:function(e){var t=this;"edit"!==this.$route.query.type?this.$api.product.putStatus({product_ids:[this.$route.query.product_id-0],status:e}).then((function(e){t.show&&(t.show=!1,t.$message.success(t.$t("Save successfully")))})):this.show&&(this.show=!1,this.$message.success(this.$t("Save successfully")))},change:function(e){this.getCurrentSubOption.statusObj[this.formDate(this.value)]=e},save:function(e){for(var t=this,a=this,n=0;n0}));if(o)return void this.$message({dangerouslyUseHTMLString:!0,message:"[".concat(a.$t("lang."+o.title),".").concat(a.$t("productmanage.option.Note"),"] -> [").concat(a.$t("The content exceeds 100,000 characters, please check and edit agian."),"]"),type:"error"})}this.$refs.form.validate(function(){var e=Object(L["a"])(regeneratorRuntime.mark((function e(a){var n,r,o,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!a){e.next=21;break}if(n={},t.editableTabs.forEach((function(e,a){n[t.getTitle(a)||e.title]=e.option.filter((function(e){return!e.name})),n["".concat(e.option[0].name||e.title,",").concat(e.name)]=e.sub_option.option.filter((function(e){return!/^\d+(?=\.{0,1}\d+$|$)/.test(e.cont.min_purchase_quantity)||!/^\d+(?=\.{0,1}\d+$|$)/.test(e.cont.min_purchase_quantity)||0===Object.keys(e.cont.price).length||!Object.keys(e.cont.price).every((function(t){return/^\d+(?=\.{0,1}\d+$|$)/.test(e.cont.price[t])}))}))})),r=Object.keys(n).every((function(e){return 0===n[e].length})),r){e.next=10;break}return o=t.$i18n.locale,i="",Object.keys(n).forEach((function(e,t){"en_US"===o?n[e].forEach((function(a,n){0===t&&0===n&&(i="Save failed! Some required fields are not filled in
"),i+="[".concat(e.split(",")[0],"] -> [").concat(a.title,"]
")})):"zh_CN"===o?n[e].forEach((function(a,n){0===t&&0===n&&(i="保存失败!以下有必填项未填
"),i+="[".concat(e.split(",")[0],"] -> [").concat(a.title,"]
")})):"zh_HK"===o&&n[e].forEach((function(a,n){0===t&&0===n&&(i="保存失敗!以下有必填項未填
"),i+="[".concat(e.split(",")[0],"] -> [").concat(a.title,"]
")}))})),t.$message({dangerouslyUseHTMLString:!0,message:i,type:"error"}),e.abrupt("return",!1);case 10:return t.show=!0,s=t.editableTabs.map((function(e){var a={voucher_type:e.voucher_type,status:e.status,book_date_required:"DEI"!==t.showDate&&e.book_date_required,option_start_date:e.option_date&&e.option_date[0]||t.formDate(new Date),option_end_date:e.option_date&&e.option_date[1]||"2099-12-31",option_detail:e.option.map((function(e){return{language:e.title,title:e.name,brief:e.description||""}})),sub_options:e.sub_option.option.map((function(t){var a={status:t.status||"ACT",supplier_sub_option_sn:t.cont.supplier_sub_option_sn,min_book_days:1,min_purchase_quantity:t.cont.min_purchase_quantity,max_purchase_quantity:t.cont.max_purchase_quantity,max_quantity_per_sub_option:t.cont.max_quantity_per_sub_option,sub_option_detail:t.cont.lang||Object.keys(t.cont.details).map((function(e){return{language:e,title:t.cont.details[e].title,brief:t.cont.details[e].meta.brief,ages:t.cont.details[e].meta.ages}})),price:t.cont.price,original_price:t.cont.original_price,cost:t.cont.cost,supplier_recommended_price:t.cont.supplier_recommended_price};return t.id&&(a.id=t.id),(t.rank.length||Object.keys(t.statusObj).length)&&(a.inventory={date_list:[]},t.rank.length&&t.rank.forEach((function(e){e.date_list.forEach((function(t){a.inventory.date_list.push({weeks:e.weeks,status:2===e.status?0:e.status,start_date:t.start_date,end_date:t.end_date})}))})),Object.keys(t.statusObj).forEach((function(e){var n=t.statusObj[e];a.inventory.date_list.push({date:e,status:2===n?0:n})}))),e.book_date_required&&(a.cancel_n_days_before_book_date=t.cont.cancel_n_days_before_book_date,a.book_n_days_before_book_date=t.cont.book_n_days_before_book_date),a}))};return e.id&&(a.id=e.id),a})),e.prev=12,e.next=15,t.$api.product.saveProductOptions(t.$route.query.product_id,{options:s});case 15:t.getProductDetail(),t.$message.success(t.$t("Save successfully")),e.next=21;break;case 19:e.prev=19,e.t0=e["catch"](12);case 21:case"end":return e.stop()}}),e,null,[[12,19]])})));return function(t){return e.apply(this,arguments)}}())},onDragTabEnd:function(e){var t=e.oldIndex,a=e.newIndex;this.editableTabs.splice(a,0,this.editableTabs.splice(t,1)[0])},initTabDrag:function(){var e=this.$refs.OptionSorting;Wu["default"].create(e,{animation:200,filter:".el-icon-close",onEnd:this.onDragTabEnd})},initSubOptionTabDrag:function(){var e=this.$refs.SuboptionSorting;Wu["default"].create(e,{animation:200,filter:".el-icon-close",onEnd:this.onSubOptionDragTabEnd})},onSubOptionDragTabEnd:function(e){var t=e.oldIndex,a=e.newIndex;this.editableTabs[this.getCurrentIndex].sub_option.option.splice(a,0,this.editableTabs[this.getCurrentIndex].sub_option.option.splice(t,1)[0])},getProductDetail:function(){var e=this;this.$api.product.getProductDetail({productId:this.$route.query.product_id}).then((function(t){t.is_limit_purchased&&(e.limit=t.limit_purchased_num),e.showDate=t.type,e.type=t.type,e.lang=Object.keys(t.details),e.status=t.status,e.editableTabs=[],t.options.length||(e.formData.book_date_required="DEI"!==t.type,e.editableTabs.push({title:"Option 1",name:"1",option:e.lang.map((function(e){return{title:e,name:"",visible:!1,description:""}})),status:"ACT",option_date:[],voucher_type:"",book_date_required:!1,sub_option:{activeName:"1",option:[{title:"sub_1",name:"1",id:"",dateStatus:{},statusObj:{},visible:!1,currencyType:"HKD",status:"ACT",cont:{supplier_sub_option_sn:"",price:{},cancel_n_days_before_book_date:"",book_n_days_before_book_date:"",max_quantity_per_sub_option:-1,quantity:"",min_purchase_quantity:"",max_purchase_quantity:"",ageType:"",minAge:"",maxAge:"",details:{},original_price:{},cost:{},supplier_recommended_price:{}},rank:[]}]}})),t.options.forEach((function(t,a){t.id===e.$route.query.option_id-0&&(e.editableTabsValue=a+1+"");var n={title:"Option "+(a+1),name:a+1+"",id:t.id,option:e.lang.map((function(e){return{title:e,name:t.details[e]?t.details[e].title:"",visible:!1,description:t.details[e]?t.details[e].meta.brief:""}})),status:t.status,option_date:[t.option_start_date||"",t.option_end_date||""],voucher_type:t.voucher_type,book_date_required:t.book_date_required,sub_option:{activeName:"1",option:[{title:"sub_1",name:"1",id:"",dateStatus:{},statusObj:{},visible:!1,currencyType:"HKD",status:"ACT",cont:{supplier_sub_option_sn:"",price:{},cancel_n_days_before_book_date:"0",book_n_days_before_book_date:"5",max_quantity_per_sub_option:-1,quantity:"",min_purchase_quantity:"",max_purchase_quantity:"",ageType:"",minAge:"",maxAge:"",details:{},original_price:{},cost:{},supplier_recommended_price:{}},rank:[]}]}};e.lang.forEach((function(e){n.sub_option.option[0].cont.details[e]={meta:{ages:[],brief:""},title:""}})),0!==t.sub_options.length&&(n.sub_option.option=t.sub_options.map((function(t,a){t.price.KRW=t.price.KRW||"",t.id===e.$route.query.sub_option_id-0&&(n.sub_option.activeName=a+1+"");var r="sub_".concat(a+1);return t.details[e.$i18n.locale]?r=t.details[e.$i18n.locale].title:Object.keys(t.details).length>0&&(r=t.details[Object.keys(t.details)[0]].title),{title:r,name:a+1+"",id:t.id,dateStatus:{},statusObj:{},visible:!1,currencyType:"HKD",status:t.status||"ACT",cont:{supplier_sub_option_sn:t.supplier_sub_option_sn,price:t.price,cancel_n_days_before_book_date:t.cancel_n_days_before_book_date,book_n_days_before_book_date:t.book_n_days_before_book_date,max_quantity_per_sub_option:t.max_quantity_per_sub_option,quantity:t.max_quantity_per_sub_option,min_purchase_quantity:t.min_purchase_quantity,max_purchase_quantity:t.max_purchase_quantity,ageType:t.ageType,minAge:t.minAge,maxAge:t.maxAge,details:t.details,original_price:t.original_price,cost:t.cost,supplier_recommended_price:t.supplier_recommended_price},rank:[]}}))),e.editableTabs.push(n)})),e.subTabClick()}))}},beforeMount:function(){this.lang=this.$route.query.lang,this.editableTabsValue="1",this.subOptionValue="1",this.getCurrencies(),this.getProductDetail()},activated:function(){this.advanceValue2=!0},deactivated:function(){this.advanceValue2=!1}},ld=sd,cd=(a("b80e"),a("ef0d"),Object(R["a"])(ld,Vu,Yu,!1,null,"6373f782",null)),ud=cd.exports,dd=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-list"},[a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.mappedCouponList,"tooltip-effect":"dark",stripe:""},on:{"sort-change":e.onSort}},[a("el-table-column",{attrs:{prop:"id",width:"100",fixed:"",label:e.$t("Batch id")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"coupon-link",attrs:{target:"_blank",to:{name:"CouponInfo",query:{couponId:t.row.id}}}},[e._v(e._s(t.row.id))])]}}])}),a("el-table-column",{attrs:{prop:"code",width:"150",fixed:"",label:e.$t("Coupon code")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.codeType>0?a("span",{staticClass:"code-random"},[e._v(e._s(e.$t("Random")))]):a("span",[e._v(e._s(t.row.code))])]}}])}),a("el-table-column",{attrs:{"min-width":"60","show-overflow-tooltip":"",label:e.$t("Coupon name")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("lang")(t.row.details,e.$i18n.locale,"title")))]}}])}),a("el-table-column",{attrs:{width:"120",label:e.$t("Discount type")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.getDiscountType(t.row.discountType)))]}}])}),a("el-table-column",{attrs:{width:"140",label:e.$t("Batch valid"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.validStart&&t.row.validEnd?[a("div",{staticClass:"valid-start-dt"},[e._v(e._s(e._f("date")(t.row.validStart,"YYYY-MM-DD HH:mm")))]),a("div",{staticClass:"valid-end-dt"},[e._v(e._s(e._f("date")(t.row.validEnd,"YYYY-MM-DD HH:mm")))])]:a("span",[t.row.couponValidHoursAfterRedeeming/24>1?[e._v(" "+e._s(e.$t("{day} Days",{day:(t.row.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]:[e._v(" "+e._s(e.$t("{day} Day",{day:(t.row.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]],2)]}}])}),a("el-table-column",{attrs:{width:"160",prop:"platforms","show-overflow-tooltip":"",label:e.$t("Platform")}}),a("el-table-column",{attrs:{prop:"totalLimit",width:"120","show-overflow-tooltip":"",label:e.$t("Coupon total")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(-1===t.row.totalLimit?e.$t("No limit"):t.row.totalLimit))]}}])}),a("el-table-column",{attrs:{width:"80","show-overflow-tooltip":"",label:e.$t("Picked")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.redeemedNum||0)+" ")]}}])}),a("el-table-column",{attrs:{width:"80","show-overflow-tooltip":"",label:e.$t("Used")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.usedNum||0)+" ")]}}])}),a("el-table-column",{attrs:{width:"80",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"coupon-link",attrs:{target:"_blank",to:{name:"CouponInfo",query:{couponId:t.row.id}}}},[e._v(e._s(e.$t("Detail")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)])},pd=[],md={data:function(){return{COUPON_BATCH_STATUS:be,couponList:[],loading:!1,deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{mappedCouponList:function(){var e=this;return this.couponList.map((function(t){var a=t.id,n=t.code,r=t.code_type,o=t.status,i=t.details,s=t.discount_type,l=t.valid_start_dt,c=t.valid_end_dt,u=t.total_limit,d=t.used_num,p=t.redeemed_num,m=t.coupon_valid_hours_after_redeeming,f=t.supplier,g=t.supporting_provider,h=[];return g.forEach((function(t){e.platformsMapping[t]&&h.push(e.$t("platform.".concat(e.platformsMapping[t])))})),{id:a,code:n,codeType:r,status:o,discountType:s,validStart:l,validEnd:c,supplier:f,usedNum:d,redeemedNum:p,couponValidHoursAfterRedeeming:m,totalLimit:u,platforms:h.join(","),details:i}}))}}),created:function(){this.getCouponList()},methods:{getDiscountType:function(e){return this.$t(we[e])},getCouponList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={ordering:e.ordering,page_size:e.pageSize,page:e.currentPage},e.loading=!0,e.couponList=[],t.prev=3,t.next=6,e.$api.coupon.getCouponsByProductId(e.$route.query.product_id,a);case 6:n=t.sent,e.couponList=n.results,e.total=n.count;case 9:return t.prev=9,e.loading=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,null,[[3,,9,12]])})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getCouponList()},onPageSizeChange:function(e){this.pageSize=e,this.getCouponList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getCouponList())}}},fd=md,gd=(a("cfee"),Object(R["a"])(fd,dd,pd,!1,null,"491b9127",null)),hd=gd.exports,_d=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"voucher-list"},[a("div",{staticClass:"serach-bar"},[a("el-form",{attrs:{inline:"",model:e.searchForm,size:"mini"}},[e.isRestaurant?e._e():[a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.common.Option"),clearable:""},model:{value:e.searchForm.option,callback:function(t){e.$set(e.searchForm,"option",t)},expression:"searchForm.option"}},e._l(e.options,(function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.common.Suboption"),clearable:""},model:{value:e.searchForm.sub_option,callback:function(t){e.$set(e.searchForm,"sub_option",t)},expression:"searchForm.sub_option"}},e._l(e.subOptions(e.searchForm.option),(function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1)],1)],a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Voucher status"),clearable:""},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status",t)},expression:"searchForm.status"}},[a("el-option",{attrs:{label:e.$t("Active"),value:"ACT"}}),a("el-option",{attrs:{label:e.$t("Used"),value:"USD"}}),a("el-option",{attrs:{label:e.$t("Deactivated"),value:"DCT"}})],1)],1),a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange",clearable:"","start-placeholder":e.$t("Upload time"),"end-placeholder":e.$t("Upload time")},model:{value:e.upload_dt,callback:function(t){e.upload_dt=t},expression:"upload_dt"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.search}},[e._v(e._s(e.$t("Search")))]),a("el-button",{attrs:{disabled:!e.isSearchable},on:{click:e.resetForm}},[e._v(e._s(e.$t("Clear")))])],1)],2)],1),a("div",{staticClass:"upload-bar"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.showUpload}},[e._v(e._s(e.$t("Upload")))])],1),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.voucherList,"tooltip-effect":"dark",stripe:""}},[e.isRestaurant?e._e():[a("el-table-column",{attrs:{prop:"id","min-width":"100",fixed:"",label:e.$t("productmanage.common.Option")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("lang")(t.row.option.detail,e.$i18n.locale,"title"))+" ")]}}],null,!1,4010691312)}),a("el-table-column",{attrs:{prop:"code","min-width":"150",fixed:"",label:e.$t("productmanage.common.Suboption")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("lang")(t.row.sub_option.detail,e.$i18n.locale,"title"))+" ")]}}],null,!1,1683447979)})],a("el-table-column",{attrs:{"min-width":"160","show-overflow-tooltip":"",label:e.$t("Voucher")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-link",{attrs:{target:"_blank",type:"primary",href:t.row.link}},[e._v(e._s(t.row.title))])]}}])}),a("el-table-column",{attrs:{"min-width":"60","show-overflow-tooltip":"",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.$t(e.VOUCHER_STATUS[t.row.status]))+" ")]}}])}),a("el-table-column",{attrs:{"min-width":"160","show-overflow-tooltip":"",label:e.$t("Related booking")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.product_booking?[t.row.product_booking.product_payment?a("el-link",{attrs:{target:"blank",type:"primary",href:"/order-manage/order/detail/"+t.row.product_booking.product_payment.id}},[e._v(e._s(t.row.product_booking.sn))]):[e._v(e._s(t.row.product_booking.sn))]]:e._e()]}}])}),a("el-table-column",{attrs:{"min-width":"120","show-overflow-tooltip":"",label:e.$t("Upload time")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("date")(t.row.create_dt))+" ")]}}])}),a("el-table-column",{attrs:{"min-width":"80",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return["ACT"===t.row.status?a("el-popconfirm",{attrs:{title:e.$t("Sure to invalidat voucher"),"confirm-button-text":e.$t("Ok"),"cancel-button-text":e.$t("Cancel")},on:{onConfirm:function(a){return e.invalidateVoucher(t.row.id)}}},[a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(e.$t("Invalidate")))])],1):a("el-button",{attrs:{type:"text",disabled:""}},[e._v(e._s(e.$t("invalidated")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1),a("el-dialog",{attrs:{title:e.$t("Upload voucher"),width:"650px",visible:e.uploadVisible,"before-close":e.closeUpload},on:{"update:visible":function(t){e.uploadVisible=t}}},[a("div",{staticClass:"upload-options"},[e.isRestaurant?e._e():[a("el-select",{attrs:{size:"mini",placeholder:e.$t("productmanage.common.Option"),clearable:""},model:{value:e.uploadOption,callback:function(t){e.uploadOption=t},expression:"uploadOption"}},e._l(e.options,(function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1),a("el-select",{attrs:{size:"mini",placeholder:e.$t("productmanage.common.Suboption"),clearable:""},model:{value:e.uploadSuboption,callback:function(t){e.uploadSuboption=t},expression:"uploadSuboption"}},e._l(e.subOptions(e.uploadOption),(function(e){return a("el-option",{key:e.id,attrs:{label:e.title,value:e.id}})})),1)]],2),a("div",{staticClass:"upload-container"},[a("el-upload",{ref:"uploadVoucher",attrs:{drag:"",multiple:"",action:"","http-request":e.uploadRequest,data:{path:"voucher"},"file-list":e.uploadFileList,"on-success":e.onFileUploadSuccess,"on-error":e.onFileUploadError,"on-change":e.onFileUploadChange,accept:"application/pdf","before-upload":e.beforeUpload}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v(e._s(e.$t("Click or drag the file here to upload")))]),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(e._s(e.$t("Only support PDF format and < 10MB")))])])],1)])],1)},vd=[],bd={data:function(){return{VOUCHER_STATUS:Ue,voucherList:[],productDetail:null,loading:!1,searchData:null,currentPage:1,total:0,pageSize:10,uploadVisible:!1,uploadOption:null,uploadSuboption:null,uploadFileList:[],uploadFileErrMsg:"",upload_dt:null,searchForm:{option:null,sub_option:null,status:null,upload_start_dt:null,upload_end_dt:null}}},computed:{isRestaurant:function(){return!this.productDetail||this.productDetail.type===pe.Restaurant},options:function(){var e,t,a=this;return(null===(e=this.productDetail)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.map((function(e){return{id:e.id,title:a.$options.filters.lang(e.details,a.$i18n.locale,"title")}})))||[]},subOptions:function(){var e=this;return function(t){var a,n,r,o=null===(a=e.productDetail)||void 0===a||null===(n=a.options)||void 0===n?void 0:n.find((function(e){return e.id===t}));return(null===o||void 0===o||null===(r=o.sub_options)||void 0===r?void 0:r.map((function(t){return{id:t.id,title:e.$options.filters.lang(t.details,e.$i18n.locale,"title")}})))||[]}},isSearchable:function(){var e=this;return Object.keys(this.searchForm).some((function(t){return!!e.searchForm[t]}))},fileUploading:function(){return this.uploadFileList.some((function(e){return!e.loaded}))}},watch:{uploadOption:function(e,t){e!==t&&(this.uploadSuboption=null)},upload_dt:function(e,t){e!==t&&(e&&e.length?(this.searchForm.upload_start_dt=Vt()(e[0]).format("YYYY-MM-DD"),this.searchForm.upload_end_dt=Vt()(e[1]).format("YYYY-MM-DD")):(this.searchForm.upload_start_dt=null,this.searchForm.upload_end_dt=null))},uploadVisible:function(e,t){e!==t&&e&&(this.uploadOption=null,this.uploadSuboption=null,this.uploadFileList=[])}},created:function(){this.getProductDetail(),this.getVoucherList(),this.showErrorMsg=$l()(this.showErrorMsg)},methods:{showErrorMsg:function(e){this.$message.error(e)},getOptionName:function(e){var t,a=null===(t=this.options)||void 0===t?void 0:t.find((function(t){return t.id===e}));return a?a.title:""},getSuboptionName:function(e,t){var a,n=null===(a=this.subOptions(e))||void 0===a?void 0:a.find((function(e){return e.id===t}));return n?n.title:""},getId:function(){return+new Date},onFileUploadSuccess:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o,i,s,l,c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.path=e,t.loaded=!0,r=t.raw,o=r.optionId,i=r.suboptionId,s=r.voucher,l={vouchers:[Object(F["a"])({},s)]},a.isRestaurant||(l.option_id=o,l.sub_option_id=i),c=a.uploadFileList.findIndex((function(e){return e.raw.id===t.raw.id})),c>-1&&a.uploadFileList.splice(c,1,t),n.prev=7,n.next=10,a.$api.voucher.createVoucher(a.$route.query.product_id,l);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n["catch"](7),t.status="fail";case 15:case"end":return n.stop()}}),n,null,[[7,12]])})))()},onFileUploadError:function(e){"Cancel"!==e.constructor.name&&this.showErrorMsg(this.$t("Upload failed"))},onFileUploadChange:function(e,t){this.uploadFileList=t},getBlob:function(e){return new Promise((function(t,a){var n=URL.createObjectURL(e),r=new XMLHttpRequest;r.open("GET",n),r.responseType="blob",r.onload=function(){t(this.response)},r.onerror=a,r.send()}))},uploadRequest:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=new FormData,a.next=3,t.getBlob(e.file);case 3:return r=a.sent,n.append("file",r,e.file.name),n.append("path","voucher"),o=t.$api.common.uploadFile(n,{cancelToken:new Jt.a.CancelToken((function(t){e.file.cancelflightRequest=t})),onUploadProgress:function(t){var a=t.loaded,n=t.total;e.onProgress({percent:Math.floor(100*a/n)})}}),o.finally((function(){e.file.cancelflightRequest=null})),a.abrupt("return",o.then((function(t){return e.file.voucher=t.file[0],t.file[0].url})));case 9:case"end":return a.stop()}}),a)})))()},beforeUpload:function(e){var t=this.uploadOption,a=this.uploadSuboption,n=this.isRestaurant;if(!n){if(!t)return this.showErrorMsg(this.$t("Upload voucher option is required")),!1;if(!a)return this.showErrorMsg(this.$t("Upload voucher suboption is required")),!1}t&&(e.optionId=t),a&&(e.suboptionId=a),e.id=this.getId();var r="application/pdf"===e.type,o=e.size<10485760;return!(!r||!o)||(this.showErrorMsg(this.$t("Only support PDF format and < 10MB")),!1)},showUpload:function(){this.uploadOption=null,this.uploadSuboption=null,this.uploadFileList=[],this.uploadVisible=!0},closeUpload:function(){this.uploadVisible=!1,this.uploadFileList.forEach((function(e){var t;null!==(t=e.raw)&&void 0!==t&&t.cancelflightRequest&&e.raw.cancelflightRequest()})),this.getVoucherList()},resetForm:function(){this.upload_dt=null,this.currentPage=1,this.searchForm={option:null,sub_option:null,status:null,upload_start_dt:null,upload_end_dt:null},this.getVoucherList()},getProductDetail:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getProductDetail({productId:e.$route.query.product_id});case 2:a=t.sent,e.productDetail=a;case 4:case"end":return t.stop()}}),t)})))()},invalidateVoucher:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.loading=!0,a.prev=1,a.next=4,t.$api.voucher.updateVoucherStatus(t.$route.query.product_id,e,{status:"DCT"});case 4:n=t.voucherList.find((function(t){return t.id===e})),n&&(n.status="DCT");case 6:return a.prev=6,t.loading=!1,a.finish(6);case 9:case"end":return a.stop()}}),a,null,[[1,,6,9]])})))()},search:function(){this.currentPage=1,this.getVoucherList()},getVoucherList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={page_size:e.pageSize,page:e.currentPage},n=Object.keys(e.searchForm),n.forEach((function(t){e.searchForm[t]&&(a[t]=e.searchForm[t])})),e.loading=!0,e.voucherList=[],t.prev=5,t.next=8,e.$api.voucher.getVouchersByProductId(e.$route.query.product_id,a);case 8:r=t.sent,e.voucherList=r.results,e.total=r.count;case 11:return t.prev=11,e.loading=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[5,,11,14]])})))()},reselect:function(){this.uploadOption=null,this.uploadSuboption=null,this.uploadFileList=[]},onCurrentPageChange:function(e){this.currentPage=e,this.getVoucherList()},onPageSizeChange:function(e){this.pageSize=e,this.getVoucherList()}}},yd=bd,Cd=(a("3733"),Object(R["a"])(yd,_d,vd,!1,null,"82e1f036",null)),kd=Cd.exports,wd={data:function(){return{activeName:"option"===this.$route.query.step||this.$route.query.option_id?"option":"product",productName:"",productType:"",detail:{options:[{id:"",status:"",option_sn:"",option_start_date:null,option_end_date:null,voucher_type:"",details:{},sub_options:[{id:"",sub_option_s:""}]}]}}},components:{Product:Ku,OptionModule:ud,CouponsModule:hd,VoucherModule:kd},computed:{getStep:function(){return this.$route.query.step},getStatus:function(){return"add"===this.$route.query.type&&"option"!==this.$route.query.step},isCouponTabDisabled:function(){return"add"===this.$route.query.type},isVoucherTabDisabled:function(){return"DEI"===this.productType||"add"===this.$route.query.type}},methods:{getDetail:function(){var e=this;this.$api.product.getProductDetail({productId:this.$route.query.product_id}).then((function(t){e.detail=t||{}}))}},mounted:function(){}},$d=wd,Sd=(a("6f6d"),Object(R["a"])($d,Wc,Gc,!1,null,"7c0d6c33",null)),xd=Sd.exports,Td=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-manage"},[a("router-view")],1)},Dd=[],Pd=(a("2ba1"),{}),Od=Object(R["a"])(Pd,Td,Dd,!1,null,"35887a27",null),Id=Od.exports,Rd=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-list"},[a("SeachForm",{on:{change:e.onSearchChange}}),a("div",{staticClass:"actions"},[a("el-row",[a("el-col",{staticClass:"action-right",attrs:{span:24}},[a("router-link",{attrs:{target:"_blank",to:{name:"CouponAdd",query:{type:"add"}}}},[a("el-button",{attrs:{type:"primary",size:"mini"}},[a("i",{staticClass:"el-icon-plus"}),a("span",[e._v(e._s(e.$t("Add")))])])],1)],1)],1)],1),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"uno-table",attrs:{border:"",data:e.mappedCouponList,"tooltip-effect":"dark",stripe:""},on:{"sort-change":e.onSort}},[a("el-table-column",{attrs:{prop:"id",width:"100",fixed:"",label:e.$t("Batch id")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"coupon-link",attrs:{target:"_blank",to:{name:"CouponInfo",query:{couponId:t.row.id}}}},[e._v(e._s(t.row.id))])]}}])}),a("el-table-column",{attrs:{prop:"code",width:"150",fixed:"",label:e.$t("Coupon code")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.codeType>0?a("span",{staticClass:"code-random"},[e._v(e._s(e.$t("Random")))]):a("span",[e._v(e._s(t.row.code))])]}}])}),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{class:"status status--"+t.row.status},[e._v(e._s(e.$t(e.COUPON_BATCH_STATUS[t.row.status])))])]}}])}),a("el-table-column",{attrs:{"min-width":"60","show-overflow-tooltip":"",label:e.$t("Coupon name")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("lang")(t.row.details,e.$i18n.locale,"title")))]}}])}),a("el-table-column",{attrs:{width:"120",label:e.$t("Discount type")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.getDiscountType(t.row.discountType)))]}}])}),a("el-table-column",{attrs:{width:"140",label:e.$t("Batch valid"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.validStart&&t.row.validEnd?[a("div",{staticClass:"valid-start-dt"},[e._v(e._s(e._f("date")(t.row.validStart,"YYYY-MM-DD HH:mm")))]),a("div",{staticClass:"valid-end-dt"},[e._v(e._s(e._f("date")(t.row.validEnd,"YYYY-MM-DD HH:mm")))])]:a("span",[t.row.couponValidHoursAfterRedeeming/24>1?[e._v(" "+e._s(e.$t("{day} Days",{day:(t.row.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]:[e._v(" "+e._s(e.$t("{day} Day",{day:(t.row.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]],2)]}}])}),a("el-table-column",{attrs:{width:"160",prop:"platforms","show-overflow-tooltip":"",label:e.$t("Platform")}}),a("el-table-column",{attrs:{prop:"totalLimit",width:"120","show-overflow-tooltip":"",label:e.$t("Coupon total")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(-1===t.row.totalLimit?e.$t("No limit"):t.row.totalLimit))]}}])}),a("el-table-column",{attrs:{width:"80","show-overflow-tooltip":"",label:e.$t("Picked")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.redeemedNum||0)+" ")]}}])}),a("el-table-column",{attrs:{width:"80","show-overflow-tooltip":"",label:e.$t("Used")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.usedNum||0)+" ")]}}])}),a("el-table-column",{attrs:{width:"80",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"coupon-link",attrs:{target:"_blank",to:{name:"CouponInfo",query:{couponId:t.row.id}}}},[e._v(e._s(e.$t("Detail")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},Ed=[],Md=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.searchRules}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Create date"),"end-placeholder":e.$t("Create date")},model:{value:e.formModel.createDate,callback:function(t){e.$set(e.formModel,"createDate",t)},expression:"formModel.createDate"}})],1),a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Valid date"),"end-placeholder":e.$t("Valid date")},model:{value:e.formModel.validDate,callback:function(t){e.$set(e.formModel,"validDate",t)},expression:"formModel.validDate"}})],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("Status"),clearable:!1,"collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.couponBatchStatus,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Platform"),multiple:"",clearable:!1,"collapse-tags":""},model:{value:e.formModel.platforms,callback:function(t){e.$set(e.formModel,"platforms",t)},expression:"formModel.platforms"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Discount type"),clearable:!1,"collapse-tags":""},model:{value:e.formModel.discountType,callback:function(t){e.$set(e.formModel,"discountType",t)},expression:"formModel.discountType"}},e._l(e.discountTypes,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t(""+t.label),value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},e._l(e.COUPON_BATCH_SEARCH_TYPES,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1)],1)},Nd=[],jd={createDate:[],validDate:[],status:null,platforms:null,discountType:null,keyWord:"",keyWordType:"code"},Ad={data:function(){return{formModel:Object.assign({},jd),supplierList:[],COUPON_BATCH_SEARCH_TYPES:Ce}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{searchRules:function(){var e=this,t={},a=this.formModel.keyWordType,n=function(t,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[e.$t("".concat(Ce[a]))])))};return["id","coupon_id","user_id"].indexOf(a)>-1&&(t.keyWord=[{validator:n,trigger:"change"},{validator:n,trigger:"blur"}]),t},discountTypes:function(){var e=we,t=Object.keys(e),a=[];return t.forEach((function(t){a.push({label:e[t],value:t})})),a},couponBatchStatus:function(){var e=this,t=be,a=Object.keys(t),n=[];return a.forEach((function(a){n.push({label:e.$t(t[a]),value:t[a].toLowerCase()})})),n},hasSearchData:function(){var e=this.formModel,t=e.createDate,a=e.validDate,n=e.keyWord,r=e.status,o=e.platforms,i=e.discountType;return t&&t.length||a&&a.length||n||r||o&&o.length||void 0!==i||null!==i},isSearchButtonEnable:function(){var e=this.formModel,t=e.createDate,a=e.validDate,n=e.keyWord,r=e.status,o=e.platforms,i=e.discountType;return t&&t.length||a&&a.length||n||r||o&&o.length||void 0!==i||null!==i},getData:function(){return function(e){var t=this.$t("productmanage.".concat(e)),a=Object.keys(t);return a.map((function(e){return{label:t[e],value:e.split("|")[1]}}))}}}),methods:{validateForm:function(){var e=this;return new Promise((function(t){e.$refs.searchForm.validate((function(e){t(!!e)}))}))},getVendors:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getVendor();case 2:a=t.sent,e.supplierList=a.map((function(e){return{label:e.name,value:e.id}}));case 4:case"end":return t.stop()}}),t)})))()},onClearClick:function(){Object.assign(this.formModel,jd),this.onSearch()},onSearch:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a&&e.$emit("change",e.formModel);case 4:case"end":return t.stop()}}),t)})))()},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},created:function(){this.getVendors()},mounted:function(){this.initEnterEvent()},beforeDestroy:function(){document.onkeydown=null},watch:{isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()},searchRules:function(e,t){e!==t&&this.$refs.searchForm.clearValidate()}}},Ld=Ad,Fd=(a("4715"),Object(R["a"])(Ld,Md,Nd,!1,null,"82e2aa84",null)),Ud=Fd.exports,zd={components:{SeachForm:Ud},data:function(){return{COUPON_BATCH_STATUS:be,couponList:[],loading:!1,deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{mappedCouponList:function(){var e=this;return this.couponList.map((function(t){var a=t.id,n=t.code,r=t.code_type,o=t.status,i=t.details,s=t.discount_type,l=t.valid_start_dt,c=t.valid_end_dt,u=t.total_limit,d=t.used_num,p=t.redeemed_num,m=t.coupon_valid_hours_after_redeeming,f=t.supplier,g=t.supporting_provider,h=[];return g.forEach((function(t){e.platformsMapping[t]&&h.push(e.$t("platform.".concat(e.platformsMapping[t])))})),{id:a,code:n,codeType:r,status:o,discountType:s,validStart:l,validEnd:c,supplier:f,usedNum:d,redeemedNum:p,couponValidHoursAfterRedeeming:m,totalLimit:u,platforms:h.join(","),details:i}}))}}),created:function(){this.getCouponList()},methods:{getDiscountType:function(e){return this.$t(we[e])},getCouponList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u,d;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.searchData||{},n=a.createDate,r=a.validDate,o=a.status,i=a.platforms,s=a.discountType,l=a.keyWord,c=a.keyWordType,u={ordering:e.ordering,page_size:e.pageSize,page:e.currentPage},n&&n.length&&(u.create_start_dt=Vt()(n[0]).format("YYYY-MM-DD"),u.create_end_dt=Vt()(n[1]).format("YYYY-MM-DD")),r&&r.length&&(u.valid_start_dt=Vt()(r[0]).format("YYYY-MM-DD"),u.valid_end_dt=Vt()(r[1]).format("YYYY-MM-DD")),o&&(u.coupon_status=o),i&&i.length&&(u.platform=i.join(",")),null===s&&void 0===s||(u.discount_type=s),l&&(u[c]=l),e.loading=!0,e.couponList=[],t.prev=11,t.next=14,e.$api.coupon.couponList(u);case 14:d=t.sent,e.couponList=d.results,e.total=d.count;case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[11,,17,20]])})))()},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getCouponList()},onDeleteConfirm:function(){return Object(L["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getCouponList()},onPageSizeChange:function(e){this.pageSize=e,this.getCouponList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getCouponList())}}},qd=zd,Hd=(a("e07d"),Object(R["a"])(qd,Rd,Ed,!1,null,"96922154",null)),Bd=Hd.exports,Kd=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"product-manage-operation"},[a("div",{staticClass:"title"},[e._v(e._s(e.getCouponName))]),a("el-tabs",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{key:"basic",attrs:{label:e.$t("Basic info"),name:"basic"}},[a("keep-alive",[a("basic-info",{attrs:{detail:e.detail},on:{name:function(t){return e.arr=t}}})],1)],1),a("el-tab-pane",{key:"list",attrs:{label:e.$t("Coupon list"),name:"list"}},[a("keep-alive",[a("detail-list",{attrs:{detail:e.detail},on:{name:function(t){return e.arr=t}}})],1)],1)],1)],1)},Vd=[],Yd=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"160px",size:"small"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Basic info")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Batch id")+":"}},[e._v(" "+e._s(e.form.id)+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Batch code")+":"}},[e.form.codeType>0?a("span",[e._v(e._s(e.$t("Random"))+"("),a("el-button",{attrs:{type:"text"},on:{click:e.goList}},[e._v(e._s(e.$t("see coupon list for detail")))]),e._v(")")],1):a("span",[e._v(e._s(e.form.code))])])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Status")+":"}},[e._v(" "+e._s(e.$t(e.COUPON_BATCH_STATUS[e.form.status]))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},e._l(e.form.details,(function(t,n){return a("el-form-item",{key:n,staticClass:"coupon-detail",attrs:{label:e.$t("lang."+n)+":"}},[a("div",{staticClass:"coupon-detail-title"},[e._v(e._s(t.title))]),a("div",{staticClass:"coupon-detail-desc",domProps:{innerHTML:e._s(t.meta.description)}})])})),1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Discount")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Basic currency")+":"}},[e._v(" "+e._s(e.form.baseCurrency)+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Discount type")+":"}},[e._v(" "+e._s(e.$t(e.COUPON_DISCOUNT_TYPES[e.form.discountType]))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Condition and discount")+":"}},[a("span",[e._v(e._s(e.$t(e.COUPON_CONDITION_LIMITS[e.form.usageCondition])))]),"Specific quantity"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("span",{staticClass:"coupon-condition-detail"},["Percentage"===e.COUPON_DISCOUNT_TYPES[e.form.discountType]?[e.form.minPurchaseAmount>1?[a("span",{staticClass:"condition-reach"},[e._v(e._s(e.$t("Reach {amount} pieces",{amount:e.form.minPurchaseQuantity})))]),a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount}% off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]:[a("span",{staticClass:"condition-reach"},[e._v(e._s(e.$t("Reach {amount} piece",{amount:e.form.minPurchaseQuantity})))]),a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount}% off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]]:[e.form.minPurchaseAmount>1?[a("span",{staticClass:"condition-reach"},[e._v(e._s(e.$t("Reach {amount} pieces",{amount:e.form.minPurchaseQuantity})))]),a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount} off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]:[a("span",{staticClass:"condition-reach"},[e._v(e._s(e.$t("Reach {amount} piece",{amount:e.form.minPurchaseQuantity})))]),a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount} off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]]],2):e._e(),"Specific amount"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("span",{staticClass:"coupon-condition-detail"},[a("span",{staticClass:"condition-reach"},[e._v(e._s(e.$t("Reach {amount}",{amount:e.form.minPurchaseAmount[e.form.baseCurrency]})))]),"Percentage"===e.COUPON_DISCOUNT_TYPES[e.form.discountType]?[a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount}% off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]:[a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount} off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]],2):e._e(),"No limit"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("span",{staticClass:"coupon-condition-detail"},["Percentage"===e.COUPON_DISCOUNT_TYPES[e.form.discountType]?[a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount}% off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]:[a("span",{staticClass:"condition-discount"},[e._v(e._s(e.$t("{discount} off",{discount:e.form.discountValue[e.form.baseCurrency]})))])]],2):e._e()])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Product limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Apply product")+":"}},[e._v(" "+e._s(e.$t(e.COUPON_PRODUCT_LIMITS[e.form.applyingMethod]))+" ")])],1)]),2===e.form.applyingMethod?a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Type/category")+":"}},[a("div",{staticClass:"category-wrapper"},e._l(e.form.includedCategories,(function(t,n){return a("div",{key:n,staticClass:"category-link"},[e._v(e._s(e._f("lang")(t.path,e.$i18n.locale))+"-"+e._s(e._f("lang")(t.name,e.$i18n.locale)))])})),0)])],1)]):e._e(),1===e.form.applyingMethod?a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Products")+":"}},[a("div",{staticClass:"product-wrapper"},e._l(e.form.includedProducts,(function(t,n){return a("el-link",{key:n,staticClass:"product-link",attrs:{title:e._f("lang")(t.name,e.$i18n.locale),href:e.getProductLink(t),target:"_blank"}},[e._v(e._s(t.id)+"-"+e._s(e._f("lang")(t.name,e.$i18n.locale)))])})),1)])],1)]):e._e()],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Redeem/Using limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Display in detail page")+":"}},[e._v(" "+e._s(e.form.visibleInStorefront?e.$t("Yes"):e.$t("No"))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{label:e.$t("Limit each user")}},[e._v(" "+e._s(e.form.userLimit&&-1!==e.form.userLimit?e.form.userLimit:e.$t("No limit"))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{label:e.$t("Total number")}},[e._v(" "+e._s(e.form.totalLimit&&-1!==e.form.totalLimit?e.form.totalLimit:e.$t("No limit"))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Batch valid prd")+":"}},[e._v(" "+e._s(e._f("date")(e.form.validStartDt,"YYYY-MM-DD HH:mm:ss"))),a("span",{staticClass:"date-time-splitter"},[e._v("-")]),e._v(e._s(e._f("date")(e.form.validEndDt,"YYYY-MM-DD HH:mm:ss"))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Coupon valid prd")+":"}},[e.form.couponValidStartDt&&e.form.couponValidEndDt?a("span",[e._v(" "+e._s(e._f("date")(e.form.couponValidStartDt,"YYYY-MM-DD HH:mm:ss"))),a("span",{staticClass:"date-time-splitter"},[e._v("-")]),e._v(e._s(e._f("date")(e.form.couponValidEndDt,"YYYY-MM-DD HH:mm:ss"))+" ")]):a("span",[e.form.couponValidHoursAfterRedeeming/24>1?[e._v(" "+e._s(e.$t("{day} Days",{day:(e.form.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]:[e._v(" "+e._s(e.$t("{day} Day",{day:(e.form.couponValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]],2)])],1)])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[e._v(" "+e._s(e.form.internalPlatforms.map((function(t){return e.$t("platform."+t.name)})).join(","))+" ")]),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[e._v(" "+e._s(e.form.externalPlatforms.map((function(t){return e.$t("platform."+t.name)})).join(","))+" ")]),a("el-form-item",{attrs:{label:e.$t("Create info")+":"}},[e._v(" "+e._s(e._f("date")(e.form.createDt,"YYYY-MM-DD HH:mm:ss"))+" "),e.form.createAgentDetail?a("el-popover",{attrs:{trigger:"click"}},[a("div",{staticClass:"user-info"},[a("div",[e._v(e._s(e.$t("Create agent"))+": "+e._s(e.form.createAgent))]),a("div",[e._v(e._s(e.$t("First name"))+": "+e._s(e.form.createAgentDetail.first_name))]),a("div",[e._v(e._s(e.$t("Last name"))+": "+e._s(e.form.createAgentDetail.last_name))]),a("div",[e._v(e._s(e.$t("Email"))+": "+e._s(e.form.createAgentDetail.email))])]),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(e.form.createAgentDetail.first_name)+" "+e._s(e.form.createAgentDetail.last_name))])],1):e._e()],1),a("el-form-item",{attrs:{label:e.$t("Picked")+":"}},[e._v(" "+e._s(e.form.redeemedNum||0)+" ")]),a("el-form-item",{attrs:{label:e.$t("Used")+":"}},[e._v(" "+e._s(e.form.usedNum||0)+" ")]),a("el-form-item",{attrs:{label:e.$t("Update info")}},[e._v(" "+e._s(e._f("date")(e.form.updateDt,"YYYY-MM-DD HH:mm:ss"))+" ")])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.coupon,watchObject:e.$route.query.couponId}}):e._e()],1)],1)},Wd=[],Gd={components:{EventTimeline:Au},props:{detail:{type:Object}},data:function(){return{showUpdateInfo:!1,EVENT_TYPE:Me,CURRENCY_TYPES:$e,COUPON_DISCOUNT_TYPES:we,COUPON_CONDITION_LIMITS:Se,COUPON_PRODUCT_LIMITS:xe,COUPON_NUMBER_LIMITS:Te,COUPON_BATCH_STATUS:be,form:{id:null,code:null,codeType:null,status:null,details:null,baseCurrency:null,discountType:null,discountValue:null,usageCondition:null,minPurchaseAmount:null,minPurchaseQuantity:null,applyingMethod:null,includesAllProducts:null,includedProducts:null,excludedProducts:null,includedCategories:null,totalLimit:null,userLimit:null,usedNum:null,redeemedNum:null,visibleInStorefront:null,supportingProvider:null,validStartDt:null,validEndDt:null,couponValidStartDt:null,couponValidEndDt:null,couponValidHoursAfterRedeeming:null,createDt:null,updateDt:null,createAgent:null,createAgentDetail:null,internalPlatforms:[],externalPlatforms:[]},detals:[],productList:[]}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id}}));return a}},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]}}),methods:{getProductLink:function(e){return"".concat(this.$env.mkpUrl,"/product/").concat(e.seo_sn,"/").concat(e.id)},goList:function(){this.$root.$emit("show-coupon-list")},countLabel:function(e){var t=e/2-.5;return 0===t?t="-":8.5===t&&(t="8+"),t+""},countPriorityLabel:function(e){var t=e/2+.5;return 8.5===t&&(t="8+"),t+""},formatDate:function(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")},remoteMethod:function(e,t){var a=this;if(""!==e||t){var n={};t?n["id__in"]=t:n["details__title__icontains"]=e,this.loading=!0,this.$api.product.productList(n).then((function(e){a.loading=!1,e.results&&(a.productList=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e})))}))}else this.productList=[]},handleData:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s,l,c,u,d,p,m,f,g,h,_,v,b,y,C,k,w,$,S,x,T,D,P,O,I,R,E,M,N;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e){a.next=2;break}return a.abrupt("return");case 2:for(N in n=e.id,r=e.code,o=e.code_type,i=e.status,s=e.details,l=e.base_currency,c=e.discount_type,u=e.discount_value,d=e.usage_condition,p=e.min_purchase_amount,m=e.min_purchase_quantity,f=e.applying_method,g=e.includes_all_products,h=e.included_products,_=e.excluded_products,v=e.included_categories,b=e.total_limit,y=e.user_limit,C=e.used_num,k=e.redeemed_num,w=e.visible_in_storefront,$=e.supporting_provider,S=e.valid_start_dt,x=e.valid_end_dt,T=e.coupon_valid_start_dt,D=e.coupon_valid_end_dt,P=e.coupon_valid_hours_after_redeeming,O=e.create_dt,I=e.update_dt,R=e.create_agent,E=e.create_agent_detail,t.form={id:n,code:r,codeType:o,status:i,details:s,baseCurrency:l,discountType:c,discountValue:u,usageCondition:d,minPurchaseAmount:p,minPurchaseQuantity:m,applyingMethod:f,includesAllProducts:g,includedProducts:h,excludedProducts:_,includedCategories:v,totalLimit:b,userLimit:y,usedNum:C,redeemedNum:k,visibleInStorefront:w,supportingProvider:$,validStartDt:S,validEndDt:x,couponValidStartDt:T,couponValidEndDt:D,couponValidHoursAfterRedeeming:P,createDt:O,updateDt:I,createAgent:R,createAgentDetail:E,internalPlatforms:[],externalPlatforms:[]},M=t,e.supporting_provider.forEach((function(e){M.internalPlatforms.forEach((function(t){t.value===e&&M.form.internalPlatforms.push(Object(F["a"])({},t))})),M.externalPlatforms.forEach((function(t){t.value===e&&M.form.externalPlatforms.push(Object(F["a"])({},t))}))})),e.details)t.detals.push({title:N,name:N,content:{title:e.details[N].title,description:e.details[N].description}});case 7:case"end":return a.stop()}}),a)})))()}},watch:{detail:function(e,t){e!==t&&this.handleData(this.detail)}}},Qd=Gd,Jd=(a("3271"),a("e770"),Object(R["a"])(Qd,Yd,Wd,!1,null,"70018402",null)),Xd=Jd.exports,Zd=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-list"},[a("SeachForm",{on:{change:e.onSearchChange}}),a("div",{staticClass:"table-container"},[a("div",{staticClass:"data-options"},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.exportLoading,expression:"exportLoading"}],attrs:{type:"text",size:"small"},on:{click:e.onExport}},[a("i",{staticClass:"el-icon-download"}),e._v(" "+e._s(e.$t("Export"))+" ")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.mappedCouponDetailList,"tooltip-effect":"dark",stripe:""},on:{"sort-change":e.onSort}},[a("el-table-column",{attrs:{prop:"id","min-width":"150",sortable:"",fixed:"",label:e.$t("Coupon id")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("formattedCode")(t.row.sn))+" ")]}}])}),a("el-table-column",{attrs:{prop:"id","min-width":"150",sortable:"",fixed:"",label:e.$t("Coupon code")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.code_type>0?a("span",{staticClass:"code-random"},[e._v(e._s(e.$t("Random")))]):a("span",[e._v(e._s(t.row.code))])]}}])}),a("el-table-column",{attrs:{"min-width":"100",sortable:"",fixed:"",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{class:"status status--"+t.row.status},[e._v(e._s(e.$t(e.COUPON_INFO_STATUS[t.row.status])))])]}}])}),a("el-table-column",{attrs:{"min-width":"140",label:e.$t("Valid time"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.validStart||t.row.validEnd?a("div",[a("div",{staticClass:"valid-start-dt"},[e._v(e._s(e._f("date")(t.row.validStart,"YYYY-MM-DD HH:mm")))]),a("div",{staticClass:"valid-end-dt"},[e._v(e._s(e._f("date")(t.row.validEnd,"YYYY-MM-DD HH:mm")))])]):a("span",[e._v("-")])]}}])}),a("el-table-column",{attrs:{"min-width":"140",label:e.$t("Use date"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return["USD"===t.row.status&&t.row.usedDt?a("span",[e._v(e._s(e._f("date")(t.row.usedDt,"YYYY-MM-DD HH:mm")))]):a("span",[e._v("-")])]}}])}),a("el-table-column",{attrs:{"min-width":"140",prop:"platforms","show-overflow-tooltip":"",label:e.$t("Use platform")},scopedSlots:e._u([{key:"default",fn:function(t){return["USD"===t.row.status&&t.row.platforms?a("span",[e._v(e._s(t.row.platforms))]):a("span",[e._v("-")])]}}])}),a("el-table-column",{attrs:{"min-width":"120","show-overflow-tooltip":"",label:e.$t("Related order")},scopedSlots:e._u([{key:"default",fn:function(t){return["USD"===t.row.status&&t.row.payment?a("el-link",{attrs:{target:"_blank",href:"/order-manage/order/detail/"+t.row.payment.id}},[e._v(e._s(t.row.payment.sn))]):a("span",[e._v("-")])]}}])}),a("el-table-column",{attrs:{"min-width":"140","show-overflow-tooltip":"",label:e.$t("Discount amount")},scopedSlots:e._u([{key:"default",fn:function(t){return["USD"===t.row.status&&t.row.payment?a("span",[e._v(e._s(t.row.payment.coupon_discounted_amount))]):a("span",[e._v("-")])]}}])}),a("el-table-column",{attrs:{"min-width":"80",label:e.$t("User ID")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.user?a("div",[t.row.userDetail?a("el-popover",{attrs:{trigger:"click"}},[a("div",{staticClass:"user-info"},[a("div",[e._v(e._s(e.$t("First name"))+": "+e._s(t.row.userDetail.first_name))]),a("div",[e._v(e._s(e.$t("Last name"))+": "+e._s(t.row.userDetail.last_name))]),a("div",[e._v(e._s(e.$t("Email"))+": "+e._s(t.row.userDetail.email))])]),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(t.row.user))])],1):a("span",[e._v(e._s(t.row.user))])],1):a("span",[e._v("-")])]}}])}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},ep=[],tp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.searchRules}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Use date"),"end-placeholder":e.$t("Use date")},model:{value:e.formModel.usedDate,callback:function(t){e.$set(e.formModel,"usedDate",t)},expression:"formModel.usedDate"}})],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("Status"),clearable:!1,"collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.couponInfoStatus,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Platform"),multiple:"",clearable:!1,"collapse-tags":""},model:{value:e.formModel.platforms,callback:function(t){e.$set(e.formModel,"platforms",t)},expression:"formModel.platforms"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},e._l(e.COUPON_INFO_SEARCH_TYPES,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1)],1)},ap=[],np={usedDate:[],useDate:[],status:null,platforms:[],keyWord:"",keyWordType:"coupon_id"},rp={data:function(){return{formModel:Object.assign({},np),supplierList:[],COUPON_INFO_SEARCH_TYPES:ke}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{searchRules:function(){var e=this,t={},a=this.formModel.keyWordType,n=function(t,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[e.$t("".concat(ke[a]))])))};return["coupon_id","user_id"].indexOf(a)>-1&&(t.keyWord=[{validator:n,trigger:"change"},{validator:n,trigger:"blur"}]),t},couponInfoStatus:function(){var e=this,t=ye,a=Object.keys(t),n=[];return a.forEach((function(a){n.push({label:e.$t(t[a]),value:a})})),n},hasSearchData:function(){var e=this.formModel,t=e.usedDate,a=e.keyWord,n=e.status,r=e.platforms;return t&&t.length||a||n||r&&r.length},isSearchButtonEnable:function(){var e=this.formModel,t=e.usedDate,a=e.keyWord,n=e.status,r=e.platforms;return t&&t.length||a||n||r&&r.length},getData:function(){return function(e){var t=this.$t("productmanage.".concat(e)),a=Object.keys(t);return a.map((function(e){return{label:t[e],value:e.split("|")[1]}}))}}}),methods:{validateForm:function(){var e=this;return new Promise((function(t){e.$refs.searchForm.validate((function(e){t(!!e)}))}))},getVendors:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getVendor();case 2:a=t.sent,e.supplierList=a.map((function(e){return{label:e.name,value:e.id}}));case 4:case"end":return t.stop()}}),t)})))()},onClearClick:function(){Object.assign(this.formModel,np),this.onSearch()},onSearch:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a&&e.$emit("change",e.formModel);case 4:case"end":return t.stop()}}),t)})))()},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},created:function(){this.getVendors()},mounted:function(){this.initEnterEvent()},beforeDestroy:function(){document.onkeydown=null},watch:{isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()},searchRules:function(e,t){e!==t&&this.$refs.searchForm.clearValidate()}}},op=rp,ip=(a("7caa"),Object(R["a"])(op,tp,ap,!1,null,"63555670",null)),sp=ip.exports,lp={components:{SeachForm:sp},data:function(){return{couponDetailList:[],loading:!1,deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id",COUPON_INFO_STATUS:ye,exportLoading:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{mappedCouponDetailList:function(){var e=this;return this.couponDetailList.map((function(t){var a=t.id,n=t.sn,r=t.code,o=t.code_type,i=t.status,s=t.base_coupon,l=t.used_dt,c=t.valid_start_dt,u=t.valid_end_dt,d=t.order_id,p=t.discount_amount,m=t.payment,f=t.user,g=t.supplier,h=t.user_detail,_="",v=[];return m&&m.user_detail&&[m.user_detail.provider].forEach((function(t){e.platformsMapping[t]&&v.push(e.$t("platform.".concat(e.platformsMapping[t])))})),{id:a,sn:n,code:r,codeType:o,status:i,cityName:_,orderId:d,baseCoupon:s,discountAmount:p,validStart:c,validEnd:u,usedDt:l,payment:m,supplier:g,user:f,userDetail:h,platforms:v.join(",")}}))},couponId:function(){return this.$route.query.couponId||""}}),created:function(){this.getCouponDetailList()},methods:{getSearchParams:function(){var e=this.searchData||{},t=e.usedDate,a=e.validDate,n=e.status,r=e.platforms,o=e.discountType,i=e.keyWord,s=e.keyWordType,l={ordering:this.ordering,page_size:this.pageSize,page:this.currentPage,locale:this.$i18n.locale};return t&&t.length&&(l.used_start_dt=Vt()(t[0]).format("YYYY-MM-DD"),l.used_end_dt=Vt()(t[1]).format("YYYY-MM-DD")),a&&a.length&&(l.valid_start_dt=Vt()(a[0]).format("YYYY-MM-DD"),l.valid_end_dt=Vt()(a[1]).format("YYYY-MM-DD")),n&&(l.status=n),r&&r.length&&(l.platform=r.join(",")),null===o&&void 0===o||(l.discount_type=o),i&&(l[s]=i),l},onExport:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exportLoading){t.next=2;break}return t.abrupt("return");case 2:return e.exportLoading=!0,t.prev=3,t.next=6,e.$api.coupon.exportCouponDetailList(e.couponId,e.getSearchParams());case 6:a=t.sent,Eo()(a,"CouponList.xlsx","application/vnd.ms-excel");case 8:return t.prev=8,e.exportLoading=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[3,,8,11]])})))()},getCouponDetailList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,e.couponDetailList=[],t.prev=2,t.next=5,e.$api.coupon.getCouponDetailList(e.couponId,e.getSearchParams());case 5:a=t.sent,e.couponDetailList=a.results,e.total=a.count;case 8:return t.prev=8,e.loading=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[2,,8,11]])})))()},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getCouponDetailList()},onDeleteConfirm:function(){return Object(L["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getCouponDetailList()},onPageSizeChange:function(e){this.pageSize=e,this.getCouponDetailList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getCouponDetailList())}}},cp=lp,up=(a("410e"),Object(R["a"])(cp,Zd,ep,!1,null,"72c27f2b",null)),dp=up.exports,pp={data:function(){return{activeName:"basic",ProductName:"",detail:null,arr:[],loading:!0}},components:{BasicInfo:Xd,DetailList:dp},computed:{getCouponName:function(){var e=this.detail;return e?this.$options.filters.lang(e.details,this.$i18n.locale,"title"):""}},mounted:function(){var e=this;this.getDetail(),this.$root.$off("show-coupon-list"),this.$root.$on("show-coupon-list",(function(){e.activeName="list"}))},methods:{getDetail:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,a={couponId:e.$route.query.couponId},t.next=5,e.$api.coupon.getCouponDetail(a);case 5:e.detail=t.sent;case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}}},mp=pp,fp=(a("07e7"),Object(R["a"])(mp,Kd,Vd,!1,null,"44beb65f",null)),gp=fp.exports,hp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"coupon-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"118px",size:"small",rules:e.rules,"validate-on-rule-change":!1,"show-message":!1,"inline-message":!0}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Basic info")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{prop:"code",label:e.$t("Batch code")+":"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}])},[a("el-input",{class:"input-with-select "+("0"===e.form.codeType?"":"input-with-select--hidden"),attrs:{placeholder:e.$t("Enter 6-20 characters")},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,20)}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,20)}.apply(null,arguments)},keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}},[a("el-select",{attrs:{slot:"prepend",placeholder:e.$t("General code")},slot:"prepend",model:{value:e.form.codeType,callback:function(t){e.$set(e.form,"codeType",t)},expression:"form.codeType"}},e._l(e.COUPON_BASE_CODE_TYPES,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1)],1)])],1),a("div",{staticClass:"tab-box"},[a("div",{staticClass:"fold"},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.isFold=!e.isFold}}},[e._v(e._s(e.isFold?e.$t("Expand"):e.$t("Fold"))),a("i",{class:e.isFold?"el-icon-arrow-down el-icon--right":"el-icon-arrow-up el-icon--right"})])],1),a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name,closable:e.editableTabs.length>1}},[a("div",{staticClass:"coupon-box",class:{active:e.isFold}},[e.showInfo?a("locale-content",{ref:"detailContent",refInFor:!0,attrs:{content:t.content,lang:t.name},on:{change:function(a){return e.contentChanged(t,a)}}}):e._e()],1)])})),a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getLanguageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)])],2)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Discount")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Basic currency")+":",prop:"baseCurrency"}},[a("el-select",{attrs:{placeholder:e.$t("Basic currency")},model:{value:e.form.baseCurrency,callback:function(t){e.$set(e.form,"baseCurrency",t)},expression:"form.baseCurrency"}},e._l(e.currencies,(function(t){return a("el-option",{key:t.id,attrs:{label:e.$t(t.code),value:t.code}})})),1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Discount type")+":",prop:"discountType"}},[a("el-select",{attrs:{placeholder:e.$t("Discount type")},model:{value:e.form.discountType,callback:function(t){e.$set(e.form,"discountType",t)},expression:"form.discountType"}},e._l(e.COUPON_DISCOUNT_TYPES,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content grid-content-compact"},[e.form.usageCondition&&"No limit"!==e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?e._e():a("el-form-item",{staticClass:"first-item",attrs:{label:e.$t("Condition and discount")+":",prop:"usageCondition"}},[a("el-select",{attrs:{width:220,placeholder:e.$t("Condition and discount")},model:{value:e.form.usageCondition,callback:function(t){e.$set(e.form,"usageCondition",t)},expression:"form.usageCondition"}},e._l(e.COUPON_CONDITION_LIMITS,(function(t,n){return a("el-option",{key:t,attrs:{label:e.$t(t),value:n}})})),1)],1),"Specific amount"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("el-form-item",{attrs:{label:e.$t("Condition and discount")+":",prop:"minPurchaseAmount"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}],null,!1,3238279197)},["Specific amount"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$t("Condition amount")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.minPurchaseAmount,callback:function(t){e.$set(e.form,"minPurchaseAmount",t)},expression:"form.minPurchaseAmount"}},[a("el-select",{attrs:{slot:"prepend",width:220,placeholder:e.$t("Condition and discount")},slot:"prepend",model:{value:e.form.usageCondition,callback:function(t){e.$set(e.form,"usageCondition",t)},expression:"form.usageCondition"}},e._l(e.COUPON_CONDITION_LIMITS,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1):e._e()],1):e._e(),"Specific quantity"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("el-form-item",{attrs:{label:e.$t("Condition and discount")+":",prop:"minPurchaseQuantity"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}],null,!1,3238279197)},["Specific quantity"===e.COUPON_CONDITION_LIMITS[e.form.usageCondition]?a("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$t("Condition quantity")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.minPurchaseQuantity,callback:function(t){e.$set(e.form,"minPurchaseQuantity",t)},expression:"form.minPurchaseQuantity"}},[a("el-select",{attrs:{slot:"prepend",width:220,placeholder:e.$t("Condition and discount")},slot:"prepend",model:{value:e.form.usageCondition,callback:function(t){e.$set(e.form,"usageCondition",t)},expression:"form.usageCondition"}},e._l(e.COUPON_CONDITION_LIMITS,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1):e._e()],1):e._e(),"Percentage"===e.COUPON_DISCOUNT_TYPES[e.form.discountType]?a("el-form-item",{staticClass:"last-item",attrs:{label:"",prop:"discountValue"}},[a("el-input",{attrs:{placeholder:e.$t("Discount percentage")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.discountValue,callback:function(t){e.$set(e.form,"discountValue",t)},expression:"form.discountValue"}},[a("template",{slot:"append"},[[e._v(e._s(e.$t("% off")))]],2)],2)],1):a("el-form-item",{staticClass:"last-item",attrs:{label:"",prop:"discountValue"}},[a("el-input",{attrs:{placeholder:e.$t("Discount total")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.discountValue,callback:function(t){e.$set(e.form,"discountValue",t)},expression:"form.discountValue"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Product limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Apply product")+":",prop:"applyingMethod"}},[a("el-radio-group",{attrs:{placeholder:e.$t("Apply product")},model:{value:e.form.applyingMethod,callback:function(t){e.$set(e.form,"applyingMethod",t)},expression:"form.applyingMethod"}},e._l(e.COUPON_PRODUCT_LIMITS,(function(t,n){return a("el-radio",{key:n,attrs:{label:n}},[e._v(e._s(e.$t(t)))])})),1)],1)],1)])],1),"Specific type/category"===e.COUPON_PRODUCT_LIMITS[e.form.applyingMethod]?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:e.$t("Type/category")+":",prop:"includedCategories"}},[a("el-cascader",{staticClass:"select-long",attrs:{options:e.mappedProductTypes,placeholder:e.$t("Product type and category"),clearable:!0,props:{multiple:!0,expandTrigger:"hover"}},model:{value:e.form.includedCategories,callback:function(t){e.$set(e.form,"includedCategories",t)},expression:"form.includedCategories"}})],1)],1)],1):e._e(),"Specific product"===e.COUPON_PRODUCT_LIMITS[e.form.applyingMethod]?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"includedProducts"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.productLoading,expression:"productLoading"}],staticClass:"select-long",attrs:{width:"350px",placeholder:e.form.includedProducts.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.productsSearch},model:{value:e.form.includedProducts,callback:function(t){e.$set(e.form,"includedProducts",t)},expression:"form.includedProducts"}},e._l(e.getRes(e.productList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1)],1):e._e(),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"coupon-title"},[e._v(e._s(e.$t("Redeem/Using limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Display in detail page")+":",prop:"visibleInStorefront"}},[a("el-select",{attrs:{disabled:e.isRandom,placeholder:e.$t("Display in detail page")},model:{value:e.form.visibleInStorefront,callback:function(t){e.$set(e.form,"visibleInStorefront",t)},expression:"form.visibleInStorefront"}},[a("el-option",{attrs:{label:e.$t("Yes"),value:!0}}),a("el-option",{attrs:{label:e.$t("No"),value:!1}})],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{label:e.$t("Limit each user")+":",prop:"userLimit"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}])},[a("el-input",{class:"input-with-select "+("1"===e.isUserLimit?"":"input-with-select--hidden"),attrs:{disabled:e.isRandom,placeholder:e.$t("Limit number")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.userLimit,callback:function(t){e.$set(e.form,"userLimit",t)},expression:"form.userLimit"}},[a("el-select",{attrs:{slot:"prepend",disabled:e.isRandom,placeholder:e.$t("Limit number")},slot:"prepend",model:{value:e.isUserLimit,callback:function(t){e.isUserLimit=t},expression:"isUserLimit"}},e._l(e.COUPON_NUMBER_LIMITS,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{prop:"totalLimit",label:e.$t("Total number")+":"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}])},[a("el-input",{class:"input-with-select "+("1"===e.isTotalLimit?"":"input-with-select--hidden"),attrs:{placeholder:e.$t("Total number")},nativeOn:{keypress:function(t){return function(t){return e.rejectSpace(t)}.apply(null,arguments)}},model:{value:e.form.totalLimit,callback:function(t){e.$set(e.form,"totalLimit",t)},expression:"form.totalLimit"}},[a("el-select",{attrs:{slot:"prepend",disabled:e.isRandom,placeholder:e.$t("Limit number")},slot:"prepend",model:{value:e.isTotalLimit,callback:function(t){e.isTotalLimit=t},expression:"isTotalLimit"}},e._l(e.COUPON_NUMBER_LIMITS,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Batch valid prd")+":",prop:"batchValidPrd"}},[a("el-date-picker",{attrs:{"picker-options":e.getPickerOptions(),type:"datetimerange","default-time":e.defaultTime,"start-placeholder":e.$t("StartDate"),"end-placeholder":e.$t("EndDate")},model:{value:e.form.batchValidPrd,callback:function(t){e.$set(e.form,"batchValidPrd",t)},expression:"form.batchValidPrd"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content grid-content-compact"},[a("el-form-item",{attrs:{label:e.$t("Coupon valid prd")+":",prop:"couponValidHoursAfterRedeeming"},scopedSlots:e._u([{key:"error",fn:function(t){return a("div",{staticClass:"form-error"},[e._v(e._s(t.error))])}}])},[a("el-input",{class:"input-with-select "+("Specific days"===e.COUPON_VALID_PEROID[e.isValidPrdByDays]?"":"input-with-select--hidden"),attrs:{placeholder:e.$t("Number of days")},model:{value:e.form.couponValidHoursAfterRedeeming,callback:function(t){e.$set(e.form,"couponValidHoursAfterRedeeming",t)},expression:"form.couponValidHoursAfterRedeeming"}},[a("el-select",{attrs:{slot:"prepend",placeholder:e.$t("Number of days")},slot:"prepend",model:{value:e.isValidPrdByDays,callback:function(t){e.isValidPrdByDays=t},expression:"isValidPrdByDays"}},e._l(e.COUPON_VALID_PEROID,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:n}})})),1)],1)],1)],1)])],1),"Specific peroid"===e.COUPON_VALID_PEROID[e.isValidPrdByDays]?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Coupon valid prd")+":",prop:"couponValidPrd"}},[a("el-date-picker",{attrs:{"picker-options":e.getPickerOptions(),type:"datetimerange",clearable:"","default-time":e.defaultTime,"start-placeholder":e.$t("StartDate"),"end-placeholder":e.$t("EndDate")},model:{value:e.form.couponValidPrd,callback:function(t){e.$set(e.form,"couponValidPrd",t)},expression:"form.couponValidPrd"}})],1)],1)])],1):e._e(),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1)],1),a("div",{staticClass:"tab-box"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Submit")))]),a("el-button",{attrs:{type:"gray",size:"small"},on:{click:e.cancel}},[e._v(e._s(e.$t("Cancel")))])],1)],1)},_p=[],vp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"couponInfo",staticClass:"coupon-manage-info"},[a("el-form",{ref:"couponFormRef",attrs:{model:e.couponForm,size:"small",rules:e.rules,"label-position":"top","show-message":!1,"inline-message":!0}},[a("el-form-item",{attrs:{label:e.$t("Coupon name")+":",prop:"title"}},[a("el-input",{attrs:{placeholder:e.$t("Coupon name")},on:{change:e.change},model:{value:e.couponForm.title,callback:function(t){e.$set(e.couponForm,"title",t)},expression:"couponForm.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Description")+":",prop:"description"}},[a("el-input",{attrs:{type:"textarea",placeholder:e.$t("Description")},on:{change:e.change},model:{value:e.couponForm.description,callback:function(t){e.$set(e.couponForm,"description",t)},expression:"couponForm.description"}})],1)],1)],1)},bp=[],yp={data:function(){return{couponForm:{title:"",description:""},isFirst:!0}},props:["content","lang"],computed:{rules:function(){var e={title:[{required:!0,message:this.$t("EnterSomething")}],description:[{required:!0,message:this.$t("EnterSomething")}]};return e}},watch:{"couponForm.title":{handler:function(e){this.couponForm.title=e||""}},"couponForm.description":{handler:function(e){this.couponForm.description=e||""}}},methods:{checkAll:function(){var e=this;return new Promise((function(t,a){e.$refs.couponFormRef&&e.$refs.couponFormRef.validate((function(e){t(!!e)}))}))},change:function(){this.$emit("change",this.couponForm)}},beforeMount:function(){this.content&&Object.assign(this.couponForm,this.content)}},Cp=yp,kp=Object(R["a"])(Cp,vp,bp,!1,null,null,null),wp=kp.exports,$p={data:function(){return{currencies:[],lastEvent:null,CURRENCY_TYPES:$e,COUPON_DISCOUNT_TYPES:we,COUPON_CONDITION_LIMITS:Se,COUPON_PRODUCT_LIMITS:xe,COUPON_NUMBER_LIMITS:Te,COUPON_VALID_PEROID:De,COUPON_BASE_CODE_TYPES:Pe,defaultTime:["00:00:00","23:59:59"],form:{code:"",codeType:"0",status:"ACT",details:{},baseCurrency:"HKD",discountType:"0",discountValue:null,usageCondition:"0",minPurchaseAmount:null,minPurchaseQuantity:null,applyingMethod:"0",includesAllProducts:!0,includedProducts:[],excludedProducts:[],includedCategories:[],totalLimit:null,userLimit:null,usedNum:null,redeemedNum:null,visibleInStorefront:!1,supportingProvider:null,validStartDt:null,validEndDt:null,couponValidStartDt:null,couponValidEndDt:null,couponValidHoursAfterRedeeming:null,createDt:null,updateDt:null,createAgent:null,createAgentDetail:null,internalPlatforms:[],externalPlatforms:[],batchValidPrd:null,couponValidPrd:null},isUserLimit:"0",isTotalLimit:"0",isValidPrdByDays:"0",editableTabs:[{title:"en_US",name:"en_US",content:{title:"",description:""}}],isFold:!1,languagePageList:["en_US","zh_CN","zh_HK","ko_KR"],editableTabsValue:"en_US",isSubmiting:!1,showInfo:!0,productLoading:!1,productList:[],rules:{}}},components:{LocaleContent:wp},watch:{"form.usageCondition":function(e,t){if(e!==t){switch(Se[e]){case"No limit":this.form.minPurchaseAmount="-1",this.form.minPurchaseQuantity="-1",this.$refs.form.clearValidate("minPurchaseAmount"),this.$refs.form.clearValidate("minPurchaseQuantity");break;case"Specific amount":this.form.minPurchaseQuantity="-1",this.form.minPurchaseAmount=null,this.$refs.form.clearValidate("minPurchaseQuantity");break;case"Specific quantity":this.form.minPurchaseQuantity=null,this.form.minPurchaseAmount="-1",this.$refs.form.clearValidate("minPurchaseAmount");break}this.rules=this.getRules()}},"form.applyingMethod":function(e,t){if(e!==t){switch(xe[e]){case"No limit":this.form.includedCategories=[],this.form.includedProducts=[],this.form.includesAllProducts=!0;break;case"Specific type/category":this.form.includedProducts=[],this.form.includesAllProducts=!1;break;case"Specific product":this.form.includedCategories=[],this.form.includesAllProducts=!1;break}this.rules=this.getRules()}},isUserLimit:function(e,t){e&&e!==t&&(this.form.userLimit="1"),e||(this.form.userLimit="-1"),this.rules=this.getRules()},isTotalLimit:function(e,t){e&&e!==t&&(this.form.totalLimit=null),e||(this.form.totalLimit="-1"),this.rules=this.getRules()},"form.batchValidPrd":function(e,t){e&&e.length?(this.form.validStartDt=e[0],this.form.validEndDt=e[1]):(this.form.validStartDt=null,this.form.validEndDt=null),this.rules=this.getRules()},"form.couponValidPrd":function(e,t){e&&e.length?(this.form.couponValidStartDt=e[0],this.form.couponValidEndDt=e[1]):(this.form.couponValidStartDt=null,this.form.couponValidEndDt=null),this.rules=this.getRules()},isValidPrdByDays:function(e,t){e!==t&&(e>0?this.form.couponValidHoursAfterRedeeming=null:(this.form.couponValidHoursAfterRedeeming="7",this.form.couponValidStartDt=null,this.form.couponValidEndDt=null,this.form.couponValidPrd=null),this.rules=this.getRules())},"form.codeType":function(e,t){if(e!==t){switch(Pe[e]){case"General code":break;case"8 random code":case"12 random code":this.form.visibleInStorefront=!1,this.form.userLimit="-1",this.isUserLimit="0",this.isTotalLimit="1";break}this.form.code="",this.rules=this.getRules()}},rules:function(){var e=this;this.$nextTick((function(){e.$refs.form.clearValidate()}))}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{isRandom:function(){return"General code"!==Pe[this.form.codeType]},mappedProductTypes:function(){var e=this;return this.productTypes.map((function(t){return{label:t.name[e.$i18n.locale],value:pe[t.name["en_US"]],children:t.children.map((function(t){return{label:t.name[e.$i18n.locale],value:t.id}}))}}))},getLanguageList:function(){var e=this,t=[];return this.languagePageList.forEach((function(a){e.editableTabs.findIndex((function(e){return e.name===a}))>-1||t.push(a)})),t},getRes:function(){var e=this.$i18n.locale;return function(t){var a=this,n=t.map((function(t){return{label:a.$options.filters.lang(t.details,e,"title"),value:t.id}}));return n}},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]}}),methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},getRules:function(){var e=this,t=function(t,a,n){if(a<=0||isNaN(a)||"number"!==typeof(a-0))n(new Error(e.$t("productmanage.common.MustBeDigitGreaterThan0")));else if(a>0&&!isNaN(a)&&"number"===typeof(a-0)){var r=a.toString().indexOf(".");if(r>-1){var o=a.length-1-r;o>2?n(new Error(e.$t("UpToTwoDecimalPlaces"))):n()}else n()}else n()},a=function(t,a,n){a<=0||!/^[0-9]+$/.test(""+a)?n(new Error(e.$t("MustBeIntegerGreaterThan0"))):n()},n=function(t,a,n){var r=a.trim().replace(/[^ -~]/g,"aa");0===r.length?n(new Error(e.$t("ItsRequired"))):r.length<6||r.length>20?n(new Error(e.$t("Length should between 6 and 20"))):/\s+/.test(r)?n(new Error(e.$t("Cannot contain spaces"))):n()},r=function(t,a,n){"boolean"!==typeof a?n(new Error(e.$t("ItsRequired"))):n()},o={discountType:[{required:!0}],usageCondition:[{required:!0}]};"General code"===Pe[this.form.codeType]&&(o.code=[{name:this.$t("Batch code"),required:!0,validator:n,trigger:"change"}]),o.baseCurrency=[{name:this.$t("Basic currency"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}],o.baseCurrency=[{name:this.$t("Discount type"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}],o.baseCurrency=[{name:this.$t("Condition and discount"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}];var i=this.form,s=i.usageCondition,l=i.applyingMethod,c=i.minPurchaseAmount,u=i.discountType;switch(we[u]){case"Amount":o.discountValue=[{name:this.$t("Discount total"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:t,trigger:"change"},{validator:function(t,a,n){+c>0&&+a>=+c?n(new Error(e.$t("Should less than condition amount"))):n()},trigger:"change"}];break;case"Percentage":o.discountValue=[{name:this.$t("Discount percentage"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:a,trigger:"change"},{validator:function(t,a,n){a<=0||a>=100?n(new Error(e.$t("Should between 1 and 99"))):n()},trigger:"change"}];break}switch(o.applyingMethod=[{name:this.$t("Apply product"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}],Se[s]){case"No limit":break;case"Specific amount":o.minPurchaseAmount=[{name:this.$t("Condition amount"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:t,trigger:"change"}];break;case"Specific quantity":o.minPurchaseQuantity=[{name:this.$t("Condition quantity"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:t,trigger:"change"}];break}switch(xe[l]){case"Specific type/category":o.includedCategories=[{name:this.$t("Type/category"),type:"array",required:!0,message:this.$t("ItsRequired"),trigger:"change"}];break;case"Specific product":o.includedProducts=[{name:this.$t("Products"),type:"array",required:!0,message:this.$t("ItsRequired"),trigger:"change"}];break}o.visibleInStorefront=[{name:this.$t("Display in detail page"),validator:r,message:this.$t("ItsRequired"),trigger:"change"}];var d=this.isUserLimit,p=this.isTotalLimit,m=this.isValidPrdByDays;switch(d>0&&(o.userLimit=[{name:this.$t("Limit each user"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:a,trigger:"change"}]),p>0&&(o.totalLimit=[{name:this.$t("Total number"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:a,trigger:"change"}]),De[m]){case"Specific days":o.couponValidHoursAfterRedeeming=[{name:this.$t("Specific days"),required:!0,message:this.$t("ItsRequired"),trigger:"change"},{validator:a,trigger:"change"}];break;case"Specific peroid":o.couponValidPrd=[{name:this.$t("Coupon valid prd"),type:"array",required:!0,message:this.$t("ItsRequired"),trigger:"change"}];break}return o.batchValidPrd=[{name:this.$t("Batch valid prd"),type:"array",required:!0,message:this.$t("ItsRequired"),trigger:"change"}],o},getPickerOptions:function(){return{disabledDate:function(e){return Vt()(Vt()(e).format("YYYY-MM-DD"))0?w:-1,user_limit:e.isUserLimit>0?+$:-1,visible_in_storefront:S,supporting_provider:o,valid_start_dt:Vt()(x).format("YYYY-MM-DD HH:mm:ss"),valid_end_dt:Vt()(T).format("YYYY-MM-DD HH:mm:ss")},"General code"===Pe[c]&&(I.code=l),D&&(I.coupon_valid_start_dt=Vt()(D).format("YYYY-MM-DD HH:mm:ss")),P&&(I.coupon_valid_end_dt=Vt()(P).format("YYYY-MM-DD HH:mm:ss")),O&&(I.coupon_valid_hours_after_redeeming=24*O),I.min_purchase_amount=-1,I.min_purchase_quantity=-1,t.t0=Se[g],t.next="No limit"===t.t0?14:"Specific amount"===t.t0?15:"Specific quantity"===t.t0?17:19;break;case 14:return t.abrupt("break",19);case 15:return I.min_purchase_amount=+h,t.abrupt("break",19);case 17:return I.min_purchase_quantity=+_,t.abrupt("break",19);case 19:return e.editableTabs.forEach((function(e){var t=e.content,a=t.title,n=t.description;I.details[e.name]={title:a,meta:{title:a,description:n.replace(/\u21b5|\r\n|\n/g,"
")}}})),e.isSubmiting=!0,t.prev=21,t.next=24,e.$api.coupon.createCoupon(I);case 24:R=t.sent,e.form.id=R.id,e.$message.success(e.$t("Save successfully")),e.$router.replace({name:"CouponInfo",query:{couponId:R.id}}),t.next=44;break;case 30:if(t.prev=30,t.t1=t["catch"](21),E=e.$t("Save failed"),!t.t1||!t.t1.error_code){t.next=44;break}t.t2=t.t1.error_code,t.next=24001===t.t2?37:24009===t.t2?39:24010===t.t2?41:43;break;case 37:return E=e.$t("Code existed, please enter a new code"),t.abrupt("break",43);case 39:return E=e.$t("If code has 8 characters, it can not contain 5 characters and 3 digits"),t.abrupt("break",43);case 41:return E=e.$t("If code has 12 characters, it can not contain 7 characters and 5 digits"),t.abrupt("break",43);case 43:e.$message.error(E);case 44:return t.prev=44,e.isSubmiting=!1,t.finish(44);case 47:t.next=54;break;case 49:e.isSubmiting=!1,M=e.$i18n.locale,N="",e.editableTabs.forEach((function(t,a){if(n[a])return!0;"en_US"===M?(N||(N="Save failed! Some required fields are not filled in
"),N+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===M?(N||(N="保存失败!以下有必填项未填
"),N+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===M&&(N||(N="保存失敗!以下有必填項未填
"),N+="[".concat(e.$t("lang."+t.name),"]
"))})),e.$message({dangerouslyUseHTMLString:!0,message:N,type:"error"});case 54:t.next=71;break;case 56:e.isSubmiting=!1,j=e.$i18n.locale,A="",L={},Object.keys(e.rules).forEach((function(t){L[t]=e.rules[t][0].name})),t.t3=regeneratorRuntime.keys(L);case 62:if((t.t4=t.t3()).done){t.next=69;break}if(F=t.t4.value,r[F]){t.next=66;break}return t.abrupt("continue",62);case 66:"en_US"===j?(A||(A="Save failed! Some required fields are not filled in
"),A+="[".concat(L[F],"]
")):"zh_CN"===j?(A||(A="保存失败!以下有必填项未填
"),A+="[".concat(L[F],"]
")):"zh_HK"===j&&(A||(A="保存失敗!以下有必填項未填
"),A+="[".concat(L[F],"]
")),t.next=62;break;case 69:e.editableTabs.forEach((function(t,a){if(n[a])return!0;"en_US"===j?(A||(A="Save failed! Some required fields are not filled in
"),A+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===j?(A||(A="保存失败!以下有必填项未填
"),A+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===j&&(A||(A="保存失敗!以下有必填項未填
"),A+="[".concat(e.$t("lang."+t.name),"]
"))})),A&&e.$message({dangerouslyUseHTMLString:!0,message:A,type:"error"});case 71:case"end":return t.stop()}}),t,null,[[21,30,44,47]])})));return function(e,a){return t.apply(this,arguments)}}());case 16:case"end":return t.stop()}}),t)})))()},cancel:function(){this.$router.push("/marketing/coupon-list")},rejectSpace:function(e){var t=e.key,a=e.isComposing;if(a||/\s/.test(t))return e.returnValue=!1,!1},rejectUnneccissaryChar:function(e,t){var a=e.isComposing;if(!a){var n=this.form.code;if(n.replace(/[^ -~]/g,"aa").length>t){var r=0,o=0;while(rt)break;r++}this.form.code=n.substring(0,r)}}}},beforeMount:function(){var e=this;this.getTreeList(),this.getCurrencies(),window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))})),this.rules=this.getRules()}},Sp=$p,xp=(a("89e1"),a("e115"),Object(R["a"])(Sp,hp,_p,!1,null,"52118369",null)),Tp=xp.exports,Dp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"faq-wrapper"},[a("div",{staticClass:"inner"},[a("el-card",{staticClass:"category-wrapper",attrs:{shadow:"never","body-style":e.cardBodyStyle}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[e._v(e._s(e.$t("Category")))]),a("el-button",{staticStyle:{float:"right",padding:"0"},attrs:{type:"text"},on:{click:e.onCategoryEditClick}},[e._v(e._s(e.$t("Edit")))])],1),a("el-tabs",{attrs:{value:e.currentLang},on:{"tab-click":e.onLangTabClick}},[e.languages.en_US?a("el-tab-pane",{attrs:{label:e.$t("lang.en_US"),name:"0"}}):e._e(),e.languages.zh_CN?a("el-tab-pane",{attrs:{label:e.$t("lang.zh_CN"),name:"1"}}):e._e(),e.languages.zh_HK?a("el-tab-pane",{attrs:{label:e.$t("lang.zh_HK"),name:"2"}}):e._e()],1),a("div",{staticClass:"category-tree"},[a("el-tree",{attrs:{"node-key":"id",data:e.categoryTreeData,"default-expanded-keys":[e.currentCategoryId],"current-node-key":e.currentCategoryId,"expand-on-click-node":!1,"render-content":e.renderContent},on:{"node-click":e.onCategoryClick}})],1)],1),a("div",{staticClass:"page-content"},[a("div",{staticClass:"search-wrapper"},[a("el-form",{staticClass:"search",nativeOn:{submit:function(t){return t.preventDefault(),e.onSearchSubmit.apply(null,arguments)}}},[a("el-input",{attrs:{size:"small",placeholder:e.$t("Search question"),"prefix-icon":"el-icon-search"},model:{value:e.searchWords,callback:function(t){e.searchWords=t},expression:"searchWords"}},[a("el-button",{attrs:{slot:"append","native-type":"submit",icon:"el-icon-search"},slot:"append"})],1),a("el-select",{staticClass:"status-select",attrs:{size:"small"},model:{value:e.qnaStatusFilter,callback:function(t){e.qnaStatusFilter=t},expression:"qnaStatusFilter"}},[a("el-option",{attrs:{label:e.$t("All status"),value:0}}),a("el-option",{attrs:{label:e.$t("Online"),value:1}}),a("el-option",{attrs:{label:e.$t("Offline"),value:2}})],1)],1),a("div",{staticClass:"actions"},[e.selectedQnas.length?a("el-button",{staticClass:"button-delete",attrs:{size:"small",type:"text"},on:{click:e.onDeleteSelectedQnaClick}},[e._v(e._s(e.$t("Delete seleted")))]):a("el-button",{attrs:{size:"small",type:"text"},on:{click:e.onImportQnaClick}},[e._v(e._s(e.$t("Import")))]),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.onAddQnaClick}},[e._v(e._s(e.$t("Add")))])],1)],1),a("div",{staticClass:"qna-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.filteredQnaData,stripe:"",height:"100%"},on:{"selection-change":e.onSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"45"}}),a("el-table-column",{attrs:{prop:"question",label:e.$t("Question")}}),a("el-table-column",{attrs:{align:"center",prop:"active",label:e.$t("Status"),width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.active?a("span",[e._v(e._s(e.$t("On")))]):a("span",[e._v(e._s(e.$t("Off")))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"expired_date",label:e.$t("Expired date"),width:"150px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.expired_date?a("span",[e._v(e._s(e._f("date")(t.row.expired_date)))]):a("span",[e._v(e._s(e.$t("Infinite")))])]}}])}),a("el-table-column",{attrs:{label:e.$t("Action"),width:"150px",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.onEditQnaClick(t.row)}}},[e._v(e._s(e.$t("Edit")))]),a("span",{staticClass:"spliter"},[e._v("|")]),a("el-popover",{attrs:{placement:"top"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete ?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{type:"default",size:"mini"},on:{click:e.onDelCancelClick}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.onDelConfirm(t.row)}}},[e._v(e._s(e.$t("Ok")))])],1),a("el-button",{attrs:{slot:"reference",type:"text",size:"small"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)]}}])})],1)],1),a("el-pagination",{attrs:{layout:"prev, pager, next",total:e.qna.total,"page-size":e.qna.pageSize},on:{"current-change":e.onPageChanged}})],1)],1),a("DialogCategory",{attrs:{visible:e.categoryDialogVisible},on:{"update:visible":function(t){e.categoryDialogVisible=t}}}),a("DialogQna",{attrs:{qna:e.currentQna,visible:e.qnaDialogVisible},on:{"update:visible":function(t){e.qnaDialogVisible=t}}}),a("DialogImportQna",{attrs:{visible:e.importQnaDialogVisible},on:{"update:visible":function(t){e.importQnaDialogVisible=t}}})],1)},Pp=[],Op=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"dialog-category",attrs:{title:e.$t("Category"),"close-on-click-modal":!1,visible:e.visible,width:"1000px","append-to-body":"","destroy-on-close":""},on:{"update:visible":e.updateVisible}},[a("div",{staticClass:"category-lang"},[a("span",{staticClass:"lang-name"},[e._v(e._s(e.categoryLangText))])]),a("div",{staticClass:"category-list-wrapper"},[a("CategoryList",{attrs:{"current-category":e.selectedLv1Category,categories:e.level1Categories,level:1},on:{selected:e.onCategorySelected}}),a("CategoryList",{attrs:{"current-category":e.selectedLv2Category,"parent-id":e.selectedLv1Category&&e.selectedLv1Category.id,categories:e.level2Categories,level:2},on:{selected:e.onCategorySelected}}),a("CategoryList",{attrs:{"current-category":e.selectedLv3Category,"parent-id":e.selectedLv2Category&&e.selectedLv2Category.id,categories:e.level3Categories,level:3},on:{selected:e.onCategorySelected}}),a("CategoryList",{attrs:{"current-category":e.selectedLv4Category,"parent-id":e.selectedLv3Category&&e.selectedLv3Category.id,categories:e.level4Categories,level:4},on:{selected:e.onCategorySelected}}),a("CategoryList",{attrs:{"current-category":e.selectedLv5Category,"parent-id":e.selectedLv4Category&&e.selectedLv4Category.id,categories:e.level5Categories,level:5},on:{selected:e.onCategorySelected}})],1)])},Ip=[],Rp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"category-list"},[a("div",{staticClass:"title"},[e._v(" LV "+e._s(e.level)+" ")]),e.categories?a("div",{staticClass:"list"},[e._l(e.categories,(function(t){return a("CategoryListItem",{key:t.id,class:{selected:t.id===e.currentCategory.id},attrs:{category:t,level:e.level,"parent-id":e.parentId},on:{click:e.onCategoryItemClick}})})),a("div",{staticClass:"add-item"},[e.isAdding?a("div",{staticClass:"add-item-input"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.catgoryName,expression:"catgoryName"}],ref:"catgoryName",attrs:{type:"text",disabled:e.submitting},domProps:{value:e.catgoryName},on:{input:function(t){t.target.composing||(e.catgoryName=t.target.value)}}}),a("button",{attrs:{disabled:e.submitting},on:{click:e.onSubmitClick}},[a("span",{staticClass:"iconfont icon-icon_circle_check"})]),a("button",{attrs:{disabled:e.submitting},on:{click:e.onCancelClick}},[a("span",{staticClass:"iconfont icon-icon_circle_close"})])]):a("el-button",{attrs:{size:"mini",type:"text"},on:{click:e.onAddClick}},[e._v(e._s(e.$t("Add")))])],1)],2):e._e()])},Ep=[],Mp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.submitting,expression:"submitting"}],staticClass:"category-list-item",on:{click:e.onCategoryItemClick}},[e.category?[e.isEditing?a("div",{staticClass:"edit-item-input"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.catgoryName,expression:"catgoryName"}],attrs:{type:"text",disabled:e.submitting},domProps:{value:e.catgoryName},on:{input:function(t){t.target.composing||(e.catgoryName=t.target.value)}}}),a("button",{staticClass:"button-action",attrs:{disabled:e.submitting},on:{click:e.onSubmitClick}},[a("span",{staticClass:"iconfont icon-icon_circle_check"})]),a("button",{staticClass:"button-action",attrs:{disabled:e.submitting},on:{click:e.onCancelClick}},[a("span",{staticClass:"iconfont icon-icon_circle_close"})])]):a("div",{staticClass:"category-info"},[a("div",{staticClass:"category-name",class:{inactive:!e.category.active}},[e._v(" "+e._s(e.category.name)+" ")]),a("button",{staticClass:"button-action",attrs:{disabled:e.submitting},on:{click:e.onEditClick}},[a("span",{staticClass:"iconfont icon-icon_edit"})]),a("el-popover",{staticStyle:{display:"block",width:"20px"},attrs:{placement:"top"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{type:"default",size:"mini"},on:{click:e.onDelCancelClick}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onDeleteClick}},[e._v(e._s(e.$t("Ok")))])],1),a("button",{staticClass:"button-action",attrs:{slot:"reference",disabled:e.submitting},slot:"reference"},[a("span",{staticClass:"iconfont icon-icon_delete"})])])],1)]:e._e()],2)},Np=[],jp={props:{level:Number,category:{type:Object,default:function(){return Object.create(null)}},parentId:{type:String}},data:function(){return{catgoryName:"",isEditing:!1,submitting:!1}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("faq",["updateCategory","deleteCategory"])),{},{onCategoryItemClick:function(){this.$emit("click",this.category)},onEditClick:function(){this.catgoryName=this.category.name,this.isEditing=!0},onCancelClick:function(){this.isEditing=!1},onSubmitClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.catgoryName){t.next=2;break}return t.abrupt("return");case 2:return a={id:e.category.id,level:e.level,name:e.catgoryName,active:e.category.active},e.submitting=!0,t.prev=4,t.next=7,e.updateCategory(a);case 7:e.isEditing=!1;case 8:return t.prev=8,e.submitting=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[4,,8,11]])})))()},onToggleClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={id:e.category.id,level:e.level,name:e.category.name,active:!e.category.active},e.submitting=!0,t.prev=2,t.next=5,e.updateCategory(a);case 5:e.isEditing=!1;case 6:return t.prev=6,e.submitting=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[2,,6,9]])})))()},onDelCancelClick:function(){window.document.body.click()},onDeleteClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={id:e.category.id,level:e.level,parentId:e.parentId},e.submitting=!0,t.prev=2,t.next=5,e.deleteCategory(a);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](2),e.$message.error(e.$t("The {name} contains category",{name:e.category.name}));case 10:return t.prev=10,e.submitting=!1,t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[2,7,10,13]])})))()}})},Ap=jp,Lp=(a("cbcf"),Object(R["a"])(Ap,Mp,Np,!1,null,"2300f77c",null)),Fp=Lp.exports,Up={components:{CategoryListItem:Fp},props:{level:Number,categories:{type:Array},currentCategory:{type:Object,default:function(){return Object.create(null)}},parentId:{type:String}},data:function(){return{catgoryName:"",isAdding:!1,submitting:!1}},methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("faq",["createCategory"])),{},{onCategoryItemClick:function(e){this.$emit("selected",{level:this.level,category:e})},onAddClick:function(){var e=this;this.catgoryName="",this.isAdding=!0,this.$nextTick((function(){e.$refs.catgoryName.focus()}))},onCancelClick:function(){this.isAdding=!1},onSubmitClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.catgoryName){t.next=2;break}return t.abrupt("return");case 2:return a={path:e.parentId||"",level:e.level,name:e.catgoryName},e.submitting=!0,t.prev=4,t.next=7,e.createCategory(a);case 7:e.isAdding=!1;case 8:return t.prev=8,e.submitting=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[4,,8,11]])})))()}})},zp=Up,qp=(a("8e9b"),Object(R["a"])(zp,Rp,Ep,!1,null,"53521876",null)),Hp=qp.exports,Bp={components:{CategoryList:Hp},props:{visible:{type:Boolean,default:!1}},data:function(){return{submitting:!1,selectedLv1Category:null,selectedLv2Category:null,selectedLv3Category:null,selectedLv4Category:null,selectedLv5Category:null}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("chatbotSetup",["platform"])),Object(U["d"])("faq",["qna","currentCategoryId","currentLang"])),Object(U["c"])({languages:"chatbotSetup/languages",categories:"faq/categories"})),{},{categoryLangText:function(){return"0"===this.currentLang?this.$t("lang.en_US"):"1"===this.currentLang?this.$t("lang.zh_CN"):"2"===this.currentLang?this.$t("lang.zh_HK"):""},level1Categories:function(){return this.categories.filter((function(e){return"uncategorized"!==e.name}))},level2Categories:function(){return this.selectedLv1Category?this.selectedLv1Category.children||[]:null},level3Categories:function(){return this.selectedLv2Category?this.selectedLv2Category.children||[]:null},level4Categories:function(){return this.selectedLv3Category?this.selectedLv3Category.children||[]:null},level5Categories:function(){return this.selectedLv4Category?this.selectedLv4Category.children||[]:null}}),mounted:function(){var e=this;this.selectedLv1Category?this.selectedLv1Category=this.level1Categories.find((function(t){return t.id===e.selectedLv1Category.id})):this.selectedLv1Category=this.level1Categories[0]},methods:{closeModel:function(){this.showPasswordReset=!1,this.$emit("update:visible",!1)},updateVisible:function(e){this.$emit("update:visible",e)},submitData:function(){},onCategorySelected:function(e){this["selectedLv".concat(e.level,"Category")]=e.category}},watch:{selectedLv1Category:function(e,t){e&&t&&e.id===t.id||(this.selectedLv2Category=null)},selectedLv2Category:function(e,t){e&&t&&e.id===t.id||(this.selectedLv3Category=null)},selectedLv3Category:function(e,t){e&&t&&e.id===t.id||(this.selectedLv4Category=null)},selectedLv4Category:function(e,t){e&&t&&e.id===t.id||(this.selectedLv5Category=null)},level1Categories:function(e){var t=this;e&&e.length?this.selectedLv1Category?this.selectedLv1Category=e.find((function(e){return e.id===t.selectedLv1Category.id})):this.selectedLv1Category=e[0]:this.selectedLv1Category=null},level2Categories:function(e){var t=this;e&&e.length?this.selectedLv2Category?this.selectedLv2Category=e.find((function(e){return e.id===t.selectedLv2Category.id})):this.selectedLv2Category=e[0]:this.selectedLv2Category=null},level3Categories:function(e){var t=this;e&&e.length?this.selectedLv3Category?this.selectedLv3Category=e.find((function(e){return e.id===t.selectedLv3Category.id})):this.selectedLv3Category=e[0]:this.selectedLv3Category=null},level4Categories:function(e){var t=this;e&&e.length?this.selectedLv4Category?this.selectedLv4Category=e.find((function(e){return e.id===t.selectedLv4Category.id})):this.selectedLv4Category=e[0]:this.selectedLv4Category=null},level5Categories:function(e){var t=this;e&&e.length?this.selectedLv5Category?this.selectedLv5Category=e.find((function(e){return e.id===t.selectedLv5Category.id})):this.selectedLv5Category=e[0]:this.selectedLv5Category=null}}},Kp=Bp,Vp=(a("e85d"),Object(R["a"])(Kp,Op,Ip,!1,null,"db446cd2",null)),Yp=Vp.exports,Wp=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{"close-on-click-modal":!1,visible:e.visible,"destroy-on-close":"",width:"800px","append-to-body":""},on:{"update:visible":e.updateVisible}},[a("el-form",{ref:"formData",attrs:{model:e.formData,"show-message":!1,size:"small",rules:e.rules}},[a("el-form-item",{attrs:{prop:"question",label:e.$t("Question"),"label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"text"},model:{value:e.formData.question,callback:function(t){e.$set(e.formData,"question",t)},expression:"formData.question"}})],1),a("el-form-item",{attrs:{label:e.$t("Similar question"),"label-width":e.formLabelWidth}},[e._l(e.similarQuestions,(function(t,n){return a("div",{key:n,staticClass:"similar-question"},[a("el-input",{attrs:{type:"text"},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}}),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){return e.onDeleteSimilarQuestionClick(n)}}},[e._v(e._s(e.$t("Delete")))])],1)})),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:e.onAddSimilarQuestionClick}},[e._v(e._s(e.$t("Add")))])],2),a("el-form-item",{attrs:{prop:"answer",label:e.$t("Answer"),"label-width":e.formLabelWidth}},[a("el-input",{attrs:{autosize:"",type:"textarea"},model:{value:e.formData.answer,callback:function(t){e.$set(e.formData,"answer",t)},expression:"formData.answer"}})],1),a("el-form-item",{attrs:{label:e.$t("Custom answer"),"label-width":e.formLabelWidth}},[e._l(e.customAnswers,(function(t,n){return a("div",{key:n,staticClass:"custom-answer"},[a("el-input",{attrs:{autosize:"",type:"textarea"},model:{value:t.answer,callback:function(a){e.$set(t,"answer",a)},expression:"item.answer"}}),a("div",{staticClass:"tag-selector"},[a("el-select",{attrs:{multiple:"",filterable:"",remote:"","reserve-keyword":"",placeholder:t.tags.length?"":e.$t("Search Tag"),"remote-method":e.searchTags,loading:e.loadingTags},model:{value:t.tags,callback:function(a){e.$set(t,"tags",a)},expression:"item.tags"}},e._l(e.tags,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.value}})})),1)],1),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){return e.onDeleteCustomAnswerClick(n)}}},[e._v(e._s(e.$t("Delete")))])],1)})),a("el-button",{attrs:{size:"mini",type:"text"},on:{click:e.onAddCustomAnswerClick}},[e._v(e._s(e.$t("Add")))])],2),a("el-form-item",{attrs:{label:e.$t("Language"),"label-width":e.formLabelWidth}},[a("span",[e._v(e._s(e.categoryLangText))])]),a("el-form-item",{attrs:{label:e.$t("Category"),"label-width":e.formLabelWidth}},[a("el-cascader",{attrs:{options:e.categories,placeholder:"",props:e.categorySelectorProps,clearable:""},model:{value:e.formData.category,callback:function(t){e.$set(e.formData,"category",t)},expression:"formData.category"}})],1),a("el-form-item",{attrs:{label:e.$t("Status"),"label-width":e.formLabelWidth}},[a("el-switch",{model:{value:e.formData.active,callback:function(t){e.$set(e.formData,"active",t)},expression:"formData.active"}})],1),a("el-form-item",{attrs:{label:e.$t("Expired date"),"label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.isNeverExpired,callback:function(t){e.isNeverExpired=t},expression:"isNeverExpired"}},[a("el-radio",{attrs:{label:!0}},[e._v(e._s(e.$t("Infinite")))]),a("el-radio",{attrs:{label:!1}},[e._v(e._s(e.$t("Expired date")))])],1),e.isNeverExpired?e._e():a("el-date-picker",{staticClass:"expired-datepicker",attrs:{type:"datetime"},model:{value:e.expiredDate,callback:function(t){e.expiredDate=t},expression:"expiredDate"}})],1),a("el-form-item",{attrs:{label:e.$t("Note"),"label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.formData.note,callback:function(t){e.$set(e.formData,"note",t)},expression:"formData.note"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.submitting,expression:"submitting"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("Submit")))])],1)],1)},Gp=[];function Qp(e,t){if(!e)return null;var a=e.find((function(e){return e.id===t}));if(a)return a;for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:[],n=Qp(e,t);return n&&(a.splice(0,0,n.id),n.parent)?Xp(e,n.parent,a):a}function Zp(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=e.find((function(e){return e.id===t}));return n&&(a.splice(0,0,n.id),n.parent_id)?Zp(e,n.parent_id,a):a}var em={props:{visible:{type:Boolean,default:!1},qna:{type:Object}},data:function(){return{formLabelWidth:"125px",submitting:!1,formData:{question:"",answer:"",active:!0,category:[],note:""},similarQuestions:[],customAnswers:[],loadingTags:!1,categorySelectorProps:{checkStrictly:!0,expandTrigger:"hover",value:"id",label:"name"},isNeverExpired:!0,expiredDate:null,rules:{question:[{required:!0,trigger:"blur"}],answer:[{required:!0,trigger:"blur"}]},path:"",tags:[]}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])("faq",["currentLang"])),Object(U["d"])("user",["userInfo"])),Object(U["c"])({categories:"faq/activeCategories",categoryTreeIds:"faq/currentCategoryTreeIds",platform:"chatbotSetup/currentPlatform"})),{},{categoryLangText:function(){return"0"===this.currentLang?this.$t("lang.en_US"):"1"===this.currentLang?this.$t("lang.zh_CN"):"2"===this.currentLang?this.$t("lang.zh_HK"):""}}),methods:Object(F["a"])(Object(F["a"])({},Object(U["b"])("faq",["getQnaData"])),{},{initFormData:function(){if(this.qna){var e=Xp(this.categories,"travelflan_category_".concat(this.qna.parent)),t=e.join(",");this.path=t,this.formData.question=this.qna.question,this.formData.answer=this.qna.answer,this.formData.active=this.qna.active,this.formData.category=e,this.formData.note=this.qna.note,this.similarQuestions=this.qna.similar_questions.map((function(e){return{value:e}}));for(var a=[],n=0;n "},model:{value:e.form.ancestors,callback:function(t){e.$set(e.form,"ancestors",t)},expression:"form.ancestors"}})],1):e._e(),a("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:""}},[a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.form.editableTabs,(function(t,n){return a("el-tab-pane",{key:t.lang,attrs:{label:e.$t("lang."+t.lang),name:t.lang,closable:e.form.editableTabs.length>1}},[a("div",{staticClass:"product-box"},[a("el-form-item",{attrs:{label:e.$t("tag.TagName")+":",prop:"editableTabs["+n+"].name[0]",rules:[{required:!0,message:e.$t("tag.Require"),trigger:"blur"}]}},e._l(t.name,(function(n,r){return a("div",{key:t.lang+r,staticStyle:{"margin-bottom":"5px"}},[a("el-input",{staticClass:"w360",attrs:{placeholder:0===r?e.$t("tag.MainTagName"):e.$t("tag.Synonym")+" "+r},model:{value:t.name[r],callback:function(a){e.$set(t.name,r,a)},expression:"item.name[cindex]"}}),a("i",{directives:[{name:"show",rawName:"v-show",value:0!==r,expression:"cindex !== 0"}],staticClass:"icon el-icon-remove-outline",staticStyle:{color:"#AAAAAC","font-size":"18px"},on:{click:function(a){return e.deleteName(t.name,r)}}}),a("i",{directives:[{name:"show",rawName:"v-show",value:r===t.name.length-1,expression:"cindex === (item.name.length - 1)"}],staticClass:"icon el-icon-circle-plus-outline",staticStyle:{color:"#AAAAAC","font-size":"18px"},on:{click:function(a){return e.addName(t.name)}}})],1)})),0)],1)])})),e.getPageList.length?a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("productmanage.common.AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)]):e._e()],2)],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{staticStyle:{"margin-bottom":"10px"},attrs:{label:e.$t("productmanage.common.Status")+":"}},e._l(e.getRadios,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v(e._s(e.$t("tag.status."+t.label+"|"+t.value)))])})),1),a("el-form-item",{staticStyle:{"margin-bottom":"10px"},attrs:{label:e.$t("tag.AITrigger")+":"}},[a("el-radio",{attrs:{label:!0},model:{value:e.form.ai_trigger,callback:function(t){e.$set(e.form,"ai_trigger",t)},expression:"form.ai_trigger"}},[e._v(e._s(e.$t("tag.On")))]),a("el-radio",{attrs:{label:!1},model:{value:e.form.ai_trigger,callback:function(t){e.$set(e.form,"ai_trigger",t)},expression:"form.ai_trigger"}},[e._v(e._s(e.$t("tag.Off")))])],1),"edit"===e.type?a("el-form-item",{staticStyle:{"margin-bottom":"6px"},attrs:{label:e.$t("productmanage.common.CreateInfo")+":"}},[a("span",[e._v(e._s(e.formatDate(e.form.create_dt)))])]):e._e(),"edit"===e.type?a("el-form-item",{attrs:{label:e.$t("productmanage.common.UpdateInfo")+":"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showUpdateInfo=!0}}},[e._v(e._s(e.formatDate(e.form.update_dt)))])],1):e._e(),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Save")))])],1)],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1},"append-to-body":""}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.tagsystem,watchObject:e.id}}):e._e()],1)],1):e._e()},$m=[],Sm={components:{EventTimeline:Au},data:function(){return{showUpdateInfo:!1,EVENT_TYPE:Me,form:{status:"ACT",ai_trigger:!0,ancestors:[],synonyms:{},internalPlatforms:[],externalPlatforms:[],editableTabs:[]},visible1:!1,editableTabsValue:"en_US",tagPageList:["en_US","zh_CN","zh_HK","ko_KR"],optionProps:{label:"name",value:"id",checkStrictly:!0},isSend:!0}},props:["type","visible","id","tree","nodeId","nodeIds"],watch:{visible:function(e,t){this.visible1=e,e&&"edit"===this.type&&this.getDetail(),e&&"add"===this.type&&(this.form.ancestors=this.nodeIds,this.editableTabsValue="en_US",this.form.editableTabs=[],this.form.internalPlatforms=[],this.form.externalPlatforms=[],this.form.editableTabs.push({lang:"en_US",name:[""]}))},visible1:function(e,t){this.$emit("update:visible",e)}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{getTitle:function(){return"edit"===this.type?this.$t("tag.EditTagCategory"):this.$t("tag.NewTagCategory")},getTree:function(){var e=JSON.parse(JSON.stringify(this.tree)),t=this.$i18n.locale;function a(e){e.map((function(e){e.name=e.name[t]||e.name.en_US||e.name.zh_HK||e.name.zh_CN||e.name.ko_KR,0===e.children.length||a(e.children)}))}return a(e),e},getPageList:function(){var e=this,t=[];return this.tagPageList.forEach((function(a){e.form.editableTabs.findIndex((function(e){return e.lang===a}))>-1||t.push(a)})),t},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t-0,name:e.getSetting.platforms[t]}})):[]},getRadios:function(){var e=this.$i18n.messages.en_US.tag.status,t=Object.keys(e),a=[],n="Show|ACT,Hide|DCT";return t.forEach((function(e){n.indexOf(e)>-1&&a.push(e)})),a.map((function(t){return{label:e[t],value:t.split("|")[1]}}))},isShow:function(){var e=this,t=this.tree.find((function(t){return t.id===e.id}));return(!t||"edit"!==this.type)&&"0"!==this.id}}),methods:{formatDate:function(e){if(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")}},handleClose:function(e){e()},onSubmit:function(){var e=this;this.$refs.form.validate((function(t,a){if(t){if(!e.isSend)return;e.isSend=!1;var n=e.form.externalPlatforms.concat(e.form.internalPlatforms),r={status:e.form.status,is_leaf_tag:!1,ai_trigger:e.form.ai_trigger,supporting_provider:n,synonyms:{},name:e.form.editableTabs[0].name[0]},o=Number(e.form.ancestors.slice(-1)[0]);if(o>0&&(r.parent_id=o),e.form.editableTabs.forEach((function(e){r.synonyms[e.lang]=e.name.map((function(e,t){return{name:e,is_display:0===t}}))})),"add"===e.type)e.$api.tag.addTree(r).then((function(t){e.isSend=!0,e.visible1=!1,e.$message.success(e.$t("Save successfully")),e.$emit("load",!0)}),(function(){e.isSend=!0})).catch((function(){e.isSend=!0}));else{var i={tag_id:e.id,data:r};e.$api.tag.updateTree(i).then((function(t){e.isSend=!0,e.visible1=!1,e.$message.success(e.$t("Save successfully")),e.$emit("load",!0)}),(function(t){e.isSend=!0,"error"===t.code&&e.$message.error(t.detail[e.$i18n.locale])})).catch((function(){e.isSend=!0}))}}else{var s={ancestors:e.$t("Category")};e.form.editableTabs.forEach((function(t,a){s["editableTabs[".concat(a,"].name[0]")]=e.$t("lang."+t.lang)}));var l="";Object.keys(a).forEach((function(t){l||(l="".concat(e.$t("tag.SaveFailed"),"
")),l+="[".concat(s[t],"]
")})),e.$message({dangerouslyUseHTMLString:!0,message:l,type:"error"})}}))},removeTab:function(e){var t=this.form.editableTabs,a=this.editableTabsValue;a===e&&t.forEach((function(n,r){if(n.lang===e){var o=t[r+1]||t[r-1];o&&(a=o.lang)}})),this.editableTabsValue=a,this.form.editableTabs=t.filter((function(t){return t.lang!==e}))},beforeLeave:function(e,t){if("add"===e)return!1;this.editableTabsValue=e},add:function(e){this.form.editableTabs.push({lang:e,name:[""]}),this.editableTabsValue=e},addName:function(e){e.push("")},deleteName:function(e,t){e.splice(t,1)},getDetail:function(){var e=this;this.form.internalPlatforms=[],this.form.externalPlatforms=[],this.$api.tag.getTreeDetail({tag_id:this.id}).then((function(t){if(t.id){for(var a in e.form.editableTabs=[],e.form=Object.assign(e.form,t),e.editableTabsValue=Object.keys(t.synonyms)[0]||"en_US",t.synonyms)e.form.editableTabs.push({lang:a,name:t.synonyms[a].map((function(e){return e.name}))});e.form.ancestors=t.ancestors.map((function(e){return e.id})),t.supporting_provider.forEach((function(t){e.internalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.internalPlatforms.push(t),e.externalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.externalPlatforms.push(t)}))}}))}}},xm=Sm,Tm=(a("c488"),Object(R["a"])(xm,wm,$m,!1,null,null,null)),Dm=Tm.exports,Pm={data:function(){var e=this;return{type:"add",visible:!1,nodeData:{},nodeids:[],defaultExpandedKeys:["0"],id:"",currentNodeId:"",tag:[{name:{en_US:e.$i18n.messages.en_US.tag.AllCategories,zh_CN:e.$i18n.messages.zh_CN.tag.AllCategories,zh_HK:e.$i18n.messages.zh_HK.tag.AllCategories},id:"0",children:[]}],defaultProps:{children:"children",label:"name"},filterText:"",dialogVisible:!1}},components:{AddEditTree:Dm},methods:{filterNode:function(e,t){if(!e)return!0;var a=new RegExp(e,"gi");return a.test(t.name[this.$i18n.locale])||a.test(t.name.en_US)||a.test(t.name.zh_HK)||a.test(t.name.zh_CN)||a.test(t.name.ko_KR)},handleNodeClick:function(e){this.$store.dispatch("tag/updateTreeId",e.id)},add:function(e,t){this.type="add",this.id=t.id,this.nodeids=[];var a=this;function n(e){e.parent&&"0"!==e.key&&(a.nodeids.unshift(e.key),n(e.parent))}n(e),this.visible=!0},edit:function(e){this.type="edit",this.id=e.id,this.visible=!0},nodeChange:function(e,t){0!==e.id&&(this.currentNodeId=e.id),this.$refs.tree.setCurrentKey(this.currentNodeId);var a=[0];function n(e){e.parent&&0!==e.key&&(a.unshift(e.key),n(e.parent))}n(t),this.defaultExpandedKeys=a},handleDelete:function(){var e=this;this.nodeData.id===this.currentNodeId&&(this.currentNodeId=""),this.$api.tag.deleteTree({tag_id:this.nodeData.id}).then((function(t){e.$message({message:e.$t("Delete successfully"),type:"success",duration:500,onClose:function(){e.getTreeList()}})}),(function(t){if(t){var a=e.$options.filters.lang(t,e.$i18n.locale);a&&e.$message.error(a)}}))},getTreeList:function(){var e=this,t={summary:!0,depth:1};this.$api.tag.getTree(t).then((function(t){e.tag[0].children=Object(Xc["a"])(t.results),e.$nextTick((function(){e.currentNodeId=e.currentNodeId||t.results[0].id,e.$refs.tree.setCurrentKey(e.currentNodeId),e.$store.dispatch("tag/updateTreeId",e.currentNodeId)}))}))}},beforeMount:function(){this.getTreeList()}},Om=Pm,Im=(a("6ed3"),Object(R["a"])(Om,Cm,km,!1,null,null,null)),Rm=Im.exports,Em=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tag-list-box"},[a("div",{staticClass:"search-box"},[a("div",{staticClass:"item"},[a("el-select",{staticClass:"status-select",attrs:{placeholder:e.$t("productmanage.common.Status"),size:"small",clearable:""},model:{value:e.status,callback:function(t){e.status=t},expression:"status"}},e._l(e.getStatua,(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:t}})})),1)],1),a("div",{staticClass:"item"},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$t("productmanage.common.EnterSomething"),size:"small"},model:{value:e.input,callback:function(t){e.input=t},expression:"input"}},[a("el-select",{attrs:{slot:"prepend",placeholder:""},slot:"prepend",model:{value:e.select,callback:function(t){e.select=t},expression:"select"}},[a("el-option",{attrs:{label:e.$t("productmanage.common.Tag"),value:"tag"}})],1)],1)],1),a("div",{staticClass:"item"},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:!e.isShow,expression:"!isShow"}],attrs:{size:"small",disabled:""}},[e._v(e._s(e.$t("productmanage.common.Search")))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isShow,expression:"isShow"}],attrs:{size:"small",type:"primary"},on:{click:function(t){return e.getList(1)}}},[e._v(e._s(e.$t("productmanage.common.Search")))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.status||e.input,expression:"status || input"}],attrs:{size:"small"},on:{click:e.handleClear}},[e._v(e._s(e.$t("productmanage.table.Clear")))])],1)]),a("el-row",{staticStyle:{"margin-top":"15px"}},[a("el-col",{attrs:{span:e.multipleSelection.length>0?18:0}},[a("div",{staticClass:"grid-content bg-purple"},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.multipleSelection.length>0,expression:"multipleSelection.length > 0"}],staticClass:"status-box"},[a("span",{on:{click:function(t){return e.updateStatus("ACT")}}},[e._v(e._s(e.$t("productmanage.status.Show|ACT")))]),a("span",{on:{click:function(t){return e.updateStatus("DCT")}}},[e._v(e._s(e.$t("productmanage.status.Hide|DCT")))])])])]),a("el-col",{attrs:{span:e.multipleSelection.length>0?6:24}},[a("div",{staticClass:"grid-content bg-purple-light",staticStyle:{"text-align":"right"}},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.jump({name:"TagManageDetail",query:{tree_id:e.treeId}})}}},[e._v(e._s(e.$t("Add")))])],1)])],1),a("div",{staticStyle:{display:"flex","flex-direction":"column","justify-content":"space-between",height:"calc(100% - 80px)"}},[a("div",[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"multipleTable",staticClass:"table-box",staticStyle:{width:"100%"},attrs:{data:e.tableList,"tooltip-effect":"dark",stripe:"","cell-style":{"border-width":0,padding:"2px 0"}},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{width:"45",type:"selection"}}),a("el-table-column",{attrs:{width:"100",prop:"id",label:e.$t("tag.TagID")}}),a("el-table-column",{attrs:{prop:"name",label:e.$t("tag.TagName"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.name[e.$i18n.locale]||t.row.name.en_US||t.row.name.zh_HK||t.row.name.zh_CN||t.row.name.ko_KR))])]}}])}),a("el-table-column",{attrs:{width:"100",label:e.$t("productmanage.common.Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.getStatua[t.row.status]))])]}}])}),a("el-table-column",{attrs:{width:"160",label:e.$t("Action")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"handle-btn",on:{click:function(a){return e.jump({name:"TagManageDetail",query:{tag_id:t.row.id,tree_id:e.treeId}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))]),a("span",{staticClass:"handle-btn"},[a("el-popover",{attrs:{placement:"bottom",width:"180"},model:{value:t.row.visible,callback:function(a){e.$set(t.row,"visible",a)},expression:"scope.row.visible"}},[a("p",[e._v(e._s(e.$t("Are you sure to delete ?")))]),a("div",{staticStyle:{"text-align":"right",margin:"0"}},[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){t.row.visible=!1}}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){t.row.visible=!1,e.handleDet(t.row.id)}}},[e._v(e._s(e.$t("Confirm")))])],1),a("el-button",{attrs:{slot:"reference",type:"text",size:"small"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)],1)]}}])}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoTagIsFound")))])])])],2)],1),a("div",{staticStyle:{"text-align":"center","margin-top":"10px"}},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])],1)},Mm=[],Nm={data:function(){return{status:"",input:"",select:"tag",pictLoading:!1,multipleSelection:[],page_size:10,total:0,currentPage:1,tableList:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])({treeId:"tag/getTreeId"})),{},{getStatua:function(){var e=this.$i18n.messages[this.$i18n.locale].tag.status;return{ACT:e["Show|ACT"],DCT:e["Hide|DCT"]}},isShow:function(){return this.status||this.input}}),watch:{treeId:function(e){this.currentPage=1,0!==e&&this.getList()},status:function(){this.getList(1)}},methods:{handleSelectionChange:function(e){this.multipleSelection=e},handleSizeChange:function(e){this.page_size=e,this.currentPage=1,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},jump:function(e){var t=this.$router.resolve({name:e.name,query:e.query});window.open(t.href,"_blank")},handleClear:function(){this.status="",this.input="",this.getList(1)},handleDet:function(e){var t=this;this.$api.tag.deleteTree({tag_id:e}).then((function(a){t.$message({message:t.$t("Delete successfully"),type:"success",duration:500,onClose:function(){e===t.tableList.shift().id&&(t.currentPage=1),t.getList()}})}))},updateStatus:function(e){var t=this;this.$api.tag.updateStatus({status:e,tag_ids:this.multipleSelection.map((function(e){return e.id}))}).then((function(e){t.$message({message:t.$t("Save successfully"),type:"success",duration:500,onClose:function(){t.getList()}})}))},getList:function(e){var t=this;this.pictLoading=!0,e&&(this.currentPage=e);var a={is_leaf_tag:!0,status:this.status,synonyms__name__icontains:this.input,page_size:this.page_size,page:this.currentPage};"0"!==this.treeId&&(a.parent_id=this.treeId),(this.status||this.input)&&delete a.parent_id,this.$api.tag.getList(a).then((function(e){t.total=e.count,t.tableList=e.results.map((function(e){return Object(F["a"])(Object(F["a"])({},e),{},{visible:!1})})),t.pictLoading=!1}))}},mounted:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.getList(1)}}},jm=Nm,Am=(a("6b36"),Object(R["a"])(jm,Em,Mm,!1,null,null,null)),Lm=Am.exports,Fm={components:{TagTree:Rm,List:Lm}},Um=Fm,zm=(a("72e7"),Object(R["a"])(Um,bm,ym,!1,null,null,null)),qm=zm.exports,Hm=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tag-detail"},[a("div",{staticClass:"title"},[e._v(e._s(e.getTitle()))]),a("el-tabs",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:e.$t("tag.TagInfo"),name:"1"}},[a("add-edit-tag",{attrs:{title:e.title},on:{"update:title":function(t){e.title=t},created:e.onTagCreated}})],1),a("el-tab-pane",{attrs:{label:e.$t("tag.RelatedProduct"),name:"2",disabled:!e.tagId}},[a("related-product")],1),a("el-tab-pane",{attrs:{label:e.$t("tag.RelatedPOI"),name:"3",disabled:!e.tagId}},[a("related-poi")],1)],1)],1)},Bm=[],Km=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"form",staticClass:"add-edit-box",attrs:{model:e.form,"label-width":"100px",size:"small"}},[a("el-form-item",{attrs:{label:e.$t("tag.TagID")+":"}},[e._v(e._s(e.id))]),a("el-form-item",{attrs:{label:e.$t("Category")+":",prop:"ancestors",rules:[{required:!0,type:"array",message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}]}},[a("el-cascader",{staticClass:"w360",attrs:{options:e.getTree,props:e.optionProps,placeholder:e.$t("tag.SelectaCategory"),separator:" > "},model:{value:e.form.ancestors,callback:function(t){e.$set(e.form,"ancestors",t)},expression:"form.ancestors"}})],1),a("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:""}},[a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.form.editableTabs,(function(t,n){return a("el-tab-pane",{key:t.lang,attrs:{label:e.$t("lang."+t.lang),name:t.lang,closable:e.form.editableTabs.length>1}},[a("div",{staticClass:"product-box"},[a("el-form-item",{attrs:{label:e.$t("tag.TagName")+":",prop:"editableTabs["+n+"].name[0]",rules:[{required:!0,message:e.$t("tag.Require"),trigger:"change"}]}},e._l(t.name,(function(n,r){return a("div",{key:t.lang+r,staticStyle:{"margin-bottom":"5px"}},[a("el-input",{staticClass:"w360",attrs:{placeholder:0===r?e.$t("tag.MainTagName"):e.$t("tag.Synonym")+" "+r},model:{value:t.name[r],callback:function(a){e.$set(t.name,r,a)},expression:"item.name[cindex]"}}),a("i",{directives:[{name:"show",rawName:"v-show",value:0!==r,expression:"cindex !== 0"}],staticClass:"icon el-icon-remove-outline",staticStyle:{color:"#AAAAAC","font-size":"18px"},on:{click:function(a){return e.deleteName(t.name,r)}}}),a("i",{directives:[{name:"show",rawName:"v-show",value:r===t.name.length-1,expression:"cindex === (item.name.length - 1)"}],staticClass:"icon el-icon-circle-plus-outline",staticStyle:{color:"#AAAAAC","font-size":"18px"},on:{click:function(a){return e.addName(t.name)}}})],1)})),0)],1)])})),e.getPageList.length?a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("productmanage.common.AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)]):e._e()],2)],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Status")+":"}},e._l(e.getRadios,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v(e._s(e.$t("tag.status."+t.label+"|"+t.value)))])})),1),"-"!==e.id&&e.$route.query.tag_id?a("el-form-item",{attrs:{label:e.$t("productmanage.common.CreateInfo")+":"}},[a("span",[e._v(e._s(e.formatDate(e.form.create_dt)))])]):e._e(),"-"!==e.id&&e.$route.query.tag_id?a("el-form-item",{attrs:{label:e.$t("productmanage.common.UpdateInfo")+":"}},[a("el-button",{attrs:{type:"text"},on:{click:function(){return e.showUpdateInfo=!0}}},[e._v(e._s(e.formatDate(e.form.update_dt)))])],1):e._e(),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Save")))])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.tagsystem,watchObject:e.$route.query.tag_id}}):e._e()],1)],1)},Vm=[],Ym={components:{EventTimeline:Au},data:function(){return{EVENT_TYPE:Me,showUpdateInfo:!1,form:{status:"ACT",ancestors:[],synonyms:{},editableTabs:[],internalPlatforms:[],externalPlatforms:[]},id:"-",editableTabsValue:"en_US",tagPageList:["en_US","zh_CN","zh_HK","ko_KR"],optionProps:{label:"name",value:"id",checkStrictly:!0},isSend:!0,tree:[]}},props:["title"],computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{getTree:function(){var e=JSON.parse(JSON.stringify(this.tree)),t=this.$i18n.locale;function a(e){e.map((function(e){e.name=e.name[t]||e.name.en_US||e.name.zh_HK||e.name.zh_CN||e.name.ko_KR,0===e.children.length?delete e.children:a(e.children)}))}return a(e),e},getPageList:function(){var e=this,t=[];return this.tagPageList.forEach((function(a){e.form.editableTabs.findIndex((function(e){return e.lang===a}))>-1||t.push(a)})),t},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t-0,name:e.getSetting.platforms[t]}})):[]},getRadios:function(){var e=this.$i18n.messages.en_US.tag.status,t=Object.keys(e),a=[],n="Show|ACT,Hide|DCT";return t.forEach((function(e){n.indexOf(e)>-1&&a.push(e)})),a.map((function(t){return{label:e[t],value:t.split("|")[1]}}))}}),methods:{formatDate:function(e){if(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")}},onSubmit:function(){var e=this;this.$refs.form.validate((function(t,a){if(t){if(!e.isSend)return;e.isSend=!1;var n=e.form.externalPlatforms.concat(e.form.internalPlatforms),r={status:e.form.status,is_leaf_tag:!0,parent_id:e.form.ancestors.slice(-1)[0],supporting_provider:n,synonyms:{},name:e.form.editableTabs[0].name[0]};if(e.form.editableTabs.forEach((function(e){r.synonyms[e.lang]=e.name.map((function(e,t){return{name:e,is_display:0===t}}))})),"-"===e.id)e.$api.tag.addTree(r).then((function(t){e.$message.success(e.$t("Save successfully")),e.isSend=!0,e.id=t.id,e.$emit("created",t.id)}),(function(){e.isSend=!0})).catch((function(){e.isSend=!0}));else{var o={tag_id:e.id,data:r};e.$api.tag.updateTree(o).then((function(t){e.$message.success(e.$t("Save successfully")),e.isSend=!0}),(function(t){e.isSend=!0,"error"===t.code&&e.$message.error(t.detail[e.$i18n.locale])})).catch((function(){e.isSend=!0}))}}else{var i={ancestors:e.$t("Category")};e.form.editableTabs.forEach((function(t,a){i["editableTabs[".concat(a,"].name[0]")]=e.$t("lang."+t.lang)}));var s="";Object.keys(a).forEach((function(t){s||(s="".concat(e.$t("tag.SaveFailed"),"
")),s+="[".concat(i[t],"]
")})),e.$message({dangerouslyUseHTMLString:!0,message:s,type:"error"})}}))},removeTab:function(e){var t=this.form.editableTabs,a=this.editableTabsValue;a===e&&t.forEach((function(n,r){if(n.lang===e){var o=t[r+1]||t[r-1];o&&(a=o.lang)}})),this.editableTabsValue=a,this.form.editableTabs=t.filter((function(t){return t.lang!==e}))},beforeLeave:function(e,t){if("add"===e)return!1;this.editableTabsValue=e},add:function(e){this.form.editableTabs.push({lang:e,name:[""]}),this.editableTabsValue=e},addName:function(e){e.push("")},deleteName:function(e,t){e.splice(t,1)},getDetail:function(){var e=this;this.$api.tag.getTreeDetail({tag_id:this.id}).then((function(t){if(t.id){for(var a in e.form.editableTabs=[],e.form=Object.assign(e.form,t),e.editableTabsValue=Object.keys(t.synonyms)[0]||"en_US",t.synonyms)e.form.editableTabs.push({lang:a,name:t.synonyms[a].map((function(e){return e.name}))});e.form.ancestors=t.ancestors.map((function(e){return e.id})),e.$emit("update:title",JSON.parse(JSON.stringify(e.form.editableTabs))),t.supporting_provider.forEach((function(t){e.internalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.internalPlatforms.push(t),e.externalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.externalPlatforms.push(t)}))}}))},getIdLink:function(e,t){for(var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=0;n0?a("span",{staticClass:"option",on:{click:function(a){return e.toogleExpand(t.row)}}},[e._v(e._s(e.$t("productmanage.common.Option"))+" "),a("i",{class:t.row.class||"el-icon-arrow-down"})]):e._e()]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("el-table-column",{attrs:{width:"1",type:"expand"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"cont-box"},[a("div",{staticClass:"right"},[a("el-table",{attrs:{stripe:"",data:e.tableChildRes(t.row),"span-method":e.objectSpanMethod,"header-cell-style":{background:"#F2F2F2"},"cell-style":{"border-width":0,padding:"8px 0"}}},[a("el-table-column",{attrs:{width:"300","show-overflow-tooltip":"",label:e.$t("productmanage.common.OptionName")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.details))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"230","show-overflow-tooltip":"",label:e.$t("productmanage.table.SuboptionName")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.sub_details))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Price")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.priceType+" "+(t.row.sub_price[e.priceType]||""))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{prop:"address","show-overflow-tooltip":"",label:e.$t("productmanage.common.Stock")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(-1==t.row.max_quantity_per_sub_option?e.$t("productmanage.table.NoLimit"):t.row.max_quantity_per_sub_option)+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"160",fixed:"right","show-overflow-tooltip":"",label:e.$t("productmanage.table.Action")},scopedSlots:e._u([{key:"default",fn:function(n){return[a("span",{staticClass:"edit no-border",on:{click:function(a){return e.jump({name:"Operation",query:{type:"edit",product_id:t.row.id,option_id:n.row.option_id,sub_option_id:n.row.sub_option_id}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))])]}}],null,!0)})],1)],1)])]}}])}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])},Xm=[],Zm={data:function(){return{hidden:!1,visible:!1,pictLoading:!0,priceType:"HKD",nameType:"",currentPage:1,page_size:10,total:0,current_size:0,tableList:[],multipleSelection:[]}},props:{from:{type:Object,default:function(){return{}}}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{isOption:function(){return this.multipleSelection.length>0},type:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.productType.".concat(t)),value:t.split("|")[1]}}))},reverseType:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},price:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.priceType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.priceType.".concat(t)),value:t}}))},status:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.status.".concat(t)),value:t.split("|")[1]}}))},reverseStatus:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},reversePlatform:function(){return function(e){var t=this,a=[];return e.forEach((function(e){t.platformsMapping[e]&&a.push(t.$t("platform.".concat(t.platformsMapping[e])))})),a.join(",")}},countName:function(){return function(e){var t=this.nameType||this.$i18n.locale,a={en_US:(e.en_US||{}).title,zh_HK:(e.zh_HK||{}).title,zh_CN:(e.zh_CN||{}).title,ko_KR:(e.ko_KR||{}).title};return a[t]||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR}}}),methods:{handleSelectionChange:function(e){this.multipleSelection=e},handleSizeChange:function(e){this.page_size=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},toogleExpand:function(e){var t=this.$refs.multipleTable;t.toggleRowExpansion(e),e.class="el-icon-arrow-up"===e.class?"el-icon-arrow-down":"el-icon-arrow-up"},tableChildRes:function(e){var t=[];return e.options.forEach((function(e,a){var n=e.sub_options;n.forEach((function(e,t){"DCT"===e.status&&n.splice(t,1)})),e.matchLength=e.sub_options.length||1,0===e.sub_options.length?(e.option_id="",e.sub_option_id="",e.sub_details={en_US:{title:""},zh_CN:{title:""},zh_HK:{title:""}},e.max_quantity_per_sub_option="",e.sub_price={CNY:"",HKD:"",KRW:"",TWD:"",USD:""},t.push(e)):e.sub_options.forEach((function(a,n){0===n?(e.option_id=e.id,e.sub_option_id=a.id,e.sub_details=a.details,e.max_quantity_per_sub_option=a.max_quantity_per_sub_option,e.sub_price=a.price,t.push(e)):(a.option_id=e.id,a.sub_option_id=a.id,a.sub_price=a.price,a.sub_details=a.details,t.push(a))}))})),t},handlePage:function(e,t){},jump:function(e){var t=this.$router.resolve({name:e.name,query:e.query});window.open(t.href,"_blank")},clearFilter:function(){this.$refs.multipleTable.clearFilter()},filterHandlerType:function(e,t,a){return t.type===e},filterHandlerPrice:function(e,t,a){this.priceType=e},filterHandlerName:function(e,t,a){this.nameType=e},filterHandlerStatus:function(e,t,a){return t.status===e},filterHandlerPlatform:function(e,t,a){return t.platforms.indexOf(e-0)>-1},getBtnList:function(){var e=this.$i18n.messages.en_US.productmanage.status,t=Object.keys(e);return t.map((function(e,t){return"Delete|DET"!==e?{text:e.split("|")[0],value:e.split("|")[1]}:{type:"pop",text:e.split("|")[0],value:e.split("|")[1]}}))},getList:function(e){var t=this;this.pictLoading=!0,this.currentPage=e||this.currentPage,this.$api.product.productList({ordering:"-id",page_size:this.page_size,page:this.currentPage}).then((function(e){t.tableList=e.results,t.total=e.count,t.pictLoading=!1,t.current_size=e.results.length}))},handleDet:function(){var e=this;this.$api.product.DetStatus({product_ids:this.multipleSelection.map((function(e){return e.id}))}).then((function(t){e.$message({message:e.$t("successfully"),type:"success",duration:500,onClose:function(){e.getList()}})}))},handleStatus:function(e){var t=this;this.$api.product.putStatus({product_ids:this.multipleSelection.map((function(e){return e.id})),status:e}).then((function(e){t.$message({message:t.$t("successfully"),type:"success",duration:500,onClose:function(){t.getList()}})}))},objectSpanMethod:function(e){var t=e.row,a=(e.column,e.rowIndex,e.columnIndex);if(0===a){var n=t.matchLength?t.matchLength:0,r=n>0?1:0;return{rowspan:n,colspan:r}}}},beforeMount:function(){this.pictLoading=!1}},ef=Zm,tf=(a("afa5"),a("bf1d"),Object(R["a"])(ef,Jm,Xm,!1,null,"307319a8",null)),af=tf.exports,nf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-box"},[a("div",{staticClass:"table-cont"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableList,"tooltip-effect":"dark",stripe:"","header-row-class-name":"table-header","header-cell-style":{background:"#F2F2F2"},"cell-style":e.cellStyle},on:{"selection-change":e.handleSelectionChange,"header-click":e.handlePage}},[a("el-table-column",{attrs:{prop:"order",width:"100",sortable:"",fixed:"",label:e.$t("poi.ID")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",{on:{click:function(a){return e.jump({name:"PointOperation",query:{type:"edit",poi_id:t.row.id}})}}},[e._v(e._s(t.row.id))])]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.City"),prop:"",width:"100","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.ancestors,(function(t,n){return a("span",{key:n},[e._v(e._s("H-City"===t.category?(t.details[e.$i18n.locale]||{}).title:""))])}))}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.Image"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"img",staticStyle:{"max-height":"34px","max-width":"48px"},attrs:{src:e.row.images.base?e.row.images.base.title:"",alt:""}})]}}])}),a("el-table-column",{attrs:{prop:"type",width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.table.Type")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.category?e.$t("poi.type."+t.row.category):"")+" ")]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.table.Name"),"min-width":"160","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.synonyms))+" ")]}}])}),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reverseStatus(t.row.status))+" ")]}}])}),a("el-table-column",{attrs:{prop:"flan.priority","min-width":"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Priority")}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",width:"100",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"edit",on:{click:function(a){return e.jump({name:"PointOperation",query:{type:"edit",poi_id:t.row.id}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])},rf=[],of={data:function(){return{hidden:!1,visible:!1,pictLoading:!0,priceType:"HKD",currentPage:1,page_size:10,total:0,current_size:0,tableList:[],multipleSelection:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{isOption:function(){return this.multipleSelection.length>0},type:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.productType.".concat(t)),value:t.split("|")[1]}}))},reverseType:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},price:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.priceType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.priceType.".concat(t)),value:t}}))},status:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.status.".concat(t)),value:t.split("|")[1]}}))},reverseStatus:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},reversePlatform:function(){return function(e){var t=this,a=[];return e.forEach((function(e){t.platformsMapping[e]&&a.push(t.$t("platform.".concat(t.platformsMapping[e])))})),a.join(",")}},countName:function(){return function(e){var t=this.$i18n.locale,a={en_US:(e.en_US||{}).title,zh_HK:(e.zh_HK||{}).title,zh_CN:(e.zh_CN||{}).title,ko_KR:(e.ko_KR||{}).title},n=a[t]||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR;return n?n.split("|")[0]:""}}}),methods:{handleSelectionChange:function(e){this.multipleSelection=e},handleSizeChange:function(e){this.page_size=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},handlePage:function(e,t){},jump:function(e){var t=this.$router.resolve({name:e.name,query:e.query});window.open(t.href,"_blank")},cellStyle:function(e){e.row,e.column,e.rowIndex;var t=e.columnIndex;return 1===t?{"border-width":0,padding:"2px 0",color:"#4499DD"}:{"border-width":0,padding:"2px 0"}},getBtnList:function(){var e=this.$i18n.messages.en_US.productmanage.status,t=Object.keys(e),a=[];return t.forEach((function(e,t){"Show|ACT"===e||"Draft|DFT"===e||"Review|REV"===e||"Hide|DCT"===e?a.push({text:e.split("|")[0],value:e.split("|")[1]}):"Delete|DET"===e&&a.push({type:"pop",text:e.split("|")[0],value:e.split("|")[1]})})),a},getList:function(e){var t=this;this.pictLoading=!0,this.currentPage=e||this.currentPage,this.$api.point.getPOIList({ordering:"-id",page_size:this.page_size,page:this.currentPage}).then((function(e){t.tableList=e.results,t.total=e.count,t.pictLoading=!1,t.current_size=e.results.length}))},handleDet:function(){var e=this;this.$api.point.deletePOI({poi_ids:this.multipleSelection.map((function(e){return e.id}))}).then((function(t){e.$message({message:e.$t("successfully"),type:"success",duration:500,onClose:function(){e.getList()}})}))},handleStatus:function(e){var t=this;this.$api.point.updatePOIStatus({poi_ids:this.multipleSelection.map((function(e){return e.id})),status:e}).then((function(e){t.$message({message:t.$t("successfully"),type:"success",duration:500,onClose:function(){t.getList()}})}))}},beforeMount:function(){this.pictLoading=!1}},sf=of,lf=(a("454f"),a("9c9a"),Object(R["a"])(sf,nf,rf,!1,null,"cb112aee",null)),cf=lf.exports,uf={data:function(){return{activeName:"1",title:[],tagId:null}},components:{AddEditTag:Qm,RelatedProduct:af,RelatedPoi:cf},methods:{getTitle:function(){if(0===this.title.length)return"";var e=this.$i18n.locale,t={},a=this.$t("tag.NewTag");return this.title.forEach((function(e){t[e.lang]=e.name[0]})),t[e]||t.en_US||t.zh_HK||t.zh_CN||t.ko_KR||a},onTagCreated:function(e){this.tagId=e}},mounted:function(){this.tagId=this.$route.query.tag_id}},df=uf,pf=(a("23b7"),Object(R["a"])(df,Hm,Bm,!1,null,null,null)),mf=pf.exports,ff=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-currency"},[a("div",{staticClass:"page-content"},[a("div",{staticClass:"currency-list"},[a("el-table",{attrs:{stripe:"",data:e.currencies,height:"100%"}},[a("el-table-column",{attrs:{label:e.$t("Currency")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.code))]),t.row.is_base?a("span",{staticClass:"base-label"},[e._v(e._s(e.$t("Base")))]):e._e()]}}])}),a("el-table-column",{attrs:{prop:"symbol",label:e.$t("Symbol")}}),a("el-table-column",{attrs:{prop:"internal_ex_rate",label:e.$t("Exchange rate")}}),a("el-table-column",{attrs:{prop:"priority",label:e.$t("Priority")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.flan&&t.row.flan.priority))])]}}])}),a("el-table-column",{attrs:{label:e.$t("Update time")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e._f("date")(t.row.update_dt)))])]}}])}),a("el-table-column",{attrs:{prop:"code",label:e.$t("Action"),width:"100",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"link-edit",attrs:{to:{name:"FinancialCurrencyEdit",params:{id:t.row.id}},target:"_blank"}},[e._v(e._s(e.$t("Edit")))])]}}])})],1)],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.dataCount,"page-size":e.pageSize,"current-page":e.currentPage},on:{"current-change":e.onPageChanged}})],1)])},gf=[],hf={data:function(){return{dataCount:0,pageSize:20,currentPage:1,currencies:[]}},methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.currency.getCurrencies({page_size:e.pageSize,page:e.currentPage});case 2:a=t.sent,e.currencies=a.results,e.dataCount=a.count;case 5:case"end":return t.stop()}}),t)})))()},onPageChanged:function(e){this.$router.push({name:this.$route.name,query:{page:e}})},onEditClick:function(e){this.$router.push({name:"FinancialCurrencyEdit",params:{id:e.id}})}},created:function(){this.$route.query.page&&(this.currentPage=Number(this.$route.query.page)),this.getCurrencies()},beforeRouteUpdate:function(e,t,a){this.currentPage=e.query.page,this.getCurrencies(),a()}},_f=hf,vf=(a("530a"),Object(R["a"])(_f,ff,gf,!1,null,"e01dc664",null)),bf=vf.exports,yf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-currency"},[a("div",{staticClass:"page-view"},[a("div",{staticClass:"page-content"},[a("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("Currency detail"))+" ")]),a("div",{staticClass:"form-container"},[a("el-form",{ref:"currencyForm",attrs:{size:"small",model:e.formData,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:e.$t("Currency"),prop:"code"}},[a("span",[e._v(e._s(e.formData.code))]),e.currencyData&&e.currencyData.is_base?a("span",{staticClass:"base-label"},[e._v("Base")]):e._e()]),a("el-form-item",{attrs:{label:e.$t("Currency Name"),prop:"name"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{prop:"meta.en_US"}},[a("el-input",{model:{value:e.formData.meta.en_US,callback:function(t){e.$set(e.formData.meta,"en_US",t)},expression:"formData.meta.en_US"}},[a("template",{slot:"prepend"},[e._v("en_US")])],2)],1),a("el-form-item",{attrs:{prop:"meta.zh_CN"}},[a("el-input",{staticClass:"meta-input",model:{value:e.formData.meta.zh_CN,callback:function(t){e.$set(e.formData.meta,"zh_CN",t)},expression:"formData.meta.zh_CN"}},[a("template",{slot:"prepend"},[e._v("zh_CN")])],2)],1),a("el-form-item",{attrs:{prop:"meta.zh_HK"}},[a("el-input",{staticClass:"meta-input",model:{value:e.formData.meta.zh_HK,callback:function(t){e.$set(e.formData.meta,"zh_HK",t)},expression:"formData.meta.zh_HK"}},[a("template",{slot:"prepend"},[e._v("zh_HK")])],2)],1),a("el-form-item",{attrs:{prop:"meta.ko_KR"}},[a("el-input",{staticClass:"meta-input",model:{value:e.formData.meta.ko_KR,callback:function(t){e.$set(e.formData.meta,"ko_KR",t)},expression:"formData.meta.ko_KR"}},[a("template",{slot:"prepend"},[e._v("ko_KR")])],2)],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("Symbol"),prop:"symbol"}},[a("el-input",{model:{value:e.formData.symbol,callback:function(t){e.$set(e.formData,"symbol",t)},expression:"formData.symbol"}})],1)],1),e.liveRate?a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("Live rate")}},[a("span",[e._v(e._s(e.liveRate))]),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:e.onFillInClick}},[e._v(e._s(e.$t("Fill in")))])],1)],1):e._e()],1),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("Priority")}},[a("el-select",{model:{value:e.formData.flan.priority,callback:function(t){e.$set(e.formData.flan,"priority",t)},expression:"formData.flan.priority"}},e._l(5,(function(e){return a("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("Exc. rate"),prop:"internal_ex_rate"}},[e.currencyData&&e.currencyData.is_base?a("span",[e._v(e._s(e.formData.internal_ex_rate.toFixed(4)))]):a("el-input",{attrs:{placeholder:e.$t("Enter with 4 decimals")},model:{value:e.formData.internal_ex_rate,callback:function(t){e.$set(e.formData,"internal_ex_rate",t)},expression:"formData.internal_ex_rate"}})],1)],1)],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.formData.internalPlatforms,callback:function(t){e.$set(e.formData,"internalPlatforms",t)},expression:"formData.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.formData.externalPlatforms,callback:function(t){e.$set(e.formData,"externalPlatforms",t)},expression:"formData.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),e.currencyData?a("el-form-item",{attrs:{label:e.$t("Create info")}},[a("span",[e._v(e._s(e._f("date")(e.currencyData.create_dt)))]),a("span",{staticClass:"agent-name"},[e._v(e._s(e.currencyData.create_agent_name))])]):e._e(),e.currencyData?a("el-form-item",{attrs:{label:e.$t("Update info")}},[a("span",[e._v(e._s(e._f("date")(e.currencyData.update_dt)))]),a("span",{staticClass:"agent-name"},[e._v(e._s(e.currencyData.update_agent_name))]),e.showChangeLog?a("div",{staticClass:"change-log"},e._l(e.currencyData.change_log,(function(t,n){return a("div",{key:t.operate_dt,staticClass:"change-log-item",class:{current:0===n}},[e._l(t.log,(function(t,n){return a("div",{key:n,staticClass:"change-log-detail"},[e._v(" "+e._s(t)+" ")])})),a("div",{staticClass:"change-date"},[a("span",[e._v(e._s(e._f("date")(t.operate_dt)))]),a("span",{staticClass:"operate-agent-name"},[e._v(e._s(t.operate_agent_name))])])],2)})),0):a("div",[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showChangeLog=!0}}},[e._v(e._s(e.$t("Show history")))])],1)]):e._e(),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Save")))])],1)],1)],1)])]),a("el-dialog",{attrs:{visible:e.alertDialogVisible,width:"400px","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.alertDialogVisible=t}}},[a("div",{staticClass:"alert-title"},[e._v(" "+e._s(e.$t("Warning"))+" ")]),a("div",{staticClass:"alert-content"},[e._v(" "+e._s(e.$t("The “exchange rate” is 10% or more lower/higher than the “live rate”, do you still want to proceed ?"))+" ")]),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(t){e.alertDialogVisible=!1}}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.submitData}},[e._v(e._s(e.$t("Yes")))])],1)])],1)},Cf=[],kf=["externalPlatforms","internalPlatforms"],wf={data:function(){return{currencyData:null,liveRate:null,formData:{code:"",internal_ex_rate:null,meta:{en_US:"",zh_CN:"",zh_HK:"",ko_KR:""},symbol:"",flan:{priority:3},internalPlatforms:[],externalPlatforms:[]},showChangeLog:!1,alertDialogVisible:!1}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["allPlatforms"])),{},{rules:function(){var e=function(e,t,a){a()};return{code:[{required:!0}],name:[{required:!0,validator:e}],symbol:[{required:!0,message:this.$t("Symbol is required"),trigger:"blur"}],"meta.en_US":[{required:!0,message:this.$t("It’s required"),trigger:"blur"}],"meta.zh_CN":[{required:!0,message:this.$t("It’s required"),trigger:"blur"}],"meta.zh_HK":[{required:!0,message:this.$t("It’s required"),trigger:"blur"}],"meta.ko_KR":[{required:!0,message:this.$t("It’s required"),trigger:"blur"}],internal_ex_rate:[{required:!0,message:this.$t("Exc. rate is required"),trigger:"blur"}]}}}),methods:{getCurrencyData:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.$route.params.id,t.next=3,e.$api.currency.getCurrencyInfo(a);case 3:n=t.sent,e.currencyData=n,e.liveRate=n.live_rate,e.formData.code=n.code,e.formData.internal_ex_rate=n.internal_ex_rate,Object.assign(e.formData.meta,n.meta),e.formData.symbol=n.symbol,e.formData.flan.priority=n.flan.priority||3,n.supporting_provider.forEach((function(t){e.internalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.formData.internalPlatforms.push(t),e.externalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.formData.externalPlatforms.push(t)}));case 12:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$refs.currencyForm.validate();case 2:if(a=t.sent,a){t.next=5;break}return t.abrupt("return");case 5:if(!(e.liveRate&&Math.abs(1e4*e.liveRate-1e4*Number(e.formData.internal_ex_rate))/(1e4*e.liveRate)>.1)){t.next=8;break}return e.alertDialogVisible=!0,t.abrupt("return");case 8:e.submitData();case 9:case"end":return t.stop()}}),t)})))()},submitData:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,a=e.formData.externalPlatforms.concat(e.formData.internalPlatforms),n=e.formData,n.externalPlatforms,n.internalPlatforms,r=Object(Gt["a"])(n,kf),t.next=5,e.$api.currency.updateCurrency(e.$route.params.id,Object.assign(r,{supporting_provider:a}));case 5:e.$message.success(e.$t("Save successfully")),e.alertDialogVisible=!1,t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),e.$message.error(e.$t("Save failed"));case 12:case"end":return t.stop()}}),t,null,[[0,9]])})))()},onFillInClick:function(){this.formData.internal_ex_rate=Number(this.liveRate.toFixed(4))}},created:function(){this.getCurrencyData()},watch:{"formData.internal_ex_rate":function(e,t){if(e){var a=e+"";/^[0-9]+\.?[0-9]{0,4}$/.test(a)||(this.formData.internal_ex_rate=t)}}}},$f=wf,Sf=(a("2b48"),Object(R["a"])($f,yf,Cf,!1,null,"829c19e6",null)),xf=Sf.exports,Tf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"poi-manage"},[a("router-view")],1)},Df=[],Pf=(a("adcb"),{}),Of=Object(R["a"])(Pf,Tf,Df,!1,null,"699c62be",null),If=Of.exports,Rf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"poi-list"},[a("SeachForm",{on:{change:e.onSearchChange}}),a("div",{staticClass:"actions"},[a("el-row",[a("el-col",{attrs:{span:18}},[a("el-button-group",e._l(e.productStatus,(function(t){return a("el-button",{key:t.value,attrs:{disabled:!e.selectedIds.length,type:"default",size:"mini"},on:{click:function(a){return e.onChangeStatus(t.value)}}},[e._v(e._s(t.text))])})),1),a("el-popconfirm",{attrs:{placement:"bottom",width:"180",title:e.$t("Are you sure to delete ?")},on:{onConfirm:e.onDeleteConfirm}},[a("el-button",{staticClass:"button-delete",attrs:{slot:"reference",disabled:!e.selectedIds.length,plain:"",type:"danger",size:"mini"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)],1),a("el-col",{staticClass:"action-right",attrs:{span:6}},[a("router-link",{attrs:{target:"_blank",to:{name:"PoiInformation",query:{type:"add"}}}},[a("el-button",{attrs:{type:"primary",size:"mini"}},[a("i",{staticClass:"el-icon-plus"}),a("span",[e._v(e._s(e.$t("Add")))])])],1)],1)],1)],1),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"uno-table",attrs:{border:"",data:e.mappedPoiList,"tooltip-effect":"dark",stripe:""},on:{"selection-change":e.onSelectionChange,"sort-change":e.onSort}},[a("el-table-column",{attrs:{type:"selection",align:"center",width:"45",fixed:""}}),a("el-table-column",{attrs:{prop:"id",width:"100",sortable:"",fixed:"",label:e.$t("poi.ID")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"poi-link",attrs:{target:"_blank",to:{name:"PoiInformation",query:{type:"edit",poi_id:t.row.id}}}},[e._v(e._s(t.row.id))])]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.City"),prop:"cityName",width:"100","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.Image"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"poi-list-img",attrs:{src:e.row.imageUrl,alt:""}})]}}])}),a("el-table-column",{attrs:{prop:"category",width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.table.Type")}}),a("el-table-column",{attrs:{prop:"poiName",label:e.$t("productmanage.table.Name"),"min-width":"160","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"statusName",width:"100",label:e.$t("productmanage.common.Status"),"show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"priority",width:"90",label:e.$t("productmanage.common.Priority")}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",width:"80",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"poi-link",attrs:{target:"_blank",to:{name:"PoiInformation",query:{type:"edit",poi_id:t.row.id}}}},[e._v(e._s(e.$t("productmanage.table.Edit")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},Ef=[],Mf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.productIdRules,"validate-on-rule-change":!0}},[a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{filterable:"",placeholder:e.$t("productmanage.common.Country"),clearable:!1},on:{change:e.onCountryChnage},model:{value:e.formModel.countryId,callback:function(t){e.$set(e.formModel,"countryId",t)},expression:"formModel.countryId"}},e._l(e.mappedCountries,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("productmanage.common.City"),filterable:"",clearable:!1,multiple:"","collapse-tags":""},on:{change:e.onCityChange},model:{value:e.formModel.cityId,callback:function(t){e.$set(e.formModel,"cityId",t)},expression:"formModel.cityId"}},e._l(e.mappedCities,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("productmanage.table.Type"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.category,callback:function(t){e.$set(e.formModel,"category",t)},expression:"formModel.category"}},e._l(e.poiTypes,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("productmanage.common.Status"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.poiStatus,(function(e){return a("el-option",{directives:[{name:"show",rawName:"v-show",value:"DET"!==e.value,expression:"item.value !== 'DET'"}],key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},on:{change:e.onKeywordTypeChange},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},[a("el-option",{attrs:{label:e.$t("poi.POIID"),value:"id__in"}}),a("el-option",{attrs:{label:e.$t("poi.Name"),value:"details__title__icontains"}}),a("el-option",{attrs:{label:e.$t("Itin_supplier_UID"),value:"supplier_uid"}})],1)],1)],1),a("el-form-item",[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$t("productmanage.common.LongitudeLatitude")},model:{value:e.formModel.point,callback:function(t){e.$set(e.formModel,"point",t)},expression:"formModel.point"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"append",filterable:"","allow-create":"","default-first-option":"",placeholder:"1-5km"},slot:"append",model:{value:e.formModel.dist,callback:function(t){e.$set(e.formModel,"dist",t)},expression:"formModel.dist"}},e._l(5,(function(e){return a("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1)],1)},Nf=[],jf={countryId:null,cityId:[],category:[],status:[],keyWord:"",keyWordType:"details__title__icontains",point:null,dist:null},Af={data:function(){return{formModel:Object.assign({},jf),cities:[]}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])(["countries"])),{},{productIdRules:function(){var e=this,t={},a=function(t,a,n){/^\s*\d*\s*$/.test(a)?n():n(new Error(e.$t("{0} must be number",[e.$t("poi.POIID")])))},n=this.formModel.keyWordType;return"id__in"===n&&(t.keyWord=[{validator:a,trigger:"change"},{validator:a,trigger:"blur"}]),t},mappedCountries:function(){var e=this;return this.countries.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},mappedCities:function(){var e=this;return this.cities.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},poiTypes:function(){var e=this.$t("poi.type"),t=Object.keys(e),a=[];return t.forEach((function(t){a.push({label:e[t],value:t})})),a},poiStatus:function(){var e=this.$t("productmanage.status"),t=Object.keys(e),a=[];return t.forEach((function(t){"Show|ACT"!==t&&"Draft|DFT"!==t&&"Review|REV"!==t&&"Hide|DCT"!==t||a.push({label:e[t],value:t.split("|")[1]})})),a},hasSearchData:function(){return this.formModel.countryId||this.formModel.cityId.length||this.formModel.keyWord||this.formModel.category.length||this.formModel.status.length||this.formModel.point||this.formModel.dist},isSearchButtonEnable:function(){return this.formModel.keyWord||this.formModel.category.length||this.formModel.status.length||this.formModel.point||this.formModel.dist}}),methods:{onKeywordTypeChange:function(){this.$refs.searchForm.clearValidate()},getCities:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.pog.getCities(e.formModel.countryId,1e3);case 2:a=t.sent,e.cities=a.results;case 4:case"end":return t.stop()}}),t)})))()},onCountryChnage:function(){this.cities=[],this.getCities(),this.onSearch()},onCityChange:function(){this.onSearch()},onClearClick:function(){Object.assign(this.formModel,jf),this.onSearch()},onSearch:function(){if(!this.formModel.point||this.formModel.dist)if(!this.formModel.dist||this.formModel.point)if(!this.formModel.point||/^-?[0-9]+(\.[0-9]{1,4})*,-?[0-9]+(\.[0-9]{1,4})*$/.test(this.formModel.point)){if(this.formModel.dist){var e=Number(this.formModel.dist);if(isNaN(e)||e<1||e>5)return void this.$message.error(this.$t("Distance must be an number between 1 and 5"))}this.$emit("change",this.formModel)}else this.$message.error(this.$t('Invaild longitude and latitude format, please follow "X,Y" format and support up to ten-thousandths'));else this.$message.error(this.$t("Please enter longitude and latitude"));else this.$message.error(this.$t("Please enter distance"))},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},mounted:function(){this.initEnterEvent()},beforeDestroy:function(){document.onkeydown=null},watch:{"formModel.countryId":function(){this.formModel.cityId=[]},isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()}}},Lf=Af,Ff=(a("7456"),Object(R["a"])(Lf,Mf,Nf,!1,null,"889757d2",null)),Uf=Ff.exports,zf={components:{SeachForm:Uf},data:function(){return{poiList:[],loading:!1,selectedIds:[],deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:{productStatus:function(){var e=this,t=["DFT","ACT","REV","DCT"];return Object.keys(ue).filter((function(e){return t.indexOf(e)>=0})).map((function(t){return{text:e.$t(ue[t]),value:t}}))},mappedPoiList:function(){var e=this;return this.poiList.map((function(t){var a=t.id,n=t.city_info,r=t.images,o=t.category,i=t.details,s=t.status,l=t.flan,c="",u="",d="",p=i[e.$i18n.locale]||i.en_US||i.zh_HK||i.zh_CN||i.ko_KR;return p&&(c=p.title),n&&n.name&&(u=n.name[e.$i18n.locale]||n.name.en_US||n.name.zh_HK||n.name.zh_CN||n.name.ko_KR),r.base&&(d=r.base.title),{id:a,poiName:c,cityName:u,imageUrl:d,category:o&&e.$t("poi.type."+o),statusName:e.$t(ue[s]),priority:l.priority}}))}},created:function(){this.getPoiList()},methods:{getPoiList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.searchData||{},n={ordering:e.ordering,page_size:e.pageSize,is_high_level:!1,details__title__icontains:"",page:e.currentPage},a.countryId&&(n.country_id=a.countryId),a.cityId&&a.cityId.length&&(n.city_id__in=a.cityId.join(",")),a.category&&a.category.length?n.category__in=a.category.join(","):n.category__in="ATR,RTR",a.keyWord&&(n[a.keyWordType]=a.keyWord),a.point&&a.dist&&(n.point=a.point,n.dist=1e3*Number(a.dist)),a.status&&a.status.length&&(n.status__in=a.status.join(",")),e.loading=!0,t.prev=9,t.next=12,e.$api.poi.getPois(n);case 12:r=t.sent,e.poiList=r.results,e.total=r.count;case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[9,,15,18]])})))()},onSelectionChange:function(e){this.selectedIds=e.map((function(e){return e.id}))},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getPoiList()},onDeleteConfirm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.poi.batchDelete({poi_ids:e.selectedIds});case 2:e.getPoiList();case 3:case"end":return t.stop()}}),t)})))()},onChangeStatus:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.poi.updateStatus({poi_ids:t.selectedIds,status:e});case 2:t.getPoiList();case 3:case"end":return a.stop()}}),a)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getPoiList()},onPageSizeChange:function(e){this.pageSize=e,this.getPoiList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getPoiList())}}},qf=zf,Hf=(a("bba4"),Object(R["a"])(qf,Rf,Ef,!1,null,"a7305d48",null)),Bf=Hf.exports,Kf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-manage-operation"},[a("div",{staticClass:"title"},[e._v(e._s(e.getPoiName))]),a("el-tabs",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:e.$t("poi.BasicInfo"),name:"basic"}},[a("keep-alive",[a("basic-info",{on:{name:function(t){return e.arr=t}}})],1)],1),a("el-tab-pane",{attrs:{label:e.$t("poi.RelatedProduct"),name:"related",disabled:e.getStatus}},["related"===e.activeName?a("related-product"):e._e()],1)],1)],1)},Vf=[],Yf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"basic-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px",size:"small",rules:e.rules}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.POIID")+":"}},[e._v(e._s(e.form.poiId))])],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.Type")+":"}},["edit"!==e.$route.query.type?a("el-select",{attrs:{placeholder:""},model:{value:e.form.category,callback:function(t){e.$set(e.form,"category",t)},expression:"form.category"}},e._l(e.$t("poi.type"),(function(e,t){return a("el-option",{key:t,attrs:{label:e,value:t}})})),1):e._e(),"edit"===e.$route.query.type?a("span",[e._v(e._s(e.$t("poi.type")[e.form.category]))]):e._e()],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{prop:"country",label:e.$t("productmanage.common.Country")}},[a("el-select",{attrs:{filterable:"",placeholder:"",clearable:!1},on:{change:e.onCountryChnage},model:{value:e.form.country,callback:function(t){e.$set(e.form,"country",t)},expression:"form.country"}},e._l(e.mappedCountries,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{prop:"city",label:e.$t("productmanage.common.City")}},[a("el-select",{attrs:{placeholder:"",clearable:!1,filterable:"","collapse-tags":""},on:{change:e.onCityChange},model:{value:e.form.city,callback:function(t){e.$set(e.form,"city",t)},expression:"form.city"}},e._l(e.mappedCities,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:"RTR"===e.form.category?12:24}},[a("div",{staticClass:"grid-content average"},[a("el-form-item",{attrs:{label:e.$t("poi.AverageCost")+":"}},[a("el-input",{model:{value:e.form.average_cost,callback:function(t){e.$set(e.form,"average_cost",t)},expression:"form.average_cost"}},[a("el-select",{attrs:{slot:"prepend",placeholder:""},slot:"prepend",model:{value:e.form.average_cost_type,callback:function(t){e.$set(e.form,"average_cost_type",t)},expression:"form.average_cost_type"}},e._l(e.currencies,(function(t){return a("el-option",{key:t.id,attrs:{label:e.$t(t.code),value:t.code}})})),1)],1)],1)],1)]),"RTR"===e.form.category?a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Reservation")+":"}},[a("el-select",{attrs:{placeholder:""},model:{value:e.form.support_reservation,callback:function(t){e.$set(e.form,"support_reservation",t)},expression:"form.support_reservation"}},[a("el-option",{attrs:{label:e.$t("Not support"),value:!1}}),a("el-option",{attrs:{label:e.$t("Support"),value:!0}})],1)],1)],1)]):e._e()],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content rating"},[a("el-form-item",{attrs:{label:e.$t("poi.Rating")+":",prop:"rating"}},["edit"!==e.$route.query.type?a("el-input",{attrs:{placeholder:"0.0-5.0"},model:{value:e.form.rating,callback:function(t){e.$set(e.form,"rating",t)},expression:"form.rating"}}):e._e(),"edit"===e.$route.query.type?a("span",[e._v(e._s(e.form.rating))]):e._e()],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.Favorited")+":"}},[e._v(e._s(e.form.favorited||"-"))])],1)])],1),a("el-row",["RTR"===e.form.category?a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content payment"},[a("el-form-item",{attrs:{label:e.$t("poi.Payment")+":"}},[a("el-select",{staticStyle:{"margin-left":"20px"},attrs:{multiple:"",filterable:"",placeholder:""},model:{value:e.form.payment,callback:function(t){e.$set(e.form,"payment",t)},expression:"form.payment"}},e._l(e.$t("poi.payment"),(function(e,t){return a("el-option",{key:t.split("|")[1],attrs:{label:e,value:t.split("|")[1]}})})),1)],1)],1)]):e._e()],1),a("el-row",["RTR"===e.form.category?a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content payment"},[a("el-form-item",{attrs:{label:e.$t("Brand")+":"}},[a("el-select",{staticStyle:{"margin-left":"20px"},attrs:{placeholder:"",filterable:""},model:{value:e.form.brand_tag,callback:function(t){e.$set(e.form,"brand_tag",t)},expression:"form.brand_tag"}},e._l(e.brandList,(function(t){return a("el-option",{key:t.id,attrs:{value:t.id,label:t.name[e.$i18n.locale]}})})),1)],1)],1)]):e._e()],1),a("el-row",[a("el-col",{attrs:{span:"RTR"===e.form.category?12:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.Location")+":",prop:"coordinates"}},[a("el-input",{attrs:{placeholder:e.locationPlaceholder},on:{input:function(t){e.form.coordinates=e.form.coordinates.replace(/[^\d\-,,.]*/g,"").replace(/,/g,",")}},model:{value:e.form.coordinates,callback:function(t){e.$set(e.form,"coordinates",t)},expression:"form.coordinates"}})],1)],1)]),a("el-col",{attrs:{span:"RTR"===e.form.category?12:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Supplier")+":",prop:"vendor"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:""},model:{value:e.form.vendor,callback:function(t){e.$set(e.form,"vendor",t)},expression:"form.vendor"}},e._l(e.vendorList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)],1)])],1)],1),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"})]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.Priority")+":"}},[a("el-select",{attrs:{placeholder:""},model:{value:e.form.priority,callback:function(t){e.$set(e.form,"priority",t)},expression:"form.priority"}},[a("el-option",{attrs:{value:1}},[e._v("1 "+e._s(e.$t("productmanage.common.LowestPriority")))]),a("el-option",{attrs:{value:2}},[e._v("2")]),a("el-option",{attrs:{value:3}},[e._v("3")]),a("el-option",{attrs:{value:4}},[e._v("4")]),a("el-option",{attrs:{value:5}},[e._v("5")]),a("el-option",{attrs:{value:6}},[e._v("6")]),a("el-option",{attrs:{value:7}},[e._v("7")]),a("el-option",{attrs:{value:8}},[e._v("8")]),a("el-option",{attrs:{value:9}},[e._v("9")]),a("el-option",{attrs:{value:10}},[e._v("10 "+e._s(e.$t("productmanage.common.HighestPriority")))])],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.District")}},[a("el-select",{attrs:{placeholder:"",clearable:!1,"collapse-tags":""},model:{value:e.form.district,callback:function(t){e.$set(e.form,"district",t)},expression:"form.district"}},e._l(e.mappedDistricts,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)]),a("el-col",{attrs:{span:12}})],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content visit"},["ATR"===e.form.category?a("el-form-item",{attrs:{label:e.$t("poi.VisitHours")+":"}},[a("el-select",{attrs:{placeholder:""},model:{value:e.form.visit_hours,callback:function(t){e.$set(e.form,"visit_hours",t)},expression:"form.visit_hours"}},e._l(18,(function(t){return a("el-option",{key:t,attrs:{label:e.countLabel(t),value:e.countLabel(t)}})})),1)],1):e._e(),"RTR"===e.form.category?a("el-form-item",{attrs:{label:e.$t("poi.SeatNumber")+":"}},[a("el-select",{attrs:{placeholder:""},model:{value:e.form.seat_number,callback:function(t){e.$set(e.form,"seat_number",t)},expression:"form.seat_number"}},[a("el-option",{attrs:{label:"-",value:"-"}}),a("el-option",{attrs:{label:"1~10",value:"1~10"}}),a("el-option",{attrs:{label:"10~20",value:"10~20"}}),a("el-option",{attrs:{label:"20~50",value:"20~50"}}),a("el-option",{attrs:{label:"50~100",value:"50~100"}}),a("el-option",{attrs:{label:"100+",value:"100+"}})],1)],1):e._e()],1)]),a("el-col",{attrs:{span:12}}),a("el-col",{attrs:{span:12}})],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.Shared")+":"}},[e._v(e._s(e.form.shared||"-"))])],1)])],1),a("el-row",{attrs:{gutter:20}},["RTR"===e.form.category?a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content tag"},[a("el-form-item",{attrs:{label:e.$t("poi.Facility")+":"}},[a("el-select",{staticStyle:{"margin-left":"20px"},attrs:{multiple:"",filterable:"","collapse-tags":"",placeholder:""},model:{value:e.form.facility,callback:function(t){e.$set(e.form,"facility",t)},expression:"form.facility"}},e._l(e.$t("poi.facility"),(function(e,t){return a("el-option",{key:t.split("|")[1],attrs:{label:e,value:t.split("|")[1]}})})),1)],1)],1)]):e._e(),a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("poi.HomePage")+":"}},[a("el-input",{model:{value:e.form.home_page,callback:function(t){e.$set(e.form,"home_page",t)},expression:"form.home_page"}})],1)],1)]),a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("SupplierLink")+":"}},[a("el-input",{model:{value:e.form.supplier_link,callback:function(t){e.$set(e.form,"supplier_link",t)},expression:"form.supplier_link"}})],1)],1)])],1)],1)])],1),a("el-row",[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Itin_supplier")+":",prop:"supplier_raw_id"}},[a("el-input",{attrs:{placeholder:e.$t("Itin_supplier")},model:{value:e.form.supplier_raw_id,callback:function(t){e.$set(e.form,"supplier_raw_id",t)},expression:"form.supplier_raw_id"}})],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Itin_supplier_UID")+":",prop:"supplier_uid"}},[a("el-input",{attrs:{placeholder:e.$t("Itin_supplier_UID")},model:{value:e.form.supplier_uid,callback:function(t){e.$set(e.form,"supplier_uid",t)},expression:"form.supplier_uid"}})],1)],1)])],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content tag"},[a("el-form-item",{attrs:{label:e.$t("poi.Tag")+":",prop:"searchable_tags_ids"}},[a("el-select",{attrs:{placeholder:e.$t("Search or select multiple options"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.remoteMethodTag,loading:e.tagLoading},model:{value:e.form.searchable_tags_ids,callback:function(t){e.$set(e.form,"searchable_tags_ids",t)},expression:"form.searchable_tags_ids"}},e._l(e.getRes(e.tagList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}},[e._v(e._s(t.label))])})),1)],1)],1)])],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"image-box"},[a("el-form-item",{attrs:{prop:"images"}},[a("template",{slot:"label"},[a("span",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.Image"))+":")]),a("p",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.1stImage"))+" ")]),a("p",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.asCover")))])]),a("el-upload",{ref:"upload",attrs:{action:e.actionUrl,multiple:"","list-type":"picture-card",accept:"image/png,image/jpeg,image/jpg","before-upload":e.beforeUpload,"on-success":e.uploadSuccess,"file-list":e.filstList},scopedSlots:e._u([{key:"file",fn:function(t){var n=t.file;return a("div",{},[a("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:n.url,alt:""}}),a("span",{staticClass:"el-upload-list__item-actions"},[a("span",{staticClass:"el-upload-list__item-preview",on:{click:function(t){return e.handlePictureCardPreview(n)}}},[a("i",{staticClass:"el-icon-zoom-in"})]),a("span",{staticClass:"el-upload-list__item-delete",on:{click:function(t){return e.handleRemove(n)}}},[a("i",{staticClass:"el-icon-delete"})])])])}}])},[a("p",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.UploadImage")))]),a("div",{staticClass:"el-upload__text"},[e._v("< 500KB 640*360 px"),a("br"),e._v(e._s(e.$t("productmanage.common.imageText")))])]),a("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],2)],1)])],1),a("div",{staticClass:"tab-box"},[a("div",{staticClass:"fold"},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.isFold=!e.isFold}}},[e._v(e._s(e.isFold?e.$t("productmanage.option.Expand"):e.$t("productmanage.common.Fold"))),a("i",{class:e.isFold?"el-icon-arrow-down el-icon--right":"el-icon-arrow-up el-icon--right"})])],1),a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name,closable:e.editableTabs.length>1}},[a("div",{staticClass:"product-box",class:{active:e.isFold}},[e.showInfo?a("product-info",{ref:"productInfo",refInFor:!0,attrs:{poi:t,type:e.form.category},on:{change:function(a){return e.changeCont(t,a)}}}):e._e()],1)])})),a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("productmanage.common.AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)])],2)],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Status")+":",prop:"status"}},e._l(e.getRadios,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v(e._s(e.$t("poi.status."+t.label+"|"+t.value)))])})),1),"edit"===e.$route.query.type?a("el-form-item",{attrs:{label:e.$t("productmanage.common.CreateInfo")+":"}},[a("span",[e._v(e._s(e.createTime))])]):e._e(),"edit"===e.$route.query.type?a("el-form-item",{attrs:{label:e.$t("productmanage.common.UpdateInfo")+":"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showUpdateInfo=!0}}},[e._v(e._s(e.updateTime))])],1):e._e()],1),a("div",{staticClass:"tab-box"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Submit")))])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.poi,watchObject:e.$route.query.poi_id}}):e._e()],1)],1)},Wf=[],Gf=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"productinfo",staticClass:"product-poi-info"},[a("el-form",{ref:"ruleForm",attrs:{model:e.ruleForm,size:"small",rules:e.rules,"label-position":"top"}},[a("el-form-item",{staticClass:"poiName",attrs:{label:e.$t("poi.POIName"),prop:"computedName"}},e._l(e.ruleForm.name,(function(t,n){return a("div",{key:n,staticStyle:{"margin-bottom":"10px"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.name[n],callback:function(t){e.$set(e.ruleForm.name,n,t)},expression:"ruleForm.name[index]"}}),a("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"text"},on:{click:e.add}},[e._v(e._s(e.$t("poi.AddSimilarName")))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:0!==n&&e.ruleForm.name.length>1,expression:"index !== 0 && ruleForm.name.length > 1"}],staticStyle:{color:"#FF5A60"},attrs:{type:"text"},on:{click:function(t){return e.handleDelete(n)}}},[e._v(e._s(e.$t("Delete")))])],1)})),0),a("el-form-item",{attrs:{label:e.$t("poi.SubDescription"),prop:"subdescription"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.subdescription,callback:function(t){e.$set(e.ruleForm,"subdescription",t)},expression:"ruleForm.subdescription"}})],1),a("el-form-item",{attrs:{label:e.$t("poi.ContactNumber"),prop:"contact_number"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.contact_number,callback:function(t){e.$set(e.ruleForm,"contact_number",t)},expression:"ruleForm.contact_number"}})],1),a("el-form-item",{attrs:{label:e.$t("poi.Address"),prop:"address"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.address,callback:function(t){e.$set(e.ruleForm,"address",t)},expression:"ruleForm.address"}})],1),a("el-form-item",{attrs:{label:e.$t("poi.OpenHours"),prop:"open_hours"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.open_hours,callback:function(t){e.$set(e.ruleForm,"open_hours",t)},expression:"ruleForm.open_hours"}})],1),"ATR"===e.type?a("el-form-item",{attrs:{label:e.$t("poi.VisitHoursNote"),prop:"visit_hours_note"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.visit_hours_note,callback:function(t){e.$set(e.ruleForm,"visit_hours_note",t)},expression:"ruleForm.visit_hours_note"}})],1):e._e(),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Brief"),prop:"brief"}},[a("editor",{attrs:{id:e.poi.name+"0"},on:{onGetContent:function(t){return e.getCont("brief",t)}},model:{value:e.ruleForm.brief,callback:function(t){e.$set(e.ruleForm,"brief",t)},expression:"ruleForm.brief"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Description"),prop:"description"}},[a("editor",{attrs:{id:e.poi.name+"1"},on:{onGetContent:function(t){return e.getCont("description",t)}},model:{value:e.ruleForm.description,callback:function(t){e.$set(e.ruleForm,"description",t)},expression:"ruleForm.description"}})],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"ATR"===e.type,expression:"type === 'ATR'"}],attrs:{label:e.$t("poi.Suggestion"),prop:"suggestion"}},[a("editor",{attrs:{id:e.poi.name+"2"},on:{onGetContent:function(t){return e.getCont("suggestion",t)}},model:{value:e.ruleForm.suggestion,callback:function(t){e.$set(e.ruleForm,"suggestion",t)},expression:"ruleForm.suggestion"}})],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"RTR"===e.type,expression:"type === 'RTR'"}],attrs:{label:e.$t("poi.Recommendation"),prop:"recommendation"}},[a("editor",{attrs:{id:e.poi.name+"3"},on:{onGetContent:function(t){return e.getCont("recommendation",t)}},model:{value:e.ruleForm.recommendation,callback:function(t){e.$set(e.ruleForm,"recommendation",t)},expression:"ruleForm.recommendation"}})],1),a("el-form-item",{attrs:{label:e.$t("poi.Transportation"),prop:"transportation"}},[a("editor",{attrs:{id:e.poi.name+"4"},on:{onGetContent:function(t){return e.getCont("transportation",t)}},model:{value:e.ruleForm.transportation,callback:function(t){e.$set(e.ruleForm,"transportation",t)},expression:"ruleForm.transportation"}})],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"ATR"===e.type,expression:"type === 'ATR'"}],attrs:{label:e.$t("poi.TicketInfo"),prop:"ticket_info"}},[a("editor",{attrs:{id:e.poi.name+"5"},on:{onGetContent:function(t){return e.getCont("ticket_info",t)}},model:{value:e.ruleForm.ticket_info,callback:function(t){e.$set(e.ruleForm,"ticket_info",t)},expression:"ruleForm.ticket_info"}})],1)],1)],1)},Qf=[],Jf={data:function(){return{ruleForm:{name:[],computedName:"",subdescription:"",contact_number:"",address:"",open_hours:"",visit_hours_note:"",brief:"",description:"",suggestion:"",transportation:"",ticket_info:"",recommendation:""},isFirst:!0}},props:["poi","type"],components:{Editor:fu},computed:{rules:function(){var e=this,t=function(t,a,n){a?a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n():n(new Error(e.$t("productmanage.common.EnterSomething")))},a=function(t,a,n){a&&a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n()};return{computedName:[{required:!0,message:this.$t("productmanage.common.EnterSomething"),trigger:"blur"}],contact_number:[{required:!0,message:this.$t("productmanage.common.EnterSomething"),trigger:"blur"}],address:[{required:!0,message:this.$t("productmanage.common.EnterSomething"),trigger:"blur"}],brief:[{required:!0,trigger:"input",validator:t}],description:[{required:!0,trigger:"input",validator:t}],suggestion:[{trigger:"input",validator:a}],transportation:[{trigger:"input",validator:a}],ticket_info:[{trigger:"input",validator:a}],recommendation:[{trigger:"input",validator:a}]}}},watch:{"ruleForm.name":{handler:function(e,t){this.ruleForm.computedName=e.join("|")},deep:!0,immediate:!0}},methods:{checkAll:function(){var e=this;return new Promise((function(t,a){e.$refs.ruleForm&&e.$refs.ruleForm.validate((function(a){a&&e.ruleForm.name[0]?t(!0):t(!1)}))}))},add:function(){this.ruleForm.name.push("")},handleDelete:function(e){this.ruleForm.name.splice(e,1),this.$emit("change",this.ruleForm)},checkValue:function(e){this.$refs.ruleForm&&this.$refs.ruleForm.validateField(e)},getCont:function(e){var t=this;setTimeout((function(){t.$emit("change",t.ruleForm),t.checkValue(e)}))},change:function(){this.$emit("change",this.ruleForm)}},mounted:function(){this.ruleForm=Object.assign(this.ruleForm,this.poi.content)}},Xf=Jf,Zf=(a("d40a"),Object(R["a"])(Xf,Gf,Qf,!1,null,null,null)),eg=Zf.exports,tg={data:function(){var e=this;return{currencies:[],EVENT_TYPE:Me,showUpdateInfo:!1,brandList:[],tagLoading:!1,cities:[],districts:[],form:{poiId:"-",fatherPoint:"",category:window.localStorage.getItem("poiType")||"ATR",country:null,city:null,district:null,searchable_tags_ids:[],vendor:"",supplier_link:"",priority:"",coordinates:"",visit_hours:"",seat_number:"",facility:[],rating:"",home_page:"",payment:"",shared:"-",favorited:"-",average_cost:"",average_cost_type:"HKD",status:"DFT",images:null,internalPlatforms:[],externalPlatforms:[],support_reservation:!1,brand_tag:null,supplier_raw_id:null,supplier_uid:null},inputCity:"",vendorList:"",tagList:[],cityList:[],districtList:[],districtList1:[],districtList2:[],actionUrl:this.$env.apiUrl+"/file_upload",dialogVisible:!1,dialogImageUrl:[],filstList:[],editableTabs:[],isFold:!1,tagPageList:["en_US","zh_CN","zh_HK","ko_KR"],editableTabsValue:"",isSend:!0,rules:{country:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}],city:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}],vendor:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}],images:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}],coordinates:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"blur"},{validator:e.validatePosition,trigger:"blur"}],searchable_tags_ids:[{required:!0,message:e.$t("productmanage.common.ItsRequired"),trigger:"change"}]},loading:!1,loading1:!1,createTime:"",updateTime:"",showInfo:!0}},components:{productInfo:eg,EventTimeline:Au},watch:{editableTabs:{handler:function(e,t){this.$emit("name",e)},deep:!0}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["d"])(["countries"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{mappedCountries:function(){var e=this;return this.countries.map((function(t){return{value:t.id,label:e.$options.filters.lang(t.details,e.$i18n.locale,"title")}}))},mappedCities:function(){var e=this;return this.cities.map((function(t){return{value:t.id,label:e.$options.filters.lang(t.details,e.$i18n.locale,"title")}}))},mappedDistricts:function(){var e=this;return this.districts.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},getPageList:function(){var e=this,t=[];return this.tagPageList.forEach((function(a){e.editableTabs.findIndex((function(e){return e.name===a}))>-1||t.push(a)})),t},getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id}}));return a}},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]},getRadios:function(){var e=this.$i18n.messages.en_US.poi.status,t=Object.keys(e),a=[],n="Draft|DFT,Show|ACT,Review|REV,Hide|DCT";return t.forEach((function(e){n.indexOf(e)>-1&&a.push(e)})),a.map((function(t){return{label:e[t],value:t.split("|")[1]}}))},locationPlaceholder:function(){return this.$t('Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude')}}),methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},getCities:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.pog.getCities(e.form.country,1e3);case 2:a=t.sent,e.cities=a.results;case 4:case"end":return t.stop()}}),t)})))()},onCountryChnage:function(){this.cities=[],this.districts=[],this.form.city=null,this.form.district=null,this.getCities()},getDistricts:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.pog.getDistricts(e.form.city,1e3);case 2:a=t.sent,e.districts=a.results;case 4:case"end":return t.stop()}}),t)})))()},onCityChange:function(){this.districts=[],this.form.district=null,this.getDistricts()},validatePosition:function(e,t,a){t||a(),/^-?[0-9]+(\.[0-9]{1,4}){0,1},-?[0-9]+(\.[0-9]{1,4}){0,1}$/.test(t)||a(new Error(this.$t("Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths"))),a()},validatePass:function(e,t,a){""===t||isNaN(t)||"number"!==typeof(t-0)||t<0||t>5?a(new Error(this.$t("poi.inputTip"))):a()},countLabel:function(e){var t=e/2-.5;return 0===t&&(t="-"),t+""},handlePictureCardPreview:function(e){this.dialogImageUrl=e.url,this.dialogVisible=!0},handleRemove:function(e){var t=this.$refs.upload.uploadFiles,a=t.findIndex((function(t){return t.uid===e.uid}));t.splice(a,1),this.handleImage()},beforeUpload:function(e){},uploadSuccess:function(e,t){this.$refs.upload.uploadFiles.forEach((function(a){a.uid===t.uid&&(a.cloundUrl=e.file[0].url)})),this.handleImage()},handleImage:function(){0===this.$refs.upload.uploadFiles.length?this.form.images=null:this.form.images={base:{title:this.$refs.upload.uploadFiles[0].cloundUrl,backgrounds:this.$refs.upload.uploadFiles.filter((function(e,t){return 0!==t})).map((function(e){return e.cloundUrl}))}},this.$refs.form.validateField("images")},changeCont:function(e,t){e.content=Object(F["a"])({},t)},beforeLeave:function(e,t){if("add"===e)return!1;this.editableTabsValue=e},removeTab:function(e){var t=this.editableTabs,a=this.editableTabsValue;a===e&&t.forEach((function(n,r){if(n.name===e){var o=t[r+1]||t[r-1];o&&(a=o.name)}})),this.editableTabsValue=a,this.editableTabs=t.filter((function(t){return t.name!==e}))},add:function(e){this.editableTabs.find((function(t){return t.name===e}))||(this.editableTabs.push({title:this.$t("lang."+e),name:e,content:{name:[""],language:e,title:"",brief:"",description:"",fee_include:"",fee_not_include:"",precautions:"",order_detail:"",refund_policy:"",sub_description:"",recommendation:""}}),this.editableTabsValue=e)},remoteMethodTag:function(e,t){var a=this;if(""!==e||t){var n={status:"ACT",page_size:100,page:1,is_leaf_tag:!0};t?n["id__in"]=t:n["synonyms__name__icontains"]=e,this.tagLoading=!0,this.$api.tag.getList(n).then((function(e){a.tagLoading=!1,e.results&&(a.tagList=e.results.map((function(e){for(var t in e.meta={},e.name)e.meta[t]=e.tag_path[t]+" - "+e.name[t];return e})))}))}else this.poiList=[]},getBrandList:function(){var e=this,t={status:"ACT",page_size:100,page:1,is_leaf_tag:!1,synonyms__name:"Food",parent__synonyms__name:"Brand"};this.$api.tag.getList(t).then((function(t){t.results&&t.results.length&&(e.brandList=t.results[0].children_tag)}))},fromArr:function(e,t){var a=e.concat(t)||[],n=[];function r(e){e.forEach((function(e){Array.isArray(e)?r(e):e.children?r(e.children):(e.data.id=e.id,n.push(e.data))}))}r(a),this.tagList=n},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.isSend){t.next=2;break}return t.abrupt("return");case 2:a=e.$refs.productInfo,n=[],r=0;case 5:if(!(r"),l+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===s?(l||(l="保存失败!以下有必填项未填
"),l+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===s&&(l||(l="保存失敗!以下有必填項未填
"),l+="[".concat(e.$t("lang."+t.name),"]
"))})),e.$message({dangerouslyUseHTMLString:!0,message:l,type:"error"})}else{e.isSend=!0;var c=e.$i18n.locale,u="",d={country:e.$t("productmanage.common.Country"),city:e.$t("poi.City"),vendor:e.$t("poi.Vendor"),images:e.$t("productmanage.common.Image"),coordinates:e.$t("poi.Location"),rating:e.$t("poi.Rating"),searchable_tags_ids:e.$t("poi.Tag")};for(var p in d){if("rating"===p){var m=e.form[p];if(m&&m>=0&&m<=5)continue}else if("coordinates"===p){if(/^-?[0-9]+(\.[0-9]{1,4}){0,1},-?[0-9]+(\.[0-9]{1,4}){0,1}$/.test(e.form[p]))continue}else if(e.form[p]){if(!Array.isArray(e.form[p]))continue;if(e.form[p].length>0)continue}"en_US"===c?(u||(u="Save failed! Some required fields are not filled in
"),u+="[".concat(d[p],"]
")):"zh_CN"===c?(u||(u="保存失败!以下有必填项未填
"),u+="[".concat(d[p],"]
")):"zh_HK"===c&&(u||(u="保存失敗!以下有必填項未填
"),u+="[".concat(d[p],"]
"))}e.editableTabs.forEach((function(t,a){if(n[a])return!0;"en_US"===c?(u||(u="Save failed! Some required fields are not filled in
"),u+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===c?(u||(u="保存失败!以下有必填项未填
"),u+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===c&&(u||(u="保存失敗!以下有必填項未填
"),u+="[".concat(e.$t("lang."+t.name),"]
"))})),u&&e.$message({dangerouslyUseHTMLString:!0,message:u,type:"error"})}}));case 15:case"end":return t.stop()}}),t)})))()},getVendor:function(){var e=this;this.$api.product.getVendor().then((function(t){e.vendorList=t.map((function(e){return{label:e.name,value:e.id}}))}))},getDetail:function(){var e=this;this.$api.poi.getDetail({poi_id:this.$route.query.poi_id}).then((function(t){e.handleData(t)}))},getTag:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getTag({path__startswith:"0008",depth:4});case 2:return a=t.sent,t.next=5,e.$api.product.getTag({path__startswith:"0005",depth:3,page_size:300});case 5:n=t.sent,a.results&&n.results&&e.fromArr(a.results,n.results);case 7:case"end":return t.stop()}}),t)})))()},formatDate:function(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")},handleData:function(e){var t=this;if(this.editableTabsValue="en_US",Object.keys(e).length>0){var a,n;for(var r in this.form.poiId=e.id,this.form.category=e.category||"ATR",this.form.vendor=e.supplier,this.form.coordinates=(e.position.coordinates||[]).join(","),e.flan&&e.flan.ratings&&(this.form.rating=e.flan.ratings.mean),this.form.priority=(e.flan||{}).priority,this.form.favorited=(e.flan||{}).favorited,this.form.shared=(e.flan||{}).shared,this.form.visit_hours=(e.meta||{}).visit_hours,this.form.home_page=(e.meta||{}).home_page,this.form.supplier_link=e.supplier_link,e.supporting_provider.forEach((function(e){t.internalPlatforms.findIndex((function(t){return t.value===e}))>-1&&t.form.internalPlatforms.push(e),t.externalPlatforms.findIndex((function(t){return t.value===e}))>-1&&t.form.externalPlatforms.push(e)})),this.form.searchable_tags_ids=e.searchable_tags,this.form.payment=e.payment_method.map((function(e){return e.toString()})),this.form.facility=e.facility_info.map((function(e){return e.toString()})),this.form.seat_number=e.meta.seat_numbers,this.form.status=e.status,this.createTime=e.create_dt?this.formatDate(e.create_dt):"",this.updateTime=e.update_dt?this.formatDate(e.update_dt):"",this.form.country=e.country,this.form.city=e.city,this.form.district=e.district,this.form.supplier_raw_id=e.supplier_raw_id,this.form.supplier_uid=e.supplier_uid,this.form.country&&this.getCities(),this.form.city&&this.getDistricts(),this.remoteMethodTag("",this.form.searchable_tags_ids.join(",")),this.form.average_cost_type=e.price_range.base_currency||"HKD",e.price_range.per_cost&&(this.form.average_cost=e.price_range.per_cost[this.form.average_cost_type]),this.form.support_reservation=e.support_reservation,this.form.brand_tag=e.brand_tag,e.details)this.editableTabs.push({title:r,name:r,content:Object.assign({name:"",subdescription:"",contact_number:"",address:"",open_hours:"",visit_hours_note:"",brief:"",description:"",suggestion:"",transportation:"",ticket_info:"",recommendation:""},e.details[r].meta)});Object.keys(e.details).length>0&&(this.editableTabsValue=Object.keys(e.details)[0]);var o="",i=e.images.base.title,s=e.images.base.backgrounds.map((function(e,t){return 0===t&&(o=e),{cloundUrl:e,url:e}}));i&&i!==o&&s.unshift({cloundUrl:e.images.base.title,url:e.images.base.title}),(a=this.filstList).push.apply(a,Object(Xc["a"])(s)),(n=this.$refs.upload.uploadFiles).push.apply(n,Object(Xc["a"])(s)),this.handleImage()}else{this.editableTabs.push({title:"en_US",name:"en_US",content:Object.assign({},{name:"",subdescription:"",contact_number:"",address:"",open_hours:"",visit_hours_note:"",brief:"",description:"",suggestion:"",transportation:"",ticket_info:""})});var l=window.localStorage.getItem("poiPlatforms");this.form.supporting_provider=l?l.split(","):[]}this.editableTabs.map((function(e){e.content.name=e.content.name?e.content.name.split("|"):[""]})),this.$emit("name")},handleList:function(e){var t=this;this.districtList2.forEach((function(a){e===a.id&&(t.districtList=a.children.map((function(e){var t={id:e.id,meta:{}};for(var a in e.details)t.meta[a]=e.details[a].title;return t})),0===t.districtList.length&&(t.form.district_id=""))}))},serachCity:function(e){var t=this;""!==e?(this.loading=!0,this.inputCity=e,this.$api.point.getPOICityList({details__title__icontains:e,category:"H-City"}).then((function(e){t.loading=!1,t.districtList1=[],t.districtList2=e.results||[],t.cityList=e.results.map((function(e){var a,n={id:e.id,meta:{}};for(var r in e.details)n.meta[r]=e.details[r].title;return(a=t.districtList1).push.apply(a,Object(Xc["a"])(e.children.map((function(e){var t={id:e.id,meta:{}};for(var a in e.details)t.meta[a]=e.details[a].title;return t})))),n}))}))):this.cityList=[]},serachDistrict:function(e,t){var a=this;""!==e?(this.loading1=!0,this.$api.point.getPOICityList({details__title__icontains:e,category:"H-City"}).then((function(e){a.loading1=!1;var t=[];a.districtList2=e.results||[],e.results.forEach((function(e){t.push.apply(t,Object(Xc["a"])(e.children))})),a.districtList=t.map((function(e){var t={id:e.id,meta:{}};for(var a in e.details)t.meta[a]=e.details[a].title;return t})),0===a.districtList.length&&(a.form.district_id="")}))):this.districtList=[]}},beforeMount:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getCurrencies();case 2:"add"===e.$route.query.type?(e.$set(e.rules,"rating",[{required:!0,validator:e.validatePass,trigger:"blur"}]),e.handleData({})):e.getDetail(),e.getVendor(),window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))}));case 5:case"end":return t.stop()}}),t)})))()},created:function(){this.getBrandList()}},ag=tg,ng=(a("8f15"),a("1c7a"),Object(R["a"])(ag,Yf,Wf,!1,null,"62a02d9a",null)),rg=ng.exports,og=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"table-box"},[a("div",{staticClass:"table-cont"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableList,"tooltip-effect":"dark",stripe:"","header-row-class-name":"table-header","header-cell-style":{background:"#F2F2F2"},"cell-style":{"border-width":0,padding:"2px 0"}},on:{"selection-change":e.handleSelectionChange,"header-click":e.handlePage}},[a("el-table-column",{attrs:{prop:"order",width:"100",sortable:"",fixed:"",label:e.$t("productmanage.table.ID/SN")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",placement:"top-start"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v(" "+e._s(t.row.id)),a("br"),e._v(e._s(t.row.sn)+" ")]),a("div",{staticClass:"cont-btn",on:{click:function(a){return e.jump({name:"Operation",query:{type:"edit",product_id:t.row.id}})}}},[a("el-button",{attrs:{type:"text"}},[e._v(e._s(t.row.id))]),a("br"),a("el-button",{attrs:{type:"text"}},[e._v(e._s(t.row.sn))])],1)])]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.City"),width:"100","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.pog_cities,(function(t){return a("span",{key:t.id},[e._v(e._s(t.name[e.$i18n.locale]))])}))}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.Image"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"img",staticStyle:{"max-height":"34px","max-width":"48px"},attrs:{src:e.row.images.base?e.row.images.base.title:"",alt:""}})]}}])}),a("el-table-column",{attrs:{prop:"type",width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.table.Type")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reverseType(t.row.type))+" ")]}}])}),a("el-table-column",{attrs:{width:"230","min-width":"160","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.details))+" ")]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.filterHandlerName}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.table.Name"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"en_US"}},[e._v(e._s(e.$t("lang.en_US")))]),a("el-dropdown-item",{attrs:{command:"zh_CN"}},[e._v(e._s(e.$t("lang.zh_CN")))]),a("el-dropdown-item",{attrs:{command:"zh_HK"}},[e._v(e._s(e.$t("lang.zh_HK")))]),a("el-dropdown-item",{attrs:{command:"ko_KR"}},[e._v(e._s(e.$t("lang.ko_KR")))])],1)],1)],1)],2),a("el-table-column",{attrs:{width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.priceType+" "+(t.row.mkp_display_price[e.priceType]||""))+" ")]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.filterHandlerPrice}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.common.Price"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.price,(function(t){return a("el-dropdown-item",{key:t.text,attrs:{command:t.value}},[e._v(e._s(t.text))])})),1)],1)],1)],2),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reverseStatus(t.row.status))+" ")]}}])}),a("el-table-column",{attrs:{prop:"supplier.name","show-overflow-tooltip":"",label:e.$t("Supplier")}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:e.$t("productmanage.common.Platform")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.reversePlatform(t.row.supporting_provider))+" ")]}}])}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",width:"160",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"edit",on:{click:function(a){return e.jump({name:"Operation",query:{type:"edit",product_id:t.row.id}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))]),t.row.options&&t.row.options.length>0?a("span",{staticClass:"option",on:{click:function(a){return e.toogleExpand(t.row)}}},[e._v(e._s(e.$t("productmanage.common.Option"))+" "),a("i",{class:t.row.class||"el-icon-arrow-down"})]):e._e()]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("el-table-column",{attrs:{width:"1",type:"expand"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"cont-box"},[a("div",{staticClass:"right"},[a("el-table",{attrs:{stripe:"",data:e.tableChildRes(t.row),"span-method":e.objectSpanMethod,"header-cell-style":{background:"#F2F2F2"},"cell-style":{"border-width":0,padding:"8px 0"}}},[a("el-table-column",{attrs:{width:"300","show-overflow-tooltip":"",label:e.$t("productmanage.common.OptionName")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.details))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"230","show-overflow-tooltip":"",label:e.$t("productmanage.table.SuboptionName")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.countName(t.row.sub_details))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"100","show-overflow-tooltip":"",label:e.$t("productmanage.common.Price")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.priceType+" "+(t.row.sub_price[e.priceType]||""))+" ")]}}],null,!0)}),a("el-table-column",{attrs:{prop:"address","show-overflow-tooltip":"",label:e.$t("productmanage.common.Stock")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(-1==t.row.max_quantity_per_sub_option?e.$t("productmanage.table.NoLimit"):t.row.max_quantity_per_sub_option)+" ")]}}],null,!0)}),a("el-table-column",{attrs:{width:"160",fixed:"right","show-overflow-tooltip":"",label:e.$t("productmanage.table.Action")},scopedSlots:e._u([{key:"default",fn:function(n){return[a("span",{staticClass:"edit no-border",on:{click:function(a){return e.jump({name:"Operation",query:{type:"edit",product_id:t.row.id,option_id:n.row.option_id,sub_option_id:n.row.sub_option_id}})}}},[e._v(e._s(e.$t("productmanage.table.Edit")))])]}}],null,!0)})],1)],1)])]}}])}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.page_size,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])},ig=[],sg={data:function(){return{hidden:!1,visible:!1,pictLoading:!0,priceType:"HKD",nameType:"",currentPage:1,page_size:10,total:0,current_size:0,tableList:[],sreachName:"",multipleSelection:[]}},props:[],computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{isOption:function(){return this.multipleSelection.length>0},type:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.productType.".concat(t)),value:t.split("|")[1]}}))},reverseType:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.productType,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},price:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.priceType,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.priceType.".concat(t)),value:t}}))},status:function(){var e=this,t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t);return a.map((function(t){return{text:e.$t("productmanage.status.".concat(t)),value:t.split("|")[1]}}))},reverseStatus:function(){return function(e){var t=this.$i18n.messages[this.$i18n.locale].productmanage.status,a=Object.keys(t),n="";return a.forEach((function(a){-1!==a.split("|").indexOf(e)&&(n=t[a])})),n}},reversePlatform:function(){return function(e){var t=this,a=[];return e.forEach((function(e){t.platformsMapping[e]&&a.push(t.$t("platform.".concat(t.platformsMapping[e])))})),a.join(",")}},countName:function(){return function(e){var t=this.nameType||this.$i18n.locale,a={en_US:(e.en_US||{}).title,zh_HK:(e.zh_HK||{}).title,zh_CN:(e.zh_CN||{}).title,ko_KR:(e.ko_KR||{}).title};return a[t]||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR}}}),methods:{handleSelectionChange:function(e){this.multipleSelection=e},handleSizeChange:function(e){this.page_size=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},toogleExpand:function(e){var t=this.$refs.multipleTable;t.toggleRowExpansion(e),e.class="el-icon-arrow-up"===e.class?"el-icon-arrow-down":"el-icon-arrow-up"},tableChildRes:function(e){var t=[];return e.options.forEach((function(e,a){var n=e.sub_options;n.forEach((function(e,t){"DCT"===e.status&&n.splice(t,1)})),e.matchLength=e.sub_options.length||1,0===e.sub_options.length?(e.option_id="",e.sub_option_id="",e.sub_details={en_US:{title:""},zh_CN:{title:""},zh_HK:{title:""}},e.max_quantity_per_sub_option="",e.sub_price={CNY:"",HKD:"",KRW:"",TWD:"",USD:""},t.push(e)):e.sub_options.forEach((function(a,n){0===n?(e.option_id=e.id,e.sub_option_id=a.id,e.sub_details=a.details,e.max_quantity_per_sub_option=a.max_quantity_per_sub_option,e.sub_price=a.price,t.push(e)):(a.option_id=e.id,a.sub_option_id=a.id,a.sub_price=a.price,a.sub_details=a.details,t.push(a))}))})),t},handlePage:function(e,t){},jump:function(e){var t=this.$router.resolve({name:e.name,query:e.query});window.open(t.href,"_blank")},filterHandlerType:function(e,t,a){return t.type===e},filterHandlerPrice:function(e,t,a){this.priceType=e},filterHandlerName:function(e,t,a){this.nameType=e},filterHandlerStatus:function(e,t,a){return t.status===e},filterHandlerPlatform:function(e,t,a){return t.platforms.indexOf(e-0)>-1},getBtnList:function(){var e=this.$i18n.messages.en_US.productmanage.status,t=Object.keys(e);return t.map((function(e,t){return"Delete|DET"!==e?{text:e.split("|")[0],value:e.split("|")[1]}:{type:"pop",text:e.split("|")[0],value:e.split("|")[1]}}))},handleDet:function(){var e=this;this.$api.product.DetStatus({product_ids:this.multipleSelection.map((function(e){return e.id}))}).then((function(t){e.$message({message:e.$t("successfully"),type:"success",duration:500,onClose:function(){e.getList()}})}))},handleStatus:function(e){var t=this;this.$api.product.putStatus({product_ids:this.multipleSelection.map((function(e){return e.id})),status:e}).then((function(e){t.$message({message:t.$t("successfully"),type:"success",duration:500,onClose:function(){t.getList()}})}))},objectSpanMethod:function(e){var t=e.row,a=(e.column,e.rowIndex,e.columnIndex);if(0===a){var n=t.matchLength?t.matchLength:0,r=n>0?1:0;return{rowspan:n,colspan:r}}},getDetail:function(){var e=this;this.$api.poi.getDetail({poi_id:this.$route.query.poi_id}).then((function(t){e.sreachName=t.details[e.$i18n.locale].title,e.getList()}))},getList:function(){var e=this;this.pictLoading=!0,this.currentPage=this.currentPage,this.$api.product.productList({pois__id:this.$route.query.poi_id,page_size:this.page_size,page:this.currentPage}).then((function(t){e.tableList=t.results,e.total=t.count,e.pictLoading=!1,e.current_size=t.results.length}))}},beforeMount:function(){this.getDetail()}},lg=sg,cg=(a("4306"),a("579c"),Object(R["a"])(lg,og,ig,!1,null,"2a2612fe",null)),ug=cg.exports,dg={data:function(){return{activeName:"basic",PoiName:"",arr:[]}},components:{BasicInfo:rg,RelatedProduct:ug},computed:{getPoiName:function(){var e=this.$i18n.locale;if(this.arr&&0!==this.arr.length){var t={en_US:"",zh_HK:"",zh_CN:"",ko_KR:""},a="";return this.arr.forEach((function(n){n.name===e&&(a=Array.isArray(n.content.name)?n.content.name[0]:n.content.name.split("|")[0]),t[n.name]=Array.isArray(n.content.name)?n.content.name[0]:n.content.name.split("|")[0]})),a||t.en_US||t.zh_HK||t.zh_CN||t.ko_KR||""}return""},getStatus:function(){return"add"===this.$route.query.type||!this.$route.query.poi_id}}},pg=dg,mg=(a("955c"),Object(R["a"])(pg,Kf,Vf,!1,null,"16178983",null)),fg=mg.exports,gg=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-list"},[a("SeachForm",{on:{change:e.onSearchChange}}),a("div",{staticClass:"actions"},[a("el-row",[a("el-col",{attrs:{span:18}},[a("el-button-group",[e._l(e.productStatus,(function(t){return a("el-button",{key:t.value,attrs:{disabled:!e.selectedIds.length,type:"default",size:"mini"},on:{click:function(a){return e.onChangeStatus(t.value)}}},[e._v(e._s(t.text))])})),a("el-button",{attrs:{type:"default",disabled:!e.selectedIds.length,size:"mini"},on:{click:e.onCopyClick}},[e._v(e._s(e.$t("productmanage.copy")))])],2),a("el-popconfirm",{attrs:{placement:"bottom",width:"180",title:e.$t("Are you sure to delete ?")},on:{onConfirm:e.onDeleteConfirm}},[a("el-button",{staticClass:"button-delete",attrs:{slot:"reference",disabled:!e.selectedIds.length,plain:"",type:"danger",size:"mini"},slot:"reference"},[e._v(e._s(e.$t("Delete")))])],1)],1),a("el-col",{staticClass:"action-right",attrs:{span:6}},[a("router-link",{attrs:{target:"_blank",to:{name:"RestaurantProductInfo",query:{type:"add"}}}},[a("el-button",{attrs:{type:"primary",size:"mini"}},[a("i",{staticClass:"el-icon-plus"}),a("span",[e._v(e._s(e.$t("Add")))])])],1)],1)],1)],1),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"uno-table",attrs:{"header-cell-class-name":"uno-table-head",border:"",data:e.mappedProductList,"tooltip-effect":"dark",stripe:""},on:{"selection-change":e.onSelectionChange,"sort-change":e.onSort}},[a("el-table-column",{attrs:{type:"selection",align:"center",width:"45",fixed:""}}),a("el-table-column",{attrs:{prop:"id",width:"100",sortable:"",fixed:"",label:e.$t("ID/SN")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("a",{staticClass:"product-link",attrs:{target:"_blank",href:e.restarantUrl(t.row.id)}},[e._v(e._s(t.row.id))]),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",placement:"top"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v(" "+e._s(t.row.sn)+" ")]),a("div",{staticClass:"product-sn",on:{click:e.onProductSNClick}},[e._v(" "+e._s(t.row.sn)+" ")])])]}}])}),a("el-table-column",{attrs:{label:e.$t("productmanage.common.Image"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticClass:"product-list-img",attrs:{src:e.row.imageUrl,alt:""}})]}}])}),a("el-table-column",{attrs:{width:"230","min-width":"160","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{on:{click:e.onProductNameClick}},[e._v(e._s(e.countName(t.row.details)))])]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.filterHandlerName}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.table.Name"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{class:{active:"en_US"===e.nameType},attrs:{command:"en_US"}},[e._v(e._s(e.$t("lang.en_US")))]),a("el-dropdown-item",{class:{active:"zh_CN"===e.nameType},attrs:{command:"zh_CN"}},[e._v(e._s(e.$t("lang.zh_CN")))]),a("el-dropdown-item",{class:{active:"zh_HK"===e.nameType},attrs:{command:"zh_HK"}},[e._v(e._s(e.$t("lang.zh_HK")))]),a("el-dropdown-item",{class:{active:"ko_KR"===e.nameType},attrs:{command:"ko_KR"}},[e._v(e._s(e.$t("lang.ko_KR")))])],1)],1)],1)],2),a("el-table-column",{attrs:{width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.priceCurrency+" "+(t.row.mkp_display_price[e.priceCurrency]||""))+" ")]}}])},[a("template",{slot:"header"},[a("el-dropdown",{on:{command:e.onPriceCurrencyChange}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.$t("productmanage.common.Price"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.currencies,(function(t){return a("el-dropdown-item",{key:t.id,attrs:{command:t.code}},[e._v(e._s(e.$t(t.code)))])})),1)],1)],1)],2),a("el-table-column",{attrs:{prop:"statusName",width:"100",label:e.$t("productmanage.common.Status"),"show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"supplier.name","show-overflow-tooltip":"",label:e.$t("Supplier")}}),a("el-table-column",{attrs:{prop:"platforms","show-overflow-tooltip":"",label:e.$t("productmanage.common.Platform")}}),a("el-table-column",{attrs:{width:"70",fixed:"right",align:"center","min-width":"70"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"product-link",attrs:{target:"_blank",to:{name:"RestaurantProductInfo",query:{type:"edit",product_id:t.row.id}}}},[e._v(e._s(e.$t("productmanage.table.Edit")))])]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("productmanage.table.Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},hg=[],_g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.productIdRules,"validate-on-rule-change":!0}},[a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{filterable:"",placeholder:e.$t("productmanage.common.Country"),clearable:!1},on:{change:e.onCountryChnage},model:{value:e.formModel.countryId,callback:function(t){e.$set(e.formModel,"countryId",t)},expression:"formModel.countryId"}},e._l(e.mappedCountries,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("productmanage.common.City"),filterable:"",clearable:!1,multiple:"","collapse-tags":""},on:{change:e.onCityChange},model:{value:e.formModel.cityId,callback:function(t){e.$set(e.formModel,"cityId",t)},expression:"formModel.cityId"}},e._l(e.mappedCities,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("productmanage.common.Status"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.productStatus,(function(e){return a("el-option",{directives:[{name:"show",rawName:"v-show",value:"DET"!==e.value,expression:"item.value !== 'DET'"}],key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("productmanage.common.Vendor"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.supplier,callback:function(t){e.$set(e.formModel,"supplier",t)},expression:"formModel.supplier"}},e._l(e.supplierList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("productmanage.common.Platform"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.platforms,callback:function(t){e.$set(e.formModel,"platforms",t)},expression:"formModel.platforms"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Overdue status"),clearable:""},model:{value:e.formModel.expired_type,callback:function(t){e.$set(e.formModel,"expired_type",t)},expression:"formModel.expired_type"}},[a("el-option",{attrs:{label:e.$t("Expire in a week"),value:"future"}}),a("el-option",{attrs:{label:e.$t("Expired"),value:"history"}})],1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},on:{change:e.onKeywordTypeChange},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},[a("el-option",{attrs:{label:e.$t("productmanage.common.ProductID"),value:"id"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.ProductSN"),value:"sn"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.ProductName"),value:"details__title__icontains"}}),a("el-option",{attrs:{label:e.$t("productmanage.common.SupplierProductID"),value:"supplier_product_sn__icontains"}}),a("el-option",{attrs:{label:"POI ID",value:"pois__id"}}),a("el-option",{attrs:{label:e.$t("POI name"),value:"pois__name__in"}})],1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1)],1)},vg=[],bg={countryId:null,cityId:[],category:[],status:[],keyWord:"",keyWordType:"id",platforms:[],supplier:[],expired_type:null},yg={data:function(){return{formModel:Object.assign({},bg),cities:[],supplierList:[]}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])(["countries"])),Object(U["c"])(["platforms"])),{},{productIdRules:function(){var e=this,t={},a=function(t){return function(a,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[t])))}},n=this.formModel.keyWordType;return"id"===n?t.keyWord=[{validator:a(this.$t("Product ID")),trigger:"change"},{validator:a(this.$t("Product ID")),trigger:"blur"}]:"pois__id"===n&&(t.keyWord=[{validator:a(this.$t("poi.POIID")),trigger:"change"},{validator:a(this.$t("poi.POIID")),trigger:"blur"}]),t},mappedCountries:function(){var e=this;return this.countries.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},mappedCities:function(){var e=this;return this.cities.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},productTypes:function(){var e=this.$t("product.type"),t=Object.keys(e),a=[];return t.forEach((function(t){a.push({label:e[t],value:t})})),a},productStatus:function(){var e=this.$t("productmanage.status"),t=Object.keys(e),a=[];return t.forEach((function(t){a.push({label:e[t],value:t.split("|")[1]})})),a},hasSearchData:function(){return this.formModel.countryId||this.formModel.cityId.length||this.formModel.keyWord||this.formModel.category.length||this.formModel.status.length||this.formModel.platforms.length||this.formModel.supplier.length||this.formModel.expired_type},isSearchButtonEnable:function(){return this.formModel.keyWord||this.formModel.category.length||this.formModel.status.length||this.formModel.platforms.length||this.formModel.supplier.length||this.formModel.expired_type},getData:function(){return function(e){var t=this.$t("productmanage.".concat(e)),a=Object.keys(t);return a.map((function(e){return{label:t[e],value:e.split("|")[1]}}))}}}),methods:{onKeywordTypeChange:function(){this.$refs.searchForm.clearValidate()},getVendors:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getVendor();case 2:a=t.sent,e.supplierList=a.map((function(e){return{label:e.name,value:e.id}}));case 4:case"end":return t.stop()}}),t)})))()},getCities:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.pog.getCities(e.formModel.countryId,1e3);case 2:a=t.sent,e.cities=a.results;case 4:case"end":return t.stop()}}),t)})))()},onCountryChnage:function(){this.cities=[],this.getCities(),this.onSearch()},onCityChange:function(){this.onSearch()},onClearClick:function(){Object.assign(this.formModel,bg),this.onSearch()},onSearch:function(){this.$emit("change",this.formModel)},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},created:function(){this.getVendors()},mounted:function(){this.initEnterEvent()},beforeMount:function(){document.onkeydown=null},watch:{"formModel.countryId":function(){this.formModel.cityId=[]},isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()}}},Cg=yg,kg=(a("5801"),Object(R["a"])(Cg,_g,vg,!1,null,"c1022d22",null)),wg=kg.exports,$g={components:{SeachForm:wg},data:function(){return{nameType:"",currencies:[],productList:[],loading:!1,selectedIds:[],deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id",priceCurrency:"HKD"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{restarantUrl:function(){var e=this;return function(t){return"".concat(e.$env.mkpUrl.replace("https://","https://m-").replace("m-www","m"),"/restaurant/product/").concat(t)}},productStatus:function(){var e=this;return Object.keys(ue).filter((function(e){return"DET"!==e})).map((function(t){return{text:e.$t(ue[t]),value:t}}))},mappedProductList:function(){var e=this;return this.productList.map((function(t){var a=t.id,n=t.sn,r=t.city_info,o=t.images,i=t.category,s=t.details,l=t.status,c=t.mkp_display_price,u=t.supplier,d=t.supporting_provider,p="",m="",f="",g=s[e.$i18n.locale]||s.en_US||s.zh_HK||s.zh_CN||s.ko_KR;g&&(p=g.title),r&&r.name&&(m=r.name[e.$i18n.locale]||r.name.en_US||r.name.zh_HK||r.name.zh_CN||r.name.ko_KR),o.base&&(f=o.base.title);var h=[];return d.forEach((function(t){e.platformsMapping[t]&&h.push(e.$t("platform.".concat(e.platformsMapping[t])))})),{id:a,sn:n,productName:p,cityName:m,imageUrl:f,category:i&&e.$t("product.type."+i),statusName:e.$t(ue[l]),mkp_display_price:c,supplier:u,platforms:h.join(","),details:s}}))},countName:function(){return function(e){var t=this.nameType||this.$i18n.locale,a={en_US:(e.en_US||{}).title,zh_HK:(e.zh_HK||{}).title,zh_CN:(e.zh_CN||{}).title,ko_KR:(e.ko_KR||{}).title};return a[t]||a.en_US||a.zh_HK||a.zh_CN||a.ko_KR}}}),created:function(){this.getProductList(),this.getCurrencies()},methods:{getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},onProductSNClick:function(e){G(e.target)&&this.$notify({title:this.$t("Copied"),message:this.$t("Copied SN successfully"),type:"success"})},onProductNameClick:function(e){G(e.target)&&this.$notify({title:this.$t("Copied"),message:this.$t("Copied name successfully"),type:"success"})},filterHandlerName:function(e,t,a){this.nameType=e},getProductList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.searchData||{},n={scope:"EC",type:"RTR",ordering:e.ordering,page_size:e.pageSize,page:e.currentPage},a.countryId&&(n.pois__country__id=a.countryId),a.cityId&&a.cityId.length&&(n.pois__city__id__in=a.cityId.join(",")),a.keyWord&&(n[a.keyWordType]=a.keyWord),a.status&&a.status.length&&(n.status__in=a.status.join(",")),a.platforms&&a.platforms.length&&(n.platforms__in=a.platforms.join(",")),a.supplier&&a.supplier.length&&(n.supplier__in=a.supplier.join(",")),a.expired_type&&(n.expired_type=a.expired_type,"future"===a.expired_type&&(n.expire_days=7)),e.loading=!0,e.productList=[],t.prev=11,t.next=14,e.$api.product.productList(n);case 14:r=t.sent,e.productList=r.results,e.total=r.count;case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[11,,17,20]])})))()},onSelectionChange:function(e){this.selectedIds=e.map((function(e){return e.id}))},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getProductList()},onDeleteConfirm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.DetStatus({product_ids:e.selectedIds});case 2:e.getProductList();case 3:case"end":return t.stop()}}),t)})))()},onChangeStatus:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.product.putStatus({product_ids:t.selectedIds,status:e});case 2:t.getProductList();case 3:case"end":return a.stop()}}),a)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getProductList()},onPageSizeChange:function(e){this.pageSize=e,this.getProductList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getProductList())},onPriceCurrencyChange:function(e){this.priceCurrency=e},onCopyClick:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.$api.product.copyProducts({product_ids:e.selectedIds});case 4:e.currentPage=1,e.getProductList();case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}}},Sg=$g,xg=(a("8402"),Object(R["a"])(Sg,gg,hg,!1,null,"16ab5766",null)),Tg=xg.exports,Dg=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-manage-operation"},[a("div",{staticClass:"title"},[e._v(e._s(e.getProductName))]),a("el-tabs",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:e.$t("poi.BasicInfo"),name:"basic"}},[a("keep-alive",[a("basic-info",{on:{name:function(t){return e.arr=t}}})],1)],1),a("el-tab-pane",{attrs:{label:e.$t("Voucher"),name:"voucher",disabled:e.isVoucherTabDisabled}},["voucher"===e.activeName?a("voucher-module"):e._e()],1),a("el-tab-pane",{attrs:{label:e.$t("Coupon"),name:"coupons",disabled:e.isCouponTabDisabled}},["coupons"===e.activeName?a("coupons-module"):e._e()],1)],1)],1)},Pg=[],Og=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"basic-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px",size:"small",rules:e.rules}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.ProductID")+":"}},[e._v(e._s(e.form.productId))])],1)]),a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.SN")+":",prop:"sn"}},[a("el-input",{attrs:{placeholder:e.$t("productmanage.common.EnterSomething")},model:{value:e.form.sn,callback:function(t){e.$set(e.form,"sn",t)},expression:"form.sn"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.Vendor")+":",prop:"supplier"}},[a("el-select",{attrs:{filterable:"",placeholder:""},model:{value:e.form.supplier,callback:function(t){e.$set(e.form,"supplier",t)},expression:"form.supplier"}},e._l(e.supplierList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)],1)]),a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Supplier SN")+":",prop:"supplier_product_sn"}},[a("el-input",{model:{value:e.form.supplier_product_sn,callback:function(t){e.$set(e.form,"supplier_product_sn",t)},expression:"form.supplier_product_sn"}})],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("SupplierLink")+":"}},[a("el-input",{model:{value:e.form.supplier_link,callback:function(t){e.$set(e.form,"supplier_link",t)},expression:"form.supplier_link"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{staticClass:"w100",attrs:{label:e.$t("productmanage.common.Rating")+":",prop:"star_ratings"}},[a("el-select",{model:{value:e.form.star_ratings,callback:function(t){e.$set(e.form,"star_ratings",t)},expression:"form.star_ratings"}},[a("el-option",{attrs:{value:5}},[e._v("5.0")]),a("el-option",{attrs:{value:4.9}},[e._v("4.9")]),a("el-option",{attrs:{value:4.8}},[e._v("4.8")]),a("el-option",{attrs:{value:4.7}},[e._v("4.7")]),a("el-option",{attrs:{value:4.6}},[e._v("4.6")]),a("el-option",{attrs:{value:4.5}},[e._v("4.5")]),a("el-option",{attrs:{value:4.4}},[e._v("4.4")]),a("el-option",{attrs:{value:4.3}},[e._v("4.3")]),a("el-option",{attrs:{value:4.2}},[e._v("4.2")]),a("el-option",{attrs:{value:4.1}},[e._v("4.1")]),a("el-option",{attrs:{value:4}},[e._v("4.0")]),a("el-option",{attrs:{value:3.9}},[e._v("3.9")]),a("el-option",{attrs:{value:3.8}},[e._v("3.8")]),a("el-option",{attrs:{value:3.7}},[e._v("3.7")]),a("el-option",{attrs:{value:3.6}},[e._v("3.6")]),a("el-option",{attrs:{value:3.5}},[e._v("3.5")]),a("el-option",{attrs:{value:3.4}},[e._v("3.4")]),a("el-option",{attrs:{value:3.3}},[e._v("3.3")]),a("el-option",{attrs:{value:3.2}},[e._v("3.2")]),a("el-option",{attrs:{value:3.1}},[e._v("3.1")]),a("el-option",{attrs:{value:3}},[e._v("3.0")]),a("el-option",{attrs:{value:2.9}},[e._v("2.9")]),a("el-option",{attrs:{value:2.8}},[e._v("2.8")]),a("el-option",{attrs:{value:2.7}},[e._v("2.7")]),a("el-option",{attrs:{value:2.6}},[e._v("2.6")]),a("el-option",{attrs:{value:2.5}},[e._v("2.5")]),a("el-option",{attrs:{value:2.4}},[e._v("2.4")]),a("el-option",{attrs:{value:2.3}},[e._v("2.3")]),a("el-option",{attrs:{value:2.2}},[e._v("2.2")]),a("el-option",{attrs:{value:2.1}},[e._v("2.1")]),a("el-option",{attrs:{value:2}},[e._v("2.0")]),a("el-option",{attrs:{value:1.9}},[e._v("1.9")]),a("el-option",{attrs:{value:1.8}},[e._v("1.8")]),a("el-option",{attrs:{value:1.7}},[e._v("1.7")]),a("el-option",{attrs:{value:1.6}},[e._v("1.6")]),a("el-option",{attrs:{value:1.5}},[e._v("1.5")]),a("el-option",{attrs:{value:1.4}},[e._v("1.4")]),a("el-option",{attrs:{value:1.3}},[e._v("1.3")]),a("el-option",{attrs:{value:1.2}},[e._v("1.2")]),a("el-option",{attrs:{value:1.1}},[e._v("1.1")]),a("el-option",{attrs:{value:1}},[e._v("1.0")])],1)],1)],1)]),a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{staticClass:"w100",attrs:{label:e.$t("productmanage.common.Reviews")+":",prop:"views"}},[a("el-input-number",{attrs:{controls:!1,min:1,max:99999999,step:1,"step-strictly":"",precision:0},model:{value:e.form.views,callback:function(t){e.$set(e.form,"views",t)},expression:"form.views"}})],1)],1)])],1),a("el-row",[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.Priority")+":",prop:"priority"}},[a("el-select",{model:{value:e.form.priority,callback:function(t){e.$set(e.form,"priority",t)},expression:"form.priority"}},[a("el-option",{attrs:{value:1}},[e._v("1 "+e._s(e.$t("productmanage.common.LowestPriority")))]),a("el-option",{attrs:{value:2}},[e._v("2")]),a("el-option",{attrs:{value:3}},[e._v("3")]),a("el-option",{attrs:{value:4}},[e._v("4")]),a("el-option",{attrs:{value:5}},[e._v("5")]),a("el-option",{attrs:{value:6}},[e._v("6")]),a("el-option",{attrs:{value:7}},[e._v("7")]),a("el-option",{attrs:{value:8}},[e._v("8")]),a("el-option",{attrs:{value:9}},[e._v("9")]),a("el-option",{attrs:{value:10}},[e._v("10 "+e._s(e.$t("productmanage.common.HighestPriority")))])],1)],1)],1)]),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"voucher_type","label-width":"100px"}},[a("template",{slot:"label"},[a("span",{staticClass:"voucher-type-label",domProps:{innerHTML:e._s(e.$t("productmanage.option.RedeemMethod")+":")}})]),a("el-select",{model:{value:e.form.voucher_type,callback:function(t){e.$set(e.form,"voucher_type",t)},expression:"form.voucher_type"}},e._l(e.voucherTypes,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],2)],1),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"is_self_purchased","label-width":"100px"}},[a("template",{slot:"label"},[a("span",{staticClass:"voucher-type-label",domProps:{innerHTML:e._s(e.$t("TF direct")+":")}})]),a("el-select",{model:{value:e.form.is_self_purchased,callback:function(t){e.$set(e.form,"is_self_purchased",t)},expression:"form.is_self_purchased"}},[a("el-option",{attrs:{label:e.$t("Yes"),value:!0}}),a("el-option",{attrs:{label:e.$t("No"),value:!1}})],1)],2)],1),a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Buy limit per ACCT")+":",prop:"is_limit_purchased"}},[a("el-select",{model:{value:e.form.is_limit_purchased,callback:function(t){e.$set(e.form,"is_limit_purchased",t)},expression:"form.is_limit_purchased"}},[a("el-option",{attrs:{label:e.$t("productmanage.common.yes"),value:!0}}),a("el-option",{attrs:{label:e.$t("productmanage.common.no"),value:!1}})],1)],1)],1)])],1),a("el-row",{directives:[{name:"show",rawName:"v-show",value:e.form.is_limit_purchased,expression:"form.is_limit_purchased"}]},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Max buy per ACCT")+":",prop:"limit_purchased_num"}},[a("el-input",{attrs:{placeholder:""},model:{value:e.form.limit_purchased_num,callback:function(t){e.$set(e.form,"limit_purchased_num",e._n(t))},expression:"form.limit_purchased_num"}})],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{prop:"limitPurchasedDateRange",label:e.$t("Restricted period")+":"}},[a("el-date-picker",{attrs:{"picker-options":e.pickerOptions,type:"daterange","start-placeholder":e.$t("StartDate"),"end-placeholder":e.$t("EndDate")},model:{value:e.form.limitPurchasedDateRange,callback:function(t){e.$set(e.form,"limitPurchasedDateRange",t)},expression:"form.limitPurchasedDateRange"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Sell perd")+":",prop:"sellPeriod"}},[a("el-date-picker",{attrs:{type:"daterange",clearable:"","start-placeholder":e.$t("productmanage.option.StartDate"),"end-placeholder":e.$t("productmanage.option.EndDate")},model:{value:e.form.sellPeriod,callback:function(t){e.$set(e.form,"sellPeriod",t)},expression:"form.sellPeriod"}})],1)],1)])],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content w100"},[a("el-form-item",{attrs:{label:e.$t("Related Rest")+":",prop:"pois_ids"}},[a("el-select",{staticClass:"custom-select",attrs:{width:"350px",placeholder:e.form.pois_ids.length?"":e.$t("Search or select multiple options"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.remoteMethod,loading:e.loading},model:{value:e.form.pois_ids,callback:function(t){e.$set(e.form,"pois_ids",t)},expression:"form.pois_ids"}},e._l(e.getRes(e.poiList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}},[e._v(e._s(t.label))])})),1)],1)],1)])],1),a("div",{staticClass:"image-box"},[a("el-form-item",{attrs:{prop:"images"}},[a("template",{slot:"label"},[a("span",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.Image"))+":")]),a("p",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.1stImage"))+" ")]),a("p",{staticClass:"image-title"},[e._v(e._s(e.$t("productmanage.common.asCover")))])]),a("draggable",{staticClass:"image-list",attrs:{disabled:e.filstList.length<2},on:{end:e.onImageDragEnd}},e._l(e.filstList,(function(t,n){return a("div",{key:t.uuid,staticClass:"image-list-item"},[a("div",{staticClass:"image-container",style:{backgroundImage:"url('"+t.url+"')"}}),a("div",{staticClass:"image-caption"},[e._v(e._s(t.captions[e.$i18n.locale]))]),a("div",{staticClass:"image-list-item-actions"},[a("button",{staticClass:"iconfont icon-text",attrs:{type:"button"},on:{click:function(a){return e.handlePictureCardPreview(t,n)}}}),a("button",{staticClass:"iconfont icon-icon_delete",attrs:{type:"button"},on:{click:function(t){return e.handleRemove(n)}}})])])})),0),a("el-upload",{ref:"upload",attrs:{action:e.actionUrl,data:{path:"product"},multiple:"","list-type":"picture-card",accept:"image/png,image/jpeg,image/jpg","show-file-list":!1,"on-success":e.uploadSuccess},scopedSlots:e._u([{key:"file",fn:function(t){var n=t.file;return a("div",{},[a("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:n.url,alt:""}}),a("span",{staticClass:"el-upload-list__item-actions"},[a("span",{staticClass:"el-upload-list__item-preview",on:{click:function(t){return e.handlePictureCardPreview(n)}}},[a("i",{staticClass:"el-icon-zoom-in"})]),a("span",{staticClass:"el-upload-list__item-delete",on:{click:function(t){return e.handleRemove(n)}}},[a("i",{staticClass:"el-icon-delete"})])])])}}])},[a("p",{staticClass:"title"},[e._v(e._s(e.$t("productmanage.common.UploadImage")))]),a("div",{staticClass:"el-upload__text"},[e._v("< 500KB 640*360 px"),a("br"),e._v(e._s(e.$t("productmanage.common.imageText")))])]),a("el-dialog",{attrs:{visible:e.dialogVisible,width:"800px","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.onImageDialogClose}},[a("div",{staticClass:"image-zoom",style:{backgroundImage:"url('"+e.dialogImageUrl+"')"}}),a("div",{staticClass:"image-captions"},[e.editableTabs.findIndex((function(e){return"en_US"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("en_US")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.en_US,callback:function(t){e.$set(e.imageCaptions,"en_US",t)},expression:"imageCaptions.en_US"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"zh_CN"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("zh_CN")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.zh_CN,callback:function(t){e.$set(e.imageCaptions,"zh_CN",t)},expression:"imageCaptions.zh_CN"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"zh_HK"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("zh_HK")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.zh_HK,callback:function(t){e.$set(e.imageCaptions,"zh_HK",t)},expression:"imageCaptions.zh_HK"}})],1):e._e(),e.editableTabs.findIndex((function(e){return"ko_KR"===e.name}))>-1?a("div",{staticClass:"caption-item"},[a("label",[e._v("ko_KR")]),a("el-input",{attrs:{placeholder:e.$t("Enter image text"),size:"small"},model:{value:e.imageCaptions.ko_KR,callback:function(t){e.$set(e.imageCaptions,"ko_KR",t)},expression:"imageCaptions.ko_KR"}})],1):e._e()]),a("button",{staticClass:"button-image-arrow iconfont icon-arrow-left",attrs:{type:"button"},on:{click:e.onImageArrowLeft}}),a("button",{staticClass:"button-image-arrow iconfont icon-arrow-right",attrs:{type:"button"},on:{click:e.onImageArrowRight}})])],2)],1),a("div",{staticClass:"tab-box"},[a("div",{staticClass:"fold"},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.isFold=!e.isFold}}},[e._v(e._s(e.isFold?e.$t("productmanage.option.Expand"):e.$t("productmanage.common.Fold"))),a("i",{class:e.isFold?"el-icon-arrow-down el-icon--right":"el-icon-arrow-up el-icon--right"})])],1),a("el-tabs",{attrs:{type:"card","before-leave":e.beforeLeave},on:{"tab-remove":e.removeTab},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},[e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name,closable:e.editableTabs.length>1}},[a("div",{staticClass:"product-box",class:{active:e.isFold}},[e.showInfo?a("product-info",{ref:"productInfo",refInFor:!0,attrs:{content:t.content,lang:t.name},on:{change:function(a){return e.changeCont(t,a)}}}):e._e()],1)])})),a("el-tab-pane",{key:"add",staticClass:"more-btn",attrs:{name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.add}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("productmanage.common.AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.getPageList,(function(t,n){return a("el-dropdown-item",{key:n,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)])],2)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:e.$t("Item type")+":",prop:"purchase_type"}},[a("el-select",{attrs:{placeholder:""},model:{value:e.form.purchase_type,callback:function(t){e.$set(e.form,"purchase_type",t)},expression:"form.purchase_type"}},[a("el-option",{attrs:{label:e.$t("Free item"),value:2}}),a("el-option",{attrs:{label:e.$t("Pay item"),value:0}})],1)],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.TotalStock")+":"}},[a("el-select",{staticClass:"w140",attrs:{placeholder:e.$t("productmanage.option.TotalStock")},model:{value:e.stockType,callback:function(t){e.stockType=t},expression:"stockType"}},[a("el-option",{attrs:{label:e.$t("productmanage.option.NoLimits"),value:-1}}),a("el-option",{attrs:{label:e.$t("productmanage.option.TotalStock"),value:0}})],1)],1)],1)]),a("el-col",{attrs:{span:4}},[a("div",{directives:[{name:"show",rawName:"v-show",value:0===e.stockType,expression:"stockType === 0"}],staticClass:"grid-content"},[a("el-form-item",{attrs:{label:"","label-width":"0",prop:"stockNum"}},[a("el-input",{model:{value:e.form.stockNum,callback:function(t){e.$set(e.form,"stockNum",t)},expression:"form.stockNum"}})],1)],1)])],1),0===e.form.purchase_type?[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Min Buy")+":",prop:"minBuy"}},[a("el-input",{model:{value:e.form.minBuy,callback:function(t){e.$set(e.form,"minBuy",t)},expression:"form.minBuy"}})],1)],1)]),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Max Buy")+":",prop:"maxBuy","label-width":"130px"}},[a("el-input",{model:{value:e.form.maxBuy,callback:function(t){e.$set(e.form,"maxBuy",t)},expression:"form.maxBuy"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.CostPrice")+":",prop:"costPrice"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.form.costPrice,callback:function(t){e.$set(e.form,"costPrice",t)},expression:"form.costPrice"}},[a("el-select",{attrs:{slot:"prepend"},slot:"prepend",model:{value:e.form.costPriceCurrency,callback:function(t){e.$set(e.form,"costPriceCurrency",t)},expression:"form.costPriceCurrency"}},e._l(e.currencies,(function(t){return a("el-option",{key:t.id,attrs:{label:e.$t(t.code),value:t.code}})})),1)],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.SellPrice")+":","label-width":"100px",prop:"price"}},[a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content bg-purple"},e._l(e.currencies,(function(t){return a("el-form-item",{key:t.id,staticClass:"mg15 price",attrs:{prop:"price"+t.code}},[a("el-input",{attrs:{size:"small"},model:{value:e.form["price"+t.code],callback:function(a){e.$set(e.form,"price"+t.code,a)},expression:"form[`price${currency.code}`]"}},[a("template",{slot:"prepend"},[e._v(e._s(e.$t(t.code)))]),"HKD"===t.code?a("template",{slot:"append"},[a("div",{staticClass:"sychronize-btn",on:{click:e.sychronizePrice}},[e._v(e._s(e.$t("Synchronize")))])]):e._e()],2)],1)})),1)])],1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.OrigianlPrice")+":","label-width":"130px"}},[a("el-row",[a("el-col",{attrs:{span:22}},[a("div",{staticClass:"grid-content bg-purple"},e._l(e.currencies,(function(t){return a("el-form-item",{key:t.id,staticClass:"mg15 price",attrs:{prop:"originalPrice"+t.code}},[a("el-input",{attrs:{size:"small"},model:{value:e.form["originalPrice"+t.code],callback:function(a){e.$set(e.form,"originalPrice"+t.code,a)},expression:"form[`originalPrice${currency.code}`]"}},[a("template",{slot:"prepend"},[e._v(e._s(e.$t(t.code)))]),"HKD"===t.code?a("template",{slot:"append"},[a("div",{staticClass:"sychronize-btn",on:{click:e.sychronizeOrignalPrice}},[e._v(e._s(e.$t("Synchronize")))])]):e._e()],2)],1)})),1)])],1)],1)],1)],1)]:e._e(),a("el-row",{attrs:{gutter:20,type:"flex",justify:"start"}},[a("el-col",[a("div",{staticClass:"grid-content items-in-line"},[a("el-form-item",{key:"valid_type",attrs:{label:e.$t("Vaild perd")+":",prop:"valid_type"}},[a("el-select",{attrs:{size:"small"},model:{value:e.form.valid_type,callback:function(t){e.$set(e.form,"valid_type",t)},expression:"form.valid_type"}},e._l(e.RESTAURANT_VALID_TYPE,(function(t,n){return a("el-option",{key:n,attrs:{label:e.$t(t),value:+n}})})),1)],1),"Specific period"===e.RESTAURANT_VALID_TYPE[e.form.valid_type]?[a("el-form-item",{key:"vaildPeriod",attrs:{label:"","label-width":"0",prop:"vaildPeriod"}},[a("el-date-picker",{attrs:{type:"datetimerange",size:"small","default-time":["00:00:00","23:59:59"],"start-placeholder":e.$t("productmanage.option.StartDate"),"end-placeholder":e.$t("productmanage.option.EndDate")},model:{value:e.form.vaildPeriod,callback:function(t){e.$set(e.form,"vaildPeriod",t)},expression:"form.vaildPeriod"}})],1)]:e._e(),"Specific date"===e.RESTAURANT_VALID_TYPE[e.form.valid_type]?[a("el-form-item",{key:"specific_date",attrs:{label:"","label-width":"0",prop:"book_n_days_before_book_date"}},[a("el-select",{attrs:{size:"small",placeholder:e.$t("Book ahead days")},model:{value:e.form.book_n_days_before_book_date,callback:function(t){e.$set(e.form,"book_n_days_before_book_date",t)},expression:"form.book_n_days_before_book_date"}},e._l(e.bookNDaysBeforeBookDates,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)]:e._e(),"Specific time"===e.RESTAURANT_VALID_TYPE[e.form.valid_type]?[a("el-form-item",{key:"specific_time",attrs:{label:"","label-width":"0",prop:"book_n_days_before_book_date"}},[a("el-select",{attrs:{size:"small",placeholder:e.$t("Book ahead days")},model:{value:e.form.book_n_days_before_book_date,callback:function(t){e.$set(e.form,"book_n_days_before_book_date",t)},expression:"form.book_n_days_before_book_date"}},e._l(e.bookNDaysBeforeBookDates,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{key:"valid_start_time",attrs:{label:"","label-width":"0",prop:"valid_start_time"}},[a("el-time-select",{attrs:{"picker-options":{maxTime:e.form.valid_end_time,format:"HH:mm",start:"00:00",step:"00:15",end:"23:59"},size:"small",placeholder:e.$t("Start time")},model:{value:e.form.valid_start_time,callback:function(t){e.$set(e.form,"valid_start_time",t)},expression:"form.valid_start_time"}})],1),a("el-form-item",{key:"valid_end_time",attrs:{label:"","label-width":"0",prop:"valid_end_time"}},[a("el-time-select",{attrs:{"picker-options":{minTime:e.form.valid_start_time,format:"HH:mm",start:"00:00",step:"00:15",end:"23:59"},size:"small",placeholder:e.$t("End time")},model:{value:e.form.valid_end_time,callback:function(t){e.$set(e.form,"valid_end_time",t)},expression:"form.valid_end_time"}})],1),a("el-form-item",{key:"valid_time_interval",attrs:{label:"","label-width":"0",prop:"valid_time_interval"}},[a("el-select",{attrs:{size:"small",placeholder:e.$t("Interval")},model:{value:e.form.valid_time_interval,callback:function(t){e.$set(e.form,"valid_time_interval",t)},expression:"form.valid_time_interval"}},e._l(e.validTimeIntervals,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)]:e._e()],2)])],1),"Specific date"===e.RESTAURANT_VALID_TYPE[e.form.valid_type]||"Specific time"===e.RESTAURANT_VALID_TYPE[e.form.valid_type]?a("div",{staticClass:"date-box"},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("div",{staticClass:"cont-box"},[a("el-calendar",{attrs:{"disabled-date":e.pickerOptions.disabledDate},scopedSlots:e._u([{key:"dateCell",fn:function(t){t.date;var n=t.data;return[a("p",{staticClass:"calendar-date-title",class:{disable:e.moment(n.day).isBefore(e.dateNow)}},[e._v(e._s(n.day.split("-").slice(1).join("-")))]),1===e.saleStatus[n.day]?a("div",{class:{disable:e.moment(n.day).isBefore(e.dateNow)}},[2===e.form.purchase_type?a("p",{staticClass:"calendar-date-title"},[e._v(e._s(e.$t("Free item")))]):e._e(),0===e.form.purchase_type?a("p",{staticClass:"calendar-date-title"},[e._v(e._s(e.getCurrentSymbol())+" "+e._s(e.form["price"+e.currencyType]))]):e._e()]):e._e()]}}],null,!1,577586702),model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}})],1),a("div",{staticClass:"right-select"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handlePrice}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.getCurrentName())),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.currencies,(function(t){return a("el-dropdown-item",{key:t.id,attrs:{command:t.code}},[e._v(e._s(e.$t(t.code)))])})),1)],1),a("el-button",{staticClass:"mult-btn",attrs:{size:"small"},on:{click:e.handleDialog}},[e._v(e._s(e.$t("productmanage.option.MultiSetting")))])],1)])]),a("el-col",{staticClass:"right-cont",attrs:{span:6}},[a("div",{staticClass:"grid-content bordertop"},[a("div",{staticClass:"cont-box margintop right"},[a("p",{staticClass:"date-title"},[e._v(e._s(e.formDate(e.selectedDate)))]),a("div",{staticClass:"date-item currency-item"},[a("div",{staticClass:"date-item-title"},[e._v(e._s(e.$t("productmanage.common.Price")))]),2===e.form.purchase_type?a("div",[a("p",{staticClass:"info"},[e._v(e._s(e.$t("Free item")))])]):e._e(),0===e.form.purchase_type?a("div",{staticClass:"price-list"},e._l(e.getPrice,(function(t,n){return a("p",{key:n,staticClass:"info"},[e._v(e._s(t.text)+" "+e._s(e.form["price"+t.value]))])})),0):e._e()]),a("div",{staticClass:"date-item stock-item"},[a("div",{staticClass:"date-item-title"},[e._v(e._s(e.$t("productmanage.common.Stock")))]),-1===e.stockType?a("div",{staticClass:"date-item-title num"},[e._v(e._s(e.$t("productmanage.option.Unlimited")))]):a("div",{staticClass:"date-item-title num",class:{red:0===e.form.stockNum}},[e._v(e._s(0===e.form.stockNum?"Sold out":e.form.stockNum))])]),a("div",{staticClass:"date-item status-item"},[a("div",{staticClass:"date-item-title"},[e._v(e._s(e.$t("productmanage.common.Status")))]),a("div",[a("el-radio-group",{attrs:{disabled:e.moment(e.selectedDate).isBefore(e.dateNow)},on:{change:e.onSelectedDateStatusChange},model:{value:e.selectedDateStatus,callback:function(t){e.selectedDateStatus=t},expression:"selectedDateStatus"}},[a("p",{staticClass:"info sale"},[a("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("productmanage.option.ForSale")))])],1),a("p",{staticClass:"info"},[a("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("productmanage.option.NotForSale")))])],1)])],1)])])])])],1)],1):e._e(),a("el-form-item",{attrs:{label:e.$t("Customer note")+":",prop:"has_remark"}},[a("el-radio",{attrs:{label:!1},model:{value:e.form.has_remark,callback:function(t){e.$set(e.form,"has_remark",t)},expression:"form.has_remark"}},[e._v(e._s(e.$t("Customer note no show")))]),a("el-radio",{attrs:{label:!0},model:{value:e.form.has_remark,callback:function(t){e.$set(e.form,"has_remark",t)},expression:"form.has_remark"}},[e._v(e._s(e.$t("Customer note show")))])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":",prop:"internalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"externalPlatforms"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t("platform."+t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Status")+":",prop:"status"}},e._l(e.radios,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v(e._s(e.$t(t.label)))])})),1),"edit"===e.$route.query.type?a("el-form-item",{attrs:{label:e.$t("productmanage.common.CreateInfo")+":"}},[a("span",[e._v(e._s(e.createTime))])]):e._e(),"edit"===e.$route.query.type?a("el-form-item",{attrs:{label:e.$t("productmanage.common.UpdateInfo")+":"}},[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showUpdateInfo=!0}}},[e._v(e._s(e.updateTime))])],1):e._e()],2),a("div",{staticClass:"tab-box"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Submit")))])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.product,watchObject:e.$route.query.product_id}}):e._e()],1),a("rank-date",{attrs:{visible:e.dialogRankDate},on:{"update:visible":function(t){e.dialogRankDate=t},save:e.handleDate}})],1)},Ig=[],Rg=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"productinfo",staticClass:"product-manage-info"},[a("el-form",{ref:"ruleForm",attrs:{model:e.ruleForm,size:"small",rules:e.rules,"label-position":"top"}},[a("el-form-item",{attrs:{label:e.$t("productmanage.common.ProductName"),prop:"title"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.title,callback:function(t){e.$set(e.ruleForm,"title",t)},expression:"ruleForm.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Keyword setting title"),prop:"seoTitle"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.seoTitle,callback:function(t){e.$set(e.ruleForm,"seoTitle",t)},expression:"ruleForm.seoTitle"}})],1),a("el-form-item",{attrs:{label:e.$t("Keyword setting description"),prop:"seoDescription"}},[a("el-input",{on:{change:e.change},model:{value:e.ruleForm.seoDescription,callback:function(t){e.$set(e.ruleForm,"seoDescription",t)},expression:"ruleForm.seoDescription"}})],1),a("el-form-item",{attrs:{label:e.$t("What to Expect"),prop:"comboDetails"}},[a("editor",{attrs:{id:"comboDetails"+this.lang},on:{onGetContent:function(t){return e.getCont("comboDetails",t)}},model:{value:e.ruleForm.comboDetails,callback:function(t){e.$set(e.ruleForm,"comboDetails",t)},expression:"ruleForm.comboDetails"}})],1),a("el-form-item",{attrs:{label:e.$t("Details"),prop:"detailedDescription"}},[a("editor",{attrs:{id:"detailedDescription"+this.lang},on:{onGetContent:function(t){return e.getCont("detailedDescription",t)}},model:{value:e.ruleForm.detailedDescription,callback:function(t){e.$set(e.ruleForm,"detailedDescription",t)},expression:"ruleForm.detailedDescription"}})],1),a("el-form-item",{attrs:{label:e.$t("Inclusions"),prop:"feeInclude"}},[a("editor",{attrs:{id:"feeInclude"+this.lang},on:{onGetContent:function(t){return e.getCont("feeInclude",t)}},model:{value:e.ruleForm.feeInclude,callback:function(t){e.$set(e.ruleForm,"feeInclude",t)},expression:"ruleForm.feeInclude"}})],1),a("el-form-item",{attrs:{label:e.$t("Exclusions"),prop:"feeNotInclude"}},[a("editor",{attrs:{id:"feeNotInclude"+this.lang},on:{onGetContent:function(t){return e.getCont("feeNotInclude",t)}},model:{value:e.ruleForm.feeNotInclude,callback:function(t){e.$set(e.ruleForm,"feeNotInclude",t)},expression:"ruleForm.feeNotInclude"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Important to Know"),prop:"useTime"}},[a("editor",{attrs:{id:"useTime"+this.lang},on:{onGetContent:function(t){return e.getCont("useTime",t)}},model:{value:e.ruleForm.useTime,callback:function(t){e.$set(e.ruleForm,"useTime",t)},expression:"ruleForm.useTime"}})],1),a("el-form-item",{attrs:{label:e.$t("How to Redeem"),prop:"useRange"}},[a("editor",{attrs:{id:"useRange"+this.lang},on:{onGetContent:function(t){return e.getCont("useRange",t)}},model:{value:e.ruleForm.useRange,callback:function(t){e.$set(e.ruleForm,"useRange",t)},expression:"ruleForm.useRange"}})],1),a("el-form-item",{attrs:{label:e.$t("Refund policy"),prop:"ruleContent"}},[a("editor",{attrs:{id:"ruleContent"+this.lang},on:{onGetContent:function(t){return e.getCont("ruleContent",t)}},model:{value:e.ruleForm.ruleContent,callback:function(t){e.$set(e.ruleForm,"ruleContent",t)},expression:"ruleForm.ruleContent"}})],1)],1)],1)},Eg=[],Mg={data:function(){return{ruleForm:{title:"",comboDetails:"",detailedDescription:"",seoTitle:"",seoDescription:"",feeInclude:"",feeNotInclude:"",useTime:"",useRange:"",ruleContent:""},isFirst:!0}},props:["content","lang"],components:{Editor:fu},computed:{rules:function(){var e=this,t=function(t,a,n){a?a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n():n(new Error(e.$t("productmanage.common.EnterSomething")))},a=function(t,a,n){a&&a.length>1e5?n(new Error(e.$t("The content exceeds 100,000 characters, please check and edit agian."))):n()},n={title:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],seoTitle:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],seoDescription:[{required:!0,message:this.$t("productmanage.common.EnterSomething")}],comboDetails:[{required:!0,trigger:"input",validator:t}],detailedDescription:[{required:!0,trigger:"input",validator:t}],feeInclude:[{required:!0,trigger:"input",validator:t}],feeNotInclude:[{required:!0,trigger:"input",validator:t}],useTime:[{required:!0,trigger:"input",validator:t}],useRange:[{trigger:"input",validator:a}],ruleContent:[{required:!0,trigger:"input",validator:t}]};return n}},watch:{"content.title":{handler:function(e){this.ruleForm.title=e||""}},"content.comboDetails":{handler:function(e){this.ruleForm.comboDetails=e||""}},"content.detailedDescription":{handler:function(e){this.ruleForm.detailedDescription=e||""}},"content.seoTitle":{handler:function(e){this.ruleForm.seoTitle=e||""}},"content.seoDescription":{handler:function(e){this.ruleForm.seoDescription=e||""}},"content.feeInclude":{handler:function(e){this.ruleForm.feeInclude=e||""}},"content.feeNotInclude":{handler:function(e){this.ruleForm.feeNotInclude=e||""}},"content.useTime":{handler:function(e){this.ruleForm.useTime=e||""}},"content.useRange":{handler:function(e){this.ruleForm.useRange=e||""}},"content.ruleContent":{handler:function(e){this.ruleForm.ruleContent=e||""}}},methods:{checkAll:function(){var e=this;return new Promise((function(t,a){e.$refs.ruleForm&&e.$refs.ruleForm.validate((function(e){t(!!e)}))}))},checkValue:function(e){this.$refs.ruleForm&&this.$refs.ruleForm.validateField(e)},getCont:function(e){var t=this;setTimeout((function(){t.$emit("change",t.ruleForm),t.checkValue(e)}))},change:function(){this.$emit("change",this.ruleForm)}},beforeMount:function(){this.content&&Object.assign(this.ruleForm,this.content)}},Ng=Mg,jg=Object(R["a"])(Ng,Rg,Eg,!1,null,null,null),Ag=jg.exports,Lg=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"rank-date"},[a("el-dialog",{attrs:{title:e.$t("productmanage.option.MultiSetting"),visible:e.visibleData},on:{"update:visible":function(t){e.visibleData=t}}},[a("el-form",{ref:"form",attrs:{model:e.fromData,"label-width":"112px",size:"small"}},[a("div",{staticClass:"cont"},[e._l(e.date,(function(t,n){return a("div",{key:n,staticClass:"date-box"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.Range")+(n+1)+":",prop:"value["+n+"]",rules:[{required:!0,message:e.$t("productmanage.common.AtLeastOneRange"),trigger:"blur"}]}},[a("el-date-picker",{attrs:{type:"daterange","value-format":"yyyy-MM-dd","range-separator":"to","start-placeholder":"Start date","end-placeholder":"End date","picker-options":e.pickerOptions,size:"small"},model:{value:e.fromData.value[n],callback:function(t){e.$set(e.fromData.value,n,t)},expression:"fromData.value[index]"}}),a("i",{directives:[{name:"show",rawName:"v-show",value:0!==n,expression:"index !== 0"}],staticClass:"icon el-icon-close",on:{click:function(t){return e.crease(n)}}}),a("i",{directives:[{name:"show",rawName:"v-show",value:n===e.date.length-1,expression:"index === date.length - 1"}],staticClass:"icon el-icon-plus",on:{click:e.add}})],1)],1)})),a("div",{staticClass:"week-box"},[a("el-form-item",{attrs:{label:e.$t("productmanage.option.Week")+":",prop:"checkedWeeks",rules:[{required:!0,message:e.$t("productmanage.common.WeekIsRequired"),trigger:"change"}]}},[a("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v(e._s(e.$t("productmanage.option.All")))]),a("el-checkbox-group",{on:{change:e.handleCheckedCitiesChange},model:{value:e.fromData.checkedWeeks,callback:function(t){e.$set(e.fromData,"checkedWeeks",t)},expression:"fromData.checkedWeeks"}},e._l(e.weeks,(function(t,n){return a("el-checkbox",{key:t,attrs:{label:n}},[e._v(e._s(t))])})),1)],1)],1)],2)]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.save(1)}}},[e._v(e._s(e.$t("productmanage.option.ForSale")))]),a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.save(2)}}},[e._v(e._s(e.$t("productmanage.option.NotForSale")))])],1)],1)],1)},Fg=[],Ug={data:function(){return{date:[{value:""}],checkAll:!0,isIndeterminate:!0,fromData:{checkedWeeks:[],value:[]},pickerOptions:{disabledDate:function(e){return e.getTime()0&&t0)){var a={};e.forEach((function(e){a["price".concat(e.code)]=0,a["originalPrice".concat(e.code)]=0})),this.form=Object(F["a"])(Object(F["a"])({},this.form),a)}},editableTabs:{handler:function(e,t){this.$emit("name",e)},deep:!0},"form.limitPurchasedDateRange":function(e,t){e&&e.length?(this.form.limit_purchased_start_date=Vt()(e[0]).format("YYYY-MM-DD"),this.form.limit_purchased_end_date=Vt()(e[1]).format("YYYY-MM-DD")):(this.form.limit_purchased_start_date=null,this.form.limit_purchased_end_date=null)},selectedDate:function(){this.updateSelectedDateStatus()}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{validTimeIntervals:function(){return[{label:"5".concat(this.$t("min")),value:5},{label:"10".concat(this.$t("min")),value:10},{label:"15".concat(this.$t("min")),value:15},{label:"20".concat(this.$t("min")),value:20},{label:"25".concat(this.$t("min")),value:25},{label:"30".concat(this.$t("min")),value:30},{label:"35".concat(this.$t("min")),value:35},{label:"40".concat(this.$t("min")),value:40},{label:"45".concat(this.$t("min")),value:45},{label:"50".concat(this.$t("min")),value:50},{label:"55".concat(this.$t("min")),value:55},{label:"60".concat(this.$t("min")),value:60},{label:"65".concat(this.$t("min")),value:65},{label:"70".concat(this.$t("min")),value:70},{label:"75".concat(this.$t("min")),value:75},{label:"80".concat(this.$t("min")),value:80},{label:"85".concat(this.$t("min")),value:85},{label:"90".concat(this.$t("min")),value:90},{label:"95".concat(this.$t("min")),value:95},{label:"100".concat(this.$t("min")),value:100},{label:"105".concat(this.$t("min")),value:105},{label:"110".concat(this.$t("min")),value:110},{label:"115".concat(this.$t("min")),value:115},{label:"120".concat(this.$t("min")),value:120}]},bookNDaysBeforeBookDates:function(){return[{label:"".concat(this.$t("{day} Day",{day:0})),value:0},{label:"".concat(this.$t("{day} Day",{day:1})),value:1},{label:"".concat(this.$t("{day} Days",{day:2})),value:2},{label:"".concat(this.$t("{day} Days",{day:3})),value:3},{label:"".concat(this.$t("{day} Days",{day:4})),value:4},{label:"".concat(this.$t("{day} Days",{day:5})),value:5}]},rules:function(){var e=this,t={sn:[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],supplier:[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],images:[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],sellPeriod:[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],pois_ids:[{type:"array",required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],is_self_purchased:[{type:"boolean",required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}]};switch(0===this.form.purchase_type&&(t.price=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],t.minBuy=[{required:!0,message:this.$t("productmanage.common.RequiredAndMustBeMin"),trigger:"change"},{validator:this.validatePass1,trigger:"change"}],t.maxBuy=[{required:!0,message:this.$t("productmanage.common.RequiredAndMustBeMax"),trigger:"change"},{validator:this.validatePass2,trigger:"change"}],t.priceHKD=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}],t.priceTWD=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}],t.priceUSD=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}],t.priceCNY=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}],t.priceKRW=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}],t.originalPriceHKD=[{validator:this.validatePass5,trigger:"change"}],t.originalPriceTWD=[{validator:this.validatePass5,trigger:"change"}],t.originalPriceUSD=[{validator:this.validatePass5,trigger:"change"}],t.originalPriceCNY=[{validator:this.validatePass5,trigger:"change"}],t.originalPriceKRW=[{validator:this.validatePass5,trigger:"change"}],t.costPrice=[{validator:this.validatePass5,trigger:"change"}]),0===this.stockType&&(t.stockNum=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:this.validatePass,trigger:"change"}]),Re[this.form.valid_type]){case"Specific period":t.vaildPeriod=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}];break;case"Specific date":t.book_n_days_before_book_date=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}];break;case"Specific time":var a=Vt()(this.form.valid_start_time,"HH:mm"),n=Vt()(this.form.valid_end_time,"HH:mm"),r=function(t,r,o){a.isValid()&&n.isValid()&&a>=n?o(new Error(e.$t("End time must after Start time"))):o()};t.book_n_days_before_book_date=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}],t.valid_start_time=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:r,message:this.$t("End time must after Start time"),trigger:"change"}],t.valid_end_time=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"},{validator:r,trigger:"change"}],t.valid_time_interval=[{required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}];break}return this.form.is_limit_purchased&&(t.limit_purchased_num=[{required:!0,validator:this.validatePass6,trigger:"change"}],t.limitPurchasedDateRange=[{type:"array",required:!0,message:this.$t("productmanage.common.ItsRequired"),trigger:"change"}]),t},voucherTypes:function(){var e=this;return Object.keys(me).map((function(t){return{label:e.$t(me[t]),value:t}}))},getPageList:function(){var e=this,t=[];return this.tagPageList.forEach((function(a){e.editableTabs.findIndex((function(e){return e.name===a}))>-1||t.push(a)})),t},getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id}}));return a}},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]},radios:function(){var e=this.$i18n.messages.en_US.productmanage.status,t=Object.keys(e);return"Delete|DET"===t.slice(-1)[0]&&t.pop(),t.map((function(t){return{label:e[t],value:t.split("|")[1]}}))},saleStatus:function(){var e={};return this.availableBookDates&&this.availableBookDates.length&&this.availableBookDates.forEach((function(t){e[t.date]=1})),this.dateRank.forEach((function(t){if(t.date)e[t.date]=t.status;else if(t.start_date&&t.end_date){var a=Vt()(t.start_date),n=Vt()(t.end_date),r=n.diff(a,"days");a.add("days",-1);for(var o=0;o<=r;o++){var i=a.add("days",1),s=i.weekday();s>0?s-=1:s=6,t.weeks.indexOf(s)>-1&&(e[i.format("YYYY-MM-DD")]=t.status)}}})),e},getPrice:function(){var e=this;return this.currencies.map((function(t){return{text:e.$t(t.code),value:t.code}}))}}),methods:{sychronizePrice:function(){if(this.currencies.length){var e=this.form.priceHKD;if(e){var t={},a=this;this.currencies.forEach((function(a){var n="price".concat(a.code);"HKD"!==n&&(t[n]="KRW"===n?+(e*a.internal_ex_rate).toFixed(0):+(e*a.internal_ex_rate).toFixed(2))})),a.form=Object(F["a"])(Object(F["a"])({},a.form),t)}}},sychronizeOrignalPrice:function(){if(this.currencies.length){var e=this.form.originalPriceHKD;if(e){var t={},a=this;this.currencies.forEach((function(a){var n="originalPrice".concat(a.code);"HKD"!==n&&(t[n]="KRW"===n?+(e*a.internal_ex_rate).toFixed(0):+(e*a.internal_ex_rate).toFixed(2))})),a.form=Object(F["a"])(Object(F["a"])({},a.form),t)}}},getCurrentName:function(){var e=this,t=this.currencies.find((function(t){return t.code===e.currencyType}));return t?this.$t(t.code):""},getCurrentSymbol:function(){var e=this,t=this.currencies.find((function(t){return t.code===e.currencyType}));return t?t.symbol:""},getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},fillDefaultContent:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getDefaultContent("RTR");case 2:for(a=t.sent,e.defaultContent=a,n=0;n0){Object.assign(this.currentImageItem.captions,this.imageCaptions);var a=this.filstList.find((function(t){return t.uuid===e.currentImageItem.uuid}));a&&Object.assign(a.captions,this.imageCaptions),this.currentImageItem=this.$refs.upload.uploadFiles[t-1],this.dialogImageUrl=this.currentImageItem.cloundUrl,Object.assign(this.imageCaptions,this.currentImageItem.captions)}},onImageArrowRight:function(){var e=this,t=this.$refs.upload.uploadFiles.findIndex((function(t){return t.uuid===e.currentImageItem.uuid}));if(t8?e.getMonth()+1:"0"+(e.getMonth()+1))+"-"+(e.getDate()>9?e.getDate():"0"+e.getDate())},validatePosition:function(e,t,a){t||a(),/^-?[0-9]+(\.[0-9]{1,4})*,-?[0-9]+(\.[0-9]{1,4})*$/.test(t)||a(new Error(this.$t("Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths"))),a()},validatePass:function(e,t,a){t<=0||isNaN(t)||"number"!==typeof(t-0)?a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0"))):a()},validatePass1:function(e,t,a){!(t>0)||this.form.maxBuy&&+t>this.form.maxBuy?a(new Error(this.$t("productmanage.common.RequiredAndMustBeMin"))):this.form.is_limit_purchased&&this.form.limit_purchased_num>0&&t>this.form.limit_purchased_num?a(new Error(this.$t("Can not greater than maximun purchase per account"))):a()},validatePass2:function(e,t,a){!(t>0)||this.form.minBuy&&+t0&&t>this.form.limit_purchased_num?a(new Error(this.$t("Can not greater than maximun purchase per account"))):a()},validatePass5:function(e,t,a){null!==t&&""!==t&&void 0!==t&&(t<=0||isNaN(t)||"number"!==typeof(t-0))?a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0"))):a()},validatePass6:function(e,t,a){t<=0||isNaN(t)||"number"!==typeof(t-0)?a(new Error(this.$t("productmanage.common.MustBeDigitGreaterThan0"))):0===this.form.purchase_type&&t"),u+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===c?(u||(u="保存失败!以下有必填项未填
"),u+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===c&&(u||(u="保存失敗!以下有必填項未填
"),u+="[".concat(e.$t("lang."+t.name),"]
"))})),e.$message({dangerouslyUseHTMLString:!0,message:u,type:"error"})}else{e.isSend=!0;var d=e.$i18n.locale,p="",m={sn:e.$t("productmanage.common.SN"),supplier:e.$t("productmanage.common.Vendor"),sellPeriod:e.$t("Sell perd"),pois_ids:e.$t("Related Rest"),images:e.$t("productmanage.common.Image"),is_self_purchased:e.$t("TF direct")};switch(e.form.is_limit_purchased&&(m.limit_purchased_num=e.$t("Max buy per ACCT")),Re[e.form.valid_type]){case"Specific period":a.hasOwnProperty("vaildPeriod")&&(m.vaildPeriod=e.$t("Vaild perd"));break;case"Specific date":a.hasOwnProperty("book_n_days_before_book_date")&&(m.book_n_days_before_book_date=e.$t("Book ahead days"));break;case"Specific time":a.hasOwnProperty("book_n_days_before_book_date")&&(m.book_n_days_before_book_date=e.$t("Book ahead days")),a.hasOwnProperty("valid_start_time")&&(m.valid_start_time=e.$t("Start time")),a.hasOwnProperty("valid_end_time")&&(m.valid_end_time=e.$t("End time")),a.hasOwnProperty("valid_time_interval")&&(m.valid_time_interval=e.$t("Interval"));break}for(var f in 0===e.form.purchase_type&&(m.minBuy=e.$t("Min Buy"),m.maxBuy=e.$t("Max Buy"),m.price=e.$t("productmanage.option.SellPrice")),m)if(!("price"===f&&e.form.priceHKD>0&&e.form.priceTWD>0&&e.form.priceUSD>0&&e.form.priceCNY>0&&e.form.priceKRW>0)&&!("limit_purchased_num"===f&&e.form[f]>0&&(0!==e.form.purchase_type||e.form[f]>=e.form.maxBuy))){if(e.form[f]){if(!Array.isArray(e.form[f]))continue;if(e.form[f].length>0)continue}"boolean"!==typeof e.form[f]&&("en_US"===d?(p||(p="Save failed! Some required fields are not filled in
"),p+="[".concat(m[f],"]
")):"zh_CN"===d?(p||(p="保存失败!以下有必填项未填
"),p+="[".concat(m[f],"]
")):"zh_HK"===d&&(p||(p="保存失敗!以下有必填項未填
"),p+="[".concat(m[f],"]
")))}!e.form.is_limit_purchased||e.form.limitPurchasedDateRange&&e.form.limitPurchasedDateRange.length||("en_US"===d?p||(p="Save failed! Some required fields are not filled in
"):"zh_CN"===d?p||(p="保存失败!以下有必填项未填
"):"zh_HK"===d&&(p||(p="保存失敗!以下有必填項未填
")),p+="[".concat(e.$t("Restricted period"),"]
")),e.editableTabs.forEach((function(t,a){if(n[a])return!0;"en_US"===d?(p||(p="Save failed! Some required fields are not filled in
"),p+="[".concat(e.$t("lang."+t.name),"]
")):"zh_CN"===d?(p||(p="保存失败!以下有必填项未填
"),p+="[".concat(e.$t("lang."+t.name),"]
")):"zh_HK"===d&&(p||(p="保存失敗!以下有必填項未填
"),p+="[".concat(e.$t("lang."+t.name),"]
"))})),p&&e.$message({dangerouslyUseHTMLString:!0,message:p,type:"error"})}}));case 15:case"end":return t.stop()}}),t)})))()},getVendor:function(){var e=this;this.$api.product.getVendor().then((function(t){e.supplierList=t.map((function(e){return{label:e.name,value:e.id}}))}))},getDetail:function(){var e=this,t={productId:this.$route.query.product_id};this.$api.product.getProductDetail(t).then((function(t){e.handleData(t)}))},formatDate:function(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")},handleData:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s,l,c,u;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(t.editableTabsValue="en_US",!(Object.keys(e).length>0)){a.next=63;break}if(t.form.productId=e.id,t.form.sn=e.sn,t.form.has_remark=e.has_remark,t.form.supplier=(e.supplier||{}).id,t.form.supplier_product_sn=e.supplier_product_sn,e.supplier_additional_info&&(t.form.supplier_link=e.supplier_additional_info.url),t.form.priority=(e.flan||{}).priority,t.form.star_ratings=(e.flan||{}).star_ratings,t.form.views=(e.flan||{}).views-0,e.supporting_provider.forEach((function(e){t.internalPlatforms.findIndex((function(t){return t.value===e}))>-1&&t.form.internalPlatforms.push(e),t.externalPlatforms.findIndex((function(t){return t.value===e}))>-1&&t.form.externalPlatforms.push(e)})),t.form.status=e.status,t.createTime=e.create_dt?t.formatDate(e.create_dt):"",t.updateTime=e.update_dt?t.formatDate(e.update_dt):"",t.form.pois_ids=e.pois.map((function(e){return e.id})),t.form.is_self_purchased=e.is_self_purchased,t.form.is_limit_purchased=e.is_limit_purchased,t.form.limit_purchased_num=e.limit_purchased_num,t.form.limit_purchased_start_date=e.limit_purchased_start_date,t.form.limit_purchased_end_date=e.limit_purchased_end_date,t.form.limit_purchased_start_date||t.form.limit_purchased_end_date?t.form.limitPurchasedDateRange=[t.form.limit_purchased_start_date,t.form.limit_purchased_end_date]:t.form.limitPurchasedDateRange=null,!e.variants.length){a.next=49;break}o=e.variants[e.variants.length-1],t.form.skuId=o.id,t.form.purchase_type=o.purchase_type,t.form.voucher_type=o.voucher_type,t.form.minBuy=o.min_purchase_quantity,t.form.maxBuy=o.max_purchase_quantity,t.form.costPriceCurrency=Object.keys(o.cost)[0],t.form.costPrice=o.cost[t.form.costPriceCurrency],t.currencies.forEach((function(e){t.form["price".concat(e.code)]=o.price[e.code],t.form["originalPrice".concat(e.code)]=o.original_price[e.code]})),o.sell_start_date&&o.sell_end_date&&(t.form.sellPeriod=[Vt()(o.sell_start_date).toDate(),Vt()(o.sell_end_date).toDate()]),-1===o.stock?t.stockType=-1:(t.stockType=0,t.form.stockNum=o.stock),t.form.valid_type=o.valid_type,a.t0=Re[o.valid_type],a.next="Specific period"===a.t0?38:"Specific date"===a.t0?40:"Specific time"===a.t0?42:47;break;case 38:return t.form.vaildPeriod=[Vt()(o.valid_start_dt).toDate(),Vt()(o.valid_end_dt).toDate()],a.abrupt("break",47);case 40:return t.form.book_n_days_before_book_date=o.book_n_days_before_book_date,a.abrupt("break",47);case 42:return t.form.book_n_days_before_book_date=o.book_n_days_before_book_date,o.valid_start_time&&(t.form.valid_start_time=Vt()(o.valid_start_time,"HH:mm:ss").format("HH:mm")),o.valid_end_time&&(t.form.valid_end_time=Vt()(o.valid_end_time,"HH:mm:ss").format("HH:mm")),t.form.valid_time_interval=o.valid_time_interval,a.abrupt("break",47);case 47:t.availableBookDates=o.available_book_dates,t.updateSelectedDateStatus();case 49:return a.next=51,t.remoteMethod("",t.form.pois_ids.join(","));case 51:for(i in t.poiList=(e.data||[]).map((function(e){return Object.keys(e.meta).forEach((function(t){e.meta[t]=e.meta[t].name})),e})),e.details)t.editableTabs.push({title:i,name:i,content:{title:e.details[i].title,comboDetails:e.details[i].meta.description,detailedDescription:e.details[i].meta.detailed_description,seoTitle:e.details[i].meta.seo_title,seoDescription:e.details[i].meta.seo_description,feeInclude:e.details[i].meta.fee_include,feeNotInclude:e.details[i].meta.fee_not_include,useTime:e.details[i].meta.use_time,useRange:e.details[i].meta.use_range,ruleContent:e.details[i].meta.rules}});Object.keys(e.details).length>0&&(t.editableTabsValue=Object.keys(e.details)[0]),s="",l=e.images.base.title,c=e.images.base.backgrounds.map((function(t,a){0===a&&(s=t);var n={en_US:"",zh_CN:"",zh_HK:"",ko_KR:""};return e.images.captions&&e.images.captions.backgrounds&&e.images.captions.backgrounds.length>a&&Object.assign(n,e.images.captions.backgrounds[a]),{uuid:Kg++,cloundUrl:t,url:t,captions:n}})),l&&l!==s&&(u={en_US:"",zh_CN:"",zh_HK:"",ko_KR:""},e.images.captions&&e.images.captions.title&&Object.assign(u,e.images.captions.title),c.unshift({uuid:Kg++,cloundUrl:e.images.base.title,url:e.images.base.title,captions:u})),(n=t.filstList).push.apply(n,Object(Xc["a"])(c)),(r=t.$refs.upload.uploadFiles).push.apply(r,Object(Xc["a"])(c)),t.handleImage(),a.next=64;break;case 63:t.editableTabs.push({title:"en_US",name:"en_US",content:Object.assign({},{title:"",comboDetails:"",detailedDescription:"",seoTitle:"",seoDescription:"",feeInclude:"",feeNotInclude:"",useTime:"",useRange:"",ruleContent:""})});case 64:t.editableTabs.map((function(e){e.content.name=e.content.name?e.content.name.split("|"):[""]})),t.$emit("name");case 66:case"end":return a.stop()}}),a)})))()},handlePrice:function(e){this.currencyType=e},handleDialog:function(){this.dialogRankDate=!0},onSelectedDateStatusChange:function(e){var t=Vt()(this.selectedDate).format("YYYY-MM-DD"),a=this.dateRank.find((function(e){return e.date===t}));a?a.status=e:this.dateRank.push({date:t,status:e})}},beforeMount:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getCurrencies();case 2:"add"===e.$route.query.type?(e.$set(e.rules,"rating",[{required:!0,validator:e.validatePass,trigger:"blur"}]),e.handleData({}),e.fillDefaultContent()):e.getDetail(),e.getVendor(),window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))}));case 5:case"end":return t.stop()}}),t)})))()}},Wg=Yg,Gg=(a("abfd"),a("cbdf"),Object(R["a"])(Wg,Og,Ig,!1,null,"9fc830b4",null)),Qg=Gg.exports,Jg={data:function(){return{activeName:"basic",ProductName:"",arr:[]}},components:{BasicInfo:Qg,CouponsModule:hd,VoucherModule:kd},computed:{isCouponTabDisabled:function(){return"add"===this.$route.query.type},isVoucherTabDisabled:function(){return"add"===this.$route.query.type},getProductName:function(){var e=this.$i18n.locale;if(this.arr&&0!==this.arr.length){var t="";return this.arr.forEach((function(a){a.name===e&&(t=a.content.title)})),t}return""}}},Xg=Jg,Zg=(a("68c2"),Object(R["a"])(Xg,Dg,Pg,!1,null,"5b9a2547",null)),eh=Zg.exports,th=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"order-list-page"},[a("iframe",{attrs:{src:e.url,frameborder:"0"}})])},ah=[],nh={name:"OrderManage",data:function(){return{url:""}},created:function(){this.url=this.$env.getOrderManageUrl()}},rh=nh,oh=(a("df9b"),Object(R["a"])(rh,th,ah,!1,null,"2dc7e5cc",null)),ih=oh.exports,sh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"reserve-list"},[a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.reserveList,"tooltip-effect":"dark",stripe:""}},[a("el-table-column",{attrs:{prop:"survey.supplier.name",label:e.$t("Rest. Name")}}),a("el-table-column",{attrs:{prop:"survey.supplier.contact_no",label:e.$t("Rest. Contact No")}}),a("el-table-column",{attrs:{prop:"survey.reservation_dt",width:"150px",label:e.$t("Reservation date")},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.survey.reservation_dt.length?a("div",[e._v(e._s(t.row.survey.reservation_dt[0]))]):e._e(),t.row.survey.reservation_dt.length>1?a("div",[e._v(e._s(t.row.survey.reservation_dt[1]))]):e._e()]}}])}),a("el-table-column",{attrs:{prop:"survey.reservation_dt",width:"150px",label:e.$t("Create date")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("date")(t.row.create_dt)))])]}}])}),a("el-table-column",{attrs:{prop:"survey.consumer.name",width:"120px",label:e.$t("User Name")}}),a("el-table-column",{attrs:{prop:"survey.consumer.gender",width:"80px",label:e.$t("Gender")}}),a("el-table-column",{attrs:{prop:"survey.consumer.email",label:e.$t("Email")}}),a("el-table-column",{attrs:{prop:"survey.consumer.contact_no",label:e.$t("Contact No")}}),a("el-table-column",{attrs:{prop:"survey.adult_num",width:"80px",label:e.$t("Adult")}}),a("el-table-column",{attrs:{prop:"survey.child_num",width:"80px",label:e.$t("Child")}}),a("el-table-column",{attrs:{prop:"survey.comment",label:e.$t("Note")}}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)])},lh=[],ch={data:function(){return{reserveList:[],loading:!1,currentPage:1,total:0,pageSize:20}},computed:{productStatus:function(){var e=this,t=["DFT","ACT","REV","DCT"];return Object.keys(ue).filter((function(e){return t.indexOf(e)>=0})).map((function(t){return{text:e.$t(ue[t]),value:t}}))}},created:function(){this.getReserveList()},methods:{onPageSizeChange:function(e){this.pageSize=e,this.getReserveList()},onCurrentPageChange:function(e){this.currentPage=e,this.getReserveList()},getReserveList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={ordering:"-id",page_size:e.pageSize,page:e.currentPage},e.loading=!0,t.prev=2,t.next=5,e.$api.common.getReservations(a);case 5:n=t.sent,e.reserveList=n.results,e.total=n.count;case 8:return t.prev=8,e.loading=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[2,,8,11]])})))()}}},uh=ch,dh=(a("efd0"),Object(R["a"])(uh,sh,lh,!1,null,"4c381678",null)),ph=dh.exports,mh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"product-list"},[a("SeachForm",{on:{change:e.onSearchChange,export:e.onExport}}),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.searchLoading||e.exportLoading,expression:"searchLoading || exportLoading"}],attrs:{data:e.mappedOrderList,"header-cell-class-name":"order-table-header","cell-class-name":"order-row-cell","tooltip-effect":"","span-method":e.orderRowSpanMethod},on:{"sort-change":e.onSortChange}},[a("el-table-column",{attrs:{align:"left",label:e.$t("Booking & supplier"),width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"order-row"},[a("div",{staticClass:"order-row-header"},[a("div",{staticClass:"order-id"},[e._v(e._s(e.$t("Order ID"))+": "+e._s(t.row.sn))]),a("div",{staticClass:"order-create-time"},[e._v(e._s(e.$t("Create time"))+": "+e._s(e._f("date")(t.row.create_dt)))]),a("div",{class:"order-status order-status--"+t.row.statusId},[e._v(e._s(t.row.status))])]),a("el-table",{attrs:{data:e.mappedBookingList(t.row),border:"","row-class-name":"order-detail-row",width:"100%","show-header":!1,"span-method":function(a){return e.detailRowSpanMethod(a,t.row.product_bookings)}}},[a("el-table-column",{attrs:{align:"left",label:e.$t("Booking & supplier"),width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(t.row.sn))]),a("div",{class:"booking-status--"+t.row.statusId},[e._v(e._s(t.row.status))]),a("div",{staticClass:"booking-platform"},[e._v(e._s(t.row.supplier&&t.row.supplier.name))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"left",label:e.$t("Product name & type"),"min-width":"170"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"product-name",attrs:{title:e._f("lang")(t.row.productTitle,e.$i18n.locale)}},[a("el-link",{attrs:{type:"primary",href:t.row.productUrl,target:"_blank"}},[e._v(e._s(e._f("lang")(t.row.productTitle,e.$i18n.locale))),a("i",{staticClass:"el-icon-link"})])],1),a("div",{staticClass:"booking-product-type"},[e._v(" "+e._s(t.row.typeAndTags)+" ")])]}}],null,!0)}),a("el-table-column",{attrs:{align:"left",label:e.$t("Item detail"),width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.options,(function(t,n){return a("div",{key:n,staticClass:"order-item-detail"},[a("div",{staticClass:"order-option-title",attrs:{title:t.title}},[e._v(e._s(e._f("lang")(t.title,e.$i18n.locale)))]),e._l(t.subOptions,(function(t,n){return a("div",{key:n,staticClass:"order-item-detail-option"},[e._v(e._s(e._f("lang")(t.title,e.$i18n.locale))+" * "+e._s(t.count))])})),t.date?a("div",{staticClass:"order-item-date",attrs:{title:t.date}},[e._v(e._s(t.date))]):t.book_dt?a("div",{staticClass:"order-item-date",attrs:{title:t.book_dt}},[e._v(e._s(t.book_dt))]):e._e()],2)}))}}],null,!0)}),a("el-table-column",{attrs:{align:"left",label:e.$t("Customer info"),width:"300"}},[[e.getOrderUserInfo(t.row)?a("div",[e.getOrderUserInfo(t.row).user_first_name||e.getOrderUserInfo(t.row).user_last_name?a("div",[e.getOrderUserInfo(t.row).user_first_name?a("span",[e._v(e._s(e.getOrderUserInfo(t.row).user_first_name)+" ")]):e._e(),e.getOrderUserInfo(t.row).user_last_name?a("span",[e._v(e._s(e.getOrderUserInfo(t.row).user_last_name)+" ")]):e._e()]):e.getOrderUserInfo(t.row).user_name?a("div",[e._v(e._s(e.getOrderUserInfo(t.row).user_name))]):e._e(),e.getOrderUserInfo(t.row).user_email?a("div",[e._v(e._s(e.getOrderUserInfo(t.row).user_email))]):e._e(),e.getOrderUserInfo(t.row).user_phone?a("div",[e._v(e._s(e.getOrderUserInfo(t.row).user_phone))]):e._e()]):e._e()]],2),a("el-table-column",{attrs:{align:"left",label:e.$t("Paid amount"),width:"120"},scopedSlots:e._u([{key:"default",fn:function(n){return[a("div",{staticClass:"paid-amount"},[e._v(e._s(t.row.currency)+" "+e._s(n.row.paid_amount))])]}}],null,!0)})],1),a("div",{staticClass:"order-row-footer"},[a("div",{staticClass:"order-item-count"},[e._v(" "+e._s(1===t.row.itemsCount?e.$t("{0} item",[t.row.itemsCount]):e.$t("{0} items",[t.row.itemsCount]))+" ")]),a("div",{staticClass:"order-user-address"},[e.isDeliveryOrder(t.row)?["PCK"===t.row.meta.picking_type?a("span",[e._v(" "+e._s(e.$t("Pickup at"))+" "+e._s(t.row.user.pickupAddress)+" ")]):a("span",[e._v(" "+e._s(e.$t("Ship to"))+" "+e._s(t.row.user.address&&t.row.user.address.detail)+" "+e._s(t.row.user.address&&t.row.user.address.postcode)+" ")])]:e._e()],2),a("div",{staticClass:"order-detail-link"},[a("el-link",{attrs:{type:"primary",href:"/order-manage/order/detail/"+t.row.id,target:"_blank"}},[e._v(e._s(e.$t("Order detail")))])],1),a("div",{staticClass:"order-subtotal"},[e._v(e._s(t.row.currency)+" "+e._s(t.row.paid_amount))])])],1)]}}])},[a("template",{slot:"header"},[e._v(e._s(e.$t("Booking & supplier")))])],2),a("el-table-column",{attrs:{align:"left",label:e.$t("Product name & type"),"min-width":"170"}}),a("el-table-column",{attrs:{align:"left",label:e.$t("Item detail"),width:"300"}}),a("el-table-column",{attrs:{align:"left",label:e.$t("Customer info"),width:"300"}}),a("el-table-column",{attrs:{align:"left",label:e.$t("Paid amount"),width:"120"}})],1)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40,100],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},fh=[],gh=(a("0481"),a("4069"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"order-search-bar"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,size:"small",model:e.formModel,rules:e.productIdRules}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Order date"),"end-placeholder":e.$t("Order date")},model:{value:e.formModel.orderDate,callback:function(t){e.$set(e.formModel,"orderDate",t)},expression:"formModel.orderDate"}})],1),a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Paid date"),"end-placeholder":e.$t("Paid date")},model:{value:e.formModel.paidDate,callback:function(t){e.$set(e.formModel,"paidDate",t)},expression:"formModel.paidDate"}})],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Order status"),multiple:"","collapse-tags":"",clearable:!1},model:{value:e.formModel.orderStatus,callback:function(t){e.$set(e.formModel,"orderStatus",t)},expression:"formModel.orderStatus"}},e._l(e.orderStatusList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Booking status"),multiple:"","collapse-tags":"",clearable:!1},model:{value:e.formModel.bookingStatus,callback:function(t){e.$set(e.formModel,"bookingStatus",t)},expression:"formModel.bookingStatus"}},e._l(e.bookingStatuses,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Platform"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.platforms,callback:function(t){e.$set(e.formModel,"platforms",t)},expression:"formModel.platforms"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Device"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.device,callback:function(t){e.$set(e.formModel,"device",t)},expression:"formModel.device"}},[a("el-option",{attrs:{label:e.$t("Windows"),value:"Windows"}}),a("el-option",{attrs:{label:e.$t("macOS"),value:"macOS"}}),a("el-option",{attrs:{label:e.$t("Other-Desktop"),value:"Other-Desktop"}}),a("el-option",{attrs:{label:e.$t("Android"),value:"Android"}}),a("el-option",{attrs:{label:e.$t("iOS"),value:"iOS"}}),a("el-option",{attrs:{label:e.$t("Other-Mobile"),value:"Other-Mobile"}})],1)],1),a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("Supplier"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.supplier,callback:function(t){e.$set(e.formModel,"supplier",t)},expression:"formModel.supplier"}},e._l(e.supplierList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-cascader",{attrs:{options:e.mappedProductTypes,placeholder:e.$t("Product type and category"),clearable:!0,props:{multiple:!0,expandTrigger:"hover"},"collapse-tags":""},model:{value:e.formModel.category,callback:function(t){e.$set(e.formModel,"category",t)},expression:"formModel.category"}})],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{attrs:{slot:"prepend"},on:{change:e.onKeywordTypeChange},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},e._l(e.mappedSearchType,(function(t,n){return a("el-option-group",{key:n},e._l(t.options,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)})),1)],1)],1)],1),a("el-form",{attrs:{inline:!0,size:"small"}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Travel date"),"end-placeholder":e.$t("Travel date")},model:{value:e.formModel.travelDate,callback:function(t){e.$set(e.formModel,"travelDate",t)},expression:"formModel.travelDate"}})],1),a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Refund date"),"end-placeholder":e.$t("Refund date")},model:{value:e.formModel.refundDate,callback:function(t){e.$set(e.formModel,"refundDate",t)},expression:"formModel.refundDate"}})],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Payment method"),clearable:!1,multiple:"","collapse-tags":""},model:{value:e.formModel.paymentType,callback:function(t){e.$set(e.formModel,"paymentType",t)},expression:"formModel.paymentType"}},e._l(e.paymentTypes,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{filterable:"",placeholder:e.$t("Country/Region"),clearable:!1},on:{change:e.onCountryChnage},model:{value:e.formModel.product__pog_countries__id,callback:function(t){e.$set(e.formModel,"product__pog_countries__id",t)},expression:"formModel.product__pog_countries__id"}},e._l(e.mappedCountries,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.cityFetching,expression:"cityFetching"}],attrs:{placeholder:e.$t("City"),filterable:"",clearable:!1,multiple:"","collapse-tags":""},on:{change:e.onCityChange},model:{value:e.formModel.product__pog_cities__id,callback:function(t){e.$set(e.formModel,"product__pog_cities__id",t)},expression:"formModel.product__pog_cities__id"}},e._l(e.mappedCities,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Hide test order")},model:{value:e.formModel.hideTestOrder,callback:function(t){e.$set(e.formModel,"hideTestOrder",t)},expression:"formModel.hideTestOrder"}},e._l(e.mappedFilterMore,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{attrs:{size:"small"},on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e(),a("div",{staticClass:"button-export"},[a("el-button",{attrs:{type:"text",size:"small"},on:{click:e.onExport}},[a("i",{staticClass:"el-icon-download"}),e._v(" "+e._s(e.$t("Export"))+" ")])],1)],1)],1)],1)}),hh=[],_h=a("3835"),vh={orderDate:null,paidDate:null,orderStatus:[],bookingStatus:[],platforms:[],supplier:[],category:[],status:[],keyWord:"",keyWordType:"id",travelDate:null,refundDate:null,product__pog_countries__id:null,product__pog_cities__id:[],hideTestOrder:"True",device:[],paymentType:[]},bh={data:function(){return{formModel:Object.assign({},vh),cities:[],supplierList:[],productTypes:[],showMoreFilter:!0,cityFetching:!1}},mounted:function(){this.initSearchBar()},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["d"])(["countries"])),Object(U["c"])(["platforms"])),{},{paymentTypes:function(){var e=this;return Object.keys(Le).map((function(t){return{value:t,label:e.$t(Le[t])}}))},productIdRules:function(){var e=this,t={},a=function(t,a,r){/^\s*\d*\s*$/.test(a)?r():r(new Error(e.$t("{0} must be number",[e.$t("".concat(he[n]))])))},n=this.formModel.keyWordType;return"product_id"===n&&(t.keyWord=[{validator:a,trigger:"change"},{validator:a,trigger:"blur"}]),t},orderStatusList:function(){var e=this,t=Object.keys(fe);return t.map((function(t){return{label:e.$t(fe[t]),value:t}}))},bookingStatuses:function(){var e=this,t=Object.keys(ge);return t.map((function(t){return{label:e.$t(ge[t]),value:t}}))},mappedCountries:function(){var e=this;return this.countries.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},mappedCities:function(){var e=this;return this.cities.map((function(t){return{value:t.id,label:(t.details[e.$i18n.locale]||{}).title}}))},mappedFilterMore:function(){return[{value:"True",label:this.$t("Hide test order")},{value:"False",label:this.$t("Show test order")}]},mappedProductTypes:function(){var e=this;return this.productTypes.map((function(t){return{label:t.name[e.$i18n.locale],value:pe[t.name["en_US"]],children:t.children.map((function(t){return{label:t.name[e.$i18n.locale],value:t.id}}))}}))},mappedSearchType:function(){var e=this;return[{options:Object.keys(he).map((function(t){return{value:t,label:e.$t("".concat(he[t]))}}))},{options:Object.keys(_e).map((function(t){return{value:t,label:e.$t("".concat(_e[t]))}}))}]},hasSearchData:function(){return Object.keys(this.searchData).length>0},isSearchButtonEnable:function(){return Object.keys(this.searchData).length>=0},searchData:function(){var e={},t=this.formModel,a=t.orderDate,n=t.paidDate,r=t.bookingStatus,o=t.orderStatus,i=t.platforms,s=t.supplier,l=t.category,c=t.keyWord,u=t.keyWordType,d=t.travelDate,p=t.refundDate,m=t.product__pog_countries__id,f=t.product__pog_cities__id,g=t.hideTestOrder,h=t.device,_=t.paymentType;if(a){var v=Object(_h["a"])(a,2),b=v[0],y=v[1];Object.assign(e,{order_start_dt:Vt()(b).format("YYYY-MM-DD"),order_end_dt:Vt()(y).format("YYYY-MM-DD")})}if(n){var C=Object(_h["a"])(n,2),k=C[0],w=C[1];Object.assign(e,{paid_start_dt:Vt()(k).format("YYYY-MM-DD"),paid_end_dt:Vt()(w).format("YYYY-MM-DD")})}if(o&&o.length&&(e.status=o.join(",")),r&&r.length&&(e.booking_status=r.join(",")),i&&i.length&&(e.platforms=i.join(",")),s&&s.length&&(e.supplier_id=s.join(",")),l&&l.length&&(e.type__in=l.map((function(e){return e[0]})).join(","),e.categories_id__in=l.filter((function(e){return[pe.Hotel,pe.Restaurant].indexOf(e[0])<0})).map((function(e){return e[1]})).join(",")),c&&(e[u]=c),d){var $=Object(_h["a"])(d,2),S=$[0],x=$[1];Object.assign(e,{travel_start_dt:Vt()(S).format("YYYY-MM-DD"),travel_end_dt:Vt()(x).format("YYYY-MM-DD")})}if(p){var T=Object(_h["a"])(p,2),D=T[0],P=T[1];Object.assign(e,{refund_start_dt:Vt()(D).format("YYYY-MM-DD"),refund_end_dt:Vt()(P).format("YYYY-MM-DD")})}return m&&(e.product__pog_countries__id=m),f&&f.length&&(e.product__pog_cities__id=f.join(",")),"True"===g&&(e.is_test_order="False"),h&&h.length&&(e.device=h.join(",")),_&&_.length&&(e.payment_type=_.join(",")),e}}),methods:{onKeywordTypeChange:function(){this.$refs.searchForm.clearValidate()},initSearchBar:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:a=e.getSearchBarStatus(),Object.assign(e.formModel,a),e.$nextTick(Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a||(e.formModel.keyWord="",e.$refs.searchForm.clearValidate()),e.onSearch();case 5:case"end":return t.stop()}}),t)}))));case 3:case"end":return t.stop()}}),t)})))()},validateForm:function(){var e=this;return new Promise((function(t){e.$refs.searchForm.validate((function(e){t(!!e)}))}))},getSearchBarStatus:function(){var e=null;try{e=JSON.parse(window.localStorage.getItem("order-search"))}catch(t){this.saveSearchBarStatus(null)}return e},saveSearchBarStatus:function(e){window.localStorage.setItem("order-search",JSON.stringify(e))},getVendors:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.product.getVendor();case 2:a=t.sent,e.supplierList=a.map((function(e){return{label:e.name,value:e.id}}));case 4:case"end":return t.stop()}}),t)})))()},getCities:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.cityFetching=!0,t.prev=1,t.next=4,e.$api.pog.getCities(e.formModel.product__pog_countries__id,1e3);case 4:a=t.sent,e.cities=a.results;case 6:return t.prev=6,e.cityFetching=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},getTreeList:function(){var e=this,t={depth:1,status:"ACT"};this.$api.category.getTree(t).then((function(t){e.productTypes=t.results}))},onCountryChnage:function(){this.cities=[],this.getCities(),this.onSearch()},onCityChange:function(){this.onSearch()},onClearClick:function(){Object.assign(this.formModel,vh),this.onSearch()},onSearch:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a&&(e.saveSearchBarStatus(e.formModel),e.$emit("change",e.searchData));case 4:case"end":return t.stop()}}),t)})))()},onExport:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$emit("export",e.searchData);case 1:case"end":return t.stop()}}),t)})))()}},created:function(){this.getVendors(),this.getTreeList()},watch:{"formModel.product__pog_countries__id":function(){this.formModel.product__pog_cities__id=[]},isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()}}},yh=bh,Ch=(a("73fe"),Object(R["a"])(yh,gh,hh,!1,null,"122c0402",null)),kh=Ch.exports,wh={components:{SeachForm:kh},data:function(){return{orderList:[],searchLoading:!1,exportLoading:!1,searchData:{is_test_order:"False"},currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{mappedOrderList:function(){var e=this;return this.orderList.map((function(t){var a=t.id,n=t.sn,r=t.create_dt,o=t.product_bookings,i=t.requested_amount,s=t.paid_amount,l=t.total_amount,c=t.meta,u=t.user_detail,d=c||{},p=d.user_first_name,m=d.user_last_name,f=d.user_gender,g=d.user_email,h=d.user_phone,_=d.ko_KR_address,v=d.pickup_address,b=u||{},y=b.first_name,C=b.last_name,k=b.gender,w=b.email,$=b.phone,S=o.map((function(e){var t=e.scope;return"TV"===t?e.snapshot.options.map((function(e){return e.sub_options.flat()})).flat():[e.snapshot.variant]})).flat().reduce((function(e,t){return e+(t.count||1)}),0);return{id:a,sn:n,meta:c,create_dt:r,statusId:t.status,status:e.$t(fe[t.status]),product_bookings:o,currency:t.currency_detail.symbol,requested_amount:i,paid_amount:s,total_amount:l,itemsCount:S,user:{first_name:p||y,last_name:m||C,gender:f||k,email:g||w,phone:h||$,address:_&&_.address,pickupAddress:v&&v.address&&v.address.detail,provider:u&&u.provider}}}))}}),methods:{getOrderUserInfo:function(e){if(!e)return null;var t=e.meta,a=e.user_detail,n=t||{},r=n.user_first_name,o=n.user_last_name,i=n.user_gender,s=n.user_email,l=n.user_phone,c=n.country_code,u=n.country_name,d=n.user_name,p=a||{},m=p.first_name,f=p.last_name,g=p.gender,h=p.email,_=p.phone,v=p.country_code,b=p.country_name,y=p.provider;return{user_first_name:r||m,user_last_name:o||f,user_gender:i||g,user_email:s||h,user_phone:l||_,user_country_code:c||v,user_country_name:u||b,user_name:d,provider:y}},goDetail:function(e){this.$router.push({name:"OrderDetail",params:{id:e}})},isDeliveryOrder:function(e){return e.product_bookings.some((function(e){return"DEI"===e.snapshot.product.type}))},mappedBookingList:function(e){var t=this;return e&&e.product_bookings?e.product_bookings.map((function(a){var n=a.id,r=a.scope,o=a.sn,i=a.snapshot,s=a.product,l=a.status,c=a.paid_amount,u=a.total_amount,d=a.currency,p={id:n,sn:o,status:t.$t(ge[l]),statusId:l,total_amount:u,paid_amount:c};s&&(p.supplier=s.supplier,p.tags=(s.categories||[]).map((function(e){return t.$options.filters.lang(e.name,t.$i18n.locale)})).join(","));var m=i.product;if(m&&(p.productTitle=m.title,p.type=t.$t(de[m.type]),p.productId=m.id),p.typeAndTags=[p.type,p.tags].filter((function(e){return e})).join(" - "),"EC"===r&&"RTR"===m.type&&i.variant){if(p.options=[{title:{},voucher_type:"RTR",subOptions:[{count:i.variant.count}]}],i.variant.book_dt)switch(i.variant.valid_type){case 1:p.options[0].book_dt=Vt()(i.variant.book_dt).format("YYYY-MM-DD");break;case 2:p.options[0].book_dt=Vt()(i.variant.book_dt).format("YYYY-MM-DD HH:mm");break}if(i.booking_at){var f=i.booking_at,g=f.book_dt,h=f.book_time;g&&h?p.options[0].book_dt=Vt()("".concat(Vt()(g).format("YYYY-MM-DD")," ").concat(h)).format("YYYY-MM-DD HH:mm"):g?p.options[0].book_dt=Vt()("".concat(g)).format("YYYY-MM-DD"):h&&(p.options[0].book_dt=Vt()("".concat(h)).format("HH:mm")),p.options[0].book_dt&&delete p.options[0].date}}else{var _=i.options;_&&_.length?(p.options=_.map((function(e){var t=e.sub_options,a=e.details,n=e.voucher_type,r=[e.book_dt,e.end_dt].filter((function(e){return e})).map((function(e){return Vt()(e).format("YYYY-MM-DD")})),o={};return Object.keys(a).forEach((function(e){o[e]=a[e].title})),{title:o,voucher_type:n,date:r.join(" ~ "),subOptions:t.map((function(e){var t={};return Object.keys(e.details).forEach((function(a){t[a]=e.details[a].title})),{id:e.id,title:t,count:e.count,price:e.price[d]}}))}})),p.options.forEach((function(e){if(i.booking_at){var t=i.booking_at,a=t.book_dt,n=t.book_time,r=t.end_dt;a&&n?e.book_dt=Vt()("".concat(Vt()(a).format("YYYY-MM-DD")," ").concat(n)).format("YYYY-MM-DD HH:mm"):a?e.book_dt=Vt()("".concat(a)).format("YYYY-MM-DD"):n&&(e.book_dt=Vt()("".concat(n)).format("HH:mm")),r||delete e.date}}))):p.options=[]}return 3===e.user.provider?p.productUrl="".concat(t.$env.rcsUrl,"/products/").concat(m.id):"RTR"===m.type?p.productUrl="".concat(t.$env.mkpUrl.replace("https://","https://m-").replace("https://m-wwww","https://m"),"/restaurant/product/").concat(m.seo_sn,"/").concat(m.id):p.productUrl="".concat(t.$env.mkpUrl,"/product/").concat(m.seo_sn,"/").concat(m.id),p})):[]},orderRowSpanMethod:function(e){e.row,e.column,e.rowIndex,e.columnIndex;return{rowspan:1,colspan:5}},detailRowSpanMethod:function(e,t){e.row,e.column,e.rowIndex;var a=e.columnIndex;return 3===a||4===a?{rowspan:1,colspan:t.product_bookings&&t.product_bookings.length||1}:{rowspan:1,colspan:1}},getOrderList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.searchLoading){t.next=2;break}return t.abrupt("return");case 2:return a=e.ordering,n=e.searchData||{},r=Object(F["a"])({page_size:e.pageSize,page:e.currentPage,ordering:a},n),e.searchLoading=!0,t.prev=6,t.next=9,e.$api.order.getOrderList(r);case 9:o=t.sent,e.orderList=o.results,e.total=o.count;case 12:return t.prev=12,e.searchLoading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[6,,12,15]])})))()},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getOrderList()},onCurrentPageChange:function(e){this.currentPage=e,this.getOrderList()},onPageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.getOrderList()},onSortChange:function(e){var t=e.prop,a=e.order,n=["paid_dt","create_dt","update_dt","id"];n.indexOf(t)<0||(this.ordering="ascending"===a?t:"descending"===a?"-".concat(t):null,this.currentPage=1,this.getOrderList())},onExport:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exportLoading){t.next=2;break}return t.abrupt("return");case 2:return e.exportLoading=!0,t.prev=3,a=e.ordering,n=Object(F["a"])(Object(F["a"])({},e.searchData),{},{ordering:a,locale:e.$i18n.locale}),t.next=8,e.$api.order.exportOrder(n);case 8:r=t.sent,Eo()(r,"PaymentList.xlsx","application/vnd.ms-excel");case 10:return t.prev=10,e.exportLoading=!1,t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[3,,10,13]])})))()}}},$h=wh,Sh=(a("0343"),Object(R["a"])($h,mh,fh,!1,null,"2de9d928",null)),xh=Sh.exports,Th=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"order-detail"},[e.orderInfo?[a("div",{staticClass:"header"},[a("span",{staticClass:"title"},[e._v(e._s(e.$t("Order ID"))+": "+e._s(e.orderInfo.sn))]),a("div",{staticClass:"status"},[e._v(" "+e._s(e.orderStatus)+" ")])]),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.orderInfoLoading,expression:"orderInfoLoading"}],staticClass:"booking-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.bookings,"row-class-name":"booking-row"}},[a("el-table-column",{attrs:{label:e.$t("Booking & supplier"),"min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"sn"},[e._v(e._s(t.row.sn))]),a("div",{staticClass:"status"},[a("el-dropdown",{directives:[{name:"loading",rawName:"v-loading",value:e.bookingStatusChanging,expression:"bookingStatusChanging"}],staticStyle:{width:"160px",cursor:"pointer"},attrs:{disabled:e.bookingStatusChanging,size:"mini",placement:"bottom-start",trigger:"click",value:t.row.status},on:{command:function(a){return e.onBookingStatusChange(t.row,a)}}},[a("span",{class:"el-dropdown-link booking-status--"+t.row.status},[e._v(e._s(e.getBookingStatus(t.row.status))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.bookingStatusList,(function(t){return a("el-dropdown-item",{key:t.value,class:"booking-status--"+t.value,attrs:{command:t.value,disabled:t.value>6}},[e._v(e._s(t.label))])})),1)],1)],1),a("div",{staticClass:"cell-affix-bottom text-info"},[e._v(" "+e._s(t.row.supplier&&t.row.supplier.name)+" ")])]}}],null,!1,3381479882)}),a("el-table-column",{attrs:{label:e.$t("Product name & type"),"min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"text-bold product-name",attrs:{title:e._f("lang")(t.row.title,e.$i18n.locale)}},[a("el-link",{attrs:{type:"primary",href:t.row.productUrl,target:"_blank"}},[e._v(" "+e._s(e._f("lang")(t.row.title,e.$i18n.locale))+" "),a("i",{staticClass:"el-icon-link"})])],1),a("div",{staticClass:"cell-affix-bottom text-info"},[e._v(" "+e._s(t.row.typeAndTags)+" ")])]}}],null,!1,3161477e3)}),a("el-table-column",{attrs:{prop:"sn",label:e.$t("Item detail & number & price"),"min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._l(t.row.options,(function(t){return a("div",{key:t.id,staticClass:"option-item"},[a("div",{staticClass:"option-name"},[e._v(e._s(e._f("lang")(t.title,e.$i18n.locale)))]),e._l(t.subOptions,(function(t){return a("div",{key:t.id,staticClass:"suboption"},[a("div",{staticClass:"text-info"},[e._v(e._s(e._f("lang")(t.title,e.$i18n.locale))+" * "+e._s(t.count)+" * "+e._s(t.price))])])})),t.date?a("div",{staticClass:"order-item-date",attrs:{title:t.date}},[e._v(e._s(t.date))]):t.book_dt?a("div",{staticClass:"order-item-date",attrs:{title:t.book_dt}},[e._v(e._s(t.book_dt))]):e._e()],2)})),a("div",{key:"delivery",staticClass:"cell-affix-bottom"},["RTR"===t.row.product.type?[e.isSelfPurchase(t.row)?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editRestCode(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))]):a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editVoucherLink(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))])]:"DEI"===t.row.product.type?["PCK"===e.orderMeta.picking_type?[e.isTvSelfPurchase(t.row)?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editSelfPickup(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))]):a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editVoucherLink(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))])]:a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editDeliveryTracking(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))])]:[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editVoucherLink(t.row)}}},[e._v(e._s(e.bookingStatus(t.row)))])]],2)]}}],null,!1,3045452250)}),a("el-table-column",{attrs:{label:e.$t("Cost"),"min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.bookingCost[t.$index].edit?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.costChangingMap[t.$index],expression:"costChangingMap[scope.$index]"}],staticClass:"cost-bold"},[a("el-input-number",{attrs:{size:"mini",controls:!1,min:0,precision:2,step:.01,"step-strictly":""},model:{value:e.bookingCost[t.$index].price,callback:function(a){e.$set(e.bookingCost[t.$index],"price",a)},expression:"bookingCost[scope.$index].price"}}),a("el-dropdown",{directives:[{name:"loading",rawName:"v-loading",value:e.currenciesLoading,expression:"currenciesLoading"}],staticClass:"currency-dropdown",attrs:{trigger:"click"},on:{command:function(a){return e.onCurrencySelect(t.$index,a)}}},[a("span",{staticClass:"el-dropdown-link"},[e._v(" "+e._s(e.bookingCost[t.$index].code)),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.currencies,(function(t){return a("el-dropdown-item",{key:t.id,attrs:{command:t.code}},[e._v(e._s(t.code))])})),1)],1),a("div",{staticClass:"cost-action"},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.cancelEditCost(t.$index)}}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{type:"text",size:"mini",disabled:e.costChangingMap[t.$index]},on:{click:function(a){return e.submitEditCost(t.$index)}}},[e._v(e._s(e.$t("Submit")))])],1)],1):a("div",{staticClass:"cost-bold"},[a("div",[e._v(e._s(e.bookingCost[t.$index].code)+" "+e._s(e.bookingCost[t.$index].price))]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){e.bookingCost[t.$index].edit=!0}}},[e._v(e._s(e.$t("Edit")))])],1)]}}],null,!1,1549910810)}),a("el-table-column",{attrs:{label:e.$t("Subtotal"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"text-bold"},[e._v(e._s(t.row.total_amount.toFixed(2)))])]}}],null,!1,1625102243)}),a("el-table-column",{attrs:{label:e.$t("Minus"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.hasDiscount(t.row.discounted_amount,t.row.coupon_discounted_amount)?a("el-popover",{attrs:{placement:"top",trigger:"hover"}},[t.row.discounted_amount-t.row.coupon_discounted_amount!==0?a("div",{staticClass:"discount-info"},[e._v(e._s(e.$t("Discount"))+" "+e._s((Math.abs(100*t.row.discounted_amount-100*t.row.coupon_discounted_amount)/100).toFixed(2)))]):e._e(),t.row.coupon_discounted_amount>0?a("div",{staticClass:"discount-info"},[e._v(e._s(e.$t("Coupon"))+" "+e._s(t.row.coupon_discounted_amount.toFixed(2)))]):e._e(),a("div",{staticClass:"text-bold order-minus",attrs:{slot:"reference"},slot:"reference"},[a("i",{staticClass:"el-icon-info"}),e._v(" "+e._s(t.row.discounted_amount.toFixed(2))+" ")])]):a("div",{staticClass:"text-bold order-minus"},[e._v(e._s(t.row.discounted_amount.toFixed(2)))])]}}],null,!1,4270407841)}),a("el-table-column",{attrs:{label:e.$t("Paid"),width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"text-highlight text-bold"},[e._v(e._s(t.row.paid_amount.toFixed(2)))])]}}],null,!1,1532499005)}),a("el-table-column",{attrs:{label:e.$t("Refunded"),width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"text-bold"},[e._v(e._s(t.row.refunded_amount.toFixed(2)))]),a("el-button",{attrs:{type:"text",disabled:e.bookingRefundedAll(t.row),size:"mini"},on:{click:function(a){return e.onRefund(t.row)}}},[e._v(e._s(e.$t("Refund")))])]}}],null,!1,1148732584)}),a("div",{staticClass:"total-container",attrs:{slot:"append"},slot:"append"},[a("span",{staticClass:"holder-title text-bold"},[e._v(e._s(e.$t("Total")))]),a("div",{staticClass:"holder-space"}),a("div",{staticClass:"holder-subtotal"},[e._v(" "+e._s(e.order.total_amount.toFixed(2))+" ")]),a("div",{staticClass:"holder-minus"},[e.hasDiscount(e.order.discounted_amount,e.order.coupon_discounted_amount)?a("el-popover",{attrs:{placement:"top",trigger:"hover"}},[e.order.discounted_amount-e.order.coupon_discounted_amount!==0?a("div",{staticClass:"discount-info"},[e._v(e._s(e.$t("Discount"))+" "+e._s((Math.abs(100*e.order.discounted_amount-100*e.order.coupon_discounted_amount)/100).toFixed(2)))]):e._e(),e.order.coupon_discounted_amount>0?a("div",{staticClass:"discount-info"},[e._v(e._s(e.$t("Coupon"))+" "+e._s(e.order.coupon_discounted_amount.toFixed(2)))]):e._e(),a("div",{staticClass:"text-bold order-minus",attrs:{slot:"reference"},slot:"reference"},[a("i",{staticClass:"el-icon-info"}),e._v(" "+e._s(e.order.discounted_amount.toFixed(2))+" ")])]):a("span",[e._v(e._s(e.order.discounted_amount.toFixed(2)))])],1),a("div",{staticClass:"holder-paid"},[e._v(" "+e._s(e.orderInfo&&e.orderInfo.paid_amount.toFixed(2))+" ")]),a("div",{staticClass:"holder-refuned"},[e._v(" "+e._s(e.orderInfo&&e.orderInfo.refunded_amount.toFixed(2))+" ")]),a("div",{staticClass:"holder-total"},[a("span",{staticClass:"value text-bold text-highlight"},[e._v(e._s(e.currencySymbol)+" "+e._s(e.orderNetPaid.toFixed(2)))])])])],1)],1),a("el-row",{staticClass:"info-row",attrs:{gutter:15}},[a("el-col",{attrs:{span:12}},[a("el-card",{attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"text-bold"},[e._v(e._s(e.$t("Customer info")))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Customer name")))]),a("div",{staticClass:"value"},[e._v(e._s(e.orderUserInfo.user_first_name)+" "+e._s(e.orderUserInfo.user_last_name))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Name(KR)")))]),a("div",{staticClass:"value"},[e._v(e._s(e.orderUserInfo.user_name))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Gender")))]),a("div",{staticClass:"value"},[e._v(e._s(e.$t(e.orderUserInfo.user_gender)))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Contact number")))]),a("div",{staticClass:"value"},[e._v(e._s(e.orderUserInfo.user_phone))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Email")))]),a("div",{staticClass:"value"},[e._v(e._s(e.orderUserInfo.user_email))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Note")))]),a("div",{staticClass:"value"},[e._v(e._s(e.orderMeta.comment))])]),e.isDeliveryOrder?a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Redeem method")))]),a("div",{staticClass:"value"},["PCK"===e.orderMeta.picking_type?a("span",[e._v(e._s(e.$t("Pickup at"))+" "+e._s(e.orderMeta.pickup_address&&e.orderMeta.pickup_address.address.detail))]):a("span",[e._v(e._s(e.$t("Ship to"))+" "+e._s(e.orderMeta.ko_KR_address&&e.orderMeta.ko_KR_address.address.detail)+" "+e._s(e.orderMeta.ko_KR_address&&e.orderMeta.ko_KR_address.address.postcode))])])]):e._e()])],1),a("el-col",{attrs:{span:12}},[a("el-card",{attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"text-bold"},[e._v(e._s(e.$t("Comment to user")))]),a("div",{staticClass:"card-actions"},[a("el-button",{attrs:{type:"text"},on:{click:e.onCommentToUserEdit}},[e._v(" "+e._s(e.$t("Edit"))+" ")])],1)]),a("div",{staticClass:"card-content"},[a("pre",[e._v(e._s(e.orderInfo.remark_to_customer))])])])],1)],1),a("el-row",{staticClass:"info-row",attrs:{gutter:15}},[a("el-col",{attrs:{span:12}},[a("el-card",{attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"text-bold"},[e._v(e._s(e.$t("Order info")))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Order ID")))]),a("div",{staticClass:"value"},[e._v(e._s(e.order.sn))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("User ID")))]),a("div",{staticClass:"value"},[a("el-link",{attrs:{href:"javascript:void(0)",type:"text"},nativeOn:{click:function(t){e.showUserInfo=!0}}},[e._v(e._s(e.order.user))])],1)]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Create time")))]),a("div",{staticClass:"value"},[e._v(e._s(e._f("date")(e.order.create_dt)))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Paid time")))]),a("div",{staticClass:"value"},[e._v(e._s(e._f("date")(e.order.paid_dt)))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Update info")))]),a("div",{staticClass:"value",on:{click:function(t){e.showUpdateInfo=!0}}},[a("el-button",{staticStyle:{padding:"0"},attrs:{type:"text"}},[e._v(e._s(e._f("date")(e.order.update_dt)))])],1)]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Platform")))]),a("div",{staticClass:"value"},[e._v(e._s(e.platformName))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Payment method")))]),a("div",{staticClass:"value"},[e._v(e._s(e.paymentTypeName))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Payment secret")))]),a("div",{staticClass:"value"},[e._v(" "+e._s(e.order.secret)+" "),e.order.secret?a("i",{directives:[{name:"clipboard",rawName:"v-clipboard",value:e.order.secret,expression:"order.secret"},{name:"clipboard",rawName:"v-clipboard:success",value:e.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:e.clipboardErrorHandler,expression:"clipboardErrorHandler",arg:"error"}],staticClass:"icon-button el-icon-copy-document"}):e._e()])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Coupon(Old)")))]),a("div",{staticClass:"value"},[a("div",{staticClass:"value"},e._l(e.orderMeta.coupons,(function(t,n){return a("div",{key:n,staticClass:"coupon-code"},[e._v(e._s(e._f("formattedCode")(t.code))),a("br")])})),0)])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Coupon")))]),a("div",{staticClass:"value"},[e.orderCoupon?a("div",{staticClass:"coupon-code"},[e.orderCoupon.base_coupon&&e.orderCoupon.base_coupon.hasOwnProperty("code_type")&&0!==e.orderCoupon.base_coupon.code_type?a("span",[e._v(e._s(e.$t("Random"))+" - ")]):a("span",[e._v(e._s(e.orderCoupon.base_coupon.code)+" - ")]),e._v(" "+e._s(e._f("formattedCode")(e.orderCoupon.code))+" ")]):e._e()])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Device")))]),a("div",{staticClass:"value"},[e._v(e._s(e.$t(e.orderMeta.device)))])])])],1),a("el-col",{attrs:{span:12}},[a("el-card",{attrs:{shadow:"never"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"text-bold"},[e._v(e._s(e.$t("Remark")))]),a("div",{staticClass:"card-actions"},[a("el-button",{attrs:{type:"text"},on:{click:e.onNoteEdit}},[e._v(" "+e._s(e.$t("Edit"))+" ")])],1)]),a("div",{staticClass:"card-content"},[a("pre",[e._v(e._s(e.orderInfo.note))])])])],1)],1)]:e._e(),e.showEditingVoucher?a("DialogEditVouchers",{attrs:{order:e.order,booking:e.editingBooking},on:{submit:e.onVoucherSave,close:function(t){e.showEditingVoucher=!1}}}):e._e(),e.showRefund?a("DialogRefund",{attrs:{booking:e.editingBooking,order:e.order,status:e.defaultRefundStatus},on:{submit:e.onRefundSave,close:function(t){e.showRefund=!1}}}):e._e(),e.showUserInfo?a("DialogUserInfo",{attrs:{user:e.orderUserInfo},on:{close:function(t){e.showUserInfo=!1}}}):e._e(),e.showEditingDeliveryTracking?a("DialogDeliveryTracking",{attrs:{order:e.order,booking:e.editingBooking},on:{submit:e.onDeliveryTrackSave,close:function(t){e.showEditingDeliveryTracking=!1}}}):e._e(),e.showBookingCode?a("DialogRestCode",{attrs:{booking:e.editingBooking},on:{close:function(t){e.showBookingCode=!1}}}):e._e(),e.showEditingNote?a("DialogOrderNote",{attrs:{order:e.order},on:{submit:e.onNoteSave,close:function(t){e.showEditingNote=!1}}}):e._e(),e.showCommentToUser?a("DialogRemarkToUser",{attrs:{order:e.order},on:{submit:e.onCommentToUserSave,close:function(t){e.showCommentToUser=!1}}}):e._e(),e.showVoucherLinkUploader?a("DialogDeliverVoucher",{attrs:{order:e.order,booking:e.editingBooking},on:{submit:e.onVoucherSave,close:function(t){e.showVoucherLinkUploader=!1}}}):e._e(),e.showSelfPickup?a("DialogDeliverSelfPickup",{attrs:{order:e.order,booking:e.editingBooking},on:{submit:e.onSelfPickupSave,close:function(t){e.showSelfPickup=!1}}}):e._e(),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.order,watchObject:e.$route.params.id}}):e._e()],1)],2)},Dh=[],Ph=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Vouchers"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{ref:"form",staticClass:"dialog-form",attrs:{inline:!0,"show-message":!1,model:e.formModel,size:"mini"}},[a("el-form-item",{attrs:{label:e.$t("Status")}},[e._v(" "+e._s(e.bookingStatus(e.booking))+" ")]),a("el-form-item",{attrs:{label:e.$t("Vouchers"),prop:"title"}},[a("el-input",{attrs:{placeholder:e.$t("Voucher name")},model:{value:e.formModel.title,callback:function(t){e.$set(e.formModel,"title",t)},expression:"formModel.title"}})],1),a("el-form-item",{attrs:{prop:"link"}},[a("el-input",{attrs:{placeholder:e.$t("Voucher link")},model:{value:e.formModel.link,callback:function(t){e.$set(e.formModel,"link",t)},expression:"formModel.link"}})],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-plus",circle:""},on:{click:e.add}})],1)],1),a("el-table",{attrs:{data:e.voucher,size:"mini"}},[a("el-table-column",{attrs:{label:e.$t("Voucher name"),prop:"title"}}),a("el-table-column",{attrs:{label:e.$t("Voucher link"),prop:"link"}}),a("el-table-column",{attrs:{width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete",circle:""},on:{click:function(a){return e.remove(t.$index)}}})]}}])})],1),e.booking.status<5?a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{size:"small",type:"primary",disabled:e.loading},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Ok")))])],1):e._e()],1)},Oh=[],Ih=(a("9911"),{props:{order:{type:Object,required:!0},booking:{type:Object,required:!0}},data:function(){return{BOOKIKNG_STATUS:ge,formModel:{title:"",link:""},voucher:Object(Xc["a"])(this.booking.voucher),loading:!1}},computed:{bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}}},methods:{add:function(){var e=this.formModel,t=e.title,a=e.link;(t.trim()||a.trim())&&(this.voucher.push({title:t.trim(),link:a.trim()}),this.formModel={title:"",link:""})},remove:function(e){this.voucher.splice(e,1)},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$emit("submit",this.booking,this.voucher,(function(){e.loading=!1})))},onClose:function(){this.$emit("close")}}}),Rh=Ih,Eh=(a("6899"),Object(R["a"])(Rh,Ph,Oh,!1,null,"5af113e4",null)),Mh=Eh.exports,Nh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Refund"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[e.booking.rewarded_mylink_points?a("el-alert",{staticStyle:{"margin-bottom":"15px"},attrs:{title:e.$t("{num} Mylink points have sent to user, please be careful with refunds",{num:e.booking.mylink_points}),type:"warning","show-icon":"",closable:!1}}):e._e(),a("el-form",{ref:"form",staticClass:"dialog-form",attrs:{model:e.formModel,rules:e.rules}},[a("el-form-item",{attrs:{prop:"amount"}},[a("el-input",{attrs:{disabled:10===e.formModel.status,placeholder:e.refundTip},model:{value:e.formModel.amount,callback:function(t){e.$set(e.formModel,"amount",t)},expression:"formModel.amount"}},[a("el-select",{class:"booking-status--"+e.formModel.status,staticStyle:{width:"200px"},attrs:{slot:"prepend",placeholder:e.$t("Booking status"),clearable:!1},slot:"prepend",model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.bookingStatusList,(function(e){return a("el-option",{key:e.value,class:"booking-status--"+e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),a("el-form-item",{attrs:{prop:"note"}},[a("el-input",{attrs:{disabled:10===e.formModel.status,placeholder:e.$t("Refund note")},model:{value:e.formModel.note,callback:function(t){e.$set(e.formModel,"note",t)},expression:"formModel.note"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"text"},on:{click:function(t){e.showTip=!e.showTip}}},[e._v(e._s(e.$t("Refund policy"))+" "),e.showTip?e._e():a("i",{staticClass:"el-icon-arrow-down"}),e.showTip?a("i",{staticClass:"el-icon-arrow-up"}):e._e()]),e.showTip?a("div",{staticClass:"refund-tip",domProps:{innerHTML:e._s(e.booking.product.details[e.$i18n.locale].meta.refund_policy)}}):e._e()],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{type:"primary",disabled:!e.inputAmountValid||e.loading},on:{click:e.onSubmit}},[e._v(e._s(e.isRefunded?e.$t("Refunded"):e.$t("Ok")))])],1)],1)},jh=[],Ah={props:{booking:{type:Object,required:!0},order:{type:Object,required:!0},status:{type:Number,required:!1}},data:function(){return{formModel:{status:null,amount:null,note:""},showTip:!1,loading:!1}},mounted:function(){this.init()},computed:{refundPolicy:function(){return this.booking.product&&this.booking.product.details&&this.booking.product.details[this.$i18n.locale]&&this.booking.product.details[this.$i18n.locale].meta?this.booking.product.details[this.$i18n.locale].meta.refund_policy:""},isRefunded:function(){var e=this.order,t=e.paid_amount,a=e.refunded_amount,n=e.refunding_amount;return a+n>=t},rules:function(){var e=this.validator;return{amount:[{required:!0,trigger:"blur",validator:e}]}},validator:function(){var e=this,t=this.amount;return function(a,n,r){n||r(),n>t&&r(new Error(e.$t("Refund amount, please enter a digit no greater than {0}",{amount:t}))),r()}},inputAmountValid:function(){return this.formModel.amount>0&&this.formModel.amount<=this.amount},amount:function(){return this.getMaxAmountCanRefund()},refundTip:function(){var e=this.amount;return this.$t("Refund amount, please enter a digit no greater than {0}",{amount:e})},bookingStatusList:function(){var e=this,t=Object.keys(ge);return t.map((function(t){return{label:e.$t(ge[t]),value:+t}}))}},methods:{init:function(){var e=null;e=this.status||this.booking.status,9!==e&&10!==e&&(e=9);var t=null;e&&(9===e&&this.booking.refunding_amount&&(t=this.booking.refunding_amount),10===e&&(t=this.booking.refunding_amount)),this.formModel.amount=t,this.formModel.status=e,this.formModel.note=this.booking.refund_note},getMaxAmountCanRefund:function(){var e=this.booking,t=e.paid_amount,a=e.refunded_amount;return(100*t-100*a)/100||0},onClose:function(){this.$emit("close")},onSubmit:function(){var e=this;if(!this.loading){this.loading=!0;var t=this.booking,a=this.formModel,n=a.status,r=a.amount,o=a.note;this.$emit("submit",{booking:t,status:+n,amount:+r,note:o},(function(){e.loading=!1}))}}},watch:{"formModel.status":function(e,t){e!==t&&10===e&&null===this.formModel.amount&&(this.formModel.amount=this.booking.refunding_amount||0)}}},Lh=Ah,Fh=(a("4417"),Object(R["a"])(Lh,Nh,jh,!1,null,"5ce492c6",null)),Uh=Fh.exports,zh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("User Info"),"before-close":e.onClose,"show-close":!0,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("User name")))]),a("div",{staticClass:"value"},[e._v(e._s(e.user.user_first_name)+" "+e._s(e.user.user_last_name))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Gender")))]),a("div",{staticClass:"value"},[e._v(e._s(e.$t(e.user.user_gender)))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Country")))]),a("div",{staticClass:"value"},[e._v(e._s(e.countryName))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Contact number")))]),a("div",{staticClass:"value"},[e._v(e._s(e.user.user_phone))])]),a("div",{staticClass:"card-info-item"},[a("div",{staticClass:"label"},[e._v(e._s(e.$t("Email")))]),a("div",{staticClass:"value"},[e._v(e._s(e.user.user_email))])])])},qh=[],Hh={props:{user:{type:Object,required:!0}},data:function(){return{}},computed:Object(F["a"])(Object(F["a"])({},Object(U["d"])(["countries"])),{},{countryName:function(){var e=this;if(this.user.user_country_code){var t=this.countries.find((function(t){return t.code===e.user.user_country_code}));if(t){var a=this.$options.filters.lang(t.details,this.$i18n.locale);return a.title}return{}}return{}}}),methods:{onClose:function(){this.$emit("close")}}},Bh=Hh,Kh=(a("3517"),Object(R["a"])(Bh,zh,qh,!1,null,"d304585e",null)),Vh=Kh.exports,Yh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Delivery tracking"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{ref:"form",attrs:{model:e.formModel,"label-position":"left","label-width":"auto",rules:e.rules,size:"mini"}},[a("el-form-item",{attrs:{label:e.$t("Status")}},[e._v(" "+e._s(e.bookingStatus(e.booking))+" ")]),a("el-form-item",{attrs:{label:e.$t("Customer name")}},[e._v(" "+e._s(e.order.meta.user_name)+" ")]),a("el-form-item",{attrs:{label:e.$t("Contact number")}},[e._v(" "+e._s(e.order.meta.user_phone)+" ")]),a("el-form-item",{attrs:{label:e.$t("Address")}},[e._v(" "+e._s(e.order.meta.ko_KR_address&&e.order.meta.ko_KR_address.address.detail)+" ")]),a("el-form-item",{attrs:{label:e.$t("Postcode")}},[e._v(" "+e._s(e.order.meta.ko_KR_address&&e.order.meta.ko_KR_address.address.postcode)+" ")]),a("el-form-item",{attrs:{label:e.$t("Requesting memo")}},[e._v(" "+e._s(e.order.meta.comment)+" ")]),a("el-row",{attrs:{type:"flex",justify:"space-between"}},[a("el-col",[a("el-form-item",{attrs:{label:e.$t("Delivery tracking"),prop:"courier_company"}},[a("el-input",{attrs:{placeholder:e.$t("Courier company")},model:{value:e.formModel.courier_company,callback:function(t){e.$set(e.formModel,"courier_company",t)},expression:"formModel.courier_company"}})],1)],1),a("el-col",{attrs:{span:1}}),a("el-col",[a("el-form-item",{attrs:{prop:"track_number","label-width":"0"}},[a("el-input",{attrs:{placeholder:e.$t("Tracking number")},model:{value:e.formModel.track_number,callback:function(t){e.$set(e.formModel,"track_number",t)},expression:"formModel.track_number"}})],1)],1)],1),a("el-form-item",{attrs:{label:e.$t("Delivery option")}},[a("el-radio",{attrs:{checked:""}},[e._v(e._s(e.$t("Apply to all related bookings in this order")))])],1)],1),e.booking.status<5?a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{size:"small",type:"primary",disabled:e.loading},on:{click:e.submit}},[e._v(e._s(e.$t("Ok")))])],1):e._e()],1)},Wh=[],Gh={props:{order:{type:Object,required:!0},booking:{type:Object,required:!0}},data:function(){return{BOOKIKNG_STATUS:ge,formModel:{courier_company:this.booking.courier_company,track_number:this.booking.track_number},loading:!1}},computed:{rules:function(){return{courier_company:[{required:!0,trigger:"blur",message:this.$t("Courier company is required")}],track_number:[{required:!0,trigger:"blur",message:this.$t("Tracking number is required")}]}},bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}}},methods:{submit:function(){var e=this;this.loading||this.$refs.form.validate(function(){var t=Object(L["a"])(regeneratorRuntime.mark((function t(a){var n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.loading=!0,a&&(n=e.formModel,r=n.courier_company,o=n.track_number,e.$emit("submit",e.booking,{courier_company:r,track_number:o},(function(){e.loading=!1})));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},onClose:function(){this.$emit("close")}}},Qh=Gh,Jh=Object(R["a"])(Qh,Yh,Wh,!1,null,null,null),Xh=Jh.exports,Zh=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"840px",title:e.$t("Rest code"),"before-close":e.onClose,"show-close":!0,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{attrs:{size:"mini","label-width":"50px","label-position":"right","label-suffix":":"}},[a("el-form-item",{attrs:{label:e.$t("Status")}},[e._v(" "+e._s(e.bookingStatus(e.booking))+" ")]),a("el-form-item",{attrs:{label:e.$t("Detail")}},[a("el-table",{attrs:{data:e.booking.booking_codes,size:"mini"}},[a("el-table-column",{attrs:{label:e.$t("E-code"),prop:"code"}}),a("el-table-column",{attrs:{label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.$t(e.ECODE_STATUS[t.row.status]))+" ")]}}])}),a("el-table-column",{attrs:{label:e.$t("Valid period"),width:"140px"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("date")(t.row.valid_start_dt))),a("br"),e._v(e._s(e._f("date")(t.row.valid_end_dt))+" ")]}}])}),a("el-table-column",{attrs:{label:e.$t("Redeem time")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("date")(t.row.redeem_dt))+" ")]}}])}),a("el-table-column",{attrs:{label:e.$t("Redeem shop")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.getShopName(t.row))+" ")]}}])}),a("el-table-column",{attrs:{label:e.$t("Note"),prop:"freeze_note"}})],1)],1)],1)],1)},e_=[],t_={props:{booking:{type:Object,required:!0}},data:function(){return{ECODE_STATUS:ve,BOOKIKNG_STATUS:ge}},computed:{bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}}},methods:{getShopName:function(e){return e.redeem_poi?this.$options.filters.lang(e.redeem_poi.name,this.$i18n.locale):""},onClose:function(){this.$emit("close")}}},a_=t_,n_=Object(R["a"])(a_,Zh,e_,!1,null,null,null),r_=n_.exports,o_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Remark"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-input",{staticClass:"remark-text",attrs:{size:"mini",type:"textarea",placeholder:e.$t("Remark")},model:{value:e.formModel.note,callback:function(t){e.$set(e.formModel,"note",t)},expression:"formModel.note"}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{size:"small",type:"primary"},on:{click:e.submit}},[e._v(e._s(e.$t("Ok"))+e._s(e.loading))])],1)],1)},i_=[],s_={props:{order:{type:Object,required:!0}},data:function(){return{loading:!1,formModel:{note:this.order.note}}},computed:{},methods:{submit:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.formModel.note,!e.loading){t.next=3;break}return t.abrupt("return");case 3:return e.loading=!0,t.next=6,e.$emit("submit",a.trim(),(function(){e.loading=!1}));case 6:case"end":return t.stop()}}),t)})))()},onClose:function(){this.$emit("close")}}},l_=s_,c_=(a("d6ed"),Object(R["a"])(l_,o_,i_,!1,null,"0cc86322",null)),u_=c_.exports,d_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Comment to user"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{ref:"form",attrs:{size:"mini"}},[a("el-row",{attrs:{type:"flex",justify:"space-between"}},[a("el-col",[a("el-form-item",[a("el-input",{attrs:{type:"textarea",placeholder:e.$t("Comment to user")},model:{value:e.formModel.remark_to_customer,callback:function(t){e.$set(e.formModel,"remark_to_customer",t)},expression:"formModel.remark_to_customer"}})],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{attrs:{size:"small",type:"primary",disabled:e.loading,loading:e.loading},on:{click:e.submit}},[e._v(e._s(e.$t("Ok")))])],1)],1)},p_=[],m_={props:{order:{type:Object,required:!0}},data:function(){return{loading:!1,formModel:{remark_to_customer:this.order.remark_to_customer}}},computed:{},methods:{submit:function(){var e=this;if(!this.loading){this.loading=!0;var t=this.formModel.remark_to_customer;this.$emit("submit",t.trim(),(function(){e.loading=!1}))}},onClose:function(){this.$emit("close")}}},f_=m_,g_=(a("16e3"),Object(R["a"])(f_,d_,p_,!1,null,"39a8ae20",null)),h_=g_.exports,__=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Deliver"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{ref:"form",staticClass:"dialog-form",attrs:{"show-message":!1,"label-width":"110px",model:e.formModel,"label-suffix":":",size:"mini"}},[a("el-form-item",{attrs:{label:e.$t("Status")}},[e._v(" "+e._s(e.bookingStatus(e.booking))+" ")]),a("el-form-item",{attrs:{label:e.$t("Voucher type"),prop:"voucher_type"}},[a("el-radio-group",{attrs:{disabled:e.booking.status>=5},model:{value:e.formModel.voucher_type,callback:function(t){e.$set(e.formModel,"voucher_type",t)},expression:"formModel.voucher_type"}},[a("el-radio",{attrs:{label:"PDF"}},[e._v("PDF")]),a("el-radio",{attrs:{label:"LINK"}},[e._v("Link")])],1)],1),"PDF"===e.formModel.voucher_type?a("el-form-item",{attrs:{label:e.$t("File"),prop:"link"}},[5===e.booking.status?a("el-link",{attrs:{target:"_blank",href:e.pdfLink}},[e._v(" "+e._s(e.formModel.fileList.length?e.formModel.fileList[0].name:"")+" ")]):a("el-upload",{attrs:{action:"","http-request":e.uploadRequest,data:{path:"voucher"},limit:2,"file-list":e.formModel.fileList,"on-success":e.onFileUploadSuccess,"on-error":e.onFileUploadError,"on-change":e.onFileUploadChange,"on-remove":e.onFileRemove,accept:"application/pdf","before-upload":e.beforeUpload}},[a("el-button",{attrs:{size:"small",type:"primary"}},[a("i",{staticClass:"el-icon-upload2"}),e._v(e._s(e.formModel.fileList.length?e.$t("Replace"):e.$t("Upload")))])],1)],1):e._e(),"LINK"===e.formModel.voucher_type?a("el-form-item",{attrs:{label:e.$t("Link"),prop:"link"}},[e.booking.status>=5?a("el-link",{attrs:{href:e.formModel.link,target:"_blank"}},[e._v(e._s(e.formModel.link))]):a("el-input",{attrs:{placeholder:e.$t("Voucher link")},model:{value:e.formModel.link,callback:function(t){e.$set(e.formModel,"link",t)},expression:"formModel.link"}},[a("template",{slot:"prepend"},[e._v("https://")])],2)],1):e._e(),"TV"===e.booking.scope?a("el-form-item",{attrs:{label:e.$t("Delivery option")}},[a("el-radio",{attrs:{checked:""}},[e._v(e._s(e.$t("Apply to all related bookings in this order")))])],1):e._e()],1),e.booking.status<5?a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{size:"small",disabled:!e.canSubmit||e.loading,type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Save")))])],1):e._e()],1)},v_=[],b_={props:{order:{type:Object,required:!0},booking:{type:Object,required:!0}},data:function(){return{BOOKIKNG_STATUS:ge,formModel:{fileList:[],voucher_type:"PDF",title:"",link:""},loading:!1}},mounted:function(){if(this.booking){var e=this.booking.voucher,t=e.voucher_type||"PDF";this.formModel.voucher_type=t;var a=e||{},n=a.file,r=a.link;"PDF"===t&&n?this.formModel.fileList=[{url:n[0].link,path:n[0].link,name:n[0].title,image_links:n[0].image_links}]:"LINK"===t&&r&&(this.formModel.link=r[0])}},computed:{pdfLink:function(){var e,t=this.formModel.fileList,a="";t.length&&(a=t[0].path,!a&&null!==(e=t[0].image_links)&&void 0!==e&&e.length&&(a=t[0].image_links[0]));return a},canSubmit:function(){return"PDF"===this.formModel.voucher_type?this.formModel.fileList.every((function(e){return e.path})):"LINK"===this.formModel.voucher_type&&this.formModel.link},bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}}},methods:{getId:function(){return+new Date},showErrorMsg:function(e){this.$message.error(e)},uploadRequest:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=new FormData,a.next=3,t.getBlob(e.file);case 3:return r=a.sent,n.append("file",r,e.file.name),n.append("path","voucher"),o=t.$api.common.uploadFile(n,{cancelToken:new Jt.a.CancelToken((function(t){e.file.cancelflightRequest=t})),onUploadProgress:function(t){var a=t.loaded,n=t.total;e.onProgress({percent:Math.floor(100*a/n)})}}),o.finally((function(){e.file.cancelflightRequest=null})),a.abrupt("return",o.then((function(t){return e.file.voucher=t.file[0],t.file[0].url})));case 9:case"end":return a.stop()}}),a)})))()},getBlob:function(e){return new Promise((function(t,a){var n=URL.createObjectURL(e),r=new XMLHttpRequest;r.open("GET",n),r.responseType="blob",r.onload=function(){t(this.response)},r.onerror=a,r.send()}))},onFileUploadSuccess:function(e,t){t.path=e,t.loaded=!0,this.formModel.fileList.splice(0,1,t)},onFileUploadError:function(e){"Cancel"!==e.constructor.name&&this.showErrorMsg(this.$t("Upload failed"))},beforeUpload:function(e){e.id=this.getId();var t="application/pdf"===e.type,a=e.size<10485760;return!(!t||!a)||(this.showErrorMsg(this.$t("Only support PDF format and < 10MB")),!1)},onFileUploadChange:function(e,t){t.length>1?this.formModel.fileList=[t.pop()]:this.formModel.fileList=t},onFileRemove:function(e,t){this.formModel.fileList=t},onSubmit:function(){var e=this;if(!this.loading){this.loading=!0;var t={voucher_type:this.formModel.voucher_type};if("PDF"===this.formModel.voucher_type){var a=this.formModel.fileList[0].raw.voucher;t.file=[{title:a.name,link:a.path,image_links:a.image_links}]}else 0===this.formModel.link.indexOf("http://")?t.link=[this.formModel.link]:t.link=["https://"+this.formModel.link];this.$emit("submit",this.booking,t,(function(){e.loading=!1}))}},onClose:function(){this.$emit("close")}}},y_=b_,C_=(a("c876"),Object(R["a"])(y_,__,v_,!1,null,"bcfacf78",null)),k_=C_.exports,w_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:!0,width:"640px",title:e.$t("Vouchers"),"before-close":e.onClose,"close-on-click-modal":!1,"close-on-press-escape":!1}},[a("el-form",{ref:"form",staticClass:"dialog-form",attrs:{"label-position":"right","label-suffix":":","label-width":"120px","show-message":!1,model:e.formModel,size:"mini"}},[a("el-form-item",{attrs:{label:e.$t("Status")}},[e._v(" "+e._s(e.bookingStatus(e.booking))+" ")]),a("el-form-item",{attrs:{label:e.$t("Goods"),prop:"ready"}},[a("el-radio-group",{attrs:{disabled:e.booking.status>=5},model:{value:e.formModel.ready,callback:function(t){e.$set(e.formModel,"ready",t)},expression:"formModel.ready"}},[a("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("Not ready")))]),a("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("Ready to pick up")))])],1)],1),1===e.formModel.ready?a("el-form-item",{attrs:{label:e.$t("Pick up note"),prop:"note"}},[a("el-input",{attrs:{placeholder:e.$t("Enter note")},model:{value:e.formModel.note,callback:function(t){e.$set(e.formModel,"note",t)},expression:"formModel.note"}})],1):e._e()],1),e.booking.status<5?a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.onClose}},[e._v(e._s(e.$t("Cancel")))]),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{size:"small",type:"primary",disabled:0===e.formModel.ready||e.loading},on:{click:e.onSubmit}},[e._v(e._s(e.$t("Ok")))])],1):e._e()],1)},$_=[],S_={props:{order:{type:Object,required:!0},booking:{type:Object,required:!0}},watch:{"formModel.ready":function(e,t){e!==t&&0===e&&(this.formModel.note="")}},computed:{bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}}},data:function(){var e;return{BOOKIKNG_STATUS:ge,formModel:{ready:this.booking.status>=5?1:0,note:(null===(e=this.booking.voucher)||void 0===e?void 0:e.note)||""},loading:!1}},methods:{onSubmit:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.loading){t.next=2;break}return t.abrupt("return");case 2:return e.loading=!0,t.next=5,e.$emit("submit",e.booking,e.formModel.note,(function(){e.loading=!1}));case 5:case"end":return t.stop()}}),t)})))()},onClose:function(){this.$emit("close")}}},x_=S_,T_=(a("c034"),Object(R["a"])(x_,w_,$_,!1,null,"34f47185",null)),D_=T_.exports,P_={components:{DialogEditVouchers:Mh,DialogRefund:Uh,DialogUserInfo:Vh,DialogDeliveryTracking:Xh,DialogRestCode:r_,DialogOrderNote:u_,DialogRemarkToUser:h_,EventTimeline:Au,DialogDeliverVoucher:k_,DialogDeliverSelfPickup:D_},data:function(){return{currencies:[],currenciesLoading:!1,bookingCost:[],orderInfoLoading:!1,EVENT_TYPE:Me,showUpdateInfo:!1,orderInfo:null,showCommentToUser:!1,showEditingNote:!1,editingBooking:null,showEditingVoucher:!1,showEditingDeliveryTracking:!1,showBookingCode:!1,showRefund:!1,showUserInfo:!1,showVoucherLinkUploader:!1,bookingStatusChanging:!1,showSelfPickup:!1,defaultRefundStatus:null,costChangingMap:{}}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{order:function(){return this.orderInfo||{}},bookingStatus:function(){var e=this;return function(t){return t.status<=4?e.$t("Deliver"):t.status>=5?e.$t("Delivered"):""}},orderStatus:function(){return this.orderInfo&&this.$t(fe[this.orderInfo.status])},currencyCode:function(){return this.orderInfo?this.orderInfo.currency_detail.code:null},currencySymbol:function(){return this.orderInfo?this.orderInfo.currency_detail.symbol:null},orderCoupon:function(){return this.orderInfo&&this.orderInfo.snapshot&&this.orderInfo.snapshot.coupon?this.orderInfo.snapshot.coupon:null},orderMeta:function(){return this.orderInfo?this.orderInfo.meta:null},paymentTypeName:function(){if(!this.orderMeta)return null;var e=this.orderMeta.payment_method||this.orderMeta.payment_type,t=Le[e]||e;return this.$t(t)},isDeliveryOrder:function(){return this.bookings.some((function(e){return"DEI"===e.snapshot.product.type}))},orderNetPaid:function(){return this.orderInfo?(100*this.orderInfo.paid_amount-100*this.orderInfo.refunded_amount)/100:0},orderUserInfo:function(){if(!this.orderInfo)return null;var e=this.orderInfo,t=e.meta,a=e.user_detail,n=t||{},r=n.user_first_name,o=n.user_last_name,i=n.user_gender,s=n.user_email,l=n.user_phone,c=n.country_code,u=n.country_name,d=n.user_name,p=a||{},m=p.first_name,f=p.last_name,g=p.gender,h=p.email,_=p.phone,v=p.country_code,b=p.country_name,y=p.provider;return{user_first_name:m||r,user_last_name:f||o,user_gender:g||i,user_email:h||s,user_phone:_||l,user_country_code:v||c,user_country_name:b||u,user_name:d,provider:y}},bookingStatusList:function(){var e=this,t=Object.keys(ge);return t.map((function(t){return{label:e.$t(ge[t]),value:+t}}))},bookings:function(){var e=this;return this.orderInfo?this.orderInfo.product_bookings.map((function(t){var a=t.id,n=t.cost,r=t.scope,o=t.sn,i=t.status,s=t.snapshot,l=t.paid_amount,c=t.refunded_amount,u=t.refunding_amount,d=t.currency,p=t.product,m=t.voucher,f=t.courier_company,g=t.track_number,h=t.booking_codes,_=t.platform,v=t.total_amount,b=t.discounted_amount,y=t.coupon_discounted_amount,C=t.refund_note,k=t.mylink_points,w=t.rewarded_mylink_points,$={id:a,cost:n,sn:o,scope:r,status:i,voucher:m,courier_company:f,booking_codes:h,track_number:g,snapshot:s,productCurrent:p,product:s.product,platform:_,total_amount:v,discounted_amount:b,paid_amount:l,refunded_amount:c,refunding_amount:u,coupon_discounted_amount:y,refund_note:C,mylink_points:k,rewarded_mylink_points:w};p&&($.supplier=p.supplier,$.tags=(p.categories||[]).map((function(t){return e.$options.filters.lang(t.name,e.$i18n.locale)})).join(","));var S=s.product;if(S&&($.type=e.$t(de[S.type]),$.title=S.title),$.typeAndTags=[$.type,$.tags].filter((function(e){return e})).join(" - "),"EC"===r&&"RTR"===S.type&&s.variant){if($.options=[{title:{},is_self_purchased:p&&p.is_self_purchased,voucher_type:s.variant.voucher_type,discount:(100*s.variant.original_price[d]-100*s.variant.price[d])*s.variant.count,subOptions:[{count:s.variant.count,price:s.variant.price[e.currencyCode]}]}],s.variant.book_dt)switch(s.variant.valid_type){case 1:$.options[0].book_dt=Vt()(s.variant.book_dt).format("YYYY-MM-DD");break;case 2:$.options[0].book_dt=Vt()(s.variant.book_dt).format("YYYY-MM-DD HH:mm");break}var x=$.options.map((function(e){return e.discount})).flat();if(x.length&&($.discount=x.reduce((function(e,t){return e+t}))/100),s.booking_at){var T=s.booking_at,D=T.book_dt,P=T.book_time;D&&P?$.options[0].book_dt=Vt()("".concat(Vt()(D).format("YYYY-MM-DD")," ").concat(P)).format("YYYY-MM-DD HH:mm"):D?$.options[0].book_dt=Vt()("".concat(D)).format("YYYY-MM-DD"):P&&($.options[0].book_dt=Vt()("".concat(P)).format("HH:mm")),$.options[0].book_dt&&delete $.options[0].date}}else{var O=s.options;if(O&&O.length){$.voucherType=O[0].voucher_type,$.options=O.map((function(e){var t=e.id,a=e.sub_options,n=e.details,r=e.voucher_type,o={};Object.keys(n).forEach((function(e){o[e]=n[e].title}));var i=[e.book_dt,e.end_dt].filter((function(e){return e})).map((function(e){return Vt()(e).format("YYYY-MM-DD")}));return{id:t,date:i.join(" ~ "),title:o,voucher_type:r,subOptions:a.map((function(e){var t={};return Object.keys(e.details).forEach((function(a){t[a]=e.details[a].title})),{id:e.id,title:t,count:e.count,price:e.price[d],discount:(100*e.original_price[d]-100*e.price[d])*e.count}}))}}));var I=$.options.map((function(e){return Object(Xc["a"])(e.subOptions.map((function(e){return e.discount})))})).flat();I.length&&($.discount=I.reduce((function(e,t){return e+t}))/100),$.options.forEach((function(e){if(s.booking_at){var t=s.booking_at,a=t.book_dt,n=t.book_time,r=t.end_dt;a&&n?e.book_dt=Vt()("".concat(Vt()(a).format("YYYY-MM-DD")," ").concat(n)).format("YYYY-MM-DD HH:mm"):a?e.book_dt=Vt()("".concat(a)).format("YYYY-MM-DD"):n&&(e.book_dt=Vt()("".concat(n)).format("HH:mm")),r||delete e.date}}))}else $.options=[]}return p&&($.supplier=p.supplier),3===e.orderInfo.user_detail.provider?$.productUrl="".concat(e.$env.rcsUrl,"/products/").concat(S.id):"RTR"===S.type?$.productUrl="".concat(e.$env.mkpUrl.replace("https://","https://m-").replace("https://m-wwww","https://m"),"/restaurant/product/").concat(S.id):$.productUrl="".concat(e.$env.mkpUrl,"/product/").concat(S.seo_sn,"/").concat(S.id),$})):[]},platform:function(){return this.orderUserInfo?this.platformsMapping[this.orderUserInfo.provider]:null},platformName:function(){return this.platform?this.$t("platform.".concat(this.platform)):null}}),methods:{cancelEditCost:function(e){var t,a=Object.keys(this.bookings[e].cost).pop();t=a?{edit:!1,code:a,price:this.bookings[e].cost[a]}:{edit:!1,code:"HKD",price:0},this.bookingCost.splice(e,1,t)},submitEditCost:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s,l;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=t.orderInfo.product_bookings[e],n){a.next=3;break}return a.abrupt("return");case 3:if(!t.costChangingMap[e]){a.next=5;break}return a.abrupt("return");case 5:return t.costChangingMap=Object(F["a"])(Object(F["a"])({},t.costChangingMap),{},Object(Ot["a"])({},e,!0)),a.prev=6,r=t.bookingCost[e],o=r.code,i=r.price,a.next=11,t.$api.order.saveBookingCost(Object(F["a"])(Object(F["a"])({},n),{},{cost:Object(Ot["a"])({},o,i)}));case 11:s=a.sent,l=s.cost,t.orderInfo.product_bookings.splice(e,1,Object(F["a"])(Object(F["a"])({},n),{},{cost:l})),t.$message.success(t.$t("Save successfully")),t.getOrderInfo(),a.next=21;break;case 18:a.prev=18,a.t0=a["catch"](6),t.$message.error(t.$t("Save failed"));case 21:return a.prev=21,t.costChangingMap=Object(F["a"])(Object(F["a"])({},t.costChangingMap),{},Object(Ot["a"])({},e,!1)),a.finish(21);case 24:case"end":return a.stop()}}),a,null,[[6,18,21,24]])})))()},onCurrencySelect:function(e,t){this.bookingCost[e].code=t},getCostPrice:function(e){var t=e.cost,a=Object.keys(t).pop();return a?{code:a,price:e.cost[a]}:{}},getCurrencies:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.currenciesLoading=!0,t.prev=1,t.next=4,e.$api.currency.getCurrencies({page_size:500,page:1});case 4:a=t.sent,e.currencies=a.results;case 6:return t.prev=6,e.currenciesLoading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},isSelfPurchase:function(e){var t;return!!e&&(null===e||void 0===e||null===(t=e.productCurrent)||void 0===t?void 0:t.is_self_purchased)},isTvSelfPurchase:function(e){var t,a;return!!e&&(null===e||void 0===e||null===(t=e.snapshot)||void 0===t||null===(a=t.warehouse)||void 0===a?void 0:a.is_self_warehouse)},onVoucherSave:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o,i,s,l,c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=a.orderInfo.product_bookings.find((function(t){return t.id===e.id})),r){n.next=3;break}return n.abrupt("return");case 3:return n.prev=3,n.next=6,a.$api.order.saveBookingVoucher(Object(F["a"])(Object(F["a"])({},r),{},{voucher:t,status:5}));case 6:o=n.sent,i=o.voucher,s=o.status,l=o.payment,c=a.orderInfo.product_bookings.findIndex((function(t){return t.id===e.id})),a.orderInfo.product_bookings.splice(c,1,Object(F["a"])(Object(F["a"])({},r),{},{voucher:i,status:s})),a.orderInfo=Object(F["a"])(Object(F["a"])({},a.orderInfo),{},{status:l.status}),a.showVoucherLinkUploader=!1,a.$message.success(a.$t("Save successfully")),a.getOrderInfo(),n.next=21;break;case 18:n.prev=18,n.t0=n["catch"](3),a.$message.error(a.$t("Save failed"));case 21:case"end":return n.stop()}}),n,null,[[3,18]])})))()},onSelfPickupSave:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o,i,s,l,c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=a.orderInfo.product_bookings.find((function(t){return t.id===e.id})),r){n.next=3;break}return n.abrupt("return");case 3:return n.prev=3,n.next=6,a.$api.order.saveBookingVoucher(Object(F["a"])(Object(F["a"])({},r),{},{voucher:{note:t},status:5}));case 6:o=n.sent,i=o.voucher,s=o.status,l=o.payment,c=a.orderInfo.product_bookings.findIndex((function(t){return t.id===e.id})),a.orderInfo.product_bookings.splice(c,1,Object(F["a"])(Object(F["a"])({},r),{},{voucher:i,status:s})),a.orderInfo=Object(F["a"])(Object(F["a"])({},a.orderInfo),{},{status:l.status}),a.showSelfPickup=!1,a.$message.success(a.$t("Save successfully")),a.getOrderInfo(),n.next=21;break;case 18:n.prev=18,n.t0=n["catch"](3),a.$message.error(a.$t("Save failed"));case 21:case"end":return n.stop()}}),n,null,[[3,18]])})))()},bookingRefundedAll:function(e){if(!this.orderInfo)return!1;var t=this.orderInfo,a=t.paid_amount,n=t.refunded_amount,r=n>=a,o=e.paid_amount,i=e.refunded_amount,s=o&&i>=o;return!(!r&&!s)},hasDiscount:function(e,t){return e-t!==0||t>0},onBookingStatusChange:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(9!==t&&10!==t){n.next=4;break}return a.onRefund(e),a.defaultRefundStatus=t,n.abrupt("return");case 4:if(!a.bookingStatusChanging){n.next=6;break}return n.abrupt("return");case 6:if(a.bookingStatusChanging=!0,n.prev=7,r=a.orderInfo.product_bookings.find((function(t){return t.id===e.id})),!r){n.next=16;break}return n.next=12,a.$api.order.saveBookingStatus(Object(F["a"])(Object(F["a"])({},r),{},{status:t}));case 12:o=a.orderInfo.product_bookings.findIndex((function(t){return t.id===e.id})),a.orderInfo.product_bookings.splice(o,1,Object(F["a"])(Object(F["a"])({},r),{},{status:t})),a.$message.success(a.$t("Save successfully")),a.getOrderInfo();case 16:n.next=21;break;case 18:n.prev=18,n.t0=n["catch"](7),a.$message.error(a.$t("Save failed"));case 21:return n.prev=21,a.bookingStatusChanging=!1,n.finish(21);case 24:case"end":return n.stop()}}),n,null,[[7,18,21,24]])})))()},getBookingStatus:function(e){return this.$t(ge[e])},clipboardSuccessHandler:function(){this.$notify({title:this.$t("Copied"),message:this.$t("Copied secret successfully"),type:"success"})},clipboardErrorHandler:function(){this.$notify.error({title:this.$t("Failed"),message:this.$t("Fail to copy secret")})},editVouchers:function(e){this.editingBooking=e,this.showEditingVoucher=!0},editDeliveryTracking:function(e){this.editingBooking=e,this.showEditingDeliveryTracking=!0},editRestCode:function(e){this.editingBooking=e,this.showBookingCode=!0},editVoucherLink:function(e){this.editingBooking=e,this.showVoucherLinkUploader=!0},editSelfPickup:function(e){this.editingBooking=e,this.showSelfPickup=!0},getOrderInfo:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.orderInfoLoading=!0,t.prev=1,t.next=4,e.$api.order.getOrdeInfo(e.$route.params.id);case 4:a=t.sent,e.orderInfo=a,e.bookingCost=a.product_bookings.map((function(e){var t=Object.keys(e.cost).pop();return t?{edit:!1,code:t,price:e.cost[t]}:{edit:!1,code:"HKD",price:0}}));case 7:return t.prev=7,e.orderInfoLoading=!1,t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[1,,7,10]])})))()},onCommentToUserEdit:function(){this.showCommentToUser=!0},onNoteEdit:function(){this.showEditingNote=!0},onRefund:function(e){this.editingBooking=e,this.showRefund=!0},onCommentToUserSave:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={id:t.orderInfo.id,remark_to_customer:e},a.prev=1,a.next=4,t.$api.order.saveCommentToUser(n);case 4:t.orderInfo=Object(F["a"])(Object(F["a"])({},t.orderInfo),{},{remark_to_customer:e}),t.showCommentToUser=!1,t.$message.success(t.$t("Save successfully")),a.next=12;break;case 9:a.prev=9,a.t0=a["catch"](1),t.$message.error(t.$t("Save failed"));case 12:case"end":return a.stop()}}),a,null,[[1,9]])})))()},onNoteSave:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={id:t.orderInfo.id,note:e},a.prev=1,a.next=4,t.$api.order.saveOrderNote(n);case 4:t.orderInfo=Object(F["a"])(Object(F["a"])({},t.orderInfo),{},{note:e}),t.showEditingNote=!1,t.$message.success(t.$t("Save successfully")),a.next=12;break;case 9:a.prev=9,a.t0=a["catch"](1),t.$message.error(t.$t("Save failed"));case 12:case"end":return a.stop()}}),a,null,[[1,9]])})))()},onDeliveryTrackSave:function(e,t){var a=this;return Object(L["a"])(regeneratorRuntime.mark((function n(){var r,o,i,s,l,c,u;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=a.orderInfo.product_bookings.find((function(t){return t.id===e.id})),r){n.next=3;break}return n.abrupt("return");case 3:return n.prev=3,n.next=6,a.$api.order.saveBookingVoucher(Object(F["a"])(Object(F["a"])({},r),{},{courier_company:t.courier_company,track_number:t.track_number,status:5}));case 6:o=n.sent,i=o.courier_company,s=o.track_number,l=o.status,c=o.payment,u=a.orderInfo.product_bookings.findIndex((function(t){return t.id===e.id})),a.orderInfo.product_bookings.splice(u,1,Object(F["a"])(Object(F["a"])({},r),{},{courier_company:i,track_number:s,status:l})),a.orderInfo=Object(F["a"])(Object(F["a"])({},a.orderInfo),{},{status:c.status}),a.showEditingDeliveryTracking=!1,a.$message.success(a.$t("Save successfully")),a.getOrderInfo(),n.next=22;break;case 19:n.prev=19,n.t0=n["catch"](3),a.$message.error(a.$t("Save failed"));case 22:case"end":return n.stop()}}),n,null,[[3,19]])})))()},onRefundSave:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s,l,c,u,d,p,m;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=e.booking,r=e.status,o=e.amount,i=e.note,s=t.orderInfo.product_bookings.find((function(e){return e.id===n.id})),s){a.next=4;break}return a.abrupt("return");case 4:return a.prev=4,a.next=7,t.$api.order.saveBookingRefund(Object(F["a"])(Object(F["a"])({},s),{},{refund_amount:o,refund_note:i,refund_requested_dt:Vt()().format("YYYY-MM-DD HH:mm:ss"),status:r}));case 7:l=a.sent,c=l.refunded_amount,u=l.refunding_amount,d=l.payment,p=l.refund_note,m=t.orderInfo.product_bookings.findIndex((function(e){return e.id===n.id})),t.orderInfo.product_bookings.splice(m,1,Object(F["a"])(Object(F["a"])({},s),{},{refunded_amount:c,refunding_amount:u,refund_note:p})),t.orderInfo=Object(F["a"])(Object(F["a"])({},t.orderInfo),{},{status:d.status,refunded_amount:d.refunded_amount,refunding_amount:d.refunding_amount,refund_note:i}),t.showRefund=!1,t.$message.success(t.$t("Save successfully")),t.getOrderInfo(),a.next=23;break;case 20:a.prev=20,a.t0=a["catch"](4),t.$message.error(t.$t("Save failed"));case 23:case"end":return a.stop()}}),a,null,[[4,20]])})))()}},created:function(){this.getOrderInfo(),this.getCurrencies()}},O_=P_,I_=(a("61c1"),Object(R["a"])(O_,Th,Dh,!1,null,"83515bb8",null)),R_=I_.exports,E_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"booking-manage-page"},[a("router-view")],1)},M_=[],N_={},j_=N_,A_=(a("8973"),Object(R["a"])(j_,E_,M_,!1,null,"7f17cac8",null)),L_=A_.exports,F_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"code-list"},[a("SearchForm",{on:{change:e.onSearchChange,export:e.onExport}}),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.searchLoading||e.exportLoading,expression:"searchLoading || exportLoading"}],attrs:{data:e.mappedCodeList,"tooltip-effect":"dark",stripe:"",height:"100%"},on:{"selection-change":e.onSelectionChange,"sort-change":e.onSortChange}},[a("el-table-column",{attrs:{align:"center",label:e.$t("E-CODE"),prop:"code"}}),a("el-table-column",{attrs:{align:"center",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){var n;return[a("span",{class:(n={"code-status":!0},n["code-status--"+t.row.status]=!0,n)},[e._v(e._s(e.$t(""+t.row.status)))])]}}])}),a("el-table-column",{attrs:{align:"center",label:e.$t("Booking #"),prop:"booking.sn"}}),a("el-table-column",{attrs:{align:"center",label:e.$t("Booking item"),prop:"booking.product_title"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.row.booking&&t.row.booking.product_title,placement:"top"}},[a("div",[e._v(e._s(t.row.booking&&t.row.booking.product_title))])])]}}])}),a("el-table-column",{attrs:{align:"center",label:e.$t("Valid Period")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"date-valid-start"},[e._v(e._s(e._f("date")(t.row.valid_start_dt)))]),a("div",{staticClass:"date-valid-end"},[e._v(e._s(e._f("date")(t.row.valid_end_dt)))])]}}])}),a("el-table-column",{attrs:{align:"center",label:e.$t("Redeem time"),prop:"redeem_dt",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("date")(t.row.redeem_dt))+" ")]}}])}),a("el-table-column",{attrs:{align:"center",label:e.$t("Redeem shop")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.getShopName(t.row.redeem_poi&&t.row.redeem_poi.name),placement:"top-start"}},[a("div",[e._v(e._s(e.getShopName(t.row.redeem_poi&&t.row.redeem_poi.name)))])])]}}])})],1)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},U_=[],z_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{attrs:{inline:!0,model:e.formModel,size:"mini"}},[a("el-row",[a("el-form-item",[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"daterange",lang:e.$i18n.locale,"range-separator":e.$t("to"),"start-placeholder":e.$t("Redeem date"),"end-placeholder":e.$t("Redeem date")},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("Status"),clearable:!1,"collapse-tags":""},on:{change:e.onSearch},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.bookingCodeStatus,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{staticClass:"item-export"},[a("el-button",{attrs:{type:"primary"},on:{click:e.onExport}},[e._v(e._s(e.$t("Export")))])],1),a("el-form-item",[a("el-input",{staticClass:"input-with-select",nativeOn:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onSearch.apply(null,arguments)}},model:{value:e.keyWord,callback:function(t){e.keyWord=t},expression:"keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend",placeholder:e.$t("Status")},slot:"prepend",model:{value:e.keyWordType,callback:function(t){e.keyWordType=t},expression:"keyWordType"}},[a("el-option",{attrs:{label:e.$t("ECode"),value:"code_id"}}),a("el-option",{attrs:{label:e.$t("BookingSn"),value:"booking_sn"}}),a("el-option",{attrs:{label:e.$t("Booking item"),value:"booking_item"}})],1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.hasSearchData},on:{click:e.onSearch}},[e._v(e._s(e.$t("Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("Clear")))]):e._e()],1)],1)],1)},q_=[],H_={code_id:null,start_redeem_dt:null,end_redeem_dt:null,booking_sn:null,status:null},B_={data:function(){return{dateRange:[],keyWordType:"code_id",keyWord:null,formModel:Object.assign({},H_)}},computed:{bookingCodeStatus:function(){var e=this,t=Object.keys(ve).map((function(t){return{label:e.$t(t),value:t}}));return t},searchData:function(){var e={};if(this.dateRange&&(this.dateRange[0]&&(e.start_redeem_dt=this.dateRange[0]),this.dateRange[1]&&(e.end_redeem_dt=this.dateRange[1])),this.formModel.status&&(e.status=this.formModel.status),this.keyWord&&this.keyWord.trim().length)switch(this.keyWordType){case"code_id":e.code_id=this.keyWord;break;case"booking_sn":e.booking_sn=this.keyWord;break;case"booking_item":e.booking_item=this.keyWord;break}return e},hasSearchData:function(){return Object.keys(this.searchData).length}},methods:{onClearClick:function(){this.dateRange=[],this.keyWordType="code_id",this.keyWord=null,Object.assign(this.formModel,H_),this.onSearch()},onSearch:function(){this.$emit("change",this.searchData)},onExport:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$emit("export",e.searchData);case 1:case"end":return t.stop()}}),t)})))()}}},K_=B_,V_=(a("f0a1"),Object(R["a"])(K_,z_,q_,!1,null,"21c6baf8",null)),Y_=V_.exports,W_={components:{SearchForm:Y_},data:function(){return{codeList:[],searchLoading:!1,exportLoading:!1,selectedIds:[],searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:{mappedCodeList:function(){return this.codeList.map((function(e){return e}))}},created:function(){this.getCodeList()},methods:{getShopName:function(e){if(!e)return"";var t=e[this.$i18n.locale];return t||(t=e.zh_HK),t||(t=e.en_US),t||(t=e.zh_CN),t},getCodeList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.searchLoading){t.next=2;break}return t.abrupt("return");case 2:return a=e.ordering,n=e.searchData||{},r=Object(F["a"])({page_size:e.pageSize,page:e.currentPage,ordering:a},n),e.searchLoading=!0,t.prev=6,t.next=9,e.$api.bookingCode.getBookingCodes(r);case 9:o=t.sent,e.codeList=o.results,e.total=o.count;case 12:return t.prev=12,e.searchLoading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[6,,12,15]])})))()},onSelectionChange:function(e){this.selectedIds=e.map((function(e){return e.id}))},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getCodeList()},onExport:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function e(){var a,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.exportLoading){e.next=2;break}return e.abrupt("return");case 2:return t.exportLoading=!0,e.prev=3,a=t.ordering,n=Object(F["a"])(Object(F["a"])({},t.searchData),{},{ordering:a,locale:t.$i18n.locale}),e.next=8,t.$api.bookingCode.getBookingExcel(n);case 8:r=e.sent,Eo()(r,"BookCode.xlsx","application/vnd.ms-excel");case 10:return e.prev=10,t.exportLoading=!1,e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[3,,10,13]])})))()},onDeleteConfirm:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.code.batchDelete({code_ids:e.selectedIds});case 2:e.getCodeList();case 3:case"end":return t.stop()}}),t)})))()},onChangeStatus:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.code.updateStatus({code_ids:t.selectedIds,status:e});case 2:t.getCodeList();case 3:case"end":return a.stop()}}),a)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getCodeList()},onPageSizeChange:function(e){this.pageSize=e,this.getCodeList()},onSortChange:function(e){var t=e.prop,a=e.order;"redeem_dt"===t&&(this.ordering="ascending"===a?"redeem_dt":"descending"===a?"-redeem_dt":null,this.currentPage=1,this.getCodeList())}}},G_=W_,Q_=(a("ee23"),Object(R["a"])(G_,F_,U_,!1,null,"461d6ed2",null)),J_=Q_.exports,X_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"operation-center"},[a("router-view")],1)},Z_=[],ev={},tv=ev,av=(a("3692"),Object(R["a"])(tv,X_,Z_,!1,null,"13f16fae",null)),nv=av.exports,rv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"operation-center-wrapper"},[a("el-menu",{staticClass:"operation-nav",attrs:{"default-active":"OperationBannerMKPHomepage"}},[a("h3",[e._v(e._s(e.$t("sidebar.MKP homepage")))]),a("el-menu-item",{attrs:{index:"OperationBannerMKPHomepage",route:{name:"OperationBannerMKPHomepage"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Banner")))])])],1),a("div",{staticClass:"operation-center-content"},[a("router-view")],1)],1)},ov=[],iv={},sv=iv,lv=(a("d240"),Object(R["a"])(sv,rv,ov,!1,null,"79cef4b0",null)),cv=lv.exports,uv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("div",{staticClass:"banner-platform"},[a("el-select",{attrs:{size:"mini",multiple:"",placeholder:e.$t("Platform"),clearable:!0},on:{clear:function(t){e.platform=[]},change:e.onPlatformChange},model:{value:e.platform,callback:function(t){e.platform=t},expression:"platform"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-tabs",{directives:[{name:"show",rawName:"v-show",value:e.hasBanner(),expression:"hasBanner()"}],attrs:{type:"card","before-leave":e.beforeLeave},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name}},[a("div",{staticClass:"coupon-box"},[e.showInfo?a("banner-uploader",{ref:"banneruploader"+t.name,refInFor:!0,attrs:{channel:e.channel,banners:t.banners,lang:t.name},on:{change:function(a){return e.bannersChanged(t,a)}}}):e._e()],1)])})),1),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.hasBanner(),expression:"!hasBanner()"}],staticClass:"banner-empty"},[e._v(" "+e._s(e.$t("NoData"))+" ")]),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))]),a("el-button",{attrs:{size:"small"},on:{click:e.add}},[e._v(e._s(e.$t("Add")))])],1)],1)},dv=[],pv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"banner-manage-info"},e._l(e.bannersEditing,(function(t,n){return a("el-form",{key:n,ref:"bannersRef-"+n,refInFor:!0,attrs:{model:t,size:"small","label-position":"right","label-width":"120px","show-message":!1,"inline-message":!0}},[a("h3",[e._v(e._s(e.$t("Banner")+"_"+(n+1))+" "),a("el-button",{staticStyle:{float:"right"},attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.remove(n)}}},[e._v(e._s(e.$t("Delete")))])],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Priority")+":",prop:"priority"}},[a("el-input-number",{attrs:{precision:0,placeholder:"1-100","controls-position":"right",min:1,max:100},on:{change:e.change},model:{value:t.priority,callback:function(a){e.$set(t,"priority",a)},expression:"banner.priority"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("PC")+"):",prop:"image_url"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1960,height:400},on:{change:function(a){return e.imageChange(t,n,a)}},model:{value:t.image_url,callback:function(a){e.$set(t,"image_url",a)},expression:"banner.image_url"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("Mobile")+"):",prop:"mobile_image_url"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1065,height:600},on:{change:function(a){return e.mobileImageChange(t,n,a)}},model:{value:t.mobile_image_url,callback:function(a){e.$set(t,"mobile_image_url",a)},expression:"banner.mobile_image_url"}})],1),a("el-form-item",{attrs:{label:e.$t("Trigger link")+":",prop:"href"}},[a("el-input",{attrs:{disabled:!t.mobile_image_url&&!t.image_url},on:{change:e.change},model:{value:t.href,callback:function(a){e.$set(t,"href",a)},expression:"banner.href"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("https://")])])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.internal_platforms,callback:function(a){e.$set(t,"internal_platforms",a)},expression:"banner.internal_platforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.external_platforms,callback:function(a){e.$set(t,"external_platforms",a)},expression:"banner.external_platforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1)],1)})),1)},mv=[],fv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"image-uploader"},[e.url?a("div",{staticClass:"image-list"},[a("div",{staticClass:"image-list-item"},[a("div",{staticClass:"image-container",style:{backgroundImage:"url('"+e.url+"')"}}),a("div",{staticClass:"image-list-item-actions"},[a("button",{staticClass:"iconfont icon-icon_online",attrs:{type:"button"},on:{click:function(t){return e.handlePictureCardPreview()}}}),a("button",{staticClass:"iconfont icon-icon_delete",attrs:{type:"button"},on:{click:function(t){return e.handleRemove()}}})])])]):e._e(),a("el-upload",{ref:e.uploaderRef,staticClass:"uploader",attrs:{action:e.actionUrl,data:{path:"option-center"},accept:e.accept,"show-file-list":!1,"before-upload":e.beforeUpload,"on-success":e.uploadSuccess}},[a("div",{staticClass:"upload-container",attrs:{slot:"trigger"},slot:"trigger"},[a("el-button",{attrs:{size:"small"}},[e._v(e._s(e.$t("productmanage.common.UploadImage")))])],1),a("div",{staticClass:"el-upload__text"},[e._v(e._s(e.$t("< {size}KB {width}*{height} px {types} only",{size:e.size,width:e.width,height:e.height,types:e.types})))])]),a("el-dialog",{attrs:{visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.onImageDialogClose}},[a("div",{staticClass:"image-zoom",style:{backgroundImage:"url('"+e.dialogImageUrl+"')"}})])],1)},gv=[],hv={props:{width:{type:Number,default:1065},height:{type:Number,default:600},size:{type:Number,default:500},accept:{type:String,default:"image/png,image/jpeg,image/jpg"},value:{type:String}},data:function(){var e=Date.now();return{uploaderRef:"uploader".concat(e),filstList:[],url:this.value,dialogImageUrl:"",dialogVisible:!1,actionUrl:this.$env.apiUrl+"/file_upload"}},computed:{types:function(){return this.accept?this.accept.split(",").map((function(e){return e.split("/")[1]})).filter((function(e){return e})).map((function(e){return e.toUpperCase()})).join(" "):""},tip:function(){var e=this.size,t=this.width,a=this.height,n=this.types;return this.$t("< {size}KB {width}*{height} px {types} only",{size:e,width:t,height:a,types:n})}},watch:{value:function(){this.url=this.value}},methods:{onImageDialogClose:function(){this.dialogVisible=!1},handlePictureCardPreview:function(){this.dialogImageUrl=this.url,this.dialogVisible=!0},handleRemove:function(){this.url=null,this.handleImage()},uploadSuccess:function(e,t,a){this.url=e.file[0].url,this.handleImage()},handleImage:function(){this.$emit("input",this.url),this.$emit("change",this.url)},getImage:function(e){},beforeUpload:function(e){var t=this.accept.split(",").indexOf(e.type)>-1,a=!0;return t&&a?new Promise((function(t,a){var n=new FileReader;n.onload=function(e){var n=e.target.result,r=new Image;r.onload=function(e){t()},r.onabort=r.onerror=function(e){a(new Error("用户取消上传"))},r.src=n},n.onabort=n.onerror=function(e){a(new Error("用户取消上传"))},n.readAsDataURL(e)})):(this.$message.error(this.tip),!1)}}},_v=hv,vv=(a("9c7e"),Object(R["a"])(_v,fv,gv,!1,null,"71752b64",null)),bv=vv.exports,yv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{href:"",priority:1,mobile_image_url:"",image_url:"",internal_platforms:t,external_platforms:e,supporting_provider:[].concat(Object(Xc["a"])(e),Object(Xc["a"])(t))}},Cv={components:{ImageUploader:bv},props:{banners:{type:Array}},mounted:function(){this.bannersEditing=this.getMappedBanners()},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),data:function(){return{bannersEditing:this.getMappedBanners()}},methods:{getMappedBanners:function(){var e=this.banners.map((function(e){return Object(F["a"])(Object(F["a"])({},yv()),e)})),t=this.externalPlatforms,a=this.internalPlatforms;return t&&a?(e.forEach((function(e){e.href&&(e.href=e.href.replace(/^(https:\/\/)+/g,""))})),e):[]},imageChange:function(e,t,a){e.image_url=a,this.bannersEditing.splice(t,1,Object(F["a"])({},e)),this.$emit("change",Object(Xc["a"])(this.bannersEditing))},mobileImageChange:function(e,t,a){e.mobile_image_url=a,this.bannersEditing.splice(t,1,Object(F["a"])({},e)),this.$emit("change",Object(Xc["a"])(this.bannersEditing))},change:function(){this.$emit("change",Object(Xc["a"])(this.bannersEditing))},add:function(e){var t=this,a=[],n=[];e.forEach((function(e){t.externalPlatforms.findIndex((function(t){return t.value===e}))>-1&&a.push(e)})),e.forEach((function(e){t.internalPlatforms.findIndex((function(t){return t.value===e}))>-1&&n.push(e)})),this.bannersEditing.push(yv(a,n))},hasBanner:function(){return this.bannersEditing.length>0},remove:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$confirm(t.$t("Are you sure to delete?"));case 3:a.next=7;break;case 5:a.prev=5,a.t0=a["catch"](0);case 7:t.bannersEditing.splice(e,1),t.change();case 9:case"end":return a.stop()}}),a,null,[[0,5]])})))()}},watch:{banners:function(e){e&&(this.bannersEditing=this.getMappedBanners())}}},kv=Cv,wv=Object(R["a"])(kv,pv,mv,!1,null,null,null),$v=wv.exports,Sv={components:{BannerUploader:$v},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms","platforms"])),data:function(){var e=Oe["Main Page"];return{loading:!1,changed:!1,showInfo:!0,languagePageList:["en_US","zh_CN","zh_HK"],editableTabsValue:"en_US",platform:[],channel:e,editableTabs:[{title:this.$t("lang.en_US"),name:"en_US",banners:[]},{title:this.$t("lang.zh_CN"),name:"zh_CN",banners:[]},{title:this.$t("lang.zh_HK"),name:"zh_HK",banners:[]}]}},methods:{hasBanner:function(){var e=this,t=!1;return this.languagePageList.forEach((function(a){e.$refs["banneruploader".concat(a)]&&e.$refs["banneruploader".concat(a)].forEach((function(e){t|=e.hasBanner()}))})),t},onPlatformChange:function(){this.getBanner()},bannerPlatformInit:function(e){var t=this;e.forEach((function(e){e.internal_platforms=[],e.external_platforms=[],e.priority=e.flan.priority||1;var a=t.externalPlatforms,n=t.internalPlatforms;a&&n&&e.supporting_provider.forEach((function(t){n.findIndex((function(e){return e.value===t}))>-1&&e.internal_platforms.findIndex((function(e){return e===t}))<0&&e.internal_platforms.push(t),a.findIndex((function(e){return e.value===t}))>-1&&e.external_platforms.findIndex((function(e){return e===t}))<0&&e.external_platforms.push(t)}))}))},getBanner:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n={channel:a},e.platform&&e.platform.length&&(n.platforms=e.platform.join(",")),t.prev=4,t.next=7,Qr.operation.getBanner(n);case 7:r=t.sent,o=r.banner,e.bannerPlatformInit(o.en_US),e.bannerPlatformInit(o.zh_CN),e.bannerPlatformInit(o.zh_HK),e.editableTabs=[{title:e.$t("lang.en_US"),name:"en_US",banners:o.en_US||[]},{title:e.$t("lang.zh_CN"),name:"zh_CN",banners:o.zh_CN||[]},{title:e.$t("lang.zh_HK"),name:"zh_HK",banners:o.zh_HK||[]}],t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](4);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,15,17,20]])})))()},urlPrefix:function(e){return e?e.indexOf("http")<0?"https://"+e:(e=e.replace(/^(https:\/\/)+/g,"https://"),e):""},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={},n=e.channel,e.editableTabs.forEach((function(t){var r=t.name,o=t.banners;a[r]=o.filter((function(e){return e.image_url||e.mobile_image_url})).map((function(t){var a=Object(F["a"])(Object(F["a"])({},t),{},{href:e.urlPrefix(t.href),channel:n,supporting_provider:[].concat(Object(Xc["a"])(t.internal_platforms),Object(Xc["a"])(t.external_platforms))});return t.priority&&(a.flan={priority:t.priority}),delete a.internal_platforms,delete a.external_platforms,a}))})),e.loading=!0,r={banner:a},o={channel:n},t.prev=6,t.next=9,Qr.operation.saveBanner(r,o);case 9:e.$message.success(e.$t("Save successfully")),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](6),e.$message.error(e.$t("Save failed"));case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[6,12,15,18]])})))()},add:function(e){var t=this;this.$refs["banneruploader".concat(this.editableTabsValue)].forEach((function(e){e.add(Object(Xc["a"])(t.platform))}))},bannersChanged:function(e,t){e.banners=t},beforeLeave:function(e,t){this.editableTabsValue=e}},mounted:function(){this.getBanner()},beforeMount:function(){var e=this;window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))}))}},xv=Sv,Tv=Object(R["a"])(xv,uv,dv,!1,null,"7dcc50cf",null),Dv=Tv.exports,Pv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"operation-center-wrapper"},[a("el-menu",{staticClass:"operation-nav",attrs:{"default-active":e.$route.name,router:""}},[a("h3",[e._v(e._s(e.$t("sidebar.Rest channel")))]),a("el-menu-item",{attrs:{index:"OperationBannerRestChannel",route:{name:"OperationBannerRestChannel"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Banner")))])]),a("el-menu-item",{attrs:{index:"OperationRestPromotion",route:{name:"OperationRestPromotion"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Promotion")))])]),a("el-menu-item",{attrs:{index:"OperationRestThemeList",route:{name:"OperationRestThemeList"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Theme list")))])]),a("el-menu-item",{attrs:{index:"OperationRestBottomTag",route:{name:"OperationRestBottomTag"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Bottom tag")))])])],1),a("div",{staticClass:"operation-center-content"},[a("router-view")],1)],1)},Ov=[],Iv={mounted:function(){},data:function(){return{}}},Rv=Iv,Ev=(a("9e90"),Object(R["a"])(Rv,Pv,Ov,!1,null,"4a06e33f",null)),Mv=Ev.exports,Nv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("el-form",{ref:"bottomTag",attrs:{model:e.formModel,size:"small",rules:e.rules,"form-model":e.formModel,"label-position":"right","label-width":"120px"}},[a("h3",[e._v(e._s(e.$t("Bottom tag")))]),a("el-form-item",{attrs:{label:e.$t("Tag")+":",prop:"bottom_tag"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.searching,expression:"searching"}],staticClass:"select-long",attrs:{placeholder:e.formModel.bottom_tag.length?"":e.$t("Choose up to 8 tags, only support tags that related more than 5 products"),"multiple-limit":8,multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.tagSearch},model:{value:e.formModel.bottom_tag,callback:function(t){e.$set(e.formModel,"bottom_tag",t)},expression:"formModel.bottom_tag"}},e._l(e.getRes()(e.tags),(function(t){return a("el-option",{key:t.value,attrs:{disabled:t.related_products_num<6,label:t.label,value:t.value}},[a("span",{staticStyle:{width:"100%","padding-right":"230px"}},[e._v(e._s(t.label))]),a("span",{staticStyle:{position:"absolute",width:"230px","padding-right":"40px","text-align":"right",right:"0",top:"0",color:"#8492a6","font-size":"13px"}},[e._v(e._s(e.$t(2>t.related_products_num?"{count} related product":"{count} related products",{count:t.related_products_num})))])])})),1)],1)],1),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],1)},jv=[],Av=Oe.Restaurant,Lv={data:function(){return{channel:Av,formModel:{channel:Av,bottom_tag:[]},tags:[],loading:!1,searching:!1}},computed:{rules:function(){return{bottom_tag:[{required:!0,trigger:"change",message:this.$t("ItsRequired")}]}}},methods:{getBottom:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n={channel:a},t.prev=3,t.next=6,Qr.operation.getBottom(n);case 6:r=t.sent,o=r.bottom_tag,e.formModel.bottom_tag=o.map((function(e){return e.id})),e.tagSearch("",e.formModel.bottom_tag.join(",")),t.next=14;break;case 12:t.prev=12,t.t0=t["catch"](3);case 14:return t.prev=14,e.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[3,12,14,17]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,e.$refs.bottomTag.validate();case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(!a){t.next=26;break}return e.loading=!0,t.prev=11,n={bottom_tag:e.formModel.bottom_tag},r=e.channel,o={channel:r},t.next=17,Qr.operation.saveBottom(n,o);case 17:e.$message.success(e.$t("Save successfully")),t.next=23;break;case 20:t.prev=20,t.t1=t["catch"](11),e.$message.error(e.$t("Save failed"));case 23:return t.prev=23,e.loading=!1,t.finish(23);case 26:case"end":return t.stop()}}),t,null,[[1,6],[11,20,23,26]])})))()},getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id,related_products_num:t.related_products_num}}));return a}},tagSearch:function(e,t){var a=this;return this.searching=!0,new Promise((function(n,r){if(""!==e||t){var o={status:"ACT",parent__synonyms__name:"Cuisine Type",related_products:!0};t?(o["id__in"]=t,o["page_size"]=t.split(",").length+20):o["synonyms__name__icontains"]=e;var i=a.$api.tag.getList(o);i.then((function(e){a.searching=!1,e.results&&(a.tags=e.results.map((function(e){for(var t in e.meta={},e.name)e.meta[t]=e.tag_path[t]+" - "+e.name[t];return e}))),n(a.tags)})),i.catch(r)}else a.searching=!1,n(a.tags),a.tags=[]}))}},mounted:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getBottom();case 2:case"end":return t.stop()}}),t)})))()}},Fv=Lv,Uv=(a("d0cf"),Object(R["a"])(Fv,Nv,jv,!1,null,"16df022f",null)),zv=Uv.exports,qv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("el-form",{ref:"promotion",attrs:{model:e.promotion,size:"small",rules:e.rules,"form-model":e.promotion,"label-position":"right","label-width":"120px"}},[a("h3",[e._v(e._s(e.$t("Promotion product list")))]),a("el-form-item",{attrs:{label:e.$t("Title")+":",prop:"meta.en_US.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.en_US.title,callback:function(t){e.$set(e.promotion.meta.en_US,"title",t)},expression:"promotion.meta.en_US.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_HK.title,callback:function(t){e.$set(e.promotion.meta.zh_HK,"title",t)},expression:"promotion.meta.zh_HK.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_CN.title,callback:function(t){e.$set(e.promotion.meta.zh_CN,"title",t)},expression:"promotion.meta.zh_CN.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Subtitle")+":",prop:"meta.en_US.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.en_US.sub_title,callback:function(t){e.$set(e.promotion.meta.en_US,"sub_title",t)},expression:"promotion.meta.en_US.sub_title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_HK.sub_title,callback:function(t){e.$set(e.promotion.meta.zh_HK,"sub_title",t)},expression:"promotion.meta.zh_HK.sub_title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_CN.sub_title,callback:function(t){e.$set(e.promotion.meta.zh_CN,"sub_title",t)},expression:"promotion.meta.zh_CN.sub_title"}})],1),a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"products"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.searching,expression:"searching"}],staticClass:"select-long",attrs:{placeholder:e.promotion.products.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.productsSearch},model:{value:e.promotion.products,callback:function(t){e.$set(e.promotion,"products",t)},expression:"promotion.products"}},e._l(e.getRes(e.productList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],1)},Hv=[],Bv={data:function(){var e=Oe["Restaurant"];return{loading:!1,searching:!1,productList:[],promotion:{is_main:!0,collection_type:Ie.Product,channel:e,meta:{en_US:{title:"",sub_title:""},zh_HK:{title:"",sub_title:""},zh_CN:{title:"",sub_title:""}},products:[]}}},computed:{rules:function(){var e=this.promotion.meta,t=e.en_US,a=e.zh_HK,n=e.zh_CN,r=function(e,t){return function(t,a,n){e?n():n(new Error)}},o=function(e,t){return function(e,a,n){t?n():n(new Error)}};return{"meta.en_US.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(t.title,t.sub_title)}],"meta.zh_HK.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(a.title,a.sub_title)}],"meta.zh_CN.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(n.title,n.sub_title)}],"meta.en_US.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(t.title,t.sub_title)}],"meta.zh_HK.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(a.title,a.sub_title)}],"meta.zh_CN.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(n.title,n.sub_title)}],products:[{required:!0,message:this.$t("ItsRequired")}]}}},methods:{getPromotion:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.promotion.channel,n={channel:a,is_main:!0},t.prev=3,t.next=6,Qr.operation.getPromotion(n);case 6:r=t.sent,o=r.collection,i=o[0],s=i.meta,l=i.products,e.promotion=o[0],s&&(e.promotion.meta=s),l&&(e.promotion.products=l.map((function(e){return e.id}))),e.productsSearch("",e.promotion.products.join(",")),t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](3);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[3,15,17,20]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u,d,p,m,f;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,e.$refs.promotion.validate();case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(n=e.promotion.meta,r=n.en_US,o=n.zh_HK,i=n.zh_CN,r.title||o.title||i.title){t.next=13;break}return e.$message.error(e.$t("Title is required")),t.abrupt("return");case 13:if(!a){t.next=30;break}return e.loading=!0,t.prev=15,s=e.promotion,l=s.is_main,c=s.collection_type,u=s.channel,d=s.meta,p=s.products,m=s.id,f={ordered_data:p,pois:[],is_main:l,collection_type:c,channel:u,meta:d},m&&(f.id=m),t.next=21,Qr.operation.savePromotion(f,{channel:u,is_main:l});case 21:e.$message.success(e.$t("Save successfully")),t.next=27;break;case 24:t.prev=24,t.t1=t["catch"](15),e.$message.error(e.$t("Save failed"));case 27:return t.prev=27,e.loading=!1,t.finish(27);case 30:case"end":return t.stop()}}),t,null,[[1,6],[15,24,27,30]])})))()},getStringLength:function(e){return null===e||void 0===e?0:e.trim().replace(/[^ -~]/g,"aa").length},getRes:function(e){var t=this,a=this.$i18n.locale,n=e.map((function(e){return{label:t.$options.filters.lang(e.details,a,"title"),value:e.id}}));return n},productsSearch:function(e,t){var a=this;return this.searching=!0,new Promise((function(n,r){if(""!==e||t){var o={scope:"EC",type:"RTR",status:"ACT"};t?(o["id__in"]=t,o["page_size"]=t.split(",").length+20):o["keyword"]=e;var i=a.$api.product.productList(o);i.then((function(e){a.searching=!1,e.results&&(a.productList=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e}))),n(a.productList)})),i.catch(r)}else a.searching=!1,n(a.productList),a.productList=[]}))},rejectUnneccissaryChar:function(e,t,a){var n=e.isComposing;if(!n){var r=this.promotion.meta[t][a],o=18;if(r.replace(/[^ -~]/g,"aa").length>o){var i=0,s=0;while(io)break;i++}this.promotion.meta[t][a]=r.substring(0,i)}}}},mounted:function(){this.getPromotion()}},Kv=Bv,Vv=(a("98e3"),Object(R["a"])(Kv,qv,Hv,!1,null,"78e56f2a",null)),Yv=Vv.exports,Wv=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[e._l(e.themeList,(function(t,n){return a("div",{key:n},[a("el-form",{ref:"themeRef",refInFor:!0,attrs:{model:t,size:"small",rules:e.getRules(t,n),"form-model":t,"label-position":"right","label-width":"120px","validate-on-rule-change":!1}},[a("h3",[e._v(e._s(e.$t("Theme"))+"_"+e._s(n+1))]),a("el-form-item",{attrs:{label:e.$t("Title")+":",prop:"meta.en_US.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"en_US","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"en_US","title")}.apply(null,arguments)}},model:{value:t.meta.en_US.title,callback:function(a){e.$set(t.meta.en_US,"title",a)},expression:"theme.meta.en_US.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_HK","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_HK","title")}.apply(null,arguments)}},model:{value:t.meta.zh_HK.title,callback:function(a){e.$set(t.meta.zh_HK,"title",a)},expression:"theme.meta.zh_HK.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_CN","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_CN","title")}.apply(null,arguments)}},model:{value:t.meta.zh_CN.title,callback:function(a){e.$set(t.meta.zh_CN,"title",a)},expression:"theme.meta.zh_CN.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("Mobile")+"):",prop:"images.base.title"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1125,height:270},on:{change:function(a){return e.imageChange(t,n,a)}},model:{value:t.images.base.title,callback:function(a){e.$set(t.images.base,"title",a)},expression:"theme.images.base.title"}})],1),a("el-form-item",{attrs:{label:e.$t("List type")+":",prop:"collection_type"}},[a("el-select",{attrs:{disabled:!0},on:{change:function(a){return e.onListTypeChange(t,a,n)}},model:{value:t.collection_type,callback:function(a){e.$set(t,"collection_type",a)},expression:"theme.collection_type"}},[a("el-option",{attrs:{label:e.$t("Restaurant"),value:e.COLLECTION_TYPE_CHOICE_VALUES.Restaurant}}),a("el-option",{attrs:{label:e.$t("Restaurant product"),value:e.COLLECTION_TYPE_CHOICE_VALUES.Product}})],1)],1),a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"data"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:t.searching,expression:"theme.searching"}],staticClass:"select-long",attrs:{placeholder:t.data.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":function(a){return e.productsSearch(a,null,t.collection_type,n)}},model:{value:t.data,callback:function(a){e.$set(t,"data",a)},expression:"theme.data"}},e._l(e.getRes(e.productList[n]||[]),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1)],1)})),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],2)},Gv=[],Qv=Oe.Restaurant,Jv=function(){return{channel:Qv,meta:{en_US:{title:""},zh_CN:{title:""},zh_HK:{title:""}},collection_type:Ie.Product,images:{base:{title:""}},data:[]}},Xv={components:{ImageUploader:bv},data:function(){var e=[Jv(),Jv(),Jv(),Jv()];return{channel:Qv,is_main:!1,languagePageList:["en_US","zh_CN","zh_HK"],themeList:e,productList:[],loading:!1,COLLECTION_TYPE_CHOICE_VALUES:Ie}},computed:{},methods:{getRules:function(e,t){var a=function(e,t,a){t?a():a(new Error)};return{"meta.en_US.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],"meta.zh_HK.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],"meta.zh_CN.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],data:[{required:!0,message:this.$t("ItsRequired")}]}},imageChange:function(e,t,a){a?this.themeList.splice(t,1,Object(F["a"])(Object(F["a"])({},e),{},{image:{base:{title:a}}})):this.themeList.splice(t,1,Object(F["a"])(Object(F["a"])({},e),{},{image:{base:{title:""}}}))},onListTypeChange:function(e,t,a){e.collection_type=t,e.data=[],this.productList[a]=[],this.themeList.splice(a,1,Object(F["a"])({},e))},getThemeList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n=e.is_main,r={channel:a,is_main:n},t.prev=3,t.next=6,Qr.operation.getTheme(r);case 6:o=t.sent,i=o.collection,i.forEach((function(t,a){e.languagePageList.forEach((function(e){t.meta[e]||(t.meta[e]={title:""})})),t.images&&t.images.base||(t.images={base:{title:""}}),t.collection_type||(t.collection_type=Ie.Product),t.collection_type===Ie.Product&&(t.data=t.products.map((function(e){return e.id}))),t.collection_type===Ie.Restaurant&&(t.data=t.pois.map((function(e){return e.id}))),e.productList[a]=[]})),e.themeList=[].concat(Object(Xc["a"])(i),Object(Xc["a"])(e.themeList)).slice(0,4),e.themeList.forEach((function(t,a){e.productsSearch("",t.data.join(","),t.collection_type,a)})),t.next=15;break;case 13:t.prev=13,t.t0=t["catch"](3);case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[3,13,15,18]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,Promise.all(e.$refs.themeRef.map((function(e){return e.validate()})));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(n=e.themeList,!n.length){t.next=15;break}if(r=!n.map((function(e){var t=e.meta,a=t.en_US,n=t.zh_HK,r=t.zh_CN;return[a.title,n.title,r.title].join("")})).join(""),!r){t.next=15;break}return e.$message.error(e.$t("Title is required")),t.abrupt("return");case 15:if(!a){t.next=32;break}return e.loading=!0,t.prev=17,o={theme:n.map((function(e){var t=e.meta,a=e.channel,n=e.images,r=e.collection_type,o=e.data,i=e.id,s={meta:t,is_main:!1,channel:a,images:n,collection_type:r,ordered_data:o};return i&&(s.id=i),r===Ie.Product&&(s.products=e.data,s.pois=[]),r===Ie.Restaurant&&(s.pois=e.data,s.products=[]),s}))},i=e.channel,s=e.is_main,l={channel:i,is_main:s},t.next=23,Qr.operation.saveTheme(o,l);case 23:e.$message.success(e.$t("Save successfully")),t.next=29;break;case 26:throw t.prev=26,t.t1=t["catch"](17),t.t1;case 29:return t.prev=29,e.loading=!1,t.finish(29);case 32:case"end":return t.stop()}}),t,null,[[1,6],[17,26,29,32]])})))()},getStringLength:function(e){return null===e||void 0===e?0:e.trim().replace(/[^ -~]/g,"aa").length},getRes:function(e){var t=this,a=this.$i18n.locale,n=e.map((function(e){return{label:t.$options.filters.lang(e.details,a,"title"),value:e.id}}));return n},updateProductList:function(e,t){this.productList.splice(t,1,e)},productsSearch:function(e,t,a,n){var r=this;return this.themeList[n].searching=!0,new Promise((function(o,i){if(""!==e||t){var s={scope:"EC",status:"ACT"};t?(s["id__in"]=t,s["page_size"]=t.split(",").length+20):s["keyword"]=e;var l=null;a===Ie.Product&&(s["type"]="RTR",l=r.$api.product.productList(s)),a===Ie.Restaurant&&(s["category__in"]="RTR",l=r.$api.poi.getPois(s)),l.then((function(e){if(r.themeList[n].searching=!1,e.results){var t=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e}));r.updateProductList(t,n)}o(r.productList[n])})),l.catch(i)}else r.themeList[n].searching=!1,o(r.productList[n]),r.updateProductList([],n)}))},rejectUnneccissaryChar:function(e,t,a,n){var r=e.isComposing;if(!r){var o=this.themeList[t].meta[a][n],i=18;if(o.replace(/[^ -~]/g,"aa").length>i){var s=0,l=0;while(si)break;s++}this.themeList[t].meta[a][n]=o.substring(0,s)}}}},mounted:function(){this.getThemeList()}},Zv=Xv,eb=(a("5031"),Object(R["a"])(Zv,Wv,Gv,!1,null,"20d4a196",null)),tb=eb.exports,ab=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("div",{staticClass:"banner-platform"},[a("el-select",{attrs:{size:"mini",multiple:"",placeholder:e.$t("Platform"),clearable:!0},on:{clear:function(t){e.platform=[]},change:e.onPlatformChange},model:{value:e.platform,callback:function(t){e.platform=t},expression:"platform"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-tabs",{directives:[{name:"show",rawName:"v-show",value:e.hasBanner(),expression:"hasBanner()"}],attrs:{type:"card","before-leave":e.beforeLeave},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name}},[a("div",{staticClass:"coupon-box"},[e.showInfo?a("banner-uploader",{ref:"banneruploader"+t.name,refInFor:!0,attrs:{channel:e.channel,banners:t.banners,lang:t.name},on:{change:function(a){return e.bannersChanged(t,a)}}}):e._e()],1)])})),1),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.hasBanner(),expression:"!hasBanner()"}],staticClass:"banner-empty"},[e._v(" "+e._s(e.$t("NoData"))+" ")]),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))]),a("el-button",{attrs:{size:"small"},on:{click:e.add}},[e._v(e._s(e.$t("Add")))])],1)],1)},nb=[],rb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"banner-manage-info"},e._l(e.bannersEditing,(function(t,n){return a("el-form",{key:n,ref:"bannersRef-"+n,refInFor:!0,attrs:{model:t,size:"small","label-position":"right","label-width":"120px","show-message":!1,"inline-message":!0}},[a("h3",[e._v(e._s(e.$t("Banner")+"_"+(n+1))+" "),a("el-button",{staticStyle:{float:"right"},attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.remove(n)}}},[e._v(e._s(e.$t("Delete")))])],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Priority")+":",prop:"priority"}},[a("el-input-number",{attrs:{precision:0,placeholder:"1-100","controls-position":"right",min:1,max:100},on:{change:e.change},model:{value:t.priority,callback:function(a){e.$set(t,"priority",a)},expression:"banner.priority"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("Mobile")+"):",prop:"mobile_image_url"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1065,height:600},on:{change:function(a){return e.imageChange(t,n,a)}},model:{value:t.mobile_image_url,callback:function(a){e.$set(t,"mobile_image_url",a)},expression:"banner.mobile_image_url"}})],1),a("el-form-item",{attrs:{label:e.$t("Trigger link")+":",prop:"href"}},[a("el-input",{attrs:{disabled:!t.mobile_image_url},on:{change:e.change},model:{value:t.href,callback:function(a){e.$set(t,"href",a)},expression:"banner.href"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("https://")])])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.internal_platforms,callback:function(a){e.$set(t,"internal_platforms",a)},expression:"banner.internal_platforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.external_platforms,callback:function(a){e.$set(t,"external_platforms",a)},expression:"banner.external_platforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1)],1)})),1)},ob=[],ib=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{href:"",priority:1,mobile_image_url:"",internal_platforms:t,external_platforms:e,supporting_provider:[].concat(Object(Xc["a"])(e),Object(Xc["a"])(t))}},sb={components:{ImageUploader:bv},props:{banners:{type:Array}},mounted:function(){this.bannersEditing=this.getMappedBanners()},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),data:function(){return{bannersEditing:this.getMappedBanners()}},methods:{getMappedBanners:function(){var e=this.banners.map((function(e){return Object(F["a"])(Object(F["a"])({},ib()),e)}));return e.forEach((function(e){e.href&&(e.href=e.href.replace(/^(https:\/\/)+/g,""))})),e},imageChange:function(e,t,a){e.mobile_image_url=a,this.bannersEditing.splice(t,1,Object(F["a"])({},e)),this.$emit("change",Object(Xc["a"])(this.bannersEditing))},change:function(){this.$emit("change",Object(Xc["a"])(this.bannersEditing))},add:function(e){var t=this,a=[],n=[];e.forEach((function(e){t.externalPlatforms.findIndex((function(t){return t.value===e}))>-1&&a.push(e)})),e.forEach((function(e){t.internalPlatforms.findIndex((function(t){return t.value===e}))>-1&&n.push(e)})),this.bannersEditing.push(ib(a,n))},hasBanner:function(){return this.bannersEditing.length>0},remove:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$confirm(t.$t("Are you sure to delete?"));case 3:a.next=7;break;case 5:a.prev=5,a.t0=a["catch"](0);case 7:t.bannersEditing.splice(e,1),t.change();case 9:case"end":return a.stop()}}),a,null,[[0,5]])})))()}},watch:{banners:function(e){e&&(this.bannersEditing=this.getMappedBanners())}}},lb=sb,cb=Object(R["a"])(lb,rb,ob,!1,null,null,null),ub=cb.exports,db={components:{BannerUploader:ub},data:function(){var e=Oe.Restaurant;return{loading:!1,changed:!1,showInfo:!0,languagePageList:["en_US","zh_CN","zh_HK"],editableTabsValue:"en_US",channel:e,platform:[],editableTabs:[{title:this.$t("lang.en_US"),name:"en_US",banners:[]},{title:this.$t("lang.zh_CN"),name:"zh_CN",banners:[]},{title:this.$t("lang.zh_HK"),name:"zh_HK",banners:[]}]}},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms","platforms"])),methods:{hasBanner:function(){var e=this,t=!1;return this.languagePageList.forEach((function(a){e.$refs["banneruploader".concat(a)]&&e.$refs["banneruploader".concat(a)].forEach((function(e){t|=e.hasBanner()}))})),t},onPlatformChange:function(){this.getBanner()},bannerPlatformInit:function(e){var t=this;e.forEach((function(e){e.internal_platforms=[],e.external_platforms=[],e.priority=e.flan.priority||1;var a=t.externalPlatforms,n=t.internalPlatforms;a&&n&&e.supporting_provider.forEach((function(t){n.findIndex((function(e){return e.value===t}))>-1&&e.internal_platforms.findIndex((function(e){return e===t}))<0&&e.internal_platforms.push(t),a.findIndex((function(e){return e.value===t}))>-1&&e.external_platforms.findIndex((function(e){return e===t}))<0&&e.external_platforms.push(t)}))}))},getBanner:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n={channel:a},e.platform&&e.platform.length&&(n.platforms=e.platform.join(",")),t.prev=4,t.next=7,Qr.operation.getBanner(n);case 7:r=t.sent,o=r.banner,e.bannerPlatformInit(o.en_US),e.bannerPlatformInit(o.zh_CN),e.bannerPlatformInit(o.zh_HK),e.editableTabs=[{title:e.$t("lang.en_US"),name:"en_US",banners:o.en_US||[]},{title:e.$t("lang.zh_CN"),name:"zh_CN",banners:o.zh_CN||[]},{title:e.$t("lang.zh_HK"),name:"zh_HK",banners:o.zh_HK||[]}],t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](4);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,15,17,20]])})))()},urlPrefix:function(e){return e?e.indexOf("http")<0?"https://"+e:(e=e.replace(/^(https:\/\/)+/g,"https://"),e):""},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={},n=e.channel,e.editableTabs.forEach((function(t){var r=t.name,o=t.banners;a[r]=o.filter((function(e){return e.mobile_image_url})).map((function(t){var a=Object(F["a"])(Object(F["a"])({},t),{},{href:e.urlPrefix(t.href),image_url:t.mobile_image_url,channel:n,supporting_provider:[].concat(Object(Xc["a"])(t.internal_platforms),Object(Xc["a"])(t.external_platforms))});return t.priority&&(a.flan={priority:t.priority}),delete a.internal_platforms,delete a.external_platforms,a}))})),e.loading=!0,r={banner:a},o={channel:n},t.prev=6,t.next=9,Qr.operation.saveBanner(r,o);case 9:e.$message.success(e.$t("Save successfully")),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](6),e.$message.error(e.$t("Save failed"));case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[6,12,15,18]])})))()},add:function(){var e=this;this.$refs["banneruploader".concat(this.editableTabsValue)].forEach((function(t){t.add(Object(Xc["a"])(e.platform))}))},bannersChanged:function(e,t){e.banners=t},beforeLeave:function(e,t){this.editableTabsValue=e}},mounted:function(){this.getBanner()},beforeMount:function(){var e=this;window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))}))}},pb=db,mb=(a("22c7"),Object(R["a"])(pb,ab,nb,!1,null,"ac0d8912",null)),fb=mb.exports,gb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"operation-center-wrapper"},[a("el-menu",{staticClass:"operation-nav",attrs:{"default-active":e.$route.name,router:""}},[a("h3",[e._v(e._s(e.$t("sidebar.Shopping channel")))]),a("el-menu-item",{attrs:{index:"OperationBannerDeliveryChannel",route:{name:"OperationBannerDeliveryChannel"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Banner")))])]),a("el-menu-item",{attrs:{index:"OperationDeliveryPromotion",route:{name:"OperationDeliveryPromotion"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Promotion")))])]),a("el-menu-item",{attrs:{index:"OperationDeliveryThemeList",route:{name:"OperationDeliveryThemeList"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Theme list")))])]),a("el-menu-item",{attrs:{index:"OperationDeliveryBottomTag",route:{name:"OperationDeliveryBottomTag"}}},[a("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.$t("Bottom tag")))])])],1),a("div",{staticClass:"operation-center-content"},[a("router-view")],1)],1)},hb=[],_b={mounted:function(){},data:function(){return{}}},vb=_b,bb=(a("a421"),Object(R["a"])(vb,gb,hb,!1,null,"7c6acb1a",null)),yb=bb.exports,Cb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("el-form",{ref:"bottomTag",attrs:{model:e.formModel,size:"small",rules:e.rules,"form-model":e.formModel,"label-position":"right","label-width":"120px"}},[a("h3",[e._v(e._s(e.$t("Bottom tag")))]),a("el-form-item",{attrs:{label:e.$t("Tag")+":",prop:"bottom_tag"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.searching,expression:"searching"}],staticClass:"select-long",attrs:{placeholder:e.formModel.bottom_tag.length?"":e.$t("Choose up to 8 tags, only support tags that related more than 5 products"),"multiple-limit":8,multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.tagSearch},model:{value:e.formModel.bottom_tag,callback:function(t){e.$set(e.formModel,"bottom_tag",t)},expression:"formModel.bottom_tag"}},e._l(e.getRes()(e.tags),(function(t){return a("el-option",{key:t.value,attrs:{disabled:t.related_products_num<6,label:t.label,value:t.value}},[a("span",{staticStyle:{width:"100%","padding-right":"230px"}},[e._v(e._s(t.label))]),a("span",{staticStyle:{position:"absolute",width:"230px","padding-right":"40px","text-align":"right",right:"0",top:"0",color:"#8492a6","font-size":"13px"}},[e._v(e._s(e.$t(2>t.related_products_num?"{count} related product":"{count} related products",{count:t.related_products_num})))])])})),1)],1)],1),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],1)},kb=[],wb=Oe.Delivery,$b={data:function(){return{channel:wb,formModel:{bottom_tag:[]},tags:[],loading:!1,searching:!1}},computed:{rules:function(){return{bottom_tag:[{required:!0,trigger:"change",message:this.$t("ItsRequired")}]}}},methods:{getBottom:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n={channel:a},t.prev=3,t.next=6,Qr.operation.getBottom(n);case 6:r=t.sent,o=r.bottom_tag,e.formModel.bottom_tag=o.map((function(e){return e.id})),e.tagSearch("",e.formModel.bottom_tag.join(",")),t.next=14;break;case 12:t.prev=12,t.t0=t["catch"](3);case 14:return t.prev=14,e.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[3,12,14,17]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,e.$refs.bottomTag.validate();case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(!a){t.next=26;break}return e.loading=!0,t.prev=11,n={bottom_tag:e.formModel.bottom_tag},r=e.channel,o={channel:r},t.next=17,Qr.operation.saveBottom(n,o);case 17:e.$message.success(e.$t("Save successfully")),t.next=23;break;case 20:t.prev=20,t.t1=t["catch"](11),e.$message.error(e.$t("Save failed"));case 23:return t.prev=23,e.loading=!1,t.finish(23);case 26:case"end":return t.stop()}}),t,null,[[1,6],[11,20,23,26]])})))()},getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id,related_products_num:t.related_products_num}}));return a}},tagSearch:function(e,t){var a=this;return this.searching=!0,new Promise((function(n,r){if(""!==e||t){var o={status:"ACT",parent__name:"Delivery",related_products:!0};t?(o["id__in"]=t,o["page_size"]=t.split(",").length+20):o["details__title__icontains"]=e;var i=a.$api.category.getTree(o);i.then((function(e){a.searching=!1,e.results&&(a.tags=e.results.map((function(e){for(var t in e.meta={},e.name)e.meta[t]=e.name[t];return e}))),n(a.tags)})),i.catch(r)}else a.searching=!1,n(a.tags),a.tags=[]}))}},mounted:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getBottom();case 2:case"end":return t.stop()}}),t)})))()}},Sb=$b,xb=(a("7bf8"),Object(R["a"])(Sb,Cb,kb,!1,null,"45f62895",null)),Tb=xb.exports,Db=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("el-form",{ref:"promotion",attrs:{model:e.promotion,size:"small",rules:e.rules,"form-model":e.promotion,"label-position":"right","label-width":"120px"}},[a("h3",[e._v(e._s(e.$t("Promotion product list")))]),a("el-form-item",{attrs:{label:e.$t("Title")+":",prop:"meta.en_US.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.en_US.title,callback:function(t){e.$set(e.promotion.meta.en_US,"title",t)},expression:"promotion.meta.en_US.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_HK.title,callback:function(t){e.$set(e.promotion.meta.zh_HK,"title",t)},expression:"promotion.meta.zh_HK.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_CN.title,callback:function(t){e.$set(e.promotion.meta.zh_CN,"title",t)},expression:"promotion.meta.zh_CN.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Subtitle")+":",prop:"meta.en_US.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"en_US","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.en_US.sub_title,callback:function(t){e.$set(e.promotion.meta.en_US,"sub_title",t)},expression:"promotion.meta.en_US.sub_title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_HK","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_HK.sub_title,callback:function(t){e.$set(e.promotion.meta.zh_HK,"sub_title",t)},expression:"promotion.meta.zh_HK.sub_title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.sub_title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","sub_title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,"zh_CN","sub_title")}.apply(null,arguments)}},model:{value:e.promotion.meta.zh_CN.sub_title,callback:function(t){e.$set(e.promotion.meta.zh_CN,"sub_title",t)},expression:"promotion.meta.zh_CN.sub_title"}})],1),a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"products"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.searching,expression:"searching"}],staticClass:"select-long",attrs:{placeholder:e.promotion.products.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.productsSearch},model:{value:e.promotion.products,callback:function(t){e.$set(e.promotion,"products",t)},expression:"promotion.products"}},e._l(e.getRes(e.productList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],1)},Pb=[],Ob={data:function(){var e=Oe.Delivery;return{loading:!1,searching:!1,productList:[],promotion:{is_main:!0,collection_type:Ie.Product,channel:e,meta:{en_US:{title:"",sub_title:""},zh_HK:{title:"",sub_title:""},zh_CN:{title:"",sub_title:""}},products:[]}}},computed:{rules:function(){var e=this.promotion.meta,t=e.en_US,a=e.zh_HK,n=e.zh_CN,r=function(e,t){return function(t,a,n){e?n():n(new Error)}},o=function(e,t){return function(e,a,n){t?n():n(new Error)}};return{"meta.en_US.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(t.title,t.sub_title)}],"meta.zh_HK.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(a.title,a.sub_title)}],"meta.zh_CN.title":[{required:!0,message:this.$t("ItsRequired"),validator:r(n.title,n.sub_title)}],"meta.en_US.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(t.title,t.sub_title)}],"meta.zh_HK.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(a.title,a.sub_title)}],"meta.zh_CN.sub_title":[{required:!0,message:this.$t("ItsRequired"),validator:o(n.title,n.sub_title)}],products:[{required:!0,message:this.$t("ItsRequired")}]}}},methods:{getPromotion:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.promotion.channel,n={channel:a,is_main:!0},t.prev=3,t.next=6,Qr.operation.getPromotion(n);case 6:r=t.sent,o=r.collection,i=o[0],s=i.meta,l=i.products,e.promotion=o[0],s&&(e.promotion.meta=s),l&&(e.promotion.products=l.map((function(e){return e.id}))),e.productsSearch("",e.promotion.products.join(",")),t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](3);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[3,15,17,20]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u,d,p,m,f;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,e.$refs.promotion.validate();case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(n=e.promotion.meta,r=n.en_US,o=n.zh_HK,i=n.zh_CN,r.title||o.title||i.title){t.next=13;break}return e.$message.error(e.$t("Title is required")),t.abrupt("return");case 13:if(!a){t.next=30;break}return e.loading=!0,t.prev=15,s=e.promotion,l=s.is_main,c=s.collection_type,u=s.channel,d=s.meta,p=s.products,m=s.id,f={ordered_data:p,pois:[],is_main:l,collection_type:c,channel:u,meta:d},m&&(f.id=m),t.next=21,Qr.operation.savePromotion(f,{channel:u,is_main:l});case 21:e.$message.success(e.$t("Save successfully")),t.next=27;break;case 24:t.prev=24,t.t1=t["catch"](15),e.$message.error(e.$t("Save failed"));case 27:return t.prev=27,e.loading=!1,t.finish(27);case 30:case"end":return t.stop()}}),t,null,[[1,6],[15,24,27,30]])})))()},getStringLength:function(e){return null===e||void 0===e?0:e.trim().replace(/[^ -~]/g,"aa").length},getRes:function(e){var t=this,a=this.$i18n.locale,n=e.map((function(e){return{label:t.$options.filters.lang(e.details,a,"title"),value:e.id}}));return n},productsSearch:function(e,t){var a=this;return this.searching=!0,new Promise((function(n,r){if(""!==e||t){var o={scope:"TV",type:"DEI",status:"ACT"};t?(o["id__in"]=t,o["page_size"]=t.split(",").length+20):o["keyword"]=e;var i=a.$api.product.productList(o);i.then((function(e){a.searching=!1,e.results&&(a.productList=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e}))),n(a.productList)})),i.catch(r)}else a.searching=!1,n(a.productList),a.productList=[]}))},rejectUnneccissaryChar:function(e,t,a){var n=e.isComposing;if(!n){var r=this.promotion.meta[t][a],o=18;if(r.replace(/[^ -~]/g,"aa").length>o){var i=0,s=0;while(io)break;i++}this.promotion.meta[t][a]=r.substring(0,i)}}}},mounted:function(){this.getPromotion()}},Ib=Ob,Rb=(a("fa5e"),Object(R["a"])(Ib,Db,Pb,!1,null,"8438ba46",null)),Eb=Rb.exports,Mb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[e._l(e.themeList,(function(t,n){return a("div",{key:n},[a("el-form",{ref:"themeRef",refInFor:!0,attrs:{model:t,size:"small",rules:e.getRules(t,n),"form-model":t,"label-position":"right","label-width":"120px","validate-on-rule-change":!1}},[a("h3",[e._v(e._s(e.$t("Theme"))+"_"+e._s(n+1))]),a("el-form-item",{attrs:{label:e.$t("Title")+":",prop:"meta.en_US.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.en_US"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"en_US","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"en_US","title")}.apply(null,arguments)}},model:{value:t.meta.en_US.title,callback:function(a){e.$set(t.meta.en_US,"title",a)},expression:"theme.meta.en_US.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_HK.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_HK"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_HK","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_HK","title")}.apply(null,arguments)}},model:{value:t.meta.zh_HK.title,callback:function(a){e.$set(t.meta.zh_HK,"title",a)},expression:"theme.meta.zh_HK.title"}})],1),a("el-form-item",{attrs:{label:"",prop:"meta.zh_CN.title"}},[a("el-input",{staticClass:"input-short",attrs:{placeholder:e.$t("{lang} wording, up to {max} characters",{lang:e.$t("lang.zh_CN"),max:18})},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_CN","title")}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,n,"zh_CN","title")}.apply(null,arguments)}},model:{value:t.meta.zh_CN.title,callback:function(a){e.$set(t.meta.zh_CN,"title",a)},expression:"theme.meta.zh_CN.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("Mobile")+"):",prop:"images.base.title"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1125,height:270},on:{change:function(a){return e.imageChange(t,n,a)}},model:{value:t.images.base.title,callback:function(a){e.$set(t.images.base,"title",a)},expression:"theme.images.base.title"}})],1),a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"data"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:t.searching,expression:"theme.searching"}],staticClass:"select-long",attrs:{placeholder:t.data.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":function(a){return e.productsSearch(a,null,t.collection_type,n)}},model:{value:t.data,callback:function(a){e.$set(t,"data",a)},expression:"theme.data"}},e._l(e.getRes(e.productList[n]||[]),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1)],1)})),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))])],1)],2)},Nb=[],jb=Oe.Delivery,Ab=function(){return{channel:jb,is_main:!1,meta:{en_US:{title:""},zh_CN:{title:""},zh_HK:{title:""}},collection_type:Ie.Product,images:{base:{title:""}},data:[]}},Lb={components:{ImageUploader:bv},data:function(){var e=[Ab(),Ab(),Ab(),Ab()];return{channel:jb,is_main:!1,languagePageList:["en_US","zh_CN","zh_HK"],themeList:e,productList:[],loading:!1,COLLECTION_TYPE_CHOICE_VALUES:Ie}},computed:{},methods:{getRules:function(e,t){var a=function(e,t,a){t?a():a(new Error)};return{"meta.en_US.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],"meta.zh_HK.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],"meta.zh_CN.title":[{required:!0,message:this.$t("ItsRequired"),validator:a}],data:[{required:!0,message:this.$t("ItsRequired")}]}},imageChange:function(e,t,a){a?this.themeList.splice(t,1,Object(F["a"])(Object(F["a"])({},e),{},{image:{base:{title:a}}})):this.themeList.splice(t,1,Object(F["a"])(Object(F["a"])({},e),{},{image:{base:{title:""}}}))},onListTypeChange:function(e,t,a){e.collection_type=t,e.data=[],this.productList[a]=[],this.themeList.splice(a,1,Object(F["a"])({},e))},getThemeList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n=e.is_main,r={channel:a,is_main:n},t.prev=3,t.next=6,Qr.operation.getTheme(r);case 6:o=t.sent,i=o.collection,i.forEach((function(t,a){e.languagePageList.forEach((function(e){t.meta[e]||(t.meta[e]={title:""})})),t.images&&t.images.base||(t.images={base:{title:""}}),t.collection_type||(t.collection_type=Ie.Product),t.collection_type===Ie.Product&&(t.data=t.products.map((function(e){return e.id}))),e.productList[a]=[]})),e.themeList=[].concat(Object(Xc["a"])(i),Object(Xc["a"])(e.themeList)).slice(0,4),e.themeList.forEach((function(t,a){e.productsSearch("",t.data.join(","),t.collection_type,a)})),t.next=15;break;case 13:t.prev=13,t.t0=t["catch"](3);case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[3,13,15,18]])})))()},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,Promise.all(e.$refs.themeRef.map((function(e){return e.validate()})));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:if(n=e.themeList,!n.length){t.next=15;break}if(r=!n.map((function(e){var t=e.meta,a=t.en_US,n=t.zh_HK,r=t.zh_CN;return[a.title,n.title,r.title].join("")})).join(""),!r){t.next=15;break}return e.$message.error(e.$t("Title is required")),t.abrupt("return");case 15:if(!a){t.next=32;break}return e.loading=!0,t.prev=17,o={theme:n.map((function(e){var t=e.meta,a=e.channel,n=e.images,r=e.collection_type,o=e.data,i=e.id,s={meta:t,is_main:!1,channel:a,images:n,collection_type:r,ordered_data:o};return i&&(s.id=i),r===Ie.Product&&(s.products=e.data,s.pois=[]),s}))},i=e.channel,s=e.is_main,l={channel:i,is_main:s},t.next=23,Qr.operation.saveTheme(o,l);case 23:e.$message.success(e.$t("Save successfully")),t.next=29;break;case 26:throw t.prev=26,t.t1=t["catch"](17),t.t1;case 29:return t.prev=29,e.loading=!1,t.finish(29);case 32:case"end":return t.stop()}}),t,null,[[1,6],[17,26,29,32]])})))()},getStringLength:function(e){return null===e||void 0===e?0:e.trim().replace(/[^ -~]/g,"aa").length},getRes:function(e){var t=this,a=this.$i18n.locale,n=e.map((function(e){return{label:t.$options.filters.lang(e.details,a,"title"),value:e.id}}));return n},updateProductList:function(e,t){this.productList.splice(t,1,e)},productsSearch:function(e,t,a,n){var r=this;return this.themeList[n].searching=!0,new Promise((function(a,o){if(""!==e||t){var i={scope:"TV",type:"DEI",status:"ACT"};t?(i["id__in"]=t,i["page_size"]=t.split(",").length+20):i["keyword"]=e;var s=null;s=r.$api.product.productList(i),s.then((function(e){if(r.themeList[n].searching=!1,e.results){var t=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e}));r.updateProductList(t,n)}a(r.productList[n])})),s.catch(o)}else r.themeList[n].searching=!1,a(r.productList[n]),r.updateProductList([],n)}))},rejectUnneccissaryChar:function(e,t,a,n){var r=e.isComposing;if(!r){var o=this.themeList[t].meta[a][n],i=18;if(o.replace(/[^ -~]/g,"aa").length>i){var s=0,l=0;while(si)break;s++}this.themeList[t].meta[a][n]=o.substring(0,s)}}}},mounted:function(){this.getThemeList()}},Fb=Lb,Ub=(a("4694"),Object(R["a"])(Fb,Mb,Nb,!1,null,"c117165a",null)),zb=Ub.exports,qb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tab-box"},[a("div",{staticClass:"banner-platform"},[a("el-select",{attrs:{size:"mini",multiple:"",placeholder:e.$t("Platform"),clearable:!0},on:{clear:function(t){e.platform=[]},change:e.onPlatformChange},model:{value:e.platform,callback:function(t){e.platform=t},expression:"platform"}},e._l(e.platforms,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-tabs",{directives:[{name:"show",rawName:"v-show",value:e.hasBanner(),expression:"hasBanner()"}],attrs:{type:"card","before-leave":e.beforeLeave},model:{value:e.editableTabsValue,callback:function(t){e.editableTabsValue=t},expression:"editableTabsValue"}},e._l(e.editableTabs,(function(t){return a("el-tab-pane",{key:t.name,attrs:{label:e.$t("lang."+t.name),name:t.name}},[a("div",{staticClass:"coupon-box"},[e.showInfo?a("banner-uploader",{ref:"banneruploader"+t.name,refInFor:!0,attrs:{channel:e.channel,banners:t.banners,lang:t.name},on:{change:function(a){return e.bannersChanged(t,a)}}}):e._e()],1)])})),1),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.hasBanner(),expression:"!hasBanner()"}],staticClass:"banner-empty"},[e._v(" "+e._s(e.$t("NoData"))+" ")]),a("div",{staticClass:"save-option"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Save")))]),a("el-button",{attrs:{size:"small"},on:{click:e.add}},[e._v(e._s(e.$t("Add")))])],1)],1)},Hb=[],Bb=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"banner-manage-info"},e._l(e.bannersEditing,(function(t,n){return a("el-form",{key:n,ref:"bannersRef-"+n,refInFor:!0,attrs:{model:t,size:"small","label-position":"right","label-width":"120px","show-message":!1,"inline-message":!0}},[a("h3",[e._v(e._s(e.$t("Banner")+"_"+(n+1))+" "),a("el-button",{staticStyle:{float:"right"},attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.remove(n)}}},[e._v(e._s(e.$t("Delete")))])],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Priority")+":",prop:"priority"}},[a("el-input-number",{attrs:{precision:0,placeholder:"1-100","controls-position":"right",min:1,max:100},on:{change:e.change},model:{value:t.priority,callback:function(a){e.$set(t,"priority",a)},expression:"banner.priority"}})],1),a("el-form-item",{attrs:{label:e.$t("Image")+"("+e.$t("Mobile")+"):",prop:"mobile_image_url"}},[a("image-uploader",{attrs:{accept:"image/png,image/jpeg,image/jpg",size:500,width:1065,height:600},on:{change:function(a){return e.imageChange(t,n,a)}},model:{value:t.mobile_image_url,callback:function(a){e.$set(t,"mobile_image_url",a)},expression:"banner.mobile_image_url"}})],1),a("el-form-item",{attrs:{label:e.$t("Trigger link")+":",prop:"href"}},[a("el-input",{attrs:{disabled:!t.mobile_image_url},on:{change:e.change},model:{value:t.href,callback:function(a){e.$set(t,"href",a)},expression:"banner.href"}},[a("span",{attrs:{slot:"prepend"},slot:"prepend"},[e._v("https://")])])],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.internal_platforms,callback:function(a){e.$set(t,"internal_platforms",a)},expression:"banner.internal_platforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[a("el-checkbox-group",{on:{change:e.change},model:{value:t.external_platforms,callback:function(a){e.$set(t,"external_platforms",a)},expression:"banner.external_platforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1)],1)})),1)},Kb=[],Vb=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{href:"",priority:1,mobile_image_url:"",internal_platforms:t,external_platforms:e,supporting_provider:[].concat(Object(Xc["a"])(e),Object(Xc["a"])(t))}},Yb={components:{ImageUploader:bv},props:{banners:{type:Array}},mounted:function(){this.bannersEditing=this.getMappedBanners()},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),data:function(){return{bannersEditing:this.getMappedBanners()}},methods:{getMappedBanners:function(){var e=this.banners.map((function(e){return Object(F["a"])(Object(F["a"])({},Vb()),e)})),t=this.externalPlatforms,a=this.internalPlatforms;return t&&a?(e.forEach((function(e){e.href&&(e.href=e.href.replace(/^(https:\/\/)+/g,""))})),e):[]},imageChange:function(e,t,a){e.mobile_image_url=a,this.bannersEditing.splice(t,1,Object(F["a"])({},e)),this.$emit("change",Object(Xc["a"])(this.bannersEditing))},change:function(){this.$emit("change",Object(Xc["a"])(this.bannersEditing))},add:function(e){var t=this,a=[],n=[];e.forEach((function(e){t.externalPlatforms.findIndex((function(t){return t.value===e}))>-1&&a.push(e)})),e.forEach((function(e){t.internalPlatforms.findIndex((function(t){return t.value===e}))>-1&&n.push(e)})),this.bannersEditing.push(Vb(a,n))},hasBanner:function(){return this.bannersEditing.length>0},remove:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$confirm(t.$t("Are you sure to delete?"));case 3:a.next=7;break;case 5:a.prev=5,a.t0=a["catch"](0);case 7:t.bannersEditing.splice(e,1),t.change();case 9:case"end":return a.stop()}}),a,null,[[0,5]])})))()}},watch:{banners:function(e){e&&(this.bannersEditing=this.getMappedBanners())}}},Wb=Yb,Gb=Object(R["a"])(Wb,Bb,Kb,!1,null,null,null),Qb=Gb.exports,Jb={components:{BannerUploader:Qb},computed:Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms","platforms"])),data:function(){var e=Oe.Delivery;return{loading:!1,changed:!1,showInfo:!0,languagePageList:["en_US","zh_CN","zh_HK"],editableTabsValue:"en_US",channel:e,platform:[],editableTabs:[{title:this.$t("lang.en_US"),name:"en_US",banners:[]},{title:this.$t("lang.zh_CN"),name:"zh_CN",banners:[]},{title:this.$t("lang.zh_HK"),name:"zh_HK",banners:[]}]}},methods:{hasBanner:function(){var e=this,t=!1;return this.languagePageList.forEach((function(a){e.$refs["banneruploader".concat(a)]&&e.$refs["banneruploader".concat(a)].forEach((function(e){t|=e.hasBanner()}))})),t},onPlatformChange:function(){this.getBanner()},bannerPlatformInit:function(e){var t=this;e.forEach((function(e){e.internal_platforms=[],e.external_platforms=[],e.priority=e.flan.priority||1;var a=t.externalPlatforms,n=t.internalPlatforms;a&&n&&e.supporting_provider.forEach((function(t){n.findIndex((function(e){return e.value===t}))>-1&&e.internal_platforms.findIndex((function(e){return e===t}))<0&&e.internal_platforms.push(t),a.findIndex((function(e){return e.value===t}))>-1&&e.external_platforms.findIndex((function(e){return e===t}))<0&&e.external_platforms.push(t)}))}))},getBanner:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a=e.channel,n={channel:a},e.platform&&e.platform.length&&(n.platforms=e.platform.join(",")),t.prev=4,t.next=7,Qr.operation.getBanner(n);case 7:r=t.sent,o=r.banner,e.bannerPlatformInit(o.en_US),e.bannerPlatformInit(o.zh_CN),e.bannerPlatformInit(o.zh_HK),e.editableTabs=[{title:e.$t("lang.en_US"),name:"en_US",banners:o.en_US||[]},{title:e.$t("lang.zh_CN"),name:"zh_CN",banners:o.zh_CN||[]},{title:e.$t("lang.zh_HK"),name:"zh_HK",banners:o.zh_HK||[]}],t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](4);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,15,17,20]])})))()},urlPrefix:function(e){return e?e.indexOf("http")<0?"https://"+e:(e=e.replace(/^(https:\/\/)+/g,"https://"),e):""},save:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={},n=e.channel,e.editableTabs.forEach((function(t){var r=t.name,o=t.banners;a[r]=o.filter((function(e){return e.mobile_image_url})).map((function(t){var a=Object(F["a"])(Object(F["a"])({},t),{},{href:e.urlPrefix(t.href),image_url:t.mobile_image_url,channel:n,supporting_provider:[].concat(Object(Xc["a"])(t.internal_platforms),Object(Xc["a"])(t.external_platforms))});return t.priority&&(a.flan={priority:t.priority}),delete a.internal_platforms,delete a.external_platforms,a}))})),r={banner:a},o={channel:n},e.loading=!0,t.prev=6,t.next=9,Qr.operation.saveBanner(r,o);case 9:e.$message.success(e.$t("Save successfully")),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](6),e.$message.error(e.$t("Save failed"));case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[6,12,15,18]])})))()},add:function(e){var t=this;this.$refs["banneruploader".concat(this.editableTabsValue)].forEach((function(e){e.add(Object(Xc["a"])(t.platform))}))},bannersChanged:function(e,t){e.banners=t},beforeLeave:function(e,t){this.editableTabsValue=e}},mounted:function(){this.getBanner()},beforeMount:function(){var e=this;window.addEventListener("setItemEvent",(function(t){"locale"===t.key&&(e.showInfo=!1,setTimeout((function(){e.showInfo=!0})))}))}},Xb=Jb,Zb=(a("d444"),Object(R["a"])(Xb,qb,Hb,!1,null,"b2e909ee",null)),ey=Zb.exports,ty=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-event"},[a("div",{staticClass:"actions"},[a("el-row",[a("el-col",{staticClass:"action-right",attrs:{span:24}},[a("router-link",{attrs:{target:"_blank",to:{name:"EventEdit",query:{type:"add"}}}},[a("el-button",{attrs:{type:"primary",size:"mini"}},[a("i",{staticClass:"el-icon-plus"}),a("span",[e._v(e._s(e.$t("Add")))])])],1)],1)],1)],1),a("div",{staticClass:"event-list"},[a("el-table",{attrs:{stripe:"",data:e.listData}},[a("el-table-column",{attrs:{prop:"order",width:"100",sortable:"",fixed:"",label:e.$t("productmanage.table.ID/SN")},scopedSlots:e._u([{key:"default",fn:function(t){return[3!==e.getShow(t.row)?a("el-button",{staticStyle:{padding:"0"},attrs:{slot:"reference",type:"text"},on:{click:function(a){e.jumpOther(e.getShow(t.row),t.row)}},slot:"reference"},[e._v(e._s(t.row.id))]):e._e(),3===e.getShow(t.row)?a("el-popover",{attrs:{placement:"bottom",width:"260",trigger:"click"}},[a("div",{staticStyle:{"text-align":"center"}},[a("div",[e._v(e._s(e.$t("productmanage.common.WhichGo")))]),a("div",{staticStyle:{"margin-top":"10px"}},[a("el-button",{staticStyle:{background:"#1989FA",color:"#fff"},attrs:{size:"small"},on:{click:function(a){return e.jumpOther(1,t.row)}}},[e._v("RCS")]),a("el-button",{staticStyle:{background:"#FF5A60",color:"#fff"},attrs:{size:"small"},on:{click:function(a){return e.jumpOther(2,t.row.sn)}}},[e._v("Marketplace")])],1)]),a("el-button",{staticStyle:{padding:"0"},attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(t.row.id))])],1):e._e(),a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",placement:"top-start"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v(" "+e._s(t.row.id)),a("br"),e._v(e._s(t.row.sn)+" ")]),a("div",{staticClass:"cont-btn"},[a("el-button",{attrs:{type:"text"}},[e._v(e._s(t.row.sn))])],1)])]}}])}),a("el-table-column",{attrs:{prop:"status",width:"100",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{class:"status status--"+t.row.status},[e._v(e._s(e.$t(e.PROMOTION_EVENT_STATUS[t.row.status])))])]}}])}),a("el-table-column",{attrs:{label:e.$t("Event name"),"min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e._f("lang")(t.row.details,e.$i18n.locale,"title")))])]}}])}),a("el-table-column",{attrs:{prop:"platforms","show-overflow-tooltip":"",label:e.$t("Platform")}}),a("el-table-column",{attrs:{label:e.$t("Create time"),width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e._f("date")(t.row.create_dt)))])]}}])}),a("el-table-column",{attrs:{label:e.$t("Action"),width:"180",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"link-edit",attrs:{to:{name:"EventEdit",query:{eventId:t.row.id}},target:"_blank"}},[e._v(e._s(e.$t("Detail")))]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onCopyLinkClick(t.row)}}},[e._v(e._s(e.$t("Copy link")))])]}}])})],1)],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.dataCount,"page-size":e.pageSize,"current-page":e.currentPage},on:{"current-change":e.onPageChanged}})],1)},ay=[],ny={data:function(){return{PROMOTION_EVENT_STATUS:Ae,dataCount:0,pageSize:10,currentPage:1,listData:[]}},computed:Object(F["a"])({},Object(U["c"])(["platformsMapping"])),methods:{getThemes:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.theme.getThemes({page_size:e.pageSize,page:e.currentPage,ordering:"-id"});case 2:a=t.sent,a.results.forEach((function(t){t.platforms=t.supporting_provider.map((function(t){return e.$t("platform.".concat(e.platformsMapping[t]))})).join(",")})),e.listData=a.results,e.dataCount=a.count;case 6:case"end":return t.stop()}}),t)})))()},onPageChanged:function(e){this.$router.push({name:this.$route.name,query:{page:e}})},getShow:function(e){var t=e.supporting_provider.indexOf(3)>-1||e.supporting_provider.indexOf(4)>-1,a=e.supporting_provider.indexOf(0)>-1||e.supporting_provider.indexOf(2)>-1||e.supporting_provider.indexOf(10)>-1||e.supporting_provider.indexOf(14)>-1||e.supporting_provider.indexOf(15)>-1||e.supporting_provider.indexOf(300)>-1;return t&&a?3:t?1:2},jumpOther:function(e,t){var a=t.seo_sn?"event/".concat(t.seo_sn,"/").concat(t.sn):"event/".concat(t.sn);switch(e){case 1:window.open("".concat(this.$env.rcsUrl,"/").concat(a),"_blank");break;case 2:window.open("".concat(this.$env.mkpUrl,"/").concat(a),"_blank");break}},onCopyLinkClick:function(e){var t=e.seo_sn?"event/".concat(e.seo_sn,"/").concat(e.sn):"event/".concat(e.sn);W("".concat(this.$env.mkpUrl,"/").concat(t))&&this.$message.success(this.$t("Copied"))}},created:function(){this.$route.query.page&&(this.currentPage=Number(this.$route.query.page)),this.getThemes()},beforeRouteUpdate:function(e,t,a){this.currentPage=e.query.page,this.getThemes(),a()}},ry=ny,oy=(a("7b84"),Object(R["a"])(ry,ty,ay,!1,null,"5e4775bb",null)),iy=oy.exports,sy=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"event-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"188px",size:"small",rules:e.rules,"validate-on-rule-change":!1,"show-message":!1,"inline-message":!0}},[a("div",{staticClass:"module-title"},[a("span",[e._v(e._s(e.$t("Theme setup")))])]),a("el-form-item",{attrs:{label:"ID:",prop:"id"}},[e._v(" "+e._s(e.eventId||"-")+" ")]),a("el-form-item",{attrs:{label:e.$t("Theme color")+":",prop:"color"}},[a("el-color-picker",{model:{value:e.form.color,callback:function(t){e.$set(e.form,"color",t)},expression:"form.color"}})],1),a("el-form-item",{attrs:{label:e.$t("Navigation background color")+":",prop:"section_color"}},[a("el-color-picker",{model:{value:e.form.section_color,callback:function(t){e.$set(e.form,"section_color",t)},expression:"form.section_color"}})],1),a("el-form-item",{attrs:{label:e.$t("Navigation font color")+":",prop:"section_font"}},[a("el-color-picker",{model:{value:e.form.section_font,callback:function(t){e.$set(e.form,"section_font",t)},expression:"form.section_font"}})],1),a("el-form-item",{attrs:{label:e.$t("Coupons")+":",prop:"coupons"}},[a("el-select",{staticClass:"custom-select",attrs:{width:"100%",multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.searchCoupons,loading:e.searching,"multiple-limit":4},model:{value:e.form.coupons,callback:function(t){e.$set(e.form,"coupons",t)},expression:"form.coupons"}},e._l(e.couponSearchResult,(function(t){return a("el-option",{key:t.id,attrs:{value:t.id,label:e.localeMapping(t.details,"title")}},[e._v(e._s(e._f("lang")(t.details,e.$i18n.locale,"title")))])})),1),a("div",{staticClass:"max-coupon-tip"},[e._v(" "+e._s(e.$t("Maximum 4 coupons"))+" ")])],1),a("div",{staticClass:"tab-container"},[a("el-tabs",{attrs:{type:"card"},on:{"tab-remove":e.onLangTabRemove},model:{value:e.currentLang,callback:function(t){e.currentLang=t},expression:"currentLang"}},[e._l(e.activeLangs,(function(t){return a("el-tab-pane",{key:t.value,attrs:{label:e.$t("lang."+t.value),name:t.value,closable:e.activeLangs.length>1}},[a("LocaleContent",{ref:"localeContent_"+t.value,refInFor:!0,attrs:{"form-data":t.formData,lang:t.value}})],1)})),e.availabelNewLangs.length?a("el-tab-pane",{key:"add",attrs:{disabled:"",name:"add"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-dropdown",{attrs:{trigger:"click"},on:{command:e.onLangAdd}},[a("span",{staticClass:"el-dropdown-link"},[e._v(e._s(e.$t("AddLanguage"))),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.availabelNewLangs,(function(t){return a("el-dropdown-item",{key:t,attrs:{command:t}},[e._v(e._s(e.$t("lang."+t)))])})),1)],1)],1)]):e._e()],2)],1),a("el-form-item",{attrs:{label:e.$t("Internal PF")+":"}},[a("el-checkbox-group",{model:{value:e.form.internalPlatforms,callback:function(t){e.$set(e.form,"internalPlatforms",t)},expression:"form.internalPlatforms"}},e._l(e.internalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[a("el-checkbox-group",{model:{value:e.form.externalPlatforms,callback:function(t){e.$set(e.form,"externalPlatforms",t)},expression:"form.externalPlatforms"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.Status")+":",prop:"status"}},e._l(e.statusList,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v(e._s(t.label))])})),1),e.eventData?a("el-form-item",{attrs:{label:e.$t("Create info")+":"}},[a("span",[e._v(e._s(e._f("date")(e.eventData.create_dt)))]),a("span",{staticClass:"agent-name"},[e._v(e._s(e.eventData.create_agent_name))])]):e._e(),e.eventData?a("el-form-item",{attrs:{label:e.$t("Update info")+":"}},[a("span",[e._v(e._s(e._f("date")(e.eventData.update_dt)))]),a("span",{staticClass:"agent-name"},[e._v(e._s(e.eventData.update_agent_name))])]):e._e()],1),a("div",{staticClass:"action-container"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.onSave}},[e._v(e._s(e.$t("Submit")))]),a("el-button",{attrs:{type:"primary",size:"small",disabled:!e.eventId},on:{click:e.onCopyLinkClick}},[e._v(e._s(e.$t("Copy link")))])],1)],1)},ly=[],cy=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"event-local-form"},[a("el-form",{ref:"form",attrs:{model:e.form,size:"small",rules:e.rules,"label-position":"top","show-message":!1,"inline-message":!0}},[a("el-form-item",{attrs:{label:e.$t("Event name"),prop:"title"}},[a("el-input",{attrs:{placeholder:e.$t("Event name")},nativeOn:{input:function(t){return function(t){return e.rejectUnneccissaryChar(t,20)}.apply(null,arguments)},compositionend:function(t){return function(t){return e.rejectUnneccissaryChar(t,20)}.apply(null,arguments)}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:e.$t("productmanage.common.UploadImage"),prop:"images"}},[a("div",{staticClass:"img-upload-item"},[a("ImageUploader",{attrs:{tips:e.imageTip.pc},model:{value:e.form.images.pc,callback:function(t){e.$set(e.form.images,"pc",t)},expression:"form.images.pc"}})],1),a("div",{staticClass:"img-upload-item"},[a("ImageUploader",{attrs:{tips:e.imageTip.mobile},model:{value:e.form.images.mobile,callback:function(t){e.$set(e.form.images,"mobile",t)},expression:"form.images.mobile"}})],1)])],1),e._l(e.form.sections,(function(t,n){return a("SectionForm",{key:t.id||e.form.sections.length+"_"+n,ref:"sectionForm",refInFor:!0,attrs:{"form-data":t,index:n,removeable:e.form.sections.length>1,lang:e.lang},on:{remove:e.onSectionRemove}})})),a("div",{staticClass:"add-section-button"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",plain:"",size:"small"},on:{click:e.onAddSectionClick}},[e._v(e._s(e.$t("Add section")))])],1),a("div",{staticClass:"other-detail-container"},[a("div",{staticClass:"title"},[e._v(e._s(e.$t("Other detail")))]),a("editor",{model:{value:e.form.meta.description,callback:function(t){e.$set(e.form.meta,"description",t)},expression:"form.meta.description"}})],1)],2)},uy=[],dy=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.percent&&e.percent<100,expression:"percent && percent < 100"}],staticClass:"image-uploader"},[a("el-upload",{ref:e.uploaderRef,staticClass:"uploader",attrs:{action:e.actionUrl,data:{path:"option-center"},accept:e.accept,limit:1,"file-list":e.filstList,"list-type":"text","on-progress":e.onProgress,"on-remove":e.handleChange,"on-change":e.handleChange,"before-upload":e.beforeUpload,"on-success":e.uploadSuccess,"on-exceed":function(t){return e.onExceed(t)}}},[a("div",{staticClass:"upload-container",attrs:{slot:"trigger"},slot:"trigger"},[a("el-button",{attrs:{size:"small"}},[e._v(e._s(e.$t("productmanage.common.UploadImage")))])],1),a("span",{staticClass:"el-upload__text",attrs:{slot:"tip"},slot:"tip"},[e._v(e._s(e.tips))])]),a("el-dialog",{attrs:{visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.onImageDialogClose}},[a("div",{staticClass:"image-zoom",style:{backgroundImage:"url('"+e.dialogImageUrl+"')"}})])],1)},py=[],my={props:{width:{type:Number,default:1065},height:{type:Number,default:600},size:{type:Number,default:500},accept:{type:String,default:"image/png,image/jpeg,image/jpg"},value:{type:String},tips:{type:String}},data:function(){var e=Date.now();return{uploaderRef:"uploader".concat(e),filstList:this.value?[{url:this.value,name:this.getName(this.value)}]:[],url:this.value,dialogImageUrl:"",dialogVisible:!1,actionUrl:this.$env.apiUrl+"/file_upload?convert=false",percent:!1}},computed:{types:function(){return this.accept?this.accept.split(",").map((function(e){return e.split("/")[1]})).filter((function(e){return e})).map((function(e){return e.toUpperCase()})).join(" "):""}},watch:{value:function(){this.url=this.value}},methods:{getName:function(e){var t=e.lastIndexOf("/");return t>-1?e&&e.substring(t+1):""},onExceed:function(e){this.$refs[this.uploaderRef].clearFiles(),this.$refs[this.uploaderRef].handleStart(e[0]),this.$refs[this.uploaderRef].submit()},onProgress:function(e){var t=e.percent;this.percent=t},handleChange:function(e,t){},onImageDialogClose:function(){this.dialogVisible=!1},handlePictureCardPreview:function(){this.dialogImageUrl=this.url,this.dialogVisible=!0},handleRemove:function(){this.url=null,this.percent=!1,this.handleImage()},uploadSuccess:function(e,t,a){this.url=e.file[0].url,this.percent=!1,this.handleImage()},handleImage:function(){this.$emit("input",this.url),this.$emit("change",this.url)},getImage:function(e){},beforeUpload:function(e){var t=this.accept.split(",").indexOf(e.type)>-1,a=!0;return t&&a?new Promise((function(t,a){var n=new FileReader;n.onload=function(e){var n=this,r=e.target.result,o=new Image;o.onload=function(e){n.percent=1,t()},o.onabort=o.onerror=function(e){a(new Error("用户取消上传"))},o.src=r},n.onabort=n.onerror=function(e){a(new Error("用户取消上传"))},n.readAsDataURL(e)})):(this.$message.error(this.tip),!1)}}},fy=my,gy=(a("05194"),Object(R["a"])(fy,dy,py,!1,null,"7ee04669",null)),hy=gy.exports,_y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"event-locale-form"},[a("div",{staticClass:"section-label"}),a("el-form",{ref:"form",attrs:{model:e.form,size:"small",rules:e.rules,"label-position":"right","label-width":"140px","show-message":!1,"inline-message":!0}},[a("el-form-item",{attrs:{label:e.$t("Section title"),prop:"name"}},[a("el-input",{attrs:{placeholder:e.$t("Section")+" "+(e.index+1)},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),e.removeable?a("el-button",{attrs:{type:"text"},on:{click:e.onRemoveClick}},[e._v(e._s(e.$t("Remove")))]):e._e()],1),a("el-form-item",{attrs:{label:e.$t("Show in navigation"),prop:"is_navigation"}},[a("el-radio",{attrs:{label:!0},model:{value:e.form.is_navigation,callback:function(t){e.$set(e.form,"is_navigation",t)},expression:"form.is_navigation"}},[e._v(e._s(e.$t("Yes")))]),a("el-radio",{attrs:{label:!1},model:{value:e.form.is_navigation,callback:function(t){e.$set(e.form,"is_navigation",t)},expression:"form.is_navigation"}},[e._v(e._s(e.$t("No")))])],1),a("el-form-item",{attrs:{label:e.$t("Section type"),prop:"type"}},[a("el-radio-group",{model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[a("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("Product")))]),a("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("One Image")))]),a("el-radio",{attrs:{label:2}},[e._v(e._s(e.$t("Two Image")))]),a("el-radio",{attrs:{label:3}},[e._v(e._s(e.$t("Three Image")))])],1)],1),0===e.form.type?[a("el-form-item",{attrs:{label:e.$t("productmanage.common.ProdcutType"),prop:"product_type"}},[a("el-select",{on:{change:e.onProductTypeChange},model:{value:e.form.product_type,callback:function(t){e.$set(e.form,"product_type",t)},expression:"form.product_type"}},e._l(e.productTypes,(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t(t.label),value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"products"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.searching,expression:"searching"}],ref:"productSelector",staticClass:"select-long",attrs:{placeholder:e.form.products.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.productsSearch},model:{value:e.form.products,callback:function(t){e.$set(e.form,"products",t)},expression:"form.products"}},e._l(e.mappedProducts,(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)]:e._l(e.form.images,(function(t,n){return a("div",{key:t+"-"+n},[a("el-form-item",{attrs:{label:e.$t("Section images")+(e.form.type>1?n+1:""),"show-message":!0,prop:"images["+n+"]"}},[a("div",{staticClass:"img-upload-item"},[a("div",{staticClass:"img-upload-item"},[a("ImageUploader",{attrs:{tips:e.sectionImageTip.pc},model:{value:e.form.images[n].pc,callback:function(t){e.$set(e.form.images[n],"pc",t)},expression:"form.images[i].pc"}})],1),a("div",{staticClass:"img-upload-item"},[a("ImageUploader",{attrs:{tips:e.sectionImageTip.mobile},model:{value:e.form.images[n].mobile,callback:function(t){e.$set(e.form.images[n],"mobile",t)},expression:"form.images[i].mobile"}})],1)])]),a("el-form-item",{attrs:{label:e.$t("Image link")}},[a("el-input",{attrs:{size:"mini",placeholder:e.$t("Please enter {0}",[e.$t("Image link")])},model:{value:e.form.images[n].link,callback:function(t){e.$set(e.form.images[n],"link",t)},expression:"form.images[i].link"}})],1)],1)}))],2)],1)},vy=[],by={components:{ImageUploader:hy},props:["formData","index","removeable","lang"],data:function(){return{productList:[],searching:!1,form:null,THEME_TYPES:ze}},computed:{rules:function(){for(var e={},t=this,a=0;a0){this.productList=[];var a=[{pc:"",mobile:"",link:""},{pc:"",mobile:"",link:""},{pc:"",mobile:"",link:""}];this.form.images=[].concat(Object(Xc["a"])(this.form.images.filter((function(e){return e.pc||e.mobile||e.link}))),a).slice(0,e)}else this.form.images=[]}}},yy=by,Cy=(a("e43e"),Object(R["a"])(yy,_y,vy,!1,null,"08de0928",null)),ky=Cy.exports,wy={components:{ImageUploader:hy,SectionForm:ky,Editor:fu},props:["formData","lang"],data:function(){return{productList:[],searching:!1,form:null}},computed:{rules:function(){var e={title:[{required:!0,message:this.$t("productmanage.common.ItsRequired")}],images:[{required:!0,message:this.$t("productmanage.common.ItsRequired")},{validator:this.validateImages,trigger:"change"}]};return e},bannerImageTip:function(){return{pc:this.$t("PC - 1960*600px JPG JPEG only || Design focus 1200*400px || <500KB"),mobile:this.$t("Mobile - 1125*1500px JPG JPEG only || Design focus 1125*900px || <500KB")}},imageTip:function(){return{pc:this.$t("PC"),mobile:this.$t("Mobile")}},productTypes:function(){return Object.keys(de).map((function(e){return{value:e,label:de[e]}}))}},created:function(){this.form=this.formData},methods:{validateImages:function(e,t,a){t&&t.pc&&t.mobile?a():a(new Error("Please upload image"))},validate:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=!0,t.prev=1,t.next=4,e.$refs.form.validate();case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),a=!1;case 9:n=e.$refs.sectionForm,r=0;case 11:if(!(rt){var r=0,o=0;while(rt)break;r++}this.form.title=n.substring(0,r)}}}}},$y=wy,Sy=(a("94ef"),Object(R["a"])($y,cy,uy,!1,null,"654c7be4",null)),xy=Sy.exports,Ty={components:{LocaleContent:xy},data:function(){return{isSubmiting:!1,searching:!1,couponSearchResult:[],eventId:null,eventData:null,form:{color:"#CD0A00",section_color:"#ffffff",section_font:"#000000",coupons:[],internalPlatforms:[],externalPlatforms:[],status:"DFT"},currentLang:"",activeLangs:[],availabelLangs:["en_US","zh_CN","zh_HK","ko_KR"]}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{rules:function(){var e={color:[{required:!0,message:this.$t("productmanage.common.ItsRequired")}]};return e},availabelNewLangs:function(){var e=this;return this.availabelLangs.filter((function(t){return e.activeLangs.findIndex((function(e){return e.value===t}))<0}))},availabelPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]},statusList:function(){var e=this;return Object.keys(Ae).map((function(t){return{label:e.$t(Ae[t]),value:t}}))}}),created:function(){this.searchCoupons=$l()(this.searchCoupons,200),this.initEventInfo()},methods:{initEventInfo:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.$route.query.eventId){t.next=18;break}return t.next=3,e.$api.theme.getThemeDetail(e.$route.query.eventId);case 3:a=t.sent,e.eventData=a,e.eventId=a.id,e.form.color=a.color,e.form.section_color=a.section_color,e.form.section_font=a.section_font,e.form.coupons=a.coupons,e.form.status=a.status,a.supporting_provider.forEach((function(t){e.internalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.internalPlatforms.push(t),e.externalPlatforms.findIndex((function(e){return e.value===t}))>-1&&e.form.externalPlatforms.push(t)})),n=Object.keys(a.details),n.forEach((function(t){e.activeLangs.push({value:t,formData:a.details[t]})})),e.currentLang=n[0],a.coupons.length&&e.initCoupons(a.coupons),t.next=20;break;case 18:e.activeLangs.push({value:"zh_HK",formData:{title:"",meta:{description:""},images:{pc:"",mobile:""},sections:[{type:0,is_navigation:!0,name:"",images:[],product_type:"DEI",products:[]}]}}),e.currentLang="zh_HK";case 20:case"end":return t.stop()}}),t)})))()},localeMapping:function(e,t){var a=e[this.$i18n.locale]||e.zh_HK||e.en_US||e.zh_CN||e.ko_KR;return a&&t?a[t]:a},searchCoupons:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e){a.next=3;break}return t.couponSearchResult=[],a.abrupt("return");case 3:return t.searching=!0,n={status:"ACT",keyword:e},a.prev=5,a.next=8,t.$api.coupon.couponList(n);case 8:r=a.sent,t.couponSearchResult=r.results,a.next=15;break;case 12:a.prev=12,a.t0=a["catch"](5),t.couponSearchResult=[];case 15:return a.prev=15,t.searching=!1,a.finish(15);case 18:case"end":return a.stop()}}),a,null,[[5,12,15,18]])})))()},initCoupons:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={id__in:e.join(",")},a.prev=1,a.next=4,t.$api.coupon.couponList(n);case 4:r=a.sent,t.couponSearchResult=r.results,a.next=11;break;case 8:a.prev=8,a.t0=a["catch"](1),t.couponSearchResult=[];case 11:case"end":return a.stop()}}),a,null,[[1,8]])})))()},getRules:function(){return[]},onLangTabRemove:function(e){var t=this.activeLangs.findIndex((function(t){return t.value===e}));t<0||this.activeLangs.splice(t,1)},onLangAdd:function(e){this.activeLangs.indexOf(e)>-1||(this.activeLangs.push({value:e,formData:{title:"",meta:{description:""},images:{pc:"",mobile:""},sections:[{type:0,is_navigation:!0,name:"",images:[],product_type:"DEI",products:[]}]}}),this.currentLang=e)},onSave:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u,d,p,m,f,g,h;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=[],t.prev=1,t.next=4,e.$refs.form.validate();case 4:t.next=10;break;case 6:t.prev=6,t.t0=t["catch"](1),e.form.color||a.push(e.$t("Theme color")),e.form.coupons.length||a.push(e.$t("Coupon"));case 10:n=0;case 11:if(!(n":"zh_CN"===e.$i18n.locale?l="保存失败!以下有必填项未填
":"zh_HK"===e.$i18n.locale&&(l="保存失敗!以下有必填項未填
"),a.forEach((function(e){l+="[".concat(e,"]
")})),e.$message({dangerouslyUseHTMLString:!0,message:l,type:"error"}),t.abrupt("return");case 30:for(c=e.form.externalPlatforms.concat(e.form.internalPlatforms),u={},d=0;d1?[e._v(" "+e._s(e.$t("{day} Days",{day:(t.row.promotionValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]:[e._v(" "+e._s(e.$t("{day} Day",{day:(t.row.promotionValidHoursAfterRedeeming/24).toFixed(0)}))+" ")]],2)]}}])}),a("el-table-column",{attrs:{width:"160",prop:"platforms","show-overflow-tooltip":"",label:e.$t("Platform")}}),a("el-table-column",{attrs:{width:"120",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("router-link",{staticClass:"promotion-link",attrs:{target:"_blank",to:{name:"PromotionInfo",query:{promotionId:t.row.id}}}},[e._v(e._s(e.$t("Detail")))]),e._v(" "),"ACT"===t.row.status?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onInvalid(t.row)}}},[e._v(e._s(e.$t("Invalid")))]):e._e()]}}])},[a("template",{slot:"header"},[a("div",{staticClass:"action-box"},[a("span",[e._v(e._s(e.$t("Action")))])])])],2),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},Ry=[],Ey=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.searchRules}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Create date"),"end-placeholder":e.$t("Create date")},model:{value:e.formModel.createDate,callback:function(t){e.$set(e.formModel,"createDate",t)},expression:"formModel.createDate"}})],1),a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Promotion date"),"end-placeholder":e.$t("Promotion date")},model:{value:e.formModel.promotionDate,callback:function(t){e.$set(e.formModel,"promotionDate",t)},expression:"formModel.promotionDate"}})],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("Status"),clearable:!1,"collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},[a("el-option",{attrs:{label:e.$t("Valid"),value:"valid"}}),a("el-option",{attrs:{label:e.$t("Invalid"),value:"invalid"}})],1)],1),a("el-form-item",[a("el-select",{attrs:{placeholder:e.$t("Platform"),multiple:"",clearable:!1,"collapse-tags":""},model:{value:e.formModel.platforms,callback:function(t){e.$set(e.formModel,"platforms",t)},expression:"formModel.platforms"}},e._l(e.platforms.filter((function(e){return 0===e.name.indexOf("MKP_")})),(function(t){return a("el-option",{key:t.value,attrs:{label:e.$t("platform."+t.name),value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},[a("el-option",{attrs:{label:e.$t("Promotion name"),value:"name"}}),a("el-option",{attrs:{label:e.$t("Promotion ID"),value:"point_id"}}),a("el-option",{attrs:{label:e.$t("Creater"),value:"create_agent"}}),a("el-option",{attrs:{label:e.$t("Booking ID"),value:"booking_sn"}}),a("el-option",{attrs:{label:e.$t("Payment ID"),value:"payment_sn"}}),a("el-option",{attrs:{label:e.$t("Product ID"),value:"product_id"}}),a("el-option",{attrs:{label:e.$t("Product name"),value:"product_title"}}),a("el-option",{attrs:{label:e.$t("Right ID"),value:"point_promo"}})],1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.isSearchButtonEnable},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1)],1)},My=[],Ny={createDate:[],promotionDate:[],status:null,platforms:null,discountType:null,keyWord:"",keyWordType:"name"},jy={data:function(){return{formModel:Object.assign({},Ny),PROMOTION_BATCH_SEARCH_TYPES:qe}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{searchRules:function(){var e=this,t={},a=this.formModel.keyWordType,n=function(t,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[e.$t("".concat(qe[a]))])))};return["point_id","product_id"].indexOf(a)>-1&&(t.keyWord=[{validator:n,trigger:"change"},{validator:n,trigger:"blur"}]),t},discountTypes:function(){var e=we,t=Object.keys(e),a=[];return t.forEach((function(t){a.push({label:e[t],value:t})})),a},couponBatchStatus:function(){var e=this,t=Fe,a=Object.keys(t),n=[];return a.forEach((function(a){n.push({label:e.$t(t[a]),value:t[a].toLowerCase()})})),n},hasSearchData:function(){var e=this.formModel,t=e.createDate,a=e.promotionDate,n=e.keyWord,r=e.status,o=e.platforms;return t&&t.length||a&&a.length||n||r||o&&o.length},isSearchButtonEnable:function(){var e=this.formModel,t=e.createDate,a=e.promotionDate,n=e.keyWord,r=e.status,o=e.platforms;return t&&t.length||a&&a.length||n||r||o&&o.length},getData:function(){return function(e){var t=this.$t("productmanage.".concat(e)),a=Object.keys(t);return a.map((function(e){return{label:t[e],value:e.split("|")[1]}}))}}}),methods:{validateForm:function(){var e=this;return new Promise((function(t){e.$refs.searchForm.validate((function(e){t(!!e)}))}))},onClearClick:function(){Object.assign(this.formModel,Ny),this.onSearch()},onSearch:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a&&e.$emit("change",e.formModel);case 4:case"end":return t.stop()}}),t)})))()},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},mounted:function(){this.initEnterEvent()},beforeDestroy:function(){document.onkeydown=null},watch:{isSearchButtonEnable:function(e,t){t&&!e&&this.onSearch()},searchRules:function(e,t){e!==t&&this.$refs.searchForm.clearValidate()}}},Ay=jy,Ly=(a("e576"),Object(R["a"])(Ay,Ey,My,!1,null,"368a8630",null)),Fy=Ly.exports,Uy={components:{SeachForm:Fy},data:function(){return{PROMOTION_STATUS:Fe,promotionList:[],loading:!1,deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platformsMapping"])),{},{mappedPromotionList:function(){var e=this;return this.promotionList.map((function(t){var a=t.id,n=t.name,r=t.status,o=t.valid_start_dt,i=t.valid_end_dt,s=t.supplier,l=t.supporting_provider,c=[];return l.forEach((function(t){e.platformsMapping[t]&&c.push(e.$t("platform.".concat(e.platformsMapping[t])))})),{id:a,name:n,status:r,validStart:o,validEnd:i,supplier:s,platforms:c.join(",")}}))}}),created:function(){this.getPromotionList()},methods:{getDiscountType:function(e){return this.$t(we[e])},getPromotionList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.searchData||{},n=a.createDate,r=a.promotionDate,o=a.status,i=a.platforms,s=a.keyWord,l=a.keyWordType,c={ordering:e.ordering,page_size:e.pageSize,page:e.currentPage},n&&n.length&&(c.create_start_dt=Vt()(n[0]).format("YYYY-MM-DD"),c.create_end_dt=Vt()(n[1]).format("YYYY-MM-DD")),r&&r.length&&(c.valid_start_dt=Vt()(r[0]).format("YYYY-MM-DD"),c.valid_end_dt=Vt()(r[1]).format("YYYY-MM-DD")),o&&(c.point_status=o),i&&i.length&&(c.platform=i.join(",")),s&&(c[l]=s),e.loading=!0,e.promotionList=[],t.prev=10,t.next=13,e.$api.promotion.promotionList(c);case 13:u=t.sent,e.promotionList=u.results,e.total=u.count;case 16:return t.prev=16,e.loading=!1,t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[10,,16,19]])})))()},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getPromotionList()},onDeleteConfirm:function(){return Object(L["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getPromotionList()},onPageSizeChange:function(e){this.pageSize=e,this.getPromotionList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getPromotionList())},onInvalid:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.promotion.editPromotion(e.id,{id:e.id,status:"DCT"});case 2:e.status="DCT";case 3:case"end":return a.stop()}}),a)})))()}}},zy=Uy,qy=(a("01ca"),Object(R["a"])(zy,Iy,Ry,!1,null,"099609e6",null)),Hy=qy.exports,By=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"product-manage-operation"},[e.detail?a("div",{staticClass:"title"},[e._v(e._s(e.detail.name))]):e._e(),a("el-tabs",[a("el-tab-pane",{attrs:{label:e.$t("Basic info")}},[e.detail?a("basic-info",{attrs:{detail:e.detail}}):e._e()],1),a("el-tab-pane",{attrs:{label:e.$t("Related order")}},[a("relative-order-list")],1)],1)],1)},Ky=[],Vy=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"promotion-info"},[a("el-form",{ref:"form",attrs:{"label-width":"160px",size:"small"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Basic info")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Promotion ID")+":"}},[e._v(" "+e._s(e.detail.id)+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Promotion name")+":"}},[e._v(" "+e._s(e.detail.name)+" ")])],1)])],1),a("el-form-item",{attrs:{label:e.$t("Promotion prd")+":"}},[e._v(" "+e._s(e._f("date")(e.detail.valid_start_dt,"YYYY-MM-DD HH:mm:ss"))),a("span",{staticClass:"date-time-splitter"},[e._v("-")]),e._v(e._s(e._f("date")(e.detail.valid_end_dt,"YYYY-MM-DD HH:mm:ss"))+" ")]),a("el-form-item",{attrs:{label:e.$t("External PF")+":"}},[e._v(" "+e._s(e.platforms.map((function(t){return e.$t("platform."+t.name)})).join(","))+" ")]),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Status")+":"}},[e._v(" "+e._s(e.$t(e.PROMOTION_STATUS[e.detail.status]))+" ")])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Rights(Mylink points)")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Rewards method")+":"}},[0===e.detail.reward_method?a("span",[e._v(e._s(e.$t("Every Booking")))]):e._e(),1===e.detail.reward_method?a("span",[e._v(e._s(e.$t("Follow Payment Price")))]):e._e()])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Mylink point promo id")+":"}},[a("span",[e._v(e._s(e.detail.mylink_point_promo))])])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Amount")+":"}},[a("span",[e._v(e._s(e.detail.reward_mylink_points))]),1===e.detail.reward_method&&e.detail.base_currency?a("span",[e._v(" "+e._s(e.$t("for every"))+" "+e._s(e.detail.base_currency.code)+" "+e._s(e.detail.reward_per_amount[e.detail.base_currency.code]))]):e._e()])],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Product limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Apply product")+":"}},[e._v(" "+e._s(e.$t(e.COUPON_PRODUCT_LIMITS[e.detail.applying_method]))+" ")])],1)]),2===e.detail.applying_method?a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Type/category")+":"}},[a("div",{staticClass:"category-wrapper"},e._l(e.detail.included_categories,(function(t,n){return a("div",{key:n,staticClass:"category-link"},[a("span","object"===typeof t?[e._v(e._s(e._f("lang")(t.path,e.$i18n.locale))+"-"+e._s(e._f("lang")(t.name,e.$i18n.locale)))]:[e._v(e._s(t))])])})),0)])],1)]):e._e(),1===e.detail.applying_method?a("el-col",{attrs:{span:18}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Products")+":"}},[a("div",{staticClass:"product-wrapper"},e._l(e.detail.included_products,(function(t,n){return a("el-link",{key:n,staticClass:"product-link",attrs:{href:e.getProductLink(t),target:"_blank"}},[a("span","object"===typeof t?[e._v(e._s(t.id)+"-"+e._s(e._f("lang")(t.name,e.$i18n.locale)))]:[e._v(e._s(t))])])})),1)])],1)]):e._e()],1),a("el-form-item",{attrs:{label:e.$t("Create info")+":"}},[e._v(" "+e._s(e._f("date")(e.detail.create_dt,"YYYY-MM-DD HH:mm:ss"))+" "),e.detail.create_agent_detail?a("el-popover",{attrs:{trigger:"click"}},[a("div",{staticClass:"user-info"},[a("div",[e._v(e._s(e.$t("Create agent"))+": "+e._s(e.detail.create_agent))]),a("div",[e._v(e._s(e.$t("First name"))+": "+e._s(e.detail.create_agent_detail.first_name))]),a("div",[e._v(e._s(e.$t("Last name"))+": "+e._s(e.detail.create_agent_detail.last_name))]),a("div",[e._v(e._s(e.$t("Email"))+": "+e._s(e.detail.create_agent_detail.email))])]),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v(e._s(e.detail.create_agent_detail.first_name)+" "+e._s(e.detail.create_agent_detail.last_name))])],1):e._e()],1),a("el-form-item",{attrs:{label:e.$t("Update info")}},[e._v(" "+e._s(e._f("date")(e.detail.update_dt,"YYYY-MM-DD HH:mm:ss"))+" ")])],1),a("el-dialog",{attrs:{visible:e.showUpdateInfo,"before-close":function(){return e.showUpdateInfo=!1}}},[e.showUpdateInfo?a("EventTimeline",{attrs:{type:e.EVENT_TYPE.promotion,watchObject:e.$route.query.promotionId}}):e._e()],1)],1)},Yy=[],Wy={components:{EventTimeline:Au},props:{detail:{type:Object}},data:function(){return{showUpdateInfo:!1,EVENT_TYPE:Me,CURRENCY_TYPES:$e,COUPON_DISCOUNT_TYPES:we,COUPON_CONDITION_LIMITS:Se,COUPON_PRODUCT_LIMITS:xe,COUPON_NUMBER_LIMITS:Te,PROMOTION_STATUS:Fe,detals:[],productList:[]}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{getRes:function(){var e=this.$i18n.locale;return function(t){var a=t.map((function(t){return{label:t.meta[e]||t.meta.en_US||t.meta.zh_HK||t.meta.zh_CN||t.meta.ko_KR,value:t.id}}));return a}},platforms:function(){var e=this;return this.detail.supporting_provider.map((function(t){return e.externalPlatforms.find((function(e){return e.value===t}))})).filter((function(e){return e}))}}),methods:{getProductLink:function(e){var t="";return t="object"===Object(wt["a"])(e)?e.id:e,"".concat(this.$env.mkpUrl,"/product/").concat(e.seo_sn,"/").concat(t)},goList:function(){this.$root.$emit("show-promotion-list")},countLabel:function(e){var t=e/2-.5;return 0===t?t="-":8.5===t&&(t="8+"),t+""},countPriorityLabel:function(e){var t=e/2+.5;return 8.5===t&&(t="8+"),t+""},formatDate:function(e){var t=new Date(+new Date(e)+288e5);return t.toJSON().substr(0,19).replace("T"," ").replace(/-/g,"-")},remoteMethod:function(e,t){var a=this;if(""!==e||t){var n={};t?n["id__in"]=t:n["details__title__icontains"]=e,this.loading=!0,this.$api.product.productList(n).then((function(e){a.loading=!1,e.results&&(a.productList=e.results.map((function(e){for(var t in e.details)e.meta[t]=e.details[t].meta.name;return e})))}))}else this.productList=[]}}},Gy=Wy,Qy=(a("4b7c"),a("2dc7"),Object(R["a"])(Gy,Vy,Yy,!1,null,"21143c3a",null)),Jy=Qy.exports,Xy=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"order-list"},[a("SeachForm",{on:{change:e.onSearchChange}}),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"uno-table",attrs:{border:"",data:e.promotionList,"tooltip-effect":"dark",stripe:""},on:{"sort-change":e.onSort}},[a("el-table-column",{attrs:{prop:"id","min-width":"160",fixed:"",label:e.$t("Payment ID")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.payment_sn)+" ")]}}])}),a("el-table-column",{attrs:{prop:"id","min-width":"170",fixed:"",label:e.$t("Booking ID")},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.sn)+" ")]}}])}),a("el-table-column",{attrs:{"show-overflow-tooltip":"","min-width":"230",label:e.$t("Product name"),prop:"product_title"}}),a("el-table-column",{attrs:{"min-width":"140","show-overflow-tooltip":"",label:e.$t("Status")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{class:"status status--"+t.row.promotion_status},[e._v(e._s(e.$t(e.PRODUCT_BOOKING_PROMOTION_STATUS[t.row.promotion_status])))])]}}])}),a("el-table-column",{attrs:{"min-width":"140",label:e.$t("Booking paid time"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.paid_dt?[e._v(" "+e._s(e._f("date")(t.row.paid_dt,"YYYY-MM-DD HH:mm"))+" ")]:a("span",{staticClass:"empty-tip"},[e._v(" - ")])]}}])}),a("el-table-column",{attrs:{"min-width":"140",label:e.$t("Payment completed time"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.completed_at?[e._v(" "+e._s(e._f("date")(t.row.completed_at,"YYYY-MM-DD HH:mm"))+" ")]:a("span",{staticClass:"empty-tip"},[e._v(" - ")])]}}])}),a("el-table-column",{attrs:{"min-width":"140",label:e.$t("Point send time"),"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.send_promotion_dt?[e._v(" "+e._s(e._f("date")(t.row.send_promotion_dt,"YYYY-MM-DD HH:mm"))+" ")]:a("span",{staticClass:"empty-tip"},[e._v(" - ")])]}}])}),a("template",{slot:"empty"},[a("div",{staticClass:"no-data"},[a("span",[e._v(e._s(e.$t("tag.NoData")))])])])],2)],1),a("div",{staticClass:"page-container"},[a("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[10,20,30,40],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.onPageSizeChange,"current-change":e.onCurrentPageChange}})],1)],1)},Zy=[],eC=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{ref:"searchForm",staticClass:"search-form",attrs:{inline:!0,model:e.formModel,size:"mini",rules:e.searchRules}},[a("el-form-item",[a("el-date-picker",{attrs:{"range-separator":"-",type:"daterange","start-placeholder":e.$t("Send date"),"end-placeholder":e.$t("Send date")},model:{value:e.formModel.createDate,callback:function(t){e.$set(e.formModel,"createDate",t)},expression:"formModel.createDate"}})],1),a("el-form-item",[a("el-select",{staticClass:"small-select",attrs:{placeholder:e.$t("Status"),clearable:!1,"collapse-tags":""},model:{value:e.formModel.status,callback:function(t){e.$set(e.formModel,"status",t)},expression:"formModel.status"}},e._l(e.statusList,(function(e){return a("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1),a("el-form-item",{attrs:{prop:"keyWord"}},[a("el-input",{staticClass:"input-with-select",model:{value:e.formModel.keyWord,callback:function(t){e.$set(e.formModel,"keyWord",t)},expression:"formModel.keyWord"}},[a("el-select",{style:{width:"120px"},attrs:{slot:"prepend"},slot:"prepend",model:{value:e.formModel.keyWordType,callback:function(t){e.$set(e.formModel,"keyWordType",t)},expression:"formModel.keyWordType"}},[a("el-option",{attrs:{label:e.$t("Booking ID"),value:"booking_sn"}}),a("el-option",{attrs:{label:e.$t("Payment ID"),value:"payment_sn"}}),a("el-option",{attrs:{label:e.$t("Product ID"),value:"product_id"}}),a("el-option",{attrs:{label:e.$t("Product name"),value:"product_title"}})],1)],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",disabled:!e.hasSearchData},on:{click:e.onSearch}},[e._v(e._s(e.$t("productmanage.common.Search")))]),e.hasSearchData?a("el-button",{on:{click:e.onClearClick}},[e._v(e._s(e.$t("productmanage.table.Clear")))]):e._e()],1),a("div",{staticClass:"actions"},[a("el-row",[a("el-col",{staticClass:"action-right",attrs:{span:24}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.exportLoading,expression:"exportLoading"}],attrs:{type:"text",size:"medium"},on:{click:e.onExport}},[a("i",{staticClass:"el-icon-download"}),e._v(e._s(e.$t("Export")))])],1)],1)],1)],1)},tC=[],aC={createDate:[],send_promotion_start_dt:null,send_promotion_end_dt:null,status:null,keyWord:"",keyWordType:"booking_sn"},nC={data:function(){return{formModel:Object.assign({},aC),PROMOTION_BATCH_SEARCH_TYPES:qe,exportLoading:!1}},computed:Object(F["a"])(Object(F["a"])({},Object(U["c"])(["platforms"])),{},{searchRules:function(){var e=this,t={},a=this.formModel.keyWordType,n=function(t,n,r){/^\s*\d*\s*$/.test(n)?r():r(new Error(e.$t("{0} must be number",[e.$t("".concat(qe[a]))])))};return["product_id"].indexOf(a)>-1&&(t.keyWord=[{validator:n,trigger:"change"},{validator:n,trigger:"blur"}]),t},statusList:function(){var e=this,t=He,a=Object.keys(t),n=[];return a.forEach((function(a){n.push({label:e.$t(t[a]),value:a})})),n},searchData:function(){var e={},t=this.formModel,a=t.send_promotion_start_dt,n=t.send_promotion_end_dt,r=t.status,o=t.keyWord,i=t.keyWordType;return a&&Object.assign(e,{send_promotion_start_dt:Vt()(a).format("YYYY-MM-DD")}),n&&Object.assign(e,{send_promotion_end_dt:Vt()(n).format("YYYY-MM-DD")}),r>-1&&Object.assign(e,{status:r}),o&&(e[i]=o),e},hasSearchData:function(){return!!Object.keys(this.searchData).length}}),methods:{onExport:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.exportLoading){t.next=2;break}return t.abrupt("return");case 2:return e.exportLoading=!0,t.prev=3,t.next=6,e.$api.promotion.exportOrderList(e.$route.query.promotionId,Object(F["a"])(Object(F["a"])({},e.searchData),{},{locale:e.$i18n.locale}));case 6:a=t.sent,Eo()(a,"Mylink_Promotion.xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");case 8:return t.prev=8,e.exportLoading=!1,t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[3,,8,11]])})))()},validateForm:function(){var e=this;return new Promise((function(t){e.$refs.searchForm.validate((function(e){t(!!e)}))}))},onClearClick:function(){Object.assign(this.formModel,aC),this.onSearch()},onSearch:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.validateForm();case 2:a=t.sent,a&&e.$emit("change",e.searchData);case 4:case"end":return t.stop()}}),t)})))()},initEnterEvent:function(){var e=this;document.onkeydown=function(t){var a=window.event.keyCode;13===a&&e.onSearch()}}},mounted:function(){this.initEnterEvent()},beforeDestroy:function(){document.onkeydown=null},watch:{"formModel.createDate":function(e){e&&e.length?(this.formModel.send_promotion_start_dt=Vt()(e[0]).format("YYYY-MM-DD"),this.formModel.send_promotion_end_dt=Vt()(e[1]).format("YYYY-MM-DD")):(this.formModel.send_promotion_start_dt=null,this.formModel.send_promotion_end_dt=null)},hasSearchData:function(e,t){t&&!e&&this.onSearch()},searchRules:function(e,t){e!==t&&this.$refs.searchForm.clearValidate()}}},rC=nC,oC=(a("7d8b"),Object(R["a"])(rC,eC,tC,!1,null,"3fcd510a",null)),iC=oC.exports,sC={components:{SeachForm:iC},data:function(){return{PRODUCT_BOOKING_PROMOTION_STATUS:He,promotionList:[],loading:!1,deletePopoverVisible:!1,searchData:null,currentPage:1,total:0,pageSize:10,ordering:"-id"}},computed:Object(F["a"])({},Object(U["c"])(["platformsMapping"])),created:function(){this.getOrderList()},methods:{getDiscountType:function(e){return this.$t(we[e])},getOrderList:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.searchData||{},e.loading=!0,e.promotionList=[],t.prev=3,t.next=6,e.$api.promotion.getOrderList(e.$route.query.promotionId,a);case 6:n=t.sent,e.promotionList=n.results,e.total=n.count;case 9:return t.prev=9,e.loading=!1,t.finish(9);case 12:case"end":return t.stop()}}),t,null,[[3,,9,12]])})))()},onSearchChange:function(e){this.searchData=e,this.currentPage=1,this.getOrderList()},onDeleteConfirm:function(){return Object(L["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},onCurrentPageChange:function(e){this.currentPage=e,this.getOrderList()},onPageSizeChange:function(e){this.pageSize=e,this.getOrderList()},onSort:function(e){"id"===e.prop&&("ascending"===e.order?this.ordering="id":this.ordering="-id",this.currentPage=1,this.getOrderList())}}},lC=sC,cC=(a("04a4"),Object(R["a"])(lC,Xy,Zy,!1,null,"03d6e95e",null)),uC=cC.exports,dC={data:function(){return{detail:null,loading:!0}},components:{BasicInfo:Jy,RelativeOrderList:uC},mounted:function(){this.getDetail()},methods:{getDetail:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.$api.promotion.getPromotionDetail(e.$route.query.promotionId);case 4:e.detail=t.sent;case 5:return t.prev=5,e.loading=!1,t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])})))()}}},pC=dC,mC=(a("dd629"),Object(R["a"])(pC,By,Ky,!1,null,"2e870137",null)),fC=mC.exports,gC=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"promotion-info"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"140px",size:"small",rules:e.rules,"validate-on-rule-change":!1,"show-message":!1,"inline-message":!0}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Basic info")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{prop:"name",label:e.$t("Promotion name")+":"}},[a("el-input",{attrs:{placeholder:e.$t("Promotion name")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Promotion prd")+":",prop:"promotionPrd"}},[a("el-date-picker",{attrs:{"picker-options":e.getPickerOptions(),type:"datetimerange","default-time":e.defaultTime,"start-placeholder":e.$t("StartDate"),"end-placeholder":e.$t("EndDate")},model:{value:e.form.promotionPrd,callback:function(t){e.$set(e.form,"promotionPrd",t)},expression:"form.promotionPrd"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:e.$t("External PF")+":",prop:"supporting_provider"}},[a("el-checkbox-group",{model:{value:e.form.supporting_provider,callback:function(t){e.$set(e.form,"supporting_provider",t)},expression:"form.supporting_provider"}},e._l(e.externalPlatforms,(function(t){return a("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(e.$t(t.name)))])})),1)],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Rights(Mylink points)")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Rewards method")+":",prop:"reward_method"}},[a("el-radio-group",{model:{value:e.form.reward_method,callback:function(t){e.$set(e.form,"reward_method",t)},expression:"form.reward_method"}},[a("el-radio",{attrs:{label:0}},[e._v(e._s(e.$t("Every Booking")))]),a("el-radio",{attrs:{label:1}},[e._v(e._s(e.$t("Follow Payment Price")))])],1)],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Mylink point promo id")+":",prop:"mylink_point_promo"}},[a("el-input",{attrs:{placeholder:e.$t("Mylink point promo id")},model:{value:e.form.mylink_point_promo,callback:function(t){e.$set(e.form,"mylink_point_promo",t)},expression:"form.mylink_point_promo"}})],1)],1)])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:e.$t("Amount")+":",prop:"reward_mylink_points"}},[a("el-input",{attrs:{placeholder:e.$t("Amount")},model:{value:e.form.reward_mylink_points,callback:function(t){e.$set(e.form,"reward_mylink_points",e._n(t))},expression:"form.reward_mylink_points"}})],1)],1),1===e.form.reward_method?a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:e.$t("for every")+":",prop:"reward_per_amount","label-width":"80px"}},[a("el-input",{attrs:{placeholder:e.$t("Price"),type:"number"},model:{value:e.form.reward_per_amount,callback:function(t){e.$set(e.form,"reward_per_amount",e._n(t))},expression:"form.reward_per_amount"}},[a("el-select",{staticStyle:{width:"80px"},attrs:{slot:"prepend"},slot:"prepend",model:{value:e.form.base_currency,callback:function(t){e.$set(e.form,"base_currency",t)},expression:"form.base_currency"}},e._l(e.CURRENCY_TYPES,(function(t,n){return a("el-option",{key:n,attrs:{value:n}},[e._v(e._s(e.$t(t)))])})),1)],1)],1)],1):e._e()],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("span",{staticClass:"promotion-title"},[e._v(e._s(e.$t("Product limit")))])])],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"grid-content"},[a("el-form-item",{attrs:{label:e.$t("Apply product")+":",prop:"applying_method"}},[a("el-radio-group",{attrs:{placeholder:e.$t("Apply product")},model:{value:e.form.applying_method,callback:function(t){e.$set(e.form,"applying_method",t)},expression:"form.applying_method"}},e._l(e.COUPON_PRODUCT_LIMITS,(function(t,n){return a("el-radio",{key:n,attrs:{label:+n}},[e._v(e._s(e.$t(t)))])})),1)],1)],1)])],1),"Specific type/category"===e.COUPON_PRODUCT_LIMITS[e.form.applying_method]?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:e.$t("Type/category")+":",prop:"included_categories"}},[a("el-cascader",{staticClass:"select-long",attrs:{options:e.mappedProductTypes,placeholder:e.$t("Product type and category"),clearable:!0,props:{multiple:!0,expandTrigger:"hover"}},model:{value:e.form.included_categories,callback:function(t){e.$set(e.form,"included_categories",t)},expression:"form.included_categories"}})],1)],1)],1):e._e(),"Specific product"===e.COUPON_PRODUCT_LIMITS[e.form.applying_method]?a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:e.$t("Products")+":",prop:"included_products"}},[a("el-select",{directives:[{name:"loading",rawName:"v-loading",value:e.productLoading,expression:"productLoading"}],staticClass:"select-long",attrs:{width:"350px",placeholder:e.form.included_products.length?"":e.$t("Enter and search one or multiple product"),multiple:"",filterable:"",remote:"","reserve-keyword":"","remote-method":e.productsSearch},model:{value:e.form.included_products,callback:function(t){e.$set(e.form,"included_products",t)},expression:"form.included_products"}},e._l(e.getRes(e.productList),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value+"-"+t.label,value:t.value}},[e._v(e._s(t.value)+"-"+e._s(t.label))])})),1)],1)],1)],1):e._e()],1),a("div",{staticClass:"tab-box"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.save}},[e._v(e._s(e.$t("Submit")))]),a("el-button",{attrs:{type:"gray",size:"small"},on:{click:e.cancel}},[e._v(e._s(e.$t("Cancel")))])],1)],1)},hC=[],_C=["promotionPrd","reward_per_amount"],vC={data:function(){return{lastEvent:null,CURRENCY_TYPES:$e,COUPON_PRODUCT_LIMITS:xe,defaultTime:["00:00:00","23:59:59"],form:{name:"",status:"ACT",reward_method:0,base_currency:"HKD",reward_per_amount:null,reward_mylink_points:null,applying_method:0,includes_all_products:!0,included_products:[],excluded_products:[],included_categories:[],supporting_provider:[],valid_start_dt:null,valid_end_dt:null,promotionPrd:[],mylink_point_promo:null},isSubmiting:!1,productTypes:[],productLoading:!1,productList:[]}},watch:{"form.applying_method":function(e,t){if(e!==t)switch(xe[e]){case"No limit":this.form.included_categories=[],this.form.included_products=[],this.form.includes_all_products=!0;break;case"Specific type/category":this.form.included_products=[],this.form.includes_all_products=!1;break;case"Specific product":this.form.included_categories=[],this.form.includes_all_products=!1;break}},"form.promotionPrd":function(e,t){e&&e.length?(this.form.valid_start_dt=e[0],this.form.valid_end_dt=e[1]):(this.form.valid_start_dt=null,this.form.valid_end_dt=null)},rules:function(){var e=this;this.$nextTick((function(){e.$refs.form.clearValidate()}))}},computed:Object(F["a"])(Object(F["a"])(Object(F["a"])({},Object(U["c"])(["externalPlatforms","internalPlatforms"])),Object(U["c"])("chatbotSetup",["getSetting"])),{},{rules:function(){var e=this,t=function(t,a,n){if(a<=0||isNaN(a)||"number"!==typeof(a-0))n(new Error(e.$t("productmanage.common.MustBeDigitGreaterThan0")));else if(a>0&&!isNaN(a)&&"number"===typeof(a-0)){var r=a.toString().indexOf(".");if(r>-1){var o=a.length-1-r;o>2?n(new Error(e.$t("UpToTwoDecimalPlaces"))):n()}else n()}else n()},a=function(t,a,n){a<=0||!/^[0-9]+$/.test(""+a)?n(new Error(e.$t("MustBeIntegerGreaterThan0"))):n()},n={name:[{name:this.$t("Promotion name"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}],promotionPrd:[{name:this.$t("Promotion prd"),type:"array",required:!0,message:this.$t("ItsRequired"),trigger:"change"}],mylink_point_promo:[{name:this.$t("Mylink point promo id"),required:!0,message:this.$t("ItsRequired"),trigger:"change"}],reward_mylink_points:[{name:this.$t("Amount"),required:!0,validator:a,trigger:"change"}],supporting_provider:[{name:this.$t("External PF"),type:"array",required:!0,trigger:"change"}]};return 1===this.form.reward_method&&(n.reward_per_amount=[{name:this.$t("Price"),required:!0,validator:t,trigger:"change"}]),n},mappedProductTypes:function(){var e=this;return this.productTypes.map((function(t){return{label:t.name[e.$i18n.locale],value:pe[t.name["en_US"]],children:t.children.map((function(t){return{label:t.name[e.$i18n.locale],value:t.id}}))}}))},getLanguageList:function(){var e=this,t=[];return this.languagePageList.forEach((function(a){e.editableTabs.findIndex((function(e){return e.name===a}))>-1||t.push(a)})),t},getRes:function(){var e=this.$i18n.locale;return function(t){var a=this,n=t.map((function(t){return{label:a.$options.filters.lang(t.details,e,"title"),value:t.id}}));return n}},getPlatforms:function(){var e=this;return this.getSetting?Object.keys(this.getSetting.platforms).filter((function(e){return"external"!==e&&"internal"!==e})).map((function(t){return{id:t,name:e.getSetting.platforms[t]}})):[]}}),methods:{getPickerOptions:function(){return{disabledDate:function(e){return Vt()(Vt()(e).format("YYYY-MM-DD"))"),d+="[".concat(p[m],"]
")):"zh_CN"===u?(d||(d="保存失败!以下有必填项未填
"),d+="[".concat(p[m],"]
")):"zh_HK"===u&&(d||(d="保存失敗!以下有必填項未填
"),d+="[".concat(p[m],"]
")),t.next=39;break;case 46:d&&e.$message({dangerouslyUseHTMLString:!0,message:d,type:"error"});case 47:case"end":return t.stop()}}),t,null,[[5,14,28,31]])})));return function(e,a){return t.apply(this,arguments)}}());case 3:case"end":return t.stop()}}),t)})))()},cancel:function(){this.$router.push("/marketing/promotion-list")}},beforeMount:function(){this.getTreeList()}},bC=vC,yC=(a("1bad"),a("4e4a"),Object(R["a"])(bC,gC,hC,!1,null,"32c258f0",null)),CC=yC.exports,kC=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"title"},[e._v("Bulk upload product")]),a("div",{staticClass:"upload-wrapper"},[a("el-upload",{staticClass:"uploader",attrs:{drag:"",action:e.uploadURL,headers:e.headers,"on-success":e.onUploadSuccess,"on-error":e.onUploadError,"before-upload":e.beforeUpload}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v(e._s(e.$t("Click or drag the file here to upload")))]),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(e._s(e.$t("Only support xls format and"))+" < 5MB")])]),a("div",{staticClass:"upload-fail-details"},e._l(e.uploadFailDetails,(function(t,n){return a("div",{key:n},[e._v(e._s(e.formatErrorMsg(t)))])})),0)],1)])},wC=[],$C={props:{visible:{type:Boolean,default:!1}},data:function(){return{baseURL:this.$env.apiUrl,uploadFailDetails:[]}},computed:{uploadURL:function(){var e=this.$env.getVendor();return"".concat(this.baseURL,"/").concat(e,"/uno_product/upload")},headers:function(){return{Authorization:"Bearer "+this.$env.getToken()}}},methods:{onUploadSuccess:function(){this.$message.success(this.$t("Upload successed."))},onUploadError:function(e){this.uploadFailDetails=JSON.parse(e.message)},beforeUpload:function(){this.uploadFailDetails=[]},formatErrorMsg:function(e){var t=e.error;return t}}},SC=$C,xC=(a("6742"),Object(R["a"])(SC,kC,wC,!1,null,"7bcc8a48",null)),TC=xC.exports;S["default"].use(N["a"]);var DC=[{path:"/",component:ct,redirect:"/home",hidden:!0,children:[{path:"home",name:"Home",component:gt},{path:"/chatbot-setup",name:"ChatbotSetup",component:yt,redirect:"/chatbot-setup/basic",hidden:!0,children:[{path:"basic",name:"ChatbotSetupBasic",component:Tt},{path:"banner",name:"ChatbotSetupBanner",component:Mt},{path:"functions",name:"ChatbotSetupFunctions",component:qt},{path:"agent",name:"ChatbotSetupAgent",component:oo},{path:"function-rule",name:"ChatbotSetupFnRule",component:bo}]},{path:"/message-center",name:"MessageCenter",component:So},{path:"/faq",name:"Faq",component:mm},{path:"/agent",name:"Agent",component:vc},{path:"/order-manage",name:"OrderManage",component:$c,redirect:"/order-manage/list",hidden:!0,children:[{path:"list",name:"OrderList",component:ih,meta:{hideTopbar:!0}},{path:"reservations",name:"ReservationList",component:ph,meta:{hideTopbar:!1}},{path:"orders",name:"Orders",component:xh,meta:{hideTopbar:!1}},{path:"order/detail/:id",name:"OrderDetail",component:R_}]},{path:"/booking-code",name:"BookingCodeIndex",component:L_,redirect:"/booking-code/list",hidden:!0,children:[{path:"list",name:"BookingCodeList",component:J_}]},{path:"/product-manage",name:"ProductManage",component:Nc,redirect:"/product-manage/travel-and-delivery",children:[{path:"travel-and-delivery",name:"TravelAndDelivery",component:Yc},{path:"restaurant",name:"RestaurantProduct",component:Tg},{path:"operation",name:"Operation",component:xd},{path:"restaurant/information",name:"RestaurantProductInfo",component:eh},{path:"bulk-upload",name:"BulkUpload",component:TC}]},{path:"/tag-manage",name:"TagManage",component:vm,redirect:"/tag-manage/basic",children:[{path:"basic",name:"TagManageBasic",component:qm},{path:"detail",name:"TagManageDetail",component:mf}]},{path:"/financial/currency",name:"FinancialCurrency",component:bf},{path:"/financial/currency/:id/edit",name:"FinancialCurrencyEdit",component:xf},{path:"/poi",name:"Poi",component:If,redirect:"/poi/list",hidden:!0,children:[{path:"list",name:"PoiList",component:Bf},{path:"information",name:"PoiInformation",component:fg}]},{path:"/marketing",name:"Marketing",component:Id,hidden:!0,redirect:"/marketing/coupon-list",children:[{path:"coupon-list",name:"CouponList",component:Bd},{path:"coupon/information",name:"CouponInfo",component:gp},{path:"coupon/Add",name:"CouponAdd",component:Tp},{path:"event-list",name:"EventList",component:iy},{path:"event/edit",name:"EventEdit",component:Oy},{path:"promotion-list",name:"PromotionList",component:Hy},{path:"promotion/information",name:"PromotionInfo",component:fC},{path:"promotion/Add",name:"PromotionAdd",component:CC}]},{path:"/operation-center",name:"OperationCenter",component:nv,hidden:!0,redirect:"/operation-center/mkp-homepage/banner",children:[{path:"mkp-homepage",name:"OperationMKPHomepage",component:cv,redirect:"/operation-center/mkp-homepage/banner",hidden:!0,children:[{path:"banner",name:"OperationBannerMKPHomepage",component:Dv}]},{path:"rest-channel",name:"OperationRestChannel",component:Mv,hidden:!0,redirect:"/operation-center/rest-channel/banner",children:[{path:"banner",name:"OperationBannerRestChannel",component:fb},{path:"promotion",name:"OperationRestPromotion",component:Yv},{path:"theme-list",name:"OperationRestThemeList",component:tb},{path:"bottom-tag",name:"OperationRestBottomTag",component:zv}]},{path:"delivery-channel",name:"OperationDeliveryChannel",component:yb,hidden:!0,redirect:"/operation-center/delivery-channel/banner",children:[{path:"banner",name:"OperationBannerDeliveryChannel",component:ey},{path:"promotion",name:"OperationDeliveryPromotion",component:Eb},{path:"theme-list",name:"OperationDeliveryThemeList",component:zb},{path:"bottom-tag",name:"OperationDeliveryBottomTag",component:Tb}]}]}]},{path:"/auth/login",name:"Login",component:Oc}],PC=new N["a"]({mode:"history",routes:DC}),OC=PC,IC={platform:null,settings:null};function RC(e,t){return e.filter(t)[0]}function EC(e,t){if(void 0===t&&(t=[]),null===e||"object"!==Object(wt["a"])(e))return e;var a=RC(t,(function(t){return t.original===e}));if(a)return a.copy;var n=Array.isArray(e)?[]:{};return t.push({original:e,copy:n}),Object.keys(e).forEach((function(a){n[a]=EC(e[a],t)})),n}var MC,NC,jC,AC,LC={UPDATE_PLATFORM:"UPDATE_PLATFORM",UPDATE_SETTINGS:"UPDATE_SETTINGS",UPDATE_FUNCTIONS:"UPDATE_CHATBOT_FUNCTIONS",UPDATE_BANNERS:"UPDATE_BANNERS",UPDATE_TEMPLATE:"UPDATE_TEMPLATE"},FC={getSettings:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.state,n=e.getters,r=e.commit,t.next=3,Qr.setting.getChatbotSettings();case 3:o=t.sent,r(LC.UPDATE_SETTINGS,o),!a.platform&&n.platforms.length&&r(LC.UPDATE_PLATFORM,n.platforms[n.platforms.length-1].code);case 6:case"end":return t.stop()}}),t)})))()},updateFunctionSettings:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.commit,r=e.state,o=EC(r.settings),o.chatbot_config[r.platform].functions=t,a.next=5,Qr.setting.updateChatbotSettings(o);case 5:n(LC.UPDATE_FUNCTIONS,t);case 6:case"end":return a.stop()}}),a)})))()},updateBanner:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.commit,r=e.state,o=EC(r.settings),o.chatbot_config[r.platform].banner=t,a.next=5,Qr.setting.updateChatbotSettings(o);case 5:n(LC.UPDATE_BANNERS,t);case 6:case"end":return a.stop()}}),a)})))()},updateWelcomeMessageTemplate:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.getters,r=e.commit,a.next=3,Qr.setting.updateMessageTemplate(n.welcomeMessage.id,t);case 3:o=a.sent,r(LC.UPDATE_TEMPLATE,o);case 5:case"end":return a.stop()}}),a)})))()},updateUnknownMessageTemplate:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.getters,r=e.commit,a.next=3,Qr.setting.updateMessageTemplate(n.unknownMessage.id,t);case 3:o=a.sent,r(LC.UPDATE_TEMPLATE,o);case 5:case"end":return a.stop()}}),a)})))()},updateCsMessageTemplate:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.getters,r=e.commit,a.next=3,Qr.setting.updateMessageTemplate(n.csMessage.id,t);case 3:o=a.sent,r(LC.UPDATE_TEMPLATE,o);case 5:case"end":return a.stop()}}),a)})))()},updatePlatform:function(e,t){var a=e.commit;a(LC.UPDATE_PLATFORM,t)}},UC={platforms:function(e){return e.settings?e.settings.available_service.faq&&e.settings.available_service.faq.platform:[]},currentPlatform:function(e,t){return t.platforms.length?t.platforms.find((function(t){return t.code===e.platform})):null},languages:function(e,t){var a={};if(t.platforms.length){var n=t.platforms.find((function(t){return t.code===e.platform}));return n.lang.forEach((function(e){a[e.value]=!0})),a}return[]},welcomeMessage:function(e){return e.settings?e.settings.templates.find((function(t){return t.platform===e.platform&&1===t.template_type})):null},unknownMessage:function(e){return e.settings?e.settings.templates.find((function(t){return t.platform===e.platform&&2===t.template_type})):null},csMessage:function(e){return e.settings?e.settings.templates.find((function(t){return t.platform===e.platform&&3===t.template_type})):null},banner:function(e){return e.settings?e.settings.chatbot_config[e.platform].banner:null},functions:function(e){return e.settings?e.settings.chatbot_config[e.platform].functions:[]},agentSettings:function(e){return e.settings?e.settings.chatbot_config[e.platform].agent_setting:[]},timezone:function(e){return e.settings?e.settings.timezone:null},timezoneOffset:function(e){return e.settings&&e.settings.timezone?e.settings.timezone.offset:Vt()().utcOffset()},getSetting:function(e){return e.settings},availableServices:function(e){return e.settings?e.settings.available_service:null},allPlatforms:function(e){return e.settings&&e.settings.platforms?Object.keys(e.settings.platforms).map((function(t){return{id:Number(t),name:e.settings.platforms[t]}})):[]}},zC=(MC={},Object(Ot["a"])(MC,LC.UPDATE_PLATFORM,(function(e,t){e.platform=t})),Object(Ot["a"])(MC,LC.UPDATE_SETTINGS,(function(e,t){e.settings=t})),Object(Ot["a"])(MC,LC.UPDATE_FUNCTIONS,(function(e,t){e.settings.chatbot_config[e.platform].functions=t})),Object(Ot["a"])(MC,LC.UPDATE_BANNERS,(function(e,t){e.settings.chatbot_config[e.platform].banner=t})),Object(Ot["a"])(MC,LC.UPDATE_TEMPLATE,(function(e,t){var a=e.settings.templates.findIndex((function(e){return e.id===t.id}));a>-1&&e.settings.templates.splice(a,1,t)})),MC),qC={namespaced:!0,state:IC,actions:FC,getters:UC,mutations:zC},HC={userInfo:null},BC={getUserInfo:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,t.next=3,Qr.user.getUserInfo();case 3:n=t.sent,a("UPDATE_USER_INFO",n);case 5:case"end":return t.stop()}}),t)})))()}},KC={timezone:function(e){return e.userInfo?e.userInfo.timezone:null},timezoneOffset:function(e){return e.userInfo&&e.userInfo.timezone?e.userInfo.timezone.offset:Vt()().utcOffset()}},VC={UPDATE_USER_INFO:"UPDATE_USER_INFO"},YC=Object(Ot["a"])({},VC.UPDATE_USER_INFO,(function(e,t){e.userInfo=t})),WC={namespaced:!0,state:HC,actions:BC,getters:KC,mutations:YC},GC={countryList:[],cityList:[]},QC={getCountryList:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,t.next=3,Qr.pog.getCountries(1e3);case 3:n=t.sent,a("GTE_CONUTYR_LIST",n.results||[]);case 5:case"end":return t.stop()}}),t)})))()},getCityList:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.commit,a.next=3,Qr.pog.getCities(t,1e3);case 3:r=a.sent,n("GTE_CONUTYR_LIST",r.results||[]);case 5:case"end":return a.stop()}}),a)})))()}},JC={getCountry:function(e){var t=window.localStorage.getItem("locale");return e.countryList.map((function(e){return{label:e.meta[t],value:e.id}}))},getCity:function(e){var t=window.localStorage.getItem("locale");return e.cityList.map((function(e){return{label:e.meta[t],value:e.id}}))}},XC={GTE_CONUTYR_LIST:"GTE_CONUTYR_LIST",GET_CITY_LIST:"GET_CITY_LIST"},ZC=(NC={},Object(Ot["a"])(NC,XC.GTE_CONUTYR_LIST,(function(e,t){e.countryList=t})),Object(Ot["a"])(NC,XC.GET_CITY_LIST,(function(e,t){e.cityList=t})),NC),ek={namespaced:!0,state:GC,actions:QC,getters:JC,mutations:ZC},tk={currentLang:null,currentCategoryId:"",faqData:null,qna:{data:[],pageSize:15,currentPage:1,total:0}},ak={UPDATE_CURRENT_LANG:"UPDATE_CURRENT_LANG",UPDATE_CURRENT_CATEGORY_ID:"UPDATE_CURRENT_CATEGORY_ID",UPDATE_FAQ_DATA:"UPDATE_FAQ_DATA",UPDATE_QNA_DATA:"UPDATE_QNA_DATA",UPDATE_CATEGORY_NAME:"UPDATE_CATEGORY_NAME",DELETE_CATEGORY:"DELETE_CATEGORY",UPDATE_QNA_PAGE:"UPDATE_QNA_PAGE",CLEAR_QNA_DATA:"CLEAR_QNA_DATA"},nk={updateCurrentLang:function(e,t){var a=e.commit;a(ak.UPDATE_CURRENT_LANG,t)},updateCurrentCategoryId:function(e,t){var a=e.commit;a(ak.UPDATE_CURRENT_CATEGORY_ID,t)},clearQnaData:function(e,t){var a=e.commit;a(ak.CLEAR_QNA_DATA)},getFaqData:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.state,n=e.commit,r=e.rootGetters,o=r["chatbotSetup/currentPlatform"],i={lang:a.currentLang,platform:o.id},t.next=5,Qr.faq.getFaq(i);case 5:s=t.sent,n(ak.UPDATE_FAQ_DATA,s.results);case 7:case"end":return t.stop()}}),t)})))()},getQnaData:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s,l;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.commit,o=e.rootGetters,i=o["chatbotSetup/currentPlatform"],s={lang:n.currentLang,platform:i.id,page_size:n.qna.pageSize,page:n.qna.currentPage},n.currentCategoryId&&(s.path=n.currentCategoryId),t&&(s.qna=t),a.next=7,Qr.faq.getQna(s);case 7:l=a.sent,r(ak.UPDATE_QNA_DATA,l);case 9:case"end":return a.stop()}}),a)})))()},updateQnaPage:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:n=e.commit,n(ak.UPDATE_QNA_PAGE,t);case 2:case"end":return a.stop()}}),a)})))()},createCategory:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.dispatch,o=e.rootGetters,i=o["chatbotSetup/currentPlatform"],s={meta:{platform:i.id,lang:Number(n.currentLang)},data:[{type:"create",path:t.path,level:t.level,key:"",payload:{name:t.name,active:!0,priority:null}}]},a.next=5,Qr.faq.categoryBulk(s);case 5:r("getFaqData");case 6:case"end":return a.stop()}}),a)})))()},updateCategory:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.commit,o=e.rootGetters,i=o["chatbotSetup/currentPlatform"],s={meta:{platform:i.id,lang:Number(n.currentLang)},data:[{type:"update",level:t.level,payload:{id:t.id,name:t.name,active:t.active}}]},a.next=5,Qr.faq.categoryBulk(s);case 5:r(ak.UPDATE_CATEGORY_NAME,t);case 6:case"end":return a.stop()}}),a)})))()},deleteCategory:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o,i,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.commit,o=e.rootGetters,i=o["chatbotSetup/currentPlatform"],s={meta:{platform:i.id,lang:Number(n.currentLang)},data:[{type:"delete",level:t.level,payload:{id:t.id}}]},a.next=5,Qr.faq.categoryBulk(s);case 5:r(ak.DELETE_CATEGORY,t);case 6:case"end":return a.stop()}}),a)})))()}},rk={categories:function(e){var t=[];if(e.faqData)for(var a=0;a-1&&a.children.splice(n,1)}}else{var r=e.faqData.tree.findIndex((function(e){return e.id===t.id}));r>-1&&e.faqData.tree.splice(r,1)}})),Object(Ot["a"])(jC,ak.UPDATE_QNA_PAGE,(function(e,t){e.qna.currentPage=t})),jC),ik={namespaced:!0,state:tk,actions:nk,getters:rk,mutations:ok},sk={treeId:""},lk={UPDATE_TREE_ID:"UPDATE_TREE_ID"},ck={updateTreeId:function(e,t){var a=e.commit;a(lk.UPDATE_TREE_ID,t)}},uk={getTreeId:function(e){return e.treeId}},dk=Object(Ot["a"])({},lk.UPDATE_TREE_ID,(function(e,t){e.treeId=t})),pk={namespaced:!0,state:sk,actions:ck,getters:uk,mutations:dk},mk={currentStats:null,clientSearch:{type:ce.MESSAGE,searchText:""},clients:{list:[],nextCursor:null,loadedAll:!1},clientTab:"all-client",currentClient:null,messages:{list:[],nextCursor:null,loadedAll:!1},agents:[],quickReplies:[],selectedQuickReply:null,stats:{agent:0,green:0,red:0,purple:0,yellow:0,blue:0,gray:0},filterAgent:null,showClientTag:!0,isAllClientHasNew:!1,isMyClientHasNew:!1},fk={APPEND_MESSAGES:"APPEND_MESSAGES",CLEAR_MESSAGES:"CLEAR_MESSAGES",SET_AGENTS:"SET_AGENTS",SET_QUICK_REPLIES:"SET_QUICK_REPLIES",SET_SELECTED_QUICK_REPLY:"SET_SELECTED_QUICK_REPLY",ADD_QUICK_REPLY:"ADD_QUICK_REPLY",UPDATE_QUICK_REPLY:"UPDATE_QUICK_REPLY",REMOVE_QUICK_REPLY:"REMOVE_QUICK_REPLY",APPEND_CLIENTS:"APPEND_CLIENTS",CLEAR_CLIENTS:"CLEAR_CLIENTS",SET_NEXT_CURSOR:"SET_NEXT_CURSOR",SET_CURRENT_CLIENT:"SET_CURRENT_CLIENT",SET_CLIENT_TAB:"SET_CLIENT_TAB",UPDATE_RECEIVED_MESSAGE_CLIENT:"UPDATE_RECEIVED_MESSAGE_CLIENT",UPDATE_STATS:"UPDATE_STATS",UPDATE_RECEIVED_USER:"UPDATE_RECEIVED_USER",UPDATE_CLIENT_ONLINE_STATUS:"UPDATE_CLIENT_ONLINE_STATUS",SET_CURRENT_STATS:"SET_CURRENT_STATS",SET_FILTER_AGENT:"SET_FILTER_AGENT",SET_CLIENT_SEARCH:"SET_CLIENT_SEARCH",SET_SHOW_CLIENT_TAG:"SET_SHOW_CLIENT_TAG",UPDATE_CURRENT_USER:"UPDATE_CURRENT_USER",UPDATE_CURRENT_USER_TAGS:"UPDATE_CURRENT_USER_TAGS",REMOVE_CURRENT_USER_TAGS:"REMOVE_CURRENT_USER_TAGS",MARK_AS_READ:"MARK_AS_READ",CALC_WAITING_SECONDS:"CALC_WAITING_SECONDS",CLEAR_CLIENT_UNREAD:"CLEAR_CLIENT_UNREAD",SET_ALL_CLIENT_HAS_NEW:"SET_ALL_CLIENT_HAS_NEW",SET_MY_CLIENT_HAS_NEW:"SET_MY_CLIENT_HAS_NEW",SET_MESSAGE_NEXT_CURSOR:"SET_MESSAGE_NEXT_CURSOR"},gk=null,hk={getStats:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,t.next=3,Qr.agent.getStatistics();case 3:n=t.sent,a("UPDATE_STATS",n);case 5:case"end":return t.stop()}}),t)})))()},setCurrentStats:function(e,t){var a=e.commit;a("SET_CURRENT_STATS",t)},clearClients:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:a=e.commit,a(fk.CLEAR_CLIENTS);case 2:case"end":return t.stop()}}),t)})))()},loadClients:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.state,n=e.dispatch,!a.clients.loadedAll){t.next=3;break}return t.abrupt("return");case 3:if(!a.clientSearch.searchText){t.next=8;break}return t.next=6,n("loadClientBySearch");case 6:t.next=10;break;case 8:return t.next=10,n("loadClientByTab");case 10:case"end":return t.stop()}}),t)})))()},loadClientByTab:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.rootState,n=e.state,r=e.dispatch,o=e.getters,i=e.commit,s={ordering:"-last_message_id",provider__gt:0,last_message__gt:-1},n.clients.nextCursor&&(s.cursor=n.clients.nextCursor),n.currentStats===le.STARTED_CHATBOT&&(s.color_status=0),n.currentStats===le.AI_HANDLING&&(s.color_status=3),n.currentStats===le.AGENT_HANDLING&&(s.color_status=1),n.currentStats===le.REQUEST_AGENT&&(s.color_status=2,s.ordering="-is_online, color_changed_dt"),n.filterAgent&&(s.locked_agent=n.filterAgent.id),"my-client"===n.clientTab&&(s.color_status=1,s.locked_agent=a.user.userInfo.user_id),t.next=11,Qr.agent.getClients(s);case 11:l=t.sent,c=null,l.next&&(u=new URL(l.next),c=u.searchParams.get("cursor")),i(fk.SET_NEXT_CURSOR,c),i(fk.APPEND_CLIENTS,l.results),l.results.length&&!n.currentClient&&(i(fk.SET_CURRENT_CLIENT,l.results[0]),o.isAssignToMe&&r("markAsRead",l.results[0].id));case 17:case"end":return t.stop()}}),t)})))()},loadClientBySearch:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l,c,u,d,p,m;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.state,n=e.commit,r=e.getters,o=e.dispatch,a.clientSearch.type!==ce.MESSAGE){t.next=10;break}return l={ordering:"-timestamp",tsv_message:a.clientSearch.searchText,page_size:20},a.clients.nextCursor&&(l.cursor=a.clients.nextCursor),t.next=6,Qr.agent.getMessages(l);case 6:i=t.sent,s=i.results.map((function(e){return Object(F["a"])(Object(F["a"])({id:e.user},e.user_detail),{},{provider:e.provider,locked_agent:e.user_detail.locked_agent_id,last_message_detail:{id:e.id,timestamp:e.timestamp,source:e.source,message:e.message,attachment_type:e.attachment_type,attachment_payload:e.attachment_payload,is_broadcast:e.is_broadcast}})})),t.next=32;break;case 10:if(a.clientSearch.type!==ce.ID){t.next=18;break}return c={ordering:"-last_message_id",last_message__gt:-1,id:a.clientSearch.searchText},t.next=14,Qr.agent.getClients(c);case 14:i=t.sent,s=i.results,t.next=32;break;case 18:if(a.clientSearch.type!==ce.CLIENT){t.next=26;break}return u={ordering:"-last_message_id",provider__gt:0,first_name__icontains:a.clientSearch.searchText,last_name__icontains:a.clientSearch.searchText,nick_name__icontains:a.clientSearch.searchText,email__icontains:a.clientSearch.searchText,or:"first_name__icontains,last_name__icontains,nick_name__icontains,email__icontains",last_message__gt:-1},t.next=22,Qr.agent.getClients(u);case 22:i=t.sent,s=i.results,t.next=32;break;case 26:if(a.clientSearch.type!==ce.TAG){t.next=32;break}return d={ordering:"-last_message_id",tag_type_categories:a.clientSearch.searchText,or:"tag_type_categories",last_message__gt:-1},t.next=30,Qr.agent.getClients(d);case 30:i=t.sent,s=i.results;case 32:p=null,i.next&&(m=new URL(i.next),p=m.searchParams.get("cursor")),n(fk.SET_NEXT_CURSOR,p),n(fk.APPEND_CLIENTS,s),s.length&&!a.currentClient&&(n(fk.SET_CURRENT_CLIENT,s[0]),r.isAssignToMe&&o("markAsRead",i.results[0].id));case 37:case"end":return t.stop()}}),t)})))()},setClientSearch:function(e,t){var a=e.commit;a(fk.SET_CLIENT_SEARCH,t)},setCurrentClient:function(e,t){e.rootState;var a=e.commit;a(fk.SET_CURRENT_CLIENT,t)},appendMessage:function(e,t){var a=e.commit;a(fk.APPEND_MESSAGES,t)},clearMessages:function(e){var t=e.commit;t(fk.CLEAR_MESSAGES)},loadMessages:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.state,n=e.commit,r=e.getters,o={ordering:"-timestamp",user:r.currentClientId},a.messages.nextCursor&&(o.cursor=a.messages.nextCursor),t.next=5,Qr.agent.getMessages(o);case 5:i=t.sent,s=null,i.next&&(l=new URL(i.next),s=l.searchParams.get("cursor")),n(fk.SET_MESSAGE_NEXT_CURSOR,s),n(fk.APPEND_MESSAGES,i.results);case 10:case"end":return t.stop()}}),t)})))()},getAllAgents:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,n={ordering:"first_name",is_staff:"True",is_active:"True",is_online:"True",page_size:100},t.next=4,Qr.agent.getClients(n);case 4:r=t.sent,a(fk.SET_AGENTS,r.results.filter((function(e){return e.first_name||e.last_name})));case 6:case"end":return t.stop()}}),t)})))()},getQuickReplies:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.state,n=e.commit,!a.quickReplies.length){t.next=3;break}return t.abrupt("return");case 3:return r={ordering:"-used_dt",page_size:100},t.next=6,Qr.agent.getQuickReplies(r);case 6:o=t.sent,n(fk.SET_QUICK_REPLIES,o.results);case 8:case"end":return t.stop()}}),t)})))()},setSelectedQuickReply:function(e,t){var a=e.commit;a(fk.SET_SELECTED_QUICK_REPLY,t)},addQuickReply:function(e,t){var a=e.commit;a(fk.ADD_QUICK_REPLY,t)},updateQuickReply:function(e,t){var a=e.commit;a(fk.UPDATE_QUICK_REPLY,t)},removeQuickReply:function(e,t){var a=e.commit;a(fk.REMOVE_QUICK_REPLY,t)},setClientTab:function(e,t){var a=e.commit;a(fk.SET_CLIENT_TAB,t),a("all-client"===t?fk.SET_ALL_CLIENT_HAS_NEW:fk.SET_MY_CLIENT_HAS_NEW,!1)},messageReceived:function(e,t){var a=e.commit,n=e.state,r=e.rootState,o=e.getters;a(fk.UPDATE_RECEIVED_MESSAGE_CLIENT,t),"my-client"===n.clientTab&&t.user_detail.locked_agent_id!==r.user.userInfo.user_id&&a(fk.SET_ALL_CLIENT_HAS_NEW,!0),"all-client"===n.clientTab&&t.user_detail.locked_agent_id===r.user.userInfo.user_id&&o.currentClientId!==t.user&&a(fk.SET_MY_CLIENT_HAS_NEW,!0)},messageDashboardReceived:function(e,t){var a=e.commit;a(fk.UPDATE_STATS,t)},messageUserReceived:function(e,t){var a=e.commit;a(fk.UPDATE_RECEIVED_USER,t)},messageOnOfflineReceived:function(e,t){var a=e.commit;e.state;a(fk.UPDATE_CLIENT_ONLINE_STATUS,t)},setFilterAgent:function(e,t){var a=e.commit;a(fk.SET_FILTER_AGENT,t)},setShowClientTag:function(e,t){var a=e.commit;a(fk.SET_SHOW_CLIENT_TAG,t)},updateClientInfo:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.commit,a.next=3,Qr.agent.updateClientInfo(t.user_id,t);case 3:r=a.sent,n(fk.UPDATE_CURRENT_USER,r);case 5:case"end":return a.stop()}}),a)})))()},addTagToCurrentClient:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.commit,a.next=3,Qr.agent.addTag(n.currentClient.id,t);case 3:o=a.sent,r(fk.UPDATE_CURRENT_USER_TAGS,o);case 5:case"end":return a.stop()}}),a)})))()},removeTagFromCurrentClient:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.state,r=e.commit,a.next=3,Qr.agent.removeTag(n.currentClient.id,t);case 3:r(fk.REMOVE_CURRENT_USER_TAGS,t);case 4:case"end":return a.stop()}}),a)})))()},markAsRead:function(e,t){return Object(L["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.commit,a.next=3,Qr.agent.markAsRead(t);case 3:n(fk.MARK_AS_READ,t);case 4:case"end":return a.stop()}}),a)})))()},initWaitingTimer:function(e){var t=e.commit;gk||(gk=window.setInterval((function(){t(fk.CALC_WAITING_SECONDS)}),1e3))}},_k={currentClient:function(e){return e.currentClient},currentClientId:function(e){return e.currentClient?e.currentClient.id:null},isAssignToMe:function(e,t,a){return!!e.currentClient&&e.currentClient.locked_agent===a.user.userInfo.user_id}},vk=(AC={},Object(Ot["a"])(AC,fk.UPDATE_STATS,(function(e,t){Object.assign(e.stats,t)})),Object(Ot["a"])(AC,fk.SET_CURRENT_STATS,(function(e,t){e.filterAgent=null,e.currentStats=t,t&&(e.clientTab="all-client")})),Object(Ot["a"])(AC,fk.APPEND_MESSAGES,(function(e,t){t instanceof Array?e.messages.list=t.reverse().concat(e.messages.list):e.messages.list.push(t)})),Object(Ot["a"])(AC,fk.CLEAR_MESSAGES,(function(e){e.messages.list=[],e.messages.nextCursor=null,e.messages.loadedAll=!1})),Object(Ot["a"])(AC,fk.SET_AGENTS,(function(e,t){e.agents=t})),Object(Ot["a"])(AC,fk.SET_QUICK_REPLIES,(function(e,t){e.quickReplies=t})),Object(Ot["a"])(AC,fk.SET_SELECTED_QUICK_REPLY,(function(e,t){e.selectedQuickReply=t})),Object(Ot["a"])(AC,fk.ADD_QUICK_REPLY,(function(e,t){e.quickReplies.unshift(t)})),Object(Ot["a"])(AC,fk.UPDATE_QUICK_REPLY,(function(e,t){var a=e.quickReplies.findIndex((function(e){return e.id===t.id}));a<0||e.quickReplies.splice(a,1,t)})),Object(Ot["a"])(AC,fk.REMOVE_QUICK_REPLY,(function(e,t){var a=e.quickReplies.findIndex((function(e){return e.id===t}));a<0||e.quickReplies.splice(a,1)})),Object(Ot["a"])(AC,fk.APPEND_CLIENTS,(function(e,t){t.forEach((function(e){e.waitingSeconds=0})),e.clients.list=e.clients.list.concat(t)})),Object(Ot["a"])(AC,fk.CLEAR_CLIENTS,(function(e){e.clients.list=[],e.clients.loadedAll=!1,e.clients.nextCursor=null,e.currentClient=null,e.messages.list=[]})),Object(Ot["a"])(AC,fk.SET_NEXT_CURSOR,(function(e,t){e.clients.nextCursor=t,e.clients.loadedAll=!t})),Object(Ot["a"])(AC,fk.SET_CURRENT_CLIENT,(function(e,t){e.currentClient=t})),Object(Ot["a"])(AC,fk.SET_CLIENT_TAB,(function(e,t){e.clientTab=t,"my-client"===t&&(e.currentStats=null,e.filterAgent=null)})),Object(Ot["a"])(AC,fk.UPDATE_RECEIVED_MESSAGE_CLIENT,(function(e,t){var a=e.currentClient&&e.currentClient.id===t.user,n=e.clients.list.findIndex((function(e){return e.id===t.user})),r={attachment_payload:t.attachment_payload,attachment_type:t.attachment_type,is_broadcast:t.is_broadcast,message:t.message,source:t.source,timestamp:t.timestamp},o=null;if(n<0){if(e.currentStats||"my-client"===e.clientTab||e.clientSearch.searchText)return;return o=Object.assign({},t.user_detail,{id:t.user,last_message:t.id,provider:t.provider,unread_messages_count_detail:1,last_message_detail:r}),void e.clients.list.unshift(o)}if(o=e.clients.list[n],o.last_message_detail=r,!a){var i=o.unread_messages_count_detail;o.unread_messages_count_detail=i?i+1:1,o.last_message_detail=r}n>0&&(e.clients.list.splice(n,1),e.clients.list.unshift(o))})),Object(Ot["a"])(AC,fk.UPDATE_CURRENT_USER,(function(e,t){var a=e.clients.list.findIndex((function(e){return e.id===t.id}));if(!(a<0)){var n=Object.assign({},e.clients.list[a],t);e.clients.list.splice(a,1,n),e.currentClient=n}})),Object(Ot["a"])(AC,fk.UPDATE_RECEIVED_USER,(function(e,t){var a=e.clients.list.findIndex((function(e){return e.id===t.id}));if(!(a<0)){var n=e.clients.list[a],r=Object.assign({},n,t);e.clients.list.splice(a,1,r),e.currentClient&&e.currentClient.id===r.id&&(e.currentClient=r)}})),Object(Ot["a"])(AC,fk.UPDATE_CLIENT_ONLINE_STATUS,(function(e,t){var a=e.clients.list.findIndex((function(e){return e.id===t.user_id}));if(!(a<0)){var n=e.clients.list[a];n.is_online="online"===t.cmd,n.online_changed_dt=new Date}})),Object(Ot["a"])(AC,fk.SET_FILTER_AGENT,(function(e,t){e.filterAgent=t})),Object(Ot["a"])(AC,fk.SET_CLIENT_SEARCH,(function(e,t){e.clientSearch.type=t.searchType,e.clientSearch.searchText=t.searchText})),Object(Ot["a"])(AC,fk.SET_SHOW_CLIENT_TAG,(function(e,t){e.showClientTag=t})),Object(Ot["a"])(AC,fk.UPDATE_CURRENT_USER_TAGS,(function(e,t){e.currentClient.tag_type_categories_detail=t})),Object(Ot["a"])(AC,fk.REMOVE_CURRENT_USER_TAGS,(function(e,t){var a=e.currentClient.tag_type_categories_detail.findIndex((function(e){return e.id===t}));a<0||e.currentClient.tag_type_categories_detail.splice(a,1)})),Object(Ot["a"])(AC,fk.MARK_AS_READ,(function(e,t){var a=e.clients.list.findIndex((function(e){return e.id===t}));if(!(a<0)){var n=e.clients.list[a];n.unread_messages_count_detail=0}})),Object(Ot["a"])(AC,fk.CALC_WAITING_SECONDS,(function(e){e.clients.list.length&&e.clients.list.forEach((function(e){if(2===e.color_status){var t=+new Date,a=0;a=e.is_online?t-new Date(e.color_changed_dt):new Date(e.online_changed_dt)-new Date(e.color_changed_dt);var n=Math.ceil(a/1e3);e.waitingSeconds!==n&&(e.waitingSeconds=n)}else e.waitingSeconds=0}))})),Object(Ot["a"])(AC,fk.CLEAR_CLIENT_UNREAD,(function(e,t){if(e.clients.list.length){var a=e.clients.list.find((function(e){return e.id===t.id}));a&&(a.unread_messages_count_detail=0)}})),Object(Ot["a"])(AC,fk.SET_ALL_CLIENT_HAS_NEW,(function(e,t){e.isAllClientHasNew=t})),Object(Ot["a"])(AC,fk.SET_MY_CLIENT_HAS_NEW,(function(e,t){e.isMyClientHasNew=t})),Object(Ot["a"])(AC,fk.SET_MESSAGE_NEXT_CURSOR,(function(e,t){e.messages.nextCursor=t,e.messages.loadedAll=!t})),AC),bk={namespaced:!0,state:mk,actions:hk,getters:_k,mutations:vk};S["default"].use(U["a"]);var yk=new U["a"].Store({state:{isAppSideNavCollapse:!0,timezones:[],countries:[]},mutations:{UPDATE_TIMEZONES:function(e,t){e.timezones=t},TOGGLE_APP_SIDE_NAV:function(e){e.isAppSideNavCollapse=!e.isAppSideNavCollapse},UPDATE_COUNTRIES:function(e,t){e.countries=t}},actions:{toggleAppSideNavCollapse:function(e){var t=e.commit;t("TOGGLE_APP_SIDE_NAV")},getTimezones:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,t.next=3,Qr.common.getTimezones();case 3:n=t.sent,a("UPDATE_TIMEZONES",n.results);case 5:case"end":return t.stop()}}),t)})))()},getCountries:function(e){return Object(L["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.commit,t.next=3,Qr.pog.getCountries(1e3);case 3:n=t.sent,a("UPDATE_COUNTRIES",n.results);case 5:case"end":return t.stop()}}),t)})))()}},getters:{platformsMapping:function(e){return e.chatbotSetup.settings?Object.assign({},e.chatbotSetup.settings.platforms):{}},externalPlatforms:function(e){if(e.chatbotSetup.settings){var t=e.chatbotSetup.settings.platforms.external;return Object.keys(t).map((function(e){return{value:Number(e),name:t[e]}}))}return[]},internalPlatforms:function(e){if(e.chatbotSetup.settings){var t=e.chatbotSetup.settings.platforms.internal;return Object.keys(t).map((function(e){return{value:Number(e),name:t[e]}}))}return[]},platforms:function(e,t){return[].concat(t.internalPlatforms).concat(t.externalPlatforms)}},modules:{chatbotSetup:qC,user:WC,productManage:ek,faq:ik,tag:pk,agent:bk}}),Ck=a("a925"),kk={lang:{en_US:"en_US",zh_CN:"zh_CN",zh_HK:"zh_HK",ko_KR:"ko_KR"},platform:{website:"Marketplace",wechat:"WeChat",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot",widget_sa:"Chatbot_sa",widget_mp:"Chatbot_mp",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip"},weekDays:{Monday:"Mon",Tuesday:"Tues",Wednesday:"Wed",Thursday:"Thur",Friday:"Fri",Saturday:"Sat",Sunday:"Sun"},"Reset password":"Reset password",Logout:"Logout","Basic setting":"Basic setting","Function setting":"Function setting","Chatroom banner":"Chatroom banner","Sure to cancel?":"Sure to cancel?",Ok:"Ok",Yes:"Yes",No:"No",Save:"Save",Cancel:"Cancel",Edit:"Edit",Delete:"Delete","Welcome message":"Welcome message","Once user came in, chatbot will sent this automatically.":"Once user came in, chatbot will sent this automatically.","Unknown reply":"Unknown reply","When AI does not understand, will reply this.":"When AI does not understand, will reply this.","Enter message":"Enter message","Please enter welcome message":"Please enter welcome message","Please enter unknown reply":"Please enter unknown reply","Save successfully":"Save successfully","Delete successfully":"Delete successfully","Save failed":"Save failed","Function and buttons":"Function and buttons","Control the function and their button wording":"Control the function and their button wording",Function:"Function",Operation:"Operation","Please enter display text":"Please enter {0} display text({1})","no more than 4 Chinese or 8 alphabetic characters":"{0}({1}) no more than 4 Chinese or 8 alphabetic characters",Banner:"Banner",Upload:"Upload",Remove:"Remove","Trigger Link":"Trigger Link","Please enter trigger link":"Please enter trigger link","Remove successfully":"Remove successfully","Remove failed":"Remove failed","Upload successfully":"Upload successfully","Upload failed":"Upload failed","Suggest size 748 x 260px":"Suggest size 748 x 260px","Please enter the valid link":"Please enter the valid link","Current Password":"Current Password","New Password":"New Password","Confirm Password":"Confirm Password","Length should between 6 and 14":"Length should between 6 and 14","Confirm password is not match the new password":"Confirm password is not match the new password","Current Password is not correct":"Current Password is not correct","This password is too common.":"This password is too common.","This password is entirely numeric.":"This password is entirely numeric.","Please enter {0}":"Please enter {0}",Submit:"Submit","Agent setting":"Agent setting",Add:"Add","Working hours":"Working hours","Type name":"Type name",Period:"Period","Online time":"Online time",Status:"Status",Action:"Action","Are you sure to delete ?":"Are you sure to delete ?","By week":"By week","By date":"By date","Function rules":"Function rules","Trigger Times":"Trigger Times","Trigger Agent":"Trigger Agent",Reply:"Reply","Some situations when trigger accumulated time, can trigger Agent and/or messages.":"Some situations when trigger accumulated time, can trigger Agent and/or messages.",Type:"Type",Count:"Count",Users:"Users",Message:"Message",Range:"Range",Keyword:"Keyword",Search:"Search",Timezone:"Timezone","Please enter agent offline auto reply":"Please enter agent offline auto reply","Please enter agent online auto reply":"Please enter agent offline auto reply","Agent online auto reply":"Agent online auto reply","Agent offline auto reply":"Agent offline auto reply","Our timezone":"Our timezone","Maximum 10 period":"Maximum 10 period","Alphanumeric, between 6 to 14 digits, cannot be too simple":"Alphanumeric, between 6 to 14 digits, cannot be too simple",Confirm:"Confirm",productmanage:{common:{Country:"Country",City:"City",Search:"Search",ProductID:"Product ID",ProductSN:"Product SN",SupplierProductID:"Supplier Product SN",OptionName:"Option name",ProductName:"Product name",Delete:"Delete",Image:"Image",Price:"Price",Status:"Status",Vendor:"Supplier",Platform:"Platform",Option:"Option",Suboption:"Sub option",Stock:"Stock",Promotion:"Promotion",SN:"SN",Brief:"Brief",yes:"Yes",no:"No",Description:"Description",FeeInlcude:"Fee inlcude",FeeNotInlcude:"Fee not inlcude",Precautions:"Precautions","Important to Know":"Important to Know",OrderDetail:"Order detail",RefundPolicy:"Refund policy",ProductInfo:"Product info",VendorPdSN:"Supplier pd SN",Priority:"Priority",LowestPriority:"Lowest priority",HighestPriority:"Highest priority",ProdcutType:"Product type",RelatedPOI:"Related POI",Tag:"Tag","1stImage":"1st image",asCover:"as cover",UploadImage:"Upload image",imageText:"JPG JPEG PNG only",Position:"Position",LongitudeLatitude:"Longitude, Latitude",Fold:"Fold",AddLanguage:"Add language",NonRefundable:"Non refundable",Refundable:"Refundable",CreateInfo:"Create Info",UpdateInfo:"Update Info",SaveAndNext:"Save and next",EnterSomething:"Enter something",ItsRequired:"It’s required",MustBeDigitGreaterThan0:"Must be digit and greater than 0",AtLeastOneRange:"At least one range",WeekIsRequired:"Week is required",SnErr:"SN existed",RequiredAndMustBeMax:"Required, must be digit and can not less than Min buy",RequiredAndMustBeMin:"Required, must be digit and can not greater than Max buy",Mustbeadigitbetween0and99:"Must be a digit between 0 and 99",SubTitle:"Subtitle",RCSDisplay:"RCS display",RCSOriginal:"RCS original",WhichGo:"Which platform do you wish to go",SensitiveWording:"Sensitive wording",APIUpdate:"API update",Star:"Star",ContactNumber:"Contact number",Email:"Email",HotelAddress:"Hotel address",Surrounding:"Surrounding",MinBookDays:"Min book days",MaxBookDays:"Max book days",Rating:"Rating",Reviews:"Reviews"},option:{Expand:"Expand",DuplicateCurrentOption:"Duplicate current option",DuplicateCurrentSub:"Duplicate current sub",RedeemMethod:"Redeem
method",SpecificDate:"Specific date",AddNewSub:"Add new sub",HideCurrentOption:"Hide current option",ShowCurrentOption:"Show current option",HideCurrentSub:"Hide current sub",ShowCurrentSub:"Show current sub",SoldOut:"Sold out",Unlimited:"Unlimited",MultiSetting:"Multi-setting",ForSale:"For sale",NotForSale:"Not for sale",SaveToDraft:"Save to draft",SaveToReview:"Save to review",SaveToShow:"Save to Show",VendorSuboptionSN:"Supplier
suboption SN",QuickSetup:"Quick setup",FillIn:"Fill in","Note(optional)":"Note (optional)",Note:"Note",MinBuy:"Min Buy",MaxBuy:"Max Buy",BookBefore:"Book ahead
days",CancelBefore:"Cancel before
days",StockType:"Stock type",AdvanceBookingDays:"Advance booking days",CancelDaysLimit:"Cancel days limit",MinNumber:"Min number",MaxNumber:"Max number",NoLimits:"No limits",TotalStock:"Total stock",Increase:"Increase",Decrease:"Decrease",Equal:"Equal",number:"number",Range:"Range",All:"All",Week:"Week",SellPeriod:"Sell period",StartDate:"Start date",EndDate:"End date",to:"to",SellPrice:"Sell Price",OrigianlPrice:"Origianl Price",CostPrice:"Cost Price",VendorSuggestPrice:" Supplier
suggest price"},weeks:{Mo:"Mo",Tu:"Tu",We:"We",Th:"Th",Fr:"Fr",Sa:"Sa",Su:"Su"},status:{"Draft|DFT":"Draft","Show|ACT":"Show","Review|REV":"Review","Hide|DCT":"Hide","Sold Out|SDT":"Sold Out","Expired|EXP":"Expired","Exclusive|ACT_ADS":"Exclusive","Deactivated Ads|DCT_ADS":"Deactivated Ads","Delete|DET":"Delete"},productType:{"Ticket|TKT":"Ticket","Tour|TOR":"Tour","Rental|RNT":"Rental","Luggage|LGG":"Luggage","Delivery|DEI":"Delivery","Hotel|ACM":"Hotel"},priceType:{USD:"USD",HKD:"HKD",TWD:"TWD",KRW:"KRW",CNY:"CNY",AED:"AED",SGD:"SGD",JOD:"JOD",GBP:"GBP",EUR:"EUR",AUD:"AUD",JPY:"JPY",THB:"THB",IDR:"IDR",MYR:"MYR",PHP:"PHP",VND:"VND"},table:{"ID/SN":"ID / SN",Type:"Type",Name:"Name",Action:"Action",Edit:"Edit",NoLimit:"No limit",SuboptionName:"Suboption name",Clear:"Clear"},view:{RCS:"RCS",TKT:"Ticket",ACM:"Accommodation",RNT:"Rental",PKG:"Package",TOR:"Tour",SFT:"Self-Trip",LCD:"Local Deals",LGG:"Luggage",RTR:"Restaurant",PCK:"Pick-Up",DEI:"Delivery"},voucherType:{"E-Code|EC":"E-Code","E-Paper|EP":"Voucher","Paper|PA":"Paper","Code|CD":"Code","Others|ETC":"Others","Delivery|DEI":"Shipping","Pickup|PCK":"Pickup"},peopleType:{"Adult|13|59":"Adult","Child|3|12":"Child","Senior|60|99":"Senior","Infant|0|2":"Infant","Student|-|-":"Student","All|-|-":"Quantity"},copy:"copy"},poi:{type:{ATR:"Attraction",RTR:"Restaurant"},payment:{"cash_only|1":"Cash","visa|2":"VISA","credit_cart|3":"Credit card","alipay|4":"Alipay","wechatpay|5":"WeChat Pay","union_pay|6":"Union Pay","electronic_money|7":"Electronic money","dc|8":"DinersClub","id|9":"ID","nc|10":"NC","uc|11":"UC","jcd|12":"JCB","ufj|13":"UFJ","amex|14":"American Express","master|15":"MasterCard","diners|16":"DinersClub"},facility:{"wifi|1":"Free WIFI","parking|2":"Parking","smoking|3":"Smoking Area","delivery|4":"Delivery","takeaway|5":"Take away","cn_service|6":"Chinese service","no_smoking|7":"No Smoking","wheelchair|8":"Wheelchair","kids_friendly|9":"Kids friendly","byob|10":"Bring your own bottle"},status:{"Draft|DFT":"Draft","Show|ACT":"Show","Review|REV":"Review","Hide|DCT":"Hide"},ID:"ID",Priority:"Priority",BasicInfo:"Basic info",RelatedProduct:"Related product",Type:"Type",AverageCost:"Average cost",VisitHours:"Visit hours",SeatNumber:"Seat number",Rating:"Rating",Favorited:"Favorited",Payment:"Payment",HomePage:"Home page",VendorLink:"Vendor link",Vendor:"Supplier",Location:"Location",LongitudeLatitude:"Longitude, Latitude",City:"City",District:"District",Shared:"Shared",Facility:"Facility",Tag:"Tag",POIID:"POI ID",Name:"Name",POIName:"POI Name",SubDescription:"Subtitle",ContactNumber:"Contact number",Address:"Address",OpenHours:"Open hours",VisitHoursNote:"Visit hours note",Suggestion:"Suggestion",Transportation:"Transportation",TicketInfo:"Ticket info",Recommendation:"Recommendation",inputTip:"Must be digit between 0.0 and 5.0",AddSimilarName:"Add similar name"},tag:{TagCategory:"Tag category",CategorySearch:"Category search",AllCategories:"All categories",DeleteCategoryTip:"Are you sure to delete this category ?",Okay:"Okay",insetTip:"The category [|] contains tags, please remove all tags under the branch before deleting.",TagID:"Tag ID",TagName:"Tag name",EditTagCategory:"Edit tag category",NewTagCategory:"New tag category",SelectaCategory:"Select a category",MainTagName:"Main tag name",Synonym:"Synonym",AITrigger:"AI trigger",SaveFailed:"Save failed! Some required fields are not filled in",Require:"Main tag name is required",NoData:"No data",NoTagIsFound:"No tag is found !",NewTag:"New tag",TagInfo:"Tag info",RelatedProduct:"Related product",RelatedPOI:"Related POI",On:"On",Off:"Off",status:{"Show|ACT":"Show","Hide|DCT":"Hide"}},Category:"Category","Search question":"Search question",Question:"Question","Expired date":"Expired date","All questions":"All questions","Are you sure to delete selected questions?":"Are you sure to delete selected questions?","Are you sure to delete?":"Are you sure to delete?","Similar question":"Similar question",Answer:"Answer","Custom answer":"Custom answer","Search Tag":"Search Tag",Language:"Language",Infinite:"Infinite",Note:"Note","Delete seleted":"Delete seleted",Alert:"Alert","Download template":"Download template","Click or drag the file here to upload":"Click or drag the file here to upload","Only support xls format and":"Only support xls format and ","Upload successed.":"Upload successed.","Upload failed, errors found, please scroll down to see detail and reupload.":"Upload failed, {uploadFailMsgs} errors found, please scroll down to see detail and reupload.","Incorrect sheet name":'Incorrect sheet name "{sheet}"',"Error in row, column, and sheet":'Error in row {row} column {column} in "{sheet}" sheet',"File exceeding is not allowed":"File exceeding {maxFileSize} is not allowed",Import:"Import","Import FAQ":"Import FAQ","All status":"All status",Online:"Online",Offline:"Offline",On:"On",Off:"Off",Uncategorized:"Uncategorized","The {name} contains category":"The {name} contains category.","Please enter the question":"Please enter the question","Please enter the answer":"Please enter the answer",pongo:{name0:"Client",name1:"AI",name2:"Agent",platform0:"travelflan|TF",platform1:"facebook|FB",platform2:"wechat-travelflan|WC",platform3:"samsung-travelflan-korea|SG",platform4:"bixbyMobile-travelflan|RCS",platform10:"widget-travelflan|WG",platform13:"widget-jegotrip|WG",platform14:"widgetSA-travelflan|WG-SA",platform15:"widgetMP-travelflan|WG-MP",platform17:"widget-mayflower|WG",platform300:"facebook-travelflan|FB",platform301:"facebook-healpack|FB",platform302:"facebook-tf-test2|FB-test",status0:"Online
Agent",status1:"Started
Chatbot",status2:"AI
Handling",status3:"Agent
Handling",status4:"Request
Agent",longestWait:"Longest
wait",AllClient:"All client",MyClient:"My client",NotFound:"not found"},weatherResult:{weatherIs:"'s weather is",Tornado:"Tornado",Tropical:"Tropical",Hurricane:"Hurricane","Severe thunder storms":"Severe thunder storms","Thunder storms":"Thunder storms","Mixed rain snow":"Mixed rain snow","Mixed rain sleet":"Mixed rain sleet","Mixed snow sleet":"Mixed snow sleet","Freezing drizzle":"Freezing drizzle",Drizzle:"Drizzle","Freezing rain":"Freezing rain",Showers:"Showers","Snow flurries":"Snow flurries","Light snow showers":"Light snow showers","Blowing snow":"Blowing snow",Snow:"Snow",Hail:"Hail",Sleet:"Sleet",Dust:"Dust",Foggy:"Foggy",Haze:"Haze",Smoky:"Smoky",Blustery:"Blustery",Windy:"Windy",Cold:"Cold",Cloudy:"Cloudy","Mostly cloudy at Night":"Mostly cloudy at Night","Mostly cloudy at Day":"Mostly cloudy at Day","Partly cloudy at night":"Partly cloudy at night","Partly cloudy at day":"Partly cloudy at day","Clear at night":"Clear at night",Sunny:"Sunny","Fair at night":"Fair at night","Fair at day":"Fair at day","Mixed rain and hail":"Mixed rain and hail",Hot:"Hot","Isolated thunder storms":"Isolated thunder storms","Scattered thunder storms":"Scattered thunder storms","Scattered showers":"Scattered showers","Heavy snow":"Heavy snow","Scattered snow showers":"Scattered snow showers","Partly cloudy":"Partly cloudy","Thunder showers":"Thunder showers","Snow showers":"Snow showers","Isolated thunder showers":"Isolated thunder showers","Not available":"Not available"},"Related products":"Related products",Supplier:"Supplier",SupplierProductSN:"Supplier pd SN",SupplierLink:"Supplier link",SupplierSuboptionSN:"Supplier
suboption SN","Click here to check out hotel that fits you":"Click here to check out hotel that fits you","Online
Agent":"Online
Agent","Started
Chatbot":"Started
Chatbot","AI
Handling":"AI
Handling","Agent
Handling":"Agent
Handling","Request
Agent":"Request
Agent","Assign to agent":"Assign to agent","Assign to me":"Assign to me","Please use shift + enter key to send message":"Please use shift + enter key to send message","All client":"All client","My client":"My client","Client info":"Client info",Information:"Information",Name:"Name",Email:"Email",ID:"ID",Lang:"Lang",Phone:"Phone",English:"English","Simplified Chinese":"Simplified Chinese","Traditional Chinese":"Traditional Chinese",Korean:"Korean","Language unknown":"Language unknown","Consultation note":"Consultation note","Type notice here...":"Type notice here...","Client tags":"Client tags","Search Tags":"Search Tags","Quick reply":"Quick reply",Welcome:"Welcome",Common:"Common",Upselling:"Upselling","User acquisition":"User acquisition",Promotion:"Promotion","Mylink Promotion":"Mylink Promotion","Enter title":"Enter title","Select category":"Select category","Input content":"Input content","Please enter title":"Please enter title","Please select category":"Please select category","Please enter content":"Please enter content","Save successfully!":"Save successfully!","Save failed!":"Save failed!","Please include dialing code (e.g. +86)":"Please include dialing code (e.g. +86)",Refresh:"Refresh","Review link":"Review link",Currency:"Currency",Base:"Base","Exchange rate":"Exchange rate",Priority:"Priority","Update time":"Update time","Currency detail":"Currency detail","Currency Name":"Name","Live rate":"Live rate","Fill in":"Fill in","Exc. rate":"Exc. rate",Platform:"Platform","Create info":"Create info","Update info":"Update info","Enter a digit with 4 decimals":"Enter a digit with 4 decimals","Show history":"Show history",Warning:"Warning","The “exchange rate” is 10% or more lower/higher than the “live rate”, do you still want to proceed ?":"The “exchange rate” is 10% or more lower/higher than the “live rate”, do you still want to proceed ?","Symbol is required":"Symbol is required","Exc. rate is required":"Exc. rate is required","It’s required":"It’s required","Enter image text":"Enter image text",Sorting:"Sorting","Option sorting":"Option sorting","Suboption sorting":"Suboption sorting",Symbol:"Symbol","Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths":"Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths",Draft:"Draft",Show:"Show",Review:"Review",Hide:"Hide","Sold Out":"Sold Out",Expired:"Expired",Exclusive:"Exclusive","Deactivated Ads":"Deactivated Ads",'Invaild longitude and latitude format, please follow "X,Y" format and support up to ten-thousandths':'Invaild longitude and latitude format, please follow "X,Y" format and support up to ten-thousandths',"Please enter distance":"Please enter distance","Please enter longitude and latitude":"Please enter longitude and latitude","Distance must be an number between 1 and 5":"Distance must be an number between 1 and 5","Search or select multiple options":"Search or select multiple options",Ticket:"Ticket",Tour:"Tour",Rental:"Rental",Luggage:"Luggage",Delivery:"Delivery",Hotel:"Hotel","E-Code":"E-Code","E-Paper":"Voucher",Paper:"Paper",Code:"Code",Others:"Others",Delivery2:"Delivery","Supplier SN":"Supplier SN","Vaild perd":"Vaild perd","Sell perd":"Sell perd","Related Rest":"Related Rest","Combo details":"Combo details","Use time":"Use time","ORDER & DELIVERY":"ORDER & DELIVERY","How to Redeem":"How to Redeem",Rules:"Rules","Item type":"Item type","Free item":"Free item","Pay item":"Pay item","Min Buy":"Min Buy","Max Buy":"Max Buy","Internal PF":"Internal PF","External PF":"External PF","POI name":"POI name","Order date":"Order date","Paid date":"Paid date","Travel date":"Travel date","Refund date":"Refund date","Select date":"Select date","Order status":"Order status","Booking status":"Booking status","Product type and category":"Product type and category","Payment Waiting":"Payment Waiting","Payment Completed":"Payment Completed","Reservation Declined":"Reservation Declined","Refund Waiting":"Refund Waiting","Refund Completed":"Refund Completed","Refund Declined":"Refund Declined","Partial Refund Waiting":"Partial Refund Waiting","Partial Refund Completed":"Partial Refund Completed","Partial Refund Decline":"Partial Refund Decline","Payment processing":"Payment processing","Payment declined":"Payment declined","Order info requested":"Order info requested","Order waiting":"Order waiting","Order processing":"Order processing","Order completed":"Order completed","Order failed":"Order failed","Refund requested":"Refund requested","Refund processing":"Refund processing","Refund confirmation":"Refund confirmation","Refund completed":"Refund completed","Refund declined":"Refund declined","Refund error":"Refund error","Booking ID":"Booking ID","Payment ID":"Order ID","Product ID":"Product ID","Right ID":"Right ID","Product SN":"Product SN","Product name":"Product name","Phone number":"Phone number","User name":"User name","User email":"User email","User phone number":"User phone number","Supplier product SN":"Supplier product SN","Option name":"Option name","Country/Region":"Country/Region",City:"City","Hide test order":"Hide test order","Show test order":"Show test order","Booking & supplier":"Booking & supplier","Product name & type":"Product name & type","Item detail":"Item detail","Customer info":"Customer info","Paid amount":"Paid amount","Order ID":"Order ID","Create time":"Create time","Order detail":"Order detail",Export:"Export","Item detail & number & price":"Item detail & number & price",Subtotal:"Subtotal",Minus:"Minus",Paid:"Paid",Refunded:"Refunded",Total:"Total","Customer name":"Customer name",Gender:"Gender","Contact number":"Contact number","Comment to user":"Comment to user","Delivery tracking":"Delivery tracking",Refund:"Refund","Order info":"Order info",Remark:"Remark","User ID":"User ID","Paid time":"Paid time","Payment method":"Payment method","Payment secret":"Payment secret","Coupon code":"Code",Discount:"Discount",Vouchers:"Vouchers",Voucher:"Voucher","Voucher status":"Voucher status","Voucher name":"Voucher name","Voucher link":"Voucher link","Upload time":"Upload time",Coupon:"Coupon","Refund amount, please enter a digit no greater than {0}":"Refund amount, please enter a digit no greater than {amount}","Refund policy":"Refund policy",Copied:"Copied","Copied secret successfully":"Copied secret successfully",Failed:"Failed","Fail to copy secret":"Fail to copy secret","User Info":"User Info",Country:"Country",Available:"Available",Frozen:"Frozen",Redeemed:"Redeemed","E-code":"E-code","Rest code":"Rest code","Valid period":"Valid period","Redeem time":"Redeem time","Redeem shop":"Redeem shop",Restaurant:"Restaurant","Voucher link is required":"Voucher link is required","{0} must be number":"{0} must be number",Address:"Address","Requesting memo":"Requesting memo","Courier company":"Courier company","Tracking number":"Tracking number","Courier company is required":"Courier company is required","Tracking number is required":"Tracking number is required",male:"Male",female:"Female","{0} item":"{0} item","{0} items":"{0} items",Warehouse:"Warehouse","Ship to":"Ship to",Pickup:"Pickup","Pickup at":"Pickup at","Redeem method":"Redeem method",Postcode:"Postcode","Batch id":"Batch ID","Coupon name":"Name","Discount type":"Discount type",Valid:"Valid",Invalid:"Invalid",Picked:"Picked",Used:"Used",Detail:"Detail","Create date":"Create date",Ready:"Ready",Voided:"Voided",Percentage:"Percentage",Marketing:"Marketing","Valid date":"Valid date","Valid time":"Valid time","Coupon id":"Coupon ID",Creater:"Creater","User id":"User ID","User phone":"User phone","Basic info":"Basic info","Batch info":"Batch info","Coupon list":"Coupon list",Description:"Description","Basic currency":"Basic currency","Condition and discount":"Condition and discount","Product limit":"Product limit","Apply product":"Apply product","Specific type/category":"Specific type/category","Specific product":"Specific product","Type/category":"Type/category","Redeem/Using limit":"Redeem/Using limit","Display in detail page":"Display in detail page","Limit each user":"Limit each user","Coupon total":"Total","Total number":"Total number","Batch valid prd":"Batch valid prd","Batch valid":"Batch valid","Coupon valid prd":"Coupon valid prd","Condition amount":"Condition amount","Condition quantity":"Condition quantity","Discount amount":"Amount","Discount total":"Discount amount","Discount quantity":"Discount quantity","Specific quantity":"Specific quantity","No limit":"No limit","Specific amount":"Specific amount","Enter and search one or multiple product":"Enter and search one or multiple product","Limit number":"Limit number","Required, must be integer and greater than {amount}":"Required, must be integer and greater than {amount}","Code existed, please enter a new code":"Code existed, please enter a new code","Choose a method":"Choose a method",Fold:"Fold",Expand:"Expand",AddLanguage:"Add language",EnterSomething:"Enter something",USD:"USD",HKD:"HKD",TWD:"TWD",KRW:"KRW",CNY:"CNY",AED:"AED",SGD:"SGD",JOD:"JOD",GBP:"GBP",EUR:"EUR",AUD:"AUD",JPY:"JPY",THB:"THB",IDR:"IDR",MYR:"MYR",PHP:"PHP",VND:"VND",All:"All",Products:"Products",StartDate:"Start date",EndDate:"End date",website:"Marketplace",wechat:"WeChat",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot",widget_sa:"Chatbot_sa",widget_mp:"Chatbot-mp",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip",ItsRequired:"It’s required",RequiredAndMustBeMax:"Required, must be digit and can not less than Min buy",RequiredAndMustBeMin:"Required, must be digit and can not greater than Max buy",MustBeDigitGreaterThan0:"Must be digit and greater than 0",MustBeIntegerGreaterThan0:"Must be integer and greater than 0",UpToTwoDecimalPlaces:"Up to two decimal","User redeem":"User redeem","System given":"System given","Reach {amount} pieces":"Reach {amount} pieces","Reach {amount} piece":"Reach {amount} piece","Reach {amount}":"Reach {amount}","{discount}% off":"{discount}% off","{discount} off":"{discount} off","% off":"% off",off:"off","Use platform":"Use platform","Related order":"Related order","Use date":"Use date","Specific days":"Specific days","Specific peroid":"Specific peroid","Number of days":"Number of days","{day} Day":"{day} Day","{day} Days":"{day} Days","First name":"First name","Last name":"Last name","Create agent":"Create agent","Coupon(Old)":"Coupon(Old)","Length should between 6 and 20":"Length should between 6 and 20","Cannot contain spaces":"Cannot contain spaces","Should between 1 and 99":"Should between 1 and 99","Should less than condition amount":"Should less than condition amount",Random:"Random","Enter 6-20 characters":"Enter 6-20 characters","Discount percentage":"Discount percentage","General code":"General code","8 random code":"8 random code","12 random code":"12 random code","If code has 8 characters, it can not contain 5 characters and 3 digits":"If code has 8 characters, it can not contain 5 characters and 3 digits","If code has 12 characters, it can not contain 7 characters and 5 digits":"If code has 12 characters, it can not contain 7 characters and 5 digits","Batch code":"Batch code","see coupon list for detail":"see coupon list for detail","Name(KR)":"Name(KR)","Rest. Name":"Rest. Name","Rest. Contact No":"Rest. Contact No","Reservation date":"Reservation date","User Name":"User Name","Contact No":"Contact No",Adult:"Adult",Child:"Child","Theme list":"Theme list","Bottom tag":"Bottom tag",Image:"Image",Mobile:"Mobile","< {size}KB {width}*{height} px {types} only":"< {size}KB {width}*{height} px {types} only","Trigger link":"Trigger link","{lang} wording, up to {max} characters":"{lang} wording, up to {max} characters",Theme:"Theme",Title:"Title","List type":"List type",Restaurants:"Restaurants",Tag:"Tag","Choose up to 8 tags, only support tags that related more than 5 products":"Choose up to 8 tags, only support tags that related more than 5 products",PC:"PC",Product:"Product","Promotion product list":"Promotion product list",Subtitle:"Subtitle","TF direct":"TF direct","Restaurant product":"Restaurant product","Title is required":"Title is required","The content exceeds 100,000 characters, please check and edit agian.":"The content exceeds 100,000 characters, please check and edit agian.","{count} related product":"{count} related product","{count} related products":"{count} related products",Reservation:"Reservation",Brand:"Brand",Support:"Support","Not support":"Not support","Specific period":"Specific period","Specific date":"Specific date","Specific time":"Specific time","Book ahead days":"Book ahead days","Start time":"Start time","End time":"End time",Interval:"Interval","End time must after Start time":"End time must after Start time",min:"min","Reservation time":"Reservation time",email:"Email",password:"Password","Enter email address":"Enter email address","Please enter your password":"Please enter your password","Email is required":"Email is required","Invalid email":"Invalid email","Invalid password":"Invalid password","Invalid email or password":"Invalid password","Contact TravelFlan":"Contact TravelFlan",ACT:"Available",DCT:"Expired",FRZ:"Frozen",RMD:"Redeemed",RFD:"Refunded",Login:"Login","For Merchants":"For Merchants",ECode:"E-code",BookingSn:"Booking #",Clear:"Clear",Verify:"Verify",MyShopOnly:"My shop only","Confirm to redeem":"Confirm to redeem",Redeeming:"Redeem...","Your account has been frozen, please contact TravelFlan business manager":"Your account has been frozen, please contact TravelFlan business manager","Please enter 12 digits":"Please enter 12 digits","The code is frozen":"The code is frozen","The code invalid":"The code invalid",Successfully:"Successfully","Redeemed the code successfully":"Redeemed the code successfully.","Reset password successfully":"Update successfully","Two passwords do not match":"Two passwords do not match","Transfering you to login page":"Transfering you to login page","Redeem date":"Redeem date","Code redeem":"Code redeem","E-code list":"E-code list","E-CODE":"E-CODE","Booking #":"Booking #","Booking item":"Booking item","Valid Period":"Valid Period",to:"to","The code redeemed":"The code redeemed","Resource Created":"Resource Created","Resource Updated":"Resource Updated","Resource Deleted":"Resource Deleted",create:"Created",update:"Updated",delete:"Deleted",Change:"Changed",from:"from","event.coupon":"Coupon","event.product":"Product","event.order":"Order","event.poi":"POI","event.tagsystem":"Tag",System:"System",NoData:"No data",sidebar:{Chatbot:"Chatbot",FAQ:"FAQ","Message record":"Message record","AI setting":"AI setting","Agent platform":"Agent platform","Order Mgmt":"Order Mgmt.","Travel and goods":"Travel and goods","Rest reserve":"Rest. reserve","Rest E-code":"Rest. E-code","Product Mgmt":"Product Mgmt.","Travel / Shopping":"Travel / Shopping",Restaurant:"Restaurant","Op center":"Op. center","MKP homepage":"MKP homepage","Rest channel":"Rest. channel","Shopping channel":"Shopping channel",POI:"POI","Tag Mgmt":"Tag Mgmt.","Revenue Mgmt":"Revenue Mgmt.",Currency:"Currency",Marketing:"Marketing",Coupon:"Coupon",Event:"Event"},Travel:"Travel","E-Commerce":"E-Commerce",EMPTY:"EMPTY",NATIVE_WC:"NATIVE_WC",JSAPI_WC:"JSAPI_WC",APP_WC:"APP_WC",FACEBOOK_WD:"FACEBOOK_WD",WEB_ALIPAY:"WEB_ALIPAY",WAP_ALIPAY:"WAP_ALIPAY",WEB_PAYPAL:"WEB_PAYPAL",SAMSUNG_RCS:"SAMSUNG_RCS",WEB_ALIPAYHK:"WEB_ALIPAYHK",WAP_ALIPAYHK:"WAP_ALIPAYHK",PAYME:"PAYME","Upload images":"Upload images",Insert:"Insert","product:sn":"SN","product:status":"status","product:flan":"Priority","product:details:{lang}":"{lang} Detail","product:details:{lang}:title":"Title","product:details:{lang}:meta:address":"Address","product:details:{lang}:meta:brief":"Brief","product:details:{lang}:meta:description":"Description","product:details:{lang}:meta:fee_inlcude":"Fee inlcude","product:details:{lang}:meta:fee_not_inlcude":"Fee not inlcude","product:details:{lang}:meta:order_detail":"Order detail","product:details:{lang}:meta:precautions":"Precautions","product:details:{lang}:meta:refund_policy":"Refund policy","product:details:{lang}:meta:subtitle":"Subtitle","product:details:{lang}:meta:rules":"Rules","product:details:{lang}:meta:use_range":"ORDER & DELIVERY","product:details:{lang}:meta:use_time":"Use time","product:supplier_product_sn":"Supplier Product SN","product:supporting_provider":"Internal PF,External PF","product:product_start_date":"Start date","product:product_end_date":"End date","product:display_price:{currency}":"{currency} RCS original","product:display_discounted_price:{currency}":"{currency} RCS display","product:mkp_display_original_price:{currency}":"{currency} Origianl Price","product:mkp_display_price:{currency}":"{currency} Sell Price","product:is_cancelable":"Refundable","product:max_purchase_quantity_per_user":"Max Buy","product:limited_each_user":"Limit each user","product:is_promotion":"Promotion","product:is_self_purchased":"TF direct","product:pois":"Related POI","product:pog_cities":"Country&City","product:searchable_tags":"Tag","product:variants:{variantId}":"Option(ID:{variantId})","product:variants:{variantId}:sku":"TotalStock","product:variants:{variantId}:stock":"stock","product:variants:{variantId}:cost:{currency}":"{currency} Cost Price","product:variants:{variantId}:price:{currency}":"{currency} Sell Price","product:variants:{variantId}:original_price:{currency}":"{currency} Origianl Price","product:variants:{variantId}:purchase_type":"Item type","product:variants:{variantId}:sell_start_date":"Start date","product:variants:{variantId}:sell_end_date":"End date","product:variants:{variantId}:valid_start_dt":"valid start date","product:variants:{variantId}:valid_end_dt":"valid end date","product:variants:{variantId}:book_n_days_before_book_date":"book_n_days_before_book_date","product:variants:{variantId}:valid_start_time":"valid start time","product:variants:{variantId}:valid_end_time":"valid end time","product:variants:{variantId}:valid_time_interval":"valid time interval","product:variants:{variantId}:min_purchase_quantity":"Min Buy","product:variants:{variantId}:max_purchase_quantity":"Max Buy","product:options:{optionId}":"Option(ID:{optionId})","product:options:{optionId}:status":"status","product:options:{optionId}:option_sn":"option sn","product:options:{optionId}:voucher_type":"Redeem method","product:options:{optionId}:option_start_date":"Start date","product:options:{optionId}:option_end_date":"End date","product:options:{optionId}:book_date_required":"Specific date","product:options:{optionId}:limited_each_user":"Limit each user","product:options:{optionId}:details:{lang}":"{lang} Detail","product:options:{optionId}:details:{lang}:meta:brief":"Brief","product:options:{optionId}:details:{lang}:title":"Title","product:options:{optionId}:sub_options:{suboptionId}":"suboption(ID:{suboptionId})","product:options:{optionId}:sub_options:{suboptionId}:status":"status","product:options:{optionId}:sub_options:{suboptionId}:cost:{currency}":"{currency} Cost Price","product:options:{optionId}:sub_options:{suboptionId}:price:{currency}":"{currency} Sell Price","product:options:{optionId}:sub_options:{suboptionId}:original_price:{currency}":"{currency} Origianl Price","product:options:{optionId}:sub_options:{suboptionId}:min_book_days":"Min book days","product:options:{optionId}:sub_options:{suboptionId}:cancel_n_days_before_book_date":"Cancel before days","product:options:{optionId}:sub_options:{suboptionId}:book_n_days_before_book_date":"Book ahead days","product:options:{optionId}:sub_options:{suboptionId}:max_quantity_per_sub_option":"Max number","product:options:{optionId}:sub_options:{suboptionId}:min_purchase_quantity":"Min Buy","product:options:{optionId}:sub_options:{suboptionId}:max_purchase_quantity":"Max Buy","product:options:{optionId}:sub_options:{suboptionId}:limited_each_user":"Limit each user","product:options:{optionId}:sub_options:{suboptionId}:details":"Title","product:warehouse":"Warehouse","product:categories":"categories","order:status":"status","order:total_amount":"Subtotal","order:requested_amount":"requested amount","order:paid_amount":"Paid amount","order:discounted_amount":"Minus","order:refunded_amount":"refunded amount","order:refunding_amount":"refunding amount","order:delivery_amount":"delivery_amount","order:coupon_discounted_amount":"coupon discounted amount","order:secret":"Payment secret","order:trade_type":"Redeem method","order:remark_to_customer":"Comment to user","order:note":"Note","order:payment_method":"Payment method","order:bookings:{bookingId}":"booking(ID:{bookingId})","order:bookings:{bookingId}:status":"status","order:bookings:{bookingId}:sn":"Booking ID","order:bookings:{bookingId}:track_number":"Tracking number","order:bookings:{bookingId}:courier_company":"Courier company","order:bookings:{bookingId}:total_amount":"Subtotal","order:bookings:{bookingId}:refunded_amount":"refunded amount","order:bookings:{bookingId}:refunding_amount":"refunding amount","order:bookings:{bookingId}:voucher":"Voucher","order:bookings:{bookingId}:customer_request":"Requesting memo","order:bookings:{bookingId}:confirmation_info":"confirmation info","order:bookings:{bookingId}:note":"Note","tagsystem:synonyms":"Synonym","tagsystem:sn":"TagID","tagsystem:status":"status","tagsystem:supporting_provider":"Internal PF&External PF","tagsystem:ai_trigger":"AI trigger","poi:status":"status","poi:flan":"Priority&Rating","poi:category":"Category","poi:supporting_provider":"Supplier","poi:price_range":"Average cost&Basic currency","poi:support_reservation":"Reservation","poi:position":"Location","poi:searchable_tags":"Tag","poi:details:{lang}":"{lang} Detail","poi:details:{lang}:title":"Title","poi:details:{lang}:meta:name":"Product name","poi:details:{lang}:meta:description":"Description","poi:details:{lang}:meta:rules":"Rules","poi:details:{lang}:meta:use_range":"ORDER & DELIVERY","poi:details:{lang}:meta:use_time":"Use time",true:"Yes",false:"No","Theme setup":"Theme setup","Theme color":"Theme color","Navigation background color":"Navigation background color","Navigation font color":"Navigation font color","Maximum 4 coupons":"Maximum 4 coupons","Event name":"Event name","PC - 1960*600px JPG JPEG only || Design focus 1200*400px || <500KB":"PC - 1960*600px JPG JPEG only || Design focus 1200*400px || <500KB","Mobile - 1125*1500px JPG JPEG only || Design focus 1125*900px || <500KB":"Mobile - 1125*1500px JPG JPEG only || Design focus 1125*900px || <500KB",Section:"Section","Section title":"Section title","Section images":"Section images","PC - 1200*60px JPG JPEG only || <500KB":"PC - 1200*60px JPG JPEG only || <500KB","Mobile - 1125*180 JPG JPEG only || <500KB":"Mobile - 1125*180 JPG JPEG only || <500KB","Add section":"Add section","Section type":"Section type","Other detail":"Other detail",Coupons:"Coupons","Copy link":"Copy link",Itin_supplier:"Itin_supplier",Itin_supplier_UID:"Itin_supplier UID","Buy limit per ACCT":"Buy limit per ACCT","Max buy per ACCT":"Max buy per ACCT","Restricted period":"Restricted period","Can not greater than maximun purchase per account":"Can not greater than maximun purchase per account","Can not less than max buy":"Can not less than max buy","Can not less than max buy2":"Can not less than max buy",'Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude':'Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude',"Copied name successfully":"Copied name successfully","Copied SN successfully":"Copied SN successfully","Refund note":"Refund note",Windows:"Windows",macOS:"macOS","Other-Desktop":"Other-Desktop",Android:"Android",iOS:"iOS","Other-Mobile":"Other-Mobile",Device:"Device","WeChat pay":"WeChat pay","WeChat official account":"WeChat official account","WeChat mini program":"WeChat mini program","Alipay web":"Alipay web","Alipay mobile":"Alipay mobile","Alipay HK web":"Alipay HK web","Alipay HK mobile":"Alipay HK mobile",Paypal:"Paypal",Payme:"Payme","Credit card":"Credit card","Overdue status":"Overdue status","Expire in a week":"Expire in a week",Amount:"Amount","Promotion ID":"Promotion ID","Promotion prd":"Promotion prd","Rights(Mylink points)":"Rights(Mylink points)","Rewards method":"Rewards method","Every Booking":"Every Booking","Follow Payment Price":"Follow Payment Price","for every":"for every",Price:"Price","Promotion date":"Promotion date","Promotion name":"Promotion name","{num} Mylink points have sent to user, please be careful with refunds":"{num} Mylink points have sent to user, please be careful with refunds","Time selection":"Time selection","Bulk upload":"Bulk upload","Customer note":"Customer note","Customer note no show":"No Show","Customer note show":"Show","Display tag":"Display tag",Synchronize:"Synchronize","Mylink point promo id":"Mylink point promo id","What to Expect":"What to Expect",Details:"Details",Inclusions:"Inclusions",Exclusions:"Exclusions","Instant Confirmation":"Instant Confirmation","Mobile Voucher":"Mobile Voucher","Hotel Pick Up":"Hotel Pick Up","Skip the Line":"Skip the Line","Free Cancellation":"Free Cancellation","Free Parking":"Free Parking","Open Dated Voucher":"Open Dated Voucher","Audio Guide":"Audio Guide","Wheel Chair Accessible":"Wheel Chair Accessible","Best Seller":"Best Seller","Exclusive Travelflan Offer":"Exclusive Travelflan Offer","COVID-19 Safety Measures":"COVID-19 Safety Measures","Valid during EID Holidays":"Valid during EID Holidays","Authorised Reseller":"Authorised Reseller","Official Reseller":"Official Reseller","500+ Bought":"500+ Bought","1K+ Bought":"1K+ Bought","1.5K+ Bought":"1.5K+ Bought","2K+ Bought":"2K+ Bought","3K+ Bought":"3K+ Bought","Keyword setting title":"Keyword setting title","Keyword setting description":"Keyword setting description",Active:"Active",Deactive:"Deactive","Related booking":"Related booking",Deactivated:"Deactivated","Upload voucher":"Upload voucher","Only support PDF format and < 10MB":"Only support PDF format and < 10MB","Upload voucher option is required":"Upload voucher option is required","Upload voucher suboption is required":"Upload voucher suboption is required",reselect:"Reselect",invalidated:"invalidated",Invalidate:"Invalidate","Sure to invalidat voucher":"Sure to invalidat the voucher",Deliver:"Deliver",Delivered:"Delivered","Voucher type":"Voucher type",File:"File",Link:"Link","Image link":"Image link",Goods:"Goods","Not ready":"Not ready","Ready to pick up":"Ready to pick up","Pick up note":"Pick up note","Enter note":"Enter note",Replace:"Replace","Delivery option":"Delivery option","Apply to all related bookings in this order":"Apply to all related bookings in this order","One Image":"One Image","Two Image":"Two Images","Three Image":"Three Images",Cost:"Cost","Show in navigation":"Show in navigation","Send date":"Send date","Booking paid time":"Booking paid time","Point send time":"Point Send Time","Payment completed time":"Payment completed time","No Promotion":"No Promotion","Payment Incomplete":"Payment Incomplete","Send Processing":"Send Processing","Send Success":"Send Success","Send Fail":"Send Fail"},wk={lang:{en_US:"英文",zh_CN:"简体中文",zh_HK:"繁体中文",ko_KR:"韩文"},platform:{website:"Marketplace",wechat:"微信",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot-网页",widget_sa:"Chatbot-微信",widget_mp:"Chatbot-小程序",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip"},weekDays:{Monday:"周一",Tuesday:"周二",Wednesday:"周三",Thursday:"周四",Friday:"周五",Saturday:"周六",Sunday:"周日"},"Reset password":"重设密码",Logout:"退出","Basic setting":"基础设置","Function setting":"功能设置","Chatroom banner":"广告图","Sure to cancel?":"确认取消?",Ok:"确定",Yes:"是",No:"否",Save:"保存",Cancel:"取消",Edit:"编辑",Delete:"删除","Welcome message":"欢迎语","Once user came in, chatbot will sent this automatically.":"用户进入聊天室时,此消息将会自动发送","Unknown reply":"未知回复","When AI does not understand, will reply this.":"当机器人无法理解用户消息时,将会发送此消息","Enter message":"输入消息","Please enter welcome message":"请输入欢迎语","Please enter unknown reply":"请输入未知回复","Save successfully":"保存成功","Delete successfully":"删除成功","Save failed":"保存失败","Function and buttons":"功能及按钮配置","Control the function and their button wording":"控制功能是否可用及对应按钮的文案",Function:"功能",Operation:"操作","Please enter display text":"请输入{0}的显示文本({1})","no more than 4 Chinese or 8 alphabetic characters":"{0}({1})的字数不能超过4个汉字或8个字母字符",Banner:"广告图",Upload:"上传",Remove:"移除","Trigger Link":"跳转链接","Please enter trigger link":"请输入跳转链接","Remove successfully":"移除成功","Remove failed":"移除失败","Upload successfully":"上传成功","Upload failed":"上传失败","Suggest size 748 x 260px":"建议大小 748 x 260像素","Please enter the valid link":"请输入正确的链接格式","Current Password":"当前密码","New Password":"新密码","Confirm Password":"确认密码","Length should between 6 and 14":"密码长度为6-14位","Confirm password is not match the new password":"确认密码与新密码不匹配","Current Password is not correct":"当前密码错误","This password is too common.":"新密码过于简单","This password is entirely numeric.":"新密码必须包含数字和字母","Please enter {0}":"请输入{0}",Submit:"提交","Agent setting":"客服设置",Add:"新增","Working hours":"工作时间","Type name":"类别名称",Period:"日期","Online time":"在线时间",Status:"状态",Action:"操作","Are you sure to delete ?":"确定要删除吗?","By week":"星期模式","By date":"日期模式","Function rules":"功能规则","Trigger Times":"触发次数","Trigger Agent":"接入客服",Reply:"回复","Some situations when trigger accumulated time, can trigger Agent and/or messages.":"当某些功能连续触发指定次数时,可以设置是否需要客服,是否自动回复指定消息。",Type:"类别",Count:"消息数",Users:"用户数",Message:"消息",Range:"范围",Keyword:"关键词",Search:"搜索",Timezone:"时区设置","Please enter agent offline auto reply":"请输入客服离线回复","Please enter agent online auto reply":"请输入客服在线回复","Agent online auto reply":"客服在线回复","Agent offline auto reply":"客服离线回复","Our timezone":"所在时区","Maximum 10 period":"最多添加10条","Alphanumeric, between 6 to 14 digits, cannot be too simple":"密码长度为6-14位,切勿过于简单,必须包含英文和数字",Confirm:"确定",productmanage:{common:{Country:"国家",City:"城市",Search:"搜索",ProductID:"产品ID",ProductSN:"产品SN",SupplierProductID:"供应商产品ID",OptionName:"选项名称",ProductName:"产品名称",Delete:"删除",Image:"图片",Price:"价格",Status:"状态",Vendor:"供应商",Platform:"平台",Option:"选项",Suboption:"子选项",Stock:"库存",Promotion:"促销",SN:"SN",Brief:"简介",yes:"是",no:"否",Description:"详细描述",FeeInlcude:"费用包含",FeeNotInlcude:"费用不含",Precautions:"注意事项","Important to Know":"注意事项",OrderDetail:"预订须知",RefundPolicy:"退改须知",ProductInfo:"产品信息",VendorPdSN:"供应商产品SN",Priority:"优先级",LowestPriority:"最低优先级",HighestPriority:"最高优先级",ProdcutType:"产品类型",RelatedPOI:"关联POI",Tag:"标签","1stImage":"第一张图",asCover:"作为封面",UploadImage:"上传图片",imageText:"仅支持 JPG JPEG PNG",Position:"位置",LongitudeLatitude:"经度,纬度",Fold:"折叠",AddLanguage:"新增语言",NonRefundable:"不可退",Refundable:"可退",CreateInfo:"创建信息",UpdateInfo:"更新信息",SaveAndNext:"保存并进入下一步",EnterSomething:"输入内容",ItsRequired:"必填项",MustBeDigitGreaterThan0:"必须为数字且大于0",AtLeastOneRange:"最少一段范围",WeekIsRequired:"星期必填",SnErr:"SN 已存在",RequiredAndMustBeMax:"必填项,且必须为不小于最少购买数的数字",RequiredAndMustBeMin:"必填项,且必须为不大于最多购买数的数字",Mustbeadigitbetween0and99:"必须为数字且在0-99之间",SubTitle:"副标题",RCSDisplay:"RCS价格",RCSOriginal:"RCS原价",WhichGo:"请选择跳转平台",SensitiveWording:"敏感词",APIUpdate:"API更新内容",Star:"星级",ContactNumber:"联系电话",Email:"邮箱",HotelAddress:"酒店地址",Surrounding:"周边推荐",MinBookDays:"最少预订天数",MaxBookDays:"最多预订天数",Rating:"评分",Reviews:"浏览量"},option:{Expand:"展开",DuplicateCurrentOption:"复制现有选项",DuplicateCurrentSub:"复制现有子选项",RedeemMethod:"兑换方式",SpecificDate:"指定日期",AddNewSub:"新增子选项",HideCurrentOption:"隐藏现有选项",ShowCurrentOption:"显示现有选项",HideCurrentSub:"隐藏现有子选项",ShowCurrentSub:"显示现有子选项",SoldOut:"售罄",Unlimited:"不限库存",MultiSetting:"批量设置",ForSale:"可售",NotForSale:"不可售",SaveToDraft:"保存为草稿",SaveToReview:"保存并提交审核",SaveToShow:"保存并发布",VendorSuboptionSN:"供应商子选项SN",QuickSetup:"快速设置",FillIn:"填入","Note(optional)":"备注(选填)",Note:"备注",MinBuy:"最少购买数",MaxBuy:"最多购买数",BookBefore:"提前预订天数",CancelBefore:"提前取消天数",StockType:"库存类型",AdvanceBookingDays:"提前预订天数",CancelDaysLimit:"提前取消天数",MinNumber:"最少数量",MaxNumber:"最多数量",NoLimits:"不限库存",TotalStock:"总库存",Increase:"增加",Decrease:"减少",Equal:"设置为",number:"数量",MultidaySetting:"批量设置",Range:"范围",All:"所有",Week:"星期",SellPeriod:"售卖时间",StartDate:"开始时间",EndDate:"结束时间",to:"至",SellPrice:"售卖价格",OrigianlPrice:"原价",CostPrice:"成本价",VendorSuggestPrice:"供应商价格"},weeks:{Mo:"周一",Tu:"周二",We:"周三",Th:"周四",Fr:"周五",Sa:"周六",Su:"周日"},status:{"Draft|DFT":"草稿","Show|ACT":"可售","Review|REV":"审核中","Hide|DCT":"隐藏","Sold Out|SDT":"售罄","Expired|EXP":"已过期","Exclusive|ACT_ADS":"专享","Deactivated Ads|DCT_ADS":"专享(不可售)","Delete|DET":"删除"},productType:{"Ticket|TKT":"门票","Tour|TOR":"玩乐","Rental|RNT":"服务","Luggage|LGG":"行李","Delivery|DEI":"购物","Hotel|ACM":"酒店"},priceType:{USD:"美元",HKD:"港币",TWD:"台币",KRW:"韩元",CNY:"人民币",AED:"阿联酋迪拉姆",SGD:"新加坡元",JOD:"约旦第纳尔",GBP:"英镑",EUR:"欧元",AUD:"澳元",JPY:"日元",THB:"泰铢",IDR:"印尼盾",MYR:"林吉特",PHP:"比索 ",VND:"越南盾"},table:{"ID/SN":"ID/SN",Type:"类型",Name:"名称",Action:"操作",Edit:"编辑",NoLimit:"不限",SuboptionName:"子选项名称",Clear:"清除"},view:{RCS:"RCS",TKT:"票券",ACM:"住宿",RNT:"租赁",PKG:"套餐",TOR:"旅行团",SFT:"自由行",LCD:"当季热卖",LGG:"行李",RTR:"餐厅",PCK:"接送"},voucherType:{"E-Code|EC":"条码/二维码","E-Paper|EP":"电子凭证","Paper|PA":"实体票","Code|CD":"兑换码","Others|ETC":"其它","Delivery|DEI":"邮寄","Pickup|PCK":"自取"},peopleType:{"Adult|13|59":"成人","Child|3|12":"儿童","Senior|60|99":"老人","Infant|0|2":"婴儿","Student|-|-":"学生","All|-|-":"数量"},copy:"复制"},poi:{type:{ATR:"景点",RTR:"餐厅"},payment:{"cash_only|1":"现金支付","visa|2":"VISA","credit_cart|3":"信用卡","alipay|4":"支付宝","wechatpay|5":"微信支付","union_pay|6":"银联","electronic_money|7":"电子钱包","dc|8":"大莱","id|9":"ID","nc|10":"NC","uc|11":"UC","jcd|12":"JCB","ufj|13":"UFJ","amex|14":"美国运通","master|15":"万事达","diners|16":"大莱"},facility:{"wifi|1":"免费WIFI","parking|2":"停车场","smoking|3":"吸烟区","delivery|4":"配送","takeaway|5":"外带","cn_service|6":"中文服务","no_smoking|7":"禁烟","wheelchair|8":"轮椅","kids_friendly|9":"可带小孩","byob|10":"可自带酒水"},status:{"Draft|DFT":"草稿","Show|ACT":"显示","Review|REV":"审核中","Hide|DCT":"隐藏"},ID:"ID",Priority:"优先级",BasicInfo:"基础信息",RelatedProduct:"关联产品",Type:"类型",AverageCost:"人均消费",VisitHours:"游玩时间",SeatNumber:"座位数",Rating:"评分",Favorited:"收藏数",Payment:"支付方式",HomePage:"官网",VendorLink:"源数据链接",Vendor:"供应商(数据源)",Location:"位置",LongitudeLatitude:"经度, 维度",City:"城市",District:"行政区",Shared:"分享数",Facility:"设施",Tag:"标签",POIID:"POI ID",Name:"名称",POIName:"POI名称",SubDescription:"副标题",ContactNumber:"联系方式",Address:"地址",OpenHours:"营业时间",VisitHoursNote:"游玩时间备注",Suggestion:"建议",Transportation:"交通",TicketInfo:"门票信息",Recommendation:"推荐",inputTip:"必须为数字且在0.0-5.0之间",AddSimilarName:"新增同义名称"},tag:{TagCategory:"标签分类",CategorySearch:"搜索分类",AllCategories:"所有分类",DeleteCategoryTip:"确定要删除这个分类吗?",Okay:"确定",insetTip:"分类 [|] 下存在子标签, 请先删除所有子标签.",TagID:"标签ID",TagName:"标签名称",EditTagCategory:"编辑标签分类",NewTagCategory:"新增标签分类",SelectaCategory:"请选择标签分类",MainTagName:"主标签名称",Synonym:"同义词",AITrigger:"AI识别",SaveFailed:"保存失败!以下有必填项未填",Require:"主标签名称必填",NoData:"暂无数据",NoTagIsFound:"暂无数据",NewTag:"新标签",TagInfo:"标签信息",RelatedProduct:"相关产品",RelatedPOI:"相关POI",On:"是",Off:"否",status:{"Show|ACT":"显示","Hide|DCT":"隐藏"}},Category:"类别","Search question":"搜索问题",Question:"问题","Expired date":"有效期","All questions":"全部问题","Are you sure to delete selected questions?":"确定要删除选中的问题吗?","Are you sure to delete?":"确定要删除吗?","Similar question":"相似问题",Answer:"答案","Custom answer":"定制答案","Search Tag":"标签搜索",Language:"语言",Infinite:"永久有效",Note:"备注","Delete seleted":"删除选中",Alert:"提示","Download template":"下载模版文件","Click or drag the file here to upload":"点击或将文件拖拽到这里上传","Only support xls format and":"只支持以下文件格式: xls 小于","Upload successed.":"上传成功","Upload failed, errors found, please scroll down to see detail and reupload.":"上传失败,{uploadFailMsgs}条错误发现,请往下滚动查看细节并重新上传","Incorrect sheet name":"工作表名称“{sheet}”錯誤","Error in row, column, and sheet":"“{sheet}”工作表中第{row}行第{column}列错误(缺少必填项)","File exceeding is not allowed":"文件大小不可超过{maxFileSize}",Import:"导入","Import FAQ":"导入FAQ","All status":"所有状态",Online:"上线",Offline:"下线",On:"上线",Off:"下线",Uncategorized:"未分类","The {name} contains category":"{name}下存在子分类","Please enter the question":"请输入问题","Please enter the answer":"请输入答案",pongo:{name0:"Client",name1:"AI",name2:"Agent",platform0:"travelflan|TF",platform1:"facebook|FB",platform2:"wechat-travelflan|WC",platform3:"samsung-travelflan-korea|SG",platform4:"bixbyMobile-travelflan|RCS",platform10:"widget-travelflan|WG",platform13:"widget-jegotrip|WG",platform14:"widgetSA-travelflan|WG-SA",platform15:"widgetMP-travelflan|WG-MP",platform17:"widget-mayflower|WG",platform300:"facebook-travelflan|FB",platform301:"facebook-healpack|FB",platform302:"facebook-tf-test2|FB-test",status0:"在线
客服",status1:"启动
聊天",status2:"AI应
答中",status3:"人工
接待中",status4:"等待
客服",longestWait:"最长等待
",AllClient:"All client",MyClient:"My client",NotFound:"not found"},weatherResult:{weatherIs:"的天气是",Tornado:"龙卷风",Tropical:"热带风暴",Hurricane:"飓风","Severe thunder storms":"强烈雷暴","Thunder storms":"雷暴","Mixed rain snow":"雨夹雪","Mixed rain sleet":"雨雪","Mixed snow sleet":"雪雨","Freezing drizzle":"冰雨",Drizzle:"细雨","Freezing rain":"冰雨",Showers:"阵雨","Snow flurries":"小阵雪","Light snow showers":"小阵雪","Blowing snow":"风雪",Snow:"飘雪",Hail:"冰雹",Sleet:"雪雨",Dust:"灰尘",Foggy:"雾",Haze:"薄雾",Smoky:"烟霞",Blustery:"大风",Windy:"阵风",Cold:"寒冷",Cloudy:"多云","Mostly cloudy at Night":"晚间多云","Mostly cloudy at Day":"日间多云","Partly cloudy at night":"晚间多云","Partly cloudy at day":"日间多云","Clear at night":"天色明朗",Sunny:"天晴","Fair at night":"晚间天气良好","Fair at day":"日间良好","Mixed rain and hail":"冰雹阵雨",Hot:"炎热","Isolated thunder storms":"局部雷暴","Scattered thunder storms":"零散雷暴","Scattered showers":"零散骤雨","Heavy snow":"大雪","Scattered snow showers":"零散阵雪","Partly cloudy":"部分时间多云","Thunder showers":"雷阵雨","Snow showers":"阵雪","Isolated thunder showers":"局部雷雨","Not available":"没有资料"},"Related products":"相关产品",Supplier:"供应商",SupplierProductSN:"供应商产品SN",SupplierLink:"供应商链接",SupplierSuboptionSN:"供应商子选项SN","Click here to check out hotel that fits you":"请点此查看为你精选的酒店","Online
Agent":"在线
客服","Started
Chatbot":"启动
聊天","AI
Handling":"AI应
答中","Agent
Handling":"人工
接待中","Request
Agent":"等待
客服","Assign to agent":"派予客服","Assign to me":"我来接待","Please use shift + enter key to send message":"直接发送请按Shift+Enter键","All client":"全部客户","My client":"我的客户","Client info":"客户信息",Information:"个人信息",Name:"名字",Email:"电邮",ID:"ID",Lang:"语言",Phone:"电话",English:"英文","Simplified Chinese":"简中","Traditional Chinese":"繁中",Korean:"韩文","Language unknown":"未知语言","Consultation note":"留言板","Type notice here...":"在此留言","Client tags":"客户标签","Search Tags":"搜索标签","Quick reply":"快速回覆",Welcome:"欢迎语",Common:"常用语",Upselling:"附加销售","User acquisition":"用户获取",Promotion:"促销活动","Mylink Promotion":"Mylink活动","Enter title":"标题","Select category":"选择类别","Input content":"输入语句","Please enter title":"请输入标题","Please select category":"请选择类别","Please enter content":"请输入内容","Save successfully!":"保存成功!","Save failed!":"保存失败!","Please include dialing code (e.g. +86)":"请加上国际码(如+86)",Refresh:"刷新","Review link":"外部评价链接",Currency:"币种",Base:"基准","Exchange rate":"汇率",Priority:"排序","Update time":"更新时间","Currency detail":"币种详情","Currency Name":"名称","Live rate":"实时汇率","Fill in":"填入","Exc. rate":"汇率",Platform:"平台","Create info":"创建信息","Update info":"更新信息","Enter a digit with 4 decimals":"输入一个包含4位小数的数字","Show history":"历史记录",Warning:"警告","The “exchange rate” is 10% or more lower/higher than the “live rate”, do you still want to proceed ?":"当前汇率值低于或高于实时汇率10%,确认要继续保存吗?","Symbol is required":"符号必填","Exc. rate is required":"汇率必填","It’s required":"必填项","Enter image text":"输入配图文字",Sorting:"排序","Option sorting":"选项排序","Suboption sorting":"子选项排序",Symbol:"符号","Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths":"格式错误,请依照 xx.xxxx, yy.yyyy 格式且最多支持小数点后四位",Draft:"草稿",Show:"可售",Review:"审核中",Hide:"隐藏","Sold Out":"售罄",Expired:"已过期",Exclusive:"专享","Deactivated Ads":"专享(不可售)",'Invaild longitude and latitude format, please follow "X,Y" format and support up to ten-thousandths':"经纬度格式错误,请依照 xx.xxxx, yy.yyyy 格式且最多支持小数点后四位","Please enter distance":"请输入距离","Please enter longitude and latitude":"请输入经纬度","Distance must be an number between 1 and 5":"距离必须1到5之间的数字","Search or select multiple options":"搜索或选择多个选项",Ticket:"票券",Tour:"旅行团",Rental:"租赁",Luggage:"行李",Delivery:"电商产品",Hotel:"酒店","E-Code":"条码/二维码","E-Paper":"电子凭证",Paper:"实体票",Code:"兑换码",Others:"其它",Delivery2:"邮寄","Supplier SN":"供应商SN","Vaild perd":"有效期","Sell perd":"售卖日期","Related Rest":"适用餐厅","Combo details":"套餐详情","Use time":"使用时间","ORDER & DELIVERY":"订购须知","How to Redeem":"订购须知",Rules:"使用规则","Item type":"销售类型","Free item":"免费领取","Pay item":"付费项目","Min Buy":"最小购买数","Max Buy":"最大购买数","Internal PF":"内部平台","External PF":"外部平台","POI name":"POI名称","Order date":"预订日期","Paid date":"支付日期","Travel date":"出行日期","Refund date":"退款日期","Select date":"选择日期","Order status":"订单状态","Booking status":"预订单状态","Product type and category":"产品分类","Payment Waiting":"支付中","Payment Completed":"支付完成","Reservation Declined":"预订拒绝","Refund Waiting":"退款已提交","Refund Completed":"退款完成","Refund Declined":"退款拒绝","Partial Refund Waiting":"部分退款已提交","Partial Refund Completed":"部分退款已完成","Partial Refund Decline":"部分退款拒绝","Payment processing":"支付中","Payment declined":"支付拒绝","Order info requested":"订单信息缺失","Order waiting":"预订待处理","Order processing":"预订处理中","Order completed":"预订已完成","Order failed":"预订失败","Refund requested":"退款已提交","Refund processing":"退款处理中","Refund confirmation":"退款已确认","Refund completed":"退款已完成","Refund declined":"退款拒绝","Refund error":"退款错误","Booking ID":"预订单ID","Payment ID":"订单ID","Product ID":"产品ID","Right ID":"积分项ID","Product SN":"产品SN","Product name":"产品名称","Phone number":"电话号码","User name":"用户姓名","User email":"用户邮箱","User phone number":"用户电话","Supplier product SN":"供应商产品SN","Option name":"选项名称","Country/Region":"国家/地区",City:"城市","Hide test order":"隐藏测试单","Show test order":"显示测试单","Booking & supplier":"预订单&供应商","Product name & type":"产品名称&类型","Item detail":"项目明细","Customer info":"顾客信息","Paid amount":"支付金额","Order ID":"订单ID","Create time":"创建时间","Order detail":"订单详情",Export:"导出","Item detail & number & price":"项目明细&数量&价格",Subtotal:"小计",Minus:"优惠",Paid:"支付",Refunded:"退款",Total:"总计","Customer name":"顾客姓名",Gender:"性别","Contact number":"联系电话","Comment to user":"给用户留言","Delivery tracking":"物流跟踪",Refund:"退款","Order info":"订单信息",Remark:"订单备注","User ID":"用户ID","Paid time":"支付时间","Payment method":"支付方式","Payment secret":"交易流水号","Coupon code":"优惠码",Discount:"优惠",Vouchers:"凭证",Voucher:"凭证","Voucher status":"凭证状态","Voucher name":"凭证姓名","Voucher link":"凭证链接","Upload time":"上传时间",Coupon:"优惠券","Refund amount, please enter a digit no greater than {0}":"退款金额, 请输入一个不大于{amount}的数字","Refund policy":"退款政策",Copied:"已复制","Copied secret successfully":"交易流水号复制成功",Failed:"失败","Fail to copy secret":"交易流水号复制失败","User Info":"用户信息",Country:"国家/地区",Available:"可用",Frozen:"已冻结",Redeemed:"已核销","E-code":"券码","Rest code":"券码","Valid period":"有效期","Redeem time":"核销时间","Redeem shop":"核销门店",Restaurant:"餐厅","Voucher link is required":"凭证链接必填","{0} must be number":"{0} 必须是数字",Address:"地址","Requesting memo":"备注","Courier company":"物流公司","Tracking number":"物流编号","Courier company is required":"物流公司必填","Tracking number is required":"物流编号必填",male:"男",female:"女","{0} item":"{0} 件","{0} items":"{0} 件",Warehouse:"仓库","Ship to":"寄送至",Pickup:"自取","Pickup at":"自取于","Redeem method":"领取方式",Postcode:"邮编","Batch id":"批次ID","Coupon name":"优惠券名称","Discount type":"优惠类型",Valid:"有效",Invalid:"无效",Picked:"已领取",Used:"已使用",Detail:"详情","Create date":"创建日期",Ready:"未开始",Voided:"已作废",Percentage:"折扣",Marketing:"市场营销","Valid date":"有效期","Valid time":"有效期","Coupon id":"优惠券ID",Creater:"创建人","User id":"用户ID","User phone":"用户手机号","Basic info":"基础信息","Batch info":"批次信息","Coupon list":"优惠券列表",Description:"详细描述","Basic currency":"基准币种","Condition and discount":"条件与折扣","Product limit":"产品限制","Apply product":"适用产品","Specific type/category":"指定分类/类别","Specific product":"指定产品","Type/category":"分类/类别","Redeem/Using limit":"兑换/使用限制","Display in detail page":"详情页显示","Limit each user":"单用户限制","Coupon total":"优惠总量","Total number":"总数","Batch valid prd":"批次有效期","Batch valid":"批次有效期","Coupon valid prd":"优惠券有效期","Condition amount":"条件金额","Condition quantity":"条件数量","Discount amount":"立减","Discount total":"立减金额","Discount quantity":"折扣力度","Specific quantity":"指定数量","No limit":"不限","Specific amount":"指定金额","Enter and search one or multiple product":"输入并搜索一个或多个产品","Limit number":"限定数量","Required, must be integer and greater than {amount}":"必填项, 必须为整数且大于{amount}","Code existed, please enter a new code":"优惠码已存在, 请重新输入优惠码","Choose a method":"选择一种方式",Fold:"折叠",Expand:"展开",AddLanguage:"新增语言",EnterSomething:"输入内容",USD:"美元",HKD:"港币",TWD:"台币",KRW:"韩元",CNY:"人民币",AED:"阿联酋迪拉姆",SGD:"新加坡元",JOD:"约旦第纳尔",GBP:"英镑",EUR:"欧元",AUD:"澳元",JPY:"日元",THB:"泰铢",IDR:"印尼盾",MYR:"林吉特",PHP:"比索 ",VND:"越南盾",All:"所有",Products:"产品",StartDate:"开始时间",EndDate:"结束时间",website:"Marketplace",wechat:"微信",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot-网页",widget_sa:"Chatbot-微信",widget_mp:"Chatbot-小程序",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip",ItsRequired:"必填项",RequiredAndMustBeMax:"必填项,且必须为不小于最少购买数的数字",RequiredAndMustBeMin:"必填项,且必须为不大于最多购买数的数字",MustBeDigitGreaterThan0:"必须为数字且大于0",MustBeIntegerGreaterThan0:"必须为整数且大于0",UpToTwoDecimalPlaces:"最多两位小数","User redeem":"用户兑换","System given":"系统发送","Reach {amount} pieces":"满{amount}件","Reach {amount} piece":"满{amount}件","Reach {amount}":"满{amount}","{discount}% off":"{discount}% 折扣","{discount} off":"立减 {discount}","% off":"% 折扣",off:"off","Use platform":"使用平台","Related order":"关联订单","Use date":"使用日期","Specific days":"指定天数","Specific peroid":"指定时段","Number of days":"天数","{day} Day":"{day}天","{day} Days":"{day}天","First name":"名","Last name":"姓","Create agent":"创建人","Coupon(Old)":"优惠券(旧)","Length should between 6 and 20":"必须为6-20位","Cannot contain spaces":"不能含有空格","Should between 1 and 99":"必须在1-99之间","Should less than condition amount":"必须小于条件金额",Random:"随机","Enter 6-20 characters":"输入6-20位字符","Discount percentage":"优惠折扣","General code":"通用码","8 random code":"8位随机码","12 random code":"12位随机码","If code has 8 characters, it can not contain 5 characters and 3 digits":"8位码不能同时包含5位字母和3位数字","If code has 12 characters, it can not contain 7 characters and 5 digits":"12位码不能同时包含7位字母和5位数字","Batch code":"批次码","see coupon list for detail":"请在优惠券列表查看详情","Name(KR)":"姓名(KR)","Rest. Name":"餐厅名称","Rest. Contact No":"餐厅电话","Reservation date":"预约时间","User Name":"用户姓名","Contact No":"联系电话",Adult:"成人",Child:"儿童","Theme list":"专题列表","Bottom tag":"底部标签",Image:"图片",Mobile:"移动端","< {size}KB {width}*{height} px {types} only":"< {size}KB {width}*{height} px 仅{types}","Trigger link":"跳转链接","{lang} wording, up to {max} characters":"{lang}文案, 最多{max}个字符",Theme:"专题",Title:"标题","List type":"列表类型",Restaurants:"餐厅",Tag:"标签","Choose up to 8 tags, only support tags that related more than 5 products":"选择最多8个标签,仅支持关联产品大于5个的标签",PC:"电脑端",Product:"产品","Promotion product list":"促销产品列表",Subtitle:"副标题","TF direct":"TF直签","Restaurant product":"餐厅产品","Title is required":"标题必填","The content exceeds 100,000 characters, please check and edit agian.":"内容超过100,000字符,请检查并重新编辑。","{count} related product":"{count} 件关联产品","{count} related products":"{count} 件关联产品",Reservation:"预订",Brand:"品牌",Support:"支持","Not support":"不支持","Specific period":"特定期间","Specific date":"特定日期","Specific time":"特定时间","Book ahead days":"提前预订天数","Start time":"开始时间","End time":"结束时间",Interval:"间隔时间","End time must after Start time":"结束时间不能早于开始时间",min:"分钟","Reservation time":"预订时间",email:"邮箱",password:"密码","Enter email address":"请输入邮箱","Please enter your password":"请输入密码","Email is required":"请填写邮箱","Invalid email":"邮箱格式错误","Invalid password":"密码格式错误","Invalid email or password":"邮箱或密码格式错误","Contact TravelFlan":"联系 TravelFlan",ACT:"可用",DCT:"已过期",FRZ:"已冻结",RMD:"已核销",RFD:"已退款",Login:"登录","For Merchants":"For Merchants",ECode:"券码",BookingSn:"订单号",Clear:"清除",Verify:"验证",MyShopOnly:"仅当前门店","Confirm to redeem":"确认核销",Redeeming:"核销中","Your account has been frozen, please contact TravelFlan business manager":"你的账户已被冻结, 请联系TravelFlan商务经理","Please enter 12 digits":"请输入12位数字","The code is frozen":"券码已被冻结","The code invalid":"券码无效",Successfully:"成功","Redeemed the code successfully":"核销成功","Two passwords do not match":"两次密码不一致","Reset password successfully":"修改成功","Transfering you to login page":"正在带您前往登录页","Redeem date":"核销日期","Code redeem":"核销券码","E-code list":"券码列表","E-CODE":"券码","Booking #":"订单号","Booking item":"订单项目","Valid Period":"有效期",to:"至","The code redeemed":"券码已核销","Resource Created":"Resource Created","Resource Updated":"Resource Updated","Resource Deleted":"Resource Deleted",create:"创建了",update:"更新了",delete:"删除了",Change:"修改了",from:"从","event.coupon":"优惠券","event.product":"产品","event.order":"订单","event.poi":"POI","event.tagsystem":"标签",System:"系统",NoData:"暂无数据",sidebar:{Chatbot:"聊天机器人",FAQ:"智能问答","Message record":"消息记录","AI setting":"AI设置","Agent platform":"客服平台","Order Mgmt":"订单管理","Travel and goods":"订单","Rest reserve":"餐厅订座","Rest E-code":"餐饮商品券码","Product Mgmt":"产品管理","Travel / Shopping":"旅游/购物",Restaurant:"餐饮产品","Op center":"运营中心","MKP homepage":"MKP首页","Rest channel":"餐厅频道页","Shopping channel":"购物频道页",POI:"POI","Tag Mgmt":"标签管理","Revenue Mgmt":"营收管理",Currency:"货币设置",Marketing:"市场营销",Coupon:"优惠券码",Event:"专题"},Travel:"旅游","E-Commerce":"购物",EMPTY:"EMPTY",NATIVE_WC:"NATIVE_WC",JSAPI_WC:"JSAPI_WC",APP_WC:"APP_WC",FACEBOOK_WD:"FACEBOOK_WD",WEB_ALIPAY:"WEB_ALIPAY",WAP_ALIPAY:"WAP_ALIPAY",WEB_PAYPAL:"WEB_PAYPAL",SAMSUNG_RCS:"SAMSUNG_RCS",WEB_ALIPAYHK:"WEB_ALIPAYHK",WAP_ALIPAYHK:"WAP_ALIPAYHK",PAYME:"PAYME","Upload images":"批量上传图片",Insert:"插入","product:sn":"SN","product:status":"状态","product:flan":"优先级","product:details:{lang}":"{lang}详情","product:details:{lang}:title":"标题","product:details:{lang}:meta:address":"地址","product:details:{lang}:meta:brief":"简介","product:details:{lang}:meta:description":"详细描述","product:details:{lang}:meta:fee_inlcude":"费用包含","product:details:{lang}:meta:fee_not_inlcude":"费用不含","product:details:{lang}:meta:order_detail":"预订须知","product:details:{lang}:meta:precautions":"注意事项","product:details:{lang}:meta:refund_policy":"退改须知","product:details:{lang}:meta:subtitle":"副标题","product:details:{lang}:meta:rules":"使用规则","product:details:{lang}:meta:use_range":"使用范围","product:details:{lang}:meta:use_time":"使用时间","product:supplier_product_sn":"供应商产品SN","product:supporting_provider":"内部平台,外部平台","product:product_start_date":"开始时间","product:product_end_date":"结束时间","product:display_price:{currency}":"{currency}RCS原价","product:display_discounted_price:{currency}":"{currency}RCS价格","product:mkp_display_original_price:{currency}":"{currency}原价","product:mkp_display_price:{currency}":"{currency}售卖价格","product:is_cancelable":"可退","product:max_purchase_quantity_per_user":"最大购买数","product:limited_each_user":"单用户限制","product:is_promotion":"促销","product:is_self_purchased":"TF直签","product:pois":"关联POI","product:pog_cities":"国家/地区&城市","product:searchable_tags":"标签","product:variants:{variantId}":"选项(ID:{variantId})","product:variants:{variantId}:sku":"总库存","product:variants:{variantId}:stock":"库存数量","product:variants:{variantId}:cost:{currency}":"{currency}成本价","product:variants:{variantId}:price:{currency}":"{currency}售卖价格","product:variants:{variantId}:original_price:{currency}":"{currency}原价","product:variants:{variantId}:purchase_type":"销售类型","product:variants:{variantId}:sell_start_date":"开始时间","product:variants:{variantId}:sell_end_date":"结束时间","product:variants:{variantId}:valid_start_dt":"有效期开始日期","product:variants:{variantId}:valid_end_dt":"有效期结束日期","product:variants:{variantId}:book_n_days_before_book_date":"book_n_days_before_book_date","product:variants:{variantId}:valid_start_time":"有效期开始时间","product:variants:{variantId}:valid_end_time":"有效期结束时间","product:variants:{variantId}:valid_time_interval":"有效期持续时间","product:variants:{variantId}:min_purchase_quantity":"最小购买数","product:variants:{variantId}:max_purchase_quantity":"最大购买数","product:options:{optionId}":"选项(ID:{optionId})","product:options:{optionId}:status":"状态","product:options:{optionId}:option_sn":"选项sn","product:options:{optionId}:voucher_type":"兑换方式","product:options:{optionId}:option_start_date":"开始时间","product:options:{optionId}:option_end_date":"结束时间","product:options:{optionId}:book_date_required":"指定日期","product:options:{optionId}:limited_each_user":"单用户限制","product:options:{optionId}:details:{lang}":"{lang}详情","product:options:{optionId}:details:{lang}:meta:brief":"简介","product:options:{optionId}:details:{lang}:title":"标题","product:options:{optionId}:sub_options:{suboptionId}":"子选项(ID:{suboptionId})","product:options:{optionId}:sub_options:{suboptionId}:status":"状态","product:options:{optionId}:sub_options:{suboptionId}:cost:{currency}":"{currency}成本价","product:options:{optionId}:sub_options:{suboptionId}:price:{currency}":"{currency}售卖价格","product:options:{optionId}:sub_options:{suboptionId}:original_price:{currency}":"{currency}原价","product:options:{optionId}:sub_options:{suboptionId}:min_book_days":"最少预订天数","product:options:{optionId}:sub_options:{suboptionId}:cancel_n_days_before_book_date":"提前取消天数","product:options:{optionId}:sub_options:{suboptionId}:book_n_days_before_book_date":"提前预订天数","product:options:{optionId}:sub_options:{suboptionId}:max_quantity_per_sub_option":"最多数量","product:options:{optionId}:sub_options:{suboptionId}:min_purchase_quantity":"最小购买数","product:options:{optionId}:sub_options:{suboptionId}:max_purchase_quantity":"最大购买数","product:options:{optionId}:sub_options:{suboptionId}:limited_each_user":"单用户限制","product:options:{optionId}:sub_options:{suboptionId}:details":"title","product:warehouse":"仓库","product:categories":"类别","order:status":"状态","order:total_amount":"小计","order:requested_amount":"需支付的金额","order:paid_amount":"支付金额","order:discounted_amount":"优惠","order:refunded_amount":"已退款金额","order:refunding_amount":"退款中金额","order:delivery_amount":"运费","order:coupon_discounted_amount":"优惠券折扣金额","order:secret":"交易流水号","order:trade_type":"兑换方式","order:remark_to_customer":"给用户留言","order:note":"备注","order:payment_method":"支付方式","order:bookings:{bookingId}":"预订单(ID:{bookingId})","order:bookings:{bookingId}:status":"状态","order:bookings:{bookingId}:sn":"预订单ID","order:bookings:{bookingId}:track_number":"物流编号","order:bookings:{bookingId}:courier_company":"物流公司","order:bookings:{bookingId}:total_amount":"小计","order:bookings:{bookingId}:refunded_amount":"已退款金额","order:bookings:{bookingId}:refunding_amount":"退款中金额","order:bookings:{bookingId}:voucher":"凭证","order:bookings:{bookingId}:customer_request":"备注","order:bookings:{bookingId}:confirmation_info":"信息确认","order:bookings:{bookingId}:note":"备注","tagsystem:synonyms":"同义词","tagsystem:sn":"标签ID","tagsystem:status":"状态","tagsystem:supporting_provider":"内部平台&外部平台","tagsystem:ai_trigger":"AI识别","poi:status":"状态","poi:flan":"优先级&评分","poi:category":"类型","poi:supporting_provider":"供应商","poi:price_range":"人均消费&基准币种","poi:support_reservation":"预订","poi:position":"位置","poi:searchable_tags":"标签","poi:details:{lang}":"{lang}详情","poi:details:{lang}:title":"标题","poi:details:{lang}:meta:name":"产品名称","poi:details:{lang}:meta:description":"详细描述","poi:details:{lang}:meta:rules":"使用规则","poi:details:{lang}:meta:use_range":"使用范围","poi:details:{lang}:meta:use_time":"使用时间",true:"是",false:"否","Theme setup":"主题页设置","Theme color":"主题页颜色","Navigation background color":"导航背景颜色","Navigation font color":"导航字体颜色","Maximum 4 coupons":"最多添加4张优惠券","Event name":"活动名称","PC - 1960*600px JPG JPEG only || Design focus 1200*400px || <500KB":"电脑端:1960*600px 仅支持JPG JPEG|| 设计关注区 1200*400px || <500KB","Mobile - 1125*1500px JPG JPEG only || Design focus 1125*900px || <500KB":"移动端:1125*1500px 仅支持JPG JPEG|| 设计关注区 1125*900px || <500KB",Section:"类目","Section title":"类目名称","Section images":"类目图片","PC - 1200*60px JPG JPEG only || <500KB":"电脑端:1200*60px 仅支持JPG JPEG || 设计关注区 1200*40px || <500KB","Mobile - 1125*180 JPG JPEG only || <500KB":"移动端:1125*180px 仅支持JPG JPEG || 设计关注区 1125*90px || <500KB","Add section":"新增类目","Section type":"类目类型","Other detail":"活动说明",Coupons:"优惠券","Copy link":"复制链接",Itin_supplier:"行程供应商",Itin_supplier_UID:"行程编号","Buy limit per ACCT":"账户购买限制","Max buy per ACCT":"账户最大购买","Restricted period":"限购时间","Can not greater than maximun purchase per account":"不能超过账户最大购买数","Can not less than max buy":"不能小于子选项的最多购买数","Can not less than max buy2":"不能小于最大购买数",'Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude':'请依照 "xx.xxxx, yy.yyyy" 格式输入经纬度',"Copied name successfully":"名称复制成功","Copied SN successfully":"SN复制成功","Refund note":"退款备注",Windows:"Windows",macOS:"macOS","Other-Desktop":"其它-电脑",Android:"安卓",iOS:"iOS","Other-Mobile":"其它-手机",Device:"设备","WeChat pay":"微信支付","WeChat official account":"微信支付-公众号","WeChat mini program":"微信支付-小程序","Alipay web":"支付宝网页版","Alipay mobile":"支付宝移动端","Alipay HK web":"支付宝香港网页版","Alipay HK mobile":"支付宝香港移动端",Paypal:"Paypal",Payme:"Payme","Credit card":"信用卡","Overdue status":"过期状态","Expire in a week":"一周内即将过期",Amount:"数量","Promotion ID":"活动ID","Promotion prd":"活动时间","Rights(Mylink points)":"权益(Mylink积分)","Rewards method":"奖励方式","Every Booking":"每个预订单","Follow Payment Price":"跟随支付金额","for every":"每",Price:"价格","Promotion date":"活动时间","Promotion name":"活动名称","{num} Mylink points have sent to user, please be careful with refunds":"{num}点MyLink点数已送出,请留意退换货","Time selection":"可选择时间","Bulk upload":"批量上传","Customer note":"启用客户备注","Customer note no show":"不显示","Customer note show":"显示","Display tag":"展示标签",Synchronize:"同步","Mylink point promo id":"Mylink积分促销id","What to Expect":"产品重点",Details:"详细介绍",Inclusions:"费用包含",Exclusions:"费用不包含","Instant Confirmation":"及買即用","Mobile Voucher":"电子门票","Hotel Pick Up":"酒店领取","Skip the Line":"免排队","Free Cancellation":"免费退","Free Parking":"免停车费","Open Dated Voucher":"任选日期","Audio Guide":"语音导览","Wheel Chair Accessible":"身障友好","Best Seller":"销售最佳","Exclusive Travelflan Offer":"TF专享","COVID-19 Safety Measures":"COVID防疫等级","Valid during EID Holidays":"EID节日可用","Authorised Reseller":"授权商","Official Reseller":"官方合作","500+ Bought":"500+已售","1K+ Bought":"1K+已售","1.5K+ Bought":"1.5K+已售","2K+ Bought":"2K+已售","3K+ Bought":"3K+已售","Keyword setting title":"搜索关键字主题","Keyword setting description":"搜索关键字简介",Active:"有效",Deactive:"无效","Related booking":"相关预订单",Deactivated:"不可售","Upload voucher":"上传凭证","Only support PDF format and < 10MB":"只支持 PDF 格式,并且 < 10MB","Upload voucher option is required":"上传凭证的选项必填","Upload voucher suboption is required":"上传凭证的子选项必填",reselect:"重新选择",invalidated:"无效",Invalidate:"无效","Sure to invalidat voucher":"确定要使凭证无效吗",Deliver:"发货",Delivered:"已发货","Voucher type":"凭证类型",File:"文件",Link:"链接","Image link":"跳转链接",Goods:"商品","Not ready":"未准备好","Ready to pick up":"准备好自取","Pick up note":"自取备注","Enter note":"输入备注",Replace:"替换","Delivery option":"发货选项","Apply to all related bookings in this order":"应用于订单里其他关联的预订","One Image":"1张图","Two Image":"2张图","Three Image":"3张图",Cost:"成本价","Show in navigation":"是否在导航里显示","Send date":"发送日期","Booking paid time":"支付时间","Point send time":"积分发送时间","Payment completed time":"订单完成时间","No Promotion":"无积分","Payment Incomplete":"订单未完成","Send Processing":"待发送","Send Success":"发送成功","Send Fail":"发送失败"},$k={lang:{en_US:"英文",zh_CN:"簡體中文",zh_HK:"繁體中文",ko_KR:"韓文"},platform:{website:"Marketplace",wechat:"微信",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot-網頁",widget_sa:"Chatbot-微信",widget_mp:"Chatbot-小程序",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip"},weekDays:{Monday:"週一",Tuesday:"週二",Wednesday:"週三",Thursday:"週四",Friday:"週五",Saturday:"週六",Sunday:"週日"},"Reset password":"重置密碼",Logout:"退出","Basic setting":"基礎設置","Function setting":"功能設置","Chatroom banner":"廣告圖","Sure to cancel?":"確認取消?",Ok:"確定",Yes:"是",No:"否",Save:"保存",Cancel:"取消",Edit:"編輯",Delete:"刪除","Welcome message":"歡迎語","Once user came in, chatbot will sent this automatically.":"用戶進入聊天室時,此消息將會自動發送","Unknown reply":"未知回復","When AI does not understand, will reply this.":"當機器人無法理解用戶消息時,將會發送此消息","Enter message":"輸入消息","Please enter welcome message":"請輸入歡迎語","Please enter unknown reply":"請輸入未知回復","Save successfully":"保存成功","Delete successfully":"刪除成功","Save failed":"保存失敗","Function and buttons":"功能及按鈕配置","Control the function and their button wording":"控製功能是否可用及對應按鈕的文案",Function:"功能",Operation:"操作","Please enter display text":"請輸入{0}的顯示文本({1})","no more than 4 Chinese or 8 alphabetic characters":"{0}({1})的字數不能超過4個漢字或8個字母字符",Banner:"廣告圖",Upload:"上傳",Remove:"移除","Trigger Link":"跳轉鏈接","Please enter trigger link":"請輸入跳轉鏈接","Remove successfully":"移除成功","Remove failed":"移除失敗","Upload successfully":"上傳成功","Upload failed":"上傳失敗","Suggest size 748 x 260px":"建議大小 748 x 260像素","Please enter the valid link":"請輸入正確的鏈接格式","Current Password":"當前密碼","New Password":"新密碼","Confirm Password":"確認密碼","Length should between 6 and 14":"密碼長度為6-14位","Confirm password is not match the new password":"確認密碼與新密碼不匹配","Current Password is not correct":"當前密碼錯誤","This password is too common.":"新密碼過於簡單","This password is entirely numeric.":"新密碼必須包含數字和字母","Please enter {0}":"請輸入{0}",Submit:"提交","Agent setting":"客服設置",Add:"新增","Working hours":"工作時間","Type name":"類別名稱",Period:"日期","Online time":"在線時間",Status:"狀態",Action:"操作","Are you sure to delete ?":"確定要刪除嗎?","By week":"星期模式","By date":"日期模式","Function rules":"功能規則","Trigger Times":"觸發次數","Trigger Agent":"接入客服",Reply:"回復","Some situations when trigger accumulated time, can trigger Agent and/or messages.":"當某些功能連續觸發指定次數時,可以設置是否需要客服,是否自動回復指定消息。",Type:"類別",Count:"消息數",Users:"用戶數",Message:"消息",Range:"範圍",Keyword:"關鍵詞",Search:"搜索",Timezone:"時區設置","Please enter agent offline auto reply":"請輸入客服離線回復","Please enter agent online auto reply":"請輸入客服在線回復","Agent online auto reply":"客服在線回復","Agent offline auto reply":"客服離線回復","Our timezone":"所在時區","Maximum 10 period":"最多添加10條","Alphanumeric, between 6 to 14 digits, cannot be too simple":"密碼長度為4-14位,切勿過於簡單,必須包含英文和數字",Confirm:"確定",productmanage:{common:{Country:"國家",City:"城市",Search:"搜索",ProductID:"產品ID",ProductSN:"產品SN",SupplierProductID:"供應商產品ID",OptionName:"選項名稱",ProductName:"產品名稱",Delete:"刪除",Image:"圖片",Price:"價格",Status:"狀態",Vendor:"供應商",Platform:"平臺",Option:"選項",Suboption:"子選項",Stock:"庫存",Promotion:"促銷",SN:"SN",Brief:"簡介",yes:"是",no:"否",Description:"詳細描述",FeeInlcude:"費用包含",FeeNotInlcude:"費用不含",Precautions:"註意事項","Important to Know":"註意事項",OrderDetail:"預訂須知",RefundPolicy:"退改須知",ProductInfo:"產品信息",VendorPdSN:"供應商產品SN",Priority:"優先級",LowestPriority:"最低優先級",HighestPriority:"最高優先級",ProdcutType:"產品類型",RelatedPOI:"關聯POI",Tag:"標籤","1stImage":"第一張圖",asCover:"作為封面",UploadImage:"上傳圖片",imageText:"僅支持 JPG JPEG PNG",Position:"位置",LongitudeLatitude:"經度, 緯度",Fold:"收起",AddLanguage:"新增語言",NonRefundable:"不可退",Refundable:"可退",CreateInfo:"創建信息",UpdateInfo:"更新信息",SaveAndNext:"保存並進入下一步",EnterSomething:"輸入內容",ItsRequired:"必填項",MustBeDigitGreaterThan0:"必須為數字且大於0",AtLeastOneRange:"最少一段範圍",WeekIsRequired:"星期必填",SnErr:"SN 已存在",RequiredAndMustBeMax:"必填項,且必須為不小於最少購買數的數字",RequiredAndMustBeMin:"必填項,且必須為不大於最多購買數的數字",Mustbeadigitbetween0and99:"必須為數字且在0-99之間",SubTitle:"副標題",RCSDisplay:"RCS價格",RCSOriginal:"RCS原價",WhichGo:"請選擇跳轉平臺",SensitiveWording:"敏感詞",APIUpdate:"API更新內容",Star:"星級",ContactNumber:"聯繫電話",Email:"電郵",HotelAddress:"酒店地址",Surrounding:"周邊推薦",MinBookDays:"最少預訂天數",MaxBookDays:"最多預訂天數",Rating:"評分",Reviews:"瀏覽量"},option:{Expand:"展開",DuplicateCurrentOption:"複製現有選項",DuplicateCurrentSub:"複製現有子選項",RedeemMethod:"兌換方式",SpecificDate:"指定日期",AddNewSub:"新增子選項",HideCurrentOption:"隱藏現有選項",ShowCurrentOption:"顯示現有選項",HideCurrentSub:"隱藏現有子選項",ShowCurrentSub:"顯示現有子選項",SoldOut:"售罄",Unlimited:"不限庫存",MultiSetting:"批量設置",ForSale:"可售",NotForSale:"不可售",SaveToDraft:"保存為草稿",SaveToReview:"保存並提交審核",SaveToShow:"保存並發佈",VendorSuboptionSN:"供應商子選項SN",QuickSetup:"快速設置",FillIn:"填入","Note(optional)":"備註(選填)",Note:"備註",MinBuy:"最少購買數",MaxBuy:"最多購買數",BookBefore:"提前預訂天數",CancelBefore:"提前取消天數",StockType:"庫存類型",AdvanceBookingDays:"提前預訂天數",CancelDaysLimit:"提前取消天數",MinNumber:"最少數量",MaxNumber:"最多數量",NoLimits:"不限庫存",TotalStock:"總庫存",Increase:"增加",Decrease:"減少",Equal:"設置為",number:"數量",MultidaySetting:"批量設置",Range:"範圍",All:"所有",Week:"星期",SellPeriod:"售賣時間",StartDate:"開始時間",EndDate:"結束時間",to:"至",SellPrice:"售賣價格",OrigianlPrice:"原價",CostPrice:"成本價",VendorSuggestPrice:"供應商價格"},weeks:{Mo:"週一",Tu:"週二",We:"週三",Th:"週四",Fr:"週五",Sa:"週六",Su:"週日"},status:{"Draft|DFT":"草稿","Show|ACT":"可售","Review|REV":"審核中","Hide|DCT":"隱藏","Sold Out|SDT":"售罄","Expired|EXP":"已過期","Exclusive|ACT_ADS":"專享","Deactivated Ads|DCT_ADS":"專享(不可售)","Delete|DET":"刪除"},productType:{"Ticket|TKT":"門票","Tour|TOR":"玩樂","Rental|RNT":"租賃","Luggage|LGG":"服務","Delivery|DEI":"購物","Hotel|ACM":"酒店"},priceType:{USD:"美元",HKD:"港幣",TWD:"臺幣",KRW:"韓元",CNY:"人民幣",AED:"阿聯酋迪拉姆",SGD:"新加坡元",JOD:"約旦第納爾",GBP:"英鎊",EUR:"歐元",AUD:"澳元",JPY:"日元",THB:"泰銖",IDR:"印尼盾",MYR:"令吉",PHP:"披索",VND:"越南盾"},table:{"ID/SN":"ID/SN",Type:"類型",Name:"名稱",Action:"操作",Edit:"編輯",NoLimit:"不限",SuboptionName:"子選項名稱",Clear:"清除"},view:{RCS:"RCS",TKT:"票券",ACM:"住宿",RNT:"租賃",PKG:"套餐",TOR:"旅行團",SFT:"自由行",LCD:"當季熱賣",LGG:"行李",RTR:"餐廳",PCK:"接送"},voucherType:{"E-Code|EC":"條碼/二維碼","E-Paper|EP":"電子憑證","Paper|PA":"實體票","Code|CD":"兌換碼","Others|ETC":"其它","Delivery|DEI":"郵寄","Pickup|PCK":"自取"},peopleType:{"Adult|13|59":"成人","Child|3|12":"兒童","Senior|60|99":"老人","Infant|0|2":"嬰兒","Student|-|-":"學生","All|-|-":"數量"},copy:"複製"},poi:{type:{ATR:"景點",RTR:"餐廳"},payment:{"cash_only|1":"現金支付","visa|2":"VISA","credit_cart|3":"信用卡","alipay|4":"支付寶","wechatpay|5":"微信支付","union_pay|6":"銀聯","electronic_money|7":"電子錢包","dc|8":"大萊","id|9":"ID","nc|10":"NC","uc|11":"UC","jcd|12":"JCB","ufj|13":"UFJ","amex|14":"美國運通","master|15":"萬事達","diners|16":"大萊"},facility:{"wifi|1":"免費WIFI","parking|2":"停車場","smoking|3":"吸煙區","delivery|4":"配送","takeaway|5":"外帶","cn_service|6":"中文服務","no_smoking|7":"禁煙","wheelchair|8":"輪椅","kids_friendly|9":"可帶小孩","byob|10":"可自帶酒水"},status:{"Draft|DFT":"草稿","Show|ACT":"顯示","Review|REV":"審核中","Hide|DCT":"隱藏"},ID:"ID",Priority:"優先級",BasicInfo:"基礎信息",RelatedProduct:"關聯產品",Type:"Type",AverageCost:"人均消費",VisitHours:"遊玩時間",SeatNumber:"座位數",Rating:"評分",Favorited:"收藏數",Payment:"支付方式",HomePage:"官網",VendorLink:"源數據鏈接",Vendor:"供應商(數據源)",Location:"位置",LongitudeLatitude:"經度, 緯度",City:"城市",District:"行政區",Shared:"分享數",Facility:"設施",Tag:"標籤",POIID:"POI ID",Name:"名稱",POIName:"POI名稱",SubDescription:"副標題",ContactNumber:"聯繫方式",Address:"地址",OpenHours:"營業時間",VisitHoursNote:"遊玩時間備註",Suggestion:"建議",Transportation:"交通",TicketInfo:"門票信息",Recommendation:"推薦",inputTip:"必須為數字且在0.0-5.0之間",AddSimilarName:"新增同義名稱"},tag:{TagCategory:"標籤分類",CategorySearch:"搜索分類",AllCategories:"所有分類",DeleteCategoryTip:"確定要刪除這個分類嗎?",Okay:"確定",insetTip:"分類 [|] 下存在子標籤,請先刪除所有子標籤.",TagID:"標籤ID",TagName:"標籤名稱",EditTagCategory:"編輯標籤分類",NewTagCategory:"新增標籤分類",SelectaCategory:"請選擇標簽分類",MainTagName:"主標籤名稱",Synonym:"同義詞",AITrigger:"AI識別",SaveFailed:"保存失敗!以下有必填項未填",Require:"主標籤名稱必填",NoData:"暫無數據",NoTagIsFound:"暫無數據",NewTag:"新標籤",TagInfo:"標籤信息",RelatedProduct:" 相關產品",RelatedPOI:"相關POI",On:"是",Off:"否",status:{"Show|ACT":"顯示","Hide|DCT":"隱藏"}},Category:"類別","Search question":"搜索問題",Question:"問題","Expired date":"有效期","All questions":"全部問題","Are you sure to delete selected questions?":"確定要刪除選中的問題嗎?","Are you sure to delete?":"確定要刪除嗎?","Similar question":"相似問題",Answer:"答案","Custom answer":"定製答案","Search Tag":"標簽搜索",Language:"語言",Infinite:"永久有效",Note:"備註","Delete seleted":"刪除選中",Alert:"提示","Download template":"下載模版文件","Click or drag the file here to upload":"點擊或將文件拖拽到這裏上傳","Only support xls format and":"隻支持以下文件格式: xls 小於","Upload successed.":"上傳成功","Upload failed, errors found, please scroll down to see detail and reupload.":"上傳失敗,{uploadFailMsgs}調錯誤發現,請往下滾動查看細節並重新上傳","Incorrect sheet name":"工作錶名稱“{sheet}”錯誤","Error in row, column, and sheet":"“{sheet}”工作錶中第{row}行第{column}列錯誤(缺少必填項)","File exceeding is not allowed":"文件大小不可超過{maxFileSize}",Import:"導入","Import FAQ":"導入FAQ","All status":"所有狀態",Online:"上線",Offline:"下線",On:"上線",Off:"下線",Uncategorized:"未分類","The {name} contains category":"{name}下存在子分類","Please enter the question":"請輸入問題","Please enter the answer":"請輸入答案",pongo:{name0:"Client",name1:"AI",name2:"Agent",platform0:"travelflan|TF",platform1:"facebook|FB",platform2:"wechat-travelflan|WC",platform3:"samsung-travelflan-korea|SG",platform4:"bixbyMobile-travelflan|RCS",platform10:"widget-travelflan|WG",platform13:"widget-jegotrip|WG",platform14:"widgetSA-travelflan|WG-SA",platform15:"widgetMP-travelflan|WG-MP",platform17:"widget-mayflower|WG",platform300:"facebook-travelflan|FB",platform301:"facebook-healpack|FB",platform302:"facebook-tf-test2|FB-test",status0:"在線
客服",status1:"啓動
聊天",status2:"AI應
答中",status3:"人工
接待中",status4:"等待
客服",longestWait:"最長等待
",AllClient:"All client",MyClient:"My client",NotFound:"not found"},weatherResult:{weatherIs:"的天氣是",Tornado:"龍卷風",Tropical:"熱帶風暴",Hurricane:"颶風","Severe thunder storms":"強烈雷暴","Thunder storms":"雷暴","Mixed rain snow":"雨夾雪","Mixed rain sleet":"雨雪","Mixed snow sleet":"雪雨","Freezing drizzle":"冰雨",Drizzle:"細雨","Freezing rain":"冰雨",Showers:"陣雨","Snow flurries":"小陣雪","Light snow showers":"小陣雪","Blowing snow":"風雪",Snow:"飄雪",Hail:"冰雹",Sleet:"雪雨",Dust:"灰塵",Foggy:"霧",Haze:"薄霧",Smoky:"煙霞",Blustery:"大風",Windy:"陣風",Cold:"寒冷",Cloudy:"多雲","Mostly cloudy at Night":"晚間多雲","Mostly cloudy at Day":"日間多雲","Partly cloudy at night":"晚間多雲","Partly cloudy at day":"日間多雲","Clear at night":"天色明朗",Sunny:"天晴","Fair at night":"晚間天氣良好","Fair at day":"日間良好","Mixed rain and hail":"冰雹陣雨",Hot:"炎熱","Isolated thunder storms":"局部雷暴","Scattered thunder storms":"零散雷暴","Scattered showers":"零散驟雨","Heavy snow":"大雪","Scattered snow showers":"零散陣雪","Partly cloudy":"部分時間多雲","Thunder showers":"雷陣雨","Snow showers":"陣雪","Isolated thunder showers":"局部雷雨","Not available":"没有資料"},"Related products":"相關產品",Supplier:"供應商",SupplierProductSN:"供應商產品SN",SupplierLink:"供應商鏈接",SupplierSuboptionSN:"供應商子選項SN","Click here to check out hotel that fits you":"請點此查看為你精選的酒店","Online
Agent":"在線
客服","Started
Chatbot":"啓動
聊天","AI
Handling":"AI應
答中","Agent
Handling":"人工
接待中","Request
Agent":"等待
客服`","Assign to agent":"派予客服","Assign to me":"我來接待","Please use shift + enter key to send message":"直接發送請按Shift+Enter鍵","All client":"全部客戶","My client":"我的客戶","Client info":"客戶信息",Information:"個人信息",Name:"名字",Email:"電郵",ID:"ID",Lang:"語言",Phone:"電話",English:"英文","Simplified Chinese":"簡中","Traditional Chinese":"繁中",Korean:"韓文","Language unknown":"未知語言","Consultation note":"留言闆","Type notice here...":"在此留言","Client tags":"客戶標籤","Search Tags":"搜索標籤","Quick reply":"快速回覆",Welcome:"歡迎語",Common:"常用語",Upselling:"附加銷售","User acquisition":"用戶獲取",Promotion:"促銷活動","Mylink Promotion":"Mylink活動","Enter title":"標題","Select category":"選擇類別","Input content":"輸入語句","Please enter title":"請輸入標題","Please select category":"請選擇類別","Please enter content":"請輸入內容","Save successfully!":"保存成功!","Save failed!":"保存失敗!","Please include dialing code (e.g. +86)":"請加上國際碼(如+86)",Refresh:"刷新","Review link":"外部評價鏈接",Currency:"幣種",Base:"基準","Exchange rate":"匯率",Priority:"排序","Update time":"更新時間","Currency detail":"幣種詳情","Currency Name":"名稱","Live rate":"實時匯率","Fill in":"填入","Exc. rate":"匯率",Platform:"平臺","Create info":"創建信息","Update info":"更新信息","Enter a digit with 4 decimals":"輸入一個包含4位小數的數字","Show history":"歷史記錄",Warning:"警告","The “exchange rate” is 10% or more lower/higher than the “live rate”, do you still want to proceed ?":"當前匯率值低於或高於實時匯率10%,確認要繼續保存嗎?","Symbol is required":"符號必填","Exc. rate is required":"匯率必填","It’s required":"必填項","Enter image text":"輸入配圖文字",Sorting:"排序","Option sorting":"選項排序","Suboption sorting":"子選項排序",Symbol:"符號","Format error, please use xx.xxxx, yy.yyyy with up to ten-thousandths":'格式錯誤,請依照"X, Y"格式且最多支持小數點後四位',Draft:"草稿",Show:"可售",Review:"審核中",Hide:"隱藏","Sold Out":"售罄",Expired:"已過期",Exclusive:"專享","Deactivated Ads":"專享(不可售)",'Invaild longitude and latitude format, please follow "X,Y" format and support up to ten-thousandths':'經緯度格式錯誤,請依照"X, Y"格式且最多支持小數點後四位',"Please enter distance":"请输入距离","Please enter longitude and latitude":"请输入经纬度","Distance must be an number between 1 and 5":"距离必须1到5之间的数字","Search or select multiple options":"搜索或選擇多個選項",Ticket:"票券",Tour:"旅行團",Rental:"租賃",Luggage:"行李",Delivery:"電商產品",Hotel:"酒店","E-Code":"條碼/二維碼","E-Paper":"電子憑證",Paper:"實體票",Code:"兌換碼",Others:"其它",Delivery2:"郵寄","Supplier SN":"供應商SN","Vaild perd":"有效期","Sell perd":"售賣日期","Related Rest":"適用餐廳","Combo details":"套餐詳情","Use time":"使用時間","ORDER & DELIVERY":"訂購須知","How to Redeem":"訂購須知",Rules:"使用規則","Item type":"銷售類型","Free item":"免費領取","Pay item":"付費項目","Min Buy":"最小購買數","Max Buy":"最大購買數","Internal PF":"內部平台","External PF":"外部平台","POI name":"POI名稱","Order date":"預訂日期","Paid date":"支付日期","Travel date":"出行日期","Refund date":"退款日期","Select date":"選擇日期","Order status":"訂單狀態","Booking status":"預訂單狀態","Product type and category":"產品分類","Payment Waiting":"支付中","Payment Completed":"支付完成","Reservation Declined":"預訂拒絕","Refund Waiting":"退款已提交","Refund Completed":"退款完成","Refund Declined":"退款拒絕","Partial Refund Waiting":"部分退款已提交","Partial Refund Completed":"部分退款已完成","Partial Refund Decline":"部分退款拒絕","Payment processing":"支付中","Payment declined":"支付拒絕","Order info requested":"訂單信息缺失","Order waiting":"預訂待處理","Order processing":"預訂處理中","Order completed":"預訂已完成","Order failed":"預訂失敗","Refund requested":"退款已提交","Refund processing":"退款處理中","Refund confirmation":"退款已確認","Refund completed":"退款已完成","Refund declined":"退款拒絕","Refund error":"退款錯誤","Booking ID":"預訂單ID","Payment ID":"訂單ID","Product ID":"產品ID","Right ID":"積分項ID","Product SN":"產品SN","Product name":"產品名稱","Phone number":"電話號碼","User name":"用戶姓名","User email":"用戶郵箱","User phone number":"用戶電話","Supplier product SN":"供應商產品SN","Option name":"選項名稱","Country/Region":"國家/地區",City:"城市","Hide test order":"隱藏測試單","Show test order":"顯示測試單","Booking & supplier":"預訂單&供應商","Product name & type":"產品名稱&類型","Item detail":"項目明細","Customer info":"顧客信息","Paid amount":"支付金額","Order ID":"訂單ID","Create time":"創建時間","Order detail":"訂單詳情",Export:"導出","Item detail & number & price":"項目明細&數量&價格",Subtotal:"小計",Minus:"優惠",Paid:"支付",Refunded:"退款",Total:"總計","Customer name":"顧客姓名",Gender:"性別","Contact number":"聯繫電話","Comment to user":"給用戶留言","Delivery tracking":"物流跟蹤",Refund:"退款","Order info":"訂單信息",Remark:"訂單備註","User ID":"用戶ID","Paid time":"支付時間","Payment method":"支付方式","Payment secret":"交易流水號","Coupon code":"優惠碼",Discount:"優惠",Vouchers:"憑證",Voucher:"憑證","Voucher status":"憑證狀態","Voucher name":"憑證姓名","Voucher link":"憑證鏈接","Upload time":"上傳時間",Coupon:"優惠券","Refund amount, please enter a digit no greater than {0}":"退款金額, 請輸入一個不大於{amount}的數字","Refund policy":"退款政策",Copied:"已複製","Copied secret successfully":"交易流水號複製成功",Failed:"失敗","Fail to copy secret":"交易流水號複製失敗","User Info":"用戶信息",Country:"國家/地區",Available:"可用",Frozen:"已凍結",Redeemed:"已核銷","E-code":"券碼","Rest code":"券碼","Valid period":"有效期","Redeem time":"核銷時間","Redeem shop":"核銷門店",Restaurant:"餐廳","Voucher link is required":"憑證鏈接必填","{0} must be number":"{0} 必須是數字",Address:"地址","Requesting memo":"備註","Courier company":"物流公司","Tracking number":"物流編號","Courier company is required":"物流公司必填","Tracking number is required":"物流編號必填",male:"男",female:"女","{0} item":"{0} 件","{0} items":"{0} 件",Warehouse:"倉庫","Ship to":"寄送至",Pickup:"自取","Pickup at":"自取於","Redeem method":"領取方式",Postcode:"郵編","Batch id":"批次ID","Coupon name":"優惠券名稱","Discount type":"優惠類型",Valid:"有效",Invalid:"無效",Picked:"已領取",Used:"已使用",Detail:"詳情","Create date":"創建日期",Ready:"未開始",Voided:"已作廢",Percentage:"折扣",Marketing:"市場營銷","Valid date":"有效期","Valid time":"有效期","Coupon id":"優惠券ID",Creater:"創建人","User id":"用戶ID","User phone":"用戶手機號","Basic info":"基礎信息","Batch info":"批次信息","Coupon list":"優惠券列表",Description:"詳細描述","Basic currency":"基準幣種","Condition and discount":"條件和折扣","Product limit":"產品限制","Apply product":"適用產品","Specific type/category":"指定分類/類別","Specific product":"指定產品","Type/category":"分類/類別","Redeem/Using limit":"兌換/使用限制","Display in detail page":"詳情頁顯示","Limit each user":"單用戶限制","Coupon total":"優惠總量","Total number":"總數","Batch valid prd":"批次有效期","Batch valid":"批次有效期","Coupon valid prd":"優惠券有效期","Condition amount":"條件金額","Condition quantity":"條件數量","Discount amount":"立減","Discount total":"立减金额","Discount quantity":"折扣力度","Specific quantity":"指定數量","No limit":"不限","Specific amount":"指定金額","Enter and search one or multiple product":"輸入並搜索一個或多個產品","Limit number":"限定數量","Required, must be integer and greater than {amount}":"必填項, 必須為整數且大於{amount}","Code existed, please enter a new code":"優惠碼已存在, 請重新輸入優惠碼","Choose a method":"選擇一種方式",Fold:"折疊",Expand:"展開",AddLanguage:"新增語言",EnterSomething:"輸入內容",USD:"美元",HKD:"港幣",TWD:"臺幣",KRW:"韓元",CNY:"人民幣",AED:"阿聯酋迪拉姆",SGD:"新加坡元",JOD:"约旦第纳尔",GBP:"英鎊",EUR:"歐元",AUD:"澳元",JPY:"日元",THB:"泰銖",IDR:"印尼盾",MYR:"令吉",PHP:"披索",VND:"越南盾",All:"所有",Products:"產品",StartDate:"開始時間",EndDate:"結束時間",website:"Marketplace",wechat:"微信",rcs:"RCS",bixbyMobile:"BixbyMobile",widget:"Chatbot-網頁",widget_sa:"Chatbot-微信",widget_mp:"Chatbot-小程序",Facebook:"Facebook",MKP_Mylink:"MKP_Mylink",MKP_MLIM:"MKP_MLIM",Shop_Jegotrip:"Shop_Jegotrip",ItsRequired:"必填項",RequiredAndMustBeMax:"必填項,且必須為不小於最少購買數的數字",RequiredAndMustBeMin:"必填項,且必須為不大於最多購買數的數字",MBeDigitGreaterThan0:"必須為數字且大於0",UpToTwoDecimalPlaces:"最多两位小数",MustBeIntegerGreaterThan0:"必須為整數且大於0","User redeem":"用戶兌換","System given":"系統發送","Reach {amount} pieces":"滿{amount}件","Reach {amount} piece":"滿{amount}件","Reach {amount}":"滿{amount}","{discount}% off":"{discount}% 折扣","{discount} off":"立減 {discount}","% off":"% 折扣",off:"off","Use platform":"使用平台","Related order":"關聯訂單","Use date":"使用日期","Specific days":"指定天數","Specific peroid":"指定時段","Number of days":"天數","{day} Day":"{day}天","{day} Days":"{day}天","First name":"名","Last name":"姓","Create agent":"創建人","Coupon(Old)":"優惠券(舊)","Length should between 6 and 20":"必須為6-20位","Cannot contain spaces":"不能含有空格","Should between 1 and 99":"必須在1-99之間","Should less than condition amount":"必須小於條件金額",Random:"隨機","Enter 6-20 characters":"輸入6-20位字符","Discount percentage":"優惠折扣","General code":"通用碼","8 random code":"8位隨機碼","12 random code":"12位隨機碼","If code has 8 characters, it can not contain 5 characters and 3 digits":"8位碼不能同時包含5位字母和3位數字","If code has 12 characters, it can not contain 7 characters and 5 digits":"12位碼不能同時包含7位字母和5位數字","Batch code":"批次碼","see coupon list for detail":"請在優惠券列表查看詳情","Name(KR)":"姓名(KR)","Rest. Name":"餐廳名稱","Rest. Contact No":"餐廳電話","Reservation date":"預約時間","User Name":"用戶姓名","Contact No":"聯繫電話",Adult:"成人",Child:"兒童","Theme list":"專題列表","Bottom tag":"底部標籤",Image:"圖片",Mobile:"移動端","< {size}KB {width}*{height} px {types} only":"< {size}KB {width}*{height} px 僅{types}","Trigger link":"跳轉鏈接","{lang} wording, up to {max} characters":"{lang}文案, 最多{max}個字符",Theme:"專題",Title:"標題","List type":"列表類型",Restaurants:"餐廳",Tag:"標籤","Choose up to 8 tags, only support tags that related more than 5 products":"選擇最多8個標籤,僅支持關聯產品大於5個的標籤",PC:"電腦端",Product:"產品","Promotion product list":"促銷產品列表",Subtitle:"副標題","TF direct":"TF直簽","Restaurant product":"餐廳產品","Title is required":"標題必填","The content exceeds 100,000 characters, please check and edit agian.":"內容超過100,000字符,請檢查並重新編輯。","{count} related product":"{count} 件关联产品","{count} related products":"{count} 件关联产品",Reservation:"预约",Brand:"品牌",Support:"支持","Not support":"不支持","Specific period":"特定期間","Specific date":"特定日期","Specific time":"特定時間","Book ahead days":"提前預訂天數","Start time":"開始時間","End time":"結束時間",Interval:"間隔時間","End time must after Start time":"結束時間不能早於開始時間",min:"分鐘","Reservation time":"預訂時間",email:"郵箱",password:"密碼","Enter email address":"請輸入電子郵件地址","Please enter your password":"請輸入密碼","Email is required":"請填寫郵箱","Invalid email":"郵箱格式錯誤","Invalid password":"密碼格式錯誤","Invalid email or password":"郵箱或密碼格式錯誤","Contact TravelFlan":"聯繫 TravelFlan",ACT:"可用",DCT:"已過期",FRZ:"已凍結",RMD:"已核銷",RFD:"已退款",Login:"登錄","For Merchants":"For Merchants",ECode:"券碼",BookingSn:"訂單號",Clear:"清除",Verify:"驗證",MyShopOnly:"僅當前門店","Confirm to redeem":"確認核銷",Redeeming:"核銷中","Your account has been frozen, please contact TravelFlan business manager":"你的賬戶已被凍結,請聯繫TravelFlan商務經理","Please enter 12 digits":"請輸入12位數字","The code is frozen":"券碼已被凍結","The code invalid":"券碼無效",Successfully:"成功","Redeemed the code successfully":"核銷成功","Two passwords do not match":"兩次密碼不一致","Reset password successfully":"修改成功","Transfering you to login page":"正在帶您前往登錄頁","Redeem date":"核銷日期","Code redeem":"核銷券碼","E-code list":"券碼列表","E-CODE":"券碼","Booking #":"訂單號","Booking item":"訂單項目","Valid Period":"有效期",to:"至","The code redeemed":"券碼已核銷","Resource Created":"Resource Created","Resource Updated":"Resource Updated","Resource Deleted":"Resource Deleted",create:"創建了",update:"更新了",delete:"刪除了",Change:"更改了",from:"從","event.coupon":"優惠券","event.product":"产品","event.order":"訂單","event.poi":"POI","event.tagsystem":"標籤",System:"系統",NoData:"暫無數據",sidebar:{Chatbot:"聊天機器人",FAQ:"智能問答","Message record":"訊息記錄","AI setting":"AI設置","Agent platform":"客服平台","Order Mgmt":"訂單管理","Travel and goods":"訂單","Rest reserve":"餐廳訂座","Rest E-code":"餐飲商品券碼","Product Mgmt":"產品管理","Travel / Shopping":"旅遊/購物",Restaurant:"餐飲產品","Op center":"運營中心","MKP homepage":"MKP首頁","Rest channel":"餐廳頻道頁","Shopping channel":"購物頻道頁",POI:"POI","Tag Mgmt":"標簽管理","Revenue Mgmt":"營收管理",Currency:"貨幣設置",Marketing:"市場營銷",Coupon:"優惠券碼",Event:"專題"},Travel:"旅遊","E-Commerce":"購物",EMPTY:"EMPTY",NATIVE_WC:"NATIVE_WC",JSAPI_WC:"JSAPI_WC",APP_WC:"APP_WC",FACEBOOK_WD:"FACEBOOK_WD",WEB_ALIPAY:"WEB_ALIPAY",WAP_ALIPAY:"WAP_ALIPAY",WEB_PAYPAL:"WEB_PAYPAL",SAMSUNG_RCS:"SAMSUNG_RCS",WEB_ALIPAYHK:"WEB_ALIPAYHK",WAP_ALIPAYHK:"WAP_ALIPAYHK",PAYME:"PAYME","Upload images":"批量上傳圖片",Insert:"插入","product:sn":"SN","product:status":"狀態","product:flan":"優先級","product:details:{lang}":"{lang}詳情","product:details:{lang}:title":"標題","product:details:{lang}:meta:address":"地址","product:details:{lang}:meta:brief":"簡介","product:details:{lang}:meta:description":"詳細描述","product:details:{lang}:meta:fee_inlcude":"費用包含","product:details:{lang}:meta:fee_not_inlcude":"費用不含","product:details:{lang}:meta:order_detail":"預訂須知","product:details:{lang}:meta:precautions":"註意事項","product:details:{lang}:meta:refund_policy":"退改須知","product:details:{lang}:meta:subtitle":"副標題","product:details:{lang}:meta:rules":"使用規則","product:details:{lang}:meta:use_range":"使用範圍","product:details:{lang}:meta:use_time":"使用時間","product:supplier_product_sn":"供應商產品SN","product:supporting_provider":"內部平台,外部平台","product:product_start_date":"開始時間","product:product_end_date":"結束時間","product:display_price:{currency}":"{currency}RCS原價","product:display_discounted_price:{currency}":"{currency}RCS價格","product:mkp_display_original_price:{currency}":"{currency}原價","product:mkp_display_price:{currency}":"{currency}售賣價格","product:is_cancelable":"可退","product:max_purchase_quantity_per_user":"最大購買數","product:limited_each_user":"單用戶限制","product:is_promotion":"促銷","product:is_self_purchased":"TF直簽","product:pois":"關聯POI","product:pog_cities":"國家/地區&城市","product:searchable_tags":"標籤","product:variants:{variantId}":"選項(ID:{variantId})","product:variants:{variantId}:sku":"總庫存","product:variants:{variantId}:stock":"庫存數量","product:variants:{variantId}:cost:{currency}":"{currency}成本價","product:variants:{variantId}:price:{currency}":"{currency}售賣價格","product:variants:{variantId}:original_price:{currency}":"{currency}原價","product:variants:{variantId}:purchase_type":"銷售類型","product:variants:{variantId}:sell_start_date":"開始時間","product:variants:{variantId}:sell_end_date":"結束時間","product:variants:{variantId}:valid_start_dt":"有效期開始日期","product:variants:{variantId}:valid_end_dt":"有效期結束日期","product:variants:{variantId}:book_n_days_before_book_date":"有效期天数","product:variants:{variantId}:valid_start_time":"有效期開始時間","product:variants:{variantId}:valid_end_time":"有效期結束時間","product:variants:{variantId}:valid_time_interval":"有效期持續時間","product:variants:{variantId}:min_purchase_quantity":"最小購買數","product:variants:{variantId}:max_purchase_quantity":"最大購買數","product:options:{optionId}":"選項(ID:{optionId})","product:options:{optionId}:status":"狀態","product:options:{optionId}:option_sn":"選項sn","product:options:{optionId}:voucher_type":"兌換方式","product:options:{optionId}:option_start_date":"開始時間","product:options:{optionId}:option_end_date":"結束時間","product:options:{optionId}:book_date_required":"指定日期","product:options:{optionId}:limited_each_user":"單用戶限制","product:options:{optionId}:details:{lang}":"{lang}詳情","product:options:{optionId}:details:{lang}:meta:brief":"簡介","product:options:{optionId}:details:{lang}:title":"標題","product:options:{optionId}:sub_options:{suboptionId}":"子選項(ID:{suboptionId})","product:options:{optionId}:sub_options:{suboptionId}:status":"狀態","product:options:{optionId}:sub_options:{suboptionId}:cost:{currency}":"{currency}成本價","product:options:{optionId}:sub_options:{suboptionId}:price:{currency}":"{currency}售賣價格","product:options:{optionId}:sub_options:{suboptionId}:original_price:{currency}":"{currency}原價","product:options:{optionId}:sub_options:{suboptionId}:min_book_days":"最少預訂天數","product:options:{optionId}:sub_options:{suboptionId}:cancel_n_days_before_book_date":"提前取消天數","product:options:{optionId}:sub_options:{suboptionId}:book_n_days_before_book_date":"提前預訂天數","product:options:{optionId}:sub_options:{suboptionId}:max_quantity_per_sub_option":"最多數量","product:options:{optionId}:sub_options:{suboptionId}:min_purchase_quantity":"最小購買數","product:options:{optionId}:sub_options:{suboptionId}:max_purchase_quantity":"最大購買數","product:options:{optionId}:sub_options:{suboptionId}:limited_each_user":"單用戶限制","product:options:{optionId}:sub_options:{suboptionId}:details":"標題","product:warehouse":"倉庫","product:categories":"類別","order:status":"狀態","order:total_amount":"小計","order:requested_amount":"需支付的金額","order:paid_amount":"支付金額","order:discounted_amount":"優惠","order:refunded_amount":"已退款金額","order:refunding_amount":"退款中金額","order:delivery_amount":"運費","order:coupon_discounted_amount":"優惠券折扣金額","order:secret":"交易流水號","order:trade_type":"領取方式","order:remark_to_customer":"給用戶留言","order:note":"備註","order:payment_method":"支付方式","order:bookings:{bookingId}":"預訂單(ID:{bookingId})","order:bookings:{bookingId}:status":"狀態","order:bookings:{bookingId}:sn":"預訂單ID","order:bookings:{bookingId}:track_number":"物流編號","order:bookings:{bookingId}:courier_company":"物流公司","order:bookings:{bookingId}:total_amount":"小計","order:bookings:{bookingId}:refunded_amount":"已退款金额,","order:bookings:{bookingId}:refunding_amount":"退款中金額","order:bookings:{bookingId}:voucher":"憑證","order:bookings:{bookingId}:customer_request":"備註","order:bookings:{bookingId}:confirmation_info":"信息確認","order:bookings:{bookingId}:note":"備註","tagsystem:synonyms":"同義詞","tagsystem:sn":"標籤ID","tagsystem:status":"狀態","tagsystem:supporting_provider":"內部平台&外部平台","tagsystem:ai_trigger":"AI識別","poi:status":"狀態","poi:flan":"優先級&評分","poi:category":"類型","poi:supporting_provider":"供應商","poi:price_range":"人均消費&基準幣種","poi:support_reservation":"预约","poi:position":"位置","poi:searchable_tags":"標籤","poi:details:{lang}":"{lang}詳情","poi:details:{lang}:title":"標題","poi:details:{lang}:meta:name":"產品名稱","poi:details:{lang}:meta:description":"詳細描述","poi:details:{lang}:meta:rules":"使用規則","poi:details:{lang}:meta:use_range":"使用範圍","poi:details:{lang}:meta:use_time":"使用時間",true:"是",false:"否","Theme setup":"主題頁設置","Theme color":"主題頁顏色","Navigation background color":"導航背景顏色","Navigation font color":"導航字體顏色","Maximum 4 coupons":"最多添加4張優惠券","Event name":"活動名稱","PC - 1960*600px JPG JPEG only || Design focus 1200*400px || <500KB":"電腦端:1960*600px 僅支援JPG JPEG || 設計關注區 1200*400px || <500KB","Mobile - 1125*1500px JPG JPEG only || Design focus 1125*900px || <500KB":"移動端:1125*1500px 僅支援JPG JPEG || 設計關注區 1125*900px || <500KB",Section:"類目","Section title":"類目名稱","Section images":"類目圖片","PC - 1200*60px JPG JPEG only || <500KB":"電腦端:1200*60px 僅支援JPG JPEG|| 設計關注區 1200*40px || <500KB","Mobile - 1125*180 JPG JPEG only || <500KB":"移動端:1125*180px 僅支援JPG JPEG|| 設計關注區 1125*90px || <500KB","Add section":"新增類目","Section type":"類目類型","Other detail":"新增類目",Coupons:"優惠券","Copy link":"複製鏈接",Itin_supplier:"行程供應商",Itin_supplier_UID:"行程編號","Buy limit per ACCT":"帳戶購買限制","Max buy per ACCT":"帳戶最大購買","Restricted period":"限購時間","Can not greater than maximun purchase per account":"不能超過賬戶最大購買數","Can not less than max buy":"不能小於子選項的最多購買數","Can not less than max buy2":"不能小於最大購買數",'Please use "xx.xxxx, yy.yyyy" format to enter longitude and latitude':"請依照 “xx.xxxx, yy.yyyy“ 格式輸入經緯度","Copied name successfully":"名稱複製成功","Copied SN successfully":"SN複製成功","Refund note":"退款備註",Windows:"Windows",macOS:"macOS","Other-Desktop":"其它-電腦",Android:"安卓",iOS:"iOS","Other-Mobile":"其它-手機",Device:"設備","WeChat pay":"微信支付","WeChat official account":"微信支付-公衆號","WeChat mini program":"微信支付-小程序","Alipay web":"支付寶網頁版","Alipay mobile":"支付寶移動端","Alipay HK web":"支付寶香港網頁版","Alipay HK mobile":"支付寶香港移動端",Paypal:"Paypal",Payme:"Payme","Credit card":"信用卡","Overdue status":"過期狀態","Expire in a week":"一周內即將過期",Amount:"數量","Promotion ID":"活動ID","Promotion prd":"活動時間","Rights(Mylink points)":"權益(Mylink積分)","Rewards method":"獎勵方式","Every Booking":"每個預訂單","Follow Payment Price":"跟隨支付金額","for every":"每",Price:"價格","Promotion date":"活動時間","Promotion name":"活動名稱","{num} Mylink points have sent to user, please be careful with refunds":"{num}點MyLink點數已送出,請留意退換貨","Time selection":"可選擇時間","Bulk upload":"批量上傳","Customer note":"啓用客戶備註","Customer note no show":"不顯示","Customer note show":"顯示","Display tag":"展示標籤",Synchronize:"同步","Mylink point promo id":"Mylink積分促銷id","What to Expect":"產品重點",Details:"詳細介紹",Inclusions:"費用包含",Exclusions:"費用不包含","Instant Confirmation":"即買即用","Mobile Voucher":"電子門票","Hotel Pick Up":"酒店領取","Skip the Line":"免排隊","Free Cancellation":"免費退","Free Parking":"免停車費","Open Dated Voucher":"任選日期","Audio Guide":"語音導覽","Wheel Chair Accessible":"身障友好","Best Seller":"銷售最佳","Exclusive Travelflan Offer":"TF專享","COVID-19 Safety Measures":"COVID防疫等級","Valid during EID Holidays":"EID節日可用","Authorised Reseller":"授權商","Official Reseller":"官方合作","500+ Bought":"500+已售","1K+ Bought":"1K+已售","1.5K+ Bought":"1.5K+已售","2K+ Bought":"2K+已售","3K+ Bought":"3K+已售","Keyword setting title":"搜索關鍵字主題","Keyword setting description":"搜索關鍵字簡介",Active:"有效",Deactive:"無效","Related booking":"相关預訂單",Deactivated:"不可售","Upload voucher":"上传憑證","Only support PDF format and < 10MB":"只支持 PDF 格式,並且小於10MB","Upload voucher option is required":"上传憑證的选项必填","Upload voucher suboption is required":"上传憑證的子选项必填",reselect:"重新選擇",invalidated:"無效",Invalidate:"無效","Sure to invalidat voucher":"確定要使憑證無效吗",Deliver:"發貨",Delivered:"已發貨","Voucher type":"憑證類型",File:"文件",Link:"鏈接","Image link":"跳轉鏈接",Goods:"商品","Not ready":"未準備好","Ready to pick up":"準備好自取","Pick up note":"自取備註","Enter note":"輸入備註",Replace:"替換","Delivery option":"發貨選項","Apply to all related bookings in this order":"適用于訂單裏其他關聯的預訂","One Image":"1張圖","Two Image":"2張圖","Three Image":"3張圖",Cost:"成本價","Show in navigation":"是否在導航裡顯示","Send date":"發送日期","Booking paid time":"訂單支付時間","Point send time":"積分發送時間","Payment completed time":"訂單完成時間","No Promotion":"無積分","Payment Incomplete":"訂單未完成","Send Processing":"待發送","Send Success":"發送成功","Send Fail":"發送失敗"},Sk=a("f0d9"),xk=a.n(Sk),Tk=a("b2d6"),Dk=a.n(Tk),Pk=a("c87b"),Ok=a.n(Pk);S["default"].use(Ck["a"]);var Ik={en_US:Object(F["a"])(Object(F["a"])({},kk),Dk.a),zh_CN:Object(F["a"])(Object(F["a"])({},wk),xk.a),zh_HK:Object(F["a"])(Object(F["a"])({},$k),Ok.a)},Rk="",Ek=window.localStorage.getItem("locale");Ek&&Object.keys(Ik).forEach((function(e){Ek.toLowerCase()===e.toLowerCase()&&(Rk=e)})),Rk||(Rk="en_US");var Mk=new Ck["a"]({locale:Rk,messages:Ik}),Nk=Mk,jk={install:function(e){e.prototype.$api=Qr}},Ak={install:function(e){e.prototype.$env=ga}},Lk={install:function(e){e.filter("date",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return e?Vt()(e).format(t):""})),e.filter("autoDate",(function(e){if(!e)return"";var t=Vt()(e),a=Vt()(),n="YYYY-MM-DD HH:mm";return t.isSame(a,"year")&&(n="MM-DD HH:mm"),t.isSame(a,"day")&&(n="HH:mm"),Vt()(e).format(n)})),e.filter("lang",(function(e,t,a){if(!e)return"";var n=null;return n=void 0!==e[t]?e[t]:e[t]||e.zh_HK||e.en_US||e.zh_CN||e.ko_KR,n&&a&&(n=n[a]),n})),e.filter("capitalize",(function(e){return e?(e=e.toString(),e.charAt(0).toUpperCase()+e.slice(1)):""})),e.filter("formattedCode",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!e)return e;e+="",t<1&&(t=4);for(var a=e.split(""),n=Math.floor((e.length-1)/t);n>-1;n--)a.splice(n*t,0," ");return a.join("")}))}},Fk=(a("841c"),{install:function(e){e.directive("plaintext",{bind:function(e,t,a){var n=e.innerText;if(t.modifiers&&t.modifiers.search&&t.value){var r=new RegExp("(".concat(t.value,")"),"ig");n=n.replace(r,'$1')}e.innerHTML=n}})}}),Uk=a("4ae6"),zk=a.n(Uk),qk={install:function(e){e.use(jk),e.use(Ak),e.use(Lk),e.use(Fk),e.use(zk.a)}};S["default"].use(T.a,{i18n:function(e,t){return Nk.t(e,t)}}),S["default"].use(qk),Object.defineProperty(S["default"].prototype,"$moment",{value:Vt.a});var Hk=localStorage.setItem;localStorage.setItem=function(e,t){var a=new Event("setItemEvent");a.newValue=t,a.key=e,window.dispatchEvent(a),Hk.apply(this,arguments)},S["default"].config.productionTip=!1,new S["default"]({router:OC,store:yk,i18n:Nk,render:function(e){return e(M)}}).$mount("#app")},"577ed":function(e,t,a){"use strict";a("167c")},"579c":function(e,t,a){"use strict";a("2a8b")},5801:function(e,t,a){"use strict";a("77a2")},"58a5":function(e,t,a){},5930:function(e,t,a){},"5c0b":function(e,t,a){"use strict";a("9c0c")},"61c1":function(e,t,a){"use strict";a("2a57")},"62e6":function(e,t,a){},"644b":function(e,t,a){},"657c":function(e,t,a){},"66db":function(e,t,a){"use strict";a("28cd")},6742:function(e,t,a){"use strict";a("e9b1")},6876:function(e,t,a){},6899:function(e,t,a){"use strict";a("a540")},"68c2":function(e,t,a){"use strict";a("bbba")},"69ae":function(e,t,a){"use strict";a("addc")},"69cf":function(e,t,a){},"6a37":function(e,t,a){},"6ae3":function(e,t,a){},"6b36":function(e,t,a){"use strict";a("a1d5")},"6b3d":function(e,t,a){"use strict";a("b078")},"6cd7":function(e,t,a){},"6db8":function(e,t,a){"use strict";a("a6f7")},"6e33":function(e,t,a){},"6ed3":function(e,t,a){"use strict";a("2141")},"6f2f":function(e,t,a){"use strict";a("8845")},"6f6d":function(e,t,a){"use strict";a("51e8")},"6f74":function(e,t,a){"use strict";a("1edc")},7232:function(e,t,a){},"72e7":function(e,t,a){"use strict";a("d32a")},"73ba":function(e,t,a){"use strict";a("0d6f")},"73ef":function(e,t,a){},"73fe":function(e,t,a){"use strict";a("1cfc")},7456:function(e,t,a){"use strict";a("fb1c")},"746a":function(e,t,a){"use strict";a("9946")},"74c1":function(e,t,a){"use strict";a("2edb")},"74c4":function(e,t,a){},7625:function(e,t,a){"use strict";a("dd1d")},"77a2":function(e,t,a){},"77d4":function(e,t,a){},7858:function(e,t,a){},"788d":function(e,t,a){"use strict";a("12f4")},7936:function(e,t,a){},"7b7e":function(e,t,a){"use strict";a("aec7")},"7b84":function(e,t,a){"use strict";a("e778")},"7bf8":function(e,t,a){"use strict";a("62e6")},"7caa":function(e,t,a){"use strict";a("93d0")},"7d7a":function(e,t,a){},"7d8b":function(e,t,a){"use strict";a("0519")},"7e94":function(e,t,a){},"7eff":function(e,t,a){"use strict";a("3c04")},"812a":function(e,t,a){"use strict";a("f794")},"817f":function(e,t,a){},8198:function(e,t,a){"use strict";a("bb91")},"827c":function(e,t,a){},8402:function(e,t,a){"use strict";a("4577")},8473:function(e,t,a){"use strict";a("e9cd")},"872f":function(e,t,a){"use strict";a("c4d5")},"87a0":function(e,t,a){},"87e9":function(e,t,a){},8845:function(e,t,a){},"88d4":function(e,t,a){},8973:function(e,t,a){"use strict";a("1c98")},"899a":function(e,t,a){},"89cd":function(e,t,a){"use strict";a("f131")},"89de":function(e,t,a){},"89e1":function(e,t,a){"use strict";a("4f5c")},"8a53":function(e,t,a){},"8aa2":function(e,t,a){},"8b0a":function(e,t,a){"use strict";a("5373")},"8cb9":function(e,t,a){"use strict";a("7936")},"8e0b":function(e,t,a){},"8e9b":function(e,t,a){"use strict";a("fdb0")},"8f0b":function(e,t,a){"use strict";a("da9d")},"8f15":function(e,t,a){"use strict";a("ca74")},9012:function(e,t,a){},9231:function(e,t,a){"use strict";a("0b9e")},"93d0":function(e,t,a){},"94c8":function(e,t,a){},"94ef":function(e,t,a){"use strict";a("87a0")},"955c":function(e,t,a){"use strict";a("ffcd")},"95de":function(e,t,a){"use strict";a("d450")},"98e3":function(e,t,a){"use strict";a("817f")},9946:function(e,t,a){},"9b4a":function(e,t,a){"use strict";a("315f")},"9bb8":function(e,t,a){},"9c0c":function(e,t,a){},"9c7e":function(e,t,a){"use strict";a("bdff")},"9c9a":function(e,t,a){"use strict";a("d009")},"9cef":function(e,t,a){},"9de2":function(e,t,a){"use strict";a("6a37")},"9e90":function(e,t,a){"use strict";a("1358")},"9f87":function(e,t,a){},"9fac":function(e,t,a){"use strict";a("ea04")},a015:function(e,t,a){},a185:function(e,t,a){},a1d5:function(e,t,a){},a222:function(e,t,a){"use strict";a("9f87")},a421:function(e,t,a){"use strict";a("dd62")},a540:function(e,t,a){},a6f7:function(e,t,a){},a90e:function(e,t,a){},aad4:function(e,t,a){},abb2:function(e,t,a){},abfd:function(e,t,a){"use strict";a("39e3")},adcb:function(e,t,a){"use strict";a("8e0b")},addc:function(e,t,a){},aec7:function(e,t,a){},af64:function(e,t,a){},afa5:function(e,t,a){"use strict";a("27f9")},afd0:function(e,t,a){"use strict";a("52e5")},b025:function(e,t,a){"use strict";a("9012")},b078:function(e,t,a){},b0e9:function(e,t,a){},b126:function(e,t,a){"use strict";a("414c")},b1cb:function(e,t,a){"use strict";a("d1f1")},b80e:function(e,t,a){"use strict";a("5455")},ba7e:function(e,t,a){},bb91:function(e,t,a){},bba4:function(e,t,a){"use strict";a("7e94")},bbba:function(e,t,a){},bdff:function(e,t,a){},be66:function(e,t,a){"use strict";a("3429")},bf1d:function(e,t,a){"use strict";a("39e1")},bf60:function(e,t,a){"use strict";a("6cd7")},c034:function(e,t,a){"use strict";a("c11f")},c053:function(e,t,a){},c11f:function(e,t,a){},c474:function(e,t,a){},c488:function(e,t,a){"use strict";a("1092")},c4d5:function(e,t,a){},c4f3:function(e,t,a){"use strict";a("fdfd")},c5b1:function(e,t,a){},c876:function(e,t,a){"use strict";a("6e33")},c87c:function(e,t,a){},c9cb:function(e,t,a){},ca1f:function(e,t,a){"use strict";a("94c8")},ca74:function(e,t,a){},cadd:function(e,t,a){"use strict";a("524f")},cbcf:function(e,t,a){"use strict";a("d11f")},cbdf:function(e,t,a){"use strict";a("0765")},cd0e:function(e,t,a){},ce83:function(e,t,a){"use strict";a("f2ae")},ceb4:function(e,t,a){},cfee:function(e,t,a){"use strict";a("f04e")},d006:function(e,t,a){"use strict";a("c053")},d009:function(e,t,a){},d0a5:function(e,t,a){},d0cf:function(e,t,a){"use strict";a("d81f")},d11f:function(e,t,a){},d1f1:function(e,t,a){},d240:function(e,t,a){"use strict";a("d4cb")},d2bf:function(e,t,a){"use strict";a("1599")},d32a:function(e,t,a){},d40a:function(e,t,a){"use strict";a("c9cb")},d444:function(e,t,a){"use strict";a("1fbe")},d450:function(e,t,a){},d4cb:function(e,t,a){},d6ed:function(e,t,a){"use strict";a("69cf")},d81f:function(e,t,a){},da9d:function(e,t,a){},dbf4:function(e,t,a){"use strict";a("3199")},dd1d:function(e,t,a){},dd62:function(e,t,a){},dd629:function(e,t,a){"use strict";a("af64")},ddda:function(e,t,a){},df9b:function(e,t,a){"use strict";a("58a5")},e062:function(e,t,a){},e07d:function(e,t,a){"use strict";a("2d12")},e115:function(e,t,a){"use strict";a("02ba")},e43e:function(e,t,a){"use strict";a("ea75")},e576:function(e,t,a){"use strict";a("0630")},e5eb:function(e,t,a){"use strict";a("0850")},e73b:function(e,t,a){},e770:function(e,t,a){"use strict";a("89de")},e778:function(e,t,a){},e85d:function(e,t,a){"use strict";a("e73b")},e909:function(e,t,a){"use strict";a("b0e9")},e9b1:function(e,t,a){},e9cd:function(e,t,a){},ea04:function(e,t,a){},ea75:function(e,t,a){},ea8b:function(e,t,a){"use strict";a("74c4")},ed23:function(e,t,a){},ee23:function(e,t,a){"use strict";a("cd0e")},eec7:function(e,t,a){},ef0d:function(e,t,a){"use strict";a("abb2")},efcf:function(e,t,a){"use strict";a("87e9")},efd0:function(e,t,a){"use strict";a("5930")},f028:function(e,t,a){},f04e:function(e,t,a){},f0a1:function(e,t,a){"use strict";a("eec7")},f131:function(e,t,a){},f2ae:function(e,t,a){},f657:function(e,t,a){},f68f:function(e,t,a){"use strict";a("3e9f")},f6ea:function(e,t,a){"use strict";a("ba7e")},f794:function(e,t,a){},f875:function(e,t,a){"use strict";a("aad4")},f879:function(e,t,a){},f8b7:function(e,t,a){},f9b1:function(e,t,a){},fa5e:function(e,t,a){"use strict";a("ed23")},fb1c:function(e,t,a){},fdb0:function(e,t,a){},fdfd:function(e,t,a){},fe3f:function(e,t,a){},fefb:function(e,t,a){},ffba:function(e,t,a){e.exports=a.p+"img/logo@2x.586e9da6.png"},ffcd:function(e,t,a){}});