!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HdSdk={})}(this,(function(e){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)};var n,r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:0,n=(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n}(r)}var h={view:"101",click:"102",input:"103",success:"104",loading:"105",heartbeat:"106",check:"107",view_success:"108",hover:"109",exit:"999"},m={event_name:{view:"101",additem:"102",updateitem:"103",removeitem:"104",checkout:"105",recommenditem:"106",proceed_to_checkout:"107",place_order:"108",click_component:"109",product_view:"110",product_share:"111",buy_now:"112",select_product:"113",deselect_product:"114",menu_view:"115",menu_click:"116",catalog_view:"117",catalog_click:"118",sku_click:"119",component_view:"120",display_click:"121",sort_click:"122",select_bundling:"123",add_wishlist:"124",cancel_wishlist:"125",proceed_to_delivery_payment:"126",proceed_to_pay:"127",proceed_to_delivery:"128",quick_payment:"129",click_product:"130",search_suggest:"131",paypal:"132",input:"133",modify:"134",select_shipping:"135",select_payment:"136",inventory_shortage:"137",login_success:"138",view_cart:"139",leave:"999"},event_category:{order:"101",cart:"102",email:"103",expresscheckoutpage:"104"},product_type:{product:"101",addon:"102",subscription:"103"},status:{soldout:"101",selling:"102"},purchase_source:{common_store:"101",one_page_store:"102"},page:{homepage:"101",pdp:"102",cart:"103",order_check_out:"104",transaction:"105",product_search:"106",product_list:"107",user_page:"108",email:"109",expresscheckout:"110","404page":"111",call_to_action:"112",consumer_home:"113",onepage_checkout:"114",address_confirm:"115",delivery_payment_confirm:"116",delivery_confirm:"117",payment_confirm:"118",addon:"119",other:"120",landing_page:"121"},general_component:{catalog:"101",logo:"102",search:"103",sign_in_bottom:"104",message:"105",cart:"106",store_language:"107",currency:"108",search_product:"109",H1:"110",paragraph:"111",single_image:"112",slider:"113",poster:"114",gallery:"115",media_lr:"116",media_ud:"117",end_payment:"118",end_email:"119",end_fb:"120",end_ins:"121",end_twitter:"122",end_snapchat:"123",end_pinterest:"124",end_line:"125",theme:"126",free_layout:"127",search_pop:"128",search_bar:"129"},custom_component:{sign_up_tab:"101",sign_in_tab:"102",line_signin:"103",fb_signin:"104",sign_in_105:"105",sign_up:"106",title_component:"107",content_component:"108",productmoduel_component:"109",productlist_component:"110",QRcode_component:"111",ins_component:"112",googlemap_component:"113",facebook_component:"114",video_component:"115",pic_component:"116",product_menu:"117",pre_order:"118",gotoamazon:"119",wishlist:"120",product_descri:"121",deliver_payment:"122",score:"123",reviews:"123",share:"124",recommendation:"125",checkout:"126",removement:"127",sign_in_128:"128",proceed_to_checkout:"129",select_all:"130",deselect_all:"131",select:"132",deselect:"133",product_edit:"134",subscribe_line:"135",back_to_cart:"136",place_order:"137",buy_now:"138",view_more:"139",play_video:"140",more_bundling:"141",rec_turn_page:"142",arrival_notice:"143",more_reviews:"144",consumer_info:"145",message:"146",order:"147",return_order:"148",wishlist_149:"149",wishlist_turn_page:"150",use_coupon:"151",sign_in:"152",subscription:"153",back:"154",continue:"155"},display_iterm:{24:"101",48:"102",72:"103"},sort_by:{newestToOldest:"101",oldestToNewest:"102",priceHighToLow:"103",priceLowToHigh:"104",default:"999"},pro_list_type:{category:"101",all_product:"102",chosen_product:"103"},share_dest:{line:"101",fb:"102",message:"103",link:"104",whatsapp:"105",twitter:"106"},signin_source:{sign_in_bottom:"101",order_edit:"102"},search_type:{user_search:"101",suggest_ai:"102",suggest_search:"103"},input_box:{email:"101",first_name:"102",last_name:"103",country:"104",province:"105",city:"106",district:"107",address1:"108",address2:"108",postcode:"109",phone:"110",same_address:"111",another_address:"112",remark:"113"},object:{info:"101",address:"102",shipping:"103"},isFirst:{yes:"1",no:"0"},loginResult:{success:"1",fail:"0"},action_type:h},g=["general_component","custom_component","status","product_type"],y=["PageView","PageLeave","PageDuration","HeartBeat","View","ViewSuccess","ViewContent","AddToCart","InitiateCheckout","AddCustomerInfo","AddShippingInfo","AddPaymentInfo","Purchase","SearchResults","CompleteRegistration","Search","Lead","Login","SelectContent","RemoveFromCart","ViewItemList"],_=["View","ViewSuccess"];function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function V(e){return JSON.parse(JSON.stringify(e))}function U(e){if("object"!==O(e))return e;return function e(t,n){var r=[];if("object"===O(t))return Object.keys(t).forEach((function(o){var i=t[o];"object"===O(i)?r=""!=n?r.concat(e(i,n+"["+o+"]")):r.concat(e(i,o)):void 0!==i&&(""!=n?r.push(n,"[",o,"]","=",encodeURIComponent(i),"&"):r.push(o,"=",encodeURIComponent(i),"&"))})),r}(e,"").slice(0,-1).join("")}var N="application/x-www-form-urlencoded",H=49152,q="The query length cannot exceed ".concat(48,"K"),B={useHttps:!0,useRetry:!0,retryTimes:1,maxRequest:5},F=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.configure(t),this.override(n)}return S(e,[{key:"configure",value:function(e){var t,n,r=Object.assign({},this.options,V(e));01&&void 0!==arguments[1]?arguments[1]:this.options,n=this.requestInterceptor;return"function"==typeof n?n(e,t):e}},{key:"formatTrackingData",value:function(e){var t=V(e);return t.moreinfo||(t.moreinfo={}),"object"===O(t.moreinfo)&&(t.moreinfo=this.formatMoreInfoData(t.moreinfo),t.moreinfo=JSON.stringify(t.moreinfo)),"localhost"===t.domain&&(t.domain=""),t}},{key:"destory",value:function(){this.data=void 0,this.options=void 0,this.urlInterceptor=void 0,this.requestInterceptor=void 0}}]),e}(),z=new Array(15);function J(e,t){return 506832829*e>>>t}function K(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24)}function G(e,t,n){return e[t]===e[n]&&e[t+1]===e[n+1]&&e[t+2]===e[n+2]&&e[t+3]===e[n+3]}function W(e,t,n,r,o){return n<=60?(r[o]=n-1<<2,o+=1):n<256?(r[o]=240,r[o+1]=n-1,o+=2):(r[o]=244,r[o+1]=n-1&255,r[o+2]=n-1>>>8,o+=3),function(e,t,n,r,o){for(var i=0;i>>8<<5),e[t+1]=255&n,t+2):(e[t]=2+(r-1<<2),e[t+1]=255&n,e[t+2]=n>>>8,t+3)}function $(e,t,n,r){for(;r>=68;)t=Y(e,t,n,64),r-=64;return r>64&&(t=Y(e,t,n,60),r-=60),Y(e,t,n,r)}function X(e,t,n,r,o){for(var i=1;1<=15)for(u=_-15,l=J(K(e,t+=1),a);S;){v=32,p=t;do{if(d=l,h=v>>>5,v+=1,p=(t=p)+h,t>u){S=!1;break}l=J(K(e,p),a),f=w+s[d],s[d]=t-w}while(!G(e,t,f));if(!S)break;o=W(e,b,t-b,r,o);do{for(m=t,g=4;t+g<_&&e[t+g]===e[f+g];)g+=1;if(t+=g,o=$(r,o,m-f,g),b=t,t>=u){S=!1;break}s[J(K(e,t-1),a)]=t-1-w,f=w+s[y=J(K(e,t),a)],s[y]=t-w}while(G(e,t,f));if(!S)break;l=J(K(e,t+=1),a)}return b<_&&(o=W(e,b,_-b,r,o)),o}var Q=function(){function e(t){w(this,e),this.sources=t}return S(e,[{key:"maxCompressedLength",value:function(){var e=this.sources.length;return 32+e+Math.floor(e/6)}},{key:"compressToBuffer",value:function(e){var t,n=this.sources,r=n.length,o=0,i=0;for(i=function(e,t,n){do{t[n]=127&e,(e>>>=7)>0&&(t[n]+=128),n+=1}while(e>0);return n}(r,e,i);o0?e:0;setTimeout(t,n>re?re:n)}))}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x(this,n)}}var ae=Object.assign({},B,{wait:"immediately"}),se=function(e){T(a,e);var t,n,r,o,i=ie(a);function a(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(this,a),(e=i.call(this,t,n)).trackingTasks=[],e.trackingReportors=[],e}return S(a,[{key:"report",value:(o=C(M.mark((function e(t){var n,r,o=arguments;return M.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]&&o[1],Array.isArray(t)){e.next=3;break}return e.abrupt("return",this.report([t],n));case 3:if(this.addTask.apply(this,I(t)),!n){e.next=7;break}return r=this.trackingTasks.pop(),e.abrupt("return",this.tryReport([r]));case 7:return e.abrupt("return",this.runReport());case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"post",value:(r=C(M.mark((function e(){var t;return M.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=this.freeTrackingTask()).length>0)){e.next=5;break}return this.tryReport(t),e.abrupt("continue",0);case 5:return e.abrupt("break",8);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"use",value:function(e,t){A(E(a.prototype),"use",this).call(this,e,t)}},{key:"addTask",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=n)){e.next=4;break}return e.next=4,Promise.all(this.trackingReportors);case 4:if(!a.supported){e.next=13;break}if("nextTick"!==r){e.next=10;break}return e.next=8,Promise.resolve();case 8:e.next=13;break;case 10:if("number"!=typeof r){e.next=13;break}return e.next=13,oe(r);case 13:if(!((o=this.freeTrackingTask()).length>0)){e.next=18;break}return i=this.tryReport(o),e.next=18,this.pushReport(i);case 18:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"freeTrackingTask",value:function(){for(var e=1,t=0;tH)return this.trackingTasks.splice(0,t)}return this.trackingTasks.splice(0)}},{key:"tryReport",value:(t=C(M.mark((function e(t){var n,r,o,i,a,s,c,u,d=arguments;return M.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>1&&void 0!==d[1]?d[1]:0,e.prev=1,r=this.options,o=r.useHttps,i=r.domain,a="http".concat(!1!==o?"s":"","://").concat(i),e.next=6,this.delegateRequest(a,t);case 6:e.next=16;break;case 8:if(e.prev=8,e.t0=e.catch(1),s=this.options,c=s.useRetry,u=s.retryTimes,!(!0===c&&u>n)){e.next=15;break}return e.next=14,this.tryReport(t,n+1);case 14:return e.abrupt("return",e.sent);case 15:return e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return t.apply(this,arguments)})},{key:"pushReport",value:function(e){var t=this,n=function(){var n=t.trackingReportors.indexOf(e);t.trackingReportors.splice(n,1)},r=e.then(n).catch((function(e){return n(),Promise.reject(e)}));return this.trackingReportors.push(r),r}},{key:"delegateRequest",value:function(e,t){if(!Array.isArray(t)){var n=this.interceptUrl("".concat(e,"/").concat("n.gif"),t);return this.options.skipReport?Promise.resolve():this.send(n,t.encoded)}return 1===t.length?this.delegateRequest(e,t[0]):this.mergeRequest(e,t)}},{key:"mergeRequest",value:function(e,t){var n=t.map((function(e){return e.encoded})),r=this.compressTrackingDatas(n),o=this.interceptUrl("".concat(e,"/").concat("o.gif","?cmp=1&enc=b64"),t);return this.options.skipReport?Promise.resolve():this.send(o,r)}},{key:"interceptUrl",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options;return"function"==typeof this.urlInterceptor?this.urlInterceptor(e,t,n):e}},{key:"compressTrackingDatas",value:function(e){var t=ne(JSON.stringify(e)),n=String.fromCharCode.apply(null,new Uint8Array(t));return btoa(n)}},{key:"validTrackingData",value:function(e){return!(e.length>H)||(t=q,"function"==typeof(null===(n=console)||void 0===n?void 0:n.error)?console.error(t):"function"==typeof(null===(r=console)||void 0===r?void 0:r.log)&&console.log(t),!1);var t,n,r}},{key:"destory",value:function(){A(E(a.prototype),"destory",this).call(this),this.trackingTasks.splice(0),this.trackingReportors.splice(0),this.trackingTasks=void 0,this.trackingReportors=void 0}}]),a}(F);L(se,"supported","function"==typeof btoa&&"undefined"!=typeof Uint16Array);var ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"http request fail.",n=new Error(t),r=e.xhr,o={type:"ajax",response:null,event:e.event,data:e.data,xhr:r,status:r.status,responseText:r.responseText};try{o.response=JSON.parse(r.responseText)}catch(e){}return Object.assign(n,{detail:o})};function ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x(this,n)}}var de=function(e){T(n,e);var t=ue(n);function n(){return w(this,n),t.apply(this,arguments)}return S(n,[{key:"send",value:function(e,t){return function(e,t){return new Promise((function(n,r){var o=new XMLHttpRequest;o.open("POST",e),o.onerror=function(e){var n=ce({xhr:o,event:e,data:t});r(n)},o.onreadystatechange=function(e){if(o.readyState===XMLHttpRequest.DONE&&200===o.status)n();else{var i=ce({xhr:o,event:e,data:t});(o.status>=500||o.status>=402&&o.status<=420||400==o.status||401==o.status)&&r(i)}},o.setRequestHeader("Content-Type",N),o.withCredentials=!1,o.send(t)}))}(e,t)}}]),n}(se);L(de,"supported","undefined"!=typeof XMLHttpRequest);var le,pe=function(){var e=C(M.mark((function e(t,n){var r;return M.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Blob([n],{type:N}),navigator.sendBeacon(t,r)){e.next=4;break}throw new Error("Send beacon fail.");case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=E(e);if(t){var o=E(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x(this,n)}}var ve=function(e){T(n,e);var t=fe(n);function n(){return w(this,n),t.apply(this,arguments)}return S(n,[{key:"send",value:function(e,t){return pe(e,t)}}]),n}(se);L(ve,"supported","function"==typeof(null===(le=navigator)||void 0===le?void 0:le.sendBeacon));var he,me,ge,ye,_e,we=function(e){return e&&e.default||e}(Object.freeze({__proto__:null,default:function(e,t){var n=new ve(e,t),r=new de(e,t),o={httpInstance:r,beaconInstance:n};return ve.supported?Object.assign(n,o):de.supported?Object.assign(r,o):void 0}})),be="shopline",Se="tracker_cid",ke="tracker_sid",Te="osudb_uid",Oe="merchant_id",xe="store_id",Ee="tracker_n_sid",Le="n_sess",Re={wait:20},Ie="admintoC",Pe="webslcodetrack",Ce="websdkprotocol",Ae="-999",je=["preview","product"],De="tracker_landing",Me=["session_id","session_create_time","session_rn","last_session_id","session_create_type"],Ve=["merchant_id","user_id","version","store_timezone","user_timezone","store_region"],Ue=Object.freeze({__proto__:null,PROD_ID:be,HTTP_COOKIE_KEY:Se,SESSION_ID_KEY:ke,UID_KEY:Te,MERCHANT_ID_KEY:Oe,STORE_ID_KEY:xe,SERVER_SESSION_ID_KEY:Ee,COOKIE_SESSION_KEY:Le,TRACKER_OPTIONS:Re,APP_ID:"101",PROJECT_ID:Ie,ACT:Pe,LEGACY_ACT:Ce,DEFAULT_CODE:Ae,REPORT_ENV:je,LANDING_SIGN:De,SESSION_KEYS:Me,OUTSIDE_PROPERTIES:Ve}),Ne=D((function(e,t){var n;n=function(){function e(){for(var e=0,t={};e=0?r="back-forward-cache":n&&(r=document.prerendering||Fe()>0?"prerender":document.wasDiscarded?"restore":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Je=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Ke=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},Ge=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},We=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ye=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},$e=-1,Xe=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Qe=function(e){"hidden"===document.visibilityState&&$e>-1&&($e="visibilitychange"===e.type?e.timeStamp:0,et())},Ze=function(){addEventListener("visibilitychange",Qe,!0),addEventListener("prerenderingchange",Qe,!0)},et=function(){removeEventListener("visibilitychange",Qe,!0),removeEventListener("prerenderingchange",Qe,!0)},tt=function(){return $e<0&&($e=Xe(),Ze(),qe((function(){setTimeout((function(){$e=Xe(),Ze()}),0)}))),{get firstHiddenTime(){return $e}}},nt=function(e,t){t=t||{},Ye((function(){var n,r=[1800,3e3],o=tt(),i=ze("FCP"),a=Je("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime-1&&e(t)},u=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],r=s[s.length-1];a&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,s.push(e)):(a=e.value,s=[e]),a>o.value&&(o.value=a,o.entries=s,n())}}))},d=Je("layout-shift",u);d&&(n=Ge(c,o,r,t.reportAllChanges),nt((function(e){i=e.value,o.value<0&&(o.value=0,n())})),Ke((function(){u(d.takeRecords()),n(!0)})),qe((function(){a=0,i=-1,o=ze("CLS",0),n=Ge(c,o,r,t.reportAllChanges),We((function(){return n()}))})))}))},ot={passive:!0,capture:!0},it=new Date,at=function(e,t){he||(he=t,me=e,ge=new Date,ut(removeEventListener),st())},st=function(){if(me>=0&&me1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){at(e,t),o()},r=function(){o()},o=function(){removeEventListener("pointerup",n,ot),removeEventListener("pointercancel",r,ot)};addEventListener("pointerup",n,ot),addEventListener("pointercancel",r,ot)}(t,e):at(t,e)}},ut=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ct,ot)}))},dt=function(e,t){t=t||{},Ye((function(){var n,r=[100,300],o=tt(),i=ze("FID"),a=function(e){e.startTimet.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};wt[r.id]=r,_t.push(r)}_t.sort((function(e,t){return t.latency-e.latency})),_t.splice(10).forEach((function(e){delete wt[e.id]}))}},St=function(e,t){t=t||{},Ye((function(){var n=[200,500];mt();var r,o=ze("INP"),i=function(e){e.forEach((function(e){e.interactionId&&bt(e),"first-input"===e.entryType&&!_t.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&bt(e)}));var t,n=(t=Math.min(_t.length-1,Math.floor(yt()/50)),_t[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())},a=Je("event",i,{durationThreshold:t.durationThreshold||40});r=Ge(e,o,n,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),Ke((function(){i(a.takeRecords()),o.value<0&&yt()>0&&(o.value=0,o.entries=[]),r(!0)})),qe((function(){_t=[],gt=ht(),o=ze("INP"),r=Ge(e,o,n,t.reportAllChanges)})))}))},kt={},Tt=function(e,t){t=t||{},Ye((function(){var n,r=[2500,4e3],o=tt(),i=ze("LCP"),a=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-Fe(),0);rperformance.now())return;r.value=Math.max(a-Fe(),0),r.entries=[i],o(!0),qe((function(){r=ze("TTFB",0),(o=Ge(e,r,n,t.reportAllChanges))(!0)}))}}))},Et=new(function(){function e(){}return e.prototype.get=function(e){var t;try{var n=JSON.parse(localStorage.getItem(e)||"");n&&n.value&&(n.maxAge?n.maxAge>Date.now()-(n.timeOffset||0)?t=n.value:this.remove(e):t=n.value)}catch(e){}return t},e.prototype.set=function(e,t,n,r){void 0===r&&(r=0);try{var o={value:t,maxAge:n?Date.now()-r+60*n*1e3:null,timeOffset:r};localStorage.setItem(e,JSON.stringify(o))}catch(e){}},e.prototype.remove=function(e){localStorage.removeItem(e)},e.prototype.getRaw=function(e){var t={value:null,maxAge:null,timeOffset:0};try{var n=JSON.parse(localStorage.getItem(e)||"");n&&n.value&&(t=n)}catch(e){}return t},e.prototype.isExpired=function(e){try{var t=JSON.parse(localStorage.getItem(e)||"");return!t||!t.value||!(!t.maxAge||t.maxAge&&t.maxAge>(Date.now()-t.timeOffset||0))}catch(e){}return!0},e.prototype.append=function(e,t){try{var n=JSON.parse(localStorage.getItem(e)||"");if(n&&n.value)return Object.assign(n.value,t),localStorage.setItem(e,JSON.stringify(n)),n.value}catch(e){}},e}()),Lt=new(function(){function e(){this.webVitals={CLS:"",FCP:"",FID:"",INP:"",LCP:"",TTFB:""},this.getWebVitals()}return e.prototype.getHttpCookie=function(e){void 0===e&&(e=0);var t=Et.get(Se);return t||(t=v(),Et.set(Se,t,e)),t},e.prototype.getSessionId=function(e,t,n){void 0===e&&(e=30),void 0===t&&(t=0);var r=Et.getRaw(ke),o=+new Date;n&&(o-=n);var i=r.value;i||(i={});var a=i.sid||"",s=r.maxAge&&r.maxAge=n.navigationStart?n.domLoading-n.navigationStart:0),t.first_paint=Math.ceil(t.first_paint),t.active=Math.ceil(n.domInteractive-n.navigationStart)}return t},e}());function Rt(e,t){for(var n={},r=0,o=t.length;rwindow.innerHeight;h&&(c.dataset.__trackerSuperLong="1"),o&&p&&(i>=v||h)?c.dataset.__trackerViewSucceed||c.dataset.__trackerViewSuccessOnce||(c.dataset.__trackerLastViewStarted=String(s),c.dataset.__trackerViewSucceed="1",e.exposedElements.add(c),(null===(r=window.SL_Report)||void 0===r?void 0:r.exposeTimer)||e.checkTimer({element:c})):(e.resetTime(c),delete c.dataset.__trackerViewSucceed,e.exposedElements.delete(c)),o&&l&&i>=0?c.dataset.__trackerViewed||c.dataset.__trackerViewOnce||(e.reportView(c,l),c.dataset.__trackerViewed="1",l.reportOnce&&(c.dataset.__trackerViewOnce="1")):delete c.dataset.__trackerViewed}))}),t)}},e.prototype.reportView=function(e,t){var n,o=(t||{}).params,i=void 0===o?{}:o;"function"==typeof i&&(i=i(e)),null===(n=this.collect)||void 0===n||n.call(this,r({event_name:"View",action_type:101},i))},e.prototype.reportViewSuccess=function(e,t){var n,o=(t||{}).params,i=void 0===o?{}:o;"function"==typeof i&&(i=i(e)),null===(n=this.collect)||void 0===n||n.call(this,r({event_name:"ViewSuccess",action_type:108},i))},e.prototype.track=function(e){var t=this,n=e.selector,r=e.targetList;if(n||(null==r?void 0:r.length)){var o=Math.random().toString(32).slice(2),i=r?'[data-__tracker-id="'.concat(o,'"]'):n;window.SL_Report.exposeObserver||this.init();var a=window.SL_Report,s=a.exposeObserver,c=a.exposeMap;this.checkTimer({options:e}),(r||document.querySelectorAll(n)).forEach((function(e){t.resetTime(e),e.dataset.__trackerSelector=i||n,(null==r?void 0:r.length)&&(e.dataset.__trackerId=o),s.observe(e)})),c.set(i,e)}},e.prototype.checkTimer=function(e){var t,n=this,r=e.element,o=e.options;if(window.SL_Report.exposeMap){var i=o;if(!i){var a=(null==r?void 0:r.dataset.__trackerSelector)||"";i=window.SL_Report.exposeMap.get(a)}var s=this.getTimeout(i);clearTimeout(null===(t=window.SL_Report)||void 0===t?void 0:t.exposeTimer);var c=function(){window.SL_Report.exposeTimer=window.setTimeout((function(){!n.handleRefreshTimeout()&&c()}),s)};c()}},e.prototype.handleRefreshTimeout=function(){var e=this;if(!this.exposedElements.size)return clearTimeout(window.SL_Report.exposeTimer),delete window.SL_Report.exposeTimer,!0;var t=window.SL_Report,n=t.exposeMap,r=t.exposeObserver;n&&this.exposedElements.forEach((function(t){var o=t.dataset,i=o.__trackerTotalViewTime,a=void 0===i?0:i,s=o.__trackerSelector,c=void 0===s?"":s,u=o.__trackerSuperLong,d=document.querySelectorAll(c);if(!Array.from(d).some((function(e){return e===t})))return e.exposedElements.delete(t),void r.unobserve(t);var l=(n.get(c)||{}).viewSuccess,p=void 0===l?{}:l,f=p.threshold,v=void 0===f?.5:f;if(u){var h=t.getBoundingClientRect(),m=h.top,g=h.height;if(m+g<0)return e.resetTime(t);if((window.innerHeight-m)/g=(p.duration||300)&&(e.reportViewSuccess(t,p),e.resetTime(t),e.exposedElements.delete(t),p.reportOnce&&(t.dataset.__trackerViewSuccessOnce="1"))}))},e.prototype.updateExposeTimer=function(e){var t=+(e.dataset.__trackerLastViewStarted||0),n=performance.now();if(t){var r=n-t;e.dataset.__trackerTotalViewTime=String(parseFloat(e.dataset.__trackerTotalViewTime)+r)}e.dataset.__trackerLastViewStarted=String(n)},e.prototype.getTimeout=function(e){var t,n=window.SL_Report.exposeMap;if(!n)return 1e3;var r=Array.from(n.values()).map((function(e){var t;return((null===(t=e.viewSuccess)||void 0===t?void 0:t.duration)||300)/2})),o=Math.min.apply(Math,s(s([],r,!1),[1e3,((null===(t=null==e?void 0:e.viewSuccess)||void 0===t?void 0:t.duration)||300)/2],!1));return o>100?o:100},e.prototype.resetTime=function(e){e.dataset.__trackerTotalViewTime="0",e.dataset.__trackerLastViewStarted="0"},e}();var Ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Nt="object"==typeof j&&j&&j.Object===Object&&j,Ht="object"==typeof self&&self&&self.Object===Object&&self,qt=Nt||Ht||Function("return this")(),Bt=function(){return qt.Date.now()},Ft=/\s/;var zt=function(e){for(var t=e.length;t--&&Ft.test(e.charAt(t)););return t},Jt=/^\s+/;var Kt=function(e){return e?e.slice(0,zt(e)+1).replace(Jt,""):e},Gt=qt.Symbol,Wt=Object.prototype,Yt=Wt.hasOwnProperty,$t=Wt.toString,Xt=Gt?Gt.toStringTag:void 0;var Qt=function(e){var t=Yt.call(e,Xt),n=e[Xt];try{e[Xt]=void 0;var r=!0}catch(e){}var o=$t.call(e);return r&&(t?e[Xt]=n:delete e[Xt]),o},Zt=Object.prototype.toString;var en=function(e){return Zt.call(e)},tn=Gt?Gt.toStringTag:void 0;var nn=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":tn&&tn in Object(e)?Qt(e):en(e)};var rn=function(e){return null!=e&&"object"==typeof e};var on=function(e){return"symbol"==typeof e||rn(e)&&"[object Symbol]"==nn(e)},an=/^[-+]0x[0-9a-f]+$/i,sn=/^0b[01]+$/i,cn=/^0o[0-7]+$/i,un=parseInt;var dn=function(e){if("number"==typeof e)return e;if(on(e))return NaN;if(Ut(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ut(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=sn.test(e);return n||cn.test(e)?un(e.slice(2),n?2:8):an.test(e)?NaN:+e},ln=Math.max,pn=Math.min;var fn=function(e,t,n){var r,o,i,a,s,c,u=0,d=!1,l=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function v(e){return u=e,s=setTimeout(m,t),d?f(e):a}function h(e){var n=e-c;return void 0===c||n>=t||n<0||l&&e-u>=i}function m(){var e=Bt();if(h(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-c);return l?pn(n,i-(e-u)):n}(e))}function g(e){return s=void 0,p&&r?f(e):(r=o=void 0,a)}function y(){var e=Bt(),n=h(e);if(r=arguments,o=this,c=e,n){if(void 0===s)return v(c);if(l)return clearTimeout(s),s=setTimeout(m,t),f(c)}return void 0===s&&(s=setTimeout(m,t)),a}return t=dn(t)||0,Ut(n)&&(d=!!n.leading,i=(l="maxWait"in n)?ln(dn(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},y.flush=function(){return void 0===s?a:g(Bt())},y};var vn=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Ut(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),fn(e,t,{leading:r,maxWait:t,trailing:o})};var hn=new(function(e){function n(){var t,n=this;return(n=e.call(this)||this).pageViewTime=Date.now(),n.maxScrollTop=0,n.skipOnSessionUpdate=!1,n.beginSessionId="",n.heartbeatIds=[],n.exposeInstance=null,n.destUrlLock=!1,n.pageLeaveLock=!1,(null===(t=window.SL_Report)||void 0===t?void 0:t.skipSelfInit)||n.init(),n}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,e),n.prototype.setMode=function(e){"debug"===e?this.setDebugMode(!0):this.setDebugMode(!1)},n.prototype.getBaseParams=function(e){return i(this,void 0,void 0,(function(){var t,n,r,o,i,s,c,u,d,l,p,f,v,h,m,g;return a(this,(function(a){switch(a.label){case 0:return 1,t=this.getOptions(),n=t.timezoneOffset,r=void 0===n?0:n,o=t.handleBaseParams,i=t.disableIframeId,s=t.timeOffset,c=void 0===s?0:s,d=(u=e||{}).ignoreSession,l=void 0!==d&&d,p=u.ignoreSessionRn,f=void 0!==p&&p,v=u.session,h={version:Dt,iframe_id:1,http_cookie:Lt.getHttpCookie(),url_path:Lt.getUrlPath(),language:Lt.getLanguage(),is_mobile:Lt.getIsMobile(),merchant_id:Lt.getMerchantId(),user_id:Lt.getUserId(),http_search:Lt.getHttpSearch(),title:Lt.getTitle(),store_id:Lt.getStoreId(),website:Lt.getWebsite(),loading_time:Lt.getPerformance().load,event_created_at_ms:+new Date,screen_width:Lt.getScreenWidth(),screen_height:Lt.getScreenHeight()},l||(m=(null==v?void 0:v.sid)?v:Lt.getSessionId(30,r,c),g=f?void 0:Lt.upsetSessionRn(m),h.session_id=m.sid,h.session_create_time=m.createAt,h.session_rn=g,h.last_session_id=m.last_session_id,h.session_create_type=m.session_create_type),i&&delete h.iframe_id,o&&"function"==typeof o?[4,o(h)]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2,h]}}))}))},n.prototype.formatParams=function(e){var t=r({},e);if(t.products&&Array.isArray(t.products)){var n=["product_type","product_id","variantion_id","product_name","product_price","position","status","quantity","update_quantity","price"];t.products.forEach((function(e){n.forEach((function(n){e[n]&&(t[n]||(t[n]=[]),t[n].push(e[n]))}))})),delete t.products}return Object.entries(t).forEach((function(e){var n=e[0],r=e[1],o=r;n in m&&(Array.isArray(r)?g.indexOf(n)>-1&&(o=(r||[]).map((function(e){return m[n][e]})).join(",")):o=m[n][r]||r),Array.isArray(o)&&(o=o.join(",")),t[n]=o})),t},n.prototype.setDefaultEventId=function(e){var t=e.event_name,n=void 0===t?"":t,o=e.event_id,i=e.action_type;if(y.includes(n)){var a=Ae,s=o?At(o):"".concat(At(n)).concat(Date.now(),"_").concat(v().replace(/-/g,""));return _.includes(n)&&(a=i||a),r(r({},e),{action_type:a,event_id:s})}return e},n.prototype.collect=function(e,t){var n;return void 0===t&&(t={}),i(this,void 0,void 0,(function(){var o,i,s,c,u,d,l,p,f,v,m,g;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),o=this.getOptions(),i=o.beforeSend,s=o.onSessionUpdate,c=o.timezoneOffset,u=o.timeOffset,d=(null===(n=Et.getRaw(ke))||void 0===n?void 0:n.value)||null,l=Et.isExpired(ke),p=String(e.action_type||"")===h.heartbeat,[4,this.getBaseParams({ignoreSession:t.ignoreSession,ignoreSessionRn:p})];case 1:return f=a.sent(),v=r(r({},f),this.setDefaultEventId(e)),i&&"function"==typeof i?[4,i(v)]:[3,3];case 2:v=a.sent(),a.label=3;case 3:return!this.skipOnSessionUpdate&&l&&d&&"function"==typeof s?(m=Lt.getSessionId(30,c,u),this.skipOnSessionUpdate=!0,[4,s(d,m)]):[3,5];case 4:a.sent(),this.skipOnSessionUpdate=!1,a.label=5;case 5:return t.ignoreLanding=p,[2,this.reportV2(v,t)];case 6:throw g=a.sent(),this.skipOnSessionUpdate=!1,console.error("collect tracker error:",g),g;case 7:return[2]}}))}))},n.prototype.report=function(e,t,n,r,o,s){return i(this,void 0,void 0,(function(){var i,c,u,d,l,p;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),i="141"===String((null==t?void 0:t.event_name)||""),[4,this.getBaseParams({ignoreSessionRn:i})];case 1:return c=a.sent(),u=this.formatParams(t),d=Object.assign({},c,u),(l=this.getOptions().beforeSend)&&"function"==typeof l?[4,l(d)]:[3,3];case 2:d=a.sent(),a.label=3;case 3:return[2,this.reportJudge(e,d,null!=n?n:"leave"===(null==u?void 0:u.event_name),r,o,!!i||s)];case 4:throw p=a.sent(),console.error("tracker[".concat(e,"] error:"),p),p;case 5:return[2]}}))}))},n.prototype.setPageViewTime=function(e){void 0===e&&(e=+new Date),this.pageViewTime=e},n.prototype.init=function(){var e,t,n=this;if("undefined"!=typeof window&&(window.SL_Report=window.SL_Report||{},!(null===(e=window.SL_Report)||void 0===e?void 0:e.init))){window.SL_Report.init=!0;var r,o,s,c,u=function(e){var t=Array.from(e),r=t[0],o=t.slice(1),i=n[r];"function"==typeof i&&i.apply(n,o)},d="setOptions";try{(r=window.SL_Report.queue||[],o=d,null==r?void 0:r.filter((function(e){return e[0]===o}))).forEach(u),null===(t=window.SL_Report.queue)||void 0===t||t.forEach((function(e){return e[0]!==d&&u(e)})),window.SL_Report.queue=[]}catch(e){console.error(e)}s=function(){return n.pageView()},document.removeEventListener("DOMContentLoaded",s),"loading"!==document.readyState?setTimeout(s,1):document.addEventListener("DOMContentLoaded",(function(){setTimeout(s)})),!function(e){window.removeEventListener("scroll",e),window.addEventListener("scroll",e,!1)}(vn((function(){return n.recordScrollTop()}),100)),function(e){window.removeEventListener("beforeunload",e),window.addEventListener("beforeunload",e)}((function(e){var t,r;return"A"!==(null===(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.activeElement)||void 0===r?void 0:r.tagName)&&n.pageLeave()})),{visibleHandler:Mt((c={visible:function(){return n.setPageViewTime()},hidden:function(){return n.pageDuration()}}).visible)?c.visible:function(){},hiddenHandler:Mt(c.hidden)?c.hidden:function(){},visibilityChange:"",hidden:"",isSupport:function(){return void 0!==document[this.hidden]},init:function(){void 0!==document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):void 0!==document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):void 0!==document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):void 0!==document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;document.addEventListener(this.visibilityChange,(function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()}),!0)}else window.addEventListener("focus",this.visibleHandler),window.addEventListener("blur",this.hiddenHandler)}}.init();document.addEventListener("click",(function(e){if(!n.destUrlLock)for(var t=function(e){if(e.path)return e.path;if("function"==typeof e.composedPath)return e.composedPath();for(var t=[],n=e.target;n&&null!==n.parentNode;)t.push(n),n=n.parentNode;return t.push(document,window),t}(e),r=t.length-1;r>=0;r--){var o=t[r];if(o&&1===o.nodeType&&"a"===o.nodeName.toLowerCase()&&/^https?:\/\//.test(o.href)){n.pageLeave({params:{page_dest_url:o.href}}),n.pageLeaveLock=!0,setTimeout((function(){n.pageLeaveLock=!1}),100);break}}})),this.setOptions({onSessionUpdate:function(e){return i(n,void 0,void 0,(function(){return a(this,(function(t){return[2,this.pageDuration({session:e})]}))}))}})}},n.prototype.pageView=function(e){var t=void 0===e?{}:e,n=t.params,o=t.session;return i(this,void 0,void 0,(function(){return a(this,(function(e){return this.setPageViewTime(),Lt.getWebVitals(),this.beginSessionId=(null==o?void 0:o.sid)||Lt.getRawSessionId(),[2,this.collect(r({event_name:"PageView"},n),{session:o})]}))}))},n.prototype.pageLeave=function(e){var t=void 0===e?{}:e,n=t.params,o=t.session;return i(this,void 0,void 0,(function(){var e,t,i;return a(this,(function(a){return this.pageLeaveLock?[2,Promise.resolve()]:(e=this.getMaxHeightParams(),t=this.collect(r(r(r({event_name:"PageLeave"},e),n),Lt.webVitals),{session:o}),i=this.pageDuration({isPageLeave:!0,params:n}),this.destroy(),[2,Promise.all([t,i])])}))}))},n.prototype.pageDuration=function(e){var t=void 0===e?{}:e,n=t.params,o=t.session,s=t.isPageLeave,c=void 0!==s&&s;return i(this,void 0,void 0,(function(){var e,t,i,s;return a(this,(function(a){return this.pageLeaveLock?[2,Promise.resolve()]:(e="",t=(+new Date-this.pageViewTime)/1e3,(isNaN(t)||t<0)&&(t=0),t=Number(t.toFixed(3)),t=Math.min(t,1800),i=this.getMaxHeightParams(),c&&(e=Lt.getRawSessionId()),s=this.collect(r(r({event_name:"PageDuration",event_duration:t,begin_session:this.beginSessionId||Lt.getRawSessionId(),end_session:e},i),n),{session:o}),this.setPageViewTime(),[2,s])}))}))},n.prototype.heartbeat=function(e,t){return void 0===t&&(t=2e3),i(this,void 0,void 0,(function(){var n,o=this;return a(this,(function(i){return n=window.setInterval((function(){o.collect(r({event_name:"HeartBeat"},e)),o.heartbeatIds.push(n)}),t),[2]}))}))},n.prototype.expose=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this.exposeInstance||(this.exposeInstance=new Vt(this.collect.bind(this))),this.exposeInstance.track(e),[2]}))}))},n.prototype.onPageChange=function(e,t){return i(this,void 0,void 0,(function(){var n=this;return a(this,(function(r){return this.destUrlLock=!0,setTimeout((function(){n.destUrlLock=!1}),100),[2,Promise.all([this.pageLeave({params:e}),this.pageView({params:t})])]}))}))},n.prototype.recordScrollTop=function(){var e=document.documentElement.scrollTop;e>this.maxScrollTop&&(this.maxScrollTop=e)},n.prototype.getMaxHeightParams=function(){var e=document.documentElement||document.body,t=e?((this.maxScrollTop+e.clientHeight)/(null==e?void 0:e.scrollHeight)*100).toFixed(2):0;return{max_height:this.maxScrollTop,max_height_pc:t}},n.prototype.destroy=function(){var e;this.pageViewTime=Date.now(),this.maxScrollTop=0,this.skipOnSessionUpdate=!1,this.beginSessionId="",this.heartbeatIds.forEach((function(e){return clearInterval(e)})),this.heartbeatIds=[],(null===(e=window.SL_Report)||void 0===e?void 0:e.exposeObserver)&&(window.SL_Report.exposeObserver.disconnect(),window.SL_Report.exposeObserver=void 0)},n}(jt));e.SDK_VERSION=Dt,e.baseParams=Lt,e.constants=Ue,e.shopTracker=hn,e.storage=Et,e.tracker=jt,Object.defineProperty(e,"__esModule",{value:!0})}));