!function(t,e,o,r,i){try{if(null==typeof i)return;if("string"!=typeof i)return;var n=function(){this.constant={COOKIE_KEY_O3_ID:"___o2u_o3id",COOKIE_KEY_DC1_ID:"___o2u_dc1id",COOKIE_KEY_DC1_ID_LIFETIME:31536e3,COOKIE_KEY_DC3_1D:"___o2u_dc3id",TIMEOUT_API_REQUEST:200,WAIT_TIME_API_RESPONSE:300,WAIT_RETRY_IMID:60,WAIT_RETRY_IMUID:20,UNSUPPORTED_BROWSER:["ie6","ie7","ie8"]},this.property={id:r,domain:o,isCookieEnabled:1}};n.prototype.convertStringToObject=function(t){try{return new Function("return "+t)()}catch(t){return{}}},n.prototype.logging=function(e){try{var o="string"==typeof this.property.domain?this.property.domain:"",r="string"==typeof e||"error"==typeof e?e:"";return("#u5Sq77frGuy475KLcXeYRMCQ7DyW3LF4"==location.hash||null!=o.match("^localhost")||null!=o.match("^test.")||null!=o.match("^testing.")||null!=o.match("^development."))&&t.console&&t.console.log&&(!r||console.log(r),!e.message||console.log(e.message),!e.stack||console.log(e.stack)),!0}catch(t){return!1}},n.prototype.setBrowser=function(){try{this.logging("exec setBrowser");var e=t.navigator.userAgent.toLowerCase(),o=t.navigator.appVersion.toLowerCase(),r="unknown";-1!=e.indexOf("msie")?r=-1!=o.indexOf("msie 6.")?"ie6":-1!=o.indexOf("msie 7.")?"ie7":-1!=o.indexOf("msie 8.")?"ie8":-1!=o.indexOf("msie 9.")?"ie9":-1!=o.indexOf("msie 10.")?"ie10":"ie":-1!=e.indexOf("trident/7")?r="ie11":-1!=e.indexOf("chrome")?r="chrome":-1!=e.indexOf("safari")?r="safari":-1!=e.indexOf("opera")?r="opera":-1!=e.indexOf("firefox")?r="firefox":-1!=e.indexOf("edge")&&(r="edge"),this.property.browser=r}catch(t){this.property.browser=""}return this},n.prototype.isSupportedBrowser=function(){try{if(this.logging("exec isSupportedBrowser"),void 0===this.property.browser||""==this.property.browser)throw new Error("not set browser name");if(-1!=this.constant.UNSUPPORTED_BROWSER.indexOf(this.property.browser))throw new Error(this.property.browser+" is unsupported browser");return!0}catch(t){return this.logging(t),!1}},n.prototype.loadScript=function(t,e){try{if(this.logging("exec loadScript : "+t),"string"!=typeof t)throw new Error("invalid argument endpoint");if("boolean"!=typeof e)throw new Error("invalid argument isAsync");var o=document.createElement("script");return o.src=null==t.match("^(http://|https://|//)")?this.getProtocol()+"//"+t:t,e&&void 0!==o.async&&(o.async=!0),document.body.appendChild(o),!0}catch(t){return this.logging(t),!1}},n.prototype.setCookie=function(t,e,o,r,i,n){try{if(this.logging("exec setCookie"),"string"!=typeof t)throw new Error("argument $k is not string");if("string"!=typeof e&&"number"!=typeof e)throw new Error("argument $v is not string, number");if("string"!=typeof o)throw new Error("argument $domain is not string");if("string"!=typeof r)throw new Error("argument $path is not string");if("number"!=typeof i)throw new Error("argument $lifetime is not number");if("string"!=typeof n)throw new Error("argument $secure is not string");if(0==this.property.isCookieEnabled)return this;var s=new Date((new Date).getTime()+i);return document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+"; expires="+s+(""!=o?"; domain="+o:"")+(""!=r?"; path="+r:"")+(""!=n?"; secure":""),!0}catch(t){return this.logging(t),!1}},n.prototype.getCookie=function(t){try{if(this.logging("exec getCookie"),0==this.property.isCookieEnabled)return"";if("string"!=typeof t&&""!=t)throw new Error("invalid argument $k");var e={search:new RegExp("(?:^|;\\s*)"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\="),extract:new RegExp("(?:^|.*;\\s*)"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*")};return e.search.test(document.cookie)?decodeURIComponent(document.cookie.replace(e.extract,"$1")):""}catch(t){return this.logging(t),""}},n.prototype.deleteCookie=function(t,e,o){try{if(this.logging("exec deleteCookie"),0==this.property.isCookieEnabled)return!1;var r=void 0!==e?e:location.hostname,i=void 0!==o?o:"";if("string"!=typeof t&&""!=t)throw new Error("invalid argument $k");if("string"!=typeof r&&""!=t)throw new Error("argument $host is not string");if("string"!=typeof i&&""!=t)throw new Error("argument $path is not string");return""!=i&&(document.cookie=encodeURIComponent(t)+"=; max-age=0; path="+i+"; domain="+r,document.cookie=encodeURIComponent(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path="+i+"; domain="+r),""==i&&(document.cookie=encodeURIComponent(t)+"=; max-age=0; domain="+r,document.cookie=encodeURIComponent(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain="+r),this}catch(t){return this.logging(t),!1}},n.prototype.setCookieStatus=function(){try{return this.logging("exec setCookieStatus"),0==this.property.isCookieEnabled?!1:(this.setCookie("_____write_test_","success",location.hostname,"/",60,""),"success"!=this.getCookie("_____write_test_")?(this.property.isCookieEnabled=0,!1):(this.deleteCookie("_____write_test_",location.hostname,"/"),!0))}catch(t){return this.logging(t),!1}},n.prototype.execGetRequest=function(e,o){try{var r,i=!1;if("function"!=typeof o&&(o=function(){}),void 0===t.XDomainRequest||"ie8"!=this.property.browser&&"ie9"!=this.property.browser?r=t.XMLHttpRequest?new XMLHttpRequest:t.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null:(r=new XDomainRequest,i=!0),null==r)throw new Error("browser is not support to ajax request");return r.open("GET",e,!0),r.timeout=this.constant.TIMEOUT_API_REQUEST,i?(r.onload=function(){o({status:200,url:e,type:"",text:r.responseText})},setTimeout((function(){r.send()}),0)):(r.addEventListener("loadend",(function(){o({status:r.status,url:r.responseURL,type:r.responseType,text:r.responseText})})),r.send()),!0}catch(t){return this.logging(t),!1}},n.prototype.requestOptout3rd=function(){try{this.logging("execute request optout 3rd");var t=location.protocol+"//"+this.property.domain+"/optout/set/?id="+this.property.id;this.loadScript(t,!0)}catch(t){this.logging(t)}},n.prototype.initImUidSdk=function(){try{t[e].logging("exec initImUidSdk"),this.loadScript(i.imuidScriptEndpoint,!1),t.IMUIDRequest=t.IMUIDRequest||[],IMUIDRequest.push({customerId:i.imuidCustomerId,callback:function(o){o.uid?t[e].property.im_uid=o.uid:t[e].logging("Could not get imuid...")},callbackTimeout:1e3})}catch(t){this.logging(t)}return this},n.prototype.waitForGettingProperty=function(o,r,i){var n=0,s=setInterval((function(){try{if(n++,""==t[e].property[o]&&n<=r)return}catch(o){t[e].logging(o)}clearInterval(s),i.call()}),50)},n.prototype.waitForLogCollectSdk=function(){return new Promise((function(o){let r=0;const i=setInterval((function(){try{if(r++,r>1200)throw new Error("[TIMEOUT] Failed load LogCollectSdk Tag");try{const t=typeof O2uLogCollectSdk;if(0==("undefined"!=t&&"function"==t.toLowerCase()))return}catch(t){return}clearInterval(i),o(!0)}catch(r){clearInterval(i),r=r instanceof Error?r:"Failed to load LogCollectSdk Tag :: "+r,t[e].logging(r),o(!1)}}),50)}))};var s=new n;if(i="object"==typeof s.convertStringToObject(i)?s.convertStringToObject(i):{},s.property.optout=void 0!==i.optout?i.optout:"",s.property.siteId=void 0!==i.site&&void 0!==i.site.siteId?i.site.siteId:"",s.property.clientId=void 0!==i.site&&void 0!==i.site.clientId?i.site.clientId:"",s.property.o3id=void 0!==i.o3Id?i.o3Id:"",s.property.dc1id=void 0!==i.dc1Id?i.dc1Id:"",s.property.dc3id=void 0!==i.dc3Id?i.dc3Id:"",s.property.imApiEndpoint=void 0!==i.imApiEndpoint?i.imApiEndpoint:"",s.property.tagType=void 0!==i.site&&void 0!==i.site.tagType?i.site.tagType:"",s.property.scriptName=void 0!==i.site&&void 0!==i.site.scriptName?i.site.scriptName:"",s.property.customParameter=void 0!==i.customParameter&&"object"==typeof i.customParameter?i.customParameter:{},s.property.tdConfig={tdDatabase:void 0!==i.site&&void 0!==i.site.tdDatabase?i.site.tdDatabase:"",tdTable:void 0!==i.site&&void 0!==i.site.tdTable?i.site.tdTable:""},s.setCookieStatus(),s.setBrowser(),t[e]=s,""==s.property.imApiEndpoint)return;if("optout"==s.property.optout)return s.logging("is optout browser"),void s.setCookie(s.constant.COOKIE_KEY_DC1_ID,"optout","","/",s.constant.COOKIE_KEY_DC1_ID_LIFETIME,"");if("optout"==s.getCookie(s.constant.COOKIE_KEY_DC1_ID)&&s.setCookie(s.constant.COOKIE_KEY_DC1_ID,"","","/",s.constant.COOKIE_KEY_DC1_ID_LIFETIME,""),!s.isSupportedBrowser())return void s.logging("not supported browser");s.loadScript(("https:"===document.location.protocol?"https:":"http:")+"//cdn.o2u.jp/scripts/log-collect-sdk/1.1.0/log-collect-sdk.min.js",!0),t[e].logging("get im api"),t[e].property.imid="";var c=t[e].property.imApiEndpoint+"?token=11Edm_Tsc8jGM09UZqwoBg&callback=window.___o2u_callback_view_track_func";t[e].loadScript(c,!0),t[e].property.im_uid="",t[e].initImUidSdk();const a=t[e].getCookie(t[e].constant.COOKIE_KEY_DC1_ID);a&&(t[e].property.dc1id=a),t[e].setCookie(t[e].constant.COOKIE_KEY_DC1_ID,t[e].property.dc1id,"","/",t[e].constant.COOKIE_KEY_DC1_ID_LIFETIME,"");const d=async function(o){try{t[e].logging("exec sendLogToLogCollectApi");if(!await s.waitForLogCollectSdk())throw Error("LogCollectSdk does not exist");if(!i.logCollectEndpoint)throw Error("$option.logCollectEndpoint is not defined");if("string"!=typeof i.logCollectEndpoint)throw Error("$option.logCollectEndpoint is not string");const r=new O2uLogCollectSdk({endpoint:i.logCollectEndpoint});r.setDatabase(s.property.tdConfig.tdDatabase).setTable(s.property.tdConfig.tdTable).setDataType("view");const n=await r.sendLog(o,{addOptionColumnFlag:!0});if(n.error)throw Error("LogCollectSdk::Failed sendLog\n"+n.error_message);s.logging("Success sending log to log-collect-api!"),s.logging({message:{"Sent to log-collect-api data":n.sent_data}})}catch(t){s.logging(Error("Stopped sending log to log-collect-api\nReason: "+t.message))}};var p={};p.sendViewTrackingLog=function(){try{t[e].logging("execute send view tracking log");const r={},i=Object.keys(t[e].property.customParameter);for(var o=0;o{s.waitForGettingProperty("im_uid",t[e].constant.WAIT_RETRY_IMUID,p.sendViewTrackingLog)}))}catch(t){return!0}}(window,"___o2u_v__100_7BEeWfEe7GaDGnm+eZ+2Uw==","a.o2u.jp","7BEeWfEe7GaDGnm+eZ+2Uw==","{'dc3Id':'69af0ae5-65b5-4fe4-981d-d64cbcb311c1','imuidCustomerId':'1007685','imuidScriptEndpoint':'https://dmp.im-apps.net/sdk/im-uid.js','optout':'','site':{'id':'045974_____0001','siteId':'0001','clientId':'045974','tdHost':'in.treasuredata.com','tdDatabase':'m_045974','tdTable':'sys_0001','tdApikey':'4433/bf476bf3cefadaaed0e8e87b19bd4a38dc17dd3d','scriptName':'','tagType':'tracking','resposneStyle':''},'dc1Id':'04c9f6db-5979-4597-a1c2-6792f022b9cf','customParameter':{},'o3Id':'69af0ae5-65b5-4fe4-981d-d64cbcb311c1','logCollectEndpoint':'https://a.o2u.jp/lc','imApiEndpoint':'https://sync.im-apps.net/imid/segment'}"),window.___o2u_callback_view_track_func=function(t){try{var e="___o2u_v__100_7BEeWfEe7GaDGnm+eZ+2Uw==";return window[e].property.imid=void 0!==t.imid?t.imid:"",window[e].property.segment_eids=void 0!==t.segment_eids?t.segment_eids:"",!0}catch(t){return!1}};