Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@finn-no/analytics

Package Overview
Dependencies
Maintainers
12
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finn-no/analytics - npm Package Compare versions

Comparing version 26.2.0 to 26.3.0

3

CHANGELOG.md
# Changelog
# 26.3.0
* Disable Adobe tracking module.
# 26.2.0

@@ -4,0 +7,0 @@ * Disable Pulse tracking module. The new Pulse web tracking implementation is done using finn-pulse-sdk.

2

dist/analytics-core.min.js

@@ -1,1 +0,1 @@

!function(){"use strict";var e={getItem:function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e,t,n,r,o,i){if(!e||/^(?:expires|max-age|path|domain|secure)$/i.test(e))return!1;var a="";if(n)switch(n.constructor){case Number:a=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:a="; expires="+n;break;case Date:a="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(o?"; domain="+o:"")+(r?"; path="+r:"")+(i?"; secure":""),!0},removeItem:function(e,t,n){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)}};function t(e){return e&&(null!=e.funnelName||null!=e.funnelStep)}var n=["start","success","prodview","purchase","poi"];function r(e){if(-1===n.indexOf(e))throw new Error("Flag "+e+" is not in the allowed funnel flags list.")}var o=["start","success","ltp","error","value"];function i(e){if(-1===o.indexOf(e))throw new Error("Flag "+e+" is not in the allowed event flags list.")}function a(e,t){return"string"==typeof e?(e.split(",").forEach(t),e):Array.isArray(e)?(e.forEach(t),e.join(",")):void 0}var s=["effect","activity"];function c(e,n){!1!==t(n)&&(!function(e){if("object"!=typeof e)throw new TypeError("Requires eventObj to be an object");if("production"!==e.context.env){if("string"!=typeof e.funnelName)throw new TypeError("Requires funnelName to be a string");if("string"!=typeof e.funnelStep)throw new TypeError("Requires funnelStep to be a string");if(null!=e.funnelFlags&&"string"!=typeof e.funnelFlags)throw new TypeError("Requires funnelFlags to be a string (comma-separated)")}}(n),e.contextData["funnel.name"]=n.funnelName,e.contextData["funnel.step"]=n.funnelStep,n.funnelFlags&&(e.contextData["funnel.flags"]=a(n.funnelFlags,r)))}function u(e,t){t&&(t.analyticsName&&function(e,t){var n=t.analyticsName;if(window.console&&"production"!==t.context.env&&n&&(n.indexOf("_")>-1||n.match(/[A-Z]{1}/))){var r='analyticsName is malformed ("'+n+'"). Should _not_ be camelCased or under_scored.See https://stash.finn.no/projects/LIBS/repos/analytics-js/browse';console.warn?console.warn(r):console.log(r)}var o=n.split(".").filter(Boolean);if(o.length<2)throw new Error("AnalyticsName should have 2 or 3 parts");e.contextData["event.group"]=o[0],e.contextData["event.name"]=o[1],o[2]&&(e.contextData["event.detail"]=o[2])}(e,t),t.eventFlags&&(e.contextData["event.flags"]=a(t.eventFlags,i)),"string"==typeof t.numberValue&&(t.numberValue*=1),"number"==typeof t.numberValue&&(e.contextData["event.numVal"]=String(t.numberValue)),"string"==typeof t.stringValue&&""!==t.stringValue&&(e.contextData["event.strVal"]=t.stringValue),t.eventError&&(e.contextData["event.error"]=t.eventError),function(e,t){if(t.kpi){var n=t.kpi;if(-1===s.indexOf(n))throw new Error("Event KPI used illegal value: "+n);e.contextData["event.kpi"]=n}}(e,t))}function f(e,t){c(e,t),u(e,t),function(e,t){var n=[];Array.isArray(t.products)&&t.products.length>0&&(n=n.concat(t.products)),t.context&&Array.isArray(t.context.products)&&t.context.products.length>0&&(n=n.concat(t.context.products)),n.length>0&&(e.products||(e.products=""),(""===e.products||e.products&&";"!==e.products[e.products.length-1])&&(e.products+=";"),e.products+=n.join(",;")),t.purchaseID&&(e.purchaseID=t.purchaseID)}(e,t)}var l="e";for(var p="62DB2F4C538CEFDA0A490D4D",d=["site","vertical","platform","sessionhash","areaid","maincat","subcat","prodcat","eventgroups","adtypeid","customername","objectpostcode","campaign","refurl","queryparams","fullurl","fullurlnoparams","orgid","userid","internalsearchterm","internalsearchresults","promotion.extendedProfile","resultListLayout","visibleElements","submarket","deparea","subcat3","usergroup","fromdate","todate","custmeta"],v=1;v<14;v++)d.push("marketcustom"+v);var h=["fullurl","fullurlnoparams","queryparams","loadtime","issynthetic","dnt","sessionstart","dayofweek","areaid","adstatus","eventvalue","DSCext.UX_EL_d","visitorhash","vis","ajsversion","event.group","event.name","event.detail","event.flags","event.kpi","event.error","event.numVal","event.strVal","funnel.name","funnel.step","funnel.flags","timeparting","nativebeacon","timeFrontpageToFinncode","timeFasToFinncode"].concat(d);var y={id:p,resolveRsid:function(e){return e.context.reportSuiteOverride&&e.context.reportSuiteOverride.length>0?e.context.reportSuiteOverride:"production"===e.context.env?"finnprodglobal":"finnglobaldev"},trackingServer:(function(){try{return!(0===window.location.protocol.indexOf("http:"))}catch(e){}return!0}()?"s":"")+"ametrics.finn.no",visitorCookieKey:"AMCV_"+p+"@AdobeOrg",visitorNamespace:"finnno",mapping:{global:["server","pageName","referrer","list1","list2","list3"],contextData:d},linkTrackContextData:h};function g(e,t){return e.events?e.events+=","+t:e.events=t,e.events}var m=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},w=" - ";function k(e){var t="";if(void 0===e)return t;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(""!==t&&(t+=w),"object"==typeof e[n]?t+=n+w+k(e[n]):t+=n+w+e[n]);return t}var b=y.linkTrackContextData.map((function(e){return"contextData."+e})).join(",");function x(e,t){e.linkTrackVars="eVar8,events,server,products,purchaseID,prop7,"+b+","+y.mapping.global.join(","),e.linkTrackEvents=m(["event3"],function(e){if(!e)return[];return e.filter((function(e){return-1!==e.indexOf(":")||-1!==e.indexOf("=")})).map((function(e){return e.split(":")[0]})).map((function(e){return e.split("=")[0]}))}(t.context.adobeEvents)).join(","),g(e,"event3");var n=t.context.adobeEvents;return n&&n.forEach((function(t){return g(e,t)})),t.eventData&&(e.contextData.eventvalue=k(t.eventData)),e}var E=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O={15:"29,25",16:"27,30",17:"26,29",18:"25,28",19:"31,27",20:"29,25",21:"28,31",22:"27,30",23:"26,29",24:"31,27",25:"30,26",26:"29,25",27:"28,31",28:"26,29",29:"25,28",30:"31,27"};function j(e){return("00"+e).substr(-2,2)}function C(e){var t,n,r,o,i,a=(n=(t=e).getFullYear(),r=O[n-2e3].split(","),o=new Date("Sun Mar {date} {year} 03:00:00 GMT+0200 (CEST)".replace("{year}",n).replace("{date}",r[0])),i=new Date("Sun Oct {date} {year} 02:59:59 GMT+0200 (CEST)".replace("{year}",n).replace("{date}",r[1])),o.getTime()<=t.getTime()&&t.getTime()<=i.getTime()?2:1),s={hours:e.getUTCHours()+a,minutes:e.getUTCMinutes(),weekday:e.getUTCDay(),offset:a};return s.hours>23&&(s.hours-=24,s.weekday++),s.hours<0&&(s.hours+=24,s.weekday--),s.weekday=(s.weekday+7)%7,s}var T=window;function _(e,t,n){return n.forEach((function(n){var r=t[n];null!=r&&""!==r&&(e[n]=r)})),e}function L(e,t){var n,r={ajsversion:t.context.ajsversion},o=e.Util.cookieRead(y.visitorCookieKey);if(t.navigationStartTime&&!t.mainContentReadyTime)throw new Error("mainContentReadyTime is required when navigationStartTime is provided");var i,a,s,c=!1;return T.performance&&T.performance.timing&&(n=T.performance.timing,c=!!t.navigationStartTime,t.navigationStartTime=t.navigationStartTime||n.navigationStart,t.mainContentReadyTime=t.mainContentReadyTime||n.domInteractive),r.visitorhash=function(e){var t=0;if(null!=e){for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);t&=t}return t>>>0}(o),r.vis=o.replace("MCAID|",""),r.loadtime=function(e,t){if(e&&t)return""+Math.round((t-e)/100)}(t.navigationStartTime,t.mainContentReadyTime),r.issynthetic=c?"1":"0",r.timeparting=(a=C(i=i||new Date),s=a.offset,[j(a.hours)+":"+j(a.minutes),E[a.weekday],"+0"+s+"00"].join("|")),r.dnt=T.navigator.doNotTrack?"1":"0",r.nativebeacon=navigator.sendBeacon&&navigator.sendBeacon.toString().indexOf("[native code]")>-1?"1":"0",_(r,t.context,y.mapping.contextData),r}function I(e,t){return e.linkTrackEvents="",e.events="",e.eVar8="",e.products="",e.prop7="",e.purchaseID="",e.list1="",e.list2="",e.list3="",e.contextData=L(e,t),e.marketingCloudVisitorID&&(e.eVar24=e.marketingCloudVisitorID),_(e,t.context,y.mapping.global),function(e,t){if(t.finnkode&&(e.prop7=t.finnkode),"object"===t.view){e.contextData.adstatus=t.adstatus,t.finnkode&&g(e,"event4"),t.timeFrontpageToFinncode&&(e.contextData.timeFrontpageToFinncode=t.timeFrontpageToFinncode),t.timeFasToFinncode&&(e.contextData.timeFasToFinncode=t.timeFasToFinncode),"fas"===t.ref&&g(e,"event1");var n=t.visitorSessionId;n&&g(e,"event5:"+n)}var r=t.visitorId;r&&g(e,"event6:"+r)}(e,t.context),e}function D(e){var t=y.resolveRsid(e),n=new AppMeasurement(t);return n.account=t,n.visitorNamespace=y.visitorNamespace,n.visitor=function(e){if(!Visitor||!Visitor.getInstance)throw new Error("Missing Visitor API Module");return Visitor.getInstance(e)}(y.id),n.visitor.trackingServer=y.trackingServer,n.trackDownloadLinks=!1,n.trackExternalLinks=!1,n.trackInlineStats=!1,n.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx",n.linkInternalFilters="javascript:finn.no",n.linkLeaveQueryString=!1,n.linkTrackVars=void 0,n.linkTrackEvents=void 0,n.currencyCode="NOK",n.usePlugins=!0,n.doPlugins=function(){},n.trackingServer=y.trackingServer,n}function S(e,n,r){if(void 0===r&&(r="o"),n||(n=D(e)),!e.context)throw new Error("Missing context object");(e&&e.analyticsName||t(e))&&(I(n,e),x(n,e),f(n,e),!0===e.trackAsPageView?n.t():n.tl(!0,r,e.analyticsName),"development"!==e.context.env&&window.console&&Object.keys(n.contextData).forEach((function(e){-1===y.linkTrackContextData.indexOf(e)&&console.warn('Key "'+e+'" is not declared in event/linktracking as a valid key, Adobe will filter it away.')})))}function A(e,t){if(t||(t=D(e)),!e.context)throw new Error("Missing context object");I(t,e),f(t,e),t.t()}function F(e){var t;e.on(e.PAGE,(function(e){t&&!e.context.reportSuiteOverride||(t=D(e)),A(e,t)})),e.on(e.EVENT,(function(e){t&&!e.context.reportSuiteOverride||(t=D(e)),S(e,t)}))}var P=Object.freeze({__proto__:null,create:D,trackEvent:S,trackPage:A,listen:F}),N="track_deferred",R=function(){function e(e){var t=e.emitter,n=e.configurator,r=e.version,o=void 0===r?"unknown":r,i=e.storage,a=e.posters,s=void 0===a?{}:a;this._emitter=t,this.configurator=n,this.version=o,this.globalPageContext=null,this.storage=i,this.posters=s}return e.prototype.setVersion=function(e){this.version=e},e.prototype._copy=function(e){var t={};return e&&Object.keys(e).forEach((function(n){t[n]=e[n]})),t},e.prototype.prepareContext=function(e){e=e?this._copy(e):{};var t={ajsversion:this.version};return e.context=this._copy(e.context),e.context&&e.context._snapshot||(this.globalPageContext&&q(this.globalPageContext,t),e.context&&q(e.context,t),e.context=this.configurator.getConfig(t),e.context._snapshot=!0),e},e.prototype.trackPage=function(e){var t=this;this._emitter.publish(this._emitter.PAGE,this.prepareContext(e)),setTimeout((function(){t._runDeferred()}),0)},e.prototype.trackEvent=function(e){this._emitter.publish(this._emitter.EVENT,this.prepareContext(e))},e.prototype.trackEventLater=function(e){if(!this.storage)return this.trackEvent(e);var t=this.storage.get(N);(t=t&&JSON.parse(t)||[]).push(this.prepareContext(e)),this.storage.set(N,JSON.stringify(t))},e.prototype.trackExitLink=function(e){var t=this.prepareContext(e),n=this.posters.adobe;if(null!=n){var r=n.create(t);n.trackEvent(t,r,l)}null!=e.callback&&e.callback()},e.prototype._runDeferred=function(){var e=this;if(this.storage){var t=this.storage.pop(N);if(t)try{(t=JSON.parse(t)).forEach((function(t,n){setTimeout((function(){e.trackEvent(t)}),10*(n+1))}))}catch(e){}}},e.prototype.setPageContext=function(e,t){var n=this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.setPageContext(t,e[t])}));this.globalPageContext||(this.globalPageContext={}),this.globalPageContext[e]=t},e.prototype.resetPageContext=function(e){this.globalPageContext=e},e}();function q(e,t){Object.keys(e).forEach((function(n){t[n]=e[n]}))}var M,V="__analyticsQueue",B="event",U="page",G="config",K="event-later",X="exit-link",$="get-api",J=((M={})[$]=1,M.config=2,M.page=3,M[X]=4,M.event=5,M[K]=6,M);function H(e,t){var n=e[0],r=t[0];return J[n]-J[r]}var Q=function(){function e(e,t){this.context=e,this.store=t}return e.prototype.getLookupKeys=function(e,t){var n=[];return e&&n.push(e),Array.isArray(t.keys)?n.concat(t.keys):n},e.prototype.lookup=function(e){if(e)return this.getValueFromContextOrStore(e)},e.prototype.getValueFromContextOrStore=function(e){return this.context&&void 0!==this.context[e]?this.context[e]:this.store[e]},e}(),z="Analytics-Configurator: ";function W(e){return void 0===e}function Y(e){return!W(e)}function Z(e){return"string"==typeof e}var ee=function(){function e(e,t,n,r){if("object"!=typeof e)throw new Error(z+"Specs should be an object");if(this.specs=e,!Array.isArray(t))throw new Error(z+"getters must be an array with one or more objects");this.getters=t,this.cache=n,this.logger=r}return e.prototype.get=function(e){if(!e)throw new Error(z+"Config key missing");var t=this.specs[e];if(!0!==t){if(!t)throw new Error(z+"Asked for key "+e+" but no spec in configuration.");return this.cache&&this.cache[e]?this.cache[e]:this.lookup(e)}},e.prototype.lookup=function(e){var t,n,r,o=this.specs[e];if(this.getters.some((function(i){var a=i(e,o);if(Y(a.result))return t=a.result,r=a.key,n=e,!0})),Y(t)&&o.deprecated&&this.logger&&this.logger.warn("Key "+e+" is deprecated"),W(t)&&Y(o.default)&&(t=this.template(o.default)),o.always&&(t=this.callWithInjectables(o,o.always,[t])),W(t)&&o.required)throw new Error(z+"key "+e+" is configured to be a required property");return W(t)||("function"==typeof o.format&&(t=o.format(t,n)),Boolean(t)&&Z(o.format)&&(t=this.template(o.format).replace("%value",t).replace("%key",e).replace("%matchKey",r).replace("%param",n)),Array.isArray(o.filters)&&o.filters.forEach((function(e){if("lc"===e&&Z(t)&&(t=t.toLowerCase()),"urldecode"===e&&Z(t))try{t=decodeURIComponent(t.replace(/\+/g,"%20"))}catch(e){}})),t&&this.cache&&(this.cache[e]=t,r&&!this.cache[r]&&(this.cache[r]=t))),t},e.prototype.template=function(e){var t=this,n=e;return"function"==typeof e&&(n=e()),"string"==typeof n&&n.indexOf("$")>-1?n.replace(/(\$\w+)/g,(function(e){return t.get(e.substr(1))||""})):n},e.prototype.callWithInjectables=function(e,t,n){var r=this;return Array.isArray(e.inject)&&e.inject.forEach((function(e){n.push(r.get(e))})),t.apply(void 0,n)},e}(),te=function(){function e(e){this.doc=e}return e.prototype.getLookupKeys=function(e,t){var n=[];return e&&n.push(e),Array.isArray(t.keys)?n.concat(t.keys):n},e.prototype.lookup=function(e){if(e)return this.getLastMetaTagByName(e)},e.prototype.getLastMetaTagByName=function(e){for(var t=e.toLowerCase(),n=this.doc.getElementsByTagName("meta"),r=n.length-1;r>=0;r--){var o=n[r];if(o&&o.name&&o.name.toLowerCase()===t)return o.content}},e}(),ne=function(){function e(e,t){this.doc=e,this.url=t||this.doc.baseURI,this.cache={}}return e.prototype.getLookupKeys=function(e,t){var n=[];return Array.isArray(t.query)?n.concat(t.query):n},e.prototype.lookup=function(e){if(e)return this.getQueryParameterFromUrlOrCache(e)},e.prototype.getQueryParameterFromUrlOrCache=function(e){var t=this.cache[this.url];if(!t){var n=this.getQueryString(this.url);t=this.cache[n]?this.cache[n]:this.cache[this.url]=this.cache[n]=this.getQueryParameters(n)}return t["string"==typeof e?e.toLowerCase():e]},e.prototype.getQueryString=function(e){var t=this.doc.createElement("a");return t.href=e,t.search||""},e.prototype.getQueryParameters=function(e){var t={};return e?e.replace(/^.*\?/,"").split(/&|&amp;/).reduce((function(e,t){var n="string"==typeof(t=t.split("="))[0]&&t[0].toLowerCase(),r=t[1];return r&&(e[n]=decodeURIComponent(r)),e}),t):t},e}();var re=function(){function e(e,t){if(!e)throw new Error("Missing specs");var n;this.specs=function(e){var t={};return Object.keys(e).forEach((function(n){t[n]=e[n],e[n].keys&&e[n].keys.forEach((function(n){e[n]||(t[n]=!0)}))})),t}(e),this.logger=t,this.store=(n={},{createGetter:function(e){return new Q(e,n)},set:function(e,t){n[e]=t}}),this.extraGetters=[]}return e.prototype.getConfig=function(e,t){var n=this;void 0===t&&(t={});var r=this.validateContextAndCreateGetterProcessor(e,t),o={};return Object.keys(this.specs).forEach((function(e){var t=n.validateAndProcessSpec(e,r);void 0!==t&&(o[e]=t)})),o},e.prototype.validateContextAndCreateGetterProcessor=function(e,t){var n=this;this.validateContext(e);var r=[this.store.createGetter(e),new ne(document),new te(document)].concat(this.extraGetters).map((function(e){return n.createGetterLookup(e)}));return new ee(this.specs,r,t,this.logger)},e.prototype.validateContext=function(e){var t=this;e&&this.logger&&Object.keys(e).forEach((function(e){t.specs[e]||t.logger.warn("Key "+e+" not in specs")}))},e.prototype.createGetterLookup=function(e){return function(t,n){var r={};return e.getLookupKeys(t,n).some((function(t){var n=e.lookup(t);return void 0!==n&&(r.result=n,r.key=t,!0)})),r}},e.prototype.validateAndProcessSpec=function(e,t){return this.validate(e),t.get(e)},e.prototype.validate=function(e){if(!this.specs[e])throw new Error("Key "+e+" not in specs")},e.prototype.get=function(e,t,n){var r=this.validateContextAndCreateGetterProcessor(t,n);return this.validateAndProcessSpec(e,r)},e.prototype.set=function(e,t){var n=this;return"object"==typeof e?Object.keys(e).forEach((function(t){n.set(t,e[t])})):(this.validate(e),this.store.set(e,t))},e.prototype.addGetter=function(e){this.extraGetters.push(e)},e}(),oe=function(){function e(e,t){void 0===e&&(e="finn-analytics-"),void 0===t&&(t="|||"),this.PREFIX=e,this.SPLIT=t;try{this.storage=window.sessionStorage||window.localStorage}catch(e){}}return e.prototype.set=function(e,t,n){var r;n&&(t=(new Date).getTime()+n+this.SPLIT+t);try{r=this.storage.setItem(this.PREFIX+e,t)}catch(e){}return r},e.prototype.get=function(e){var t;try{if(2===(t=(t=this.storage.getItem(this.PREFIX+e)).split(this.SPLIT)).length)return 1*t[0]<=(new Date).getTime()?(this.remove(e),null):t[1];t=t[0]}catch(e){}return t},e.prototype.remove=function(e){var t;try{t=this.storage.removeItem(this.PREFIX+e)}catch(e){}return t},e.prototype.removeAll=function(){for(var e in this.storage)if(0===e.indexOf(this.PREFIX))try{this.storage.removeItem(e)}catch(e){}},e.prototype.getValue=function(e){return this.storage.getItem(this.PREFIX+e)},e.prototype.pop=function(e){var t=this.get(e);return this.remove(e),t},e}();function ie(e){return e.replace(/([-/])(\d+)(\/?)/g,"$1ID$3")}var ae={"client.application":{},"client.device":{inject:["userAgent"],always:function(e,t){if(e)return e;if(t.indexOf("tablet")>-1||t.indexOf("ipad")>-1)return"tablet";if(t.indexOf("mobi")>-1)return"mobile";return"desktop"}}};function se(e,t){return Array.isArray(t)?t.some((function(t){return-1!==e.indexOf(t)})):-1!==e.indexOf(t)}function ce(e,t){return e?function(e){if(e)return se(e,["/caravan/","/mobilehome/"])?"car":se(e,["/agriculturetractor/","/agriculturecombines/","/agriculturetools/","/truck/","/construction/","/bus/"])?"b2b":se(e,"/companyforsale/")?"realestate":void 0}(t)||e:function(e){if(e){var t=e.split("/").filter((function(e){return e}));return function(e){return-1!==e.indexOf("search.html")||-1!==e.indexOf("browse.html")||-1!==e.indexOf("ad.html")}(t)&&t.length>1?t[0]:void 0}}(t)||function(e){if(e)return se(e,"/smajobber/")?"smalljobs":se(e,"hotell.finn.no")||se(e,"leiebil.finn.no")?"travel":se(e,"kart.finn")?"map":se(e,"/b2b/")?"b2b":se(e,"/mc/")?"mc":se(e,"/boat/")?"boat":se(e,"/job/")?"job":se(e,"/realestate/")?"realestate":se(e,"/bap/")?"bap":se(e,"/car/")?"car":void 0}(t)||"common"}var ue={pulseOptions:{format:function(e){void 0===e&&(e="");return t=e,t&&"string"==typeof t?function(e){var t=function(e){if(0===e.indexOf("%7B"))return decodeURIComponent(e.replace(/\+/g,"%20"));return e}(e);if(0===t.indexOf("{")&&JSON.parse)try{return JSON.parse(t)}catch(e){}return{}}(e):{};var t},keys:["FINN.pulseOptions"]},contentType:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentType}},contentId:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentId}},spidId:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.spidId}},contentLocation:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentLocation}},category:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.category}},tags:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.tags}},filters:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.filters}},objectCustom:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.objectCustom}},experiments:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.experiments}},intent:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.intent}},target:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.target}},pageViewId:{}};function fe(t,n){function r(e,t){return t.some((function(t){return!!(t&&e.indexOf(t)>-1)}))}function o(e){var t=document.createElement("a");return t.href=e,t}function i(e,t){var n=e.pathname;if(t){var r=document.createElement("a");r.href=t,n=r.pathname}return"/"!==n[0]&&(n="/"+n),n}function a(e){return"/smajobber/"===e||r(e,["/search.html","/smajobber/alle-smajobber","flybilletter/","feriehus-hytteutleie/","reise/pakkereiser/","reise/restplasser/"])}function s(e){var t=(new Date).getTime();return""+Math.round((t-1*e)/1e3)}function c(e,t,n){return e.indexOf("/innfinn/adselection/ad")>1?ie(e):"smalljobs"===t?ie(e.replace(/(.*)(alle-smajobber\/[^/]+\/[^/]+)(.*)/,"$1$2")):"common"===t&&e.indexOf("/meldinger")>-1?function(e){return e.replace(/meldinger\/id\/.*/,"meldinger")}(e):"travel"===t&&(r=n.host,o="hotell.finn",i=i||0,r.indexOf(o,i)===i)?function(e){return e.replace(/(finn.no\/Hotel|Place)\/(.*\.html?)/i,"$1/ID")}(e):e;var r,o,i}void 0===t&&(t=window),void 0===n&&(n=new oe);for(var u={ajsversion:{},"tracking-location":{always:function(e){var n=e?o(e):t.location;return{href:n.href,origin:n.origin,protocol:n.protocol,host:n.host,hostname:n.hostname,port:n.port,pathname:n.pathname,search:n.search,hash:n.hash}}},referrer:{always:function(e){var n;try{n=e||t.document.referrer}catch(e){}if(!n)try{n=document.referrer}catch(e){n=""}return n.replace(/finn\.no:443/,"finn.no")},keys:["referer"]},env:{default:t.location.host||"",always:function(e){return"production"===e||"development"===e?e:["www.finn","event.finn.no","kart.finn","hjemmehos.finn","hotell.finn.no","redirect.datahc.com","leiebil.finn.no","hjelpesenter.finn","finnspirasjon.finn.no","avinor.no"].some((function(t){return 0===e.indexOf(t)}))?"production":"development"}},adstatus:{keys:["dcsext.adstatus"]},adtypeid:{keys:["dcsext.adtypeid"],query:["adtypeid"]},areaid:{keys:["dcsext.seg_areaid"],query:["areaid"]},customername:{keys:["dcsext.customer"]},userAgent:{default:t.navigator.userAgent.toLowerCase()||""},deparea:{keys:["dcsext.deparea"]},eventgroups:{keys:["dscext.ux_el_d","dcsext.ux_el_d"]},finnkode:{keys:["finnkode","adid","dcsext.adid"],query:["finnkode","adid"]},loggedIn:{deprecated:!0,keys:["dcsext.finn.loggedin"]},maincat:{keys:["dcsext.maincat"]},objectpostcode:{keys:["dcsext.seg_postcode"]},prodcat:{keys:["dcsext.prodcat"]},ref:{inject:["tracking-location","referrer"],always:function(e,t,n){return e||(a(i(t,n))?"fas":void 0)},query:["ref"]},refurl:{inject:["referrer"],always:function(e,t){if(e)return e;if(t){var n=o(t),r=n.hostname,a=n.port,s=i(n);return c(r+(a&&"443"!==a&&"80"!==a&&"0"!==a?":"+a:"")+s,n,ce(null,s))}}},currentTimeSinceFas:{always:function(e){if(e)return e;var t=n.get("fas-start");return t?s(t):void 0}},currentTimeSinceFrontpage:{always:function(e){if(e)return e;var t=n.get("frontpage-start");return t?s(t):void 0}},timeFasToFinncode:{inject:["view"],always:function(e,t){if(e)return e;if("fas"!==t||n.get("fas-start")||n.set("fas-start",(new Date).getTime(),18e5),"object"===t){var r=n.pop("fas-start");if(r)return s(r)}}},timeFrontpageToFinncode:{inject:["view"],always:function(e,t){if(e)return e;if("frontpage"!==t||n.get("frontpage-start")||n.set("frontpage-start",(new Date).getTime(),18e5),"object"===t){var r=n.pop("frontpage-start");if(r)return s(r)}}},view:{inject:["tracking-location"],always:function(e,t){if("object"===e||"frontpage"===e||"fas"===e||"browse"===e||"other"===e)return e;var n=t.hostname,o=i(t);return r(o,["/object","/ad.html","/annonse","eiendom/nybygg/prosjekt"])?"object":"/"===o&&n.indexOf("finn.no")>-1&&"hotell.finn.no"!==n&&"leiebil.finn.no"!==n&&"hjelpesenter.finn"!==n&&"finnspirasjon.finn.no"!==n&&"kart.finn.no"!==n?"frontpage":a(o)?"fas":r(o,["/browse"])?"browse":void 0}},campaign:{keys:["cid","af","ds","em","ps","psm"],format:"%matchKey=%value"},internalsearchresults:{filters:["lc"],format:function(e){return e&&"0"!=e?e:"zero"},keys:["searchresult","wt.oss_r"]},internalsearchterm:{filters:["lc"],keys:["searchterm","wt.oss"]},reportSuiteOverride:{},server:{keys:["finn.server","dcsext.server"]},sessionhash:{keys:["finn.visit"]},site:{inject:["vertical","tracking-location"],always:function(e,t,n){if(e)return e;if(n.host.indexOf("finn.no")>-1){var r="finn.no";return t&&"common"!==t&&(r+="/"+t),r}},filters:["lc"],keys:["finn.site"]},platform:{default:"www.finn"},visibleElements:{always:function(e){void 0===e&&(e="");try{var n=t.document.querySelectorAll("[data-track-visible-element]");if(n&&n.length>0){for(var r=e.split(",").filter(Boolean),o=0;o<n.length;o++){var i=n[o].getAttribute("data-track-visible-element");i&&r.push(i)}return r.join(",")}}catch(e){}return e}},abtest:{always:function(t){if(void 0===t&&(t=e.getItem("abtest")),t&&"string"==typeof t&&0===t.indexOf("{"))try{return t=JSON.parse(t),Object.keys(t)}catch(e){}},keys:["FINN.abtest"]},products:{always:function(e){return"string"==typeof e?e.split(","):e?void 0:[]},keys:["FINN.products"]},list1:{},list2:{},list3:{inject:["abtest"],always:function(e,t){return void 0===e&&(e=""),void 0===t&&(t=[]),e.split(",").filter(Boolean).concat(t.map((function(e){return"ab:"+e}))).join(",")}},subcat:{keys:["dcsext.subcat"]},subcat3:{keys:["dcsext.subcat3"]},submarket:{keys:["dcsext.submarket"]},usergroup:{filters:["lc"],keys:["finn.usergroup"]},orgid:{keys:["finn.orgid"]},userid:{filters:["lc"],default:function(){return t.finnUserId||"0"},format:function(e){if(isNaN(Number(e))&&t.trackJs){var n="[configurationSpec] Non-numerical userid: "+e;t.trackJs.track(n),t.console&&"function"==typeof console.warn&&console.warn(n)}return e},keys:["dcs.dcsaut","finn.userid"]},resultListLayout:{keys:["resultListLayout"]},trackinginput:{format:function(e){if(!e||"string"!=typeof e)return e;0===e.indexOf("%7B")&&(e=decodeURIComponent(e));var t=e;if(e&&0===e.indexOf("{")&&JSON.parse)try{t=JSON.parse(e),e.indexOf("audienceManager")>-1&&(t=t.parameters.audienceManager)}catch(e){}return t},keys:["finn.trackinginput"]},queryparams:{inject:["tracking-location"],always:function(e,t){return e||t.search},filters:["lc","urldecode"]},fullurl:{inject:["tracking-location"],always:function(e,t){return e||(n=t.href,n.substr(n.indexOf("//")+2,n.length).replace(/(;|%3b|jsessionid=|pdc=)[^?]+/,""));var n},filters:["lc","urldecode"]},fullurlnoparams:{inject:["tracking-location"],always:function(e,t){if(e)return e;var n=t.hostname,r=t.port;return n+(r&&"443"!==r&&"80"!==r&&"0"!==r?":"+r:"")+i(t)},filters:["lc","urldecode"]},pageName:{inject:["vertical","tracking-location","fullurlnoparams"],always:function(e,t,n,r){return e||c(r,t,n)}},vertical:{required:!0,inject:["verticalId","tracking-location"],always:function(e,t,n){return ce(e,i(n))},filters:["lc"],keys:["marketplace","finn.marketplace"]},verticalId:{keys:["dcsext.vertical"],query:["verticalid"]},visitorSessionId:{format:"$finnkode%value",keys:["finn.visitorsessionid"]},visitorId:{format:"$finnkode%value",keys:["finn.visitorid"]},adobeEvents:{always:function(e){return e&&"string"==typeof e?e.split(",").map((function(e){return e.trim()})):[]}},"promotion.extendedProfile":{format:function(e){return e&&"false"!==e?"1":"0"},keys:["extendedProfile"]},custmeta:{},fromdate:{},todate:{}},f=1;f<14;f++)u["marketcustom"+f]={keys:["marketcustom"+f]};return le(ue,le(ae,u))}function le(e,t){return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}var pe=function(){function e(e){this.requestFactory=e,this.beaconBuffer="",this.sendRequest=this.sendRequest.bind(this)}return e.prototype.trackEvent=function(e){var t=this.urlEncodeEvent(e);this.enqueueRequest(t)},e.prototype.urlEncodeEvent=function(e){return this.encodeParameter("e",this.urlEncodeEventOptions(e))},e.prototype.encodeParameter=function(e,t){return t?encodeURIComponent(e)+"="+encodeURIComponent(t):""},e.prototype.urlEncodeEventOptions=function(e){var t=this;return Object.keys(e).map((function(n){var r=e[n];return"object"==typeof r&&null!==r?t.urlEncodeEventOptions(r):t.encodeParameter(n,r)})).filter(Boolean).join("&")},e.prototype.enqueueRequest=function(e){clearTimeout(this.bulkTimer),this.beaconBuffer+="&"+e,this.bulkTimer=setTimeout(this.sendRequest,100)},e.prototype.sendRequest=function(){if(this.beaconBuffer){var e=this.createRequest();e&&e.send(this.beaconBuffer),this.clearBeaconBuffer()}},e.prototype.createRequest=function(){return this.beaconBuffer.length>e.MAX_BULK_LENGTH?this.requestFactory.getXhr():this.requestFactory.getBeacon()},e.prototype.clearBeaconBuffer=function(){this.beaconBuffer=""},e.MAX_BULK_LENGTH=1900,e}(),de=function(){function e(t,n){this.baseUrl=e.getBaseUrl(t,n)}return e.getBaseUrl=function(t,n){return"production"===t&&e.FINN_SITES_REGEXP.test(n.hostname)?"https://www.finn.no"+e.BASE_URL:"https://dev.finn.no"+e.BASE_URL},e.prototype.getXhr=function(){var e=new XMLHttpRequest;return"withCredentials"in e?(e.open("POST",this.baseUrl),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=!0,e):null},e.prototype.getBeacon=function(){var e=new Image(0,0),t=String(this.baseUrl);return{send:function(n){e.src=t+"?"+n}}},e.BASE_URL="/ec/b",e.FINN_SITES_REGEXP=/[www|kart|hotell|leiebil|hjelpesenter|finnspirasjon]\.finn\.no/i,e}(),ve=function(){function e(t){this.eventObj=e.migrateLegacyEventDataOptions(t),this.context=this.eventObj.context,this.type=this.eventObj.ecType||this.context.ecType,this.category=this.eventObj.ecCategory||this.context.ecCategory}return e.migrateLegacyEventDataOptions=function(e){if(e.eventData&&!e.ecType&&!e.ecCategory){var t=he(e,{});return t.eventData=he(e.eventData,{}),t.ecType=t.eventData.ecType,delete t.eventData.ecType,t.ecCategory=t.eventData.ecCategory,delete t.eventData.ecCategory,t}return e},e.prototype.hasRequiredTrackingData=function(){return Boolean(this.type||this.category)},e.prototype.getOptions=function(){var e=this.getRequiredOptions(),t=this.getOptionFromEventOrContext("client.application");t&&(e["client.application"]=t);var n=this.getOptionFromEventOrContext("client.device");n&&(e["client.device"]=n);var r=this.getOptionFromEventOrContext("finnkode");r&&(e.finnkode=r);var o=this.getOptionFromEventOrContext("userid");o&&(e.userid=o);var i=this.getOptionFromEventOrContext("referrer");i&&(e.referrer=i);var a=this.getEventData();return a&&(e.eventData=a),e},e.prototype.getRequiredOptions=function(){return{ecType:this.type,ecCategory:this.category}},e.prototype.getOptionFromEventOrContext=function(e){return this.eventObj[e]||this.context[e]},e.prototype.getEventData=function(){return this.eventObj.eventData},e}();function he(e,t){return void 0===e&&(e={}),Object.keys(e).forEach((function(n){t[n]=e[n]})),t}var ye,ge=function(){function e(e){this.client=e}return e.prototype.trackEvent=function(e){var t=new ve(e);t.hasRequiredTrackingData()&&this.scheduleEventTracking(t)},e.prototype.scheduleEventTracking=function(e){var t=e.getOptions();this.validateOptionsAndThrow(t),this.client.trackEvent(t)},e.prototype.validateOptionsAndThrow=function(e){if(!e.ecType)throw new Error("EC beacons require a ecType property on the event object");if(!e.ecCategory)throw new Error("EC beacons require a ecCategory property on the event object")},e.prototype.trackDeprecatedEvent=function(e){this.client.trackEvent(e)},e}();function me(e,t){var n=function(e){var t=e.getConfig(),n=new de(t.env,t["tracking-location"]);return new pe(n)}(e);ye=new ge(n),function(e){e.on(e.EVENT,we),e.on(e.PAGE,we)}(t)}function we(e){ye.trackEvent(e),ke(e)}function ke(e){e.ecData&&("production"!==e.context.env&&(be("eventObj.ecData is deprecated and will be removed in the next major release"),be("Please contact the Frontend Core Team if you see this message anywhere")),ye.trackDeprecatedEvent(e.ecData)),Array.isArray(e.ecPayload)&&("production"!==e.context.env&&(be("eventObj.ecPayload is deprecated and will be removed in the next major release"),be("Please publish the events as individual events instead (with eventObj.combine == true to combine the events into one request)")),e.ecPayload.forEach((function(e){ye.trackDeprecatedEvent(e)})))}function be(e){window.console&&(console.warn?console.warn(e):console.log(e))}var xe,Ee=Object.freeze({__proto__:null,configureAndListen:me,trackDeprecatedEvents:ke}),Oe="object"==typeof Reflect?Reflect:null,je=Oe&&"function"==typeof Oe.apply?Oe.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};xe=Oe&&"function"==typeof Oe.ownKeys?Oe.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Ce=Number.isNaN||function(e){return e!=e};function Te(){Te.init.call(this)}var _e=Te,Le=function(e,t){return new Promise((function(n,r){function o(){void 0!==i&&e.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==t&&(i=function(n){e.removeListener(t,o),r(n)},e.once("error",i)),e.once(t,o)}))};Te.EventEmitter=Te,Te.prototype._events=void 0,Te.prototype._eventsCount=0,Te.prototype._maxListeners=void 0;var Ie=10;function De(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Se(e){return void 0===e._maxListeners?Te.defaultMaxListeners:e._maxListeners}function Ae(e,t,n,r){var o,i,a,s;if(De(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=Se(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function Fe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Pe(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=Fe.bind(r);return o.listener=n,r.wrapFn=o,o}function Ne(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):qe(o,o.length)}function Re(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function qe(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(Te,"defaultMaxListeners",{enumerable:!0,get:function(){return Ie},set:function(e){if("number"!=typeof e||e<0||Ce(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Ie=e}}),Te.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Te.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Ce(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Te.prototype.getMaxListeners=function(){return Se(this)},Te.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)je(s,this,t);else{var c=s.length,u=qe(s,c);for(n=0;n<c;++n)je(u[n],this,t)}return!0},Te.prototype.addListener=function(e,t){return Ae(this,e,t,!1)},Te.prototype.on=Te.prototype.addListener,Te.prototype.prependListener=function(e,t){return Ae(this,e,t,!0)},Te.prototype.once=function(e,t){return De(t),this.on(e,Pe(this,e,t)),this},Te.prototype.prependOnceListener=function(e,t){return De(t),this.prependListener(e,Pe(this,e,t)),this},Te.prototype.removeListener=function(e,t){var n,r,o,i,a;if(De(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},Te.prototype.off=Te.prototype.removeListener,Te.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},Te.prototype.listeners=function(e){return Ne(this,e,!0)},Te.prototype.rawListeners=function(e){return Ne(this,e,!1)},Te.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Re.call(e,t)},Te.prototype.listenerCount=Re,Te.prototype.eventNames=function(){return this._eventsCount>0?xe(this._events):[]};var Me=_e.EventEmitter;_e.once=Le;var Ve,Be=(Ve=function(e,t){return(Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ve(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ue="finn-analytics error",Ge=function(e){function t(){var n=e.call(this)||this;return n.EVENT=t.EVENT,n.PAGE=t.PAGE,n}return Be(t,e),t.prototype.logError=function(e,t,n){try{n=JSON.stringify(n,null,4)}catch(e){}try{window.trackJs?window.trackJs.track(e):window.console.error?window.console.error(Ue,e,".\n name:"+t+"\n data:",n):window.console.log(Ue,e,".\n name:"+t+"\n data:",n)}catch(e){}},t.prototype.publish=function(e,t){void 0===t&&(t={});try{this.emit(e,t)}catch(n){this.logError(n,e,t)}},t.EVENT="event",t.PAGE="page",t}(Me);function Ke(e){e.on(e.PAGE,(function(e){return Xe(e)}))}function Xe(e){e&&e.context&&"production"===e.context.env&&e.context["tracking-location"]&&$e({url:e.context["tracking-location"].href},0)}function $e(e,t){t>5||setTimeout((function(){window.MBL?window.MBL.logPageview(e):$e(e,++t)}),1e3)}var Je=Object.freeze({__proto__:null,listen:Ke,trackPage:Xe}),He=new Ge,Qe=new oe,ze=function(e,t){var n={warn:function(t){"production"!==o.get("env")&&e.console&&e.console.warn&&e.console.warn("finn-analytics config warning: "+t)}},r=fe(e,t),o=new re(r,n);return o}(window,Qe),We=new R({emitter:He,configurator:ze,storage:Qe,posters:{adobe:P,ec:Ee,medietall:Je}});try{window.FINN=window.FINN||{},window.finnAnalytics&&window.console&&console.warn("finnAnalytics script already loaded!"),window.finnAnalytics=window.FINN.analytics=We;We.setVersion("26.2.0")}catch(e){}!function(){var t="AMCV_finnno@AdobeOrg",n="AMCV_62DB2F4C538CEFDA0A490D4D@AdobeOrg",r=e.getItem(t),o=e.getItem(n);if(r){if(!o){var i=new Date;i.setMonth(i.getMonth()+24),e.setItem(n,r,i.toGMTString(),"/",".finn.no")}e.removeItem(t,"/",".finn.no"),e.removeItem("AMCV_finnno","/",".finn.no")}}(),F(He),me(ze,He),Ke(He),setTimeout((function(){!function(e){var t=window[V];window[V]={__injected:!0,push:function(t){var n=t[0],r=t[1],o=r;switch(n){case B:e.trackEvent(r);break;case K:e.trackEventLater(r);break;case X:e.trackExitLink(r);break;case U:e.trackPage(r);break;case $:o(e);break;case G:e.setPageContext(r)}}},t&&!t.__injected&&t.sort(H).forEach((function(e){window[V].push(e)}))}(We)}),0)}();
!function(){"use strict";var e={getItem:function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e,t,n,r,o,i){if(!e||/^(?:expires|max-age|path|domain|secure)$/i.test(e))return!1;var a="";if(n)switch(n.constructor){case Number:a=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:a="; expires="+n;break;case Date:a="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(o?"; domain="+o:"")+(r?"; path="+r:"")+(i?"; secure":""),!0},removeItem:function(e,t,n){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)}};var t="e";for(var n=["site","vertical","platform","sessionhash","areaid","maincat","subcat","prodcat","eventgroups","adtypeid","customername","objectpostcode","campaign","refurl","queryparams","fullurl","fullurlnoparams","orgid","userid","internalsearchterm","internalsearchresults","promotion.extendedProfile","resultListLayout","visibleElements","submarket","deparea","subcat3","usergroup","fromdate","todate","custmeta"],r=1;r<14;r++)n.push("marketcustom"+r);["fullurl","fullurlnoparams","queryparams","loadtime","issynthetic","dnt","sessionstart","dayofweek","areaid","adstatus","eventvalue","DSCext.UX_EL_d","visitorhash","vis","ajsversion","event.group","event.name","event.detail","event.flags","event.kpi","event.error","event.numVal","event.strVal","funnel.name","funnel.step","funnel.flags","timeparting","nativebeacon","timeFrontpageToFinncode","timeFasToFinncode"].concat(n);(function(){try{return!(0===window.location.protocol.indexOf("http:"))}catch(e){}})();var o="track_deferred",i=function(){function e(e){var t=e.emitter,n=e.configurator,r=e.version,o=void 0===r?"unknown":r,i=e.storage,a=e.posters,s=void 0===a?{}:a;this._emitter=t,this.configurator=n,this.version=o,this.globalPageContext=null,this.storage=i,this.posters=s}return e.prototype.setVersion=function(e){this.version=e},e.prototype._copy=function(e){var t={};return e&&Object.keys(e).forEach((function(n){t[n]=e[n]})),t},e.prototype.prepareContext=function(e){e=e?this._copy(e):{};var t={ajsversion:this.version};return e.context=this._copy(e.context),e.context&&e.context._snapshot||(this.globalPageContext&&a(this.globalPageContext,t),e.context&&a(e.context,t),e.context=this.configurator.getConfig(t),e.context._snapshot=!0),e},e.prototype.trackPage=function(e){var t=this;this._emitter.publish(this._emitter.PAGE,this.prepareContext(e)),setTimeout((function(){t._runDeferred()}),0)},e.prototype.trackEvent=function(e){this._emitter.publish(this._emitter.EVENT,this.prepareContext(e))},e.prototype.trackEventLater=function(e){if(!this.storage)return this.trackEvent(e);var t=this.storage.get(o);(t=t&&JSON.parse(t)||[]).push(this.prepareContext(e)),this.storage.set(o,JSON.stringify(t))},e.prototype.trackExitLink=function(e){var n=this.prepareContext(e),r=this.posters.adobe;if(null!=r){var o=r.create(n);r.trackEvent(n,o,t)}null!=e.callback&&e.callback()},e.prototype._runDeferred=function(){var e=this;if(this.storage){var t=this.storage.pop(o);if(t)try{(t=JSON.parse(t)).forEach((function(t,n){setTimeout((function(){e.trackEvent(t)}),10*(n+1))}))}catch(e){}}},e.prototype.setPageContext=function(e,t){var n=this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.setPageContext(t,e[t])}));this.globalPageContext||(this.globalPageContext={}),this.globalPageContext[e]=t},e.prototype.resetPageContext=function(e){this.globalPageContext=e},e}();function a(e,t){Object.keys(e).forEach((function(n){t[n]=e[n]}))}var s,c="__analyticsQueue",u="event",f="page",l="config",p="event-later",h="exit-link",d="get-api",v=((s={})[d]=1,s.config=2,s.page=3,s[h]=4,s.event=5,s[p]=6,s);function y(e,t){var n=e[0],r=t[0];return v[n]-v[r]}var g=function(){function e(e,t){this.context=e,this.store=t}return e.prototype.getLookupKeys=function(e,t){var n=[];return e&&n.push(e),Array.isArray(t.keys)?n.concat(t.keys):n},e.prototype.lookup=function(e){if(e)return this.getValueFromContextOrStore(e)},e.prototype.getValueFromContextOrStore=function(e){return this.context&&void 0!==this.context[e]?this.context[e]:this.store[e]},e}(),m="Analytics-Configurator: ";function w(e){return void 0===e}function b(e){return!w(e)}function k(e){return"string"==typeof e}var x=function(){function e(e,t,n,r){if("object"!=typeof e)throw new Error(m+"Specs should be an object");if(this.specs=e,!Array.isArray(t))throw new Error(m+"getters must be an array with one or more objects");this.getters=t,this.cache=n,this.logger=r}return e.prototype.get=function(e){if(!e)throw new Error(m+"Config key missing");var t=this.specs[e];if(!0!==t){if(!t)throw new Error(m+"Asked for key "+e+" but no spec in configuration.");return this.cache&&this.cache[e]?this.cache[e]:this.lookup(e)}},e.prototype.lookup=function(e){var t,n,r,o=this.specs[e];if(this.getters.some((function(i){var a=i(e,o);if(b(a.result))return t=a.result,r=a.key,n=e,!0})),b(t)&&o.deprecated&&this.logger&&this.logger.warn("Key "+e+" is deprecated"),w(t)&&b(o.default)&&(t=this.template(o.default)),o.always&&(t=this.callWithInjectables(o,o.always,[t])),w(t)&&o.required)throw new Error(m+"key "+e+" is configured to be a required property");return w(t)||("function"==typeof o.format&&(t=o.format(t,n)),Boolean(t)&&k(o.format)&&(t=this.template(o.format).replace("%value",t).replace("%key",e).replace("%matchKey",r).replace("%param",n)),Array.isArray(o.filters)&&o.filters.forEach((function(e){if("lc"===e&&k(t)&&(t=t.toLowerCase()),"urldecode"===e&&k(t))try{t=decodeURIComponent(t.replace(/\+/g,"%20"))}catch(e){}})),t&&this.cache&&(this.cache[e]=t,r&&!this.cache[r]&&(this.cache[r]=t))),t},e.prototype.template=function(e){var t=this,n=e;return"function"==typeof e&&(n=e()),"string"==typeof n&&n.indexOf("$")>-1?n.replace(/(\$\w+)/g,(function(e){return t.get(e.substr(1))||""})):n},e.prototype.callWithInjectables=function(e,t,n){var r=this;return Array.isArray(e.inject)&&e.inject.forEach((function(e){n.push(r.get(e))})),t.apply(void 0,n)},e}(),E=function(){function e(e){this.doc=e}return e.prototype.getLookupKeys=function(e,t){var n=[];return e&&n.push(e),Array.isArray(t.keys)?n.concat(t.keys):n},e.prototype.lookup=function(e){if(e)return this.getLastMetaTagByName(e)},e.prototype.getLastMetaTagByName=function(e){for(var t=e.toLowerCase(),n=this.doc.getElementsByTagName("meta"),r=n.length-1;r>=0;r--){var o=n[r];if(o&&o.name&&o.name.toLowerCase()===t)return o.content}},e}(),O=function(){function e(e,t){this.doc=e,this.url=t||this.doc.baseURI,this.cache={}}return e.prototype.getLookupKeys=function(e,t){var n=[];return Array.isArray(t.query)?n.concat(t.query):n},e.prototype.lookup=function(e){if(e)return this.getQueryParameterFromUrlOrCache(e)},e.prototype.getQueryParameterFromUrlOrCache=function(e){var t=this.cache[this.url];if(!t){var n=this.getQueryString(this.url);t=this.cache[n]?this.cache[n]:this.cache[this.url]=this.cache[n]=this.getQueryParameters(n)}return t["string"==typeof e?e.toLowerCase():e]},e.prototype.getQueryString=function(e){var t=this.doc.createElement("a");return t.href=e,t.search||""},e.prototype.getQueryParameters=function(e){var t={};return e?e.replace(/^.*\?/,"").split(/&|&amp;/).reduce((function(e,t){var n="string"==typeof(t=t.split("="))[0]&&t[0].toLowerCase(),r=t[1];return r&&(e[n]=decodeURIComponent(r)),e}),t):t},e}();var j=function(){function e(e,t){if(!e)throw new Error("Missing specs");var n;this.specs=function(e){var t={};return Object.keys(e).forEach((function(n){t[n]=e[n],e[n].keys&&e[n].keys.forEach((function(n){e[n]||(t[n]=!0)}))})),t}(e),this.logger=t,this.store=(n={},{createGetter:function(e){return new g(e,n)},set:function(e,t){n[e]=t}}),this.extraGetters=[]}return e.prototype.getConfig=function(e,t){var n=this;void 0===t&&(t={});var r=this.validateContextAndCreateGetterProcessor(e,t),o={};return Object.keys(this.specs).forEach((function(e){var t=n.validateAndProcessSpec(e,r);void 0!==t&&(o[e]=t)})),o},e.prototype.validateContextAndCreateGetterProcessor=function(e,t){var n=this;this.validateContext(e);var r=[this.store.createGetter(e),new O(document),new E(document)].concat(this.extraGetters).map((function(e){return n.createGetterLookup(e)}));return new x(this.specs,r,t,this.logger)},e.prototype.validateContext=function(e){var t=this;e&&this.logger&&Object.keys(e).forEach((function(e){t.specs[e]||t.logger.warn("Key "+e+" not in specs")}))},e.prototype.createGetterLookup=function(e){return function(t,n){var r={};return e.getLookupKeys(t,n).some((function(t){var n=e.lookup(t);return void 0!==n&&(r.result=n,r.key=t,!0)})),r}},e.prototype.validateAndProcessSpec=function(e,t){return this.validate(e),t.get(e)},e.prototype.validate=function(e){if(!this.specs[e])throw new Error("Key "+e+" not in specs")},e.prototype.get=function(e,t,n){var r=this.validateContextAndCreateGetterProcessor(t,n);return this.validateAndProcessSpec(e,r)},e.prototype.set=function(e,t){var n=this;return"object"==typeof e?Object.keys(e).forEach((function(t){n.set(t,e[t])})):(this.validate(e),this.store.set(e,t))},e.prototype.addGetter=function(e){this.extraGetters.push(e)},e}(),C=function(){function e(e,t){void 0===e&&(e="finn-analytics-"),void 0===t&&(t="|||"),this.PREFIX=e,this.SPLIT=t;try{this.storage=window.sessionStorage||window.localStorage}catch(e){}}return e.prototype.set=function(e,t,n){var r;n&&(t=(new Date).getTime()+n+this.SPLIT+t);try{r=this.storage.setItem(this.PREFIX+e,t)}catch(e){}return r},e.prototype.get=function(e){var t;try{if(2===(t=(t=this.storage.getItem(this.PREFIX+e)).split(this.SPLIT)).length)return 1*t[0]<=(new Date).getTime()?(this.remove(e),null):t[1];t=t[0]}catch(e){}return t},e.prototype.remove=function(e){var t;try{t=this.storage.removeItem(this.PREFIX+e)}catch(e){}return t},e.prototype.removeAll=function(){for(var e in this.storage)if(0===e.indexOf(this.PREFIX))try{this.storage.removeItem(e)}catch(e){}},e.prototype.getValue=function(e){return this.storage.getItem(this.PREFIX+e)},e.prototype.pop=function(e){var t=this.get(e);return this.remove(e),t},e}();function _(e){return e.replace(/([-/])(\d+)(\/?)/g,"$1ID$3")}var L={"client.application":{},"client.device":{inject:["userAgent"],always:function(e,t){if(e)return e;if(t.indexOf("tablet")>-1||t.indexOf("ipad")>-1)return"tablet";if(t.indexOf("mobi")>-1)return"mobile";return"desktop"}}};function I(e,t){return Array.isArray(t)?t.some((function(t){return-1!==e.indexOf(t)})):-1!==e.indexOf(t)}function P(e,t){return e?function(e){if(e)return I(e,["/caravan/","/mobilehome/"])?"car":I(e,["/agriculturetractor/","/agriculturecombines/","/agriculturetools/","/truck/","/construction/","/bus/"])?"b2b":I(e,"/companyforsale/")?"realestate":void 0}(t)||e:function(e){if(e){var t=e.split("/").filter((function(e){return e}));return function(e){return-1!==e.indexOf("search.html")||-1!==e.indexOf("browse.html")||-1!==e.indexOf("ad.html")}(t)&&t.length>1?t[0]:void 0}}(t)||function(e){if(e)return I(e,"/smajobber/")?"smalljobs":I(e,"hotell.finn.no")||I(e,"leiebil.finn.no")?"travel":I(e,"kart.finn")?"map":I(e,"/b2b/")?"b2b":I(e,"/mc/")?"mc":I(e,"/boat/")?"boat":I(e,"/job/")?"job":I(e,"/realestate/")?"realestate":I(e,"/bap/")?"bap":I(e,"/car/")?"car":void 0}(t)||"common"}var T={pulseOptions:{format:function(e){void 0===e&&(e="");return t=e,t&&"string"==typeof t?function(e){var t=function(e){if(0===e.indexOf("%7B"))return decodeURIComponent(e.replace(/\+/g,"%20"));return e}(e);if(0===t.indexOf("{")&&JSON.parse)try{return JSON.parse(t)}catch(e){}return{}}(e):{};var t},keys:["FINN.pulseOptions"]},contentType:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentType}},contentId:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentId}},spidId:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.spidId}},contentLocation:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.contentLocation}},category:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.category}},tags:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.tags}},filters:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.filters}},objectCustom:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.objectCustom}},experiments:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.experiments}},intent:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.intent}},target:{inject:["pulseOptions"],always:function(e,t){void 0===t&&(t={});return e||t.target}},pageViewId:{}};function A(t,n){function r(e,t){return t.some((function(t){return!!(t&&e.indexOf(t)>-1)}))}function o(e){var t=document.createElement("a");return t.href=e,t}function i(e,t){var n=e.pathname;if(t){var r=document.createElement("a");r.href=t,n=r.pathname}return"/"!==n[0]&&(n="/"+n),n}function a(e){return"/smajobber/"===e||r(e,["/search.html","/smajobber/alle-smajobber","flybilletter/","feriehus-hytteutleie/","reise/pakkereiser/","reise/restplasser/"])}function s(e){var t=(new Date).getTime();return""+Math.round((t-1*e)/1e3)}function c(e,t,n){return e.indexOf("/innfinn/adselection/ad")>1?_(e):"smalljobs"===t?_(e.replace(/(.*)(alle-smajobber\/[^/]+\/[^/]+)(.*)/,"$1$2")):"common"===t&&e.indexOf("/meldinger")>-1?function(e){return e.replace(/meldinger\/id\/.*/,"meldinger")}(e):"travel"===t&&(r=n.host,o="hotell.finn",i=i||0,r.indexOf(o,i)===i)?function(e){return e.replace(/(finn.no\/Hotel|Place)\/(.*\.html?)/i,"$1/ID")}(e):e;var r,o,i}void 0===t&&(t=window),void 0===n&&(n=new C);for(var u={ajsversion:{},"tracking-location":{always:function(e){var n=e?o(e):t.location;return{href:n.href,origin:n.origin,protocol:n.protocol,host:n.host,hostname:n.hostname,port:n.port,pathname:n.pathname,search:n.search,hash:n.hash}}},referrer:{always:function(e){var n;try{n=e||t.document.referrer}catch(e){}if(!n)try{n=document.referrer}catch(e){n=""}return n.replace(/finn\.no:443/,"finn.no")},keys:["referer"]},env:{default:t.location.host||"",always:function(e){return"production"===e||"development"===e?e:["www.finn","event.finn.no","kart.finn","hjemmehos.finn","hotell.finn.no","redirect.datahc.com","leiebil.finn.no","hjelpesenter.finn","finnspirasjon.finn.no","avinor.no"].some((function(t){return 0===e.indexOf(t)}))?"production":"development"}},adstatus:{keys:["dcsext.adstatus"]},adtypeid:{keys:["dcsext.adtypeid"],query:["adtypeid"]},areaid:{keys:["dcsext.seg_areaid"],query:["areaid"]},customername:{keys:["dcsext.customer"]},userAgent:{default:t.navigator.userAgent.toLowerCase()||""},deparea:{keys:["dcsext.deparea"]},eventgroups:{keys:["dscext.ux_el_d","dcsext.ux_el_d"]},finnkode:{keys:["finnkode","adid","dcsext.adid"],query:["finnkode","adid"]},loggedIn:{deprecated:!0,keys:["dcsext.finn.loggedin"]},maincat:{keys:["dcsext.maincat"]},objectpostcode:{keys:["dcsext.seg_postcode"]},prodcat:{keys:["dcsext.prodcat"]},ref:{inject:["tracking-location","referrer"],always:function(e,t,n){return e||(a(i(t,n))?"fas":void 0)},query:["ref"]},refurl:{inject:["referrer"],always:function(e,t){if(e)return e;if(t){var n=o(t),r=n.hostname,a=n.port,s=i(n);return c(r+(a&&"443"!==a&&"80"!==a&&"0"!==a?":"+a:"")+s,n,P(null,s))}}},currentTimeSinceFas:{always:function(e){if(e)return e;var t=n.get("fas-start");return t?s(t):void 0}},currentTimeSinceFrontpage:{always:function(e){if(e)return e;var t=n.get("frontpage-start");return t?s(t):void 0}},timeFasToFinncode:{inject:["view"],always:function(e,t){if(e)return e;if("fas"!==t||n.get("fas-start")||n.set("fas-start",(new Date).getTime(),18e5),"object"===t){var r=n.pop("fas-start");if(r)return s(r)}}},timeFrontpageToFinncode:{inject:["view"],always:function(e,t){if(e)return e;if("frontpage"!==t||n.get("frontpage-start")||n.set("frontpage-start",(new Date).getTime(),18e5),"object"===t){var r=n.pop("frontpage-start");if(r)return s(r)}}},view:{inject:["tracking-location"],always:function(e,t){if("object"===e||"frontpage"===e||"fas"===e||"browse"===e||"other"===e)return e;var n=t.hostname,o=i(t);return r(o,["/object","/ad.html","/annonse","eiendom/nybygg/prosjekt"])?"object":"/"===o&&n.indexOf("finn.no")>-1&&"hotell.finn.no"!==n&&"leiebil.finn.no"!==n&&"hjelpesenter.finn"!==n&&"finnspirasjon.finn.no"!==n&&"kart.finn.no"!==n?"frontpage":a(o)?"fas":r(o,["/browse"])?"browse":void 0}},campaign:{keys:["cid","af","ds","em","ps","psm"],format:"%matchKey=%value"},internalsearchresults:{filters:["lc"],format:function(e){return e&&"0"!=e?e:"zero"},keys:["searchresult","wt.oss_r"]},internalsearchterm:{filters:["lc"],keys:["searchterm","wt.oss"]},reportSuiteOverride:{},server:{keys:["finn.server","dcsext.server"]},sessionhash:{keys:["finn.visit"]},site:{inject:["vertical","tracking-location"],always:function(e,t,n){if(e)return e;if(n.host.indexOf("finn.no")>-1){var r="finn.no";return t&&"common"!==t&&(r+="/"+t),r}},filters:["lc"],keys:["finn.site"]},platform:{default:"www.finn"},visibleElements:{always:function(e){void 0===e&&(e="");try{var n=t.document.querySelectorAll("[data-track-visible-element]");if(n&&n.length>0){for(var r=e.split(",").filter(Boolean),o=0;o<n.length;o++){var i=n[o].getAttribute("data-track-visible-element");i&&r.push(i)}return r.join(",")}}catch(e){}return e}},abtest:{always:function(t){if(void 0===t&&(t=e.getItem("abtest")),t&&"string"==typeof t&&0===t.indexOf("{"))try{return t=JSON.parse(t),Object.keys(t)}catch(e){}},keys:["FINN.abtest"]},products:{always:function(e){return"string"==typeof e?e.split(","):e?void 0:[]},keys:["FINN.products"]},list1:{},list2:{},list3:{inject:["abtest"],always:function(e,t){return void 0===e&&(e=""),void 0===t&&(t=[]),e.split(",").filter(Boolean).concat(t.map((function(e){return"ab:"+e}))).join(",")}},subcat:{keys:["dcsext.subcat"]},subcat3:{keys:["dcsext.subcat3"]},submarket:{keys:["dcsext.submarket"]},usergroup:{filters:["lc"],keys:["finn.usergroup"]},orgid:{keys:["finn.orgid"]},userid:{filters:["lc"],default:function(){return t.finnUserId||"0"},format:function(e){if(isNaN(Number(e))&&t.trackJs){var n="[configurationSpec] Non-numerical userid: "+e;t.trackJs.track(n),t.console&&"function"==typeof console.warn&&console.warn(n)}return e},keys:["dcs.dcsaut","finn.userid"]},resultListLayout:{keys:["resultListLayout"]},trackinginput:{format:function(e){if(!e||"string"!=typeof e)return e;0===e.indexOf("%7B")&&(e=decodeURIComponent(e));var t=e;if(e&&0===e.indexOf("{")&&JSON.parse)try{t=JSON.parse(e),e.indexOf("audienceManager")>-1&&(t=t.parameters.audienceManager)}catch(e){}return t},keys:["finn.trackinginput"]},queryparams:{inject:["tracking-location"],always:function(e,t){return e||t.search},filters:["lc","urldecode"]},fullurl:{inject:["tracking-location"],always:function(e,t){return e||(n=t.href,n.substr(n.indexOf("//")+2,n.length).replace(/(;|%3b|jsessionid=|pdc=)[^?]+/,""));var n},filters:["lc","urldecode"]},fullurlnoparams:{inject:["tracking-location"],always:function(e,t){if(e)return e;var n=t.hostname,r=t.port;return n+(r&&"443"!==r&&"80"!==r&&"0"!==r?":"+r:"")+i(t)},filters:["lc","urldecode"]},pageName:{inject:["vertical","tracking-location","fullurlnoparams"],always:function(e,t,n,r){return e||c(r,t,n)}},vertical:{required:!0,inject:["verticalId","tracking-location"],always:function(e,t,n){return P(e,i(n))},filters:["lc"],keys:["marketplace","finn.marketplace"]},verticalId:{keys:["dcsext.vertical"],query:["verticalid"]},visitorSessionId:{format:"$finnkode%value",keys:["finn.visitorsessionid"]},visitorId:{format:"$finnkode%value",keys:["finn.visitorid"]},adobeEvents:{always:function(e){return e&&"string"==typeof e?e.split(",").map((function(e){return e.trim()})):[]}},"promotion.extendedProfile":{format:function(e){return e&&"false"!==e?"1":"0"},keys:["extendedProfile"]},custmeta:{},fromdate:{},todate:{}},f=1;f<14;f++)u["marketcustom"+f]={keys:["marketcustom"+f]};return R(T,R(L,u))}function R(e,t){return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}var N=function(){function e(e){this.requestFactory=e,this.beaconBuffer="",this.sendRequest=this.sendRequest.bind(this)}return e.prototype.trackEvent=function(e){var t=this.urlEncodeEvent(e);this.enqueueRequest(t)},e.prototype.urlEncodeEvent=function(e){return this.encodeParameter("e",this.urlEncodeEventOptions(e))},e.prototype.encodeParameter=function(e,t){return t?encodeURIComponent(e)+"="+encodeURIComponent(t):""},e.prototype.urlEncodeEventOptions=function(e){var t=this;return Object.keys(e).map((function(n){var r=e[n];return"object"==typeof r&&null!==r?t.urlEncodeEventOptions(r):t.encodeParameter(n,r)})).filter(Boolean).join("&")},e.prototype.enqueueRequest=function(e){clearTimeout(this.bulkTimer),this.beaconBuffer+="&"+e,this.bulkTimer=setTimeout(this.sendRequest,100)},e.prototype.sendRequest=function(){if(this.beaconBuffer){var e=this.createRequest();e&&e.send(this.beaconBuffer),this.clearBeaconBuffer()}},e.prototype.createRequest=function(){return this.beaconBuffer.length>e.MAX_BULK_LENGTH?this.requestFactory.getXhr():this.requestFactory.getBeacon()},e.prototype.clearBeaconBuffer=function(){this.beaconBuffer=""},e.MAX_BULK_LENGTH=1900,e}(),F=function(){function e(t,n){this.baseUrl=e.getBaseUrl(t,n)}return e.getBaseUrl=function(t,n){return"production"===t&&e.FINN_SITES_REGEXP.test(n.hostname)?"https://www.finn.no"+e.BASE_URL:"https://dev.finn.no"+e.BASE_URL},e.prototype.getXhr=function(){var e=new XMLHttpRequest;return"withCredentials"in e?(e.open("POST",this.baseUrl),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=!0,e):null},e.prototype.getBeacon=function(){var e=new Image(0,0),t=String(this.baseUrl);return{send:function(n){e.src=t+"?"+n}}},e.BASE_URL="/ec/b",e.FINN_SITES_REGEXP=/[www|kart|hotell|leiebil|hjelpesenter|finnspirasjon]\.finn\.no/i,e}(),S=function(){function e(t){this.eventObj=e.migrateLegacyEventDataOptions(t),this.context=this.eventObj.context,this.type=this.eventObj.ecType||this.context.ecType,this.category=this.eventObj.ecCategory||this.context.ecCategory}return e.migrateLegacyEventDataOptions=function(e){if(e.eventData&&!e.ecType&&!e.ecCategory){var t=q(e,{});return t.eventData=q(e.eventData,{}),t.ecType=t.eventData.ecType,delete t.eventData.ecType,t.ecCategory=t.eventData.ecCategory,delete t.eventData.ecCategory,t}return e},e.prototype.hasRequiredTrackingData=function(){return Boolean(this.type||this.category)},e.prototype.getOptions=function(){var e=this.getRequiredOptions(),t=this.getOptionFromEventOrContext("client.application");t&&(e["client.application"]=t);var n=this.getOptionFromEventOrContext("client.device");n&&(e["client.device"]=n);var r=this.getOptionFromEventOrContext("finnkode");r&&(e.finnkode=r);var o=this.getOptionFromEventOrContext("userid");o&&(e.userid=o);var i=this.getOptionFromEventOrContext("referrer");i&&(e.referrer=i);var a=this.getEventData();return a&&(e.eventData=a),e},e.prototype.getRequiredOptions=function(){return{ecType:this.type,ecCategory:this.category}},e.prototype.getOptionFromEventOrContext=function(e){return this.eventObj[e]||this.context[e]},e.prototype.getEventData=function(){return this.eventObj.eventData},e}();function q(e,t){return void 0===e&&(e={}),Object.keys(e).forEach((function(n){t[n]=e[n]})),t}var D,B=function(){function e(e){this.client=e}return e.prototype.trackEvent=function(e){var t=new S(e);t.hasRequiredTrackingData()&&this.scheduleEventTracking(t)},e.prototype.scheduleEventTracking=function(e){var t=e.getOptions();this.validateOptionsAndThrow(t),this.client.trackEvent(t)},e.prototype.validateOptionsAndThrow=function(e){if(!e.ecType)throw new Error("EC beacons require a ecType property on the event object");if(!e.ecCategory)throw new Error("EC beacons require a ecCategory property on the event object")},e.prototype.trackDeprecatedEvent=function(e){this.client.trackEvent(e)},e}();function U(e,t){var n=function(e){var t=e.getConfig(),n=new F(t.env,t["tracking-location"]);return new N(n)}(e);D=new B(n),function(e){e.on(e.EVENT,M),e.on(e.PAGE,M)}(t)}function M(e){D.trackEvent(e),G(e)}function G(e){e.ecData&&("production"!==e.context.env&&(V("eventObj.ecData is deprecated and will be removed in the next major release"),V("Please contact the Frontend Core Team if you see this message anywhere")),D.trackDeprecatedEvent(e.ecData)),Array.isArray(e.ecPayload)&&("production"!==e.context.env&&(V("eventObj.ecPayload is deprecated and will be removed in the next major release"),V("Please publish the events as individual events instead (with eventObj.combine == true to combine the events into one request)")),e.ecPayload.forEach((function(e){D.trackDeprecatedEvent(e)})))}function V(e){window.console&&(console.warn?console.warn(e):console.log(e))}var X,$=Object.freeze({__proto__:null,configureAndListen:U,trackDeprecatedEvents:G}),J="object"==typeof Reflect?Reflect:null,K=J&&"function"==typeof J.apply?J.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};X=J&&"function"==typeof J.ownKeys?J.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var H=Number.isNaN||function(e){return e!=e};function Q(){Q.init.call(this)}var W=Q,z=function(e,t){return new Promise((function(n,r){function o(){void 0!==i&&e.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==t&&(i=function(n){e.removeListener(t,o),r(n)},e.once("error",i)),e.once(t,o)}))};Q.EventEmitter=Q,Q.prototype._events=void 0,Q.prototype._eventsCount=0,Q.prototype._maxListeners=void 0;var Y=10;function Z(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function ee(e){return void 0===e._maxListeners?Q.defaultMaxListeners:e._maxListeners}function te(e,t,n,r){var o,i,a,s;if(Z(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=ee(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function ne(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function re(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=ne.bind(r);return o.listener=n,r.wrapFn=o,o}function oe(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):ae(o,o.length)}function ie(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function ae(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(Q,"defaultMaxListeners",{enumerable:!0,get:function(){return Y},set:function(e){if("number"!=typeof e||e<0||H(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Y=e}}),Q.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Q.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||H(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Q.prototype.getMaxListeners=function(){return ee(this)},Q.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)K(s,this,t);else{var c=s.length,u=ae(s,c);for(n=0;n<c;++n)K(u[n],this,t)}return!0},Q.prototype.addListener=function(e,t){return te(this,e,t,!1)},Q.prototype.on=Q.prototype.addListener,Q.prototype.prependListener=function(e,t){return te(this,e,t,!0)},Q.prototype.once=function(e,t){return Z(t),this.on(e,re(this,e,t)),this},Q.prototype.prependOnceListener=function(e,t){return Z(t),this.prependListener(e,re(this,e,t)),this},Q.prototype.removeListener=function(e,t){var n,r,o,i,a;if(Z(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},Q.prototype.off=Q.prototype.removeListener,Q.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},Q.prototype.listeners=function(e){return oe(this,e,!0)},Q.prototype.rawListeners=function(e){return oe(this,e,!1)},Q.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):ie.call(e,t)},Q.prototype.listenerCount=ie,Q.prototype.eventNames=function(){return this._eventsCount>0?X(this._events):[]};var se=W.EventEmitter;W.once=z;var ce,ue=(ce=function(e,t){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),fe="finn-analytics error",le=function(e){function t(){var n=e.call(this)||this;return n.EVENT=t.EVENT,n.PAGE=t.PAGE,n}return ue(t,e),t.prototype.logError=function(e,t,n){try{n=JSON.stringify(n,null,4)}catch(e){}try{window.trackJs?window.trackJs.track(e):window.console.error?window.console.error(fe,e,".\n name:"+t+"\n data:",n):window.console.log(fe,e,".\n name:"+t+"\n data:",n)}catch(e){}},t.prototype.publish=function(e,t){void 0===t&&(t={});try{this.emit(e,t)}catch(n){this.logError(n,e,t)}},t.EVENT="event",t.PAGE="page",t}(se);function pe(e){e.on(e.PAGE,(function(e){return he(e)}))}function he(e){e&&e.context&&"production"===e.context.env&&e.context["tracking-location"]&&de({url:e.context["tracking-location"].href},0)}function de(e,t){t>5||setTimeout((function(){window.MBL?window.MBL.logPageview(e):de(e,++t)}),1e3)}var ve=Object.freeze({__proto__:null,listen:pe,trackPage:he}),ye=new le,ge=new C,me=function(e,t){var n={warn:function(t){"production"!==o.get("env")&&e.console&&e.console.warn&&e.console.warn("finn-analytics config warning: "+t)}},r=A(e,t),o=new j(r,n);return o}(window,ge),we=new i({emitter:ye,configurator:me,storage:ge,posters:{ec:$,medietall:ve}});try{window.FINN=window.FINN||{},window.finnAnalytics&&window.console&&console.warn("finnAnalytics script already loaded!"),window.finnAnalytics=window.FINN.analytics=we;we.setVersion("26.3.0")}catch(e){}!function(){var t="AMCV_finnno@AdobeOrg",n="AMCV_62DB2F4C538CEFDA0A490D4D@AdobeOrg",r=e.getItem(t),o=e.getItem(n);if(r){if(!o){var i=new Date;i.setMonth(i.getMonth()+24),e.setItem(n,r,i.toGMTString(),"/",".finn.no")}e.removeItem(t,"/",".finn.no"),e.removeItem("AMCV_finnno","/",".finn.no")}}(),U(me,ye),pe(ye),setTimeout((function(){!function(e){var t=window[c];window[c]={__injected:!0,push:function(t){var n=t[0],r=t[1],o=r;switch(n){case u:e.trackEvent(r);break;case p:e.trackEventLater(r);break;case h:e.trackExitLink(r);break;case f:e.trackPage(r);break;case d:o(e);break;case l:e.setPageContext(r)}}},t&&!t.__injected&&t.sort(y).forEach((function(e){window[c].push(e)}))}(we)}),0)}();
# Adobe Tracking
> **_NOTE:_** Adobe tracking is as of 01.11.2021 disabled.
> The client tracking functions are still available, but the signals are not sent to adobe.
> See `@finn-no/pulse-sdk` for tracking documentation in FINN.
Minimal tracking example:

@@ -4,0 +8,0 @@

# Pulse Tracking
> **_NOTE:_** Pulse tracking has been moved to `@finn-no/pulse-sdk`.
## Setup

@@ -4,0 +6,0 @@

@@ -1,5 +0,9 @@

var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -37,3 +41,3 @@ import settings from '../settings';

'event3'
], getAdobeEventTrackNames(eventObj.context.adobeEvents)).join(',');
], getAdobeEventTrackNames(eventObj.context.adobeEvents), true).join(',');
appendToEvents(appm, 'event3');

@@ -40,0 +44,0 @@ var extraEvents = eventObj.context.adobeEvents;

import migrateLegacyCookies from './adobe/fix-cookies';
import * as adobe from './adobe/index';
import AnalyticsApi from './api';

@@ -14,3 +13,2 @@ import { injectAndProcess } from './client/mapper';

var posters = {
adobe: adobe,
ec: ec,

@@ -36,3 +34,2 @@ medietall: medietall

migrateLegacyCookies();
adobe.listen(emitter);
ec.configureAndListen(configurator, emitter);

@@ -39,0 +36,0 @@ medietall.listen(emitter);

{
"name": "@finn-no/analytics",
"version": "26.2.0",
"version": "26.3.0",
"homepage": "https://github.schibsted.io/finn/finn-analytics-js",

@@ -53,9 +53,9 @@ "licence": "MIT",

"devDependencies": {
"@finn-no/cdn-uploader": "^3.1.5",
"@finn-no/cdn-uploader": "^3.3.0",
"@sinonjs/fake-timers": "6.0.1",
"@types/expect.js": "^0.3.29",
"@types/mocha": "^8.2.2",
"@types/mocha": "^8.2.3",
"@types/node": "^14.14.41",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"acorn": "^8.0.4",

@@ -74,3 +74,3 @@ "es6-shim": "0.35.6",

"karma-sinon": "^1.0.5",
"karma-typescript": "5.5.1",
"karma-typescript": "5.5.2",
"markdown-table": "^3.0.0",

@@ -77,0 +77,0 @@ "mocha": "^8.2.1",

@@ -18,6 +18,2 @@ # @finn-no/analytics

* Adobe tracking
* See [ADOBE.md](./docs/ADOBE.md)
* Pulse tracking
* See [PULSE.md](./docs/PULSE.md)
* Event Collector tracking

@@ -24,0 +20,0 @@ * See [EVENT-COLLECTOR.md](./docs/EVENT-COLLECTOR.md)

import migrateLegacyCookies from './adobe/fix-cookies';
import * as adobe from './adobe/index';
import AnalyticsApi from './api';

@@ -22,3 +21,2 @@ import { injectAndProcess } from './client/mapper';

const posters = {
adobe: adobe,
ec: ec,

@@ -46,3 +44,2 @@ medietall: medietall

adobe.listen(emitter);
ec.configureAndListen(configurator, emitter);

@@ -49,0 +46,0 @@ medietall.listen(emitter);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc