// 7f9c3650 (()=>{var I=Object.defineProperty,w=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var f=(s,e,t)=>e in s?I(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,m=(s,e)=>{for(var t in e||(e={}))E.call(e,t)&&f(s,t,e[t]);if(P)for(var t of P(e))_.call(e,t)&&f(s,t,e[t]);return s},d=(s,e)=>w(s,O(e));var h=(s,e,t)=>new Promise((r,a)=>{var n=i=>{try{c(t.next(i))}catch(p){a(p)}},o=i=>{try{c(t.throw(i))}catch(p){a(p)}},c=i=>i.done?r(i.value):Promise.resolve(i.value).then(n,o);c((t=t.apply(s,e)).next())});var y=class{constructor(){this.debug=!1,this.prefix="gsms.js: "}setDebug(e){this.debug=e}message(e){return this.prefix+e}log(e,t){this.debug&&t(this.message(e))}logObject(e,t){this.log(e,r=>{console.log(r,JSON.stringify(t,(a,n)=>typeof n=="function"?n.toString():n,2))})}waring(e){this.log(e,console.warn)}error(e){this.log(e,console.error)}info(e){this.log(e,console.info)}},l=new y;function A(s,e=!1){if(!s)return null;let t=document.cookie.split(/\s*;\s*/).filter(r=>r.split("=")[0]===s)[0];return t?(t=t.split("=",2)[1],t=e?t:decodeURIComponent(t),t):null}function T(s,e,t,r,a=""){let n=[],o=new Date(Date.now()+r*1e3).toUTCString();return n.push(s+"="+e),n.push("path="+t||"/"),a&&n.push("domain="+a),o&&n.push("expires="+o),n.push("SameSite=lax"),document.cookie=n.join(";"),e}var b=()=>Math.random().toString(32).substring(2),k=s=>new URLSearchParams(location.search).get(s),v=(s,e,t=!1)=>{let r=k(s);if(r)return T(s,r,"/",e),r;let a=A(s);return(!a||t)&&(a=a||b(),T(s,a,"/",e)),a},S=(s,e,t=!1)=>{let r=t&&typeof e=="string"?e:JSON.stringify(e);localStorage.setItem(s,r)},D=(s,e=!1)=>{let t=localStorage.getItem(s);return t?e?t:JSON.parse(t):null},x=(s,e=!1)=>{let t=k(s);if(t)return S(s,t,e),t;let r=D(s,e);return r==null&&(e&&(r=b()),S(s,r,e)),r};var g=class{constructor(e="",t=""){this.sid=e||v("bst.sid.0",1800,!0),this.client=t||x("bst.cid.0",!0),this.commonStaticParams=this.getCommonStaticParams()}getCommonStaticParams(){return{client:this.client,loc:document.location.href,ref:document.referrer,sid:this.sid,ts:Date.now()}}getCommonDynamicParams(e){return{}}expandParams(e,t=void 0,r=[]){let a=e;return Object.keys(a).reduce((o,c)=>{let i=c,p=a[i];return typeof p=="function"&&!r.includes(i)?o[i]=Array.isArray(t)?p(...t):p():o[i]=p,o},{})}mergeCommonParmas(e){return m(m(m({},this.commonStaticParams),this.getCommonDynamicParams(e)),e)}normalizeParams(e){return this.mergeCommonParmas(this.expandParams(e))}getItemIds(e){var r;return((r=e==null?void 0:e.items)==null?void 0:r.map(a=>a.id))||[]}};var u=class{constructor(e,t){this.paramsOperator=new g(t==null?void 0:t.sid,t==null?void 0:t.client),this.systemParams=this.paramsOperator.expandParams(e,void 0,["_afterEvent"]),this.api_host=this.systemParams._api_host||"https://log.geniee-search."+(this.systemParams._dev?"dev":"net")}genUrl(){let e=new URL(this.api_host);return(this.systemParams._excepts||[]).forEach(r=>{e.searchParams.append("except",r)}),e.toString()}send(e){navigator.sendBeacon(this.genUrl(),JSON.stringify(e)),this.systemParams._afterEvent&&this.systemParams._afterEvent()}imp(e){let t=this.paramsOperator.normalizeParams(e);return l.logObject("\u9001\u4FE1\u30C7\u30FC\u30BF(imp)",t),this.send(t),t}findTargetElements(e){let t=0;return new Promise((r,a)=>{let n=setInterval(()=>{let o=document.querySelectorAll(e);o.length>0&&(clearInterval(n),r(o)),t>100&&(clearInterval(n),a(new Error(`\u30BF\u30FC\u30B2\u30C3\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002(${e})`))),t++},100)})}click(e,t){return h(this,null,function*(){let r;try{r=yield this.findTargetElements(e)}catch(n){l.error(n.toString());return}delete t._target;let a=this.paramsOperator.getCommonStaticParams();r.forEach((n,o)=>{let c=this.paramsOperator.expandParams(t,[n,Array.from(r),o]),i=m(m(m({rank:o},a),this.paramsOperator.getCommonDynamicParams(c)),c);n.addEventListener("click",()=>{let p=d(m({},i),{ts:Date.now()});l.logObject("\u9001\u4FE1\u30C7\u30FC\u30BF(click)",p),this.send(i)})})})}};var C=s=>({systemParams:Object.keys(s).reduce((t,r)=>{if(r.startsWith("_")){let a=r;t[a]=s[a],delete s[a]}return t},{}),userParams:s});self.gsmsSendEvent=s=>{let e=self.gsmsCommon||{},{systemParams:t,userParams:r}=C(m(m({},s),e)),a=r,n=new u(t,a),o=n.paramsOperator.mergeCommonParmas(a);n.send(o)};self.gsmsGetAPI=s=>new u(s||{});})();