1webpackJsonp([2],{"+pb+":function(e,t,r){"use strict";var n=r("rCTf"),o=r("xAJs");n.Observable.prototype.map=o.map},"/cFU":function(e,t,r){var n,o;n=[r,t,r("lHK6"),r("JDN0"),r("oQ8U")],void 0!==(o=function(e,t,r,n,o){"use strict";function a(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function c(e){return void 0===e&&(e=""),n(e)?r(e)?(o.log(s,"queryString is Empty"),a()+window.location.pathname):(e=e.replace(/^\?/,""),a()+window.location.pathname+"?"+e):(o.log(s,"queryString is not a String"),a()+window.location.pathname)}function i(e){void 0===e&&(e="");var t=new RegExp(/(^http|^\/hktv\/zh|^\/hktv\/zh)/),n="/hktv/"+hktvCommon.env.currentLanguage+"/";return r(e)?n:t.test(e)?e:n+("/"==e.substring(0,1)?e.substring(1):e)}Object.defineProperty(t,"__esModule",{value:!0});var s="[UriUtils] ";t.getLocationOrigin=a,t.getURL=c,t.getHktvUrlPrefix=i}.apply(t,n))&&(e.exports=o)},"/t1l":function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("BUAs"),r("GiK3"),r("VY30"),r("FrIH"),r("2CZX"),r("/cFU")],void 0!==(o=function(e,t,r,n,o,c,i,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.render=function(){var e=this.props,t=e.list,a=e.message,u=e.onClickAction;return n.createElement("div",{className:"StoreSearch"},n.createElement("div",{className:"StoreSearch-title"},a),n.createElement("div",{className:"StoreSearch-list"},n.createElement(c.default,{cols:4,overflow:"hidden"},t.map(function(e,t){var a=e.link&&/^https?:\/\//.test(e.link),c=a?e.link:s.getHktvUrlPrefix("s/"+e.code),l=function(){return u(r({},o.RecentSearchObjectDefault,{type:"store",code:e.code,name:e.alt,link:e.link,eventAction:"suggested_stores"}))};return n.createElement(i.UIWrapper,{padding:"0",key:"StoreSearchItem_"+e.code.toString()},n.createElement("a",{className:"StoreSearchItem",href:c,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,onClick:l},e.url?n.createElement("img",{src:decodeURIComponent(e.url),alt:e.alt}):n.createElement("span",{className:"StoreSearchItem-name"},e.alt)))}))))},t}(n.PureComponent);t.default=u}.apply(t,n))&&(e.exports=o)},"2BLD":function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),c=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};n=[r,t,r("BUAs"),r("GiK3"),r("2KeS"),r("RH2O"),r("igqX"),r("N+5n"),r("O27J"),r("Y0d7"),r("EEm8"),r("9UTb"),r("qOUa"),r("MrHX"),r("Avmo")],void 0!==(o=function(e,t,r,n,o,i,s,u,l,p,d,h,f,m,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var g=function(e){function t(t){var n=e.call(this,t)||this,a=s.default(),c=u.createEpicMiddleware(y.default);return n.store=o.createStore(h.todoApp,r({},h.initialState,{recentDataList:p.loadLocalStorageRecentSearch()}),f.composeStoreEnhancers(c,a)),a.run(m.default),n}return a(t,e),t.prototype.componentDidCatch=function(e,t){},t.prototype.render=function(){return n.createElement(i.Provider,{store:this.store},n.createElement(d.default,c({},this.props)))},t}(n.Component),v=n.createElement(g,SuggestionSearchData);l.render(v,document.getElementById("search-box"))}.apply(t,n))&&(e.exports=o)},"2CZX":function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("GiK3")],void 0!==(o=function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.render=function(){return r.createElement("span",{className:"ui-wrapper",style:{display:"inline-block",padding:this.props.padding,margin:this.props.margin,backgroundColor:this.props.backgroundColor}},this.props.children)},t.defaultProps={padding:0,margin:0,backgroundColor:"transparent"},t}(r.Component);t.UIWrapper=n}.apply(t,n))&&(e.exports=o)},"9UTb":function(e,t,r){var n,o,a=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};n=[r,t,r("O84L")],void 0!==(o=function(e,t,r){"use strict";function n(e,n){switch(void 0===e&&(e=t.initialState),n.type){case r.TOGGLE_LIST:return a({},e,{index:n.index});case r.ADD_RECENT:return a({},e,{recentDataList:n.recentDataList});case r.UPDATE_SUGGESTION:return a({},e,{storeDataList:n.storeDataList,productDataList:n.productDataList,keywordDataList:n.keywordDataList,keywordSuggestDataList:n.keywordSuggestDataList,keyword:n.keyword});case r.ADD_STORE:return a({},e,{storeDataList:n.storeDataList});case r.ADD_PRODUCT:return a({},e,{productDataList:n.productDataList});case r.ADD_KEYWORD:return a({},e,{keywordDataList:n.keywordDataList});case r.SET_TOTAL_RESULTNUM:if(e.totalResultNum!=n.totalResultNum)return a({},e,{totalResultNum:n.totalResultNum});default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.initialState={index:0,totalResultNum:0,recentDataList:[],storeDataList:[],productDataList:[],keywordDataList:[],keywordSuggestDataList:[],keyword:""},t.todoApp=n}.apply(t,n))&&(e.exports=o)},Avmo:function(e,t,r){var n,o;n=[r,t,r("hYBY"),r("O84L"),r("Y0d7"),r("HcJ8"),r("+pb+")],void 0!==(o=function(e,t,r,n,o){"use strict";function a(){if(hktvCommon.env.isKWSCustomerGroup)return!1;var e=parseInt(hktvCommon.env.kwsWebParallelRunConfig,10);return 2===e||1===e&&hktvCommon.env.loggedin}function c(e){return a()&&KeywordSearchAdapter.sendSuggestRequest(e).catch(function(){}),AlgoliaSearchAdapter.sendSuggestRequest(e).then(function(e){return o.parseSuggestionData(e)}).catch(function(e){return[]})}function i(e){return KeywordSearchAdapter.sendSuggestRequest(e).catch(function(e){return[]})}function s(e){return n.updateSearchSuggestion(e.storeDataList,e.productDataList,e.keywordDataList,e.keywordSuggestDataList,e.keyword)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e,t){return e.ofType(n.START_SUGGESTION).mergeMap(function(e){return r.PromiseObservable.create(hktvCommon.env.isKWSCustomerGroup?i(e.keyword):c(e.keyword)).map(function(e){return s(e)})})};t.default=u}.apply(t,n))&&(e.exports=o)},EEm8:function(e,t,r){var n,o;n=[r,t,r("RH2O"),r("O84L"),r("Y0d7"),r("li0y")],void 0!==(o=function(e,t,r,n,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){return{toggleIndex:e.index,totalResultNum:e.totalResultNum,recentDataList:e.recentDataList,storeDataList:e.storeDataList,productDataList:e.productDataList,keywordDataList:e.keywordDataList,keywordSuggestDataList:e.keywordSuggestDataList,keyword:e.keyword}},i=function(e){return{dispatch:e,updateSearchSuggestionWithDispatch:function(t,r,o,a,c){e(n.updateSearchSuggestion(t,r,o,a,c))},saveRecentHistoryWithDispatch:function(t){o.saveLocalStorageRecentSearch(t),e(n.addRecent(t))}}},s=r.connect(c,i)(a.UIRecentSuggestionSearch);t.default=s}.apply(t,n))&&(e.exports=o)},FrIH:function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("GiK3")],void 0!==(o=function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.render=function(){var e=this,t=["ui-grid-view",this.props.className].join(" ");return r.createElement("ul",{className:t,style:{display:"block"}},r.Children.map(this.props.children,function(t,n){return r.createElement("li",{key:n,style:{display:"inline-block",width:100/e.props.cols+"%",overflow:e.props.overflow}},t)}))},t.defaultProps={overflow:"auto",className:""},t}(r.Component);t.default=n}.apply(t,n))&&(e.exports=o)},HcJ8:function(e,t,r){"use strict";var n=r("rCTf"),o=r("XO5T");n.Observable.prototype.mergeMap=o.mergeMap,n.Observable.prototype.flatMap=o.mergeMap},LYcC:function(e,t,r){var n,o;n=[r,t,r("GiK3")],void 0!==(o=function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.color||"#333333";return r.createElement("svg",{id:"rubbish_bin",className:"rubbish_bin",width:"13px",height:"13px",viewBox:"0 0 9 11",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},r.createElement("g",{transform:"translate(-43.000000, -47.000000)",fill:t},r.createElement("path",{d:"M47.8125,56.28125 L47.8125,50.4375 C47.8125,50.2475781 47.9665,50.09375 48.15625,50.09375 C48.3461719,50.09375 48.5,50.2475781 48.5,50.4375 L48.5,56.28125 C48.5,56.471 48.3461719,56.625 48.15625,56.625 C47.9665,56.625 47.8125,56.471 47.8125,56.28125 M45.75,56.28125 L45.75,50.4375 C45.75,50.2475781 45.904,50.09375 46.09375,50.09375 C46.2836719,50.09375 46.4375,50.2475781 46.4375,50.4375 L46.4375,56.28125 C46.4375,56.471 46.2836719,56.625 46.09375,56.625 C45.904,56.625 45.75,56.471 45.75,56.28125 M45.921875,47 C45.732125,47 45.578125,47.1538281 45.578125,47.34375 L45.578125,48.375 L43.34375,48.375 C43.154,48.375 43,48.5288281 43,48.71875 C43,48.9085 43.154,49.0625 43.34375,49.0625 L43.6875,49.0625 L43.6875,57.65625 C43.6875,57.8461719 43.8415,58 44.03125,58 L50.21875,58 C50.4086719,58 50.5625,57.8461719 50.5625,57.65625 L50.5625,49.0625 L50.90625,49.0625 C51.0961719,49.0625 51.25,48.9085 51.25,48.71875 C51.25,48.5288281 51.0961719,48.375 50.90625,48.375 L48.671875,48.375 L48.671875,47.34375 C48.671875,47.1538281 48.5180469,47 48.328125,47 L45.921875,47 Z"}))))};t.default=n}.apply(t,n))&&(e.exports=o)},MrHX:function(e,t,r){var n,o,a=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(c=a[2&r[0]?"return":r[0]?"throw":"next"])&&!(c=c.call(a,r[1])).done)return c;switch(a=0,c&&(r=[0,c.value]),r[0]){case 0:case 1:c=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,a=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(c=s.trys,!(c=c.length>0&&c[c.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!c||r[1]>c[0]&&r[1]<c[3])){s.label=r[1];break}if(6===r[0]&&s.label<c[1]){s.label=c[1],c=r;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(r);break}c[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],a=0}finally{o=c=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var o,a,c,i,s={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]};return i={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i};n=[r,t,r("egdi"),r("O84L")],void 0!==(o=function(e,t,r,n){"use strict";function o(){return"undefined"!=typeof algoliaTotalSkuCount?algoliaTotalSkuCount:0}function c(){var e;return a(this,function(t){switch(t.label){case 0:return[4,r.call(o)];case 1:return e=t.sent(),[4,r.put(n.setTotalProductNum(e))];case 2:return t.sent(),[2]}})}function i(){return a(this,function(e){switch(e.label){case 0:return[4,r.takeEvery(n.GET_TOTAL_RESULTNUM,c)];case 1:return e.sent(),[2]}})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i}.apply(t,n))&&(e.exports=o)},O4Lo:function(e,t,r){function n(e,t,r){function n(t){var r=v,n=S;return v=S=void 0,L=t,w=e.apply(n,r)}function l(e){return L=e,E=setTimeout(h,t),b?n(e):w}function p(e){var r=e-k,n=e-L,o=t-r;return D?u(o,_-n):o}function d(e){var r=e-k,n=e-L;return void 0===k||r>=t||r<0||D&&n>=_}function h(){var e=a();if(d(e))return f(e);E=setTimeout(h,p(e))}function f(e){return E=void 0,R&&v?n(e):(v=S=void 0,w)}function m(){void 0!==E&&clearTimeout(E),L=0,v=k=S=E=void 0}function y(){return void 0===E?w:f(a())}function g(){var e=a(),r=d(e);if(v=arguments,S=this,k=e,r){if(void 0===E)return l(k);if(D)return E=setTimeout(h,t),n(k)}return void 0===E&&(E=setTimeout(h,t)),w}var v,S,_,w,E,k,L=0,b=!1,D=!1,R=!0;if("function"!=typeof e)throw new TypeError(i);return t=c(t)||0,o(r)&&(b=!!r.leading,D="maxWait"in r,_=D?s(c(r.maxWait)||0,t):_,R="trailing"in r?!!r.trailing:R),g.cancel=m,g.flush=y,g}var o=r("yCNF"),a=r("RVHk"),c=r("kxzG"),i="Expected a function",s=Math.max,u=Math.min;e.exports=n},O84L:function(e,t,r){var n,o;n=[r,t],void 0!==(o=function(e,t){"use strict";function r(e){return{type:t.TOGGLE_LIST,index:e}}function n(e){return{type:t.ADD_RECENT,recentDataList:e}}function o(e){return{type:t.START_SUGGESTION,keyword:e}}function a(e,r,n,o,a){return{type:t.UPDATE_SUGGESTION,storeDataList:e,productDataList:r,keywordDataList:n,keywordSuggestDataList:o,keyword:a}}function c(e){return{type:t.ADD_STORE,storeDataList:e}}function i(e){return{type:t.ADD_PRODUCT,productDataList:e}}function s(e){return{type:t.ADD_KEYWORD,keywordDataList:e}}function u(){return{type:t.GET_TOTAL_RESULTNUM}}function l(e){return{type:t.SET_TOTAL_RESULTNUM,totalResultNum:e}}
1Object.defineProperty(t,"__esModule",{value:!0}),t.ADD_RECENT="ADD_RECENT",t.START_SUGGESTION="START_SUGGESTION",t.UPDATE_SUGGESTION="UPDATE_SUGGESTION",t.ADD_STORE="ADD_STORE",t.ADD_PRODUCT="ADD_PRODUCT",t.ADD_KEYWORD="ADD_KEYWORD",t.GET_TOTAL_RESULTNUM="GET_TOTAL_RESULTNUM",t.SET_TOTAL_RESULTNUM="SET_TOTAL_RESULTNUM",t.TOGGLE_LIST="TOGGLE_LIST",t.toggleList=r,t.addRecent=n,t.startSearchSuggestion=o,t.updateSearchSuggestion=a,t.addStore=c,t.addProduct=i,t.addKeyword=s,t.getTotalProductNum=u,t.setTotalProductNum=l}.apply(t,n))&&(e.exports=o)},RVHk:function(e,t,r){var n=r("TQ3y"),o=function(){return n.Date.now()};e.exports=o},T5ki:function(e,t,r){e.exports=r.p+"src/media/svg/searchBox/icStoreSearch.svg"},VY30:function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("GiK3"),r("BUAs"),r("LYcC")],void 0!==(o=function(e,t,n,o,c){"use strict";function i(e){return n.createElement(n.Fragment,null,e.name)}function s(e){return n.createElement(n.Fragment,null,e.name)}function u(e,t){return n.createElement(n.Fragment,null,n.createElement("span",{style:{paddingRight:5}},e.name),n.createElement("span",{style:{paddingRight:5}},t),n.createElement("span",{style:{color:"#237630"}},e.catname))}function l(e){return n.createElement(n.Fragment,null,e.name)}function p(e,t){switch(e.type){case"product":return s(e);case"keyword":return u(e,t);case"store":return l(e);case"keywordSuggest":case"normal":default:return i(e)}}function d(e){switch(e.type){case"store":return n.createElement("img",{id:"icStoreSearch",src:f});case"product":case"keyword":case"keywordSuggest":case"normal":default:return n.createElement("img",{id:"icKeywordSearch",src:h})}}Object.defineProperty(t,"__esModule",{value:!0});var h=r("xk0K"),f=r("T5ki");t.RecentSearchObjectDefault={type:"normal",code:"",name:"",catname:"",eventAction:"",link:""};var m=function(e){function t(t){var r=e.call(this,t)||this;return r.onMouseEnterBin=r.onMouseEnterBin.bind(r),r.onMouseLeaveBin=r.onMouseLeaveBin.bind(r),r.state={binIconColor:"#666666"},r}return a(t,e),t.prototype.onMouseEnterBin=function(e){this.setState({binIconColor:"#222222"})},t.prototype.onMouseLeaveBin=function(e){this.setState({binIconColor:"#666666"})},t.prototype.render=function(){var e=this.props,t=e.list,r=e.message,a=e.clearAllHistory,i=e.onClickAction;return n.createElement("div",{className:"RecentSearch"},n.createElement("div",{className:"RecentSearch-title"},n.createElement("span",null,r.title)),n.createElement("ul",{className:"RecentSearch-list"},t.map(function(e,t){return n.createElement("li",{key:"RecentSearchItem_"+t,className:"RecentSearchItem",onClick:function(){return i(o({},e,{eventAction:"history"}))}},d(e),n.createElement("div",null,p(e,r.in)))})),n.createElement("div",{className:"RecentSearch-clearAll",style:{textAlign:"right",padding:"8px 10px 8px 0"}},n.createElement("div",{className:"RecentSearch-clearButton",style:{cursor:"pointer",color:this.state.binIconColor},onClick:function(){return a()},onMouseEnter:this.onMouseEnterBin,onMouseLeave:this.onMouseLeaveBin},n.createElement(c.default,{color:this.state.binIconColor}),n.createElement("span",{style:{marginLeft:"5px"}},r.clearAll))))},t}(n.PureComponent);t.default=m}.apply(t,n))&&(e.exports=o)},XO5T:function(e,t,r){"use strict";function n(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),o.mergeMap(e,t,r)(this)}var o=r("ANGw");t.mergeMap=n},Y0d7:function(e,t,r){var n,o;n=[r,t,r("lHK6"),r("NGEn"),r("oQ8U")],void 0!==(o=function(e,t,r,n,o){"use strict";function a(e){void 0===e&&(e="zh"),t.LOCALE=e}function c(e){try{localStorage.setItem(f,JSON.stringify(e))}catch(e){}}function i(){if(r(localStorage.suggestionRecentRecord))return[];try{return JSON.parse(localStorage.suggestionRecentRecord)}catch(e){return localStorage.setItem(f,"[]"),o.error(e),[]}}function s(e){void 0===e&&(e="general");var t,r;switch(e){case"supermarket":t="#629b4d",r="#115b54";break;case"beautynhealth":t="#f47a95",r="#db4d6d";break;case"personalcarenhealth":t="#ff9100",r="#fa760f";break;case"mothernbaby":t="#60b4be",r="#076873";break;case"pets":t="#e35a1b",r="#d4542d";break;case"homenfamily":t="#49968e",r="#20554f";break;case"housewares":t="#B59D00",r="#3E3E23";break;case"deals":t="#ff6161",r="#c01a3c";break;case"sportsntravel":t="#a1df5a",r="#355f05";break;case"toysnbooks":t="#2079d9",r="#0e4e94";break;case"fashion":t="#969293",r="#595757";break;case"finance":t="#99353B",r="#51090E";break;case"disney":t="#222",r="#222";break;case"general":t="#237630",r="#115b54"}return{normal:t,hover:r}}function u(e){return{storeDataList:d(e),productDataList:h(e),keywordDataList:p(e),keywordSuggestDataList:l(e),keyword:e.keyword}}function l(e){var t=[];if(n(e.suggestKeywords)&&!r(e.suggestKeywords))for(var o=0;o<e.suggestKeywords.length;o++){var a={},c=e.suggestKeywords[o];a.keyword=e.keyword,a.code=c.code,a.name=c.code,t.push(a)}return t}function p(e){var o=[];if(n(e.categoryDepth1s)&&!r(e.categoryDepth1s))for(var a=0;a<e.categoryDepth1s.length;a++){var c={},i=e.categoryDepth1s[a];
1c.keyword=e.keyword,c.code=i.code,"en"==t.LOCALE?c.name=i.nameEn:c.name=i.nameZh,o.push(c)}return o}function d(e){var o=[];if(n(e.stores)&&!r(e.stores))for(var a=0;a<e.stores.length;a++){var c={},i=e.stores[a];c.code=i.code,c.url=i.imageUrl,"en"==t.LOCALE?(c.alt=i.nameEn,c.link=i.linkEn):(c.alt=i.nameZh,c.link=i.linkZh),o.push(c)}return o}function h(e){var o=[];if(n(e.products)&&!r(e.products))for(var a=0;a<e.products.length;a++){var c={},i=e.products[a];c.code=i.code,"en"==t.LOCALE?c.name=i.nameEn:c.name=i.nameZh,o.push(c)}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.LOCALE="zh";var f="suggestionRecentRecord";t.setLocale=a,t.saveLocalStorageRecentSearch=c,t.loadLocalStorageRecentSearch=i,t.setSearchButtonColor=s,t.parseSuggestionData=u,t.parseKeywordSuggestData=l,t.parseKeywordData=p,t.parseStoreData=d,t.parseProductData=h}.apply(t,n))&&(e.exports=o)},gLhK:function(e,t,r){var n,o;n=[r,t,r("oQ8U")],void 0!==(o=function(e,t,r){"use strict";function n(e){var t=e.getState;return function(e){return function(n){r.log(a+"["+c+"] Will dispatch:",n);var o=e(n);return r.log(a+"["+c+"] State after dispatch:",t()),c++,o}}}function o(e){e.getState;return function(e){return function(t){try{return e(t)}catch(e){throw r.error("Caught an exception!",e),e}}}}Object.defineProperty(t,"__esModule",{value:!0});var a="[ReduxLogger]",c=1;t.logger=n,t.crashReporter=o}.apply(t,n))&&(e.exports=o)},lHK6:function(e,t,r){function n(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||p(e)||c(e)))return!e.length;var t=a(e);if(t==d||t==h)return!e.size;if(l(e))return!o(e).length;for(var r in e)if(m.call(e,r))return!1;return!0}var o=r("/GnY"),a=r("gHOb"),c=r("1Yb9"),i=r("NGEn"),s=r("bGc4"),u=r("ggOT"),l=r("HT7L"),p=r("YsVG"),d="[object Map]",h="[object Set]",f=Object.prototype,m=f.hasOwnProperty;e.exports=n},li0y:function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("O4Lo"),r("lHK6"),r("BUAs"),r("GiK3"),r("Y0d7"),r("zYmO"),r("/cFU"),r("VY30"),r("VY30"),r("wL7K"),r("wL7K"),r("liDG"),r("/t1l"),r("wPMo"),r("O84L")],void 0!==(o=function(e,t,r,n,o,c,i,s,u,l,p,d,h,f,m,y,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var v=function(e){function t(t){var n=e.call(this,t)||this;return n.DEBUG="[SuggestionSearchBox]",n.recentSearchMsg={title:"",in:"",clearAll:""},n.searchRecentGAEventhandler=function(e,t){analytics.trackEventV2("search",e,t)},n.recommendedBrandGAHandler=function(e,t,r,n){var o=e||"general",a=t||"NA",c=r||"false",i=t||"NA",s=o+"_recommended_brand_shortcut";analytics.trackEventV2("search","recommended_brand",o+" | "+a+" | mabs_"+c),analytics.trackEcommercePromoClick(i,"",s,n+1),analytics.trackKafkaPromoClick("recommended_brand_shortcut",[{clickthrough_link:i||"",mabs_ref_id:r||"",promotion_name:"",creative_slot:n?n+1:0}])},n.state={isInputFocus:!1,isSearchButtonHover:!1,isInSearchBoxArea:!1,calledImpression:!1},n.keywordOnUrl=s.stringToJson(window.location.search.replace("?",""),void 0,void 0,!0).keyword||"",n.onChangeSearchInput=r(n.onChangeSearchInput.bind(n),400),i.setLocale(n.props.locale),n.clearAllRecentHistory=n.clearAllRecentHistory.bind(n),n.insertRecentHistory=n.insertRecentHistory.bind(n),n.proceedToSearchResultPage=n.proceedToSearchResultPage.bind(n),n}return a(t,e),t.prototype.componentDidMount=function(){this.dispatch(g.getTotalProductNum())},t.prototype.onChangeSearchInput=function(e){var t=0;n(e.trim())?t=1:(t=2,this.dispatch(g.startSearchSuggestion(e))),this.dispatch(g.toggleList(t))},t.prototype.onFocusSearchInput=function(e){var t=1;n(e)||(t=2),this.setState({isInputFocus:!0}),this.dispatch(g.toggleList(t))},t.prototype.onBlurSearchInput=function(){var e=this.state.isInSearchBoxArea;this.setState({isInputFocus:!1}),e||this.dispatch(g.toggleList(0))},t.prototype.onMouseEnterSearchButton=function(){this.setState({isSearchButtonHover:!0})},t.prototype.onMouseLeaveSearchButton=function(){this.setState({isSearchButtonHover:!1})},t.prototype.onMouseEnterSearchBoxArea=function(){this.setState({isInSearchBoxArea:!0})},t.prototype.onMouseLeaveSearchBoxArea=function(){this.setState({isInSearchBoxArea:!1})},t.prototype.onClickSearchButton=function(){if(!n(this.searchInput.value))if(Array.isArray(this.props.productDataList)&&this.props.productDataList.length>0)this.proceedToSearchResultPage(o({},p.RecentSearchObjectDefault,{type:"product",code:this.props.productDataList[0].code,name:this.props.productDataList[0].name,eventAction:"find"}));else{var e=this.searchInput.value;this.proceedToSearchResultPage(o({},p.RecentSearchObjectDefault,{name:e,eventAction:"find"}))}},t.prototype.onKeyPressSearchInput=function(e){if("enter"==e.key.toLocaleLowerCase()&&!n(e.currentTarget.value))if(Array.isArray(this.props.productDataList)&&this.props.productDataList.length>0)this.proceedToSearchResultPage(o({},p.RecentSearchObjectDefault,{type:"product",code:this.props.productDataList[0].code,name:this.props.productDataList[0].name,eventAction:"find"}));else{var t=e.currentTarget.value;this.proceedToSearchResultPage(o({},p.RecentSearchObjectDefault,{name:t,eventAction:"find"}))}},t.prototype.dispatch=function(e){this.props.dispatch(e)},t.prototype.updateSearchSuggestion=function(e){this.props.updateSearchSuggestionWithDispatch(i.parseStoreData(e),i.parseProductData(e),i.parseKeywordData(e),i.parseKeywordSuggestData(e),e.keyword)},t.prototype.clearAllRecentHistory=function(){this.props.saveRecentHistoryWithDispatch([]),this.searchRecentGAEventhandler("history_clear","NA")},t.prototype.insertRecentHistory=function(e){var t=this.props.recentDataList.filter(function(t){return!(t.name===e.name&&t.code===e.code)}).slice(0,7);t.unshift(e),i.saveLocalStorageRecentSearch(t)},t.prototype.proceedToSearchResultPage=function(e){this.insertRecentHistory(e);var t;switch(e.type){case"normal":if(t="search_a?keyword="+encodeURIComponent(e.name),this.props.keywordDataList[0]){t+="&bannerCategory="+this.props.keywordDataList[0].code}break;case"keyword":t="search_a/?keyword="+encodeURIComponent(e.name)+"&category="+e.code;break;case"keywordSuggest":t="search_a/?keyword="+encodeURIComponent(e.name);break;case"product":t="p/"+e.code;break;case"store":t="s/"+e.code}var r=e.eventAction,n=this.searchInput.value;"find"==r?this.searchRecentGAEventhandler(r,n):"history"==r?this.searchRecentGAEventhandler(r,t):"suggested_stores"==r?this.searchRecentGAEventhandler(r,n+" | "+e.code):"suggested_keywords"==r?this.searchRecentGAEventhandler(r,n+" | "+e.name):"suggested_categories"==r&&this.searchRecentGAEventhandler(r,n+" | "+e.catname),"store"!==e.type&&window.location.assign(u.getHktvUrlPrefix()+t)},t.prototype.renderSubmitButton=function(){var e=this,t=this.props.zone,r=this.state,n=r.isInputFocus,o=r.isSearchButtonHover,a=i.setSearchButtonColor(t);return c.createElement("div",{className:"SuggestionSearch-button",style:n?o?{cursor:"pointer",backgroundColor:a.hover}:{cursor:"pointer",backgroundColor:a.normal}:{cursor:"pointer",backgroundColor:"#FFFFFF"},onMouseEnter:function(t){return e.onMouseEnterSearchButton()},onMouseLeave:function(t){return e.onMouseLeaveSearchButton()},onClick:function(t){return e.onClickSearchButton()}}
1,c.createElement(y.default,{color:n?"#FFFFFF":"#9B9B9B"}))},t.prototype.renderInputSection=function(){var e=this,t=this.props,r=t.message,n=t.totalResultNum,o=n?Number(n).toLocaleString():"",a=n>0?r.input_placeHolder1+" "+o+" "+r.input_placeHolder2:r.input_placeHolder;return c.createElement("div",{className:"SuggestionSearch-input_section"},c.createElement("input",{ref:function(t){return e.searchInput=t},className:"SuggestionSearch-input",type:"text",placeholder:a,onChange:function(t){return e.onChangeSearchInput(t.currentTarget.value)},onFocus:function(t){return e.onFocusSearchInput(t.currentTarget.value)},onBlur:function(t){return e.onBlurSearchInput()},onKeyPress:function(t){return e.onKeyPressSearchInput(t)},defaultValue:this.keywordOnUrl,onClick:function(){return e.searchRecentGAEventhandler("input","NA")}}),this.renderSubmitButton())},t.prototype.renderResultList=function(){var e=this.props,t=e.message,r=e.keywordDataList,o=e.storeDataList,a=e.productDataList,i=e.keywordSuggestDataList,s=e.keyword;return c.createElement("div",{className:"SuggestionSearch-result"},!n(a)&&c.createElement(f.default,{list:a,onClickAction:this.proceedToSearchResultPage}),c.createElement(h.UIKeywordSuggestionSearch,{title:t.keywordSearch,keyword:s,list:i,onClickAction:this.proceedToSearchResultPage}),!n(r)&&c.createElement(d.default,{title:t.categorySearch,message:t.in,list:r,onClickAction:this.proceedToSearchResultPage}),!n(o)&&c.createElement(m.default,{message:t.relatedStore,list:o,onClickAction:this.proceedToSearchResultPage}))},t.prototype.renderEmptyInputList=function(){return c.createElement("div",{className:"SuggestionSearch-noInput"},this.renderRecommendBrandList(),this.renderRecentSearchList())},t.prototype.renderRecommendBrandList=function(){var e=this,t=this.props,r=t.recommendbrands,n=t.message;if(!this.state.calledImpression){var o=analytics.getGaRevamp2020AnalyticsZone()?analytics.getGaRevamp2020AnalyticsZone():"general";analytics.trackEcommercePromoImpressionMulti(r.map(function(e,t){return{id:e.href?e.href:"NA",name:"",creative:o+"_recommended_brand_shortcut",position:t+1}})),analytics.trackKafkaPromoImpressionMulti("recommended_brand_shortcut",r.map(function(e,t){return{clickthrough_link:e.href||"",mabs_ref_id:e.mabs||"",promotion_name:"",creative_slot:t+1}})),this.setState({calledImpression:!0})}return Array.isArray(r)&&r.length>0&&c.createElement("div",null,c.createElement("div",{className:"RecommendBrand-title"},n.recommendbrand),c.createElement("ul",{className:"SuggestionSearch-brands"},r.map(function(t,r){var n=t.href,o=t.url,a=t.alt,i=t.mabs;return c.createElement("li",{className:"SuggestionSearch-brand "+(i?"adLabel":""),key:r},c.createElement("a",{href:n,onClick:function(){e.recommendedBrandGAHandler(analytics.getGaRevamp2020AnalyticsZone(),n,i,r)}},c.createElement("img",{src:o,alt:a})))})))},t.prototype.renderRecentSearchList=function(){var e=this.props,t=e.recentDataList,r=e.message;return this.recentSearchMsg.title=r.recentSearch,this.recentSearchMsg.in=r.in,this.recentSearchMsg.clearAll=r.clearRecord,c.createElement("div",{className:"SuggestionSearch-recentSearch"},!n(t)&&c.createElement(l.default,{list:t,message:this.recentSearchMsg,clearAllHistory:this.clearAllRecentHistory,onClickAction:this.proceedToSearchResultPage}))},t.prototype.renderList=function(){var e=this.props.toggleIndex,t=this.state,r=t.isInputFocus,n=t.isInSearchBoxArea;if(!r&&!n)return null;switch(e){case 1:return this.renderEmptyInputList();case 2:return this.renderResultList();case 0:default:return null}},t.prototype.render=function(){var e=this;return c.createElement("div",{className:"UISuggestionSearchContainer",onMouseEnter:function(t){return e.onMouseEnterSearchBoxArea()},onMouseLeave:function(t){return e.onMouseLeaveSearchBoxArea()}},this.renderInputSection(),this.renderList())},t}(c.Component);t.UIRecentSuggestionSearch=v}.apply(t,n))&&(e.exports=o)},liDG:function(e,t,r){var n,o;n=[r,t,r("BUAs"),r("GiK3"),r("VY30")],void 0!==(o=function(e,t,n,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=r("xk0K"),i=function(e){var t=e.list,r=e.onClickAction;return o.createElement("ul",{className:"ProductSearch"},t.map(function(e,t){return o.createElement("li",{key:"ProductSearchItem_"+t,className:"ProductSearchItem"},o.createElement("img",{id:"icKeywordSearch",src:c}),o.createElement("div",{onClick:function(){return r(n({},a.RecentSearchObjectDefault,{type:"product",code:e.code,name:e.name}))}},e.name))}))};t.default=i}.apply(t,n))&&(e.exports=o)},oQ8U:function(e,t,r){var n,o;n=[r,t],void 0!==(o=function(e,t){"use strict";function r(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(c)try{console.log.apply(console,[e].concat(t))}catch(r){console.log(e,t)}}function n(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(c)try{console.info.apply(console,[e].concat(t))}catch(r){console.info(e,t)}}function o(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(c)try{console.warn.apply(console,[e].concat(t))}catch(r){console.warn(e,t)}}function a(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(c)try{console.error.apply(console,[e].concat(t))}catch(r){console.error(e,t)}}
1Object.defineProperty(t,"__esModule",{value:!0});var c=/debug=true/.test(document.cookie);t.log=r,t.info=n,t.warn=o,t.error=a}.apply(t,n))&&(e.exports=o)},qOUa:function(e,t,r){var n,o;n=[r,t,r("4ufr"),r("2KeS"),r("gLhK")],void 0!==(o=function(e,t,r,n,o){"use strict";function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i?n.compose(n.applyMiddleware.apply(void 0,e.concat([o.logger,o.crashReporter])),i):n.compose(n.applyMiddleware.apply(void 0,e.concat([o.logger,o.crashReporter])))}Object.defineProperty(t,"__esModule",{value:!0});var c=/debug=true/.test(document.cookie),i=c&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__();t.default=i?n.compose(n.applyMiddleware(r.default,o.logger,o.crashReporter),i):n.compose(n.applyMiddleware(r.default,o.logger,o.crashReporter)),t.composeStoreEnhancers=a}.apply(t,n))&&(e.exports=o)},wL7K:function(e,t,r){var n,o,a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();n=[r,t,r("BUAs"),r("GiK3"),r("VY30")],void 0!==(o=function(e,t,n,o,c){"use strict";function i(e,t,r){return o.createElement("li",{key:"KeywordSearchItem_"+t,className:"KeywordSearchItem"},o.createElement("img",{id:"icKeywordSearch",src:l}),o.createElement("div",{onClick:function(){return r(n({},c.RecentSearchObjectDefault,{type:"keywordSuggest",name:e.name,eventAction:"suggested_keywords"}))}},o.createElement("span",{style:{paddingRight:5}},e.name)))}function s(e,t,r,a){return o.createElement("li",{key:"KeywordSearchItem_"+t,className:"KeywordSearchItem"},o.createElement("img",{id:"icKeywordSearch",src:l}),o.createElement("div",{onClick:function(){return a(n({},c.RecentSearchObjectDefault,{type:"keyword",code:e.code,name:e.keyword,catname:e.name,eventAction:"suggested_categories"}))}},o.createElement("span",{style:{paddingRight:5}},e.keyword),o.createElement("span",{style:{paddingRight:5}},r),o.createElement("span",{style:{color:"#237630"}},e.name)))}function u(e){var t=e.title,r=e.keyword,n=e.list,a=e.onClickAction;return r&&o.createElement("div",{className:"KeywordSuggestSearch"},Array.isArray(n)&&n.length>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:"StoreSearch-title"},t),o.createElement("ul",null,n.map(function(e,t){return i(e,t,a)}))))}Object.defineProperty(t,"__esModule",{value:!0});var l=r("xk0K");t.UIKeywordSuggestionSearch=u;var p=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.render=function(){var e=this.props,t=e.title,r=e.message,n=e.list,a=e.onClickAction;return o.createElement("div",{className:"KeywordCategorySearch"},o.createElement("div",{className:"StoreSearch-title"},t),o.createElement("ul",null,n.map(function(e,t){return s(e,t,r,a)})))},t}(o.PureComponent);t.default=p}.apply(t,n))&&(e.exports=o)},wPMo:function(e,t,r){var n,o;n=[r,t,r("GiK3")],void 0!==(o=function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){var t=e.color||"#FFFFFF";return r.createElement("svg",{id:"magnifier",className:"magnifier",width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},r.createElement("g",{transform:"translate(-72.000000, -44.000000)",fill:t},r.createElement("path",{d:"M79.0010825,46.1678442 C76.359779,46.1678442 74.2106317,48.2756618 74.2106317,50.8661709 C74.2106317,53.4569554 76.359779,55.5647729 79.0010825,55.5647729 C81.6423859,55.5647729 83.7915332,53.4569554 83.7915332,50.8661709 C83.7915332,48.2756618 81.6423859,46.1678442 79.0010825,46.1678442 M84.508917,55.100429 C85.4439416,53.933064 86.0021649,52.4623337 86.0021649,50.8661709 C86.0021649,47.0800845 82.8614058,44 79.0010825,44 C75.1407591,44 72,47.0800845 72,50.8661709 C72,54.6522573 75.1407591,57.7326171 79.0010825,57.7326171 C80.6283419,57.7326171 82.127741,57.1852639 83.3179249,56.2684247 L88.5622752,61.4119221 C88.7267952,61.5732782 88.942131,61.6539563 89.1577476,61.6539563 C89.3733642,61.6539563 89.5887001,61.5732782 89.7532201,61.4119221 C90.08226,61.0894852 90.08226,60.5663169 89.7532201,60.2438801 L84.508917,55.100429 Z"}))))};t.default=n}.apply(t,n))&&(e.exports=o)},xk0K:function(e,t,r){e.exports=r.p+"src/media/svg/searchBox/icKeywordSearch.svg"},zYmO:function(e,t,r){var n,o;n=[r,t,r("lHK6"),r("JDN0")],void 0!==(o=function(e,t,r,n){"use strict";function o(e,t){var r={};try{return e.forEach(function(e){r[e[t]]=e}),r}catch(e){return console.log(c+"toMap fail with below error"),console.error(e),{}}}function a(e,t,o,a){void 0===t&&(t="&"),void 0===o&&(o="=");var i=c+"stringToJson: ",s={};if(n(e)){e.split(t).forEach(function(e,t){var n=e.split(o),c=n[0]||"",u=n[1]||"";a&&(u=decodeURIComponent(u)),c?(c=c.replace(" ",""),/\[\]$/.test(c)?(c=c.replace(/(\[\])/,""),r(s[c])&&(s[c]=[]),s[c].push(u)):s[c]=u):console.log(i+"Error="+c)})}else console.warn(i+"StringData is not a STRING!");return s}
1Object.defineProperty(t,"__esModule",{value:!0});var c="[JsonUtils]";t.toMap=o,t.stringToJson=a}.apply(t,n))&&(e.exports=o)}},["2BLD"]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.