// source --> https://www.tcgkauppa.fi/wp-content/plugins/trustpilot-reviews/review/assets/js/headerScript.min.js?ver=1.0&#039; async=&#039;async 
function inIframe(){try{return window.self!==window.top}catch(t){return!1}}function tryParseJson(t){if("string"==typeof t)try{return JSON.parse(t)}catch(t){return!1}return!1}!function(t,e,r,i,n){t.TrustpilotObject=n,t.tp=t.tp||function(){(t.tp.q=t.tp.q||[]).push(arguments)},a=e.createElement(r),a.async=1,a.src=i,a.type="text/javascript",f=e.getElementsByTagName(r)[0],f.parentNode.insertBefore(a,f)}(window,document,"script",trustpilot_settings.TrustpilotScriptUrl,"tp"),tp("register",trustpilot_settings.key),inIframe()&&window.addEventListener("message",function(t){var e=new URL(window.location).hostname,r=new URL(t.origin).hostname,i=-1===t.origin.indexOf(e),n=e!==r;if(i!==n&&console.log(`Origin missmatch: old condition result: ${i}, new condition result: ${n}`),t.data&&!n)if("undefined"!=typeof TrustpilotPreview){if("string"!=typeof t.data||"submit"!==t.data)return jsonData=tryParseJson(t.data),void(jsonData&&(jsonData.trustbox?TrustpilotPreview.setSettings(jsonData.trustbox):jsonData.customised&&TrustpilotPreview.updateActive(jsonData.customised)));TrustpilotPreview.sendTrustboxes()}else{var s=tryParseJson(t.data);if(s&&s.trustboxes){var o=document.createElement("script");o.type="text/javascript",o.src=trustpilot_settings.WidgetScriptUrl,document.head.appendChild(o);var a=document.createElement("script");a.type="text/javascript",a.onload=function(){const e=t.source.parent.document.getElementById("configuration_iframe").contentWindow;TrustpilotPreview.init([trustpilot_settings.PreviewCssUrl,trustpilot_settings.PreviewWPCssUrl],s,e,t.source)},a.src=trustpilot_settings.PreviewScriptUrl,document.head.appendChild(a)}}});
//# sourceMappingURL=headerScript.min.js.map;
// source --> https://www.tcgkauppa.fi/wp-content/plugins/wc-paytrail/assets/js/wc-paytrail.js?ver=2.7.1 
jQuery(document).ready(function($) {
	/**
	 * Display Apple Pay in payment methods
	 */
	function wcPaytrailInitApplePay() {
		if ( $( '.wc-paytrail-classic #wc-paytrail-ppa-method-apple_pay' ).length > 0 && typeof checkoutFinland !== 'undefined' ) {
			const applePayButton = checkoutFinland.applePayButton;
			
			if (applePayButton.canMakePayment()) {
				$( '#wc-paytrail-ppa-method-group-applepay' ).removeClass( 'wc-paytrail-hide-ap' );
			}
		}
	}
	wcPaytrailInitApplePay();

	$( document.body ).on( 'updated_checkout', function() {
		wcPaytrailInitApplePay();
	} );

	/**
	 * When clicking Paytrail card token, add active class and check radio button
	 */
	$( 'form.checkout, form#order_review' ).on( 'click', '#payment .payment_methods .payment_method_paytrail_ppa li.woocommerce-SavedPaymentMethods-token', function( e ) {
		$( '#payment .payment_methods .payment_method_paytrail_ppa li.woocommerce-SavedPaymentMethods-token' ).removeClass( 'selected' );
		$( this ).addClass( 'selected' );
		$( 'input[type="radio"]', this ).prop( 'checked', true ).change();
	} );

	/**
	 * When clicking Paytrail PPA payment method, add active class and check radio button
	 */
	$( 'form.checkout, form#order_review' ).on( 'click', '.wc-paytrail-classic .wc-paytrail-ppa-method', function( e ) {
		$( '.wc-paytrail-ppa-method.selected').removeClass( 'selected' );
		$( this ).addClass( 'selected' );
		$( 'input[type="radio"]', this ).prop( 'checked', true ).change();
	} );
});