!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ya=e():t.ya=e()}("undefined"!=typeof self?self:this,(()=>(()=>{var t={751:function(t){"undefined"!=typeof self&&self,t.exports=function(){"use strict";var t={825:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Browser=e.Util=e.CLog=void 0;var o=n(r(148));e.CLog=o.default;var i=n(r(109));e.Util=i.default;var u=n(r(387));e.Browser=u.default},387:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(r(109));e.default={generateMetrics:function(t,e){if("object"!==n(t))return null;var r={},o=t.line||t.lineNumber,u=t.column||t.columnNumber;r.ts=i.default.getTime(),t.name&&(r.name=t.name),t.message&&(r.message=t.message),t.stack&&(r.stack=t.stack),o&&(r.line=o),u&&(r.col=u);var a="undefined"!=typeof window?window:{};return"object"===n(a.performance)&&"object"===n(a.performance.timing)&&i.default.isNumber(a.performance.timing.navigationStart)&&(r.progress_time=r.ts-a.performance.timing.navigationStart),r.ex_base="",void 0!==a.location&&void 0!==a.location.href&&(r.url=a.location.href),i.default.isString(e)&&(r.label=e),r},createImageTag:function(t,e){if("undefined"!=typeof document){var r=document.createElement("img");i.default.isFunction(e)&&(r.onload=e),r.src=t}}}},148:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=o(r(109));function u(){return["Object","Console","console"].indexOf(i.default.getType(console))>=0?console:{}}var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"NONE",get:function(){return 0}},{key:"CRITICAL",get:function(){return 1}},{key:"WARNING",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"prefix",set:function(t){this._prefix=t}},{key:"defaultLogLevel",get:function(){return this.CRITICAL}},{key:"logLevel",get:function(){return i.default.isNumber(this._logLevel)?this._logLevel:this.defaultLogLevel},set:function(t){i.default.isNumber(t)&&[0,1,2,3,4].indexOf(t)>=0&&(this._logLevel=t)}},{key:"debug",value:function(){var e=u();if(this.logLevel>=t.DEBUG){for(var r=arguments.length,n=new Array(r),o=0;o=t.INFO){for(var r=arguments.length,n=new Array(r),o=0;o=t.WARNING){for(var r=arguments.length,n=new Array(r),o=0;o=t.CRITICAL){for(var r=arguments.length,n=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:0,r=Number(t);return c(r)?r:e}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(t=v(t,e))===e?t:parseInt(t)}function g(t){var e=t.split("#")[0].split("?");return 1===e.length?null:e.slice(1).join("?")}Object.defineProperty(e,"__esModule",{value:!0}),e.default={getType:n,is:o,isObject:i,isArray:u,isString:a,isNumber:c,isBoolean:f,isMap:s,isPrimitive:function(t){return c(t)||a(t)||f(t)},isFunction:function(t){return o("Function",t)},isNull:y,isNaN:d,isUndefined:p,findKey:function(t,e){return o("Object",t)&&Object.prototype.hasOwnProperty.call(t,e)},isUUID:function(t){return null!==t.match(/^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/)},deepCopy:function(t){return JSON.parse(JSON.stringify(t))},merge:function(){for(var t=arguments,e=arguments.length,r={},n=function(){var e=o<0||t.length<=o?void 0:t[o];Object.keys(e).forEach((function(t){r[t]=e[t]}))},o=0;o1&&void 0!==arguments[1]?arguments[1]:0;return(t=b(t,e))===e||t>=0?t:e},isEmpty:function(t){return!!(y(t)||p(t)||d(t))||(a(t)?""===t:c(t)||l(t)?0===t:i(t)?0===Object.keys(t).length:u(t)?0===t.length:!!s(t)&&0===t.size)},snakeToLCC:function(t){return(t=m(t).replace(/_+([a-z])/g,(function(t,e){return e.toUpperCase()}))).charAt(0).toLowerCase()+t.slice(1)},urlQueryBuild:function(t){return Object.keys(t).map((function(e){return[e,t[e]].map(m).map(encodeURIComponent).join("=")})).join("&")},urlQueryString:g,urlQueryParse:function(t){return g("?".concat(t)).split("&").reduce((function(t,e){var r=e.split("=");return 2===r.length&&(t[r[0]]=r[1]),t}),{})}}}},e={};return function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}(825)}()},295:function(t){"undefined"!=typeof self&&self,t.exports=function(){"use strict";var t={949:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:String(e)}var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=i(r(288)),a=i(r(500)),l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"recordBuild",value:function(t,e,r,n){if(!u.default.isString(t)||!u.default.isUUID(t))return a.default.error("tokenが不正な値:",t),null;if(!u.default.isString(e)||e.length<1)return a.default.error("projectが不正な値:",e),null;if(!u.default.isString(r)||r.length<1)return a.default.error("datasetが不正な値:",r),null;if(!u.default.isObject(n))return a.default.error("dataが不正な値:",n),null;var o=u.default.deepCopy(n);Object.keys(o).forEach((function(t){0===t.indexOf("cex_")&&(a.default.warning("パラメータ ".concat(t,": cex_で始まるキーは予約済みキーのため使用できません.")),delete o[t])})),o.cex_cqt=u.default.getTime();var i={tk:t,p:e,d:r,data:o};return a.default.info("[レコード生成]",i),i}},{key:"recordsBuild",value:function(t,e,r,n){var o=this,i=[],a=function(n){if(u.default.isObject(n)){var a=o.recordBuild(t,e,r,n);u.default.isNull(a)||i.push(a)}};return u.default.isArray(n)?n.forEach(a):a(n),i}},{key:"requestBodyBuild",value:function(t){var e=u.default.deepCopy(t),r={cex_cst:u.default.getTime()};return JSON.stringify({r:e,bp:r})}}],r&&function(t,e){for(var r=0;rs)u.default.error("データのサイズが大きすぎます。データを破棄します ".concat(a,"/").concat(s),o);else if(f>y&&u.default.warning("規定値を超えた件数のログが送信されます ".concat(f,"/").concat(y),o),this.charCount+a<=s&&this.queue.length+f<=y)this.queue=this.queue.concat(o),this.charCount+=a,this.charCountArray=this.charCountArray.concat(i);else if(this.online)this.send(),this.queue=this.queue.concat(o),this.charCount+=a,this.charCountArray=this.charCountArray.concat(i);else for(this.queue=this.queue.concat(o),this.charCount+=a,this.charCountArray=this.charCountArray.concat(i);this.charCount>s||this.queue.length>y;)u.default.warning("データ容量超過のため削除",this.queue[0]),this.queue.shift(),this.charCount-=this.charCountArray[0],this.charCountArray.shift()}},{key:"send",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.queue.length>0&&this.online){var e=l.default.requestBodyBuild(this.queue);a.default.send(e,t),this.reset()}}},{key:"reset",value:function(){this.queue=[],this.charCount=0,this.charCountArray=[]}}],r&&function(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0&&(this._logLevel=t)}},{key:"debug",value:function(){var e=c();if(e&&!(this.logLevel0)if((t=t.filter((function(t){return u.default.isString(t)}))).length>0){var e=t.map((function(t){return(t.endsWith(":")?t:t.concat(":")).toLocaleLowerCase()}));f.default.targetProtocols=e,a.default.info("ロギング対象プロトコル変更",e)}else a.default.error("プロトコル名はstring型の値にしてください. プロトコル設定を行いませんでした");else f.default.targetProtocols=["http:","https:"],a.default.info("ロギング対象プロトコルをデフォルトにリセット",f.default.targetProtocols);else a.default.error("引数には配列を指定してください. プロトコル設定を行いませんでした")}},{key:"send",value:function(t){var e;u.default.isObject(t)&&(e=t,["token","project","dataset","data"].every((function(t){return t in e})))?-1!==f.default.targetProtocols.indexOf(window.location.protocol)?(y.push(t.token,t.project,t.dataset,t.data),u.default.isUndefined(t.flush)||u.default.isBoolean(t.flush)||a.default.warning("flushオプションが期待するのはboolean型です"),!0===t.flush?this.flush(t.callback):p.setTimer()):a.default.error("現在開いているページの ".concat(window.location.protocol," プロトコルはロギング対象外です。")):a.default.error("引数の型が不正")}},{key:"flush",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.default.isFunction(t)?y.send(t):(u.default.isNull(t)||a.default.warning("callbackには関数を指定してください"),y.send())}},{key:"getSdkName",value:function(){return f.default.sdkName}},{key:"getSdkVersion",value:function(){return f.default.sdkVersion}},{key:"getPageSession",value:function(){return(0,s.default)()}}],r&&function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;l.default.sendBeaconEnabled&&null!==(e=window)&&void 0!==e&&e.navigator&&u.default.isNull(r)&&u.default.isFunction(window.navigator.sendBeacon)?this.sendBeacon(t):this.sendAjax(t,r)}},{key:"sendAjax",value:function(t,e){var r=c(),n=this.buildUrl(),o=function(){null==e||e()};if(r){r.open("POST",n),r.withCredentials=!0,r.setRequestHeader("Content-Type","application/json;charset=UTF-8");var i=l.default.apiAccessToken;i&&r.setRequestHeader("Authorization","Bearer ".concat(i)),!("timeout"in r)&&l.default.ajaxTimeout?setTimeout((function(){r.abort(),o()}),l.default.ajaxTimeout):r.timeout=l.default.ajaxTimeout,r.onload=r.ontimeout=r.onerror=r.onabort=o,r.send(t),a.default.info("[送信]",n,t)}}},{key:"sendBeacon",value:function(t){var e=this.buildUrl(!0);navigator.sendBeacon(e,t),a.default.info("[送信]",e,t)}},{key:"buildUrl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e="".concat(l.default.apiScheme).concat(l.default.apiHost).concat(l.default.apiPath),r=l.default.apiAccessToken;return null!==r&&t&&(e+="?access_token=".concat(r)),e}}],r&&function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.buffer=e,this.shortInterval=o||c.default.shortTimerInterval,this.longInterval=n||c.default.longTimerInterval,this.shortTimer=null,this.longTimer=null,this.leaveCallback=function(t){var e;"visibilitychange"===t.type&&"hidden"!==(null===(e=document)||void 0===e?void 0:e.visibilityState)||(l.default.debug("fire inactive event. type = ".concat(t.type)),r.buffer.queue.length>0&&(r.buffer.send(),r.clearAllTimer()))},"undefined"!=typeof window&&"addEventListener"in window?t.INACTIVE_EVENTS.forEach((function(t){window.addEventListener(t,r.leaveCallback,!1)})):l.default.warning("not hook a leave event."),this.createNetWorkStateHandler(),this.setInitialNetWork(),this.setNetWorkWatcher()}var e,r,n;return e=t,n=[{key:"INACTIVE_EVENTS",get:function(){return["blur","pagehide","visibilitychange","beforeunload"]}}],(r=[{key:"createNetWorkStateHandler",value:function(){var t=this;this.onlineHandler=function(){t.buffer.online=!0,t.buffer.queue.length>0&&t.buffer.send()},this.offlineHandler=function(){t.buffer.online=!1}}},{key:"setInitialNetWork",value:function(){var t;"undefined"!=typeof window&&a.default.isBoolean(null===(t=window.navigator)||void 0===t?void 0:t.onLine)?this.buffer.online=window.navigator.onLine:this.buffer.online=!0}},{key:"setNetWorkWatcher",value:function(){"undefined"!=typeof window&&"addEventListener"in window&&(window.addEventListener("online",this.onlineHandler,!1),window.addEventListener("offline",this.offlineHandler,!1))}},{key:"setTimer",value:function(){var t=this;a.default.isNull(this.shortTimer)||(clearTimeout(this.shortTimer),this.shortTimer=null),this.shortTimer=setTimeout((function(){t.buffer.send(),t.clearAllTimer(),l.default.debug("Called: short timer fire.")}),this.shortInterval),a.default.isNull(this.longTimer)&&(this.longTimer=setTimeout((function(){t.buffer.send(),t.clearAllTimer(),l.default.debug("Called: long timer fire.")}),this.longInterval))}},{key:"clearAllTimer",value:function(){a.default.isNull(this.shortTimer)||(clearTimeout(this.shortTimer),this.shortTimer=null),a.default.isNull(this.longTimer)||(clearTimeout(this.longTimer),this.longTimer=null)}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.default=f},288:function(t,e){function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,r=Number(t);return c(r)?r:e},isEmpty:function(t){return!!(f(t)||s(t)||Number.isNaN(t))||(a(t)?""===t:c(t)||l(t)?0===t:i(t)?0===Object.keys(t).length:u(t)?0===t.length:!!o("Map",t)&&0===t.size)},urlQueryString:y,urlQueryParse:function(t){return y("?".concat(t)).split("&").reduce((function(t,e){var n,o=e.split("=");if(2===o.length){var i=(2,function(t){if(Array.isArray(t))return t}(n=o)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],l=!0,c=!1;try{for(i=(r=r.call(t)).next,0;!(l=(n=i.call(r)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(n)||function(t,e){if(t){if("string"==typeof t)return r(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=i[0],a=i[1];t[u]=a}return t}),{})}}},324:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},808:function(t){t.exports=JSON.parse('{"name":"YASCoreLogger-web","version":"4.2.0"}')}},e={};return function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}(720)}()}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};return(()=>{"use strict";r.d(n,{default:()=>_e});var t=r(751);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,r){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:c,o=y(n);if(""===o)return t.CLog.error("[YAConfigurator#updateTracker] 不正なロギングID",n),!1;if(!t.Util.isObject(e))return t.CLog.error("[YAConfigurator#updateTracker] 期待しないデータ型",e),!1;var i=[];if(t.Util.isUndefined(this.trackers[o])){if(!t.Util.isArray(this.groups[o]))return t.CLog.error("[YAConfigurator#updateTracker] トラッカー未作成のロギングIDまたはグループ",n),!1;this.groups[o].forEach((function(t){i.push(r.trackers[t])}))}else i.push(this.trackers[o]);return i.forEach((function(t){Object.keys(e).forEach((function(r){t.setParameter(r,e[r])}))})),t.CLog.info("[YAConfigurator#updateTracker] トラッカーに値を設定完了",i),!0}},{key:"setBaseParameters",value:function(e){return t.Util.isObject(e)?(this.baseParameters=t.Util.merge(this.baseParameters,e),t.CLog.info("[YAConfigurator#baseParameters] ベースパラメータ設定完了",this.baseParameters),!0):(t.CLog.error("[YAConfigurator#setBaseParameters] オブジェクト形式ではありません",e),!1)}},{key:"getBaseParameters",value:function(){return t.Util.merge(this.baseParameters,{pvid:this.pvid})}},{key:"getTrackerParameters",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],o={};if(!t.Util.isString(r)&&t.Util.isPrimitive(r)||!t.Util.isEmpty(r))if(t.Util.isArray(r))n=t.Util.deepCopy(r);else{if(!t.Util.isPrimitive(r))return t.CLog.error("[YAConfigurator#getTrackerParameters] 不正なターゲット指定"),o;n=[r]}else n=[c];return n.map(y).filter(d).forEach((function(t){o=m(e.trackers,t,o)})),n.map(p).filter(d).filter((function(r){return t.Util.isArray(e.groups[r])})).forEach((function(t){e.groups[t].map(y).filter(d).forEach((function(t){o=m(e.trackers,t,o)}))})),t.Util.deepCopy(o)}}],o=[{key:"getInstance",value:function(){return b}}],n&&s(r.prototype,n),o&&s(r,o),Object.defineProperty(r,"prototype",{writable:!1}),e}(),b=new v;const g=v;function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function w(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o="undefined"!=typeof window?window:{},i=g.getInstance();if(t.Util.isPrimitive(e)){n=t.Util.isObject(n)?n:{},t.Util.findKey(n,"groups")?(t.CLog.debug("[ConfigCommander#run] found options.groups",n.groups),i.registerTracker(e,r,n.groups)):(t.CLog.debug("[ConfigCommander#run] not found options.groups"),i.registerTracker(e,r));var u=n.savekey||"_aui",a=o.localStorage.getItem(u);t.Util.findKey(n,"savekey")&&t.CLog.debug("[ConfigCommander#run] set savekey",n.savekey),t.Util.isNull(a)&&(a=l().getPageSession(),o.localStorage.setItem(u,a)),i.updateTracker({aui:a},e)}else t.CLog.error("[ConfigCommander#run] ロギングIDは文字列を期待します",e)}}],null&&w(r.prototype,null),n&&w(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const j=S;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function C(t,e){for(var r=0;r=0,o=Object.keys(r).filter((function(r){n&&"category"===r&&t.CLog.warning("[YAValidator#run] \n イベントアクションにアイテム分析用の文字列を設定している場合、イベントカテゴリは集計時に固定の値に上書きされます。");var o=e[r]?e[r].short:"";return!n&&["itms","inm","iln","cn","cv"].indexOf(o)>=0?(t.CLog.warning("[YAValidator#run] \n イベントアクションにアイテム分析用の文字列を設定していない場合、アイテム情報のログは送信されません。",r),!1):function(e,r){var n=Object.keys(e).filter((function(t){return!e[t].numbered})),o=Object.keys(e).filter((function(t){return!!e[t].numbered}));if(-1!==n.indexOf(r))return!0;var i=L.exec(r);if(null!==i&&-1!==o.indexOf(i[1])){var u=e[i[1]],a=t.Util.normalizeToNumber(i[2]);return!(t.Util.findKey(u,"min")&&au.max||(e[r]={short:"".concat(u.short).concat(a),type:u.type},0))}return!1}(e,r)})),i={};return o.forEach((function(n){var o=e[n],u=o.short,a=o.type,l=E(e,r,n);null!==l?i[u]=l:t.CLog.warning("[YAValidator#run] ".concat(n,"に").concat(a,"型以外の値(").concat(r[n],")が指定されています"))})),i}}],null&&U(r.prototype,null),n&&U(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const A=_,N="1.6.7";function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function x(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0?i.forEach((function(e){u&&!t.Util.isUndefined(u[e])?u=u[e]:a=!1})):a=!1,a?u:null}var M=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var r,n;return r=e,n=[{key:"document",set:function(t){this._document=t}},{key:"pageUrl",get:function(){return D(this._document,"location","href")}},{key:"pageHost",get:function(){return D(this._document,"location","hostname")}},{key:"pageQueryParameter",get:function(){if(null===this.pageUrl)return null;var t=x(this.pageUrl.split("#")[0].split("?")).slice(1);return 1!==t.length?null:t[0].split("&").reduce((function(t,e){var r=x(e.split("=")),n=r[0],o=r.slice(1);return 1===o.length&&(t[n]=o[0]),t}),{})}},{key:"pageReferrer",get:function(){var e=D(this._document,"referrer");return t.Util.isString(e)&&!t.Util.isEmpty(e)?e:null}},{key:"pageTitle",get:function(){return D(this._document,"title")}},{key:"userLanguage",get:function(){return D(this._document,"defaultView","navigator","language")||D(this._document,"defaultView","navigator","browserLanguage")}},{key:"dataSource",get:function(){return"web"}},{key:"loggerSdkName",get:function(){return"YASYahooAnalyticsLogger-web"}},{key:"loggerSdkVersion",get:function(){return t.Util.isString(N)?N:""}},{key:"screenWidth",get:function(){return D(this._document,"defaultView","screen","width")}},{key:"screenHeight",get:function(){return D(this._document,"defaultView","screen","height")}},{key:"viewportWidth",get:function(){var t=D(this._document,"documentElement","clientWidth"),e=D(this._document,"body","clientWidth"),r=D(this._document,"compatMode");return!t||"CSS1Compat"!==r&&e?e||null:t}},{key:"viewportHeight",get:function(){var t=D(this._document,"documentElement","clientHeight"),e=D(this._document,"body","clientHeight"),r=D(this._document,"compatMode");return!t||"CSS1Compat"!==r&&e?e||null:t}},{key:"screenColorDepth",get:function(){return D(this._document,"defaultView","screen","colorDepth")}},{key:"deviceOrientation",get:function(){var e=D(this._document,"defaultView","screen","orientation","type")||D(this._document,"defaultView","screen","mozOrientation","type")||D(this._document,"defaultView","screen","msOrientation","type"),r=D(this._document,"defaultView","orientation");if(t.Util.isString(e)){var n=e.match(/^(landscape|portrait)-(primary|secondary)$/);if(t.Util.isArray(n))return n[1]}else if(t.Util.isNumber(r))return 90===Math.abs(r)?"landscape":"portrait";return null}},{key:"getVal",value:function(){return D.apply(void 0,arguments)}}],null&&B(r.prototype,null),n&&B(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const F=M,q=JSON.parse('{"k8":"dsb.yahoo.co.jp","hh":"dsb.yahooapis.jp"}'),H=function(){var e="undefined"!=typeof window?window:{},r=t.Util.normalizeToString(e.location.hostname);return/^(.+\.)?yahoo\.co\.jp\/?$/.test(r)?q.k8:q.hh};function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function V(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,loggerSdkName:F.loggerSdkName,loggerSdkVersion:F.loggerSdkVersion,hitType:this.hitType||null,clientHitTimestamp:t.Util.getTime()}}},{key:"buildRepairableCommonData",value:function(e){var r,n=e.pageUrl;t.Util.isUndefined(n)?r=F.pageUrl:t.Util.isString(n)&&!t.Util.isEmpty(n)&&Y(n)?r=n:(t.CLog.warning("[BaseBuilder#run] pageUrlの値がURLとして不正です. ","http(s)://で始まる文字列を指定してください.",n),r=F.pageUrl,t.CLog.warning("[BaseBuilder#run] pageUrlの値を次の値に自動設定しました. ","必要に応じて適切な値を指定してください.",r));var o,i=e.pageReferrer;return t.Util.isUndefined(i)?o=F.pageReferrer:t.Util.isString(i)&&(t.Util.isEmpty(i)||Y(i))?o=i:t.Util.isNull(i)?(t.CLog.warning("[BaseBuilder#run] pageReferrerの値がNULLになっています. 期待している値かどうか確認してください.",i),o=i):(t.CLog.warning("[BaseBuilder#run] pageReferrerの値がURLとして不正です. ","http(s)://で始まる文字列を指定してください.",i),o=F.pageReferrer,t.CLog.warning("[BaseBuilder#run] pageReferrerの値を次の値に自動設定しました. ","必要に応じて適切な値を指定してください.",o)),{pageUrl:r,pageReferrer:o}}},{key:"run",value:function(e,r,n,o,i){if(!t.Util.isString(e)||t.Util.isEmpty(e))return null;t.CLog.debug("[BaseBuilder#run] hit schema = ".concat(this.hitType,", rule ="),this.rule);var u=this.buildWritableCommonData(),a=this.formatParameters(this.campaign),l=this.formatParameters(r),c=this.formatParameters(n),f=this.formatParameters(o),s=this.formatParameters(i),y=this.buildNonWritableCommonData(e);y.hitSequence=f.hitSequence,y.pvid=c.pvid,t.CLog.debug("[BaseBuilder#run] common =",u,"campaign = ",a,"builder =",l,"base =",c,"tracker =",f,"hit =",s,"non_writable =",y);var p=t.Util.merge(u,a,l,c,f,s,y),d=this.buildRepairableCommonData(p);return t.CLog.debug("[BaseBuilder#run] repaired = ",d),A.run(this.rule,t.Util.merge(p,d))}}],null&&V(r.prototype,null),n&&V(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const z=Z,K={hitType:{short:"ht",type:"string"},loggingId:{short:"lid",type:"string"},clientHitTimestamp:{short:"cht",type:"number"},loggerSdkName:{short:"lsn",type:"string"},loggerSdkVersion:{short:"lsv",type:"string"},isNonInteraction:{short:"ini",type:"boolean"},pageUrl:{short:"pu",type:"string"},pageReferrer:{short:"pr",type:"string"},pageTitle:{short:"pt",type:"string"},userLanguage:{short:"ul",type:"string"},dataSource:{short:"ds",type:"string"},screenWidth:{short:"sw",type:"number"},screenHeight:{short:"sh",type:"number"},viewportWidth:{short:"vw",type:"number"},viewportHeight:{short:"vh",type:"number"},screenColorDepth:{short:"scd",type:"number"},deviceOrientation:{short:"do",type:"string"},hitSequence:{short:"hs",type:"number"},pvid:{short:"pvid",type:"string"},dim:{short:"cud",type:"string",numbered:!0},aui:{short:"aui",type:"string"},useAnalyticsUid:{short:"uaui",type:"boolean"},mtestid:{short:"mti",type:"string"},cptS:{short:"cps",type:"string"},cptN:{short:"cpn",type:"string"},cptM:{short:"cpm",type:"string"},cptK:{short:"cpk",type:"string"},cptC:{short:"cpc",type:"string"}};function G(t){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(t)}function $(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0)return t.CLog.debug("[HitCommander#run] window onload was over."),o.generate(i,e,n),void l().flush(u[Nt]);setTimeout(r,100,o)}(o))}o.generate(i,e,n)}})),this.isFlush&&!0!==u[At]&&(l().flush(u[Nt]),t.CLog.info("[HitCommander#run] フラッシュ完了"))}},{key:"generate",value:function(e,r,n){var o=this,i=Et.getBaseParameters(),u=Et.getTrackerParameters(r);t.CLog.debug("[HitCommander#generate] Fire ".concat(e.schemaName,", ")+"LoggingIDs are [".concat(Object.keys(u),"]")),Object.keys(u).forEach((function(r){var a=e.run(r,i,u[r],n);t.Util.isNull(a)?t.CLog.error("[HitCommander#generate] ログ生成失敗\nLoggingID=".concat(r,", ")+"EventName=".concat(e.schemaName,", options=").concat(n)):(l().send({token:Et.tokens[r],project:"ya",dataset:r,data:a}),o.isFlush=!0,t.CLog.info("[HitCommander#generate] ログ登録完了",a))}))}},{key:"formatConfig",value:function(e){var r=[At,Nt],n={};return Object.keys(e).forEach((function(o){r.indexOf(t.Util.snakeToLCC(o))>-1&&(n[t.Util.snakeToLCC(o)]=e[o])})),n}}],null&&Lt(r.prototype,null),n&&Lt(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const xt=It;function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Bt(t,e){for(var r=0;r0?setTimeout((function(){Zt(Kt(a.prototype),"fire",e).call(e)}),this.options.minElapsedTime):Zt(Kt(a.prototype),"fire",this).call(this)}}])&&Yt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),a}(Wt);const $t=Gt;function Jt(t){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(t)}function Qt(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return!t.Util.isString(e)||t.Util.isEmpty(e)?(t.CLog.error("[ConfigCommander#run] サブコマンドの型または値が不正",e,"type: ".concat(le(e))),!1):t.Util.isFunction(this[e])?(this[e](r),!0):(t.CLog.error("[ConfigCommander#run] 未定義のサブコマンド",e),!1)}},{key:"accessToken",value:function(e){l().setAccessToken(e),t.CLog.info("[ConfigCommander#run] set access token.",e)}}],null&&ce(r.prototype,null),n&&ce(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const se=fe;function ye(t){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function pe(t,e){for(var r=0;r=2&&t.Util.isString(n[0])&&(e[n[0]]=n[1]),t.Util.findKey(e,"log_level")){var i=e.log_level;"debug"===i||4===i?t.CLog.logLevel=4:"info"===i||3===i?t.CLog.logLevel=3:"warning"===i||2===i?t.CLog.logLevel=2:"critical"===i||1===i?t.CLog.logLevel=1:"none"!==i&&0!==i||(t.CLog.logLevel=0)}}}],null&&be(r.prototype,null),n&&be(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const he=ge;function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}function Se(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r&&"object"===we(r)&&r.nodeName){this.element=r;var o=this.extractItemData(r);t.Util.isObject(n)?this.itemData=t.Util.merge(o,n):(t.CLog.warning("[ItemSection#constructor] params が不正な値"),this.itemData=o)}else t.CLog.warning("[ItemSection#constructor] element が不正な値")}var r,n;return r=e,(n=[{key:"extractItemData",value:function(e){var r={};if(!e||"object"!==we(e)||!e.dataset||!e.dataset.yaItemSec)return t.CLog.warning("[ItemSection#extractItemData] セクションのデータ属性が未定義 または不正な値"),r;try{if(e.dataset.yaItemSec){var n=JSON.parse(e.dataset.yaItemSec);(r=t.Util.merge(r,n)).action="view_item_list",r.items=this.extractItemDetailsData(e)}}catch(e){t.CLog.error("[ItemSection#extractItemData] セクションのデータ属性が不正な値",e)}return r}},{key:"extractItemDetailsData",value:function(e){var r=[];return"object"!==we(e)||"function"!=typeof e.getElementsByTagName?(t.CLog.warning("[ItemSection#extractItemDetailsData] element が不正な値"),r):(["a","button","input"].forEach((function(n){var o=e.getElementsByTagName(n);Array.prototype.slice.call(o).forEach((function(e){if(e.dataset&&e.dataset.yaItemDetail)try{var n={};if(e.dataset.yaItemDetail){var o=JSON.parse(e.dataset.yaItemDetail);n=t.Util.merge(n,o)}r.push(n)}catch(e){t.CLog.error("[ItemSection#extractItemDetailsData] アイテムのデータ属性が不正な値",e)}else t.CLog.warning("[ItemSection#extractItemDetailsData] セクションのデータ属性が未定義")}))})),r)}},{key:"sendEventLog",value:function(e,r){t.Util.isObject(e)?xt.run(r,"event",e):t.CLog.warning("[ItemSection#sendEventLog] 不正な引数(itemData)の指定",e)}}])&&Se(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const Oe=je;function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function ke(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r