/*! License information is available at dmp.licenses.txt */ /*! d4fe8e0 released at 2025/7/31 9:22:26 UTC */(()=>{var e={374:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeywordSearcher=void 0;const n=r(954);t.KeywordSearcher=class{constructor(e,t){this.searchInterval=1,this.keywords=e,this.text=t}search(e){if(0===this.keywords.length)return Promise.resolve([[],{}]);const t=this.regexpFromWords(this.keywords.map((e=>e.word))),r={};let o=new Promise((e=>{this.doSearch(t,r,e)}));return e&&(o=(0,n.timeoutPromise)(o,e).catch((()=>r))),o.then((e=>[this.keywords.filter((t=>t.times<=e[t.word.toLowerCase()])),e]))}doSearch(e,t,r){const n=e.exec(this.text);if(n){const o=n[0].toLowerCase();t[o]||(t[o]=0),t[o]+=1,e.lastIndex-=o.length-1,setTimeout((()=>{this.doSearch(e,t,r)}),this.searchInterval)}else r(t)}regexpFromWords(e){const t=e.map((e=>{const t=e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1");return/^\w+$/.test(e)?`\\b${t}\\b`:t})).sort(((e,t)=>t.length-e.length));return new RegExp("("+t.join("|")+")","ig")}}},905:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(6964)),a=r(9787);s.polyfill(),new a.ValveDMP},954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNodeOnce=t.retry=t.choice=t.Deferred=t.timeoutPromise=t.requestGPTSurveyTag=t.pollingElementById=t.appendScript=void 0;t.appendScript=e=>{const t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=e;const r=new Promise(((e,r)=>{t.addEventListener("load",(t=>e(t))),t.addEventListener("error",(e=>r(e)))}));return document.head.appendChild(t),r};t.pollingElementById=(e,t)=>new Promise(((r,n)=>{const o=document.getElementById(e);if(o)return void r(o);const i=Date.now(),s=()=>{const o=document.getElementById(e);o?r(o):"number"==typeof t&&i+t{const r=encodeURIComponent(Object.keys(t).map((e=>{const r=t[e],n=Array.isArray(r)?r.map((e=>encodeURIComponent(""!==e?e:"null"))).join(","):encodeURIComponent(""!==r?r:"null");return`${encodeURIComponent(e)}=${n||"null"}`})).join("&")),n=`https://securepubads.g.doubleclick.net/gampad/adx?${[`iu=${e}`,"sz=1x1",`c=${Math.floor(1e8*Math.random())}`,`t=${r}`].join("&")}`;return fetch(n)};t.timeoutPromise=(e,t)=>{const r=new Promise((e=>{setTimeout(e,t)})).then((()=>{throw new Error(`Operation timed out after ${t} ms`)}));return Promise.race([e,r])};t.Deferred=class{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}},t.choice=function(e,t,r=()=>Math.random()){if(0===e.length||t<=0)return;const n=r();if(n>t)return;const o=Math.floor(e.length*n/t);return Number.isFinite(o)&&0<=o&&o{const i=s=>{e(s).then((e=>{n(e)})).catch((e=>{s{i(s+1)}),s*r):o(e)}))};i(0)}))},t.observeNodeOnce=function(e,t,r){let n=null;const o=new MutationObserver(((e,t)=>{r(e,t,!1),t.disconnect(),n&&clearTimeout(n)}));o.observe(e,t),n=setTimeout((()=>{o.disconnect(),r(void 0,o,!0)}),1e4)}},1018:(e,t)=>{t.defaults={},t.set=function(e,r,n){var o=n||{},i=t.defaults,s=o.expires||i.expires,a=o.domain||i.domain,c=void 0!==o.path?o.path:void 0!==i.path?i.path:"/",u=void 0!==o.secure?o.secure:i.secure,l=void 0!==o.httponly?o.httponly:i.httponly,h=void 0!==o.samesite?o.samesite:i.samesite,f=s?new Date("number"==typeof s?(new Date).getTime()+864e5*s:s):0;document.cookie=e.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+r.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(f&&f.getTime()>=0?";expires="+f.toUTCString():"")+(a?";domain="+a:"")+(c?";path="+c:"")+(u?";secure":"")+(l?";httponly":"")+(h?";samesite="+h:"")},t.get=function(e){for(var t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");if(n=n<0?r.length:n,decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))===e)return decodeURIComponent(r.slice(n+1))}return null},t.erase=function(e,r){t.set(e,"",{expires:-1,domain:r&&r.domain,path:r&&r.path,secure:0,httponly:0})},t.all=function(){for(var e={},t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");n=n<0?r.length:n,e[decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))]=decodeURIComponent(r.slice(n+1))}return e}},6964:function(e,t,r){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,i=void 0,s=void 0,a=function(e,t){w[o]=e,w[o+1]=t,2===(o+=2)&&(s?s(_):T())};function c(e){s=e}function u(e){a=e}var l="undefined"!=typeof window?window:void 0,h=l||{},f=h.MutationObserver||h.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(_)}}function m(){return void 0!==i?function(){i(_)}:b()}function v(){var e=0,t=new f(_),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function g(){var e=new MessageChannel;return e.port1.onmessage=_,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(_,1)}}var w=new Array(1e3);function _(){for(var e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0,r(8624);class n{static jsonUrl(){return"https://cdn.pool.st-hatena.com/valve/dmp-config.json"}constructor(){this.textSelectors=[],this.keywords=[],this.debug=-1!==location.href.indexOf("valve_dmp_debug"),this.configPromise=this.fetchConfig().then((e=>(this.textSelectors=(e.TextSelectors||[]).reduce(((e,t)=>(t.service===this.service&&e.push(t.selector),e)),[]),this.keywords=e.DMPKeywords||[],!0))).catch((e=>(this.debug&&console.error(e),!1))),this.service=this.getService(),!this.service&&this.debug&&console.error("ValveDMP: `service` is not provided")}fetchConfig(){const e=window.ValveDMP||{};return e.config?Promise.resolve(e.config):fetch(n.jsonUrl()).then((e=>{if(e.status>=400)throw new Error(`ValveDMP: config is not found on ${n.jsonUrl()}`);return e.json()}))}getService(){const e=window.ValveDMP||{};if(e.service)return e.service;const t=document.querySelector("script#valve-dmp");return t?t.getAttribute("data-service"):null}ready(){return new Promise(((e,t)=>{this.configPromise.then((r=>r&&this.service?e(this):t(null)))}))}}t.Config=n},7610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PageTextExtractor=void 0;t.PageTextExtractor=class{constructor(e){this.selectors=e}contentSelector(){return 0===this.selectors.length?null:this.selectors.join(",")}contentText(){const e=this.contentSelector();if(!e)return"";return this._foldParents(document.querySelectorAll(e)).map((e=>e.textContent)).join("\n")}contentTextWithTimeout(e){const t=this.contentSelector();return t?this._pollingQuerySelectorAll(t,e).then((e=>this._foldParents(e).map((e=>e.textContent)).join("\n"))):Promise.reject(new Error("empty selector"))}_foldParents(e){let t=[];return Array.prototype.forEach.call(e,(e=>{t.some((t=>t.contains(e)))||(t=t.filter((t=>!e.contains(t))),t.push(e))})),t}_pollingQuerySelectorAll(e,t){return new Promise(((r,n)=>{const o=Date.now(),i=()=>{const s=document.querySelectorAll(e);s.length>0?r(s):"number"==typeof t&&o+t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPlatform=t.platformDriverFactory=t.BigMiningDriver=t.EnhanceDriver=t.PlatformDriver=void 0,r(8624);const n=r(954);class o{constructor(e,t=!1){this.service=e,this.debug=t}submit(e){this.send(e),this.debug&&console.log(`ValveDMP: ${this.platform} <- [ ${e.map((e=>e.parameter)).join(", ")} ]`)}}t.PlatformDriver=o;class i extends o{constructor(){super(...arguments),this.platform="Enhance"}send(e){0!==e.length&&(0,n.appendScript)("//d-cache.microad.jp/js/td_htn_access.js").then((t=>{window.enhanceTd&&window.enhanceTd.HTN&&"function"==typeof window.enhanceTd.HTN.start&&e.forEach((e=>window.enhanceTd.HTN.start({article_category:e.parameter})))})).catch((()=>{this.debug&&console.error("ValveDMP: Enhance parameter submission failed.")}))}}t.EnhanceDriver=i;class s extends o{constructor(){super(...arguments),this.platform="BigMining"}send(e){0!==e.length&&(window.hatenadfp=window.hatenadfp||{},window.hatenadfp.imKeywords=e.map((e=>e.parameter)),(0,n.appendScript)("//cdn.bigmining.com/private/js/hatena_bigmining.js").catch((()=>{this.debug&&console.error("ValveDMP: BigMining parameter submission failed.")})))}}t.BigMiningDriver=s;const a={Enhance:i,BigMining:s};t.platformDriverFactory=a;t.isPlatform=e=>-1!==["Enhance","BigMining"].indexOf(e)},8624:function(){!function(e){"use strict";if(!e.fetch){var t="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,n="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,i="ArrayBuffer"in e;if(i)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};p.prototype.append=function(e,t){e=h(e),t=f(t);var r=this.map[e];this.map[e]=r?r+","+t:t},p.prototype.delete=function(e){delete this.map[h(e)]},p.prototype.get=function(e){return e=h(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(h(e))},p.prototype.set=function(e,t){this.map[h(e)]=f(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},P.error=function(){var e=new P(null,{status:0,statusText:""});return e.type="error",e};var l=[301,302,303,307,308];P.redirect=function(e,t){if(-1===l.indexOf(t))throw new RangeError("Invalid status code");return new P(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=w,e.Response=P,e.fetch=function(e,t){return new Promise((function(r,o){var i=new w(e,t),s=new XMLHttpRequest;s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new P(o,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&n&&(s.responseType="blob"),i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===i._bodyInit?null:i._bodyInit)}))},e.fetch.polyfill=!0}function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function y(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(n&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(o&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(i&&n&&a(e))this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!i||!ArrayBuffer.prototype.isPrototypeOf(e)&&!c(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=g(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var e=y(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=y(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=m(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function P(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},9787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValveDMP=void 0;const n=r(7262),o=r(374),i=r(7610),s=r(8109),a=r(954),c=r(1018);t.ValveDMP=class{constructor(){this.config=new n.Config,this.config.debug&&"function"==typeof console.time&&console.time("ValveDMP"),this.keywordSearch=Promise.all([this.config.ready(),this.onDOMContentLoaded()]).catch((()=>{throw new Error("ValveDMP: failed to ready")})).then((()=>new o.KeywordSearcher(this.config.keywords,new i.PageTextExtractor(this.config.textSelectors).contentText()).search())).then((e=>{const[t,r]=e,n=t.reduce(((e,t)=>(e[t.platform]instanceof Array||(e[t.platform]=[]),e[t.platform].push(t),e)),{});Object.keys(n).forEach((e=>{if("Enhance"!==e&&"BigMining"!==e&&(0,s.isPlatform)(e)){new s.platformDriverFactory[e](this.config.service,this.config.debug).submit(n[e])}}))})).catch((e=>{this.config.debug&&console.error(e)})),this.imCall=this.callIntimateMerger(),this.done=Promise.all([this.keywordSearch,this.imCall]).then((()=>{this.config.debug&&"function"==typeof console.timeEnd&&console.timeEnd("ValveDMP")}))}onDOMContentLoaded(){return new Promise((e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()}))}callIntimateMerger(){var e;return(null!==(e=(0,c.get)("login"))&&void 0!==e?e:(0,c.get)("rk"))&&((new Image).src="//atm.im-apps.net/a/beacon.gif?cid=6604&c1=1",this.config.debug&&console.log("ValveDMP: IntimateMerger login beacon requested")),(0,a.appendScript)("//dmp.im-apps.net/js/6604/0001/itm.js").then((()=>{this.config.debug&&console.log("ValveDMP: IntimateMerger inserted")})).catch((e=>{this.config.debug&&console.error(e)}))}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();r(905)})();