(function(t,e,r,i,o,s){if(typeof e==undefined||typeof r==undefined||typeof i==undefined||typeof o==undefined||typeof s==undefined)return;if(typeof e!="string")return;if(typeof r!="string")return;if(typeof i!="string")return;if(typeof o!="string")return;var e=e;if(typeof t.CustomEvent!=="function"){function n(t,e){e=e||{bubbles:false,cancelable:false,detail:undefined};var r=document.createEvent("CustomEvent");r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail);return r}n.prototype=t.Event.prototype;t.CustomEvent=n}var a=function(){this.constant={LIMIT_COOKIE_KEY_LENGTH_IE:35,LIMIT_COOKIE_BYTE_VOLUME_IE:8500,LIMIT_COOKIE_KEY_LENGTH_FIREFOX:125,LIMIT_COOKIE_BYTE_VOLUME_FIREFOX:25165824,LIMIT_COOKIE_KEY_LENGTH_CHROME:155,LIMIT_COOKIE_BYTE_VOLUME_CHROME:25165824,LIMIT_COOKIE_KEY_LENGTH_SAFARI:550,LIMIT_COOKIE_BYTE_VOLUME_SAFARI:3e3,LIMIT_COOKIE_KEY_LENGTH_OPERA:40,LIMIT_COOKIE_BYTE_VOLUME_OPERA:8500,LIMIT_COOKIE_KEY_LENGTH_UNKNOWN:40,LIMIT_COOKIE_BYTE_VOLUME_UNKNOWN:8500,COOKIE_LIFETIME_DEFAULT:60*60*24*365*1*1e3,COOKIE_LIFETIME_SESSION:60*30*1e3,COOKIE_KEY_USER_ID:"__juicer_uid_9i3nsdfP_",COOKIE_KEY_JUICER_ID:"__juicer_jid_9i3nsdfP_",COOKIE_KEY_SESSION_ID:"__juicer_sesid_9i3nsdfP_",COOKIE_KEY_SESSION_REFERRER:"__juicer_session_referrer_9i3nsdfP_",COOKIE_KEY_INTEREST_ID:"__juicer_interestid_9i3nsdfP_",COOKIE_KEY_PEACH_ID:"__juicer_peach_id_9i3nsdfP_",COOKIE_KEY_TD_GLOBAL_ID:"_td_global",COOKIE_KEY_TD_CLIENT_ID:"_td",COOKIE_KEY_IS_OPTOUT:"__juicer_optout_",UNSUPPORTED_BROWSER:["ie6","ie7","ie8","ie9"],TIMEOUT_SMOOOTHIE_API_REQUEST:2e3,TD_TABLE_BASE_LOG:"juicertag_first_logs",TD_TABLE_ABTEST_LOG:"juicertag_abtest_logs",TD_TABLE_POPUP_NPS_LOG:"juicertag_nps_logs",TD_TABLE_POPUP_AD_IMPRESSION_LOG:"juicertag_popup_impression_logs",TD_TABLE_POPUP_AD_CLICK_LOG:"juicertag_popup_click_logs",TD_TABLE_COLLABORATION_TG_LOG:"juicertag_collaborate_tag007_logs",TD_TABLE_SECOND_LOG:"juicertag_second_logs",TD_TABLE_ABTEST_CLICK_LOG:"juicertag_click_logs",IS_NOT_PRIVATE_MODE:1,IS_PRIVATE_MODE:2,DEVICE_TYPE_PC:"pc",DEVICE_TYPE_TABLET:"tablet",DEVICE_TYPE_SMARTPHONE:"smartphone",DEVICE_TYPE_UNKNOWN:"unknown",SEX_TYPE_MALE:1,SEX_TYPE_FEMALE:2,SEX_TYPE_DATA:{1:"男性",2:"女性"},IP_INFO_RESOURCE_TYPE_DATA:{dokodokojp:1,landscape:2}};this.property={domain:r,id:{},config:"",pageInActionId:"",color:i,siteId:"",syncId:"",juicerId:"",userId:"",sessionId:"",interestId:"",peachId:"",tdClientId:"",tdGlobalId:"",imUid:"",ipUaMixIdByMd5:"",ipUaMixIdBySha256:"",endpoint:"",browser:"",browserVersion:"",charset:"",host:"",ip:"",language:"",os:"",osVersion:"",path:"",platform:"",referrer:"",screen:"",time:"",title:"",protocol:"",url:"",userAgent:"",version:"",viewport:"",userCard:{},interestCategoryDefault:{},interestCategoryO:{},age:0,sex:0,area:"",storageType:0,isPrivateMode:0,cookieStatus:{},ready:false,isLoadedTreasureDataSdk:false,tdData:{},option:{}}};a.prototype.validateObjectType=function(t,e){var r=typeof t;return r!="undefined"&&r.toLowerCase()==e?true:false};a.prototype.getByteLength=function(t){try{if(!this.validateObjectType(t,"string"))throw new Error("argument $v is not string");return encodeURI(t).replace(/%../g,"*").length}catch(e){e=e instanceof Error?e:"getByteLength :: "+e;this.logging(e);return 0}};a.prototype.convertStringToObject=function(t){try{return new Function("return "+t)()}catch(e){return{}}};a.prototype.logging=function(e){try{var r=typeof this.property.domain=="string"?this.property.domain:"";var i=typeof e=="string"||typeof e=="error"?e:"";if((location.hash=="#u5Sq77frGuy475KLcXeYRMCQ7DyW3LF4"||r.match("^localhost")!=null||r.match("^test.")!=null||r.match("^testing.")!=null||r.match("^development.")!=null)&&t.console&&t.console.log){if(location.hash=="#u5Sq77frGuy475KLcXeYRMCQ7DyW3LF4"&&typeof e.stack!="undefined")console.error(e);!i||console.log(i);!e.message||console.log(e.message);!e.stack||console.log(e.stack)}return true}catch(o){return false}};a.prototype.execGetRequest=function(e,r){try{var i;var o=false;if(!this.validateObjectType(r,"function"))r=function(t){};if(typeof t.XDomainRequest!="undefined"&&(this.getBrowser()=="ie8"||this.getBrowser()=="ie9")){i=new XDomainRequest;o=true}else if(t.XMLHttpRequest){i=new XMLHttpRequest}else if(t.ActiveXObject){i=new ActiveXObject("Microsoft.XMLHTTP")}else{i=null}if(i==null)throw new Error("browser is not support to ajax request");i.open("GET",e,true);i.timeout=this.constant.TIMEOUT_SMOOOTHIE_API_REQUEST;if(!o){i.addEventListener("loadend",function(){r({status:i.status,url:i.responseURL,type:i.responseType,text:i.responseText})});i.send()}else{i.onload=function(){r({status:200,url:e,type:"",text:i.responseText})};setTimeout(function(){i.send()},0)}return true}catch(s){s=s instanceof Error?s:"execGetRequest :: "+s;this.logging(s);return false}};a.prototype.setCharset=function(){return this};a.prototype.setLanguage=function(){return this};a.prototype.setOs=function(){return this};a.prototype.setOsVersion=function(){return this};a.prototype.setPlatform=function(){return this};a.prototype.setScreen=function(){return this};a.prototype.setVersion=function(){return this};a.prototype.setViewport=function(){return this};a.prototype.setBrowser=function(){try{var e=t.navigator.userAgent.toLowerCase();var r=t.navigator.appVersion.toLowerCase();var i="unknown";if(e.indexOf("msie")!=-1){if(r.indexOf("msie 6.")!=-1){i="ie6"}else if(r.indexOf("msie 7.")!=-1){i="ie7"}else if(r.indexOf("msie 8.")!=-1){i="ie8"}else if(r.indexOf("msie 9.")!=-1){i="ie9"}else if(r.indexOf("msie 10.")!=-1){i="ie10"}else{i="ie"}}else if(e.indexOf("trident/7")!=-1){i="ie11"}else if(e.indexOf("chrome")!=-1){i="chrome"}else if(e.indexOf("safari")!=-1){i="safari"}else if(e.indexOf("opera")!=-1){i="opera"}else if(e.indexOf("firefox")!=-1){i="firefox"}else if(e.indexOf("edge")!=-1){i="edge"}this.property.browser=i}catch(o){this.property.browser=""}return this};a.prototype.setBrowserVersion=function(){return this};a.prototype.setUserAgent=function(){try{this.property.userAgent=t.navigator.userAgent}catch(e){this.property.userAgent=""}return this};a.prototype.setReferrer=function(){try{this.property.referrer=document.referrer}catch(t){this.property.referrer=""}return this};a.prototype.setTime=function(){try{this.property.time=(new Date).getTime()}catch(t){this.property.time=""}return this};a.prototype.setTitle=function(){try{this.property.title=document.title.replace(/^\s+|\s+$/g,"")}catch(t){this.property.title=""}return this};a.prototype.setUrl=function(){try{this.property.url=location.href}catch(t){this.property.url=""}return this};a.prototype.setProtocol=function(){try{this.property.protocol=location.protocol}catch(t){this.property.protocol=""}return this};a.prototype.setHost=function(){try{this.property.host=location.hostname}catch(t){this.property.host=""}return this};a.prototype.setPath=function(){try{this.property.path=location.pathname}catch(t){this.property.path=""}return this};a.prototype.setId=function(t){this.property.id=t;return this};a.prototype.setIp=function(t){this.property.ip=t;return this};a.prototype.setDomain=function(t){this.property.domain=t;return this};a.prototype.setEndpoint=function(t){this.property.endpoint=t;return this};a.prototype.setTdData=function(t){this.property.tdData=t;return this};a.prototype.setJuicerId=function(t){this.property.juicerId=t;return this};a.prototype.setUserId=function(t){this.property.userId=t;return this};a.prototype.setSessionId=function(t){this.property.sessionId=t;return this};a.prototype.setPeachId=function(t){this.property.peachId=t;return this};a.prototype.setInterestId=function(t){this.property.interestId=t;return this};a.prototype.setTdClientId=function(t){this.property.tdClientId=t;return this};a.prototype.setTdGlobalId=function(t){this.property.tdGlobalId=t;return this};a.prototype.setConfig=function(t){this.property.config=t;return this};a.prototype.setColor=function(t){this.property.color=t;return this};a.prototype.setSiteId=function(t){if(!this.validateObjectType(t,"string")&&!this.validateObjectType(t,"number"))return this;if(this.validateObjectType(t,"string")){t=t.match(/^[0-9]{1,}$/)&&parseInt(t)==parseInt(t)?parseInt(t):0}this.property.siteId=t;return this};a.prototype.setSyncId=function(t){this.property.syncId=t;return this};a.prototype.setOption=function(t){this.property.option=t;return this};a.prototype.setInterestCategoryDefault=function(t){if(!this.validateObjectType(t,"object"))return this;this.property.interestCategoryDefault=t;return this};a.prototype.setInterestCategoryO=function(t){if(!this.validateObjectType(t,"object"))return this;this.property.interestCategoryO=t;return this};a.prototype.setArea=function(t){if(!this.validateObjectType(t,"string"))return this;this.property.area=t;return this};a.prototype.setPageInActionId=function(t){if(!this.validateObjectType(t,"string"))return this;this.property.pageInActionId=t;return this};a.prototype.setIpUaMixIdByMd5=function(t){this.property.ipUaMixIdByMd5=t;return this};a.prototype.setIpUaMixIdBySha256=function(t){this.property.ipUaMixIdBySha256=t;return this};a.prototype.setImuid=function(t){this.property.imUid=t;return this};a.prototype.setDevice=function(t){if(!this.validateObjectType(t,"string"))return this;this.property.device=t;return this};a.prototype.setUserCard=function(t){if(!this.validateObjectType(t,"object"))return this;this.property.userCard=t;if(!this.validateObjectType(this.property.userCard.age,"string")&&!this.validateObjectType(this.property.userCard.age,"number"))this.property.userCard.age=0;if(this.validateObjectType(this.property.userCard.age,"string")&&parseInt(this.property.userCard.age)!=parseInt(this.property.userCard.age))this.property.userCard.age=0;this.property.userCard.age=parseInt(this.property.userCard.age);if(!this.validateObjectType(this.property.userCard.sex,"string")&&!this.validateObjectType(this.property.userCard.sex,"number"))this.property.userCard.sex=0;if(this.validateObjectType(this.property.userCard.sex,"string")&&parseInt(this.property.userCard.sex)!=parseInt(this.property.userCard.sex))this.property.userCard.sex=0;this.property.userCard.sex=parseInt(this.property.userCard.sex);return this};a.prototype.getBrowser=function(){return this.validateObjectType(this.property.browser,"string")?this.property.browser:""};a.prototype.getBrowserVersion=function(){return this.validateObjectType(this.property.browserVersion,"string")?this.property.browserVersion:""};a.prototype.getDevice=function(){return this.validateObjectType(this.property.device,"string")?this.property.device:""};a.prototype.getCharset=function(){return this.validateObjectType(this.property.charset,"string")?this.property.charset:""};a.prototype.getHost=function(){return this.validateObjectType(this.property.host,"string")?this.property.host:""};a.prototype.getProtocol=function(){return this.validateObjectType(this.property.protocol,"string")?this.property.protocol:""};a.prototype.getIp=function(){return this.validateObjectType(this.property.ip,"string")?this.property.ip:""};a.prototype.getLanguage=function(){return this.validateObjectType(this.property.language,"string")?this.property.language:""};a.prototype.getOs=function(){return this.validateObjectType(this.property.os,"string")?this.property.os:""};a.prototype.getOsVersion=function(){return this.validateObjectType(this.property.osVersion,"string")?this.property.osVersion:""};a.prototype.getPath=function(){return this.validateObjectType(this.property.path,"string")?this.property.path:""};a.prototype.getPlatform=function(){return this.validateObjectType(this.property.platform,"string")?this.property.platform:""};a.prototype.getReferrer=function(){return this.validateObjectType(this.property.referrer,"string")?this.property.referrer:""};a.prototype.getScreen=function(){return this.validateObjectType(this.property.screen,"string")?this.property.screen:""};a.prototype.getUserAgent=function(){return this.validateObjectType(this.property.userAgent,"string")?this.property.userAgent:""};a.prototype.getVersion=function(){return this.validateObjectType(this.property.version,"string")?this.property.version:""};a.prototype.getViewport=function(){return this.validateObjectType(this.property.viewport,"string")?this.property.viewport:""};a.prototype.getTime=function(){return this.validateObjectType(this.property.time,"number")?this.property.time:""};a.prototype.getTitle=function(){return this.validateObjectType(this.property.title,"string")?this.property.title:""};a.prototype.getDomain=function(){return this.validateObjectType(this.property.domain,"string")?this.property.domain:""};a.prototype.getEndpoint=function(){return this.validateObjectType(this.property.endpoint,"string")?this.property.endpoint:""};a.prototype.getUrl=function(){return this.validateObjectType(this.property.url,"string")?this.property.url:""};a.prototype.getReady=function(){return this.validateObjectType(this.property.ready,"boolean")?this.property.ready:false};a.prototype.getPrivateMode=function(){return this.validateObjectType(this.property.isPrivateMode,"number")?this.property.isPrivateMode:0};a.prototype.getStorageType=function(){return this.validateObjectType(this.property.storageType,"number")?this.property.storageType:0};a.prototype.getTdData=function(){return this.validateObjectType(this.property.tdData,"object")?this.property.tdData:{}};a.prototype.getJuicerId=function(){return this.validateObjectType(this.property.juicerId,"string")?this.property.juicerId:""};a.prototype.getUserId=function(){return this.validateObjectType(this.property.userId,"string")?this.property.userId:""};a.prototype.getSessionId=function(){return this.validateObjectType(this.property.sessionId,"string")?this.property.sessionId:""};a.prototype.getPeachId=function(){return this.validateObjectType(this.property.peachId,"string")?this.property.peachId:""};a.prototype.getInterestId=function(){return this.validateObjectType(this.property.interestId,"string")?this.property.interestId:""};a.prototype.getTdClientId=function(){return this.validateObjectType(this.property.tdClientId,"string")?this.property.tdClientId:""};a.prototype.getTdGlobalId=function(){return this.validateObjectType(this.property.tdGlobalId,"string")?this.property.tdGlobalId:""};a.prototype.getConfig=function(){return this.validateObjectType(this.property.config,"object")?this.property.config:{}};a.prototype.getSyncId=function(){return this.validateObjectType(this.property.syncId,"string")?this.property.syncId:""};a.prototype.getOption=function(){return this.validateObjectType(this.property.option,"object")?this.property.option:{}};a.prototype.getUserCard=function(){return this.validateObjectType(this.property.userCard,"object")?this.property.userCard:{}};a.prototype.getInterestCategoryDefault=function(){return this.validateObjectType(this.property.interestCategoryDefault,"object")?this.property.interestCategoryDefault:{}};a.prototype.getInterestCategoryO=function(){return this.validateObjectType(this.property.interestCategoryO,"object")?this.property.interestCategoryO:{}};a.prototype.getArea=function(){return this.validateObjectType(this.property.area,"string")?this.property.area:""};a.prototype.getPageInActionId=function(){return this.validateObjectType(this.property.pageInActionId,"string")?this.property.pageInActionId:""};a.prototype.getId=function(){return this.validateObjectType(this.property.id,"object")?this.property.id:{}};a.prototype.getSiteId=function(){return this.validateObjectType(this.property.siteId,"number")?this.property.siteId:0};a.prototype.getColor=function(){return this.validateObjectType(this.property.color,"string")?this.property.color:{}};a.prototype.getIpUaMixIdByMd5=function(){return this.validateObjectType(this.property.ipUaMixIdByMd5,"string")?this.property.ipUaMixIdByMd5:""};a.prototype.getIpUaMixIdBySha256=function(){return this.validateObjectType(this.property.ipUaMixIdBySha256,"string")?this.property.ipUaMixIdBySha256:""};a.prototype.getImuid=function(){return this.validateObjectType(this.property.imUid,"string")?this.property.imUid:""};a.prototype.getLocalStorage=function(e){try{if(!this.validateObjectType(e,"string"))throw new Error("argument $k is not string");if(e=="")return"";return t.localStorage.getItem(e)!=null?t.localStorage.getItem(e):""}catch(r){r=r instanceof Error?r:"getLocalStorage :: "+r;this.logging(r);return""}};a.prototype.setLocalStorage=function(e,r){if(!this.validateObjectType(e,"string"))throw new Error("argument $k is not string");if(!this.validateObjectType(r,"string")&&!this.validateObjectType(r,"number"))throw new Error("argument $v is not string, number");if(e=="")return"";t.localStorage.setItem(e,r);return this};a.prototype.deleteLocalStorage=function(e){try{if(!this.validateObjectType(e,"string"))throw new Error("argument $k is not string");if(e=="")return"";t.localStorage.removeItem(e);return this}catch(r){r=r instanceof Error?r:"deleteLocalStorage :: "+r;this.logging(r);return this}};a.prototype.deleteAllLocalStorage=function(t){this.deleteLocalStorage(this.constant.COOKIE_KEY_USER_ID).deleteLocalStorage(this.constant.COOKIE_KEY_JUICER_ID).deleteLocalStorage(this.constant.COOKIE_KEY_SESSION_ID).deleteLocalStorage(this.constant.COOKIE_KEY_INTEREST_ID);return this};a.prototype.setCookie=function(t,e,r,i,o,s){try{if(!this.validateObjectType(t,"string"))throw new Error("argument $k is not string");if(!this.validateObjectType(e,"string")&&!this.validateObjectType(e,"number"))throw new Error("argument $v is not string, number");if(!this.validateObjectType(r,"string"))throw new Error("argument $domain is not string");if(!this.validateObjectType(i,"string"))throw new Error("argument $path is not string");if(!this.validateObjectType(o,"number"))throw new Error("argument $lifetime is not number");if(!this.validateObjectType(s,"string"))throw new Error("argument $secure is not string");if(!this.validateObjectType(this.property.cookieStatus,"object")||!this.validateObjectType(this.property.cookieStatus.cookieWriteEnabled,"number")||this.property.cookieStatus.cookieWriteEnabled!=1)return this;var n=new Date(this.getTime()+o);document.cookie=escape(t)+"="+escape(e)+"; expires="+n+(r!=""?"; domain="+r:"")+(i!=""?"; path="+i:"")+(s!=""?"; secure":"");return this}catch(a){a=a instanceof Error?a:"setCookie :: "+a;this.logging(a);return this}};a.prototype.getCookie=function(t){try{if(!this.validateObjectType(t,"string"))throw new Error("argument $k is not string");if(t=="")return"";var e=null;e=new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=");if(!e.test(document.cookie))return"";e=new RegExp("(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*");return unescape(document.cookie.replace(e,"$1"))}catch(r){r=r instanceof Error?r:"getCookie :: "+r;this.logging(r);return""}};a.prototype.deleteCookie=function(t,e,r){try{var e=!this.validateObjectType(e,"undefined")?e:this.property.getHost();var r=!this.validateObjectType(r,"undefined")?r:"";if(!this.validateObjectType(t,"string"))throw new Error("argument $k is not string");if(!this.validateObjectType(e,"string"))throw new Error("argument $host is not string");if(!this.validateObjectType(r,"string"))throw new Error("argument $path is not string");if(t=="")return"";if(r!=""){document.cookie=escape(t)+"=; max-age=0"+"; path="+r+"; domain="+e;document.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+"; path="+r+"; domain="+e}if(r==""){document.cookie=escape(t)+"=; max-age=0"+"; domain="+e;document.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+"; domain="+e}return this}catch(i){i=i instanceof Error?i:"deleteCookie :: "+i;this.logging(i);return this}};a.prototype.setPrivateMode=function(){try{var r;if(this.getBrowser()=="chrome"){t.webkitRequestFileSystem(t.TEMPORARY,1,function(){t[e].property.isPrivateMode=1},function(r){t[e].property.isPrivateMode=2});return this}if(this.getBrowser()=="firefox"){try{r=t.indexedDB.open("test")}catch(n){t[e].property.isPrivateMode=2;return this}if(t[e].property.isPrivateMode==0){var i=0;var o=3;var s=10;retry=t.setInterval(function(){try{i++;if(r.readyState!="done"&&i=o)t.clearInterval(retry);if(!r.result||typeof r.result=="undefined"){t[e].property.isPrivateMode=2;return}t[e].property.isPrivateMode=1;return}catch(n){t.clearInterval(retry)}},10)}return this}if(t.localStorage&&this.getBrowser()=="safari"){try{t.localStorage.setItem("_m_i_x_e_r_local_storage_test",1);this.property.isPrivateMode=1;t.localStorage.removeItem("_m_i_x_e_r_local_storage_test")}catch(n){this.property.isPrivateMode=2}return this}if(this.getBrowser().match(/^ie[0-9]{1,2}$/)!=null||this.getBrowser()=="edge"){try{if(t.indexedDB)this.property.isPrivateMode=1;if(!t.indexedDB||typeof t.indexedDB==undefined)this.property.isPrivateMode=2}catch(n){this.property.isPrivateMode=2}return this}this.property.isPrivateMode=1}catch(n){this.property.isPrivateMode=1}return this};a.prototype.setStorageType=function(){try{this.property.storageType=!t.localStorage?1:2;if(this.property.storageType==1)return this;try{t.localStorage.setItem("_m_i_x_e_r_","success");if(t.localStorage.getItem("_m_i_x_e_r_")!="success")throw new Error("disable local storage");t.localStorage.removeItem("_m_i_x_e_r_")}catch(r){this.logging("Safari(プライベートモード)の為、ローカルストレージを使用出来ません");this.property.storageType=1;return this}var e={cookie:this.getCookie(this.constant.COOKIE_KEY_USER_ID),localStorage:this.getLocalStorage(this.constant.COOKIE_KEY_USER_ID)};if(e.cookie==""&&e.localStorage=="")return this;if(e.cookie!=""&&e.localStorage!=""){this.deleteCookie(this.constant.COOKIE_KEY_USER_ID,this.getHost(),"/").deleteCookie(this.constant.COOKIE_KEY_JUICER_ID,this.getHost(),"/")}if(e.localStorage!="")return this;this.setLocalStorage(this.constant.COOKIE_KEY_USER_ID,this.getCookie(this.constant.COOKIE_KEY_USER_ID)).setLocalStorage(this.constant.COOKIE_KEY_JUICER_ID,this.getCookie(this.constant.COOKIE_KEY_JUICER_ID));this.deleteCookie(this.constant.COOKIE_KEY_USER_ID,this.getHost(),"/").deleteCookie(this.constant.COOKIE_KEY_JUICER_ID,this.getHost(),"/")}catch(r){this.property.storageType=3}return this};a.prototype.setCookieStatus=function(){try{this.logging("exec setCookieStatus");this.property.cookieStatus={cookieKeyLength:0,cookieKeyVolume:0,cookieWriteEnabled:1,isManyCookieKey:true,isHighCapacityCookie:true};this.setCookie("_t_e_s_t_c_o_o_k_i_e_","success",this.getHost(),"/",this.constant.COOKIE_LIFETIME_DEFAULT,"");if(this.getCookie("_t_e_s_t_c_o_o_k_i_e_")!="success"){this.property.cookieStatus.cookieWriteEnabled=0;return this}this.deleteCookie("_t_e_s_t_c_o_o_k_i_e_",this.getHost(),"/");if(this.getStorageType()==2)return this;this.property.cookieStatus.cookieKeyLength=document.cookie.split(";").length;this.property.cookieStatus.cookieKeyVolume=this.getByteLength(document.cookie);if(this.getBrowser().match(/^ie[0-9]{1,2}$/)!=null||this.getBrowser()=="edge"){this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_IE?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_IE?true:false}else if(this.getBrowser()=="firefox"){this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_FIREFOX?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_FIREFOX?true:false}else if(this.getBrowser()=="chrome"){this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_CHROME?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_CHROME?true:false}else if(this.getBrowser()=="safari"){this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_SAFARI?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_SAFARI?true:false}else if(this.getBrowser()=="opera"){this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_OPERA?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_OPERA?true:false}else{this.property.cookieStatus.isManyCookieKey=this.property.cookieStatus.cookieKeyLength>this.constant.LIMIT_COOKIE_KEY_LENGTH_UNKNOWN?true:false;this.property.cookieStatus.isHighCapacityCookie=this.property.cookieStatus.cookieKeyVolume>this.constant.LIMIT_COOKIE_BYTE_VOLUME_UNKNOWN?true:false}return this}catch(t){this.funcTagDisabled();t=t instanceof Error?t:"updateJuicerId :: "+t;this.logging(t);return this}};a.prototype.getCookieStatus=function(){try{this.logging("exec getCookieStatus");if(!this.validateObjectType(this.property.cookieStatus.cookieKeyLength,"number")||!this.validateObjectType(this.property.cookieStatus.cookieKeyVolume,"number")||!this.validateObjectType(this.property.cookieStatus.isManyCookieKey,"boolean")||!this.validateObjectType(this.property.cookieStatus.isHighCapacityCookie,"boolean"))throw new Error("Invalid cookie status");return this.property.cookieStatus}catch(t){this.funcTagDisabled();t=t instanceof Error?t:"getCookieStatus :: "+t;this.logging(t);return{}}};a.prototype.funcTagEnabled=function(){this.property.ready=true};a.prototype.funcTagDisabled=function(){this.property.ready=false};a.prototype.funcTreasureDataSdkEnabled=function(){this.property.isLoadedTreasureDataSdk=true};a.prototype.isTresureDataSdk=function(){if(!this.validateObjectType(this.getConfig(),"object")||!this.validateObjectType(this.getConfig().siteInfo,"object")||!this.validateObjectType(this.getConfig().siteInfo.sdkTresureData,"boolean"))return false;return this.getConfig().siteInfo.sdkTresureData?true:false};a.prototype.isLoadedTreasureDataSdk=function(){return this.validateObjectType(this.property.isLoadedTreasureDataSdk,"boolean")==true&&this.property.isLoadedTreasureDataSdk==true?true:false};a.prototype.waitForReadingTreasureDataSdk=function(r){var i=0;var o=1200;var s=50;var n=setInterval(function(){try{i++;if(i>o)throw new Error("not initialize core script");try{if(t[e].getReady()==false)return}catch(s){return}try{if(t[e].validateObjectType(JuicerTreasure,"function")==false)return}catch(s){return}t[e].funcTreasureDataSdkEnabled();clearInterval(n);r.call()}catch(s){t[e].funcTagDisabled();s=s instanceof Error?s:"not initialize core script :: "+s;t[e].logging(s);clearInterval(n)}},s)};a.prototype.init=function(){try{this.logging("exec initialize");this.setTime().setUrl().setProtocol().setHost().setPath().setReferrer().setTitle().setUserAgent().setBrowser().setPrivateMode().setStorageType();if(!this.validateObjectType(this.getStorageType(),"number")||this.getStorageType()==0)throw new Error("Invalid storage type");this.setCookieStatus();this.funcTagEnabled()}catch(t){this.funcTagDisabled();t=t instanceof Error?t:"init :: "+t;this.logging(t)}return this};a.prototype.initConfiguration=function(r){try{this.logging("exec initConfiguration");var i=o+"&"+"url="+encodeURIComponent(this.getUrl())+"&"+"userAgent="+encodeURIComponent(this.getUserAgent());this.execGetRequest(i,function(i){try{if(typeof i.status=="undefined"||typeof i.text=="undefined"||i.status!="200"||i.text=="")throw new Error("exec initConfiguration : invalid response data");i=t[e].convertStringToObject(i.text);if(!t[e].validateObjectType(i.status,"boolean")||i.status!=true)throw new Error("exec initConfiguration : failed get tag conifguration");if(!t[e].validateObjectType(i.id,"object"))throw new Error("exec initConfiguration : empty $response.id");if(!t[e].validateObjectType(i.tdData,"object"))throw new Error("exec initConfiguration : empty $response.tdData");if(!t[e].validateObjectType(i.endpoint,"string"))throw new Error("exec initConfiguration : empty $response.endpoint");if(!t[e].validateObjectType(i.ip,"string"))throw new Error("exec initConfiguration : empty $response.ip");if(!t[e].validateObjectType(i.config,"object"))throw new Error("exec initConfiguration : empty $response.config");if(!t[e].validateObjectType(i.config.siteInfo,"object"))throw new Error("exec initConfiguration : empty $response.config.siteInfo");if(!t[e].validateObjectType(i.config.abtestInfo,"object"))throw new Error("exec initConfiguration : empty $response.config.abtestInfo");t[e].setId(i.id).setConfig(i.config).setTdData(i.tdData).setEndpoint(i.endpoint).setIp(i.ip);t[e].funcTagEnabled();r()}catch(o){t[e].funcTagDisabled();o=o instanceof Error?o:"init :: "+o;t[e].logging(o)}})}catch(s){this.funcTagDisabled();s=s instanceof Error?s:"init :: "+s;this.logging(s)}return this};a.prototype.initTrackingId=function(){try{this.logging("exec initTrackingId");if(this.getReady()==false)throw new Error("$property.ready is false");if(this.getStorageType()==1)this.setJuicerId(this.getCookie(this.constant.COOKIE_KEY_JUICER_ID));if(this.getStorageType()==2)this.setJuicerId(this.getLocalStorage(this.constant.COOKIE_KEY_JUICER_ID));if(this.getStorageType()==1)this.setUserId(this.getCookie(this.constant.COOKIE_KEY_USER_ID));if(this.getStorageType()==2)this.setUserId(this.getLocalStorage(this.constant.COOKIE_KEY_USER_ID));this.setSessionId(this.getCookie(this.constant.COOKIE_KEY_SESSION_ID));if(this.getStorageType()==1)this.setPeachId(this.getCookie(this.constant.COOKIE_KEY_PEACH_ID));if(this.getStorageType()==2)this.setPeachId(this.getLocalStorage(this.constant.COOKIE_KEY_PEACH_ID))}catch(t){this.funcTagDisabled();t=t instanceof Error?t:"initTrackingId :: "+t;this.logging(t)}return this};a.prototype.initSessionReferrer=function(){try{this.logging("exec initSessionReferrer");var t=this.getCookie(this.constant.COOKIE_KEY_SESSION_ID);var e=this.getCookie(this.constant.COOKIE_KEY_SESSION_REFERRER);if(t==""){this.setCookie(this.constant.COOKIE_KEY_SESSION_REFERRER,"",this.getHost(),"/",this.constant.COOKIE_LIFETIME_SESSION,"");return this}if(e==""){this.setCookie(this.constant.COOKIE_KEY_SESSION_REFERRER,"",this.getHost(),"/",this.constant.COOKIE_LIFETIME_SESSION,"");return this}var r="/^"+t+"___/";if(e.match(r)!=null){this.setCookie(this.constant.COOKIE_KEY_SESSION_REFERRER,e,this.getHost(),"/",this.constant.COOKIE_LIFETIME_SESSION,"");return this}e=t+"___"+encodeURIComponent(this.getReferrer());this.setCookie(this.constant.COOKIE_KEY_SESSION_REFERRER,e,this.getHost(),"/",this.constant.COOKIE_LIFETIME_SESSION,"");return this}catch(i){this.funcTagDisabled();i=i instanceof Error?i:"initSessionReferrer :: "+i;this.logging(i)}return this};a.prototype.getSessionReferrer=function(){try{this.logging("exec getSessionReferrer");var t=this.getCookie(this.constant.COOKIE_KEY_SESSION_ID);var e=this.getCookie(this.constant.COOKIE_KEY_SESSION_REFERRER);if(t=="")return"";if(e=="")return e;var r=new RegExp("^("+t+"___)");if(e.match(r)==null)return"";e=e.replace(t+"___","");return decodeURIComponent(e)}catch(i){i=i instanceof Error?i:"getSessionReferrer :: "+i;this.logging(i)}return""};a.prototype.setSessionReferrer=function(){try{this.logging("exec setSessionReferrer");var t=this.getCookie(this.constant.COOKIE_KEY_SESSION_ID);var e=this.getCookie(this.constant.COOKIE_KEY_SESSION_REFERRER);if(t=="")throw new Error("Not set session id");var r=new RegExp("^("+t+"___)");if(e.match(r)!=null)return true;e=t+"___"+encodeURIComponent(this.getReferrer());this.setCookie(this.constant.COOKIE_KEY_SESSION_REFERRER,e,this.getHost(),"/",this.constant.COOKIE_LIFETIME_SESSION,"");return true}catch(i){i=i instanceof Error?i:"setSessionReferrer :: "+i;this.logging(i);return false}return true};a.prototype.initTreasureDataSdk=function(){try{this.logging("exec initTresureDataSdk");if(this.getReady()==false)throw new Error("$property.ready is false");if(!this.isTresureDataSdk())throw new Error("tresuredata sdk is disabled");if(!this.validateObjectType(this.getTdData().host,"string"))throw new Error("$config.tdData is not string");if(!this.validateObjectType(this.getTdData().apikey,"string"))throw new Error("$config.tdData.apikey is not string");if(!this.validateObjectType(this.getTdData().database,"string"))throw new Error("$config.tdData.database is not string");!function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=["addRecord","fetchGlobalID","set","trackEvent","trackPageview","trackClicks","ready"],i=0;i