((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).jssdkCommon=t()})(this,function(){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e(e){return e&&e.Math===Math?e:void 0}var t="object"===("undefined"==typeof globalThis?"undefined":r(globalThis))&&e(globalThis)||"object"===("undefined"==typeof window?"undefined":r(window))&&e(window)||"object"===("undefined"==typeof self?"undefined":r(self))&&e(self)||"object"===("undefined"==typeof global?"undefined":r(global))&&e(global)||function(){return this}()||{};function s(e,t,n,o){var i,a="",n=(void 0!==n&&0!==n&&((i=new Date).setTime(i.getTime()+n),a="expires="+i.toUTCString()+"; "),o?"domain=".concat(o,"; "):"");document.cookie=e+"="+encodeURIComponent(t)+"; "+a+n+"path=/"}function a(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o{try{return"object"===r(new Function("return "+e)())}catch(e){}})(e.newValue)&&(n=(t=JSON.parse(e.newValue)).key,o=t.value,a.setItem(n,o,0,""))}catch(e){console.error("Failed to sync data across tabs:",e)}})},n.prototype._setSyncFlag=function(e,t){this._synCreated=!0,localStorage.setItem("syn-"+e,JSON.stringify({key:e,value:t}))},n.prototype._initSyncListeners=function(){var n=this;window.addEventListener("beforeunload",function(){var e,t;n._synCreated&&(t=(e=Object.keys(sessionStorage)).map(function(e){return{key:e,value:sessionStorage.getItem(e)}}),e.forEach(function(e){localStorage.removeItem("syn-"+e)}),window.postMessage({type:"SYNC_STORAGE_CLEAR",payload:t},"*"))}),window.addEventListener("message",function(e){e.data&&"SYNC_STORAGE_CLEAR"===e.data.type&&Array.isArray(e.data.payload)&&e.data.payload.forEach(function(e){var t=e.key;localStorage.setItem("syn-"+t,JSON.stringify({key:t,value:e.value}))})})},n.prototype._initStorageSync=function(){Object.keys(localStorage).forEach(function(e){e.startsWith("syn-")&&(e=JSON.parse(localStorage.getItem(e)||"{}"),sessionStorage.setItem(e.key,e.value))})},n.prototype._createIframe=function(e){var t=this,n=document.createElement("iframe");return n.src=e,n.style="width: 1px;height: 1px;border:none;",n.onload=function(){t._iframeLoaded=!0},window.document.body.appendChild(n),n};var o=new n("https://www.dhresource.com/jssdk/html/hub.html?v=2024092601");return t.DHJSSDK={Storage:o},o});