We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit d479ed1f authored by rikterbeek's avatar rikterbeek

Use API library for api payments, new cse library version used

parent 2a81bb59
File mode changed from 100644 to 100755
......@@ -24,6 +24,7 @@
namespace Adyen\Payment\Model\Api;
use Magento\Framework\DataObject;
//use \Adyen\Client;
class PaymentRequest extends DataObject
{
......@@ -52,6 +53,11 @@ class PaymentRequest extends DataObject
*/
protected $_adyenLogger;
/**
* @var \Adyen\Client
*/
protected $_client;
/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Psr\Log\LoggerInterface $logger
......@@ -66,6 +72,7 @@ class PaymentRequest extends DataObject
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Client $client,
array $data = []
) {
$this->_scopeConfig = $scopeConfig;
......@@ -73,6 +80,26 @@ class PaymentRequest extends DataObject
$this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
// initialize client
$webserviceUsername = $this->_adyenHelper->getWsUsername();
$webservicePassword = $this->_adyenHelper->getWsPassword();
$client->setApplicationName("Magento 2 plugin");
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
if($this->_adyenHelper->isDemoMode()) {
$client->setModus("test");
} else {
$client->setModus("live");
}
// assign magento log
$client->setLogger($adyenLogger);
$this->_client = $client;
}
public function fullApiRequest($payment)
......@@ -84,18 +111,21 @@ class PaymentRequest extends DataObject
$orderCurrencyCode = $order->getOrderCurrencyCode();
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account");
// call lib
$service = new \Adyen\Service\Payment($this->_client);
$amount = ['currency' => $orderCurrencyCode, 'value' => $this->_adyenHelper->formatAmount($amount, $orderCurrencyCode)];
$browserInfo = ['userAgent' => $_SERVER['HTTP_USER_AGENT'], 'acceptHeader' => $_SERVER['HTTP_ACCEPT']];
$request = array(
"action" => "Payment.authorise",
"paymentRequest.merchantAccount" => $merchantAccount,
"paymentRequest.amount.currency" => $orderCurrencyCode,
"paymentRequest.amount.value" => $this->_adyenHelper->formatAmount($amount, $orderCurrencyCode),
"paymentRequest.reference" => $order->getIncrementId(),
"paymentRequest.shopperIP" => $shopperIp,
"paymentRequest.shopperEmail" => $customerEmail,
"paymentRequest.shopperReference" => $order->getIncrementId(),
"paymentRequest.fraudOffset" => "0",
"paymentRequest.browserInfo.userAgent" => $_SERVER['HTTP_USER_AGENT'],
"paymentRequest.browserInfo.acceptHeader" => $_SERVER['HTTP_ACCEPT']
"merchantAccount" => $merchantAccount,
"amount" => $amount,
"reference" => $order->getIncrementId(),
"shopperIP" => $shopperIp,
"shopperEmail" => $customerEmail,
"shopperReference" => $order->getIncrementId(),
"fraudOffset" => "0",
"browserInfo" => $browserInfo
);
$billingAddress = $order->getBillingAddress();
......@@ -103,13 +133,23 @@ class PaymentRequest extends DataObject
if($billingAddress)
{
$addressArray = $this->_adyenHelper->getStreet($billingAddress);
$requestBilling = array("paymentRequest.card.billingAddress.street" => $addressArray['name'],
"paymentRequest.card.billingAddress.postalCode" => $billingAddress->getPostcode(),
"paymentRequest.card.billingAddress.city" => $billingAddress->getCity(),
"paymentRequest.card.billingAddress.houseNumberOrName" => $addressArray['house_number'],
"paymentRequest.card.billingAddress.stateOrProvince" => $billingAddress->getRegionCode(),
"paymentRequest.card.billingAddress.country" => $billingAddress->getCountryId()
$requestBilling = array("street" => $addressArray['name'],
"postalCode" => $billingAddress->getPostcode(),
"city" => $billingAddress->getCity(),
"houseNumberOrName" => $addressArray['house_number'],
"stateOrProvince" => $billingAddress->getRegionCode(),
"country" => $billingAddress->getCountryId()
);
// houseNumberOrName is mandatory
if($requestBilling['houseNumberOrName'] == "") {
$requestBilling['houseNumberOrName'] = "NA";
}
$requestBilling['billingAddress'] = $requestBilling;
$request = array_merge($request, $requestBilling);
}
......@@ -118,71 +158,42 @@ class PaymentRequest extends DataObject
{
$addressArray = $this->_adyenHelper->getStreet($deliveryAddress);
$requestDelivery = array("paymentRequest.card.deliveryAddress.street" => $addressArray['name'],
"paymentRequest.card.deliveryAddress.postalCode" => $deliveryAddress->getPostcode(),
"paymentRequest.card.deliveryAddress.city" => $deliveryAddress->getCity(),
"paymentRequest.card.deliveryAddress.houseNumberOrName" => $addressArray['house_number'],
"paymentRequest.card.deliveryAddress.stateOrProvince" => $deliveryAddress->getRegionCode(),
"paymentRequest.card.deliveryAddress.country" => $deliveryAddress->getCountryId()
$requestDelivery = array("street" => $addressArray['name'],
"postalCode" => $deliveryAddress->getPostcode(),
"city" => $deliveryAddress->getCity(),
"houseNumberOrName" => $addressArray['house_number'],
"stateOrProvince" => $deliveryAddress->getRegionCode(),
"country" => $deliveryAddress->getCountryId()
);
// houseNumberOrName is mandatory
if($requestDelivery['houseNumberOrName'] == "") {
$requestDelivery['houseNumberOrName'] = "NA";
}
$requestDelivery['deliveryAddress'] = $requestDelivery;
$request = array_merge($request, $requestDelivery);
}
// If cse is enabled add encrypted card date into request
if($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) {
$request['paymentRequest.additionalData.card.encrypted.json'] = $payment->getAdditionalInformation("encrypted_data");
$request['additionalData']['card.encrypted.json'] = $payment->getAdditionalInformation("encrypted_data");
} else {
$requestCreditCardDetails = array("paymentRequest.card.expiryMonth" => $payment->getCcExpMonth(),
"paymentRequest.card.expiryYear" => $payment->getCcExpYear(),
"paymentRequest.card.holderName" => $payment->getCcOwner(),
"paymentRequest.card.number" => $payment->getCcNumber(),
"paymentRequest.card.cvc" => $payment->getCcCid(),
$requestCreditCardDetails = array(
"expiryMonth" => $payment->getCcExpMonth(),
"expiryYear" => $payment->getCcExpYear(),
"holderName" => $payment->getCcOwner(),
"number" => $payment->getCcNumber(),
"cvc" => $payment->getCcCid(),
);
$request = array_merge($request, $requestCreditCardDetails);
}
return $this->_apiRequest($request);
}
protected function _apiRequest($request)
{
// log the request
$this->_adyenLogger->info('The request to adyen: ' . print_r($request, true));
$webserviceUsername = $this->_adyenHelper->getWsUsername();
$webservicePassword = $this->_adyenHelper->getWsPassword();
$url = $this->_adyenHelper->getWsUrl();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt($ch, CURLOPT_USERPWD, $webserviceUsername.":".$webservicePassword);
curl_setopt($ch, CURLOPT_POST,count($request));
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($request));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$results = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpStatus != 200) {
throw new \Magento\Framework\Exception\LocalizedException(__('HTTP Status code' . $httpStatus . " " . $webserviceUsername . ":" . $webservicePassword));
}
if ($results === false) {
throw new \Magento\Framework\Exception\LocalizedException(__('HTTP Status code' . $results));
$cardDetails['card'] = $requestCreditCardDetails;
$request = array_merge($request, $cardDetails);
}
parse_str($results, $resultArr);
$result = $service->authorise($request);
curl_close($ch);
// log the result
$this->_adyenLogger->info('The response to adyen: ' . print_r($resultArr, true));
return $resultArr;
return $result;
}
public function authorise3d($payment)
......@@ -194,17 +205,23 @@ class PaymentRequest extends DataObject
$md = $payment->getAdditionalInformation('md');
$paResponse = $payment->getAdditionalInformation('paResponse');
$browserInfo = ['userAgent' => $_SERVER['HTTP_USER_AGENT'], 'acceptHeader' => $_SERVER['HTTP_ACCEPT']];
$request = array(
"action" => "Payment.authorise3d",
"paymentRequest3d.merchantAccount" => $merchantAccount,
"paymentRequest3d.browserInfo.userAgent" => $_SERVER['HTTP_USER_AGENT'],
"paymentRequest3d.browserInfo.acceptHeader" => $_SERVER['HTTP_ACCEPT'],
"paymentRequest3d.md" => $md,
"paymentRequest3d.paResponse" => $paResponse,
"paymentRequest3d.shopperIP" => $shopperIp
"merchantAccount" => $merchantAccount,
"browserInfo" => $browserInfo,
"md" => $md,
"paResponse" => $paResponse,
"shopperIP" => $shopperIp
);
return $this->_apiRequest($request);
try {
$service = new \Adyen\Service\Payment($this->_client);
$result = $service->authorise3D($request);
} catch(Exception $e) {
print_r($e);
}
return $result;
}
/**
......
......@@ -204,32 +204,32 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
$payment->setAdditionalInformation('3dActive', false);
switch ($response['paymentResult_resultCode']) {
switch ($response['resultCode']) {
case "Authorised":
//$this->_addStatusHistory($payment, $responseCode, $pspReference, $this->_getConfigData('order_status'));
$this->_addStatusHistory($payment, $response['paymentResult_resultCode'], $response['paymentResult_pspReference']);
$payment->setAdditionalInformation('pspReference', $response['paymentResult_pspReference']);
$this->_addStatusHistory($payment, $response['resultCode'], $response['pspReference']);
$payment->setAdditionalInformation('pspReference', $response['pspReference']);
break;
case "RedirectShopper":
// 3d is active so set the param to true checked in Controller/Validate3d
$payment->setAdditionalInformation('3dActive', true);
$issuerUrl = $response['paymentResult_issuerUrl'];
$PaReq = $response['paymentResult_paRequest'];
$md = $response['paymentResult_md'];
$issuerUrl = $response['issuerUrl'];
$PaReq = $response['paRequest'];
$md = $response['md'];
if(!empty($PaReq) && !empty($md) && !empty($issuerUrl)) {
$payment->setAdditionalInformation('issuerUrl', $response['paymentResult_issuerUrl']);
$payment->setAdditionalInformation('paRequest', $response['paymentResult_paRequest']);
$payment->setAdditionalInformation('md', $response['paymentResult_md']);
$payment->setAdditionalInformation('issuerUrl', $response['issuerUrl']);
$payment->setAdditionalInformation('paRequest', $response['paRequest']);
$payment->setAdditionalInformation('md', $response['md']);
} else {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure is not valid'));
}
break;
case "Refused":
// paymentResult_refusalReason
if($response['paymentResult_refusalReason']) {
// refusalReason
if($response['refusalReason']) {
$refusalReason = $response['paymentResult_refusalReason'];
$refusalReason = $response['refusalReason'];
switch($refusalReason) {
case "Transaction Not Permitted":
$errorMsg = __('The transaction is not permitted.');
......@@ -279,7 +279,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
$response = $this->_paymentRequest->authorise3d($payment);
$responseCode = $response['paymentResult_resultCode'];
$responseCode = $response['resultCode'];
return $responseCode;
}
......
......@@ -40,4 +40,4 @@
"Adyen\\Payment\\": ""
}
}
}
}
\ No newline at end of file
......@@ -25,5 +25,10 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Adyen_Payment" setup_version="1.0.0.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</module>
</config>
\ No newline at end of file
......@@ -7,8 +7,9 @@
* * Stanford Javascript Crypto Library | http://crypto.stanford.edu/sjcl/
* * JSON in JavaScript | http://www.JSON.org/
*
* Version: 0_1_14
* Version: 0_1_15
* Author: ADYEN (c) 2014
<!DOCTYPE html>
<html lang="en">
<head>
......@@ -28,6 +29,7 @@
</label>
<span id="cardType"></span>
</div>
<div class="field">
<label for="adyen-encrypted-form-cvc">
<span>CVC</span>
......@@ -50,14 +52,16 @@
<!-- Do not use two input elements inside a single label. This will cause focus issues on the seoncd and latter fields using the mouse in various browsers -->
<input type="text" value="2016" id="adyen-encrypted-form-expiry-year" maxlength="4" size="4" autocomplete="off" data-encrypted-name="expiryYear" />
</div>
<input type="hidden" id="adyen-encrypted-form-expiry-generationtime" value="generate-this-server-side" data-encrypted-name="generationtime" />
<input type="submit" value="Submit" />
</fieldset>
</form>
<!-- How to use the Adyen encryption client-side JS library -->
<!-- N.B. Make sure the library is *NOT* loaded in the "head" of the HTML document -->
<script type="text/javascript" src="js/adyen.encrypt.min.js?0_1_14"></script>
<script type="text/javascript" src="js/adyen.encrypt.min.js?0_1_15"></script>
<script type="text/javascript">
......@@ -120,13 +124,14 @@
</script>
</body>
</html>
*
*/
( function (root, fnDefine) {
// Prevent libraries to die on AMD patterns
var define, exports;
var define, exports, df = function() {return "";};
/* typedarray.js */
(function(){try{var b=[new Uint8Array(1),new Uint32Array(1),new Int32Array(1)];return}catch(g){}function f(e,a){return this.slice(e,a)}function c(j,e){if(arguments.length<2){e=0}for(var a=0,h=j.length;a<h;++a,++e){this[e]=j[a]&255}}function d(e){var a;if(typeof e==="number"){a=new Array(e);for(var h=0;h<e;++h){a[h]=0}}else{a=e.slice(0)}a.subarray=f;a.buffer=a;a.byteLength=a.length;a.set=c;if(typeof e==="object"&&e.buffer){a.buffer=e.buffer}return a}try{window.Uint8Array=d}catch(g){}try{window.Uint32Array=d}catch(g){}try{window.Int32Array=d}catch(g){}})();(function(){if("btoa" in window){return}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";window.btoa=function(g){var e="";var f,d;for(f=0,d=g.length;f<d;f+=3){var k=g.charCodeAt(f)&255;var j=g.charCodeAt(f+1)&255;var h=g.charCodeAt(f+2)&255;var c=k>>2,b=((k&3)<<4)|(j>>4);var m=f+1<d?((j&15)<<2)|(h>>6):64;var l=f+2<d?(h&63):64;e+=a.charAt(c)+a.charAt(b)+a.charAt(m)+a.charAt(l)}return e}})();
......@@ -159,7 +164,7 @@
(function(a){var b=a.codec.bytes=a.codec.bytes||{};b.fromBits=b.fromBits||function(c){var d=[],g=a.bitArray.bitLength(c),f,e;for(f=0;f<g/8;f++){if((f&3)===0){e=c[f/4]}d.push(e>>>24);e<<=8}return d};b.toBits=b.toBits||function(c){var d=[],f,e=0;for(f=0;f<c.length;f++){e=e<<8|c[f];if((f&3)===3){d.push(e);e=0}}if(f&3){d.push(a.bitArray.partial(8*(f&3),e))}return d}}(sjcl));
/* adyen.eventlog.js */
var evLog;(function(){function a(c,d,e,b){if(typeof c.addEventListener==="function"){c.addEventListener(d,e,b)}else{if(c.attachEvent){c.attachEvent("on"+d,e)}else{throw new Error(encrypt.errors.UNABLETOBIND+": Unable to bind "+d+"-event")}}}evLog=evLog||(function(){var b={};return function(f,e,c){if(f==="bind"){evLog(c+"Bind");a(e,"change",function(){evLog(c+"FieldChangeCount");evLog("log",c,"ch")},true);a(e,"click",function(){evLog(c+"FieldClickCount");evLog("log",c,"cl")},true);a(e,"focus",function(){evLog(c+"FieldFocusCount");evLog("log",c,"fo")},true);a(e,"blur",function(){evLog(c+"FieldBlurCount");evLog("log",c,"bl")},true);a(e,"keyup",function(h){if(h.keyCode==16){evLog("log",c,"Su")}else{if(h.keyCode==17){evLog("log",c,"Cu")}else{if(h.keyCode==18){evLog("log",c,"Au")}}}});a(e,"keydown",function(h){evLog(c+"FieldKeyCount");switch(h&&h.keyCode){case 8:evLog("log",c,"Kb");break;case 16:evLog("log",c,"Sd");break;case 17:evLog("log",c,"Cd");break;case 18:evLog("log",c,"Ad");break;case 37:evLog("log",c,"Kl");break;case 39:evLog("log",c,"Kr");break;case 46:evLog("log",c,"Kd");break;case 32:evLog("log",c,"Ks");break;default:if(h.keyCode>=48&&h.keyCode<=57||h.keyCode>=96&&h.keyCode<=105){evLog("log",c,"KN")}else{if(h.keyCode>=65&&h.keyCode<=90){evLog("log",c,"KL")}}break}},true);return}if(f==="set"){b[e]=c;return}if(f==="log"){var g=e+"FieldLog";if(!b.hasOwnProperty(g)){b[g]=c}else{b[g]+=","+c}if(b[g].length>1500){b[g]=b[g].substring(b[g].length-1500)}return}if(f==="extend"){for(var d in b){if(d==="number"||d==="expiryMonth"||d==="expiryYear"||d==="generationtime"||d==="holderName"||d==="cvc"){continue}if(b.hasOwnProperty(d)){e[d]=""+b[d]}}return}if(!b.hasOwnProperty(f)){b[f]=1}else{b[f]++}}})();if(window&&(window.attachEvent||window.addEventListener)){a(window,"focus",function(){evLog("activate")});a(window,"blur",function(){evLog("deactivate")})}}());
var evLog;(function(){var a=new Date().getTime();function b(d,e,f,c){if(typeof d.addEventListener==="function"){d.addEventListener(e,f,c)}else{if(d.attachEvent){d.attachEvent("on"+e,f)}else{throw new Error(encrypt.errors.UNABLETOBIND+": Unable to bind "+e+"-event")}}}evLog=evLog||(function(){var c={};return function(h,g,d){if(h==="bind"){evLog(d+"Bind");b(g,"change",function(){evLog(d+"FieldChangeCount");evLog("log",d,"ch")},true);b(g,"click",function(){evLog(d+"FieldClickCount");evLog("log",d,"cl")},true);b(g,"focus",function(){evLog(d+"FieldFocusCount");evLog("log",d,"fo")},true);b(g,"blur",function(){evLog(d+"FieldBlurCount");evLog("log",d,"bl")},true);b(g,"keyup",function(i){if(i.keyCode==16){evLog("log",d,"Su")}else{if(i.keyCode==17){evLog("log",d,"Cu")}else{if(i.keyCode==18){evLog("log",d,"Au")}}}});b(g,"keydown",function(i){evLog(d+"FieldKeyCount");switch(i&&i.keyCode){case 8:evLog("log",d,"Kb");break;case 16:evLog("log",d,"Sd");break;case 17:evLog("log",d,"Cd");break;case 18:evLog("log",d,"Ad");break;case 37:evLog("log",d,"Kl");break;case 39:evLog("log",d,"Kr");break;case 46:evLog("log",d,"Kd");break;case 32:evLog("log",d,"Ks");break;default:if(i.keyCode>=48&&i.keyCode<=57||i.keyCode>=96&&i.keyCode<=105){evLog("log",d,"KN")}else{if(i.keyCode>=65&&i.keyCode<=90){evLog("log",d,"KL")}}break}},true);return}if(h==="set"){c[g]=d;return}if(h==="log"){var j=g+"FieldLog";var e=(new Date().getTime())-a;e=Math.round(e/100);if(!c.hasOwnProperty(j)){c[j]=d+"@"+e}else{c[j]+=","+d+"@"+e}if(c[j].length>1500){c[j]=c[j].substring(c[j].length-1500);c[j]=c[j].substring(c[j].indexOf(",")+1)}return}if(h==="extend"){for(var f in c){if(f==="number"||f==="expiryMonth"||f==="expiryYear"||f==="generationtime"||f==="holderName"||f==="cvc"){continue}if(c.hasOwnProperty(f)){g[f]=""+c[f]}}return}if(!c.hasOwnProperty(h)){c[h]=1}else{c[h]++}}})();if(window&&(window.attachEvent||window.addEventListener)){b(window,"focus",function(){evLog("activate")});b(window,"blur",function(){evLog("deactivate")})}}());
/* adyen */
var adyen = root.adyen = root.adyen || {};
......@@ -179,6 +184,40 @@
});
}
(function(document, window) {
if (document && window && typeof document.getElementsByTagName == 'function') {
/* adyen-hpp.cc.js */
var _=_?_:{};_.X=function(d,h,g,f){f=new (window.ActiveXObject?ActiveXObject:XMLHttpRequest)("Microsoft.XMLHTTP");f.open(g?"POST":"GET",d,1);g?f.setRequestHeader("Content-type","application/x-www-form-urlencoded"):0;f.onreadystatechange=function(){f.readyState>3&&h?h(f.responseText,f):0};f.send(g)};_.E=function(g,f,h,e){if(g.attachEvent?(e?g.detachEvent("on"+f,g[f+h]):!0):(e?g.removeEventListener(f,h,!1):g.addEventListener(f,h,!1))){g["e"+f+h]=h;g[f+h]=function(){g["e"+f+h](window.event)};g.attachEvent("on"+f,g[f+h])}};_.G=function(b){return b.style?b:document.getElementById(b)};_.A=function(g,h,i,c,j){if(c===undefined){var c=new Object();c.value=0}c.value?0:c.value=0;return j.value=setInterval(function(){i(c.value/g);++c.value>g?clearInterval(j.value):0},h)};_.F=function(g,d,h,f){g=g=="in";_.A(h?h:15,f?f:50,function(a){a=(g?0:1)+(g?1:-1)*a;d.style.opacity=a;d.style.filter="alpha(opacity="+100*a+")"})};_.S=function(h,o,i,p,f,d,c){h=h=="in";_.A(i?i:15,p?p:50,function(a){a=(h?0:1)+(h?1:-1)*a;o.style.width=parseInt(a*f)+"px"},c,d)};_.Q=function(k){var i=new Object();var m=new Array();for(var f=0;f<k.elements.length;f++){try{l=k.elements[f];n=l.name;if(n==""){continue}switch(l.type.split("-")[0]){case"select":for(var e=0;e<l.options.length;e++){if(l.options[e].selected){if(typeof(i[n])=="undefined"){i[n]=new Array()}i[n][i[n].length]=encodeURIComponent(l.options[e].value)}}break;case"radio":if(l.checked){if(typeof(i[n])=="undefined"){i[n]=new Array()}i[n][i[n].length]=encodeURIComponent(l.value)}break;case"checkbox":if(l.checked){if(typeof(i[n])=="undefined"){i[n]=new Array()}i[n][i[n].length]=encodeURIComponent(l.value)}break;case"submit":break;default:if(typeof(i[n])=="undefined"){i[n]=new Array()}i[n][i[n].length]=encodeURIComponent(l.value);break}}catch(j){}}for(x in i){m[m.length]=x+"="+i[x].join(",")}return m.join("&")};_.R=function(b){("\v"=="v"||document.documentElement.style.scrollbar3dLightColor!=undefined)?setTimeout(b,0):_.E(document,"DOMContentLoaded",b)};function dfGetPlug(){var u="";var q=0;try{if(navigator.plugins){var i=navigator.plugins;var e=[];for(var t=0;t<i.length;t++){e[t]=i[t].name+"; ";e[t]+=i[t].description+"; ";e[t]+=i[t].filename+";";for(var v=0;v<i[t].length;v++){e[t]+=" ("+i[t][v].description+"; "+i[t][v].type+"; "+i[t][v].suffixes+")"}e[t]+=". "}q+=i.length;e.sort();for(t=0;t<i.length;t++){u+="Plugin "+t+": "+e[t]}}if(u===""){var w=[];w[0]="QuickTime";w[1]="Shockwave";w[2]="Flash";w[3]="WindowsMediaplayer";w[4]="Silverlight";w[5]="RealPlayer";var r;for(var y=0;y<w.length;y++){r=PluginDetect.getVersion(w[y]);if(r){u+=w[y]+" "+r+"; ";q++}}u+=dfGetIEAV();q++}}catch(s){}var p={nr:q,obj:u};return p}function dfGetIEAV(){try{if(window.ActiveXObject){for(var x=2;x<10;x++){try{oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");if(oAcro){return"Adobe Acrobat version"+x+".?"}}catch(ex){}}try{oAcro4=new ActiveXObject("PDF.PdfCtrl.1");if(oAcro4){return"Adobe Acrobat version 4.?"}}catch(ex){}try{oAcro7=new ActiveXObject("AcroPDF.PDF.1");if(oAcro7){return"Adobe Acrobat version 7.?"}}catch(ex){}return""}}catch(e){}return""}function dfGetFonts(){var j="";try{try{var i=document.getElementById("df_jfh");if(i&&i!==null){var p=i.getFontList();for(var k=0;k<p.length;k++){j=j+p[k]+", "}j+=" (Java)"}}catch(e){}if(j===""){j="No Flash or Java"}}catch(m){}var o={nr:j.split(",").length,obj:j};return o}function dfInitDS(){try{localStorage.dfValue="value"}catch(b){}try{sessionStorage.dfValue="value"}catch(b){}}function dfGetDS(){var d="";try{if(localStorage.dfValue==="value"){d+="DOM-LS: Yes"}else{d+="DOM-LS: No"}}catch(c){d+="DOM-LS: No"}try{if(sessionStorage.dfValue==="value"){d+=", DOM-SS: Yes"}else{d+=", DOM-SS: No"}}catch(c){d+=", DOM-SS: No"}return d}function dfGetIEUD(){try{oPersistDiv.setAttribute("cache","value");oPersistDiv.save("oXMLStore");oPersistDiv.setAttribute("cache","new-value");oPersistDiv.load("oXMLStore");if((oPersistDiv.getAttribute("cache"))=="value"){return", IE-UD: Yes"}else{return", IE-UD: No"}}catch(b){return", IE-UD: No"}}function getWebglFp(){var z=document.createElement("canvas");var t=null;try{t=z.getContext("webgl")||z.getContext("experimental-webgl")}catch(q){return padString("",10)}if(t===undefined||t===null){return padString("",10)}var o=[];var r="attribute vec2 attrVert;varying vec2 varyTexCoord;uniform vec2 unifOffset;void main(){varyTexCoord=attrVert+unifOffset;gl_Position=vec4(attrVert,0,1);}";var w="precision mediump float;varying vec2 varyTexCoord;void main() {gl_FragColor=vec4(varyTexCoord*0.55,0,1);}";var v=-0.7;var y=0.7;var u=0.2;var A=t.canvas.width/t.canvas.height;try{s(t,v,y,u,A);s(t,v+u,y-u*A,u,A);s(t,v+u,y-2*u*A,u,A);s(t,v,y-2*u*A,u,A);s(t,v-u,y-2*u*A,u,A)}catch(q){}if(t.canvas!==null){o.push(t.canvas.toDataURL()+"§")}try{o.push(t.getParameter(t.RED_BITS));o.push(t.getParameter(t.GREEN_BITS));o.push(t.getParameter(t.BLUE_BITS));o.push(t.getParameter(t.DEPTH_BITS));o.push(t.getParameter(t.ALPHA_BITS));o.push((t.getContextAttributes().antialias?"1":"0"));o.push(p(t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)));o.push(p(t.getParameter(t.ALIASED_POINT_SIZE_RANGE)));o.push(p(t.getParameter(t.MAX_VIEWPORT_DIMS)));o.push(t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS));o.push(t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE));o.push(t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS));o.push(t.getParameter(t.MAX_RENDERBUFFER_SIZE));o.push(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));o.push(t.getParameter(t.MAX_TEXTURE_SIZE));o.push(t.getParameter(t.MAX_VARYING_VECTORS));o.push(t.getParameter(t.MAX_VERTEX_ATTRIBS));o.push(t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS));o.push(t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS));o.push(t.getParameter(t.RENDERER));o.push(t.getParameter(t.SHADING_LANGUAGE_VERSION));o.push(t.getParameter(t.STENCIL_BITS));o.push(t.getParameter(t.VENDOR));o.push(t.getParameter(t.VERSION));o.push(t.getSupportedExtensions().join(""))}catch(q){return padString("",10)}return o.join("");function s(i,b,c,a,d){var h=new Float32Array([b,c,b,c-a*d,b+a,c-a*d,b,c,b+a,c,b+a,c-a*d]);var f=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,f);i.bufferData(i.ARRAY_BUFFER,h,i.STATIC_DRAW);f.itemSize=2;f.numItems=h.length/f.itemSize;var j=i.createProgram();var g=i.createShader(i.VERTEX_SHADER);var e=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(g,r);i.shaderSource(e,w);i.compileShader(g);i.compileShader(e);i.attachShader(j,g);i.attachShader(j,e);i.linkProgram(j);i.useProgram(j);j.vertexPosAttrib=i.getAttribLocation(j,"attrVert");j.offsetUniform=i.getUniformLocation(j,"unifOffset");i.enableVertexAttribArray(j.vertexPosArray);i.vertexAttribPointer(j.vertexPosAttrib,f.itemSize,i.FLOAT,!1,0,0);i.uniform2f(j.offsetUniform,1,1);i.drawArrays(i.TRIANGLE_STRIP,0,f.numItems)}function p(a){t.clearColor(0,0.5,0,1);t.enable(t.DEPTH_TEST);t.depthFunc(t.LEQUAL);t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);return a[0]+a[1]}}function getJsFonts(){var E=function(){return(new Date()).getTime()};var D=E()+3000;try{var u=["monospace","sans-serif","serif"];var B="abcdefghijklmnopqrstuvwxyz";var s="80px";var C=document.body||document.getElementsByTagName("body")[0];var v=document.createElement("span");v.style.fontSize=s;v.innerHTML=B;var t={};var I={};var z=0;for(z=0;z<u.length;z++){v.style.fontFamily=u[z];C.appendChild(v);t[u[z]]=v.offsetWidth;I[u[z]]=v.offsetHeight;C.removeChild(v)}var y=["Abril Fatface","Adobe Caslon","Adobe Garamond","ADOBE GARAMOND PRO","Affair","Ailerons","Alegreya","Aller","Altus","Amatic","Ambassador","American Typewriter","American Typewriter Condensed","Americane","Amsi Pro","Andale Mono","Anivers","Anonymous Pro","Arca Majora","Archivo Narrow","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Arimo","Arvo","Asfalto","Asia","Audimat","AvantGarde Bk BT","AvantGarde Md BT","Bank Gothic","BankGothic Md BT","Barkentina","Baskerville","Baskerville Old Face","Bassanova","Batang","BatangChe","Bauhaus 93","Beauchef","Bebas Neue","Bellaboo","Berlin Sans FB","Berlin Sans FB Demi","Betm","Bitter","Blackout","Blox","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bomb","Book Antiqua","Bookman Old Style","Bookshelf Symbol 7","Bosque","Bowling Script","Box","Brandon Text","Brandon Text Medium","Bree Serif","Bremen Bd BT","Britannic Bold","Broadway","Brooklyn Samuels","Brotherhood Script","Bukhari Script","Burford","Byker","Cabin","Caecilia","Calibri","Cambria","Cambria Math","Cathedral","Century","Century Gothic","Century Schoolbook","Cervo","Chalfont","Chaucer","Chivo","Chunk","Clarendon","Clarendon Condensed","Clavo","Clavo Regular","Clear Sans Screen","Code","Comic Sans","Comic Sans MS","Conifer","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Core Sans NR","Courier","Courier New","Curely","D Sert","Delicate","Delicious","DIN","Directors Gothic","Dogtown","Domine","Donau","Dosis","Droid Sans","Droid Serif","Emblema Headline","Endless Bummer","English 111 Vivace BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","Exo","Exo 2","Fabfelt Script","Fanwood","Fedra Sans","Fela","Felice","Felice Regular","Fertigo Pro","FFF TUSJ","Fins","Fjalla One","Fontin","Franchise","Franklin Gothic","Franklin Gothic Book","Franklin Gothic Demi","Franklin Gothic Demi Cond","Franklin Gothic Heavy","Franklin Gothic Medium","Franklin Gothic Medium Cond","Free Spirit","FS Clerkenwell","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Galano Classic","Garamond","GEOM","Georgia","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Giant","Gibbs","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Glaser Stencil","Glober","Gloucester MT Extra Condensed","Gotham","GOTHAM","GOTHAM BOLD","Goudy Bookletter 1911","Goudy Old Style","Gravitas One","Hamster","Harman","Helena","Helvetica","Helvetica Neue","Herald","Hero","Hogshead","Home Brush","Horizontes Script","Hoverage","Humanst 521 Cn BT","HWT Artz","Ikaros","Impact","Inconsolata","Into The Light","Istok Web","Itoya","Ivory","Jack","Jekyll and Hyde","Jimmy","Josefin Slab","Junction","Kapra","Karla","Karol","Karol Regular","Karol Semi Bold Italic","Kautiva","Kelso","Knewave","Kurversbrug","Lato","League Gothic","League Script Number One","League Spartan","Libre Baskerville","Linden Hill","Linotte","Lobster","Lombok","Lora","Louize","Louize Italic","Louize Medium","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Lulo Clean","Manifesto","Maxwell","Merel","Merlo","Merriweather","Metro Nova","Metro Nova Light","Metro Nova Regular","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","Modern Brush","Modern No. 20","MONO","Monthoers","Montserrat","Moon","Mrs Eaves","MS Gothic","MS LineDraw","MS Mincho","MS Outlook","MS PGothic","MS PMincho","MS Reference Sans Serif","MS Reference Specialty","MS Sans Serif","MS Serif","MS UI Gothic","MTT Milano","Muli","Museo Slab","Myriad Pro","Neo Sans","Neo-Noire","Neutron","News Gothic","News GothicMT","NewsGoth BT","Nickainley Script","Nobile","Old Century","Old English Text MT","Old Standard TT","Open Sans","Orbitron","Ostrich Sans","Oswald","Palatino","Palatino Linotype","Papyrus","Parchment","Pegasus","Perfograma","Perpetua","Perpetua Titling MT","Petala Pro","Petala Semi Light","Pipeburn","Playfair Display","Prociono","PT Sans","PT Serif","Pythagoras","Qandon","Qandon Regular","Questrial","Raleway","Razor","Reef","Roboto","Roboto Slab","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Runaway","Sartorius","Schist","Scripta Pro","Seaside Resort","Selfie","Serendipity","Serifa","Serifa BT","Serifa Th BT","Shine Pro","Shoebox","Signika","Silver","Skolar","Skyward","Sniglet","Sortdecai","Sorts Mill Goudy","Source Sans Pro","Sparkle","Splandor","Springtime","Spruce","Spumante","Squoosh Gothic","Stadt","Stencil","Streamster","Sunday","Sunn","Swis721 BlkEx BT","Swiss911 XCm BT","Symbol","Tahoma","Technical","Texta","Ticketbook","Timber","Times","Times New Roman","Times New Roman PS","Titillium Web","Trajan","TRAJAN PRO","Trebuchet MS","Trend Rough","Troika","Twist","Ubuntu","Uniform","Univers","Univers CE 55 Medium","Univers Condensed","Unveil","Uomo","Varela Round","Verdana","Visby","Vollkorn","Wahhabi Script","Waterlily","Wayback","Webdings","Wendy","Wingdings","Wingdings 2","Wingdings 3","Woodland","Yonder","Zodiaclaw"];var F=[];while(y.length>0){var G=y.pop();var A=false;for(z=0;z<u.length&&!A;z++){if(E()>D){return padString("",10)}v.style.fontFamily=G+","+u[z];C.appendChild(v);var H=(v.offsetWidth!==t[u[z]]||v.offsetHeight!==I[u[z]]);C.removeChild(v);A=A||H}if(A){F.push(G)}}return F.join(";")}catch(w){return padString("",10)}}function dfGetProp(){var E={};var s={};s.plugins=10;s.nrOfPlugins=3;s.fonts=10;s.nrOfFonts=3;s.timeZone=10;s.video=10;s.superCookies=10;s.userAgent=10;s.mimeTypes=10;s.nrOfMimeTypes=3;s.canvas=10;s.cpuClass=5;s.platform=5;s.doNotTrack=5;s.webglFp=10;s.jsFonts=10;try{try{var B=dfGetPlug();E.plugins=padString(calculateMd5_b64(B.obj),s.plugins);E.nrOfPlugins=padString(String(B.nr),s.nrOfPlugins)}catch(u){E.plugins=padString("",s.plugins);E.nrOfPlugins=padString("",s.nrOfPlugins)}E.fonts=padString("",s.fonts);E.nrOfFonts=padString("",s.nrOfFonts);try{var e=new Date();e.setDate(1);e.setMonth(5);var C=e.getTimezoneOffset();e.setMonth(11);var D=e.getTimezoneOffset();E.timeZone=padString(calculateMd5_b64(C+"**"+D),s.timeZone)}catch(u){E.timeZone=padString("",s.timeZone)}try{E.video=padString(String((screen.width+7)*(screen.height+7)*screen.colorDepth),s.video)}catch(u){E.video=padString("",s.video)}E.superCookies=padString(calculateMd5_b64(dfGetDS()),Math.floor(s.superCookies/2))+padString(calculateMd5_b64(dfGetIEUD()),Math.floor(s.superCookies/2));E.userAgent=padString(calculateMd5_b64(navigator.userAgent),s.userAgent);var v="";var y=0;if(navigator.mimeTypes){y=navigator.mimeTypes.length;for(var z=0;z<y;z++){var t=navigator.mimeTypes[z];v+=t.description+t.type+t.suffixes}}E.mimeTypes=padString(calculateMd5_b64(v),s.mimeTypes);E.nrOfMimeTypes=padString(String(y),s.nrOfMimeTypes);E.canvas=padString(calculateMd5_b64(dfCanvasFingerprint()),s.canvas);E.cpuClass=(navigator.cpuClass)?padString(calculateMd5_b64(navigator.cpuClass),s.cpuClass):padString("",s.cpuClass);E.platform=(navigator.platform)?padString(calculateMd5_b64(navigator.platform),s.platform):padString("",s.platform);E.doNotTrack=(navigator.doNotTrack)?padString(calculateMd5_b64(navigator.doNotTrack),s.doNotTrack):padString("",s.doNotTrack);E.jsFonts=padString(calculateMd5_b64(getJsFonts()),s.jsFonts);E.webglFp=padString(calculateMd5_b64(getWebglFp()),s.webglFp);var A=0,i;for(i in E){if(E.hasOwnProperty(i)){A=0;try{A=E[i].length}catch(u){}if(typeof E[i]==="undefined"||E[i]===null||A!==s[i]){E[i]=padString("",s[i])}}}}catch(w){}return E}function dfCanvasFingerprint(){var g=document.createElement("canvas");if(!!(g.getContext&&g.getContext("2d"))){var h=document.createElement("canvas");var e=h.getContext("2d");var f="#&*(sdfjlSDFkjls28270(";e.font="14px 'Arial'";e.textBaseline="alphabetic";e.fillStyle="#f61";e.fillRect(138,2,63,20);e.fillStyle="#068";e.fillText(f,3,16);e.fillStyle="rgba(105, 194, 1, 0.6)";e.fillText(f,5,18);return h.toDataURL()}return padString("",10)}function populateFontList(b){}function dfGetEntropy(){var e=["iPad","iPhone","iPod"];var f=navigator.userAgent;if(f){for(var d=0;d<e.length;d++){if(f.indexOf(e[d])>=0){return"20"}}}return"40"}function dfSet(m,e){try{var i=dfGetProp();var p=dfHashConcat(i);var j=dfGetEntropy();var k=_.G(m);k.value=p+":"+j}catch(o){}}function dfHashConcat(e){try{var f="";f=e.plugins+e.nrOfPlugins+e.fonts+e.nrOfFonts+e.timeZone+e.video+e.superCookies+e.userAgent+e.mimeTypes+e.nrOfMimeTypes+e.canvas+e.cpuClass+e.platform+e.doNotTrack+e.webglFp+e.jsFonts;f=f.replace(/\+/g,"G").replace(/\//g,"D");return f}catch(d){return""}}function dfDo(d){try{var f=_.G(d);if(!f){return}if(f.value){return}dfInitDS();_.R(function(){setTimeout(function(){dfSet(d,0)},500)})}catch(e){}}function padString(f,e){if(f.length>=e){return(f.substring(0,e))}else{for(var d="";d.length<e-f.length;d+="0"){}return(d.concat(f))}}function calculateMd5_b64(b){return md5_binl2b64(md5_cmc5(md5_s2b(b),b.length*8))}function md5_cmc5(g,a){g[a>>5]|=128<<((a)%32);g[(((a+64)>>>9)<<4)+14]=a;var h=1732584193;var i=-271733879;var j=-1732584194;var y=271733878;for(var e=0;e<g.length;e+=16){var b=h;var c=i;var d=j;var f=y;h=md5_ff(h,i,j,y,g[e+0],7,-680876936);y=md5_ff(y,h,i,j,g[e+1],12,-389564586);j=md5_ff(j,y,h,i,g[e+2],17,606105819);i=md5_ff(i,j,y,h,g[e+3],22,-1044525330);h=md5_ff(h,i,j,y,g[e+4],7,-176418897);y=md5_ff(y,h,i,j,g[e+5],12,1200080426);j=md5_ff(j,y,h,i,g[e+6],17,-1473231341);i=md5_ff(i,j,y,h,g[e+7],22,-45705983);h=md5_ff(h,i,j,y,g[e+8],7,1770035416);y=md5_ff(y,h,i,j,g[e+9],12,-1958414417);j=md5_ff(j,y,h,i,g[e+10],17,-42063);i=md5_ff(i,j,y,h,g[e+11],22,-1990404162);h=md5_ff(h,i,j,y,g[e+12],7,1804603682);y=md5_ff(y,h,i,j,g[e+13],12,-40341101);j=md5_ff(j,y,h,i,g[e+14],17,-1502002290);i=md5_ff(i,j,y,h,g[e+15],22,1236535329);h=md5_gg(h,i,j,y,g[e+1],5,-165796510);y=md5_gg(y,h,i,j,g[e+6],9,-1069501632);j=md5_gg(j,y,h,i,g[e+11],14,643717713);i=md5_gg(i,j,y,h,g[e+0],20,-373897302);h=md5_gg(h,i,j,y,g[e+5],5,-701558691);y=md5_gg(y,h,i,j,g[e+10],9,38016083);j=md5_gg(j,y,h,i,g[e+15],14,-660478335);i=md5_gg(i,j,y,h,g[e+4],20,-405537848);h=md5_gg(h,i,j,y,g[e+9],5,568446438);y=md5_gg(y,h,i,j,g[e+14],9,-1019803690);j=md5_gg(j,y,h,i,g[e+3],14,-187363961);i=md5_gg(i,j,y,h,g[e+8],20,1163531501);h=md5_gg(h,i,j,y,g[e+13],5,-1444681467);y=md5_gg(y,h,i,j,g[e+2],9,-51403784);j=md5_gg(j,y,h,i,g[e+7],14,1735328473);i=md5_gg(i,j,y,h,g[e+12],20,-1926607734);h=md5_hh(h,i,j,y,g[e+5],4,-378558);y=md5_hh(y,h,i,j,g[e+8],11,-2022574463);j=md5_hh(j,y,h,i,g[e+11],16,1839030562);i=md5_hh(i,j,y,h,g[e+14],23,-35309556);h=md5_hh(h,i,j,y,g[e+1],4,-1530992060);y=md5_hh(y,h,i,j,g[e+4],11,1272893353);j=md5_hh(j,y,h,i,g[e+7],16,-155497632);i=md5_hh(i,j,y,h,g[e+10],23,-1094730640);h=md5_hh(h,i,j,y,g[e+13],4,681279174);y=md5_hh(y,h,i,j,g[e+0],11,-358537222);j=md5_hh(j,y,h,i,g[e+3],16,-722521979);i=md5_hh(i,j,y,h,g[e+6],23,76029189);h=md5_hh(h,i,j,y,g[e+9],4,-640364487);y=md5_hh(y,h,i,j,g[e+12],11,-421815835);j=md5_hh(j,y,h,i,g[e+15],16,530742520);i=md5_hh(i,j,y,h,g[e+2],23,-995338651);h=md5_ii(h,i,j,y,g[e+0],6,-198630844);y=md5_ii(y,h,i,j,g[e+7],10,1126891415);j=md5_ii(j,y,h,i,g[e+14],15,-1416354905);i=md5_ii(i,j,y,h,g[e+5],21,-57434055);h=md5_ii(h,i,j,y,g[e+12],6,1700485571);y=md5_ii(y,h,i,j,g[e+3],10,-1894986606);j=md5_ii(j,y,h,i,g[e+10],15,-1051523);i=md5_ii(i,j,y,h,g[e+1],21,-2054922799);h=md5_ii(h,i,j,y,g[e+8],6,1873313359);y=md5_ii(y,h,i,j,g[e+15],10,-30611744);j=md5_ii(j,y,h,i,g[e+6],15,-1560198380);i=md5_ii(i,j,y,h,g[e+13],21,1309151649);h=md5_ii(h,i,j,y,g[e+4],6,-145523070);y=md5_ii(y,h,i,j,g[e+11],10,-1120210379);j=md5_ii(j,y,h,i,g[e+2],15,718787259);i=md5_ii(i,j,y,h,g[e+9],21,-343485551);h=md5_safe_add(h,b);i=md5_safe_add(i,c);j=md5_safe_add(j,d);y=md5_safe_add(y,f)}return Array(h,i,j,y)}function md5_cmn(a,j,k,m,b,i){return md5_safe_add(md5_bit_rol(md5_safe_add(md5_safe_add(j,a),md5_safe_add(m,i)),b),k)}function md5_ff(m,o,a,b,p,c,d){return md5_cmn((o&a)|((~o)&b),m,o,p,c,d)}function md5_gg(m,o,a,b,p,c,d){return md5_cmn((o&b)|(a&(~b)),m,o,p,c,d)}function md5_hh(m,o,a,b,p,c,d){return md5_cmn(o^a^b,m,o,p,c,d)}function md5_ii(m,o,a,b,p,c,d){return md5_cmn(a^(o|(~b)),m,o,p,c,d)}function md5_safe_add(g,a){var b=(g&65535)+(a&65535);var h=(g>>16)+(a>>16)+(b>>16);return(h<<16)|(b&65535)}function md5_bit_rol(a,b){return(a<<b)|(a>>>(32-b))}function md5_s2b(c){var h=Array();var a=(1<<8)-1;for(var b=0;b<c.length*8;b+=8){h[b>>5]|=(c.charCodeAt(b/8)&a)<<(b%32)}return h}function md5_binl2b64(i){var c="";var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var p="";for(var b=0;b<i.length*4;b+=3){var a=(((i[b>>2]>>8*(b%4))&255)<<16)|(((i[b+1>>2]>>8*((b+1)%4))&255)<<8)|((i[b+2>>2]>>8*((b+2)%4))&255);for(var d=0;d<4;d++){if(b*8+d*6>i.length*32){p+=c}else{p+=j.charAt((a>>6*(3-d))&63)}}}return p}var PluginDetect={version:"0.7.5",name:"PluginDetect",handler:function(a,c,b){return function(){a(c,b)}},isDefined:function(b){return typeof b!="undefined"},isArray:function(b){return(/array/i).test(Object.prototype.toString.call(b))},isFunc:function(b){return typeof b=="function"},isString:function(b){return typeof b=="string"},isNum:function(b){return typeof b=="number"},isStrNum:function(b){return(typeof b=="string"&&(/\d/).test(b))},getNumRegx:/[\d][\d\.\_,-]*/,splitNumRegx:/[\.\_,-]/g,getNum:function(d,a){var b=this,c=b.isStrNum(d)?(b.isDefined(a)?new RegExp(a):b.getNumRegx).exec(d):null;return c?c[0]:null},compareNums:function(b,h,f){var g=this,e,d,c,a=parseInt;if(g.isStrNum(b)&&g.isStrNum(h)){if(g.isDefined(f)&&f.compareNums){return f.compareNums(b,h)}e=b.split(g.splitNumRegx);d=h.split(g.splitNumRegx);for(c=0;c<Math.min(e.length,d.length);c++){if(a(e[c],10)>a(d[c],10)){return 1}if(a(e[c],10)<a(d[c],10)){return -1}}}return 0},formatNum:function(e,a){var b=this,d,c;if(!b.isStrNum(e)){return null}if(!b.isNum(a)){a=4}a--;c=e.replace(/\s/g,"").split(b.splitNumRegx).concat(["0","0","0","0"]);for(d=0;d<4;d++){if(/^(0+)(.+)$/.test(c[d])){c[d]=RegExp.$2}if(d>a||!(/\d/).test(c[d])){c[d]="0"}}return c.slice(0,4).join(",")},$hasMimeType:function(a){return function(d){if(!a.isIE&&d){var c,b,e,f=a.isString(d)?[d]:d;if(!f||!f.length){return null}for(e=0;e<f.length;e++){if(/[^\s]/.test(f[e])&&(c=navigator.mimeTypes[f[e]])&&(b=c.enabledPlugin)&&(b.name||b.description)){return c}}}return null}},findNavPlugin:function(d,k,h){var b=this,a=new RegExp(d,"i"),j=(!b.isDefined(k)||k)?/\d/:0,c=h?new RegExp(h,"i"):0,f=navigator.plugins,A="",m,g,e;for(m=0;m<f.length;m++){e=f[m].description||A;g=f[m].name||A;if((a.test(e)&&(!j||j.test(RegExp.leftContext+RegExp.rightContext)))||(a.test(g)&&(!j||j.test(RegExp.leftContext+RegExp.rightContext)))){if(!c||!(c.test(e)||c.test(g))){return f[m]}}}return null},getMimeEnabledPlugin:function(e,d){var c=this,f,a=new RegExp(d,"i"),b="";if((f=c.hasMimeType(e))&&(f=f.enabledPlugin)&&(a.test(f.description||b)||a.test(f.name||b))){return f}return 0},getPluginFileVersion:function(h,d){var b=this,g,f,a,c,e=-1;if(b.OS>2||!h||!h.version||!(g=b.getNum(h.version))){return d}if(!d){return g}g=b.formatNum(g);d=b.formatNum(d);f=d.split(b.splitNumRegx);a=g.split(b.splitNumRegx);for(c=0;c<f.length;c++){if(e>-1&&c>e&&f[c]!="0"){return d}if(a[c]!=f[c]){if(e==-1){e=c}if(f[c]!="0"){return d}}}return g},AXO:window.ActiveXObject,getAXO:function(f){var c=null,b,a=this,d;try{c=new a.AXO(f)}catch(b){}return c},convertFuncs:function(b){var d,c,a,g=/^[\$][\$]/,h={},f=this;for(d in b){if(g.test(d)){h[d]=1}}for(d in h){try{c=d.slice(2);if(c.length>0&&!b[c]){b[c]=b[d](b);delete b[d]}}catch(a){}}},initScript:function(){var i=this,g=navigator,a="/",e=g.userAgent||"",c=g.vendor||"",h=g.platform||"",d=g.product||"";i.OS=100;if(h){var b,j=["Win",1,"Mac",2,"Linux",3,"FreeBSD",4,"iPhone",21.1,"iPod",21.2,"iPad",21.3,"Win.*CE",22.1,"Win.*Mobile",22.2,"Pocket\\s*PC",22.3,"",100];for(b=j.length-2;b>=0;b=b-2){if(j[b]&&new RegExp(j[b],"i").test(h)){i.OS=j[b+1];break}}}i.convertFuncs(i);i.isIE=new Function("return "+a+"*@cc_on!@*"+a+"false")();i.verIE=i.isIE&&(/MSIE\s*(\d+\.?\d*)/i).test(e)?parseFloat(RegExp.$1,10):null;i.ActiveXEnabled=false;if(i.isIE){var b,f=["Msxml2.XMLHTTP","Msxml2.DOMDocument","Microsoft.XMLDOM","ShockwaveFlash.ShockwaveFlash","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary","wmplayer.ocx"];for(b=0;b<f.length;b++){if(i.getAXO(f[b])){i.ActiveXEnabled=true;break}}i.head=i.isDefined(document.getElementsByTagName)?document.getElementsByTagName("head")[0]:null
}i.isGecko=(/Gecko/i).test(d)&&(/Gecko\s*\/\s*\d/i).test(e);i.verGecko=i.isGecko?i.formatNum((/rv\s*\:\s*([\.\,\d]+)/i).test(e)?RegExp.$1:"0.9"):null;i.isSafari=(/Safari\s*\/\s*\d/i).test(e)&&(/Apple/i).test(c);i.isChrome=(/Chrome\s*\/\s*(\d[\d\.]*)/i).test(e);i.verChrome=i.isChrome?i.formatNum(RegExp.$1):null;i.isOpera=(/Opera\s*[\/]?\s*(\d+\.?\d*)/i).test(e);i.verOpera=i.isOpera&&((/Version\s*\/\s*(\d+\.?\d*)/i).test(e)||1)?parseFloat(RegExp.$1,10):null;i.addWinEvent("load",i.handler(i.runWLfuncs,i))},init:function(a){var c=this,b,a;if(!c.isString(a)){return -3}if(a.length==1){c.getVersionDelimiter=a;return -3}a=a.toLowerCase().replace(/\s/g,"");b=c[a];if(!b||!b.getVersion){return -3}c.plugin=b;if(!c.isDefined(b.installed)){b.installed=b.version=b.version0=b.getVersionDone=null;b.$=c;b.pluginName=a}c.garbage=false;if(c.isIE&&!c.ActiveXEnabled){if(b!==c.java){return -2}}return 1},fPush:function(c,b){var a=this;if(a.isArray(b)&&(a.isFunc(c)||(a.isArray(c)&&c.length>0&&a.isFunc(c[0])))){b.push(c)}},callArray:function(c){var a=this,b;if(a.isArray(c)){for(b=0;b<c.length;b++){if(c[b]===null){return}a.call(c[b]);c[b]=null}}},call:function(a){var c=this,b=c.isArray(a)?a.length:-1;if(b>0&&c.isFunc(a[0])){a[0](c,b>1?a[1]:0,b>2?a[2]:0,b>3?a[3]:0)}else{if(c.isFunc(a)){a(c)}}},getVersionDelimiter:",",$getVersion:function(a){return function(e,h,g){var b=a.init(e),d,c,f;if(b<0){return null}d=a.plugin;if(d.getVersionDone!=1){d.getVersion(null,h,g);if(d.getVersionDone===null){d.getVersionDone=1}}a.cleanup();c=(d.version||d.version0);c=c?c.replace(a.splitNumRegx,a.getVersionDelimiter):c;return c}},cleanup:function(){var a=this;if(a.garbage&&a.isDefined(window.CollectGarbage)){window.CollectGarbage()}},isActiveXObject:function(a,g){var b=this,d=false,c,f="<",h=f+'object width="1" height="1" style="display:none" '+a.getCodeBaseVersion(g)+">"+a.HTML+f+"/object>";if(!b.head){return d}if(b.head.firstChild){b.head.insertBefore(document.createElement("object"),b.head.firstChild)}else{b.head.appendChild(document.createElement("object"))}b.head.firstChild.outerHTML=h;try{b.head.firstChild.classid=a.classID}catch(c){}try{if(b.head.firstChild.object){d=true}}catch(c){}try{if(d&&b.head.firstChild.readyState<4){b.garbage=true}}catch(c){}b.head.removeChild(b.head.firstChild);return d},codebaseSearch:function(h,b){var c=this;if(!c.ActiveXEnabled||!h){return null}if(h.BIfuncs&&h.BIfuncs.length&&h.BIfuncs[h.BIfuncs.length-1]!==null){c.callArray(h.BIfuncs)}var e,f=h.SEARCH,d;if(c.isStrNum(b)){if(f.match&&f.min&&c.compareNums(b,f.min)<=0){return true}if(f.match&&f.max&&c.compareNums(b,f.max)>=0){return false}e=c.isActiveXObject(h,b);if(e&&(!f.min||c.compareNums(b,f.min)>0)){f.min=b}if(!e&&(!f.max||c.compareNums(b,f.max)<0)){f.max=b}return e}var g=[0,0,0,0],o=[].concat(f.digits),G=f.min?1:0,m,k,j,i,F,a=function(r,q){var p=[].concat(g);p[r]=q;return c.isActiveXObject(h,p.join(","))};if(f.max){i=f.max.split(c.splitNumRegx);for(m=0;m<i.length;m++){i[m]=parseInt(i[m],10)}if(i[0]<o[0]){o[0]=i[0]}}if(f.min){F=f.min.split(c.splitNumRegx);for(m=0;m<F.length;m++){F[m]=parseInt(F[m],10)}if(F[0]>g[0]){g[0]=F[0]}}if(F&&i){for(m=1;m<F.length;m++){if(F[m-1]!=i[m-1]){break}if(i[m]<o[m]){o[m]=i[m]}if(F[m]>g[m]){g[m]=F[m]}}}if(f.max){for(m=1;m<o.length;m++){if(i[m]>0&&o[m]==0&&o[m-1]<f.digits[m-1]){o[m-1]+=1;break}}}for(m=0;m<o.length;m++){j={};for(k=0;k<20;k++){if(o[m]-g[m]<1){break}e=Math.round((o[m]+g[m])/2);if(j["a"+e]){break}j["a"+e]=1;if(a(m,e)){g[m]=e;G=1}else{o[m]=e}}o[m]=g[m];if(!G&&a(m,g[m])){G=1}if(!G){break}}return G?g.join(","):null},addWinEvent:function(b,a){var c=this,d=window,e;if(c.isFunc(a)){if(d.addEventListener){d.addEventListener(b,a,false)}else{if(d.attachEvent){d.attachEvent("on"+b,a)}else{e=d["on"+b];d["on"+b]=c.winHandler(a,e)}}}},winHandler:function(d,c){return function(){d();if(typeof c=="function"){c()}}},WLfuncs0:[],WLfuncs:[],runWLfuncs:function(a){a.winLoaded=true;a.callArray(a.WLfuncs0);a.callArray(a.WLfuncs);if(a.onDoneEmptyDiv){a.onDoneEmptyDiv()}},winLoaded:false,$onWindowLoaded:function(a){return function(b){if(a.winLoaded){a.call(b)}else{a.fPush(b,a.WLfuncs)}}},div:null,divWidth:50,pluginSize:1,emptyDiv:function(){var a=this,d,c,e,b=0;if(a.div&&a.div.childNodes){for(d=a.div.childNodes.length-1;d>=0;d--){e=a.div.childNodes[d];if(e&&e.childNodes){if(b==0){for(c=e.childNodes.length-1;c>=0;c--){e.removeChild(e.childNodes[c])}a.div.removeChild(e)}else{}}}}},DONEfuncs:[],onDoneEmptyDiv:function(){var a=this,b,c;if(!a.winLoaded){return}if(a.WLfuncs&&a.WLfuncs.length&&a.WLfuncs[a.WLfuncs.length-1]!==null){return}for(b in a){c=a[b];if(c&&c.funcs){if(c.OTF==3){return}if(c.funcs.length&&c.funcs[c.funcs.length-1]!==null){return}}}for(b=0;b<a.DONEfuncs.length;b++){a.callArray(a.DONEfuncs)}a.emptyDiv()},getWidth:function(a){if(a){var b=a.scrollWidth||a.offsetWidth,c=this;if(c.isNum(b)){return b}}return -1},getTagStatus:function(f,m,g,h){var i=this,k,c=f.span,d=i.getWidth(c),A=g.span,b=i.getWidth(A),j=m.span,a=i.getWidth(j);if(!c||!A||!j||!i.getDOMobj(f)){return -2}if(b<a||d<0||b<0||a<0||a<=i.pluginSize||i.pluginSize<1){return 0}if(d>=a){return -1}try{if(d==i.pluginSize&&(!i.isIE||i.getDOMobj(f).readyState==4)){if(!f.winLoaded&&i.winLoaded){return 1}if(f.winLoaded&&i.isNum(h)){if(!i.isNum(f.count)){f.count=h}if(h-f.count>=10){return 1}}}}catch(k){}return 0},getDOMobj:function(d,f){var c,b=this,a=d?d.span:0,g=a&&a.firstChild?1:0;try{if(g&&f){a.firstChild.focus()}}catch(c){}return g?a.firstChild:null},setStyle:function(g,d){var c=g.style,f,b,a=this;if(c&&d){for(f=0;f<d.length;f=f+2){try{c[d[f]]=d[f+1]}catch(b){}}}},insertDivInBody:function(b){var i,f=this,a="pd33993399",d=null,h=document,g="<",c=(h.getElementsByTagName("body")[0]||h.body);if(!c){try{h.write(g+'div id="'+a+'">o'+g+"/div>");d=h.getElementById(a)}catch(i){}}c=(h.getElementsByTagName("body")[0]||h.body);if(c){if(c.firstChild&&f.isDefined(c.insertBefore)){c.insertBefore(b,c.firstChild)}else{c.appendChild(b)}if(d){c.removeChild(d)}}else{}},insertHTML:function(k,f,m,b,D){var E,a=document,q=this,i,h=a.createElement("span"),c,o,j="<";var g=["outlineStyle","none","borderStyle","none","padding","0px","margin","0px","visibility","visible"];if(!q.isDefined(b)){b=""}if(q.isString(k)&&(/[^\s]/).test(k)){i=j+k+' width="'+q.pluginSize+'" height="'+q.pluginSize+'" ';for(c=0;c<f.length;c=c+2){if(/[^\s]/.test(f[c+1])){i+=f[c]+'="'+f[c+1]+'" '}}i+=">";for(c=0;c<m.length;c=c+2){if(/[^\s]/.test(m[c+1])){i+=j+'param name="'+m[c]+'" value="'+m[c+1]+'" />'}}i+=b+j+"/"+k+">"}else{i=b}if(!q.div){q.div=a.createElement("div");o=a.getElementById("plugindetect");if(o){q.div=o}else{q.div.id="plugindetect";q.insertDivInBody(q.div)}q.setStyle(q.div,g.concat(["width",q.divWidth+"px","height",(q.pluginSize+3)+"px","fontSize",(q.pluginSize+3)+"px","lineHeight",(q.pluginSize+3)+"px","verticalAlign","baseline","display","block"]));if(!o){q.setStyle(q.div,["position","absolute","right","0px","top","0px"])}}if(q.div&&q.div.parentNode){q.div.appendChild(h);q.setStyle(h,g.concat(["fontSize",(q.pluginSize+3)+"px","lineHeight",(q.pluginSize+3)+"px","verticalAlign","baseline","display","inline"]));try{if(h&&h.parentNode){h.focus()}}catch(E){}try{h.innerHTML=i}catch(E){}if(h.childNodes.length==1&&!(q.isGecko&&q.compareNums(q.verGecko,"1,5,0,0")<0)){q.setStyle(h.firstChild,g.concat(["display","inline"]))}return{span:h,winLoaded:q.winLoaded,tagName:(q.isString(k)?k:"")}}return{span:null,winLoaded:q.winLoaded,tagName:""}},quicktime:{mimeType:["video/quicktime","application/x-quicktimeplayer","image/x-macpaint","image/x-quicktime"],progID:"QuickTimeCheckObject.QuickTimeCheck.1",progID0:"QuickTime.QuickTime",classID:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",minIEver:7,HTML:("<")+'param name="src" value="" />'+("<")+'param name="controller" value="false" />',getCodeBaseVersion:function(a){return'codebase="#version='+a+'"'},SEARCH:{min:0,max:0,match:0,digits:[16,128,128,0]},getVersion:function(a){var d=this,b=d.$,e=null,c=null,f;if(!b.isIE){if(b.hasMimeType(d.mimeType)){c=b.OS!=3?b.findNavPlugin("QuickTime.*Plug-?in",0):null;if(c&&c.name){e=b.getNum(c.name)}}}else{if(b.isStrNum(a)){f=a.split(b.splitNumRegx);if(f.length>3&&parseInt(f[3],10)>0){f[3]="9999"}a=f.join(",")}if(b.isStrNum(a)&&b.verIE>=d.minIEver&&d.canUseIsMin()>0){d.installed=d.isMin(a);d.getVersionDone=0;return}d.getVersionDone=1;if(!e&&b.verIE>=d.minIEver){e=d.CDBASE2VER(b.codebaseSearch(d))}if(!e){c=b.getAXO(d.progID);if(c&&c.QuickTimeVersion){e=c.QuickTimeVersion.toString(16);e=parseInt(e.charAt(0),16)+"."+parseInt(e.charAt(1),16)+"."+parseInt(e.charAt(2),16)}}}d.installed=e?1:(c?0:-1);d.version=b.formatNum(e,3)},cdbaseUpper:["7,60,0,0","0,0,0,0"],cdbaseLower:["7,50,0,0",null],cdbase2ver:[function(a,c){var b=c.split(a.$.splitNumRegx);return[b[0],b[1].charAt(0),b[1].charAt(1),b[2]].join(",")},null],CDBASE2VER:function(d){var c=this,a=c.$,f,e=c.cdbaseUpper,b=c.cdbaseLower;if(d){d=a.formatNum(d);for(f=0;f<e.length;f++){if(e[f]&&a.compareNums(d,e[f])<0&&b[f]&&a.compareNums(d,b[f])>=0&&c.cdbase2ver[f]){return c.cdbase2ver[f](c,d)}}}return d},canUseIsMin:function(){var d=this,b=d.$,f,a=d.canUseIsMin,e=d.cdbaseUpper,c=d.cdbaseLower;if(!a.value){a.value=-1;for(f=0;f<e.length;f++){if(e[f]&&b.codebaseSearch(d,e[f])){a.value=1;break}if(c[f]&&b.codebaseSearch(d,c[f])){a.value=-1;break}}}d.SEARCH.match=a.value==1?1:0;return a.value},isMin:function(a){var c=this,b=c.$;return b.codebaseSearch(c,a)?0.7:-1}},flash:{mimeType:["application/x-shockwave-flash","application/futuresplash"],progID:"ShockwaveFlash.ShockwaveFlash",classID:"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000",getVersion:function(){var k=function(i){if(!i){return null}var e=/[\d][\d\,\.\s]*[rRdD]{0,1}[\d\,]*/.exec(i);return e?e[0].replace(/[rRdD\.]/g,",").replace(/\s/g,""):null};var b,f=this,c=f.$,g,d,h=null,a=null,j=null;if(!c.isIE){b=c.findNavPlugin("Flash");if(b&&b.description&&c.hasMimeType(f.mimeType)){h=k(b.description)}if(h){h=c.getPluginFileVersion(b,h)}}else{for(d=15;d>2;d--){a=c.getAXO(f.progID+"."+d);if(a){j=d.toString();break}}if(j=="6"){try{a.AllowScriptAccess="always"}catch(g){return"6,0,21,0"}}try{h=k(a.GetVariable("$version"))}catch(g){}if(!h&&j){h=j}}f.installed=h?1:-1;f.version=c.formatNum(h);return true}},shockwave:{mimeType:"application/x-director",progID:"SWCtl.SWCtl",classID:"clsid:166B1BCA-3F9C-11CF-8075-444553540000",getVersion:function(){var f=null,g=null,d,c,b=this,a=b.$;if(!a.isIE){c=a.findNavPlugin("Shockwave\\s*for\\s*Director");if(c&&c.description&&a.hasMimeType(b.mimeType)){f=a.getNum(c.description)}if(f){f=a.getPluginFileVersion(c,f)}}else{try{g=a.getAXO(b.progID).ShockwaveVersion("")}catch(d){}if(a.isString(g)&&g.length>0){f=a.getNum(g)}else{if(a.getAXO(b.progID+".8")){f="8"}else{if(a.getAXO(b.progID+".7")){f="7"}else{if(a.getAXO(b.progID+".1")){f="6"}}}}}b.installed=f?1:-1;b.version=a.formatNum(f)}},windowsmediaplayer:{mimeType:["application/x-mplayer2","application/asx","application/x-ms-wmp"],progID:"wmplayer.ocx",classID:"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6",getVersion:function(){var f=this,e=null,c=f.$,b,d=null,a;f.installed=-1;if(!c.isIE){if(c.hasMimeType(f.mimeType)){d=c.findNavPlugin("Windows\\s*Media.*Plug-?in",0,"Totem")||c.findNavPlugin("Flip4Mac.*Windows\\s*Media.*Plug-?in",0,"Totem");b=(c.isGecko&&c.compareNums(c.verGecko,c.formatNum("1.8"))<0);b=b||(c.isOpera&&c.verOpera<10);if(!b&&c.getMimeEnabledPlugin(f.mimeType[2],"Windows\\s*Media.*Firefox.*Plug-?in")){a=c.getDOMobj(c.insertHTML("object",["type",f.mimeType[2],"data",""],["src",""],"",f));if(a){e=a.versionInfo}}}}else{d=c.getAXO(f.progID);if(d){e=d.versionInfo}}f.installed=d&&e?1:(d?0:-1);f.version=c.formatNum(e)}},silverlight:{mimeType:"application/x-silverlight",progID:"AgControl.AgControl",digits:[20,20,9,12,31],getVersion:function(){var K=this,u=K.$,i=document,f=null,q=null,a=null,e=true,o=[1,0,1,1,1],k=[1,0,1,1,1],h=function(d){return(d<10?"0":"")+d.toString()},r=function(t,s,d,p,v){return(t+"."+s+"."+d+h(p)+h(v)+".0")},J=function(d,s,p){return g(d,(s==0?p:k[0]),(s==1?p:k[1]),(s==2?p:k[2]),(s==3?p:k[3]),(s==4?p:k[4]))},g=function(d,v,t,s,p,w){var w;try{return d.IsVersionSupported(r(v,t,s,p,w))}catch(w){}return false};if(!u.isIE){var b;if(u.hasMimeType(K.mimeType)){b=u.isGecko&&u.compareNums(u.verGecko,u.formatNum("1.6"))<=0;if(u.isGecko&&b){e=false}a=u.findNavPlugin("Silverlight.*Plug-?in",0);if(a&&a.description){f=u.formatNum(a.description)}if(f){k=f.split(u.splitNumRegx);if(parseInt(k[2],10)>=30226&&parseInt(k[0],10)<2){k[0]="2"}f=k.join(",")}}K.installed=a&&e&&f?1:(a&&e?0:(a?-0.2:-1))}else{q=u.getAXO(K.progID);var m,j,c;if(q&&g(q,o[0],o[1],o[2],o[3],o[4])){for(m=0;m<K.digits.length;m++){c=k[m];for(j=c+(m==0?0:1);j<=K.digits[m];j++){if(J(q,m,j)){e=true;k[m]=j}else{break}}if(!e){break}}if(e){f=r(k[0],k[1],k[2],k[3],k[4])}}K.installed=q&&e&&f?1:(q&&e?0:(q?-0.2:-1))}K.version=u.formatNum(f)}},realplayer:{mimeType:["audio/x-pn-realaudio-plugin"],progID:["rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer"],classID:"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA",INSTALLED:{},q1:[[11,0,0],[999],[663],[663],[663],[660],[468],[468],[468],[468],[468],[468],[431],[431],[431],[372],[180],[180],[172],[172],[167],[114],[0]],q3:[[6,0],[12,99],[12,69],[12,69],[12,69],[12,69],[12,69],[12,69],[12,69],[12,69],[12,69],[12,69],[12,46],[12,46],[12,46],[11,3006],[11,2806],[11,2806],[11,2804],[11,2804],[11,2799],[11,2749],[11,2700]],compare:function(g,f){var d,i=g.length,e=f.length,h,c;for(d=0;d<Math.max(i,e);d++){h=d<i?g[d]:0;c=d<e?f[d]:0;if(h>c){return 1}if(h<c){return -1}}return 0},convertNum:function(h,d,c){var e=this,a=e.$,b,i,f,g=null;if(!h||!(b=a.formatNum(h))){return g}b=b.split(a.splitNumRegx);for(f=0;f<b.length;f++){b[f]=parseInt(b[f],10)}if(e.compare(b.slice(0,Math.min(d[0].length,b.length)),d[0])!=0){return g}i=b.length>d[0].length?b.slice(d[0].length):[];if(e.compare(i,d[1])>0||e.compare(i,d[d.length-1])<0){return g}for(f=d.length-1;f>=1;f--){if(f==1){break}if(e.compare(d[f],i)==0&&e.compare(d[f],d[f-1])==0){break}if(e.compare(i,d[f])>=0&&e.compare(i,d[f-1])<0){break}}return c[0].join(".")+"."+c[f].join(".")},getVersion:function(b,d){var r=this,s=null,f=0,k=0,g=r.$,m,q,M,a;if(g.isString(d)&&/[^\s]/.test(d)){a=d}else{d=null;a=r.mimeType[0]}if(g.isDefined(r.INSTALLED[a])){r.installed=r.INSTALLED[a];return}if(!g.isIE){var t="RealPlayer.*Plug-?in",o=g.hasMimeType(r.mimeType),h=g.findNavPlugin(t,0);if(o&&h){f=1;if(d){if(g.getMimeEnabledPlugin(d,t)){k=1}else{k=0}}else{k=1}}if(r.getVersionDone!==0){r.getVersionDone=0;if(o){var j=1,c=null,L=null;M=g.hasMimeType("application/vnd.rn-realplayer-javascript");if(M){c=g.formatNum(g.getNum(M.enabledPlugin.description))}if(g.OS==1&&c){var i=c.split(g.splitNumRegx);L=true;if(r.compare(i,[6,0,12,200])<0){L=false}else{if(r.compare(i,[6,0,12,1739])<=0&&r.compare(i,[6,0,12,857])>=0){L=false}}}if(L===false){j=0}if(g.OS<=2){if(g.isGecko&&g.compareNums(g.verGecko,g.formatNum("1,8"))<0){j=0}if(g.isChrome){j=0}if(g.isOpera&&g.verOpera<10){j=0}}else{j=0}if(j){M=g.insertHTML("object",["type",r.mimeType[0]],["src","","autostart","false","imagestatus","false","controls","stopbutton"],"",r);M=g.getDOMobj(M);try{s=g.getNum(M.GetVersionInfo())}catch(m){}g.setStyle(M,["display","none"])}if(!s&&c&&L===false){M=r.convertNum(c,r.q3,r.q1);s=M?M:c}}}else{s=r.version}r.installed=f&&k&&s?1:(f&&k?0:(f?-0.2:-1))}else{M=null;for(q=0;q<r.progID.length;q++){M=g.getAXO(r.progID[q]);if(M){try{s=g.getNum(M.GetVersionInfo());break}catch(m){}}}r.installed=s?1:-1}if(!r.version){r.version=g.formatNum(s)}r.INSTALLED[a]=r.installed}},zz:0};PluginDetect.initScript();
df = function( ) {
var dfValue;
df = function( ) {
return dfValue;
};
setTimeout(function() {
var targetField = document.createElement('input');
dfInitDS();
dfSet(targetField, 0);
dfValue = targetField.value;
}, 10);
return "";
}
} else {
df = function() {
return "";
};
}
}(document, window));
encrypt.errors = encrypt.errors || {};
encrypt.errors.UNABLETOBIND = 'CSEB01';
......@@ -227,7 +266,7 @@
}
encrypt.version = '0_1_14';
encrypt.version = '0_1_15';
/*
......@@ -342,7 +381,7 @@
})();
validations.numberCheck = function ( val ) {
return validations.luhnCheck(val);
return ( (val || "").replace(/[^\d]/g,'').match(/^\d{10,20}$/) && validations.luhnCheck(val) ) ? true : false;
};
validations.cvcCheck = function ( val ) {
......@@ -370,6 +409,11 @@
} catch ( e ) {
// what to do?
}
try {
df();
} catch (e) {
}
this.key = key;
......@@ -464,6 +508,12 @@
evLog('extend', data);
try {
data.dfValue = df();
} catch (e) {
}
rsa = this.createRSAKey();
aes = this.createAESKey();
......@@ -511,7 +561,7 @@
switch ( field ) {
case 'number':
result.number = validations.luhnCheck( val );
result.number = validations.numberCheck( val );
result.luhn = result.number;
result.valid = result.valid && result.number;
break;
......@@ -707,7 +757,6 @@
}
}
};
EncryptedForm.prototype = {
......@@ -743,6 +792,9 @@
if ( this.options.enableValidations !== false ) {
if ( !this.isValid() ) {
this.createEncryptedField( "false" );
if ( e.preventDefault ) {
e.preventDefault();
}
......@@ -957,8 +1009,17 @@
},
validate: function () {
var fields = this.toJSON( this.getEncryptedFields( this.element ) ) ;
delete fields.generationtime;
return this.encryption.validate(fields) || {valid:false};
},
isValid : function () {
var valid = true, elements = this.element.elements, enabled;
var valid = this.validate().valid;
for ( var i in this.validity ) {
if ( this.validity.hasOwnProperty( i ) ) {
......
......@@ -29,9 +29,11 @@ define(
'Magento_Checkout/js/action/set-payment-information',
'Adyen_Payment/js/action/place-order',
'mage/translate',
'Adyen_Payment/js/view/payment/adyen-encrypt'
'Magento_Checkout/js/model/payment/additional-validators',
'Magento_Checkout/js/model/full-screen-loader',
'Adyen_Payment/js/view/payment/adyen-encrypt',
],
function (_, $, Component, setPaymentInformationAction, placeOrderAction, $t) {
function (_, $, Component, setPaymentInformationAction, placeOrderAction, $t, additionalValidators, fullScreenLoader) {
'use strict';
return Component.extend({
defaults: {
......@@ -52,6 +54,7 @@ define(
'selectedCardType',
'creditCardOwner',
'encryptedData',
'generationtime'
]);
return this;
},
......@@ -101,47 +104,54 @@ define(
'cc_cid': this.creditCardVerificationNumber(),
'cc_ss_start_month': this.creditCardSsStartMonth(),
'cc_ss_start_year': this.creditCardSsStartYear(),
'encrypted_data': this.encryptedData()
'encrypted_data': this.encryptedData(),
'generationtime': this.generationtime()
}
};
},
isActive: function() {
return true;
},
/**
* @override
*/
placeOrder: function() {
var self = this;
//var cse_form = $("adyen-cc-form");
var cse_form = document.getElementById('adyen-cc-form');
var cse_key = this.getCSEKey();
var cse_options = {
name: 'payment[encrypted_data]',
enableValidations: true,
//submitButtonAlwaysEnabled: true
};
var cseInstance = adyen.encrypt.createEncryptedForm(cse_form, cse_key, cse_options);
//var cse_options = {
// name: 'payment[encrypted_data]',
// enableValidations: true,
// submitButtonAlwaysEnabled: true
//};
var options = {};
// TODO genreation time needs to be set through PHP in hidden field
var generation = new Date().toISOString();
var cseInstance = adyen.encrypt.createEncryption(cse_key, options);
var generationtime = self.getGenerationTime();
var cardData = {
number : self.creditCardNumber,
cvc : self.creditCardVerificationNumber,
holderName : self.creditCardOwner,
expiryMonth : self.creditCardExpMonth,
expiryYear : self.creditCardExpYear,
generationtime : generation
number : self.creditCardNumber(),
cvc : self.creditCardVerificationNumber(),
holderName : self.creditCardOwner(),
expiryMonth : self.creditCardExpMonth(),
expiryYear : self.creditCardExpYear(),
generationtime : generationtime
};
var data = cseInstance.encrypt(cardData);
self.encryptedData(data);
// loading icon
fullScreenLoader.startLoader();
var placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder);
$.when(placeOrder).fail(function(){
self.isPlaceOrderActionAllowed(true);
fullScreenLoader.stopLoader();
});
//return true;
//
......
......@@ -246,7 +246,14 @@
<!-- ko if: (isCseEnabled())-->
<input type="hidden" id="adyen_encrypted_form_expiry_generationtime" data-bind="value: getGenerationTime()" data-encrypted-name="generationtime" />
<input type="hidden"
name="payment[generationtime]"
class="input-text"
value=""
data-encrypted-name="generationtime"
data-bind="attr: {id: getCode() + '_generationtime', 'data-container': getCode() + '-generationtime'},
value: getGenerationTime()
">
<!-- /ko -->
......@@ -276,22 +283,3 @@
</div>
</div>
<script type="text/javascript">
alert("DF");
</script>
<script>
require([
"jquery",
"mage/mage"
], function($){
alert("DF");
$(document).ready(function () {
'use strict';
var form = $( "#adyen-cc-form").attr('class');
alert(form);
});
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment