From 022dc571f86c886a5c0983068538c0396ed41aa9 Mon Sep 17 00:00:00 2001 From: Alex Nicksay Date: Mon, 24 Nov 2014 13:17:26 -0500 Subject: [PATCH] v2.0.0 --- dist/boot-debug.js | 321 +++++++++ dist/boot-trace.js | 28 + dist/boot.js | 12 + dist/spf-debug.js | 1657 ++++++++++++++++++++++++++++++++++++++++++++ dist/spf-trace.js | 77 ++ dist/spf.js | 63 ++ 6 files changed, 2158 insertions(+) create mode 100644 dist/boot-debug.js create mode 100644 dist/boot-trace.js create mode 100644 dist/boot.js create mode 100644 dist/spf-debug.js create mode 100644 dist/spf-trace.js create mode 100644 dist/spf.js diff --git a/dist/boot-debug.js b/dist/boot-debug.js new file mode 100644 index 00000000..7626e148 --- /dev/null +++ b/dist/boot-debug.js @@ -0,0 +1,321 @@ +/* +SPF 20 (v2.0.0) +(c) 2012-2014 Google, Inc. +License: MIT +*/ +(function(){function $spf$bind$$($fn$$1$$, $self$$1$$, $var_args$$27$$) { + var $args$$ = Array.prototype.slice.call(arguments, 2); + return function() { + var $newArgs$$ = $args$$.slice(); + $newArgs$$.push.apply($newArgs$$, arguments); + return $fn$$1$$.apply($self$$1$$, $newArgs$$); + }; +} +function $spf$dispatch$$($name$$47$$, $opt_detail$$) { + if (document.createEvent) { + var $evt$$21$$ = document.createEvent("CustomEvent"); + $evt$$21$$.initCustomEvent($name$$47$$, !0, !0, $opt_detail$$); + document.dispatchEvent($evt$$21$$); + } +} +;var $spf$state$values_$$ = window._spf_state || {}; +window._spf_state = $spf$state$values_$$; +var $spf$config$values$$ = {}; +"config" in $spf$state$values_$$ || ($spf$state$values_$$.config = $spf$config$values$$); +$spf$config$values$$ = $spf$state$values_$$.config; +function $spf$array$each$$($arr$$10$$, $fn$$3$$) { + if ($arr$$10$$.forEach) { + $arr$$10$$.forEach($fn$$3$$, void 0); + } else { + for (var $i$$3$$ = 0, $l$$ = $arr$$10$$.length;$i$$3$$ < $l$$;$i$$3$$++) { + $i$$3$$ in $arr$$10$$ && $fn$$3$$.call(void 0, $arr$$10$$[$i$$3$$], $i$$3$$, $arr$$10$$); + } + } +} +function $spf$array$every$$($arr$$11$$, $fn$$4$$) { + if ($arr$$11$$.every) { + return $arr$$11$$.every($fn$$4$$, void 0); + } + for (var $i$$4$$ = 0, $l$$1$$ = $arr$$11$$.length;$i$$4$$ < $l$$1$$;$i$$4$$++) { + if ($i$$4$$ in $arr$$11$$ && !$fn$$4$$.call(void 0, $arr$$11$$[$i$$4$$], $i$$4$$, $arr$$11$$)) { + return!1; + } + } + return!0; +} +function $spf$array$filter$$($arr$$12$$, $fn$$5$$) { + if ($arr$$12$$.filter) { + return $arr$$12$$.filter($fn$$5$$, void 0); + } + var $res$$ = []; + $spf$array$each$$($arr$$12$$, function($a$$, $i$$5$$, $arr$$13$$) { + $fn$$5$$.call(void 0, $a$$, $i$$5$$, $arr$$13$$) && $res$$.push($a$$); + }); + return $res$$; +} +function $spf$array$isArray$$($val$$2$$) { + return "[object Array]" == Object.prototype.toString.call($val$$2$$); +} +;function $spf$debug$debug$$($var_args$$29$$) { + $spf$debug$levels_$$[$spf$debug$Level$DEBUG$$] >= $spf$debug$levels_$$.debug && $spf$debug$log$$($spf$debug$Level$DEBUG$$, arguments); +} +function $spf$debug$warn$$($var_args$$31$$) { + $spf$debug$levels_$$[$spf$debug$Level$WARN$$] >= $spf$debug$levels_$$.debug && $spf$debug$log$$($spf$debug$Level$WARN$$, arguments); +} +function $spf$debug$log$$($method$$1$$, $args$$2$$) { + if (window.console) { + $args$$2$$ = Array.prototype.slice.call($args$$2$$); + var $current$$ = (new Date).getTime(), $overall$$ = $spf$debug$formatDuration$$($spf$debug$start_$$, $current$$); + $spf$debug$split_$$ ? $args$$2$$.unshift($overall$$ + "/" + $spf$debug$formatDuration$$($spf$debug$split_$$, $current$$) + ":") : $args$$2$$.unshift($overall$$ + ":"); + $spf$debug$direct_$$ ? ($args$$2$$.unshift("[spf]"), window.console[$method$$1$$].apply(window.console, $args$$2$$)) : ($args$$2$$.unshift("[spf - " + $method$$1$$ + "]"), window.console.log($args$$2$$.join(" "))); + } +} +function $spf$debug$formatDuration$$($start$$7$$, $end$$3$$) { + var $dur$$ = ($end$$3$$ - $start$$7$$) / 1E3; + $dur$$.toFixed && ($dur$$ = $dur$$.toFixed(3)); + return $dur$$ + "s"; +} +var $spf$debug$start_$$ = (new Date).getTime(), $spf$debug$split_$$ = 0, $spf$debug$direct_$$ = !(!window.console || !window.console.debug), $spf$debug$levels_$$ = {debug:1, info:2, warn:3, error:4}, $spf$debug$Level$DEBUG$$ = "debug", $spf$debug$Level$WARN$$ = "warn"; +function $spf$pubsub$subscribe$$($topic$$, $fn$$7$$) { + $topic$$ && $fn$$7$$ && ($topic$$ in $spf$pubsub$subscriptions$$ || ($spf$pubsub$subscriptions$$[$topic$$] = []), $spf$pubsub$subscriptions$$[$topic$$].push($fn$$7$$)); +} +function $spf$pubsub$publish_$$($topic$$4$$) { + $topic$$4$$ in $spf$pubsub$subscriptions$$ && $spf$array$each$$($spf$pubsub$subscriptions$$[$topic$$4$$], function($subFn$$1$$, $i$$11$$, $arr$$18$$) { + $arr$$18$$[$i$$11$$] = null; + $subFn$$1$$ && $subFn$$1$$(); + }); +} +var $spf$pubsub$subscriptions$$ = {}; +"ps-s" in $spf$state$values_$$ || ($spf$state$values_$$["ps-s"] = $spf$pubsub$subscriptions$$); +$spf$pubsub$subscriptions$$ = $spf$state$values_$$["ps-s"]; +function $spf$url$absolute$$($relative$$) { + var $aEl$$inline_4$$ = document.createElement("a"); + $aEl$$inline_4$$.href = $relative$$; + $aEl$$inline_4$$.href = $aEl$$inline_4$$.href; + return $aEl$$inline_4$$.href.split("#")[0]; +} +;function $spf$net$resource$load$$($el$$1_url$$18$$, $name$$52$$, $check_opt_fn$$) { + var $type$$73$$ = $spf$net$resource$Type$JS$$; + $spf$debug$debug$$("resource.load", $type$$73$$, $el$$1_url$$18$$, $name$$52$$); + var $isJS_key$$inline_57_prevName$$ = $type$$73$$ == $spf$net$resource$Type$JS$$; + $el$$1_url$$18$$ = $spf$net$resource$canonicalize$$($type$$73$$, $el$$1_url$$18$$); + var $pseudonym$$ = $name$$52$$ || "^" + $el$$1_url$$18$$, $topic$$6$$ = $spf$net$resource$key$$($type$$73$$, $pseudonym$$), $prevUrl$$; + $name$$52$$ && ($prevUrl$$ = $spf$net$resource$url$get$$($type$$73$$, $name$$52$$)) && $el$$1_url$$18$$ != $prevUrl$$ && ($spf$dispatch$$($isJS_key$$inline_57_prevName$$ ? "spfjsbeforeunload" : "spfcssbeforeunload", {name:$name$$52$$, url:$prevUrl$$}), $spf$net$resource$unloadPrepare_$$($type$$73$$, $name$$52$$, $prevUrl$$), $spf$pubsub$subscribe$$($topic$$6$$, $spf$bind$$($spf$net$resource$unloadComplete_$$, null, $type$$73$$, $name$$52$$, $prevUrl$$))); + $isJS_key$$inline_57_prevName$$ = $spf$net$resource$key$$($type$$73$$, $el$$1_url$$18$$); + if (($isJS_key$$inline_57_prevName$$ = $spf$net$resource$name_$$[$isJS_key$$inline_57_prevName$$]) && $pseudonym$$ != $isJS_key$$inline_57_prevName$$) { + var $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ = $spf$net$resource$key$$($type$$73$$, $isJS_key$$inline_57_prevName$$); + delete $spf$net$resource$url_$$[$key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$]; + $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ = $spf$net$resource$key$$($type$$73$$, $el$$1_url$$18$$); + delete $spf$net$resource$name_$$[$key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$]; + ($key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ = $spf$net$resource$key$$($type$$73$$, $isJS_key$$inline_57_prevName$$)) && $topic$$6$$ && $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ in $spf$pubsub$subscriptions$$ && ($spf$pubsub$subscriptions$$[$topic$$6$$] = ($spf$pubsub$subscriptions$$[$topic$$6$$] || []).concat($spf$pubsub$subscriptions$$[$key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$]), + delete $spf$pubsub$subscriptions$$[$key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$]); + } + $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ = $spf$net$resource$key$$($type$$73$$, $el$$1_url$$18$$); + $spf$net$resource$name_$$[$key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$] = $pseudonym$$; + var $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$ = $el$$1_url$$18$$, $key$$inline_78$$ = $spf$net$resource$key$$($type$$73$$, $pseudonym$$); + $spf$net$resource$url_$$[$key$$inline_78$$] = $key$$inline_61_key$$inline_65_key$$inline_73_oldTopic$$inline_67_url$$inline_77$$; + $spf$debug$debug$$(" subscribing callback", $topic$$6$$); + $spf$pubsub$subscribe$$($topic$$6$$, $check_opt_fn$$); + $check_opt_fn$$ = $spf$bind$$($spf$net$resource$check$$, null, $type$$73$$); + $spf$net$resource$status$get$$($type$$73$$, $el$$1_url$$18$$) ? ($isJS_key$$inline_57_prevName$$ && $pseudonym$$ != $isJS_key$$inline_57_prevName$$ && ($el$$1_url$$18$$ = $spf$net$resource$find$$($type$$73$$, $el$$1_url$$18$$)) && $el$$1_url$$18$$.setAttribute("name", $name$$52$$ || ""), $check_opt_fn$$()) : ($el$$1_url$$18$$ = $spf$net$resource$create$$($type$$73$$, $el$$1_url$$18$$, $check_opt_fn$$, void 0, void 0, $prevUrl$$)) && $name$$52$$ && $el$$1_url$$18$$.setAttribute("name", $name$$52$$); +} +function $spf$net$resource$unload$$($name$$53$$) { + var $type$$74$$ = $spf$net$resource$Type$JS$$; + $spf$debug$warn$$("resource.unload", $type$$74$$, $name$$53$$); + var $url$$19$$ = $spf$net$resource$url$get$$($type$$74$$, $name$$53$$); + $spf$net$resource$unloadPrepare_$$($type$$74$$, $name$$53$$, $url$$19$$); + $spf$net$resource$unloadComplete_$$($type$$74$$, $name$$53$$, $url$$19$$); +} +function $spf$net$resource$unloadPrepare_$$($topic$$7_type$$75$$, $name$$54$$, $key$$inline_86_url$$20$$) { + $spf$debug$debug$$(" > resource.unloadPrepare_", $topic$$7_type$$75$$, $key$$inline_86_url$$20$$); + var $key$$inline_82$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $name$$54$$); + delete $spf$net$resource$url_$$[$key$$inline_82$$]; + $key$$inline_86_url$$20$$ && ($key$$inline_86_url$$20$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $key$$inline_86_url$$20$$), delete $spf$net$resource$name_$$[$key$$inline_86_url$$20$$]); + $topic$$7_type$$75$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $name$$54$$); + $spf$debug$debug$$(" clearing callbacks for", $topic$$7_type$$75$$); + delete $spf$pubsub$subscriptions$$[$topic$$7_type$$75$$]; +} +function $spf$net$resource$unloadComplete_$$($key$$inline_90_type$$76$$, $name$$55_url$$inline_8$$, $el$$inline_10_url$$21$$) { + var $isJS$$1$$ = $key$$inline_90_type$$76$$ == $spf$net$resource$Type$JS$$; + $el$$inline_10_url$$21$$ && ($spf$debug$debug$$(" > resource.unloadComplete_", $key$$inline_90_type$$76$$, $el$$inline_10_url$$21$$), $spf$dispatch$$($isJS$$1$$ ? "spfjsunload" : "spfcssunload", {name:$name$$55_url$$inline_8$$, url:$el$$inline_10_url$$21$$}), $name$$55_url$$inline_8$$ = $spf$net$resource$canonicalize$$($key$$inline_90_type$$76$$, $el$$inline_10_url$$21$$), ($el$$inline_10_url$$21$$ = $spf$net$resource$find$$($key$$inline_90_type$$76$$, $name$$55_url$$inline_8$$, void 0)) && $el$$inline_10_url$$21$$.parentNode && + $el$$inline_10_url$$21$$.parentNode.removeChild($el$$inline_10_url$$21$$), $key$$inline_90_type$$76$$ = $spf$net$resource$key$$($key$$inline_90_type$$76$$, $name$$55_url$$inline_8$$), delete $spf$net$resource$status_$$[$key$$inline_90_type$$76$$]); +} +function $spf$net$resource$check$$($type$$77$$) { + $spf$debug$debug$$("resource.check", $type$$77$$); + var $prefix$$4$$ = $spf$net$resource$key$$($type$$77$$, ""), $topic$$8$$; + for ($topic$$8$$ in $spf$pubsub$subscriptions$$) { + if (0 == $topic$$8$$.indexOf($prefix$$4$$)) { + var $names$$ = $topic$$8$$.substring($prefix$$4$$.length).split("|"), $ready$$ = $spf$array$every$$($names$$, $spf$bind$$($spf$net$resource$url$loaded$$, null, $type$$77$$)); + $spf$debug$debug$$(" ", $topic$$8$$, "->", $names$$, "=", $ready$$); + $ready$$ && ($spf$debug$debug$$(" publishing", $topic$$8$$), $spf$pubsub$publish_$$($topic$$8$$)); + } + } +} +function $spf$net$resource$create$$($type$$78$$, $url$$22$$, $opt_callback$$7$$, $opt_document$$2_prevEl$$, $opt_statusGroup$$, $opt_prevUrl$$) { + function $next$$1$$() { + $spf$debug$debug$$("resource.create", $type$$78$$, $url$$22$$, "done"); + $spf$net$resource$status$get$$($type$$78$$, $url$$22$$, $opt_statusGroup$$) && ($spf$debug$debug$$("resource.create", $type$$78$$, $url$$22$$, "loaded"), $spf$net$resource$status$set$$($spf$net$resource$State$LOADED$$, $type$$78$$, $url$$22$$, $opt_statusGroup$$)); + $opt_callback$$7$$ && setTimeout($opt_callback$$7$$, 0); + return null; + } + $spf$debug$debug$$("resource.create", $type$$78$$, $url$$22$$, "loading"); + var $isJS$$2$$ = $type$$78$$ == $spf$net$resource$Type$JS$$; + $url$$22$$ = $spf$net$resource$canonicalize$$($type$$78$$, $url$$22$$); + $spf$net$resource$status$set$$($spf$net$resource$State$LOADING$$, $type$$78$$, $url$$22$$, $opt_statusGroup$$); + var $doc$$2_head$$ = $opt_document$$2_prevEl$$ || document, $el$$2$$ = $doc$$2_head$$.createElement($isJS$$2$$ ? "script" : "link"); + if (!$url$$22$$) { + return $next$$1$$(); + } + var $label$$4$$ = $url$$22$$ ? String($url$$22$$).replace(/[^\w]/g, "") : ""; + $el$$2$$.className = $spf$net$resource$key$$($type$$78$$, $label$$4$$); + "onload" in $el$$2$$ ? $el$$2$$.onerror = $el$$2$$.onload = $next$$1$$ : $el$$2$$.onreadystatechange = function $$el$$2$$$onreadystatechange$() { + /^c|loade/.test($el$$2$$.readyState) && $next$$1$$(); + }; + $doc$$2_head$$ = $doc$$2_head$$.getElementsByTagName("head")[0]; + $isJS$$2$$ ? ($el$$2$$.async = !0, $el$$2$$.src = $url$$22$$, $doc$$2_head$$.insertBefore($el$$2$$, $doc$$2_head$$.firstChild)) : ($el$$2$$.rel = "stylesheet", $el$$2$$.href = $url$$22$$, $opt_document$$2_prevEl$$ = $opt_prevUrl$$ && $spf$net$resource$find$$($type$$78$$, $opt_prevUrl$$, $opt_document$$2_prevEl$$), $doc$$2_head$$.insertBefore($el$$2$$, $opt_document$$2_prevEl$$)); + return $el$$2$$; +} +function $spf$net$resource$find$$($cls$$3_type$$80$$, $label$$5_url$$24$$, $doc$$inline_16_opt_document$$4$$) { + $label$$5_url$$24$$ = $label$$5_url$$24$$ ? String($label$$5_url$$24$$).replace(/[^\w]/g, "") : ""; + $cls$$3_type$$80$$ = $spf$net$resource$key$$($cls$$3_type$$80$$, $label$$5_url$$24$$); + $doc$$inline_16_opt_document$$4$$ = $doc$$inline_16_opt_document$$4$$ || document; + return($doc$$inline_16_opt_document$$4$$.querySelectorAll ? $doc$$inline_16_opt_document$$4$$.querySelectorAll("." + $cls$$3_type$$80$$) : [])[0]; +} +function $spf$net$resource$canonicalize$$($type$$87$$, $url$$28$$) { + var $key$$29_paths$$1$$ = "rsrc-p-" + $type$$87$$; + if ($url$$28$$) { + var $index$$45$$ = $url$$28$$.indexOf("//"); + if (0 > $index$$45$$) { + if (0 == $url$$28$$.lastIndexOf("hash-", 0)) { + return $url$$28$$; + } + $key$$29_paths$$1$$ = $spf$state$values_$$[$key$$29_paths$$1$$] || ""; + if ("[object String]" == Object.prototype.toString.call($key$$29_paths$$1$$)) { + $url$$28$$ = $key$$29_paths$$1$$ + $url$$28$$; + } else { + for (var $p$$ in $key$$29_paths$$1$$) { + $url$$28$$ = $url$$28$$.replace($p$$, $key$$29_paths$$1$$[$p$$]); + } + } + $url$$28$$ = 0 > $url$$28$$.indexOf("." + $type$$87$$) ? $url$$28$$ + "." + $type$$87$$ : $url$$28$$; + $url$$28$$ = $spf$url$absolute$$($url$$28$$); + } else { + 0 == $index$$45$$ && ($url$$28$$ = $spf$url$absolute$$($url$$28$$)); + } + } + return $url$$28$$; +} +function $spf$net$resource$key$$($type$$88$$, $label$$9$$, $opt_group$$) { + return $type$$88$$ + "-" + $label$$9$$ + ($opt_group$$ ? "-" + $opt_group$$ : ""); +} +function $spf$net$resource$status$set$$($status$$, $key$$30_type$$89$$, $url$$30$$, $opt_group$$1$$) { + $key$$30_type$$89$$ = $spf$net$resource$key$$($key$$30_type$$89$$, $url$$30$$, $opt_group$$1$$); + $spf$net$resource$status_$$[$key$$30_type$$89$$] = $status$$; +} +function $spf$net$resource$status$get$$($key$$31_type$$90$$, $url$$31$$, $opt_group$$2$$) { + $key$$31_type$$90$$ = $spf$net$resource$key$$($key$$31_type$$90$$, $url$$31$$, $opt_group$$2$$); + return $spf$net$resource$status_$$[$key$$31_type$$90$$]; +} +function $spf$net$resource$url$get$$($type$$97$$, $name$$60$$) { + var $key$$37$$ = $spf$net$resource$key$$($type$$97$$, $name$$60$$); + return $spf$net$resource$url_$$[$key$$37$$]; +} +function $spf$net$resource$url$loaded$$($type$$99$$, $name$$62$$) { + var $url$$39$$ = $spf$net$resource$url$get$$($type$$99$$, $name$$62$$), $JSCompiler_temp$$2_status$$inline_25$$; + if ($JSCompiler_temp$$2_status$$inline_25$$ = void 0 != $url$$39$$) { + $JSCompiler_temp$$2_status$$inline_25$$ = $spf$net$resource$status$get$$($type$$99$$, $url$$39$$), $JSCompiler_temp$$2_status$$inline_25$$ = "" == $url$$39$$ || $JSCompiler_temp$$2_status$$inline_25$$ == $spf$net$resource$State$LOADED$$; + } + return $JSCompiler_temp$$2_status$$inline_25$$; +} +var $spf$net$resource$status_$$ = {}, $spf$net$resource$name_$$ = {}, $spf$net$resource$url_$$ = {}, $spf$net$resource$State$LOADING$$ = 1, $spf$net$resource$State$LOADED$$ = 2, $spf$net$resource$Type$JS$$ = "js"; +"rsrc-s" in $spf$state$values_$$ || ($spf$state$values_$$["rsrc-s"] = $spf$net$resource$status_$$); +$spf$net$resource$status_$$ = $spf$state$values_$$["rsrc-s"]; +"rsrc-n" in $spf$state$values_$$ || ($spf$state$values_$$["rsrc-n"] = $spf$net$resource$name_$$); +$spf$net$resource$name_$$ = $spf$state$values_$$["rsrc-n"]; +"rsrc-u" in $spf$state$values_$$ || ($spf$state$values_$$["rsrc-u"] = $spf$net$resource$url_$$); +$spf$net$resource$url_$$ = $spf$state$values_$$["rsrc-u"]; +function $spf$net$script$ready$$($names$$1_topic$$9$$, $opt_fn$$3$$, $opt_require$$) { + $names$$1_topic$$9$$ = $spf$array$isArray$$($names$$1_topic$$9$$) ? $names$$1_topic$$9$$ : [$names$$1_topic$$9$$]; + $spf$debug$debug$$("script.ready", $names$$1_topic$$9$$); + $names$$1_topic$$9$$ = $spf$array$filter$$($names$$1_topic$$9$$, function($name$$65$$) { + return!!$name$$65$$; + }); + var $unknown$$ = []; + $spf$array$each$$($names$$1_topic$$9$$, function($name$$66$$) { + void 0 == $spf$net$resource$url$get$$($spf$net$resource$Type$JS$$, $name$$66$$) && $unknown$$.push($name$$66$$); + }); + var $known$$ = !$unknown$$.length; + if ($opt_fn$$3$$) { + var $ready$$1$$ = $spf$array$every$$($names$$1_topic$$9$$, $spf$bind$$($spf$net$resource$url$loaded$$, null, $spf$net$resource$Type$JS$$)); + $known$$ && $ready$$1$$ ? $opt_fn$$3$$() : ($names$$1_topic$$9$$ = $spf$net$resource$key$$($spf$net$resource$Type$JS$$, $names$$1_topic$$9$$.sort().join("|")), $spf$debug$debug$$(" subscribing", $names$$1_topic$$9$$), $spf$pubsub$subscribe$$($names$$1_topic$$9$$, $opt_fn$$3$$)); + } + $opt_require$$ && !$known$$ && $opt_require$$($unknown$$); +} +function $spf$net$script$require$$($names$$3$$, $opt_fn$$4$$) { + $spf$debug$debug$$("script.require", $names$$3$$); + $names$$3$$ = $spf$array$isArray$$($names$$3$$) ? $names$$3$$ : [$names$$3$$]; + $spf$array$each$$($names$$3$$, function($name$$68$$) { + if ($name$$68$$) { + var $url$$43$$ = $spf$net$script$url_$$[$name$$68$$] || $name$$68$$, $url$$43$$ = $spf$net$resource$canonicalize$$($spf$net$resource$Type$JS$$, $url$$43$$), $previous$$1$$ = $spf$net$resource$url$get$$($spf$net$resource$Type$JS$$, $name$$68$$); + $previous$$1$$ && $url$$43$$ != $previous$$1$$ && $spf$net$script$unrequire$$($name$$68$$); + } + }); + $spf$net$script$ready$$($names$$3$$, $opt_fn$$4$$, $spf$net$script$require_$$); +} +function $spf$net$script$require_$$($names$$4$$) { + $spf$array$each$$($names$$4$$, function($name$$69$$) { + function $next$$3$$() { + $spf$net$resource$load$$($url$$44$$, $name$$69$$, void 0); + } + var $deps$$ = $spf$net$script$deps_$$[$name$$69$$], $url$$44$$ = $spf$net$script$url_$$[$name$$69$$] || $name$$69$$; + $deps$$ ? $spf$net$script$require$$($deps$$, $next$$3$$) : $next$$3$$(); + }); +} +function $spf$net$script$unrequire$$($names$$5$$) { + $spf$debug$debug$$("script.unrequire", $names$$5$$); + $names$$5$$ = $spf$array$isArray$$($names$$5$$) ? $names$$5$$ : [$names$$5$$]; + $spf$array$each$$($names$$5$$, function($name$$70$$) { + var $descendants$$ = [], $dep$$; + for ($dep$$ in $spf$net$script$deps_$$) { + var $list$$ = $spf$net$script$deps_$$[$dep$$], $list$$ = $spf$array$isArray$$($list$$) ? $list$$ : [$list$$]; + $spf$array$each$$($list$$, function($l$$6$$) { + $l$$6$$ == $name$$70$$ && $descendants$$.push($dep$$); + }); + } + $spf$array$each$$($descendants$$, function($descend$$) { + $spf$net$script$unrequire$$($descend$$); + }); + $spf$net$resource$unload$$($name$$70$$); + }); +} +var $spf$net$script$deps_$$ = {}; +"js-d" in $spf$state$values_$$ || ($spf$state$values_$$["js-d"] = $spf$net$script$deps_$$); +var $spf$net$script$deps_$$ = $spf$state$values_$$["js-d"], $spf$net$script$url_$$ = {}; +"js-u" in $spf$state$values_$$ || ($spf$state$values_$$["js-u"] = $spf$net$script$url_$$); +$spf$net$script$url_$$ = $spf$state$values_$$["js-u"]; +var $spf$bootloader$api_$$ = {script:{load:function($url$$40$$, $name$$63$$, $opt_fn$$1$$) { + $spf$net$resource$load$$($url$$40$$, $name$$63$$, $opt_fn$$1$$); +}, get:function($url$$41$$, $opt_fn$$2$$) { + $spf$net$resource$create$$($spf$net$resource$Type$JS$$, $url$$41$$, $opt_fn$$2$$); +}, ready:$spf$net$script$ready$$, done:function($key$$inline_110_name$$67$$) { + $key$$inline_110_name$$67$$ = $spf$net$resource$key$$($spf$net$resource$Type$JS$$, $key$$inline_110_name$$67$$); + $spf$net$resource$url_$$[$key$$inline_110_name$$67$$] = ""; + $spf$net$resource$check$$($spf$net$resource$Type$JS$$); +}, require:$spf$net$script$require$$, declare:function($deps$$1$$, $opt_urls$$) { + if ($deps$$1$$) { + for (var $name$$72$$ in $deps$$1$$) { + $spf$net$script$deps_$$[$name$$72$$] = $deps$$1$$[$name$$72$$]; + } + if ($opt_urls$$) { + for ($name$$72$$ in $opt_urls$$) { + $spf$net$script$url_$$[$name$$72$$] = $opt_urls$$[$name$$72$$]; + } + } + } +}, path:function($paths$$2$$) { + $spf$state$values_$$["rsrc-p-" + $spf$net$resource$Type$JS$$] = $paths$$2$$; +}}}, $api$$ = this.spf = this.spf || {}, $fn$$; +for ($fn$$ in $spf$bootloader$api_$$) { + $api$$[$fn$$] = $spf$bootloader$api_$$[$fn$$]; +} +;})(); diff --git a/dist/boot-trace.js b/dist/boot-trace.js new file mode 100644 index 00000000..271f88ab --- /dev/null +++ b/dist/boot-trace.js @@ -0,0 +1,28 @@ +/* +SPF 20 (v2.0.0) +(c) 2012-2014 Google, Inc. +License: MIT +*/ +/** + * https://github.com/google/tracing-framework + * Copyright 2013 Google, Inc. All Rights Reserved. + * Use of this source code is governed by a BSD-style license that can be + * found at https://github.com/google/tracing-framework/blob/master/LICENSE. + */ +(function(){function aa(a){return a};function f(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}function ba(a,b){if(document.createEvent){var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!0,!0,b);document.dispatchEvent(c)}}function ca(){};function k(a,b){return l[a]=b}var l=window._spf_state||{};window._spf_state=l;var m={};"config"in l||k("config",m);m=l.config;function q(a,b){if(a.forEach)a.forEach(b,void 0);else for(var c=0,d=a.length;cd){if(0==b.lastIndexOf("hash-",0))return b;c=l[c]||"";if("[object String]"==Object.prototype.toString.call(c))b=c+b;else for(var e in c)b=b.replace(e,c[e]);b=0>b.indexOf("."+a)?b+"."+a:b;b=ja(b)}else 0==d&&(b=ja(b))}return b}function E(a,b,c){return a+"-"+b+(c?"-"+c:"")}function R(a){return a?String(a).replace(/[^\w]/g,""):""}function P(a,b,c,d){b=E(b,c,d);T[b]=a}function L(a,b,c){a=E(a,b,c);return T[a]} +function Ca(a,b){var c=E(a,b);delete T[c]}function S(a,b){var c=L(a,b);return""==b||c==Q}function J(a,b,c){a=E(a,b);U[a]=c}function F(a,b){var c=E(a,b);return U[c]}function I(a,b){var c=E(a,b);delete U[c]}function O(a,b){var c=F(a,b);return void 0!=c&&S(a,c)}var T={},H={},U={},Ha=-1!=navigator.userAgent.indexOf(" Trident/"),Ba=1,Q=2,Ga="css",C="js";"rsrc-s"in l||k("rsrc-s",T);T=l["rsrc-s"];"rsrc-n"in l||k("rsrc-n",H);H=l["rsrc-n"];"rsrc-u"in l||k("rsrc-u",U);U=l["rsrc-u"];wa=w(wa,"spf.net.resource.load"); +Aa=w(Aa,"spf.net.resource.unload");va=w(va,"spf.net.resource.unload_");K=w(K,"spf.net.resource.check");M=w(M,"spf.net.resource.create");N=w(N,"spf.net.resource.destroy");Da=w(Da,"spf.net.resource.discover");Ea=w(Ea,"spf.net.resource.prefetch");Fa=w(Fa,"spf.net.resource.prefetch_");Ia=w(Ia,"spf.net.resource.eval");Ja=w(Ja,"spf.net.resource.exec");Ka=w(Ka,"spf.net.resource.path");D=w(D,"spf.net.resource.canonicalize");E=w(E,"spf.net.resource.key");R=w(R,"spf.net.resource.label");P=w(P,"spf.net.resource.status.set"); +L=w(L,"spf.net.resource.status.get");Ca=w(Ca,"spf.net.resource.status.clear");S=w(S,"spf.net.resource.status.loaded");J=w(J,"spf.net.resource.url.set");F=w(F,"spf.net.resource.url.get");I=w(I,"spf.net.resource.url.clear");O=w(O,"spf.net.resource.url.loaded");function V(a,b,c){wa(C,a,b,c)}function La(a){Aa(C,a)}function Ma(){Da(C)}function Na(a,b){M(C,a,b)}function Oa(a){a=t(a);q(a,function(a){Ea(C,a)})}function W(a,b,c){a=t(a);a=da(a,function(a){return!!a});var d=[];q(a,function(a){void 0==F(C,a)&&d.push(a)});var e=!d.length;if(b){var g=s(a,f(O,null,C));e&&g?b():(a=E(C,a.sort().join("|")),u(a,b))}c&&!e&&c(d)}function Pa(a){J(C,a,"");K(C)}function Qa(a,b){a=t(a);var c=E(C,a.sort().join("|"));ga(c,b)} +function X(a,b){a=t(a);q(a,function(a){if(a){var b=Y[a]||a,b=D(C,b),e=F(C,a);e&&b!=e&&Z(a)}});W(a,b,Ra)}function Ra(a){q(a,function(a){function c(){V(e,a)}var d=$[a],e=Y[a]||a;d?X(d,c):c()})}function Z(a){a=t(a);q(a,function(a){var c=[],d;for(d in $){var e=$[d],e=t(e);q(e,function(e){e==a&&c.push(d)})}q(c,function(a){Z(a)});La(a)})}function Sa(a,b){Ia(C,a,b)}function Ta(a,b){if(a){for(var c in a)$[c]=a[c];if(b)for(c in b)Y[c]=b[c]}}function Ua(a){Ka(C,a)}var $={};"js-d"in l||k("js-d",$); +var $=l["js-d"],Y={};"js-u"in l||k("js-u",Y);Y=l["js-u"];V=w(V,"spf.net.script.load");La=w(La,"spf.net.script.unload");Ma=w(Ma,"spf.net.script.discover");Na=w(Na,"spf.net.script.get");Oa=w(Oa,"spf.net.script.prefetch");W=w(W,"spf.net.script.ready");Pa=w(Pa,"spf.net.script.done");Qa=w(Qa,"spf.net.script.ignore");X=w(X,"spf.net.script.require");Ra=w(Ra,"spf.net.script.require_");Z=w(Z,"spf.net.script.unrequire");Sa=w(Sa,"spf.net.script.eval");Ta=w(Ta,"spf.net.script.declare");Ua=w(Ua,"spf.net.script.path");var Va={script:{load:V,get:Na,ready:W,done:Pa,require:X,declare:Ta,path:Ua}},Wa=this.spf=this.spf||{},Xa;for(Xa in Va)Wa[Xa]=Va[Xa];})(); diff --git a/dist/boot.js b/dist/boot.js new file mode 100644 index 00000000..7f4003e1 --- /dev/null +++ b/dist/boot.js @@ -0,0 +1,12 @@ +/* +SPF 20 (v2.0.0) +(c) 2012-2014 Google, Inc. +License: MIT +*/ +(function(){function f(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}function g(a,b){if(document.createEvent){var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!0,!0,b);document.dispatchEvent(c)}};var l=window._spf_state||{};window._spf_state=l;var m={};"config"in l||(l.config=m);m=l.config;function r(a,b){if(a.forEach)a.forEach(b,void 0);else for(var c=0,d=a.length;cd){if(0==b.lastIndexOf("hash-",0))return b;c=l[c]||"";if("[object String]"==Object.prototype.toString.call(c))b=c+b;else for(var e in c)b=b.replace(e,c[e]);b=0>b.indexOf("."+a)?b+"."+a:b;b=z(b)}else 0==d&&(b=z(b))}return b}function D(a,b,c){return a+"-"+b+(c?"-"+c:"")}function Q(a,b,c,d){b=D(b,c,d);O[b]=a}function K(a,b,c){a=D(a,b,c);return O[a]}function E(a,b){var c=D(a,b);return I[c]} +function P(a,b){var c=E(a,b),d;if(d=void 0!=c)d=K(a,c),d=""==c||d==R;return d}var O={},H={},I={},S=1,R=2,B="js";"rsrc-s"in l||(l["rsrc-s"]=O);O=l["rsrc-s"];"rsrc-n"in l||(l["rsrc-n"]=H);H=l["rsrc-n"];"rsrc-u"in l||(l["rsrc-u"]=I);I=l["rsrc-u"];function T(a,b,c){a=u(a)?a:[a];a=t(a,function(a){return!!a});var d=[];r(a,function(a){void 0==E(B,a)&&d.push(a)});var e=!d.length;if(b){var n=s(a,f(P,null,B));e&&n?b():(a=D(B,a.sort().join("|")),v(a,b))}c&&!e&&c(d)}function U(a,b){a=u(a)?a:[a];r(a,function(a){if(a){var b=V[a]||a,b=C(B,b),e=E(B,a);e&&b!=e&&W(a)}});T(a,b,X)}function X(a){r(a,function(a){function c(){A(e,a,void 0)}var d=Y[a],e=V[a]||a;d?U(d,c):c()})} +function W(a){a=u(a)?a:[a];r(a,function(a){var c=[],d;for(d in Y){var e=Y[d],e=u(e)?e:[e];r(e,function(e){e==a&&c.push(d)})}r(c,function(a){W(a)});N(a)})}var Y={};"js-d"in l||(l["js-d"]=Y);var Y=l["js-d"],V={};"js-u"in l||(l["js-u"]=V);V=l["js-u"];var Z={script:{load:function(a,b,c){A(a,b,c)},get:function(a,b){M(B,a,b)},ready:T,done:function(a){a=D(B,a);I[a]="";J(B)},require:U,declare:function(a,b){if(a){for(var c in a)Y[c]=a[c];if(b)for(c in b)V[c]=b[c]}},path:function(a){l["rsrc-p-"+B]=a}}},aa=this.spf=this.spf||{},$;for($ in Z)aa[$]=Z[$];})(); diff --git a/dist/spf-debug.js b/dist/spf-debug.js new file mode 100644 index 00000000..7477d569 --- /dev/null +++ b/dist/spf-debug.js @@ -0,0 +1,1657 @@ +/* +SPF 20 (v2.0.0) +(c) 2012-2014 Google, Inc. +License: MIT +*/ +(function(){function $spf$bind$$($fn$$, $self$$1$$, $var_args$$27$$) { + var $args$$ = Array.prototype.slice.call(arguments, 2); + return function() { + var $newArgs$$ = $args$$.slice(); + $newArgs$$.push.apply($newArgs$$, arguments); + return $fn$$.apply($self$$1$$, $newArgs$$); + }; +} +function $spf$execute$$($fn$$1$$, $var_args$$28$$) { + if ($fn$$1$$) { + var $args$$1$$ = Array.prototype.slice.call(arguments, 1); + try { + return $fn$$1$$.apply(null, $args$$1$$); + } catch ($err$$) { + return $err$$; + } + } +} +function $spf$dispatch$$($name$$47$$, $opt_detail$$) { + if (document.createEvent) { + var $evt$$21$$ = document.createEvent("CustomEvent"); + $evt$$21$$.initCustomEvent($name$$47$$, !0, !0, $opt_detail$$); + return document.dispatchEvent($evt$$21$$); + } + return!0; +} +function $spf$now$$() { + return(new Date).getTime(); +} +function $spf$nullFunction$$() { +} +;function $spf$state$set$$($key$$16$$, $value$$39$$) { + return $spf$state$values_$$[$key$$16$$] = $value$$39$$; +} +var $spf$state$values_$$ = window._spf_state || {}; +window._spf_state = $spf$state$values_$$; +var $spf$config$defaults$$ = {"animation-class":"spf-animate", "animation-duration":425, "cache-lifetime":6E5, "cache-max":50, "cache-unified":!1, "link-class":"spf-link", "nolink-class":"spf-nolink", "navigate-limit":20, "navigate-lifetime":864E5, "reload-identifier":null, "request-timeout":0, "url-identifier":"?spf=__type__"}, $spf$config$values$$ = {}; +"config" in $spf$state$values_$$ || $spf$state$set$$("config", $spf$config$values$$); +$spf$config$values$$ = $spf$state$values_$$.config; +function $spf$array$each$$($arr$$10$$, $fn$$2$$) { + if ($arr$$10$$.forEach) { + $arr$$10$$.forEach($fn$$2$$, void 0); + } else { + for (var $i$$3$$ = 0, $l$$ = $arr$$10$$.length;$i$$3$$ < $l$$;$i$$3$$++) { + $i$$3$$ in $arr$$10$$ && $fn$$2$$.call(void 0, $arr$$10$$[$i$$3$$], $i$$3$$, $arr$$10$$); + } + } +} +function $spf$array$every$$($arr$$11$$, $fn$$3$$) { + if ($arr$$11$$.every) { + return $arr$$11$$.every($fn$$3$$, void 0); + } + for (var $i$$4$$ = 0, $l$$1$$ = $arr$$11$$.length;$i$$4$$ < $l$$1$$;$i$$4$$++) { + if ($i$$4$$ in $arr$$11$$ && !$fn$$3$$.call(void 0, $arr$$11$$[$i$$4$$], $i$$4$$, $arr$$11$$)) { + return!1; + } + } + return!0; +} +function $spf$array$filter$$($arr$$12$$, $fn$$4$$) { + if ($arr$$12$$.filter) { + return $arr$$12$$.filter($fn$$4$$, void 0); + } + var $res$$ = []; + $spf$array$each$$($arr$$12$$, function($a$$, $i$$5$$, $arr$$13$$) { + $fn$$4$$.call(void 0, $a$$, $i$$5$$, $arr$$13$$) && $res$$.push($a$$); + }); + return $res$$; +} +function $spf$array$map$$($arr$$15$$, $fn$$5$$) { + if ($arr$$15$$.map) { + return $arr$$15$$.map($fn$$5$$, void 0); + } + var $res$$1$$ = []; + $res$$1$$.length = $arr$$15$$.length; + $spf$array$each$$($arr$$15$$, function($a$$1$$, $i$$7$$, $arr$$16$$) { + $res$$1$$[$i$$7$$] = $fn$$5$$.call(void 0, $a$$1$$, $i$$7$$, $arr$$16$$); + }); + return $res$$1$$; +} +function $spf$array$toArray$$($val$$1$$) { + return "[object Array]" == Object.prototype.toString.call($val$$1$$) ? $val$$1$$ : [$val$$1$$]; +} +;function $spf$cache$remove$$($key$$21$$) { + var $storage$$2$$ = $spf$cache$storage_$$(); + $key$$21$$ in $storage$$2$$ && delete $storage$$2$$[$key$$21$$]; +} +function $spf$cache$collect$$() { + var $storage$$3_storage$$inline_21$$ = $spf$cache$storage_$$(), $extra$$inline_23_key$$22_max$$inline_22$$; + for ($extra$$inline_23_key$$22_max$$inline_22$$ in $storage$$3_storage$$inline_21$$) { + $spf$cache$valid_$$($storage$$3_storage$$inline_21$$[$extra$$inline_23_key$$22_max$$inline_22$$]) || delete $storage$$3_storage$$inline_21$$[$extra$$inline_23_key$$22_max$$inline_22$$]; + } + $storage$$3_storage$$inline_21$$ = $spf$cache$storage_$$(); + $extra$$inline_23_key$$22_max$$inline_22$$ = parseInt($spf$config$values$$["cache-max"], 10); + $extra$$inline_23_key$$22_max$$inline_22$$ = isNaN($extra$$inline_23_key$$22_max$$inline_22$$) ? Infinity : $extra$$inline_23_key$$22_max$$inline_22$$; + $extra$$inline_23_key$$22_max$$inline_22$$ = Object.keys($storage$$3_storage$$inline_21$$).length - $extra$$inline_23_key$$22_max$$inline_22$$; + if (!(0 >= $extra$$inline_23_key$$22_max$$inline_22$$)) { + for (var $i$$inline_24$$ = 0;$i$$inline_24$$ < $extra$$inline_23_key$$22_max$$inline_22$$;$i$$inline_24$$++) { + var $JSCompiler_object_inline_count_0$$inline_25$$ = Infinity, $JSCompiler_object_inline_key_1$$inline_26$$, $key$$inline_27$$; + for ($key$$inline_27$$ in $storage$$3_storage$$inline_21$$) { + $storage$$3_storage$$inline_21$$[$key$$inline_27$$].count < $JSCompiler_object_inline_count_0$$inline_25$$ && ($JSCompiler_object_inline_key_1$$inline_26$$ = $key$$inline_27$$, $JSCompiler_object_inline_count_0$$inline_25$$ = $storage$$3_storage$$inline_21$$[$key$$inline_27$$].count); + } + delete $storage$$3_storage$$inline_21$$[$JSCompiler_object_inline_key_1$$inline_26$$]; + } + } +} +function $spf$cache$valid_$$($unit$$2$$) { + if (!($unit$$2$$ && "data" in $unit$$2$$)) { + return!1; + } + var $lifetime$$1$$ = $unit$$2$$.life, $lifetime$$1$$ = isNaN($lifetime$$1$$) ? Infinity : $lifetime$$1$$; + return $spf$now$$() - $unit$$2$$.time < $lifetime$$1$$; +} +function $spf$cache$updateCount_$$($unit$$4$$) { + var $count$$8$$ = parseInt($spf$state$values_$$["cache-counter"], 10) || 0; + $count$$8$$++; + $spf$state$set$$("cache-counter", $count$$8$$); + $unit$$4$$.count = $count$$8$$; +} +function $spf$cache$storage_$$($opt_storage$$) { + return!$opt_storage$$ && "cache-storage" in $spf$state$values_$$ ? $spf$state$values_$$["cache-storage"] : $spf$state$set$$("cache-storage", $opt_storage$$ || {}); +} +;function $spf$debug$debug$$($var_args$$29$$) { + $spf$debug$isLevelEnabled$$($spf$debug$Level$DEBUG$$) && $spf$debug$log$$($spf$debug$Level$DEBUG$$, arguments); +} +function $spf$debug$info$$($var_args$$30$$) { + $spf$debug$isLevelEnabled$$($spf$debug$Level$INFO$$) && $spf$debug$log$$($spf$debug$Level$INFO$$, arguments); +} +function $spf$debug$warn$$($var_args$$31$$) { + $spf$debug$isLevelEnabled$$($spf$debug$Level$WARN$$) && $spf$debug$log$$($spf$debug$Level$WARN$$, arguments); +} +function $spf$debug$error$$($var_args$$32$$) { + $spf$debug$isLevelEnabled$$($spf$debug$Level$ERROR$$) && $spf$debug$log$$($spf$debug$Level$ERROR$$, arguments); +} +function $spf$debug$log$$($method$$1$$, $args$$2$$) { + if (window.console) { + $args$$2$$ = Array.prototype.slice.call($args$$2$$); + var $current$$ = $spf$now$$(), $overall$$ = $spf$debug$formatDuration$$($spf$debug$start_$$, $current$$); + $spf$debug$split_$$ ? $args$$2$$.unshift($overall$$ + "/" + $spf$debug$formatDuration$$($spf$debug$split_$$, $current$$) + ":") : $args$$2$$.unshift($overall$$ + ":"); + $spf$debug$direct_$$ ? ($args$$2$$.unshift("[spf]"), window.console[$method$$1$$].apply(window.console, $args$$2$$)) : ($args$$2$$.unshift("[spf - " + $method$$1$$ + "]"), window.console.log($args$$2$$.join(" "))); + } +} +function $spf$debug$formatDuration$$($start$$7$$, $end$$3$$) { + var $dur$$ = ($end$$3$$ - $start$$7$$) / 1E3; + $dur$$.toFixed && ($dur$$ = $dur$$.toFixed(3)); + return $dur$$ + "s"; +} +function $spf$debug$isLevelEnabled$$($level$$7$$) { + return $spf$debug$levels_$$[$level$$7$$] >= $spf$debug$levels_$$.debug; +} +var $spf$debug$start_$$ = $spf$now$$(), $spf$debug$split_$$ = 0, $spf$debug$direct_$$ = !(!window.console || !window.console.debug), $spf$debug$levels_$$ = {debug:1, info:2, warn:3, error:4}, $spf$debug$Level$DEBUG$$ = "debug", $spf$debug$Level$INFO$$ = "info", $spf$debug$Level$WARN$$ = "warn", $spf$debug$Level$ERROR$$ = "error"; +function $spf$dom$classlist$get$$($node$$2$$) { + return $node$$2$$.classList ? $node$$2$$.classList : $node$$2$$.className && $node$$2$$.className.match(/\S+/g) || []; +} +function $spf$dom$classlist$contains$$($node$$3$$, $cls$$) { + if ($node$$3$$.classList) { + return $node$$3$$.classList.contains($cls$$); + } + for (var $classes$$ = $spf$dom$classlist$get$$($node$$3$$), $i$$9$$ = 0, $l$$2$$ = $classes$$.length;$i$$9$$ < $l$$2$$;$i$$9$$++) { + if ($classes$$[$i$$9$$] == $cls$$) { + return!0; + } + } + return!1; +} +function $spf$dom$classlist$add$$($node$$4$$, $cls$$1$$) { + $node$$4$$.classList ? $node$$4$$.classList.add($cls$$1$$) : $spf$dom$classlist$contains$$($node$$4$$, $cls$$1$$) || ($node$$4$$.className += " " + $cls$$1$$); +} +function $spf$dom$classlist$remove$$($node$$5$$, $cls$$2$$) { + if ($node$$5$$.classList) { + $node$$5$$.classList.remove($cls$$2$$); + } else { + for (var $classes$$1$$ = $spf$dom$classlist$get$$($node$$5$$), $newClasses$$ = [], $i$$10$$ = 0, $l$$3$$ = $classes$$1$$.length;$i$$10$$ < $l$$3$$;$i$$10$$++) { + $classes$$1$$[$i$$10$$] != $cls$$2$$ && $newClasses$$.push($classes$$1$$[$i$$10$$]); + } + $node$$5$$.className = $newClasses$$.join(" "); + } +} +;function $spf$dom$query$$($selector$$1$$, $opt_document$$) { + var $doc$$ = $opt_document$$ || document; + return $doc$$.querySelectorAll ? $doc$$.querySelectorAll($selector$$1$$) : []; +} +function $spf$dom$flattenElement$$($element$$4$$) { + var $child$$1$$, $parent$$2$$ = $element$$4$$.parentNode; + if ($parent$$2$$ && 11 != $parent$$2$$.nodeType) { + if ($element$$4$$.removeNode) { + $element$$4$$.removeNode(!1); + } else { + for (;$child$$1$$ = $element$$4$$.firstChild;) { + $parent$$2$$.insertBefore($child$$1$$, $element$$4$$); + } + $parent$$2$$.removeChild($element$$4$$); + } + } +} +function $spf$dom$getAncestor$$($element$$6$$, $matcher$$, $opt_parent$$) { + for (;$element$$6$$;) { + if ($matcher$$($element$$6$$)) { + return $element$$6$$; + } + if ($opt_parent$$ && $element$$6$$ == $opt_parent$$) { + break; + } + $element$$6$$ = $element$$6$$.parentNode; + } + return null; +} +function $spf$dom$createIframe$$($id$$4_opt_id$$, $doc$$1_opt_document$$1$$, $opt_callback$$6$$) { + $id$$4_opt_id$$ = $id$$4_opt_id$$ || ""; + $doc$$1_opt_document$$1$$ = $doc$$1_opt_document$$1$$ || document; + var $iframeEl$$ = $doc$$1_opt_document$$1$$.createElement("iframe"); + $iframeEl$$.id = $id$$4_opt_id$$; + $iframeEl$$.src = 'javascript:""'; + $iframeEl$$.style.display = "none"; + $opt_callback$$6$$ && ($iframeEl$$.onload = $spf$bind$$($opt_callback$$6$$, null, $iframeEl$$)); + $doc$$1_opt_document$$1$$.body.appendChild($iframeEl$$); + return $iframeEl$$; +} +;function $spf$history$replace$$($opt_url$$4$$, $opt_state$$1$$, $opt_doCallback$$1$$, $opt_retainState$$) { + var $currentState$$ = window.history.state; + $opt_retainState$$ && $currentState$$ && ($opt_state$$1$$ = $opt_state$$1$$ || $currentState$$); + $spf$debug$info$$("history.replace ", $opt_url$$4$$); + $spf$history$push_$$(!0, $opt_url$$4$$, $opt_state$$1$$, $opt_doCallback$$1$$); +} +function $spf$history$push_$$($pushState$$inline_32_replace$$, $opt_url$$5_url$$11$$, $opt_state$$2_state$$, $callback$$36_opt_doCallback$$2$$) { + if ($opt_url$$5_url$$11$$ || $opt_state$$2_state$$) { + $opt_url$$5_url$$11$$ = $opt_url$$5_url$$11$$ || window.location.href; + $opt_state$$2_state$$ = $opt_state$$2_state$$ || {}; + var $timestamp$$1$$ = $spf$now$$(); + $spf$state$set$$("history-timestamp", $timestamp$$1$$); + $opt_state$$2_state$$["spf-timestamp"] = $timestamp$$1$$; + if ($pushState$$inline_32_replace$$) { + $spf$history$doReplaceState_$$($opt_state$$2_state$$, $opt_url$$5_url$$11$$), $spf$debug$debug$$(" replaceState: ", "url=", $opt_url$$5_url$$11$$, "state=", $opt_state$$2_state$$); + } else { + $pushState$$inline_32_replace$$ = $spf$history$getIframe$$().contentWindow.history.pushState; + if ("function" == typeof $pushState$$inline_32_replace$$) { + $pushState$$inline_32_replace$$.call(window.history, $opt_state$$2_state$$, "", $opt_url$$5_url$$11$$); + } else { + throw Error("history.pushState is not a function."); + } + $spf$debug$debug$$(" pushState: ", "url=", $opt_url$$5_url$$11$$, "state=", $opt_state$$2_state$$); + } + $spf$state$set$$("history-url", $opt_url$$5_url$$11$$); + $callback$$36_opt_doCallback$$2$$ && ($callback$$36_opt_doCallback$$2$$ = $spf$state$values_$$["history-callback"]) && $callback$$36_opt_doCallback$$2$$($opt_url$$5_url$$11$$, $opt_state$$2_state$$); + } +} +function $spf$history$pop_$$($evt$$22_state$$1$$) { + var $url$$12$$ = window.location.href; + $spf$debug$info$$("history.pop ", "url=", $url$$12$$, "evt=", $evt$$22_state$$1$$); + if ($spf$state$values_$$["history-ignore-pop"]) { + $spf$state$set$$("history-ignore-pop", !1); + } else { + if ($evt$$22_state$$1$$.state) { + $evt$$22_state$$1$$ = $evt$$22_state$$1$$.state; + var $callback$$37_timestamp$$2$$ = $evt$$22_state$$1$$["spf-timestamp"]; + $url$$12$$ == $spf$state$values_$$["history-url"] ? ($spf$state$set$$("history-timestamp", $callback$$37_timestamp$$2$$), $spf$history$doReplaceState_$$($evt$$22_state$$1$$, $url$$12$$), $spf$debug$debug$$(" replaceState: ", "url=", $url$$12$$, "state=", $evt$$22_state$$1$$)) : ($evt$$22_state$$1$$["spf-back"] = $callback$$37_timestamp$$2$$ < parseInt($spf$state$values_$$["history-timestamp"], 10), $evt$$22_state$$1$$["spf-current"] = $spf$state$values_$$["history-url"], $spf$state$set$$("history-timestamp", + $callback$$37_timestamp$$2$$), $spf$state$set$$("history-url", $url$$12$$), ($callback$$37_timestamp$$2$$ = $spf$state$values_$$["history-callback"]) && $callback$$37_timestamp$$2$$($url$$12$$, $evt$$22_state$$1$$)); + } + } +} +function $spf$history$doReplaceState_$$($data$$29$$, $opt_url$$7$$) { + var $replaceState$$ = $spf$history$getIframe$$().contentWindow.history.replaceState; + if ("function" == typeof $replaceState$$) { + $replaceState$$.call(window.history, $data$$29$$, "", $opt_url$$7$$); + } else { + throw Error("history.replaceState is not a function"); + } +} +function $spf$history$getIframe$$() { + var $frame$$ = document.getElementById("history-iframe"); + $frame$$ || ($frame$$ = $spf$dom$createIframe$$("history-iframe")); + return $frame$$; +} +;function $spf$net$xhr$send$$($addContentType_method$$2$$, $url$$15$$, $data$$31$$, $opt_options$$16$$) { + var $options$$3$$ = $opt_options$$16$$ || {}, $chunked$$ = !1, $offset$$14$$ = 0, $timer$$, $xhr$$ = new XMLHttpRequest; + $xhr$$.open($addContentType_method$$2$$, $url$$15$$, !0); + $xhr$$.timing = {}; + var $xhr_abort$$ = $xhr$$.abort; + $xhr$$.abort = function $$xhr$$$abort$() { + clearTimeout($timer$$); + $xhr$$.onreadystatechange = null; + $xhr_abort$$.call($xhr$$); + }; + $xhr$$.onreadystatechange = function $$xhr$$$onreadystatechange$() { + var $chunk_firefoxSpdy_timing$$ = $xhr$$.timing; + if ($xhr$$.readyState == $spf$net$xhr$State$HEADERS_RECEIVED$$) { + $chunk_firefoxSpdy_timing$$.responseStart = $chunk_firefoxSpdy_timing$$.responseStart || $spf$now$$(); + $chunked$$ = -1 < ($xhr$$.getResponseHeader("Transfer-Encoding") || "").toLowerCase().indexOf("chunked"); + if (!$chunked$$) { + var $chunk_firefoxSpdy_timing$$ = $xhr$$.getResponseHeader("X-Firefox-Spdy"), $chromeSpdy_loadTimes$$ = window.chrome && chrome.loadTimes && chrome.loadTimes(), $chromeSpdy_loadTimes$$ = $chromeSpdy_loadTimes$$ && $chromeSpdy_loadTimes$$.wasFetchedViaSpdy; + $chunked$$ = !(!$chunk_firefoxSpdy_timing$$ && !$chromeSpdy_loadTimes$$); + } + $options$$3$$.$onHeaders$ && $options$$3$$.$onHeaders$($xhr$$); + } else { + $xhr$$.readyState == $spf$net$xhr$State$LOADING$$ ? $chunked$$ && $options$$3$$.$onChunk$ && ($chunk_firefoxSpdy_timing$$ = $xhr$$.responseText.substring($offset$$14$$), $offset$$14$$ = $xhr$$.responseText.length, $options$$3$$.$onChunk$($xhr$$, $chunk_firefoxSpdy_timing$$)) : $xhr$$.readyState == $spf$net$xhr$State$DONE$$ && ($chunk_firefoxSpdy_timing$$.responseEnd = $chunk_firefoxSpdy_timing$$.responseEnd || $spf$now$$(), window.performance && window.performance.getEntriesByName && ($xhr$$.resourceTiming = + window.performance.getEntriesByName($url$$15$$)[0]), $chunked$$ && $options$$3$$.$onChunk$ && $xhr$$.responseText.length > $offset$$14$$ && ($chunk_firefoxSpdy_timing$$ = $xhr$$.responseText.substring($offset$$14$$), $offset$$14$$ = $xhr$$.responseText.length, $options$$3$$.$onChunk$($xhr$$, $chunk_firefoxSpdy_timing$$)), clearTimeout($timer$$), $options$$3$$.$onDone$ && $options$$3$$.$onDone$($xhr$$)); + } + }; + $addContentType_method$$2$$ = "POST" == $addContentType_method$$2$$; + if ($options$$3$$.headers) { + for (var $key$$25$$ in $options$$3$$.headers) { + $xhr$$.setRequestHeader($key$$25$$, $options$$3$$.headers[$key$$25$$]), "content-type" == $key$$25$$.toLowerCase() && ($addContentType_method$$2$$ = !1); + } + } + $addContentType_method$$2$$ && $xhr$$.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + 0 < $options$$3$$.$timeoutMs$ && ($timer$$ = setTimeout(function() { + $xhr$$.abort(); + $options$$3$$.$onTimeout$ && $options$$3$$.$onTimeout$($xhr$$); + }, $options$$3$$.$timeoutMs$)); + $xhr$$.timing.fetchStart = $spf$now$$(); + $xhr$$.send($data$$31$$); + return $xhr$$; +} +var $spf$net$xhr$State$HEADERS_RECEIVED$$ = 2, $spf$net$xhr$State$LOADING$$ = 3, $spf$net$xhr$State$DONE$$ = 4; +function $spf$pubsub$subscribe$$($topic$$, $fn$$6$$) { + $topic$$ && $fn$$6$$ && ($topic$$ in $spf$pubsub$subscriptions$$ || ($spf$pubsub$subscriptions$$[$topic$$] = []), $spf$pubsub$subscriptions$$[$topic$$].push($fn$$6$$)); +} +function $spf$pubsub$unsubscribe$$($topic$$1$$, $fn$$7$$) { + $topic$$1$$ in $spf$pubsub$subscriptions$$ && $fn$$7$$ && $spf$array$every$$($spf$pubsub$subscriptions$$[$topic$$1$$], function($subFn$$, $i$$11$$, $arr$$17$$) { + return $subFn$$ == $fn$$7$$ ? ($arr$$17$$[$i$$11$$] = null, !1) : !0; + }); +} +function $spf$pubsub$publish_$$($topic$$4$$) { + $topic$$4$$ in $spf$pubsub$subscriptions$$ && $spf$array$each$$($spf$pubsub$subscriptions$$[$topic$$4$$], function($subFn$$1$$, $i$$12$$, $arr$$18$$) { + $arr$$18$$[$i$$12$$] = null; + $subFn$$1$$ && $subFn$$1$$(); + }); +} +var $spf$pubsub$subscriptions$$ = {}; +"ps-s" in $spf$state$values_$$ || $spf$state$set$$("ps-s", $spf$pubsub$subscriptions$$); +$spf$pubsub$subscriptions$$ = $spf$state$values_$$["ps-s"]; +function $spf$string$endsWith$$($str$$9$$, $suffix$$) { + var $l$$4$$ = $str$$9$$.length - $suffix$$.length; + return 0 <= $l$$4$$ && $str$$9$$.indexOf($suffix$$, $l$$4$$) == $l$$4$$; +} +var $spf$string$trim$$ = String.prototype.trim ? function($str$$10$$) { + return $str$$10$$.trim(); +} : function($str$$11$$) { + return $str$$11$$.replace(/^\s+|\s+$/g, ""); +}; +function $spf$string$partition$$($arr$$19_str$$12$$) { + $arr$$19_str$$12$$ = $arr$$19_str$$12$$.split("#"); + var $nosep$$ = 1 == $arr$$19_str$$12$$.length; + return[$arr$$19_str$$12$$[0], $nosep$$ ? "" : "#", $nosep$$ ? "" : $arr$$19_str$$12$$.slice(1).join("#")]; +} +;function $spf$url$utils$$($url$$16_utils$$) { + var $aEl$$ = document.createElement("a"); + $aEl$$.href = $url$$16_utils$$; + $aEl$$.href = $aEl$$.href; + $url$$16_utils$$ = {href:$aEl$$.href, protocol:$aEl$$.protocol, host:$aEl$$.host, hostname:$aEl$$.hostname, port:$aEl$$.port, pathname:$aEl$$.pathname, search:$aEl$$.search, hash:$aEl$$.hash, $username$:$aEl$$.$username$, $password$:$aEl$$.$password$}; + $url$$16_utils$$.origin = $url$$16_utils$$.protocol + "//" + $url$$16_utils$$.host; + $url$$16_utils$$.pathname && "/" == $url$$16_utils$$.pathname[0] || ($url$$16_utils$$.pathname = "/" + $url$$16_utils$$.pathname); + return $url$$16_utils$$; +} +function $spf$url$absolute$$($relative$$, $opt_keepHash$$) { + var $utils$$1$$ = $spf$url$utils$$($relative$$); + return $opt_keepHash$$ ? $utils$$1$$.href : $spf$string$partition$$($utils$$1$$.href)[0]; +} +function $spf$url$removeParameters$$($url$$21$$, $parameters$$1$$) { + var $result$$3$$ = $spf$string$partition$$($url$$21$$); + $url$$21$$ = $result$$3$$[0]; + for (var $i$$14$$ = 0;$i$$14$$ < $parameters$$1$$.length;$i$$14$$++) { + $url$$21$$ = $url$$21$$.replace(new RegExp("([?&])" + $parameters$$1$$[$i$$14$$] + "(?:=[^&]*)?(?:(?=[&])|$)", "g"), function($_$$, $delim$$1$$) { + return "?" == $delim$$1$$ ? $delim$$1$$ : ""; + }); + } + $spf$string$endsWith$$($url$$21$$, "?") && ($url$$21$$ = $url$$21$$.slice(0, -1)); + return $url$$21$$ + $result$$3$$[1] + $result$$3$$[2]; +} +;function $spf$tasks$add$$($key$$27$$, $fn$$8$$, $opt_delay$$) { + var $queue$$ = $spf$tasks$queues_$$[$key$$27$$]; + return $key$$27$$ && $fn$$8$$ ? ($queue$$ || ($queue$$ = $spf$tasks$queues_$$[$key$$27$$] = {items:[], $scheduledKey$:0, $timeoutKey$:0, $semaphore$:1}), $queue$$.items.push({$fn$:$fn$$8$$, $delay$:$opt_delay$$ || 0})) : $queue$$ && $queue$$.items.length || 0; +} +function $spf$tasks$run$$($key$$28$$, $opt_sync$$) { + var $queue$$1$$ = $spf$tasks$queues_$$[$key$$28$$]; + if ($queue$$1$$) { + var $active$$ = !!$queue$$1$$.$scheduledKey$ || !!$queue$$1$$.$timeoutKey$; + 0 < $queue$$1$$.$semaphore$ && ($opt_sync$$ || !$active$$) && $spf$tasks$do_$$($key$$28$$, $opt_sync$$); + } +} +function $spf$tasks$suspend$$($key$$29_queue$$2$$) { + ($key$$29_queue$$2$$ = $spf$tasks$queues_$$[$key$$29_queue$$2$$]) && $key$$29_queue$$2$$.$semaphore$--; +} +function $spf$tasks$resume$$($key$$30$$, $opt_sync$$1$$) { + var $queue$$3$$ = $spf$tasks$queues_$$[$key$$30$$]; + $queue$$3$$ && ($queue$$3$$.$semaphore$++, $spf$tasks$run$$($key$$30$$, $opt_sync$$1$$)); +} +function $spf$tasks$cancel$$($key$$31$$) { + var $queue$$4$$ = $spf$tasks$queues_$$[$key$$31$$]; + $queue$$4$$ && ($spf$tasks$clearAsyncTasks_$$($queue$$4$$), delete $spf$tasks$queues_$$[$key$$31$$]); +} +function $spf$tasks$key$$($obj$$20$$) { + var $uid$$ = parseInt($spf$state$values_$$.uid, 10) || 0; + $uid$$++; + return $obj$$20$$["spf-key"] || ($obj$$20$$["spf-key"] = "" + $spf$state$set$$("uid", $uid$$)); +} +function $spf$tasks$do_$$($key$$33$$, $opt_sync$$2$$) { + var $queue$$5$$ = $spf$tasks$queues_$$[$key$$33$$]; + if ($queue$$5$$ && ($spf$tasks$clearAsyncTasks_$$($queue$$5$$), 0 < $queue$$5$$.$semaphore$ && $queue$$5$$.items.length)) { + var $task$$1$$ = $queue$$5$$.items[0]; + if ($task$$1$$) { + var $step$$ = $spf$bind$$(function($nextFn$$, $taskFn$$) { + $taskFn$$(); + $nextFn$$(); + }, null, $spf$bind$$($spf$tasks$do_$$, null, $key$$33$$, $opt_sync$$2$$)); + $opt_sync$$2$$ ? ($queue$$5$$.items.shift(), $step$$($task$$1$$.$fn$)) : $spf$tasks$scheduleTask_$$($queue$$5$$, $task$$1$$, $step$$); + } + } +} +function $spf$tasks$scheduleTask_$$($queue$$6$$, $addTask_scheduler_task$$2$$, $fn$$9_step$$1$$) { + $addTask_scheduler_task$$2$$.$delay$ ? ($fn$$9_step$$1$$ = $spf$bind$$($fn$$9_step$$1$$, null, $spf$nullFunction$$), $queue$$6$$.$timeoutKey$ = setTimeout($fn$$9_step$$1$$, $addTask_scheduler_task$$2$$.$delay$), $addTask_scheduler_task$$2$$.$delay$ = 0) : ($queue$$6$$.items.shift(), $fn$$9_step$$1$$ = $spf$bind$$($fn$$9_step$$1$$, null, $addTask_scheduler_task$$2$$.$fn$), ($addTask_scheduler_task$$2$$ = ($addTask_scheduler_task$$2$$ = $spf$config$values$$["advanced-task-scheduler"]) && $addTask_scheduler_task$$2$$.addTask) ? + $queue$$6$$.$scheduledKey$ = $addTask_scheduler_task$$2$$($fn$$9_step$$1$$) : $queue$$6$$.$timeoutKey$ = setTimeout($fn$$9_step$$1$$, 0)); +} +function $spf$tasks$clearAsyncTasks_$$($queue$$7$$) { + if ($queue$$7$$.$scheduledKey$) { + var $cancelTask_scheduler$$1$$ = $spf$config$values$$["advanced-task-scheduler"]; + ($cancelTask_scheduler$$1$$ = $cancelTask_scheduler$$1$$ && $cancelTask_scheduler$$1$$.cancelTask) && $cancelTask_scheduler$$1$$($queue$$7$$.$scheduledKey$); + $queue$$7$$.$scheduledKey$ = 0; + } + $queue$$7$$.$timeoutKey$ && (clearTimeout($queue$$7$$.$timeoutKey$), $queue$$7$$.$timeoutKey$ = 0); +} +var $spf$tasks$queues_$$ = {}; +function $spf$net$resource$load$$($el$$1_type$$73$$, $url$$24$$, $name$$52$$, $check_opt_fn$$) { + $spf$debug$debug$$("resource.load", $el$$1_type$$73$$, $url$$24$$, $name$$52$$); + var $isJS_key$$inline_36_prevName$$ = $el$$1_type$$73$$ == $spf$net$resource$Type$JS$$; + $url$$24$$ = $spf$net$resource$canonicalize$$($el$$1_type$$73$$, $url$$24$$); + var $pseudonym$$ = $name$$52$$ || "^" + $url$$24$$, $topic$$6$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $pseudonym$$), $prevUrl$$; + $name$$52$$ && ($prevUrl$$ = $spf$net$resource$url$get$$($el$$1_type$$73$$, $name$$52$$)) && $url$$24$$ != $prevUrl$$ && ($spf$dispatch$$($isJS_key$$inline_36_prevName$$ ? "spfjsbeforeunload" : "spfcssbeforeunload", {name:$name$$52$$, url:$prevUrl$$}), $spf$net$resource$unloadPrepare_$$($el$$1_type$$73$$, $name$$52$$, $prevUrl$$), $spf$pubsub$subscribe$$($topic$$6$$, $spf$bind$$($spf$net$resource$unloadComplete_$$, null, $el$$1_type$$73$$, $name$$52$$, $prevUrl$$))); + $isJS_key$$inline_36_prevName$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $url$$24$$); + if (($isJS_key$$inline_36_prevName$$ = $spf$net$resource$name_$$[$isJS_key$$inline_36_prevName$$]) && $pseudonym$$ != $isJS_key$$inline_36_prevName$$) { + var $key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $isJS_key$$inline_36_prevName$$); + delete $spf$net$resource$url_$$[$key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$]; + $key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $url$$24$$); + delete $spf$net$resource$name_$$[$key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$]; + ($key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $isJS_key$$inline_36_prevName$$)) && $topic$$6$$ && $key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$ in $spf$pubsub$subscriptions$$ && ($spf$pubsub$subscriptions$$[$topic$$6$$] = ($spf$pubsub$subscriptions$$[$topic$$6$$] || []).concat($spf$pubsub$subscriptions$$[$key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$]), delete $spf$pubsub$subscriptions$$[$key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$]); + } + $key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$ = $spf$net$resource$key$$($el$$1_type$$73$$, $url$$24$$); + $spf$net$resource$name_$$[$key$$inline_40_key$$inline_44_key$$inline_52_oldTopic$$inline_46$$] = $pseudonym$$; + $spf$net$resource$url$set$$($el$$1_type$$73$$, $pseudonym$$, $url$$24$$); + $spf$debug$debug$$(" subscribing callback", $topic$$6$$); + $spf$pubsub$subscribe$$($topic$$6$$, $check_opt_fn$$); + $check_opt_fn$$ = $spf$bind$$($spf$net$resource$check$$, null, $el$$1_type$$73$$); + $spf$net$resource$status$get$$($el$$1_type$$73$$, $url$$24$$) ? ($isJS_key$$inline_36_prevName$$ && $pseudonym$$ != $isJS_key$$inline_36_prevName$$ && ($el$$1_type$$73$$ = $spf$net$resource$find$$($el$$1_type$$73$$, $url$$24$$)) && $el$$1_type$$73$$.setAttribute("name", $name$$52$$ || ""), $check_opt_fn$$()) : ($el$$1_type$$73$$ = $spf$net$resource$create$$($el$$1_type$$73$$, $url$$24$$, $check_opt_fn$$, void 0, void 0, $prevUrl$$)) && $name$$52$$ && $el$$1_type$$73$$.setAttribute("name", $name$$52$$); +} +function $spf$net$resource$unload$$($type$$74$$, $name$$53$$) { + $spf$debug$warn$$("resource.unload", $type$$74$$, $name$$53$$); + var $url$$25$$ = $spf$net$resource$url$get$$($type$$74$$, $name$$53$$); + $spf$net$resource$unloadPrepare_$$($type$$74$$, $name$$53$$, $url$$25$$); + $spf$net$resource$unloadComplete_$$($type$$74$$, $name$$53$$, $url$$25$$); +} +function $spf$net$resource$unloadPrepare_$$($topic$$7_type$$75$$, $name$$54$$, $key$$inline_60_url$$26$$) { + $spf$debug$debug$$(" > resource.unloadPrepare_", $topic$$7_type$$75$$, $key$$inline_60_url$$26$$); + var $key$$inline_56$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $name$$54$$); + delete $spf$net$resource$url_$$[$key$$inline_56$$]; + $key$$inline_60_url$$26$$ && ($key$$inline_60_url$$26$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $key$$inline_60_url$$26$$), delete $spf$net$resource$name_$$[$key$$inline_60_url$$26$$]); + $topic$$7_type$$75$$ = $spf$net$resource$key$$($topic$$7_type$$75$$, $name$$54$$); + $spf$debug$debug$$(" clearing callbacks for", $topic$$7_type$$75$$); + delete $spf$pubsub$subscriptions$$[$topic$$7_type$$75$$]; +} +function $spf$net$resource$unloadComplete_$$($type$$76$$, $name$$55$$, $url$$27$$) { + var $isJS$$1$$ = $type$$76$$ == $spf$net$resource$Type$JS$$; + $url$$27$$ && ($spf$debug$debug$$(" > resource.unloadComplete_", $type$$76$$, $url$$27$$), $spf$dispatch$$($isJS$$1$$ ? "spfjsunload" : "spfcssunload", {name:$name$$55$$, url:$url$$27$$}), $spf$net$resource$destroy$$($type$$76$$, $url$$27$$)); +} +function $spf$net$resource$check$$($type$$77$$) { + $spf$debug$debug$$("resource.check", $type$$77$$); + var $prefix$$4$$ = $spf$net$resource$key$$($type$$77$$, ""), $topic$$8$$; + for ($topic$$8$$ in $spf$pubsub$subscriptions$$) { + if (0 == $topic$$8$$.indexOf($prefix$$4$$)) { + var $names$$ = $topic$$8$$.substring($prefix$$4$$.length).split("|"), $ready$$ = $spf$array$every$$($names$$, $spf$bind$$($spf$net$resource$url$loaded$$, null, $type$$77$$)); + $spf$debug$debug$$(" ", $topic$$8$$, "->", $names$$, "=", $ready$$); + $ready$$ && ($spf$debug$debug$$(" publishing", $topic$$8$$), $spf$pubsub$publish_$$($topic$$8$$)); + } + } +} +function $spf$net$resource$create$$($type$$78$$, $url$$28$$, $opt_callback$$7$$, $opt_document$$2_prevEl$$, $opt_statusGroup$$, $opt_prevUrl$$) { + function $next$$1$$() { + $spf$debug$debug$$("resource.create", $type$$78$$, $url$$28$$, "done"); + $spf$net$resource$status$get$$($type$$78$$, $url$$28$$, $opt_statusGroup$$) && ($spf$debug$debug$$("resource.create", $type$$78$$, $url$$28$$, "loaded"), $spf$net$resource$status$set$$($spf$net$resource$State$LOADED$$, $type$$78$$, $url$$28$$, $opt_statusGroup$$)); + $opt_callback$$7$$ && setTimeout($opt_callback$$7$$, 0); + return null; + } + $spf$debug$debug$$("resource.create", $type$$78$$, $url$$28$$, "loading"); + var $isJS$$2$$ = $type$$78$$ == $spf$net$resource$Type$JS$$; + $url$$28$$ = $spf$net$resource$canonicalize$$($type$$78$$, $url$$28$$); + $spf$net$resource$status$set$$($spf$net$resource$State$LOADING$$, $type$$78$$, $url$$28$$, $opt_statusGroup$$); + var $doc$$2_head$$ = $opt_document$$2_prevEl$$ || document, $el$$2$$ = $doc$$2_head$$.createElement($isJS$$2$$ ? "script" : "link"); + if (!$url$$28$$) { + return $next$$1$$(); + } + var $label$$4$$ = $spf$net$resource$label$$($url$$28$$); + $el$$2$$.className = $spf$net$resource$key$$($type$$78$$, $label$$4$$); + "onload" in $el$$2$$ ? $el$$2$$.onerror = $el$$2$$.onload = $next$$1$$ : $el$$2$$.onreadystatechange = function $$el$$2$$$onreadystatechange$() { + /^c|loade/.test($el$$2$$.readyState) && $next$$1$$(); + }; + $doc$$2_head$$ = $doc$$2_head$$.getElementsByTagName("head")[0]; + $isJS$$2$$ ? ($el$$2$$.async = !0, $el$$2$$.src = $url$$28$$, $doc$$2_head$$.insertBefore($el$$2$$, $doc$$2_head$$.firstChild)) : ($el$$2$$.rel = "stylesheet", $el$$2$$.href = $url$$28$$, $opt_document$$2_prevEl$$ = $opt_prevUrl$$ && $spf$net$resource$find$$($type$$78$$, $opt_prevUrl$$, $opt_document$$2_prevEl$$), $doc$$2_head$$.insertBefore($el$$2$$, $opt_document$$2_prevEl$$)); + return $el$$2$$; +} +function $spf$net$resource$destroy$$($type$$79$$, $url$$29$$) { + $url$$29$$ = $spf$net$resource$canonicalize$$($type$$79$$, $url$$29$$); + var $el$$3_key$$inline_66$$ = $spf$net$resource$find$$($type$$79$$, $url$$29$$, void 0); + $el$$3_key$$inline_66$$ && $el$$3_key$$inline_66$$.parentNode && $el$$3_key$$inline_66$$.parentNode.removeChild($el$$3_key$$inline_66$$); + $el$$3_key$$inline_66$$ = $spf$net$resource$key$$($type$$79$$, $url$$29$$); + delete $spf$net$resource$status_$$[$el$$3_key$$inline_66$$]; +} +function $spf$net$resource$find$$($cls$$3_type$$80$$, $label$$5_url$$30$$, $opt_document$$4$$) { + $label$$5_url$$30$$ = $spf$net$resource$label$$($label$$5_url$$30$$); + $cls$$3_type$$80$$ = $spf$net$resource$key$$($cls$$3_type$$80$$, $label$$5_url$$30$$); + return $spf$dom$query$$("." + $cls$$3_type$$80$$, $opt_document$$4$$)[0]; +} +function $spf$net$resource$discover$$($type$$81$$) { + $spf$debug$debug$$("resource.discover", $type$$81$$); + var $isJS$$3$$ = $type$$81$$ == $spf$net$resource$Type$JS$$, $els$$1$$ = []; + $spf$array$each$$($spf$dom$query$$($isJS$$3$$ ? "script[src]" : 'link[rel~="stylesheet"]'), function($el$$4$$) { + var $url$$31$$ = $isJS$$3$$ ? $el$$4$$.src : $el$$4$$.href, $url$$31$$ = $spf$net$resource$canonicalize$$($type$$81$$, $url$$31$$); + if (!$spf$net$resource$status$get$$($type$$81$$, $url$$31$$)) { + $spf$net$resource$status$set$$($spf$net$resource$State$LOADED$$, $type$$81$$, $url$$31$$); + var $cls$$4_label$$6$$ = $spf$net$resource$label$$($url$$31$$), $cls$$4_label$$6$$ = $spf$net$resource$key$$($type$$81$$, $cls$$4_label$$6$$); + $spf$dom$classlist$add$$($el$$4$$, $cls$$4_label$$6$$); + var $name$$56$$ = $el$$4$$.getAttribute("name"); + if ($name$$56$$) { + var $key$$inline_71$$ = $spf$net$resource$key$$($type$$81$$, $url$$31$$); + $spf$net$resource$name_$$[$key$$inline_71$$] = $name$$56$$; + $spf$net$resource$url$set$$($type$$81$$, $name$$56$$, $url$$31$$); + } + $els$$1$$.push($el$$4$$); + $spf$debug$debug$$(" found", $url$$31$$, $cls$$4_label$$6$$, $name$$56$$); + } + }); +} +function $spf$net$resource$prefetch$$($type$$82$$, $url$$32$$) { + if ($url$$32$$ && ($url$$32$$ = $spf$net$resource$canonicalize$$($type$$82$$, $url$$32$$), !$spf$net$resource$status$get$$($type$$82$$, $url$$32$$))) { + var $el$$5_label$$7$$ = $spf$net$resource$label$$($url$$32$$), $id$$5_next$$2$$ = $spf$net$resource$key$$($type$$82$$, $el$$5_label$$7$$), $key$$34$$ = $spf$net$resource$key$$($type$$82$$, "prefetch"), $el$$5_label$$7$$ = document.getElementById($key$$34$$); + if (!$el$$5_label$$7$$) { + $el$$5_label$$7$$ = $spf$dom$createIframe$$($key$$34$$, null, function($el$$6$$) { + $el$$6$$.title = $key$$34$$; + $spf$tasks$run$$($key$$34$$, !0); + }); + } else { + if ($el$$5_label$$7$$.contentWindow.document.getElementById($id$$5_next$$2$$)) { + return; + } + } + $id$$5_next$$2$$ = $spf$bind$$($spf$net$resource$prefetch_$$, null, $el$$5_label$$7$$, $type$$82$$, $url$$32$$, $id$$5_next$$2$$, $key$$34$$); + $el$$5_label$$7$$.title ? $id$$5_next$$2$$() : $spf$tasks$add$$($key$$34$$, $id$$5_next$$2$$); + } +} +function $spf$net$resource$prefetch_$$($doc$$3_el$$7$$, $fetchEl_type$$83$$, $url$$33$$, $id$$6$$, $group$$) { + var $isCSS$$ = $fetchEl_type$$83$$ == $spf$net$resource$Type$CSS$$; + $doc$$3_el$$7$$ = $doc$$3_el$$7$$.contentWindow.document; + $fetchEl_type$$83$$ == $spf$net$resource$Type$JS$$ ? ($fetchEl_type$$83$$ = $doc$$3_el$$7$$.createElement("object"), $spf$net$resource$IS_IE$$ ? $doc$$3_el$$7$$.createElement("script").src = $url$$33$$ : $fetchEl_type$$83$$.data = $url$$33$$, $fetchEl_type$$83$$.id = $id$$6$$, $doc$$3_el$$7$$.body.appendChild($fetchEl_type$$83$$)) : $isCSS$$ ? ($fetchEl_type$$83$$ = $spf$net$resource$create$$($fetchEl_type$$83$$, $url$$33$$, null, $doc$$3_el$$7$$, $group$$), $fetchEl_type$$83$$.id = $id$$6$$) : + ($fetchEl_type$$83$$ = $doc$$3_el$$7$$.createElement("img"), $fetchEl_type$$83$$.src = $url$$33$$, $fetchEl_type$$83$$.id = $id$$6$$, $doc$$3_el$$7$$.body.appendChild($fetchEl_type$$83$$)); +} +function $spf$net$resource$eval$$($type$$84$$, $el$$8_text$$10$$, $name$$57$$) { + for (var $previous$$ = $spf$net$resource$url$get$$($type$$84$$, $name$$57$$), $cls$$5_id$$7_label$$8_str$$inline_73$$ = $el$$8_text$$10$$.replace(/\s/g, ""), $cls$$5_id$$7_label$$8_str$$inline_73$$ = $cls$$5_id$$7_label$$8_str$$inline_73$$ || "", $result$$inline_74$$ = 0, $i$$inline_75$$ = 0, $l$$inline_76$$ = $cls$$5_id$$7_label$$8_str$$inline_73$$.length;$i$$inline_75$$ < $l$$inline_76$$;++$i$$inline_75$$) { + $result$$inline_74$$ = 31 * $result$$inline_74$$ + $cls$$5_id$$7_label$$8_str$$inline_73$$.charCodeAt($i$$inline_75$$), $result$$inline_74$$ %= 4294967296; + } + $cls$$5_id$$7_label$$8_str$$inline_73$$ = "hash-" + $result$$inline_74$$; + $spf$net$resource$url$set$$($type$$84$$, $name$$57$$, $cls$$5_id$$7_label$$8_str$$inline_73$$); + !$spf$net$resource$status$loaded$$($type$$84$$, $cls$$5_id$$7_label$$8_str$$inline_73$$) && ($el$$8_text$$10$$ = $spf$net$resource$exec$$($type$$84$$, $el$$8_text$$10$$)) && ($spf$net$resource$status$set$$($spf$net$resource$State$LOADED$$, $type$$84$$, $cls$$5_id$$7_label$$8_str$$inline_73$$), $el$$8_text$$10$$ && ($cls$$5_id$$7_label$$8_str$$inline_73$$ = $spf$net$resource$label$$($cls$$5_id$$7_label$$8_str$$inline_73$$), $cls$$5_id$$7_label$$8_str$$inline_73$$ = $spf$net$resource$key$$($type$$84$$, + $cls$$5_id$$7_label$$8_str$$inline_73$$), $el$$8_text$$10$$.className = $cls$$5_id$$7_label$$8_str$$inline_73$$, $el$$8_text$$10$$.setAttribute("name", $name$$57$$)), ($previous$$ = $previous$$ && $previous$$[0]) && $spf$net$resource$destroy$$($type$$84$$, $previous$$)); +} +function $spf$net$resource$exec$$($type$$85$$, $text$$11$$) { + $text$$11$$ = $spf$string$trim$$($text$$11$$); + if (!$text$$11$$) { + return null; + } + var $targetEl$$ = document.getElementsByTagName("head")[0] || document.body, $el$$9$$; + $type$$85$$ == $spf$net$resource$Type$JS$$ ? ($el$$9$$ = document.createElement("script"), $el$$9$$.text = $text$$11$$, $targetEl$$.appendChild($el$$9$$)) : ($el$$9$$ = document.createElement("style"), $targetEl$$.appendChild($el$$9$$), "styleSheet" in $el$$9$$ ? $el$$9$$.styleSheet.cssText = $text$$11$$ : $el$$9$$.appendChild(document.createTextNode($text$$11$$))); + return $el$$9$$; +} +function $spf$net$resource$canonicalize$$($type$$87$$, $url$$34$$) { + var $key$$36_paths$$1$$ = "rsrc-p-" + $type$$87$$; + if ($url$$34$$) { + var $index$$45$$ = $url$$34$$.indexOf("//"); + if (0 > $index$$45$$) { + if (0 == $url$$34$$.lastIndexOf("hash-", 0)) { + return $url$$34$$; + } + $key$$36_paths$$1$$ = $spf$state$values_$$[$key$$36_paths$$1$$] || ""; + if ("[object String]" == Object.prototype.toString.call($key$$36_paths$$1$$)) { + $url$$34$$ = $key$$36_paths$$1$$ + $url$$34$$; + } else { + for (var $p$$ in $key$$36_paths$$1$$) { + $url$$34$$ = $url$$34$$.replace($p$$, $key$$36_paths$$1$$[$p$$]); + } + } + $url$$34$$ = 0 > $url$$34$$.indexOf("." + $type$$87$$) ? $url$$34$$ + "." + $type$$87$$ : $url$$34$$; + $url$$34$$ = $spf$url$absolute$$($url$$34$$); + } else { + 0 == $index$$45$$ && ($url$$34$$ = $spf$url$absolute$$($url$$34$$)); + } + } + return $url$$34$$; +} +function $spf$net$resource$key$$($type$$88$$, $label$$9$$, $opt_group$$) { + return $type$$88$$ + "-" + $label$$9$$ + ($opt_group$$ ? "-" + $opt_group$$ : ""); +} +function $spf$net$resource$label$$($url$$35$$) { + return $url$$35$$ ? String($url$$35$$).replace(/[^\w]/g, "") : ""; +} +function $spf$net$resource$status$set$$($status$$, $key$$37_type$$89$$, $url$$36$$, $opt_group$$1$$) { + $key$$37_type$$89$$ = $spf$net$resource$key$$($key$$37_type$$89$$, $url$$36$$, $opt_group$$1$$); + $spf$net$resource$status_$$[$key$$37_type$$89$$] = $status$$; +} +function $spf$net$resource$status$get$$($key$$38_type$$90$$, $url$$37$$, $opt_group$$2$$) { + $key$$38_type$$90$$ = $spf$net$resource$key$$($key$$38_type$$90$$, $url$$37$$, $opt_group$$2$$); + return $spf$net$resource$status_$$[$key$$38_type$$90$$]; +} +function $spf$net$resource$status$loaded$$($type$$92$$, $url$$39$$) { + var $status$$1$$ = $spf$net$resource$status$get$$($type$$92$$, $url$$39$$); + return "" == $url$$39$$ || $status$$1$$ == $spf$net$resource$State$LOADED$$; +} +function $spf$net$resource$url$set$$($key$$43_type$$96$$, $name$$59$$, $url$$43$$) { + $key$$43_type$$96$$ = $spf$net$resource$key$$($key$$43_type$$96$$, $name$$59$$); + $spf$net$resource$url_$$[$key$$43_type$$96$$] = $url$$43$$; +} +function $spf$net$resource$url$get$$($type$$97$$, $name$$60$$) { + var $key$$44$$ = $spf$net$resource$key$$($type$$97$$, $name$$60$$); + return $spf$net$resource$url_$$[$key$$44$$]; +} +function $spf$net$resource$url$loaded$$($type$$99$$, $name$$62$$) { + var $url$$45$$ = $spf$net$resource$url$get$$($type$$99$$, $name$$62$$); + return void 0 != $url$$45$$ && $spf$net$resource$status$loaded$$($type$$99$$, $url$$45$$); +} +var $spf$net$resource$status_$$ = {}, $spf$net$resource$name_$$ = {}, $spf$net$resource$url_$$ = {}, $spf$net$resource$IS_IE$$ = -1 != navigator.userAgent.indexOf(" Trident/"), $spf$net$resource$State$LOADING$$ = 1, $spf$net$resource$State$LOADED$$ = 2, $spf$net$resource$Type$CSS$$ = "css", $spf$net$resource$Type$JS$$ = "js"; +"rsrc-s" in $spf$state$values_$$ || $spf$state$set$$("rsrc-s", $spf$net$resource$status_$$); +$spf$net$resource$status_$$ = $spf$state$values_$$["rsrc-s"]; +"rsrc-n" in $spf$state$values_$$ || $spf$state$set$$("rsrc-n", $spf$net$resource$name_$$); +$spf$net$resource$name_$$ = $spf$state$values_$$["rsrc-n"]; +"rsrc-u" in $spf$state$values_$$ || $spf$state$set$$("rsrc-u", $spf$net$resource$url_$$); +$spf$net$resource$url_$$ = $spf$state$values_$$["rsrc-u"]; +function $spf$net$connect$preconnect$$($urls$$) { + $urls$$ = $spf$array$toArray$$($urls$$); + $spf$array$each$$($urls$$, function($url$$46$$) { + $spf$net$resource$prefetch$$("img", $url$$46$$); + }); +} +;function $spf$net$script$load$$($url$$47$$, $name$$63$$, $opt_fn$$1$$) { + $spf$net$resource$load$$($spf$net$resource$Type$JS$$, $url$$47$$, $name$$63$$, $opt_fn$$1$$); +} +function $spf$net$script$unload$$($name$$64$$) { + $spf$net$resource$unload$$($spf$net$resource$Type$JS$$, $name$$64$$); +} +function $spf$net$script$get$$($url$$48$$, $opt_fn$$2$$) { + $spf$net$resource$create$$($spf$net$resource$Type$JS$$, $url$$48$$, $opt_fn$$2$$); +} +function $spf$net$script$prefetch$$($urls$$1$$) { + $urls$$1$$ = $spf$array$toArray$$($urls$$1$$); + $spf$array$each$$($urls$$1$$, function($url$$49$$) { + $spf$net$resource$prefetch$$($spf$net$resource$Type$JS$$, $url$$49$$); + }); +} +function $spf$net$script$ready$$($names$$1_topic$$9$$, $opt_fn$$3$$, $opt_require$$) { + $names$$1_topic$$9$$ = $spf$array$toArray$$($names$$1_topic$$9$$); + $spf$debug$debug$$("script.ready", $names$$1_topic$$9$$); + $names$$1_topic$$9$$ = $spf$array$filter$$($names$$1_topic$$9$$, function($name$$65$$) { + return!!$name$$65$$; + }); + var $unknown$$ = []; + $spf$array$each$$($names$$1_topic$$9$$, function($name$$66$$) { + void 0 == $spf$net$resource$url$get$$($spf$net$resource$Type$JS$$, $name$$66$$) && $unknown$$.push($name$$66$$); + }); + var $known$$ = !$unknown$$.length; + if ($opt_fn$$3$$) { + var $ready$$1$$ = $spf$array$every$$($names$$1_topic$$9$$, $spf$bind$$($spf$net$resource$url$loaded$$, null, $spf$net$resource$Type$JS$$)); + $known$$ && $ready$$1$$ ? $opt_fn$$3$$() : ($names$$1_topic$$9$$ = $spf$net$resource$key$$($spf$net$resource$Type$JS$$, $names$$1_topic$$9$$.sort().join("|")), $spf$debug$debug$$(" subscribing", $names$$1_topic$$9$$), $spf$pubsub$subscribe$$($names$$1_topic$$9$$, $opt_fn$$3$$)); + } + $opt_require$$ && !$known$$ && $opt_require$$($unknown$$); +} +function $spf$net$script$require$$($names$$3$$, $opt_fn$$4$$) { + $spf$debug$debug$$("script.require", $names$$3$$); + $names$$3$$ = $spf$array$toArray$$($names$$3$$); + $spf$array$each$$($names$$3$$, function($name$$68$$) { + if ($name$$68$$) { + var $url$$50$$ = $spf$net$script$url_$$[$name$$68$$] || $name$$68$$, $url$$50$$ = $spf$net$resource$canonicalize$$($spf$net$resource$Type$JS$$, $url$$50$$), $previous$$1$$ = $spf$net$resource$url$get$$($spf$net$resource$Type$JS$$, $name$$68$$); + $previous$$1$$ && $url$$50$$ != $previous$$1$$ && $spf$net$script$unrequire$$($name$$68$$); + } + }); + $spf$net$script$ready$$($names$$3$$, $opt_fn$$4$$, $spf$net$script$require_$$); +} +function $spf$net$script$require_$$($names$$4$$) { + $spf$array$each$$($names$$4$$, function($name$$69$$) { + function $next$$3$$() { + $spf$net$script$load$$($url$$51$$, $name$$69$$); + } + var $deps$$ = $spf$net$script$deps_$$[$name$$69$$], $url$$51$$ = $spf$net$script$url_$$[$name$$69$$] || $name$$69$$; + $deps$$ ? $spf$net$script$require$$($deps$$, $next$$3$$) : $next$$3$$(); + }); +} +function $spf$net$script$unrequire$$($names$$5$$) { + $spf$debug$debug$$("script.unrequire", $names$$5$$); + $names$$5$$ = $spf$array$toArray$$($names$$5$$); + $spf$array$each$$($names$$5$$, function($name$$70$$) { + var $descendants$$ = [], $dep$$; + for ($dep$$ in $spf$net$script$deps_$$) { + var $list$$ = $spf$net$script$deps_$$[$dep$$], $list$$ = $spf$array$toArray$$($list$$); + $spf$array$each$$($list$$, function($l$$6$$) { + $l$$6$$ == $name$$70$$ && $descendants$$.push($dep$$); + }); + } + $spf$array$each$$($descendants$$, function($descend$$) { + $spf$net$script$unrequire$$($descend$$); + }); + $spf$net$script$unload$$($name$$70$$); + }); +} +function $spf$net$script$eval$$($text$$12$$, $name$$71$$) { + $spf$net$resource$eval$$($spf$net$resource$Type$JS$$, $text$$12$$, $name$$71$$); +} +function $spf$net$script$exec$$($text$$13$$) { + $spf$net$resource$exec$$($spf$net$resource$Type$JS$$, $text$$13$$); +} +var $spf$net$script$deps_$$ = {}; +"js-d" in $spf$state$values_$$ || $spf$state$set$$("js-d", $spf$net$script$deps_$$); +var $spf$net$script$deps_$$ = $spf$state$values_$$["js-d"], $spf$net$script$url_$$ = {}; +"js-u" in $spf$state$values_$$ || $spf$state$set$$("js-u", $spf$net$script$url_$$); +$spf$net$script$url_$$ = $spf$state$values_$$["js-u"]; +function $spf$net$style$load$$($url$$52$$, $name$$73$$, $opt_fn$$5$$) { + $spf$net$resource$load$$($spf$net$resource$Type$CSS$$, $url$$52$$, $name$$73$$, $opt_fn$$5$$); +} +function $spf$net$style$get$$($url$$53$$, $opt_fn$$6$$) { + $spf$net$resource$create$$($spf$net$resource$Type$CSS$$, $url$$53$$, $opt_fn$$6$$); +} +function $spf$net$style$prefetch$$($urls$$2$$) { + $urls$$2$$ = $spf$array$toArray$$($urls$$2$$); + $spf$array$each$$($urls$$2$$, function($url$$54$$) { + $spf$net$resource$prefetch$$($spf$net$resource$Type$CSS$$, $url$$54$$); + }); +} +;function $spf$nav$response$parse$$($response_text$$16$$, $opt_multipart_parts$$1$$, $opt_lastDitch$$) { + if ($opt_multipart_parts$$1$$) { + $opt_multipart_parts$$1$$ = []; + var $chunk$$1_extra$$1$$, $start$$8$$ = 0; + $opt_lastDitch$$ && ($response_text$$16$$ += "\r\n"); + var $finish$$ = $response_text$$16$$.indexOf($spf$nav$response$Token$BEGIN$$, $start$$8$$); + for (-1 < $finish$$ && ($start$$8$$ = $finish$$ + $spf$nav$response$Token$BEGIN$$.length);-1 < ($finish$$ = $response_text$$16$$.indexOf($spf$nav$response$Token$DELIMITER$$, $start$$8$$));) { + $chunk$$1_extra$$1$$ = $spf$string$trim$$($response_text$$16$$.substring($start$$8$$, $finish$$)), $start$$8$$ = $finish$$ + $spf$nav$response$Token$DELIMITER$$.length, $chunk$$1_extra$$1$$ && $opt_multipart_parts$$1$$.push(JSON.parse($chunk$$1_extra$$1$$)); + } + $finish$$ = $response_text$$16$$.indexOf($spf$nav$response$Token$END$$, $start$$8$$); + -1 < $finish$$ && ($chunk$$1_extra$$1$$ = $spf$string$trim$$($response_text$$16$$.substring($start$$8$$, $finish$$)), $start$$8$$ = $finish$$ + $spf$nav$response$Token$END$$.length, $chunk$$1_extra$$1$$ && $opt_multipart_parts$$1$$.push(JSON.parse($chunk$$1_extra$$1$$))); + $chunk$$1_extra$$1$$ = ""; + $response_text$$16$$.length > $start$$8$$ && ($chunk$$1_extra$$1$$ = $response_text$$16$$.substring($start$$8$$), $opt_lastDitch$$ && $spf$string$endsWith$$($chunk$$1_extra$$1$$, "\r\n") && ($chunk$$1_extra$$1$$ = $chunk$$1_extra$$1$$.substring(0, $chunk$$1_extra$$1$$.length - 2))); + return{$parts$:$opt_multipart_parts$$1$$, $extra$:$chunk$$1_extra$$1$$}; + } + $response_text$$16$$ = JSON.parse($response_text$$16$$); + $opt_multipart_parts$$1$$ = "number" == typeof $response_text$$16$$.length ? $response_text$$16$$ : [$response_text$$16$$]; + return{$parts$:$opt_multipart_parts$$1$$, $extra$:""}; +} +function $spf$nav$response$process$$($url$$55$$, $response$$1$$, $opt_callback$$8$$, $fragments_opt_navigate$$, $opt_reverse$$) { + $spf$debug$info$$("nav.response.process ", $response$$1$$, $opt_reverse$$); + var $key$$46$$ = "process " + $spf$url$absolute$$($url$$55$$), $sync$$ = !$spf$config$values$$["experimental-process-async"], $fn$$12_num$$5$$; + $fn$$12_num$$5$$ = 0; + $response$$1$$.timing || ($response$$1$$.timing = {}); + $response$$1$$.title && (document.title = $response$$1$$.title); + $fragments_opt_navigate$$ && $response$$1$$.url && $spf$url$absolute$$($response$$1$$.url) != $spf$url$absolute$$(window.location.href) && ($spf$debug$debug$$(" update history with response url"), $spf$history$replace$$($response$$1$$.url + window.location.hash, null, !1, !0)); + $response$$1$$.head && ($fn$$12_num$$5$$ = $spf$bind$$(function($head$$1$$, $timing$$1$$) { + var $extracted$$ = $spf$nav$response$extract_$$($head$$1$$); + $spf$nav$response$preinstallLinks_$$($extracted$$); + $spf$nav$response$installStyles_$$($extracted$$); + $spf$debug$debug$$(" head css"); + $spf$tasks$suspend$$($key$$46$$); + $spf$nav$response$installScripts_$$($extracted$$, function() { + $timing$$1$$.spfProcessHead = $spf$now$$(); + $spf$debug$debug$$(" head js"); + $spf$tasks$resume$$($key$$46$$, $sync$$); + $spf$debug$debug$$(" process task done: head"); + }); + }, null, $response$$1$$.head, $response$$1$$.timing), $fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $fn$$12_num$$5$$), $spf$debug$debug$$(" process task queued: head", $fn$$12_num$$5$$)); + $response$$1$$.attr && ($fn$$12_num$$5$$ = $spf$bind$$(function($attrs$$, $timing$$2$$) { + for (var $id$$9$$ in $attrs$$) { + var $el$$12_element$$inline_80$$ = document.getElementById($id$$9$$); + if ($el$$12_element$$inline_80$$) { + var $attributes$$inline_81$$ = $attrs$$[$id$$9$$], $name$$inline_82$$ = void 0; + for ($name$$inline_82$$ in $attributes$$inline_81$$) { + var $value$$inline_83$$ = $attributes$$inline_81$$[$name$$inline_82$$]; + "class" == $name$$inline_82$$ ? $el$$12_element$$inline_80$$.className = $value$$inline_83$$ : "style" == $name$$inline_82$$ ? $el$$12_element$$inline_80$$.style.cssText = $value$$inline_83$$ : $el$$12_element$$inline_80$$.setAttribute($name$$inline_82$$, $value$$inline_83$$); + } + $spf$debug$debug$$(" attr set", $id$$9$$); + } + } + $timing$$2$$.spfProcessAttr = $spf$now$$(); + $spf$debug$debug$$(" process task done: attr"); + }, null, $response$$1$$.attr, $response$$1$$.timing), $fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $fn$$12_num$$5$$), $spf$debug$debug$$(" process task queued: attr", $fn$$12_num$$5$$)); + $fragments_opt_navigate$$ = $response$$1$$.body || {}; + var $numBeforeFragments$$ = $fn$$12_num$$5$$, $id$$8_numFragments$$; + for ($id$$8_numFragments$$ in $fragments_opt_navigate$$) { + $fn$$12_num$$5$$ = $spf$bind$$(function($id$$10$$, $body$$1$$) { + var $animationFn_el$$13$$ = document.getElementById($id$$10$$); + if ($animationFn_el$$13$$) { + var $extracted$$1$$ = $spf$nav$response$extract_$$($body$$1$$), $animationClass_animationData_innerHtmlHandler$$ = $spf$config$values$$["animation-class"]; + if ($spf$nav$response$CAN_ANIMATE_$$ && $spf$dom$classlist$contains$$($animationFn_el$$13$$, $animationClass_animationData_innerHtmlHandler$$)) { + $spf$tasks$suspend$$($key$$46$$); + var $animationKey$$ = $spf$tasks$key$$($animationFn_el$$13$$); + $spf$tasks$run$$($animationKey$$, !0); + $animationClass_animationData_innerHtmlHandler$$ = {$extracted$:$extracted$$1$$, reverse:!!$opt_reverse$$, $currentEl$:null, $pendingEl$:null, $parentEl$:$animationFn_el$$13$$, $currentClass$:$animationClass_animationData_innerHtmlHandler$$ + "-old", $pendingClass$:$animationClass_animationData_innerHtmlHandler$$ + "-new", $startClass$:$opt_reverse$$ ? $animationClass_animationData_innerHtmlHandler$$ + "-reverse-start" : $animationClass_animationData_innerHtmlHandler$$ + "-forward-start", + $endClass$:$opt_reverse$$ ? $animationClass_animationData_innerHtmlHandler$$ + "-reverse-end" : $animationClass_animationData_innerHtmlHandler$$ + "-forward-end"}; + $animationFn_el$$13$$ = $spf$bind$$(function($data$$32$$) { + $spf$nav$response$installStyles_$$($data$$32$$.$extracted$); + $spf$dom$classlist$add$$($data$$32$$.$parentEl$, $data$$32$$.$startClass$); + $data$$32$$.$currentEl$ = document.createElement("div"); + $data$$32$$.$currentEl$.className = $data$$32$$.$currentClass$; + var $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$ = $data$$32$$.$parentEl$, $parent$$inline_86$$ = $data$$32$$.$currentEl$; + if ($parent$$inline_86$$) { + for (var $child$$inline_87$$;$child$$inline_87$$ = $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$.firstChild;) { + $parent$$inline_86$$.appendChild($child$$inline_87$$); + } + $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$.appendChild($parent$$inline_86$$); + } + $data$$32$$.$pendingEl$ = document.createElement("div"); + $data$$32$$.$pendingEl$.className = $data$$32$$.$pendingClass$; + $data$$32$$.$pendingEl$.innerHTML = $data$$32$$.$extracted$.$html$; + $data$$32$$.reverse ? ($element$$inline_85_refNode$$inline_90_refNode$$inline_93$$ = $data$$32$$.$currentEl$, $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$.parentNode.insertBefore($data$$32$$.$pendingEl$, $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$)) : ($element$$inline_85_refNode$$inline_90_refNode$$inline_93$$ = $data$$32$$.$currentEl$, $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$.parentNode.insertBefore($data$$32$$.$pendingEl$, $element$$inline_85_refNode$$inline_90_refNode$$inline_93$$.nextSibling)); + $spf$debug$debug$$(" process anim done: add new", $data$$32$$.$parentEl$.id); + }, null, $animationClass_animationData_innerHtmlHandler$$); + $spf$tasks$add$$($animationKey$$, $animationFn_el$$13$$, 0); + $spf$debug$debug$$(" process anim queued: add new", $id$$10$$); + $animationFn_el$$13$$ = $spf$bind$$(function($data$$33$$) { + $spf$dom$classlist$remove$$($data$$33$$.$parentEl$, $data$$33$$.$startClass$); + $spf$dom$classlist$add$$($data$$33$$.$parentEl$, $data$$33$$.$endClass$); + $spf$debug$debug$$(" process anim done: swap", $data$$33$$.$parentEl$.id); + }, null, $animationClass_animationData_innerHtmlHandler$$); + $spf$tasks$add$$($animationKey$$, $animationFn_el$$13$$, 0); + $spf$debug$debug$$(" process anim queued: swap", $id$$10$$); + $animationFn_el$$13$$ = $spf$bind$$(function($data$$34$$) { + $data$$34$$.$parentEl$.removeChild($data$$34$$.$currentEl$); + $spf$dom$classlist$remove$$($data$$34$$.$parentEl$, $data$$34$$.$endClass$); + $spf$dom$flattenElement$$($data$$34$$.$pendingEl$); + $spf$debug$debug$$(" body update", $data$$34$$.$parentEl$.id); + $spf$tasks$suspend$$($animationKey$$); + $spf$nav$response$installScripts_$$($data$$34$$.$extracted$, function() { + $spf$debug$debug$$(" body js", $data$$34$$.$parentEl$.id); + $spf$tasks$resume$$($animationKey$$); + $spf$debug$debug$$(" process anim done: del old", $data$$34$$.$parentEl$.id); + }); + }, null, $animationClass_animationData_innerHtmlHandler$$); + $spf$tasks$add$$($animationKey$$, $animationFn_el$$13$$, parseInt($spf$config$values$$["animation-duration"], 10)); + $spf$debug$debug$$(" process anim queued: del old", $id$$10$$); + $animationFn_el$$13$$ = $spf$bind$$(function($data$$35$$, $key$$47$$) { + $spf$debug$debug$$(" process anim done: complete", $data$$35$$.$parentEl$.id); + $spf$tasks$resume$$($key$$47$$); + $spf$debug$debug$$(" process task done: body ", $data$$35$$.$parentEl$.id); + }, null, $animationClass_animationData_innerHtmlHandler$$, $key$$46$$); + $spf$tasks$add$$($animationKey$$, $animationFn_el$$13$$); + $spf$debug$debug$$(" process anim queued: complete", $id$$10$$); + $spf$tasks$run$$($animationKey$$); + } else { + $spf$nav$response$installStyles_$$($extracted$$1$$); + var $installScripts$$ = function $$installScripts$$$() { + $spf$tasks$suspend$$($key$$46$$); + $spf$nav$response$installScripts_$$($extracted$$1$$, function() { + $spf$debug$debug$$(" body js", $id$$10$$); + $spf$tasks$resume$$($key$$46$$, $sync$$); + $spf$debug$debug$$(" process task done: body", $id$$10$$); + }); + }; + ($animationClass_animationData_innerHtmlHandler$$ = $spf$config$values$$["experimental-html-handler"]) ? ($spf$tasks$suspend$$($key$$46$$), $animationClass_animationData_innerHtmlHandler$$($extracted$$1$$.$html$, $animationFn_el$$13$$, function() { + $installScripts$$(); + $spf$tasks$resume$$($key$$46$$, $sync$$); + })) : ($animationFn_el$$13$$.innerHTML = $extracted$$1$$.$html$, $spf$debug$debug$$(" body update", $id$$10$$), $installScripts$$()); + } + } + }, null, $id$$8_numFragments$$, $fragments_opt_navigate$$[$id$$8_numFragments$$], $response$$1$$.timing), $fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $fn$$12_num$$5$$), $spf$debug$debug$$(" process task queued: body", $id$$8_numFragments$$, $fn$$12_num$$5$$); + } + $id$$8_numFragments$$ = $fn$$12_num$$5$$ - $numBeforeFragments$$; + $response$$1$$.foot ? ($fn$$12_num$$5$$ = $spf$bind$$(function($extracted$$2_foot$$, $timing$$4$$, $numFragments$$1$$) { + $numFragments$$1$$ && ($timing$$4$$.spfProcessBody = $spf$now$$()); + $extracted$$2_foot$$ = $spf$nav$response$extract_$$($extracted$$2_foot$$); + $spf$nav$response$installStyles_$$($extracted$$2_foot$$); + $spf$debug$debug$$(" foot css"); + $spf$tasks$suspend$$($key$$46$$); + $spf$nav$response$installScripts_$$($extracted$$2_foot$$, function() { + $timing$$4$$.spfProcessFoot = $spf$now$$(); + $spf$debug$debug$$(" foot js"); + $spf$tasks$resume$$($key$$46$$, $sync$$); + $spf$debug$debug$$(" process task done: foot"); + }); + }, null, $response$$1$$.foot, $response$$1$$.timing, $id$$8_numFragments$$), $fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $fn$$12_num$$5$$), $spf$debug$debug$$(" process task queued: foot", $fn$$12_num$$5$$)) : $id$$8_numFragments$$ && ($fn$$12_num$$5$$ = $spf$bind$$(function($timing$$5$$) { + $timing$$5$$.spfProcessBody = $spf$now$$(); + $spf$debug$debug$$(" process task done: timing-for-body"); + }, null, $response$$1$$.timing), $fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $fn$$12_num$$5$$), $spf$debug$debug$$(" process task queued: timing-for-body", $fn$$12_num$$5$$)); + $opt_callback$$8$$ && ($fn$$12_num$$5$$ = $spf$tasks$add$$($key$$46$$, $spf$bind$$($opt_callback$$8$$, null, $url$$55$$, $response$$1$$)), $spf$debug$debug$$(" process task queued: callback", $fn$$12_num$$5$$)); + $spf$tasks$run$$($key$$46$$, $sync$$); +} +function $spf$nav$response$preprocess$$($url$$56$$, $response$$2$$, $opt_callback$$9$$) { + $spf$debug$info$$("nav.response.preprocess ", $response$$2$$); + var $key$$48$$ = "preprocess " + $spf$url$absolute$$($url$$56$$), $fn$$13$$; + $response$$2$$.head && ($fn$$13$$ = $spf$bind$$(function($extracted$$3_head$$2$$) { + $extracted$$3_head$$2$$ = $spf$nav$response$extract_$$($extracted$$3_head$$2$$); + $spf$nav$response$preinstallLinks_$$($extracted$$3_head$$2$$); + $spf$nav$response$preinstallStyles_$$($extracted$$3_head$$2$$); + $spf$nav$response$preinstallScripts_$$($extracted$$3_head$$2$$); + $spf$debug$debug$$(" preprocess task done: head"); + }, null, $response$$2$$.head), $spf$tasks$add$$($key$$48$$, $fn$$13$$), $spf$debug$debug$$(" preprocess task queued: head")); + var $fragments$$1$$ = $response$$2$$.body || {}, $id$$11$$; + for ($id$$11$$ in $fragments$$1$$) { + $fragments$$1$$[$id$$11$$] && ($fn$$13$$ = $spf$bind$$(function($id$$12$$, $body$$2$$) { + var $extracted$$4$$ = $spf$nav$response$extract_$$($body$$2$$); + $spf$nav$response$preinstallStyles_$$($extracted$$4$$); + $spf$nav$response$preinstallScripts_$$($extracted$$4$$); + $spf$debug$debug$$(" body js", $id$$12$$); + $spf$debug$debug$$(" preprocess task done: body", $id$$12$$); + }, null, $id$$11$$, $fragments$$1$$[$id$$11$$]), $spf$tasks$add$$($key$$48$$, $fn$$13$$), $spf$debug$debug$$(" preprocess task queued: body", $id$$11$$)); + } + $response$$2$$.foot && ($fn$$13$$ = $spf$bind$$(function($extracted$$5_foot$$1$$) { + $extracted$$5_foot$$1$$ = $spf$nav$response$extract_$$($extracted$$5_foot$$1$$); + $spf$nav$response$preinstallStyles_$$($extracted$$5_foot$$1$$); + $spf$nav$response$preinstallScripts_$$($extracted$$5_foot$$1$$); + $spf$debug$debug$$(" preprocess task done: foot"); + }, null, $response$$2$$.foot), $spf$tasks$add$$($key$$48$$, $fn$$13$$), $spf$debug$debug$$(" preprocess task queued: foot")); + $opt_callback$$9$$ && ($spf$tasks$add$$($key$$48$$, $spf$bind$$($opt_callback$$9$$, null, $url$$56$$, $response$$2$$)), $spf$debug$debug$$(" preprocess task queued: callback")); + $spf$tasks$run$$($key$$48$$); +} +function $spf$nav$response$extract_$$($html$$) { + var $result$$4$$ = new $spf$nav$response$Extraction_$$; + if (!$html$$) { + return $result$$4$$; + } + if ("[object String]" != Object.prototype.toString.call($html$$)) { + return $html$$.scripts && $spf$array$each$$($html$$.scripts, function($script$$) { + $result$$4$$.scripts.push({url:$script$$.url || "", text:$script$$.text || "", name:$script$$.name || "", async:$script$$.async || !1}); + }), $html$$.styles && $spf$array$each$$($html$$.styles, function($style$$) { + $result$$4$$.$styles$.push({url:$style$$.url || "", text:$style$$.text || "", name:$style$$.name || ""}); + }), $html$$.links && $spf$config$values$$["experimental-preconnect"] && $spf$array$each$$($html$$.links, function($link$$) { + "spf-preconnect" == $link$$.rel && $result$$4$$.links.push({url:$link$$.url || "", rel:$link$$.rel || ""}); + }), $result$$4$$.$html$ = $html$$.html || "", $result$$4$$; + } + $html$$ = $html$$.replace($spf$nav$response$ElementRegEx$SCRIPT_STYLE$$, function($full_name$$76$$, $tag$$1_url$$57$$, $async_attr$$, $text$$17$$) { + return "script" == $tag$$1_url$$57$$ ? ($full_name$$76$$ = ($full_name$$76$$ = $async_attr$$.match($spf$nav$response$AttributeRegEx$NAME$$)) ? $full_name$$76$$[1] : "", $tag$$1_url$$57$$ = ($tag$$1_url$$57$$ = $async_attr$$.match($spf$nav$response$AttributeRegEx$SRC$$)) ? $tag$$1_url$$57$$[1] : "", $async_attr$$ = $spf$nav$response$AttributeRegEx$ASYNC$$.test($async_attr$$), $result$$4$$.scripts.push({url:$tag$$1_url$$57$$, text:$text$$17$$, name:$full_name$$76$$, async:$async_attr$$}), "") : + "style" == $tag$$1_url$$57$$ ? ($full_name$$76$$ = ($full_name$$76$$ = $async_attr$$.match($spf$nav$response$AttributeRegEx$NAME$$)) ? $full_name$$76$$[1] : "", $result$$4$$.$styles$.push({url:"", text:$text$$17$$, name:$full_name$$76$$}), "") : $full_name$$76$$; + }); + $html$$ = $html$$.replace($spf$nav$response$ElementRegEx$LINK$$, function($full$$1$$, $attr$$1$$) { + var $name$$77_rel$$ = $attr$$1$$.match($spf$nav$response$AttributeRegEx$REL$$), $name$$77_rel$$ = $name$$77_rel$$ ? $name$$77_rel$$[1] : ""; + if ("stylesheet" == $name$$77_rel$$) { + var $name$$77_rel$$ = ($name$$77_rel$$ = $attr$$1$$.match($spf$nav$response$AttributeRegEx$NAME$$)) ? $name$$77_rel$$[1] : "", $url$$58$$ = $attr$$1$$.match($spf$nav$response$AttributeRegEx$HREF$$), $url$$58$$ = $url$$58$$ ? $url$$58$$[1] : ""; + $result$$4$$.$styles$.push({url:$url$$58$$, text:"", name:$name$$77_rel$$}); + return ""; + } + return "spf-preconnect" == $name$$77_rel$$ && $spf$config$values$$["experimental-preconnect"] ? ($url$$58$$ = ($url$$58$$ = $attr$$1$$.match($spf$nav$response$AttributeRegEx$HREF$$)) ? $url$$58$$[1] : "", $result$$4$$.links.push({url:$url$$58$$, rel:$name$$77_rel$$}), "") : $full$$1$$; + }); + $result$$4$$.$html$ = $html$$; + return $result$$4$$; +} +function $spf$nav$response$installScripts_$$($result$$5$$, $opt_callback$$10$$) { + if (0 >= $result$$5$$.scripts.length) { + $opt_callback$$10$$ && $opt_callback$$10$$(); + } else { + var $index$$46$$ = -1, $next$$4$$ = function $$next$$4$$$() { + $index$$46$$++; + if ($index$$46$$ < $result$$5$$.scripts.length) { + var $item$$ = $result$$5$$.scripts[$index$$46$$], $fn$$14$$ = function $$fn$$14$$$() { + }; + $item$$.url ? $fn$$14$$ = $item$$.name ? $spf$bind$$($spf$net$script$load$$, null, $item$$.url, $item$$.name) : $spf$bind$$($spf$net$script$get$$, null, $item$$.url) : $item$$.text && ($fn$$14$$ = $item$$.name ? $spf$bind$$($spf$net$script$eval$$, null, $item$$.text, $item$$.name) : $spf$bind$$($spf$net$script$exec$$, null, $item$$.text)); + $item$$.url && !$item$$.async ? $fn$$14$$($next$$4$$) : ($fn$$14$$(), $next$$4$$()); + } else { + $opt_callback$$10$$ && $opt_callback$$10$$(); + } + }; + $next$$4$$(); + } +} +function $spf$nav$response$preinstallScripts_$$($result$$6_urls$$3$$) { + 0 >= $result$$6_urls$$3$$.scripts.length || ($result$$6_urls$$3$$ = $spf$array$map$$($result$$6_urls$$3$$.scripts, function($item$$1$$) { + return $item$$1$$.url; + }), $spf$net$script$prefetch$$($result$$6_urls$$3$$)); +} +function $spf$nav$response$installStyles_$$($result$$7$$) { + if (!(0 >= $result$$7$$.$styles$.length)) { + for (var $i$$15$$ = 0, $l$$7$$ = $result$$7$$.$styles$.length;$i$$15$$ < $l$$7$$;$i$$15$$++) { + var $item$$2$$ = $result$$7$$.$styles$[$i$$15$$]; + $item$$2$$.url ? $item$$2$$.name ? $spf$net$style$load$$($item$$2$$.url, $item$$2$$.name) : $spf$net$style$get$$($item$$2$$.url) : $item$$2$$.text && ($item$$2$$.name ? $spf$net$resource$eval$$($spf$net$resource$Type$CSS$$, $item$$2$$.text, $item$$2$$.name) : $spf$net$resource$exec$$($spf$net$resource$Type$CSS$$, $item$$2$$.text)); + } + } +} +function $spf$nav$response$preinstallStyles_$$($result$$8_urls$$4$$) { + 0 >= $result$$8_urls$$4$$.$styles$.length || ($result$$8_urls$$4$$ = $spf$array$map$$($result$$8_urls$$4$$.$styles$, function($item$$3$$) { + return $item$$3$$.url; + }), $spf$net$style$prefetch$$($result$$8_urls$$4$$)); +} +function $spf$nav$response$preinstallLinks_$$($result$$10_urls$$5$$) { + 0 >= $result$$10_urls$$5$$.links.length || ($result$$10_urls$$5$$ = $spf$array$map$$($result$$10_urls$$5$$.links, function($item$$4$$) { + return "spf-preconnect" == $item$$4$$.rel ? $item$$4$$.url : ""; + }), $spf$net$connect$preconnect$$($result$$10_urls$$5$$)); +} +function $spf$nav$response$Extraction_$$() { + this.$html$ = ""; + this.scripts = []; + this.$styles$ = []; + this.links = []; +} +var $spf$nav$response$CAN_ANIMATE_$$ = function() { + var $testEl$$ = document.createElement("div"); + if ("transition" in $testEl$$.style) { + return!0; + } + for (var $prefixes$$ = ["webkit", "Moz", "Ms", "O", "Khtml"], $i$$16$$ = 0, $l$$8$$ = $prefixes$$.length;$i$$16$$ < $l$$8$$;$i$$16$$++) { + if ($prefixes$$[$i$$16$$] + "Transition" in $testEl$$.style) { + return!0; + } + } + return!1; +}(), $spf$nav$response$ElementRegEx$LINK$$ = /\x3clink([\s\S]*?)\x3e/ig, $spf$nav$response$ElementRegEx$SCRIPT_STYLE$$ = /\x3c(script|style)([\s\S]*?)\x3e([\s\S]*?)\x3c\/\1\x3e/ig, $spf$nav$response$AttributeRegEx$ASYNC$$ = /(?:\s|^)async(?:\s|=|$)/i, $spf$nav$response$AttributeRegEx$HREF$$ = /(?:\s|^)href\s*=\s*["']?([^\s"']+)/i, $spf$nav$response$AttributeRegEx$NAME$$ = /(?:\s|^)name\s*=\s*["']?([^\s"']+)/i, $spf$nav$response$AttributeRegEx$REL$$ = /(?:\s|^)rel\s*=\s*["']?([^\s"']+)/i, $spf$nav$response$AttributeRegEx$SRC$$ = +/(?:\s|^)src\s*=\s*["']?([^\s"']+)/i, $spf$nav$response$Token$BEGIN$$ = "[\r\n", $spf$nav$response$Token$DELIMITER$$ = ",\r\n", $spf$nav$response$Token$END$$ = "]\r\n"; +function $spf$nav$request$send$$($url$$59$$, $opt_options$$17$$) { + $spf$debug$debug$$("nav.request.send ", $url$$59$$, $opt_options$$17$$); + var $options$$4$$ = $opt_options$$17$$ || {}; + $options$$4$$.method = (($options$$4$$.method || "GET") + "").toUpperCase(); + $options$$4$$.type = $options$$4$$.type || "request"; + var $requestUrl_url$$inline_100$$ = $url$$59$$, $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = $spf$config$values$$["url-identifier"] || ""; + if ($handleComplete_ident$$inline_102_timing$$6_xhrOpts$$) { + var $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.replace("__type__", $options$$4$$.type || ""), $cached_headers_keys$$inline_107_result$$inline_103$$ = $spf$string$partition$$($requestUrl_url$$inline_100$$), $requestUrl_url$$inline_100$$ = $cached_headers_keys$$inline_107_result$$inline_103$$[0]; + 0 == $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.lastIndexOf("?", 0) && -1 != $requestUrl_url$$inline_100$$.indexOf("?") && ($handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.replace("?", "&")); + $requestUrl_url$$inline_100$$ += $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ + $cached_headers_keys$$inline_107_result$$inline_103$$[1] + $cached_headers_keys$$inline_107_result$$inline_103$$[2]; + } + $requestUrl_url$$inline_100$$ = $spf$url$absolute$$($requestUrl_url$$inline_100$$); + $spf$debug$debug$$(" request url ", $requestUrl_url$$inline_100$$); + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = {}; + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.spfUrl = $requestUrl_url$$inline_100$$; + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.startTime = $spf$now$$(); + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.fetchStart = $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.startTime; + a: { + var $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ = $spf$nav$request$getCacheKey_$$($url$$59$$, $options$$4$$.current, null, $options$$4$$.type, !1), $l$$inline_109_opt_current$$inline_106$$ = $options$$4$$.current, $cached_headers_keys$$inline_107_result$$inline_103$$ = []; + $l$$inline_109_opt_current$$inline_106$$ && ($cached_headers_keys$$inline_107_result$$inline_103$$.push($cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ + " previous " + $l$$inline_109_opt_current$$inline_106$$), $cached_headers_keys$$inline_107_result$$inline_103$$.push($cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ + " previous " + $spf$url$utils$$($l$$inline_109_opt_current$$inline_106$$).pathname)); + $cached_headers_keys$$inline_107_result$$inline_103$$.push($cacheKey$$inline_105_chunking_headerId_i$$inline_108$$); + $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ = 0; + for ($l$$inline_109_opt_current$$inline_106$$ = $cached_headers_keys$$inline_107_result$$inline_103$$.length;$cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ < $l$$inline_109_opt_current$$inline_106$$;$cacheKey$$inline_105_chunking_headerId_i$$inline_108$$++) { + var $cached$$inline_110_key$$inline_187$$; + b: { + $cached$$inline_110_key$$inline_187$$ = $cached_headers_keys$$inline_107_result$$inline_103$$[$cacheKey$$inline_105_chunking_headerId_i$$inline_108$$]; + var $storage$$inline_188_unit$$inline_189$$ = $spf$cache$storage_$$(); + if ($cached$$inline_110_key$$inline_187$$ in $storage$$inline_188_unit$$inline_189$$) { + $storage$$inline_188_unit$$inline_189$$ = $storage$$inline_188_unit$$inline_189$$[$cached$$inline_110_key$$inline_187$$]; + if ($spf$cache$valid_$$($storage$$inline_188_unit$$inline_189$$)) { + $spf$cache$updateCount_$$($storage$$inline_188_unit$$inline_189$$); + $cached$$inline_110_key$$inline_187$$ = $storage$$inline_188_unit$$inline_189$$.data; + break b; + } + $spf$cache$remove$$($cached$$inline_110_key$$inline_187$$); + } + $cached$$inline_110_key$$inline_187$$ = void 0; + } + if ($cached$$inline_110_key$$inline_187$$) { + $cached_headers_keys$$inline_107_result$$inline_103$$ = {key:$cached_headers_keys$$inline_107_result$$inline_103$$[$cacheKey$$inline_105_chunking_headerId_i$$inline_108$$], response:$cached$$inline_110_key$$inline_187$$.response, type:$cached$$inline_110_key$$inline_187$$.type}; + break a; + } + } + $cached_headers_keys$$inline_107_result$$inline_103$$ = null; + } + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.spfPrefetched = !!$cached_headers_keys$$inline_107_result$$inline_103$$ && "prefetch" == $cached_headers_keys$$inline_107_result$$inline_103$$.type; + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$.spfCached = !!$cached_headers_keys$$inline_107_result$$inline_103$$; + if ($cached_headers_keys$$inline_107_result$$inline_103$$) { + return setTimeout($spf$bind$$($spf$nav$request$handleResponseFromCache_$$, null, $url$$59$$, $options$$4$$, $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$, $cached_headers_keys$$inline_107_result$$inline_103$$.key, $cached_headers_keys$$inline_107_result$$inline_103$$.response), 0), null; + } + $spf$debug$debug$$(" sending XHR"); + $cached_headers_keys$$inline_107_result$$inline_103$$ = {}; + void 0 != $options$$4$$.$referer$ && ($cached_headers_keys$$inline_107_result$$inline_103$$["X-SPF-Referer"] = $options$$4$$.$referer$); + $options$$4$$.current && ($cached_headers_keys$$inline_107_result$$inline_103$$["X-SPF-Previous"] = $options$$4$$.current); + if ($cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ = $spf$config$values$$["advanced-header-identifier"]) { + $cached_headers_keys$$inline_107_result$$inline_103$$["X-SPF-Request"] = $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$.replace("__type__", $options$$4$$.type), $cached_headers_keys$$inline_107_result$$inline_103$$.Accept = "application/json"; + } + $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$ = {$multipart$:!1, $extra$:"", complete:[]}; + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = $spf$bind$$($spf$nav$request$handleCompleteFromXHR_$$, null, $url$$59$$, $options$$4$$, $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$, $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$); + $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$ = {headers:$cached_headers_keys$$inline_107_result$$inline_103$$, $timeoutMs$:$spf$config$values$$["request-timeout"], $onHeaders$:$spf$bind$$($spf$nav$request$handleHeadersFromXHR_$$, null, $url$$59$$, $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$), $onChunk$:$spf$bind$$($spf$nav$request$handleChunkFromXHR_$$, null, $url$$59$$, $options$$4$$, $cacheKey$$inline_105_chunking_headerId_i$$inline_108$$), $onDone$:$handleComplete_ident$$inline_102_timing$$6_xhrOpts$$, + $onTimeout$:$handleComplete_ident$$inline_102_timing$$6_xhrOpts$$}; + return "POST" == $options$$4$$.method ? $spf$net$xhr$send$$("POST", $requestUrl_url$$inline_100$$, $options$$4$$.$postData$, $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$) : $spf$net$xhr$send$$("GET", $requestUrl_url$$inline_100$$, null, $handleComplete_ident$$inline_102_timing$$6_xhrOpts$$); +} +function $spf$nav$request$handleResponseFromCache_$$($url$$60$$, $options$$5$$, $timing$$7$$, $cacheKey$$1_parts$$2$$, $response$$4$$) { + $spf$debug$debug$$("nav.request.handleResponseFromCache_ ", $url$$60$$, $response$$4$$); + var $updateCache$$ = !1; + $timing$$7$$.responseStart = $timing$$7$$.responseEnd = $spf$now$$(); + $options$$5$$.type && 0 == $options$$5$$.type.lastIndexOf("navigate", 0) && ($timing$$7$$.navigationStart = $timing$$7$$.startTime, $spf$config$values$$["cache-unified"] || ($spf$cache$remove$$($cacheKey$$1_parts$$2$$), $updateCache$$ = !0)); + if ($options$$5$$.$onPart$ && "multipart" == $response$$4$$.type) { + $cacheKey$$1_parts$$2$$ = $response$$4$$.parts; + for (var $i$$17$$ = 0;$i$$17$$ < $cacheKey$$1_parts$$2$$.length;$i$$17$$++) { + $options$$5$$.$onPart$($url$$60$$, $cacheKey$$1_parts$$2$$[$i$$17$$]); + } + } + $spf$nav$request$done_$$($url$$60$$, $options$$5$$, $timing$$7$$, $response$$4$$, $updateCache$$); +} +function $spf$nav$request$handleHeadersFromXHR_$$($multipart_url$$61$$, $chunking$$1$$, $xhr$$2$$) { + $spf$debug$debug$$("nav.request.handleHeadersFromXHR_ ", $multipart_url$$61$$, $xhr$$2$$); + $multipart_url$$61$$ = -1 != ($xhr$$2$$.getResponseHeader("X-SPF-Response-Type") || "").toLowerCase().indexOf("multipart"); + $spf$debug$debug$$(" response is", ($multipart_url$$61$$ ? "" : "non-") + "multipart"); + $chunking$$1$$.$multipart$ = $multipart_url$$61$$; +} +function $spf$nav$request$handleChunkFromXHR_$$($url$$62$$, $options$$6$$, $chunking$$2$$, $i$$18_xhr$$3$$, $chunk$$2_text$$18$$, $opt_lastDitch$$1$$) { + $spf$debug$debug$$("nav.request.handleChunkFromXHR_ ", $url$$62$$, {extra:$chunking$$2$$.$extra$, chunk:$chunk$$2_text$$18$$}); + if ($chunking$$2$$.$multipart$) { + $chunk$$2_text$$18$$ = $chunking$$2$$.$extra$ + $chunk$$2_text$$18$$; + var $parsed$$; + try { + $parsed$$ = $spf$nav$response$parse$$($chunk$$2_text$$18$$, !0, $opt_lastDitch$$1$$); + } catch ($err$$2$$) { + $spf$debug$debug$$(" JSON parse failed", $chunk$$2_text$$18$$); + $i$$18_xhr$$3$$.abort(); + $options$$6$$.$onError$ && $options$$6$$.$onError$($url$$62$$, $err$$2$$); + return; + } + if ($options$$6$$.$onPart$) { + for ($i$$18_xhr$$3$$ = 0;$i$$18_xhr$$3$$ < $parsed$$.$parts$.length;$i$$18_xhr$$3$$++) { + $spf$debug$debug$$(" parsed part", $parsed$$.$parts$[$i$$18_xhr$$3$$]), $options$$6$$.$onPart$($url$$62$$, $parsed$$.$parts$[$i$$18_xhr$$3$$]); + } + } + $chunking$$2$$.complete = $chunking$$2$$.complete.concat($parsed$$.$parts$); + $chunking$$2$$.$extra$ = $parsed$$.$extra$; + } else { + $spf$debug$debug$$(" skipping non-multipart response"); + } +} +function $spf$nav$request$handleCompleteFromXHR_$$($url$$63$$, $options$$7$$, $timing$$8$$, $chunking$$3_i$$19$$, $l$$9_xhr$$4$$) { + $spf$debug$debug$$("nav.request.handleCompleteFromXHR_ ", $url$$63$$, {extra:$chunking$$3_i$$19$$.$extra$, complete:$l$$9_xhr$$4$$.responseText}); + if ($l$$9_xhr$$4$$.timing) { + for (var $navigationStart_t$$ in $l$$9_xhr$$4$$.timing) { + $timing$$8$$[$navigationStart_t$$] = $l$$9_xhr$$4$$.timing[$navigationStart_t$$]; + } + } + if ($l$$9_xhr$$4$$.resourceTiming) { + if ("load" == $options$$7$$.type) { + for (var $key$$49_value$$43$$ in $l$$9_xhr$$4$$.resourceTiming) { + $timing$$8$$[$key$$49_value$$43$$] = $l$$9_xhr$$4$$.resourceTiming[$key$$49_value$$43$$]; + } + } else { + if (window.performance && window.performance.timing) { + $navigationStart_t$$ = window.performance.timing.navigationStart; + for (var $metric_part$$ in $l$$9_xhr$$4$$.resourceTiming) { + $key$$49_value$$43$$ = $l$$9_xhr$$4$$.resourceTiming[$metric_part$$], void 0 !== $key$$49_value$$43$$ && ($spf$string$endsWith$$($metric_part$$, "Start") || $spf$string$endsWith$$($metric_part$$, "End") || "startTime" == $metric_part$$) && ($timing$$8$$[$metric_part$$] = $navigationStart_t$$ + Math.round($key$$49_value$$43$$)); + } + } + } + } + "load" != $options$$7$$.type && ($timing$$8$$.navigationStart = $timing$$8$$.startTime); + $chunking$$3_i$$19$$.complete.length && ($chunking$$3_i$$19$$.$extra$ = $spf$string$trim$$($chunking$$3_i$$19$$.$extra$), $chunking$$3_i$$19$$.$extra$ && $spf$nav$request$handleChunkFromXHR_$$($url$$63$$, $options$$7$$, $chunking$$3_i$$19$$, $l$$9_xhr$$4$$, "", !0)); + var $parts$$3_response$$5$$; + try { + $parts$$3_response$$5$$ = $spf$nav$response$parse$$($l$$9_xhr$$4$$.responseText).$parts$; + } catch ($err$$3$$) { + $spf$debug$debug$$(" JSON parse failed"); + $options$$7$$.$onError$ && $options$$7$$.$onError$($url$$63$$, $err$$3$$); + return; + } + if ($options$$7$$.$onPart$ && 1 < $parts$$3_response$$5$$.length) { + for ($chunking$$3_i$$19$$ = $chunking$$3_i$$19$$.complete.length;$chunking$$3_i$$19$$ < $parts$$3_response$$5$$.length;$chunking$$3_i$$19$$++) { + $spf$debug$debug$$(" parsed part", $parts$$3_response$$5$$[$chunking$$3_i$$19$$]), $options$$7$$.$onPart$($url$$63$$, $parts$$3_response$$5$$[$chunking$$3_i$$19$$]); + } + } + if (1 < $parts$$3_response$$5$$.length) { + var $cacheType$$; + $chunking$$3_i$$19$$ = 0; + for ($l$$9_xhr$$4$$ = $parts$$3_response$$5$$.length;$chunking$$3_i$$19$$ < $l$$9_xhr$$4$$;$chunking$$3_i$$19$$++) { + $metric_part$$ = $parts$$3_response$$5$$[$chunking$$3_i$$19$$], $metric_part$$.cacheType && ($cacheType$$ = $metric_part$$.cacheType); + } + $parts$$3_response$$5$$ = {parts:$parts$$3_response$$5$$, type:"multipart"}; + $cacheType$$ && ($parts$$3_response$$5$$.cacheType = $cacheType$$); + } else { + $parts$$3_response$$5$$ = 1 == $parts$$3_response$$5$$.length ? $parts$$3_response$$5$$[0] : {}; + } + $spf$nav$request$done_$$($url$$63$$, $options$$7$$, $timing$$8$$, $parts$$3_response$$5$$, !0); +} +function $spf$nav$request$done_$$($url$$64$$, $options$$8$$, $timing$$9$$, $response$$6$$, $cache_cacheKey$$2$$) { + $spf$debug$debug$$("nav.request.done_", $url$$64$$, $options$$8$$, $timing$$9$$, $response$$6$$, $cache_cacheKey$$2$$); + if ($cache_cacheKey$$2$$ && "POST" != $options$$8$$.method && ($cache_cacheKey$$2$$ = $spf$nav$request$getCacheKey_$$($url$$64$$, $options$$8$$.current, $response$$6$$.cacheType, $options$$8$$.type, !0))) { + $response$$6$$.cacheKey = $cache_cacheKey$$2$$; + var $data$$inline_192_unit$$inline_196$$ = {response:$response$$6$$, type:$options$$8$$.type || ""}, $lifetime$$inline_193$$ = parseInt($spf$config$values$$["cache-lifetime"], 10), $JSCompiler_temp_const$$inline_195_max$$inline_194$$ = parseInt($spf$config$values$$["cache-max"], 10); + 0 >= $lifetime$$inline_193$$ || 0 >= $JSCompiler_temp_const$$inline_195_max$$inline_194$$ || ($JSCompiler_temp_const$$inline_195_max$$inline_194$$ = $spf$cache$storage_$$(), $data$$inline_192_unit$$inline_196$$ = {data:$data$$inline_192_unit$$inline_196$$, life:$lifetime$$inline_193$$, time:$spf$now$$(), count:0}, $spf$cache$updateCount_$$($data$$inline_192_unit$$inline_196$$), $JSCompiler_temp_const$$inline_195_max$$inline_194$$[$cache_cacheKey$$2$$] = $data$$inline_192_unit$$inline_196$$, setTimeout($spf$cache$collect$$, + 1E3)); + } + $response$$6$$.timing = $timing$$9$$; + $options$$8$$.$onSuccess$ && $options$$8$$.$onSuccess$($url$$64$$, $response$$6$$); +} +function $spf$nav$request$getCacheKey_$$($absoluteUrl_url$$65$$, $opt_current$$, $opt_cacheType$$, $opt_requestType$$, $opt_set$$) { + $absoluteUrl_url$$65$$ = $spf$url$absolute$$($absoluteUrl_url$$65$$); + var $cacheKey$$3$$; + $spf$config$values$$["cache-unified"] ? $cacheKey$$3$$ = $absoluteUrl_url$$65$$ : "navigate-back" == $opt_requestType$$ || "navigate-forward" == $opt_requestType$$ ? $cacheKey$$3$$ = "history " + $absoluteUrl_url$$65$$ : "navigate" == $opt_requestType$$ ? $cacheKey$$3$$ = ($opt_set$$ ? "history " : "prefetch ") + $absoluteUrl_url$$65$$ : "prefetch" == $opt_requestType$$ && ($cacheKey$$3$$ = $opt_set$$ ? "prefetch " + $absoluteUrl_url$$65$$ : ""); + $opt_current$$ && "url" == $opt_cacheType$$ ? $cacheKey$$3$$ += " previous " + $opt_current$$ : $opt_current$$ && "path" == $opt_cacheType$$ && ($cacheKey$$3$$ += " previous " + $spf$url$utils$$($opt_current$$).pathname); + return $cacheKey$$3$$ || ""; +} +;function $spf$nav$getAncestorWithLinkClass_$$($element$$8$$) { + return $spf$dom$getAncestor$$($element$$8$$, function($node$$6$$) { + return $spf$dom$classlist$contains$$($node$$6$$, $spf$config$values$$["link-class"]); + }); +} +function $spf$nav$getAncestorWithNoLinkClass_$$($element$$9$$) { + return $spf$dom$getAncestor$$($element$$9$$, function($node$$7$$) { + return $spf$dom$classlist$contains$$($node$$7$$, $spf$config$values$$["nolink-class"]); + }); +} +function $spf$nav$getAncestorWithHref_$$($element$$10$$, $parent$$4$$) { + return $spf$dom$getAncestor$$($element$$10$$, function($node$$8$$) { + return $node$$8$$.href && "img" != $node$$8$$.tagName.toLowerCase(); + }, $parent$$4$$); +} +function $spf$nav$getEventURL_$$($evt$$25_target$$39$$) { + if ($evt$$25_target$$39$$.metaKey || $evt$$25_target$$39$$.altKey || $evt$$25_target$$39$$.ctrlKey || $evt$$25_target$$39$$.shiftKey) { + return $spf$debug$debug$$(" ignoring click with modifier key"), null; + } + if (0 < $evt$$25_target$$39$$.button) { + return $spf$debug$debug$$(" ignoring click with alternate button"), null; + } + var $linkEl$$ = $spf$nav$getAncestorWithLinkClass_$$($evt$$25_target$$39$$.target); + if (!$linkEl$$) { + return $spf$debug$debug$$(" ignoring click without link class"), null; + } + if ($spf$config$values$$["nolink-class"] && $spf$nav$getAncestorWithNoLinkClass_$$($evt$$25_target$$39$$.target)) { + return $spf$debug$debug$$(" ignoring click with nolink class"), null; + } + $evt$$25_target$$39$$ = $spf$nav$getAncestorWithHref_$$($evt$$25_target$$39$$.target, $linkEl$$); + return $evt$$25_target$$39$$ ? $evt$$25_target$$39$$.href : ($spf$debug$debug$$(" ignoring click without href parent"), null); +} +function $spf$nav$isAllowed_$$($url$$66$$) { + return $spf$url$utils$$($url$$66$$).origin != $spf$url$utils$$(window.location.href).origin ? ($spf$debug$warn$$("destination not same-origin"), !1) : !0; +} +function $spf$nav$isEligible_$$() { + if (!$spf$state$values_$$["nav-init"]) { + return $spf$debug$warn$$("navigation not initialized"), !1; + } + var $age$$1_count$$9_timestamp$$3$$ = parseInt($spf$state$values_$$["nav-counter"], 10) || 0; + $age$$1_count$$9_timestamp$$3$$++; + var $lifetime$$3_limit$$ = parseInt($spf$config$values$$["navigate-limit"], 10), $lifetime$$3_limit$$ = isNaN($lifetime$$3_limit$$) ? Infinity : $lifetime$$3_limit$$; + if ($age$$1_count$$9_timestamp$$3$$ > $lifetime$$3_limit$$) { + return $spf$debug$warn$$("navigation limit reached"), !1; + } + $age$$1_count$$9_timestamp$$3$$ = parseInt($spf$state$values_$$["nav-init-time"], 10); + $age$$1_count$$9_timestamp$$3$$--; + $age$$1_count$$9_timestamp$$3$$ = $spf$now$$() - $age$$1_count$$9_timestamp$$3$$; + $lifetime$$3_limit$$ = parseInt($spf$config$values$$["navigate-lifetime"], 10); + $lifetime$$3_limit$$ = isNaN($lifetime$$3_limit$$) ? Infinity : $lifetime$$3_limit$$; + return $age$$1_count$$9_timestamp$$3$$ > $lifetime$$3_limit$$ ? ($spf$debug$warn$$("navigation lifetime reached"), !1) : !0; +} +function $spf$nav$handleClick_$$($evt$$26$$) { + $spf$debug$debug$$("nav.handleClick ", "evt=", $evt$$26$$); + if (!$evt$$26$$.defaultPrevented) { + var $url$$69$$ = $spf$nav$getEventURL_$$($evt$$26$$); + $url$$69$$ && $spf$nav$isAllowed_$$($url$$69$$) && $spf$nav$isEligible_$$() && $spf$dispatch$$("spfclick", {url:$url$$69$$, target:$evt$$26$$.target}) && ($spf$nav$navigate_$$($url$$69$$), $evt$$26$$.preventDefault()); + } +} +function $spf$nav$handleMouseDown_$$($evt$$27$$) { + $spf$debug$debug$$("nav.handleMouseDown ", "evt=", $evt$$27$$); + var $url$$70$$ = $spf$nav$getEventURL_$$($evt$$27$$); + $url$$70$$ && setTimeout(function() { + $spf$nav$prefetch_$$($url$$70$$, void 0); + }, 0); +} +function $spf$nav$handleHistory_$$($url$$71$$, $opt_state$$3$$) { + var $reverse$$ = !(!$opt_state$$3$$ || !$opt_state$$3$$["spf-back"]), $referer$$ = $opt_state$$3$$ && $opt_state$$3$$["spf-referer"], $current$$3$$ = $opt_state$$3$$ && $opt_state$$3$$["spf-current"]; + $spf$debug$debug$$("nav.handleHistory ", "(url=", $url$$71$$, "state=", $opt_state$$3$$, ")"); + var $reloadId$$ = $spf$config$values$$["reload-identifier"]; + $reloadId$$ && ($url$$71$$ = $spf$url$removeParameters$$($url$$71$$, [$reloadId$$])); + $spf$nav$isAllowed_$$($url$$71$$) ? $spf$nav$isEligible_$$() ? $spf$dispatch$$("spfhistory", {url:$url$$71$$, referer:$referer$$, previous:$current$$3$$}) && $spf$nav$navigate_$$($url$$71$$, null, $current$$3$$, $referer$$, !0, $reverse$$) : $spf$nav$reload$$($url$$71$$, $spf$nav$ReloadReason$INELIGIBLE$$) : $spf$nav$reload$$($url$$71$$, $spf$nav$ReloadReason$FORBIDDEN$$); +} +function $spf$nav$navigate_$$($url$$73$$, $opt_options$$19_options$$9_xhr$$inline_144$$, $current$$4_history$$inline_131_opt_current$$3$$, $opt_referer_referer$$1$$, $history$$inline_139_opt_history_promoteKey$$inline_133$$, $handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$) { + $spf$debug$info$$("nav.navigate_ ", $url$$73$$, $opt_options$$19_options$$9_xhr$$inline_144$$, $current$$4_history$$inline_131_opt_current$$3$$, $opt_referer_referer$$1$$, $history$$inline_139_opt_history_promoteKey$$inline_133$$, $handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$); + $spf$nav$cancel$$(); + $opt_options$$19_options$$9_xhr$$inline_144$$ = $opt_options$$19_options$$9_xhr$$inline_144$$ || {}; + $opt_referer_referer$$1$$ = void 0 == $opt_referer_referer$$1$$ ? window.location.href : $opt_referer_referer$$1$$; + $current$$4_history$$inline_131_opt_current$$3$$ = $history$$inline_139_opt_history_promoteKey$$inline_133$$ ? $current$$4_history$$inline_131_opt_current$$3$$ : window.location.href; + var $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$; + a: { + if (-1 != $url$$73$$.indexOf("#") && ($JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$ = $spf$url$absolute$$($url$$73$$), $spf$string$partition$$($current$$4_history$$inline_131_opt_current$$3$$ || window.location.href)[0] == $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$)) { + $spf$debug$debug$$(" not handling hash-only URL"); + $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$ = !1; + break a; + } + $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$ = !0; + } + if ($JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$) { + if ($spf$nav$dispatchRequest_$$($url$$73$$, $opt_referer_referer$$1$$, $current$$4_history$$inline_131_opt_current$$3$$, $opt_options$$19_options$$9_xhr$$inline_144$$)) { + $spf$state$set$$("nav-counter", (parseInt($spf$state$values_$$["nav-counter"], 10) || 0) + 1); + $spf$nav$cancelAllPrefetchesExcept$$($url$$73$$); + $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$ = $spf$url$absolute$$($url$$73$$); + var $handleSuccess$$inline_143_opt_skipKey$$inline_123$$ = "preprocess " + $spf$url$absolute$$($JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$), $key$$inline_126_prefetchXhr_reverse$$inline_140$$; + for ($key$$inline_126_prefetchXhr_reverse$$inline_140$$ in $spf$tasks$queues_$$) { + $handleSuccess$$inline_143_opt_skipKey$$inline_123$$ != $key$$inline_126_prefetchXhr_reverse$$inline_140$$ && 0 == $key$$inline_126_prefetchXhr_reverse$$inline_140$$.lastIndexOf("preprocess", 0) && $spf$tasks$cancel$$($key$$inline_126_prefetchXhr_reverse$$inline_140$$); + } + $key$$inline_126_prefetchXhr_reverse$$inline_140$$ = $spf$nav$prefetches_$$()[$JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$]; + $spf$state$set$$("nav-request", $key$$inline_126_prefetchXhr_reverse$$inline_140$$); + $spf$state$set$$("nav-promote", null); + $spf$state$set$$("nav-promote-time", null); + $key$$inline_126_prefetchXhr_reverse$$inline_140$$ && 4 != $key$$inline_126_prefetchXhr_reverse$$inline_140$$.readyState ? ($current$$4_history$$inline_131_opt_current$$3$$ = !!$history$$inline_139_opt_history_promoteKey$$inline_133$$, $spf$debug$debug$$("nav.navigatePromotePrefetch_ ", $url$$73$$), $handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$ = "preprocess " + $spf$url$absolute$$($url$$73$$), $history$$inline_139_opt_history_promoteKey$$inline_133$$ = "promote " + $spf$url$absolute$$($url$$73$$), + $spf$state$set$$("nav-promote", $url$$73$$), $spf$state$set$$("nav-promote-time", $spf$now$$()), $spf$tasks$cancel$$($handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$), $spf$tasks$run$$($history$$inline_139_opt_history_promoteKey$$inline_133$$, !0), $current$$4_history$$inline_131_opt_current$$3$$ || $spf$nav$navigateAddHistory_$$($url$$73$$, $opt_referer_referer$$1$$, $spf$bind$$($spf$nav$handleNavigateError_$$, null, $opt_options$$19_options$$9_xhr$$inline_144$$))) : ($history$$inline_139_opt_history_promoteKey$$inline_133$$ = + !!$history$$inline_139_opt_history_promoteKey$$inline_133$$, $key$$inline_126_prefetchXhr_reverse$$inline_140$$ = !!$handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$, $handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$ = $spf$bind$$($spf$nav$handleNavigateError_$$, null, $opt_options$$19_options$$9_xhr$$inline_144$$), $JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$ = $spf$bind$$($spf$nav$handleNavigatePart_$$, null, + $opt_options$$19_options$$9_xhr$$inline_144$$, $key$$inline_126_prefetchXhr_reverse$$inline_140$$), $handleSuccess$$inline_143_opt_skipKey$$inline_123$$ = $spf$bind$$($spf$nav$handleNavigateSuccess_$$, null, $opt_options$$19_options$$9_xhr$$inline_144$$, $key$$inline_126_prefetchXhr_reverse$$inline_140$$, ""), $spf$config$values$$["advanced-navigate-persist-timing"] || $spf$nav$clearResourceTimings_$$(), $opt_options$$19_options$$9_xhr$$inline_144$$ = $spf$nav$request$send$$($url$$73$$, {method:$opt_options$$19_options$$9_xhr$$inline_144$$.method, + $onPart$:$JSCompiler_inline_result$$15_absoluteUrl$$2_absoluteUrl$$inline_121_handlePart$$inline_142$$, $onError$:$handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$, $onSuccess$:$handleSuccess$$inline_143_opt_skipKey$$inline_123$$, $postData$:$opt_options$$19_options$$9_xhr$$inline_144$$.postData, type:"navigate" + ($history$$inline_139_opt_history_promoteKey$$inline_133$$ ? $key$$inline_126_prefetchXhr_reverse$$inline_140$$ ? "-back" : "-forward" : ""), current:$current$$4_history$$inline_131_opt_current$$3$$, + $referer$:$opt_referer_referer$$1$$}), $spf$state$set$$("nav-request", $opt_options$$19_options$$9_xhr$$inline_144$$), $history$$inline_139_opt_history_promoteKey$$inline_133$$ || $spf$nav$navigateAddHistory_$$($url$$73$$, $opt_referer_referer$$1$$, $handleError$$inline_141_opt_reverse$$1_preprocessKey$$inline_132$$)); + } else { + $spf$nav$reload$$($url$$73$$, $spf$nav$ReloadReason$REQUEST_CANCELED$$); + } + } else { + $spf$nav$navigateScroll_$$($url$$73$$), $history$$inline_139_opt_history_promoteKey$$inline_133$$ || $spf$nav$navigateAddHistory_$$($url$$73$$, $opt_referer_referer$$1$$, $spf$bind$$($spf$nav$handleNavigateError_$$, null, $opt_options$$19_options$$9_xhr$$inline_144$$)); + } +} +function $spf$nav$navigateScroll_$$($result$$11_url$$76$$) { + $result$$11_url$$76$$ = $spf$string$partition$$($result$$11_url$$76$$); + if ($result$$11_url$$76$$[1]) { + if ($result$$11_url$$76$$[2]) { + var $el$$14$$ = document.getElementById($result$$11_url$$76$$[2]); + $el$$14$$ && ($spf$debug$debug$$(" scrolling into view", $result$$11_url$$76$$[2]), $el$$14$$.scrollIntoView()); + } else { + $spf$debug$debug$$(" scrolling to top"), window.scroll(0, 0); + } + } +} +function $spf$nav$navigateAddHistory_$$($url$$77$$, $referer$$4_state$$2$$, $handleError$$3$$) { + try { + $referer$$4_state$$2$$ = {"spf-referer":$referer$$4_state$$2$$}, $spf$url$absolute$$($url$$77$$, !0) == window.location.href ? $spf$history$replace$$($url$$77$$, null, !1, !0) : ($spf$debug$info$$("history.add ", $url$$77$$), $spf$history$push_$$(!1, $url$$77$$, $referer$$4_state$$2$$, void 0)); + } catch ($err$$4$$) { + $spf$nav$cancel$$(), $spf$debug$error$$("error caught, redirecting ", "(url=", $url$$77$$, "err=", $err$$4$$, ")"), $handleError$$3$$($url$$77$$, $err$$4$$); + } +} +function $spf$nav$handleNavigateError_$$($options$$12$$, $url$$78$$, $err$$5$$) { + $spf$debug$warn$$("navigate error", "(url=", $url$$78$$, ")"); + $spf$state$set$$("nav-request", null); + $spf$nav$dispatchError_$$($url$$78$$, $err$$5$$, $options$$12$$) && $spf$nav$reload$$($url$$78$$, $spf$nav$ReloadReason$ERROR$$, $err$$5$$); +} +function $spf$nav$handleNavigatePart_$$($options$$13$$, $reverse$$3$$, $url$$79$$, $partial$$) { + if ($spf$nav$dispatchPartProcess_$$($url$$79$$, $partial$$, $options$$13$$)) { + if ($partial$$.reload) { + $spf$nav$reload$$($url$$79$$, $spf$nav$ReloadReason$RESPONSE_RECEIVED$$); + } else { + if ($partial$$.redirect) { + $spf$nav$handleNavigateRedirect_$$($options$$13$$, $partial$$.redirect); + } else { + try { + $spf$nav$response$process$$($url$$79$$, $partial$$, function() { + $spf$nav$dispatchPartDone_$$($url$$79$$, $partial$$, $options$$13$$); + }, !0, $reverse$$3$$); + } catch ($err$$6$$) { + $spf$debug$debug$$(" failed to process part", $partial$$), $spf$nav$handleNavigateError_$$($options$$13$$, $url$$79$$, $err$$6$$); + } + } + } + } else { + $spf$nav$reload$$($url$$79$$, $spf$nav$ReloadReason$PART_PROCESS_CANCELED$$); + } +} +function $spf$nav$handleNavigateSuccess_$$($options$$14$$, $reverse$$4$$, $multipart$$1_original_timing$$10$$, $url$$80$$, $response$$8$$) { + $spf$state$set$$("nav-request", null); + $spf$state$values_$$["nav-promote"] == $multipart$$1_original_timing$$10$$ && ($multipart$$1_original_timing$$10$$ = $response$$8$$.timing || {}, $multipart$$1_original_timing$$10$$.navigationStart = $spf$state$values_$$["nav-promote-time"], $multipart$$1_original_timing$$10$$.spfPrefetched = !0); + $multipart$$1_original_timing$$10$$ = "multipart" == $response$$8$$.type; + if (!$multipart$$1_original_timing$$10$$) { + if (!$spf$nav$dispatchProcess_$$($url$$80$$, $response$$8$$, $options$$14$$)) { + $spf$nav$reload$$($url$$80$$, $spf$nav$ReloadReason$PROCESS_CANCELED$$); + return; + } + if ($response$$8$$.reload) { + $spf$nav$reload$$($url$$80$$, $spf$nav$ReloadReason$RESPONSE_RECEIVED$$); + return; + } + if ($response$$8$$.redirect) { + $spf$nav$handleNavigateRedirect_$$($options$$14$$, $response$$8$$.redirect); + return; + } + } + try { + $spf$nav$response$process$$($url$$80$$, $multipart$$1_original_timing$$10$$ ? {} : $response$$8$$, function() { + $spf$nav$navigateScroll_$$($url$$80$$); + $spf$nav$dispatchDone_$$($url$$80$$, $response$$8$$, $options$$14$$); + }, !0, $reverse$$4$$); + } catch ($err$$7$$) { + $spf$debug$debug$$(" failed to process response", $response$$8$$), $spf$nav$handleNavigateError_$$($options$$14$$, $url$$80$$, $err$$7$$); + } +} +function $spf$nav$handleNavigateRedirect_$$($options$$15$$, $redirectUrl$$) { + try { + $redirectUrl$$ += window.location.hash, $spf$history$replace$$($redirectUrl$$, null, !0, !0); + } catch ($err$$8$$) { + $spf$nav$cancel$$(), $spf$debug$error$$("error caught, reloading ", "(url=", $redirectUrl$$, "err=", $err$$8$$, ")"), $spf$nav$handleNavigateError_$$($options$$15$$, $redirectUrl$$, $err$$8$$); + } +} +function $spf$nav$cancel$$() { + var $xhr$$6$$ = $spf$state$values_$$["nav-request"]; + $xhr$$6$$ && ($spf$debug$warn$$("aborting previous navigate ", "xhr=", $xhr$$6$$), $xhr$$6$$.abort(), $spf$state$set$$("nav-request", null)); +} +function $spf$nav$callback$$($fn$$15$$, $var_args$$35$$) { + var $args$$4_val$$4$$; + $fn$$15$$ && ($args$$4_val$$4$$ = Array.prototype.slice.call(arguments), $args$$4_val$$4$$[0] = $fn$$15$$, $args$$4_val$$4$$ = $spf$execute$$.apply(null, $args$$4_val$$4$$), $args$$4_val$$4$$ instanceof Error && $spf$debug$error$$("error in callback (url=", window.location.href, "err=", $args$$4_val$$4$$, ")")); + return!1 !== $args$$4_val$$4$$; +} +function $spf$nav$reload$$($url$$81$$, $reason$$, $err$$9_opt_err$$) { + $err$$9_opt_err$$ = $err$$9_opt_err$$ ? $err$$9_opt_err$$.message : ""; + $spf$debug$warn$$("reloading (", "url=", $url$$81$$, "reason=", $reason$$, "error=", $err$$9_opt_err$$, ")"); + $spf$nav$cancel$$(); + $spf$nav$cancelAllPrefetchesExcept$$(); + var $logReason$$ = $reason$$; + $err$$9_opt_err$$ && ($logReason$$ += " Message: " + $err$$9_opt_err$$); + $spf$dispatch$$("spfreload", {url:$url$$81$$, reason:$logReason$$}); + $spf$config$values$$["experimental-remove-history"] && window.location.href == $url$$81$$ && ($spf$state$set$$("history-ignore-pop", !0), window.history.back()); + setTimeout(function() { + var $reloadId$$1_url$$inline_154$$ = $spf$config$values$$["reload-identifier"]; + if ($reloadId$$1_url$$inline_154$$) { + var $params$$ = {}; + $params$$[$reloadId$$1_url$$inline_154$$] = encodeURIComponent($reason$$); + var $reloadId$$1_url$$inline_154$$ = $url$$81$$, $result$$inline_156$$ = $spf$string$partition$$($reloadId$$1_url$$inline_154$$), $reloadId$$1_url$$inline_154$$ = $result$$inline_156$$[0], $delim$$inline_157$$ = -1 != $reloadId$$1_url$$inline_154$$.indexOf("?") ? "&" : "?", $key$$inline_158$$; + for ($key$$inline_158$$ in $params$$) { + $reloadId$$1_url$$inline_154$$ += $delim$$inline_157$$ + $key$$inline_158$$, $params$$[$key$$inline_158$$] && ($reloadId$$1_url$$inline_154$$ += "=" + $params$$[$key$$inline_158$$]), $delim$$inline_157$$ = "&"; + } + $url$$81$$ = $reloadId$$1_url$$inline_154$$ + $result$$inline_156$$[1] + $result$$inline_156$$[2]; + } + window.location.href = $url$$81$$; + }, 0); +} +function $spf$nav$load_$$($url$$83$$, $opt_options$$21_options$$16$$, $opt_original_original$$1$$) { + $spf$debug$info$$("nav.load ", $url$$83$$, $opt_options$$21_options$$16$$, $opt_original_original$$1$$); + $opt_options$$21_options$$16$$ = $opt_options$$21_options$$16$$ || {}; + $opt_original_original$$1$$ = $opt_original_original$$1$$ || $url$$83$$; + $spf$nav$dispatchRequest_$$($url$$83$$, void 0, void 0, $opt_options$$21_options$$16$$, !0) && $spf$nav$request$send$$($url$$83$$, {method:$opt_options$$21_options$$16$$.method, $onPart$:$spf$bind$$($spf$nav$handleLoadPart_$$, null, !1, $opt_options$$21_options$$16$$, $opt_original_original$$1$$), $onError$:$spf$bind$$($spf$nav$handleLoadError_$$, null, !1, $opt_options$$21_options$$16$$, $opt_original_original$$1$$), $onSuccess$:$spf$bind$$($spf$nav$handleLoadSuccess_$$, null, !1, $opt_options$$21_options$$16$$, + $opt_original_original$$1$$), $postData$:$opt_options$$21_options$$16$$.postData, type:"load"}); +} +function $spf$nav$prefetch_$$($absoluteUrl$$inline_162_url$$85$$, $opt_options$$23_options$$17_xhr$$inline_161$$, $opt_original$$1_original$$2$$) { + $spf$debug$info$$("nav.prefetch ", $absoluteUrl$$inline_162_url$$85$$, $opt_options$$23_options$$17_xhr$$inline_161$$, $opt_original$$1_original$$2$$); + $opt_options$$23_options$$17_xhr$$inline_161$$ = $opt_options$$23_options$$17_xhr$$inline_161$$ || {}; + $opt_original$$1_original$$2$$ = $opt_original$$1_original$$2$$ || $absoluteUrl$$inline_162_url$$85$$; + var $current$$6$$ = window.location.href; + $spf$nav$dispatchRequest_$$($absoluteUrl$$inline_162_url$$85$$, void 0, void 0, $opt_options$$23_options$$17_xhr$$inline_161$$, !0) && ($opt_options$$23_options$$17_xhr$$inline_161$$ = $spf$nav$request$send$$($absoluteUrl$$inline_162_url$$85$$, {method:$opt_options$$23_options$$17_xhr$$inline_161$$.method, $onPart$:$spf$bind$$($spf$nav$handleLoadPart_$$, null, !0, $opt_options$$23_options$$17_xhr$$inline_161$$, $opt_original$$1_original$$2$$), $onError$:$spf$bind$$($spf$nav$handleLoadError_$$, + null, !0, $opt_options$$23_options$$17_xhr$$inline_161$$, $opt_original$$1_original$$2$$), $onSuccess$:$spf$bind$$($spf$nav$handleLoadSuccess_$$, null, !0, $opt_options$$23_options$$17_xhr$$inline_161$$, $opt_original$$1_original$$2$$), $postData$:$opt_options$$23_options$$17_xhr$$inline_161$$.postData, type:"prefetch", current:$current$$6$$}), $spf$debug$debug$$("nav.addPrefetch ", $absoluteUrl$$inline_162_url$$85$$, $opt_options$$23_options$$17_xhr$$inline_161$$), $absoluteUrl$$inline_162_url$$85$$ = + $spf$url$absolute$$($absoluteUrl$$inline_162_url$$85$$), $spf$nav$prefetches_$$()[$absoluteUrl$$inline_162_url$$85$$] = $opt_options$$23_options$$17_xhr$$inline_161$$); +} +function $spf$nav$handleLoadError_$$($isPrefetch$$, $options$$18$$, $original$$3$$, $url$$86$$, $err$$10$$) { + $spf$debug$warn$$($isPrefetch$$ ? "prefetch" : "load", "error", "(url=", $url$$86$$, ")"); + $isPrefetch$$ && $spf$nav$removePrefetch$$($url$$86$$); + $isPrefetch$$ && $spf$state$values_$$["nav-promote"] == $original$$3$$ ? $spf$nav$handleNavigateError_$$($options$$18$$, $url$$86$$, $err$$10$$) : $spf$nav$dispatchError_$$($url$$86$$, $err$$10$$, $options$$18$$, !0); +} +function $spf$nav$handleLoadPart_$$($isPrefetch$$1$$, $options$$19$$, $original$$4$$, $url$$87$$, $partial$$1$$) { + if ($spf$nav$dispatchPartProcess_$$($url$$87$$, $partial$$1$$, $options$$19$$, !0)) { + if ($partial$$1$$.reload) { + if (!$isPrefetch$$1$$) { + return; + } + if ($spf$state$values_$$["nav-promote"] == $original$$4$$) { + $spf$nav$reload$$($url$$87$$, $spf$nav$ReloadReason$RESPONSE_RECEIVED$$); + return; + } + } + if ($partial$$1$$.redirect) { + $spf$nav$handleLoadRedirect_$$($isPrefetch$$1$$, $options$$19$$, $original$$4$$, $partial$$1$$.redirect); + } else { + if ($isPrefetch$$1$$) { + var $fn$$16$$ = $spf$bind$$($spf$nav$handleNavigatePart_$$, null, $options$$19$$, !1, $url$$87$$, $partial$$1$$), $promoteKey$$1$$ = "promote " + $spf$url$absolute$$($original$$4$$); + $spf$tasks$add$$($promoteKey$$1$$, $fn$$16$$); + if ($spf$state$values_$$["nav-promote"] == $original$$4$$) { + $spf$tasks$run$$($promoteKey$$1$$, !0); + return; + } + } + ($isPrefetch$$1$$ ? $spf$nav$response$preprocess$$ : $spf$nav$response$process$$)($url$$87$$, $partial$$1$$, function() { + $spf$nav$dispatchPartDone_$$($url$$87$$, $partial$$1$$, $options$$19$$, !0); + }); + } + } +} +function $spf$nav$handleLoadSuccess_$$($isPrefetch$$2$$, $options$$20$$, $original$$5$$, $url$$88$$, $response$$9$$) { + var $multipart$$2$$ = "multipart" == $response$$9$$.type; + if (!$multipart$$2$$) { + if (!$spf$nav$dispatchProcess_$$($url$$88$$, $response$$9$$, $options$$20$$, !0)) { + $spf$nav$reload$$($url$$88$$, $spf$nav$ReloadReason$PROCESS_CANCELED$$); + return; + } + if ($response$$9$$.reload) { + if (!$isPrefetch$$2$$) { + return; + } + if ($spf$state$values_$$["nav-promote"] == $original$$5$$) { + $spf$nav$reload$$($url$$88$$, $spf$nav$ReloadReason$RESPONSE_RECEIVED$$); + return; + } + } + if ($response$$9$$.redirect) { + $spf$nav$handleLoadRedirect_$$($isPrefetch$$2$$, $options$$20$$, $original$$5$$, $response$$9$$.redirect); + return; + } + } + var $processFn$$1_promoteKey$$2$$ = "promote " + $spf$url$absolute$$($original$$5$$); + if ($isPrefetch$$2$$) { + $spf$nav$removePrefetch$$($url$$88$$); + if ($spf$state$values_$$["nav-promote"] == $original$$5$$) { + $spf$tasks$add$$($processFn$$1_promoteKey$$2$$, $spf$bind$$($spf$nav$handleNavigateSuccess_$$, null, $options$$20$$, !1, $original$$5$$, $url$$88$$, $response$$9$$)); + $spf$tasks$run$$($processFn$$1_promoteKey$$2$$, !0); + return; + } + $spf$tasks$cancel$$($processFn$$1_promoteKey$$2$$); + } + $processFn$$1_promoteKey$$2$$ = $isPrefetch$$2$$ ? $spf$nav$response$preprocess$$ : $spf$nav$response$process$$; + try { + $processFn$$1_promoteKey$$2$$($url$$88$$, $multipart$$2$$ ? {} : $response$$9$$, function() { + $spf$nav$dispatchDone_$$($url$$88$$, $response$$9$$, $options$$20$$, !0); + }); + } catch ($err$$11$$) { + $spf$debug$debug$$(" failed to process response", $response$$9$$), $spf$nav$handleLoadError_$$($isPrefetch$$2$$, $options$$20$$, $original$$5$$, $url$$88$$, $err$$11$$); + } +} +function $spf$nav$handleLoadRedirect_$$($isPrefetch$$3_redirectFn$$, $options$$21$$, $original$$6$$, $redirectUrl$$1$$) { + $isPrefetch$$3_redirectFn$$ = $isPrefetch$$3_redirectFn$$ ? $spf$nav$prefetch_$$ : $spf$nav$load_$$; + var $redirectOpts$$ = {}; + $spf$array$each$$([$spf$nav$Callback$ERROR$$, $spf$nav$Callback$REQUEST$$, $spf$nav$Callback$PART_PROCESS$$, $spf$nav$Callback$PART_DONE$$, $spf$nav$Callback$PROCESS$$, $spf$nav$Callback$DONE$$], function($key$$50$$) { + $redirectOpts$$[$key$$50$$] = $options$$21$$[$key$$50$$]; + }); + $isPrefetch$$3_redirectFn$$($redirectUrl$$1$$, $redirectOpts$$, $original$$6$$); +} +function $spf$nav$dispatchError_$$($detail$$3_url$$90$$, $err$$12$$, $opt_options$$24_proceed$$, $opt_noEvents$$) { + $detail$$3_url$$90$$ = {url:$detail$$3_url$$90$$, err:$err$$12$$}; + ($opt_options$$24_proceed$$ = $spf$nav$callback$$(($opt_options$$24_proceed$$ || {})[$spf$nav$Callback$ERROR$$], $detail$$3_url$$90$$)) && !$opt_noEvents$$ && ($opt_options$$24_proceed$$ = $spf$dispatch$$("spferror", $detail$$3_url$$90$$)); + return $opt_options$$24_proceed$$; +} +function $spf$nav$dispatchRequest_$$($detail$$7_url$$94$$, $referer$$5$$, $previous$$2$$, $opt_options$$25_proceed$$1$$, $opt_noEvents$$1$$) { + $detail$$7_url$$94$$ = {url:$detail$$7_url$$94$$, referer:$referer$$5$$, previous:$previous$$2$$}; + ($opt_options$$25_proceed$$1$$ = $spf$nav$callback$$(($opt_options$$25_proceed$$1$$ || {})[$spf$nav$Callback$REQUEST$$], $detail$$7_url$$94$$)) && !$opt_noEvents$$1$$ && ($opt_options$$25_proceed$$1$$ = $spf$dispatch$$("spfrequest", $detail$$7_url$$94$$)); + return $opt_options$$25_proceed$$1$$; +} +function $spf$nav$dispatchPartProcess_$$($detail$$8_url$$95$$, $partial$$2$$, $opt_options$$26_proceed$$2$$, $opt_noEvents$$2$$) { + $detail$$8_url$$95$$ = {url:$detail$$8_url$$95$$, part:$partial$$2$$}; + ($opt_options$$26_proceed$$2$$ = $spf$nav$callback$$(($opt_options$$26_proceed$$2$$ || {})[$spf$nav$Callback$PART_PROCESS$$], $detail$$8_url$$95$$)) && !$opt_noEvents$$2$$ && ($opt_options$$26_proceed$$2$$ = $spf$dispatch$$("spfpartprocess", $detail$$8_url$$95$$)); + return $opt_options$$26_proceed$$2$$; +} +function $spf$nav$dispatchPartDone_$$($detail$$9_url$$96$$, $partial$$3$$, $opt_options$$27$$, $opt_noEvents$$3$$) { + $detail$$9_url$$96$$ = {url:$detail$$9_url$$96$$, part:$partial$$3$$}; + $spf$nav$callback$$(($opt_options$$27$$ || {})[$spf$nav$Callback$PART_DONE$$], $detail$$9_url$$96$$) && !$opt_noEvents$$3$$ && $spf$dispatch$$("spfpartdone", $detail$$9_url$$96$$); +} +function $spf$nav$dispatchProcess_$$($detail$$10_url$$97$$, $response$$11$$, $opt_options$$28_proceed$$4$$, $opt_noEvents$$4$$) { + $detail$$10_url$$97$$ = {url:$detail$$10_url$$97$$, response:$response$$11$$}; + ($opt_options$$28_proceed$$4$$ = $spf$nav$callback$$(($opt_options$$28_proceed$$4$$ || {})[$spf$nav$Callback$PROCESS$$], $detail$$10_url$$97$$)) && !$opt_noEvents$$4$$ && ($opt_options$$28_proceed$$4$$ = $spf$dispatch$$("spfprocess", $detail$$10_url$$97$$)); + return $opt_options$$28_proceed$$4$$; +} +function $spf$nav$dispatchDone_$$($detail$$11_url$$98$$, $response$$12$$, $opt_options$$29$$, $opt_noEvents$$5$$) { + $detail$$11_url$$98$$ = {url:$detail$$11_url$$98$$, response:$response$$12$$}; + $spf$nav$callback$$(($opt_options$$29$$ || {})[$spf$nav$Callback$DONE$$], $detail$$11_url$$98$$) && !$opt_noEvents$$5$$ && $spf$dispatch$$("spfdone", $detail$$11_url$$98$$); +} +function $spf$nav$removePrefetch$$($absoluteUrl$$4_url$$102$$) { + $spf$debug$debug$$("nav.removePrefetch ", $absoluteUrl$$4_url$$102$$); + $absoluteUrl$$4_url$$102$$ = $spf$url$absolute$$($absoluteUrl$$4_url$$102$$); + var $prefetches$$2$$ = $spf$nav$prefetches_$$(), $prefetchXhr$$1$$ = $prefetches$$2$$[$absoluteUrl$$4_url$$102$$]; + $prefetchXhr$$1$$ && $prefetchXhr$$1$$.abort(); + delete $prefetches$$2$$[$absoluteUrl$$4_url$$102$$]; +} +function $spf$nav$cancelAllPrefetchesExcept$$($absoluteUrl$$5_opt_skipUrl$$) { + $spf$debug$debug$$("nav.cancelAllPrefetchesExcept", $absoluteUrl$$5_opt_skipUrl$$); + var $prefetches$$3$$ = $spf$nav$prefetches_$$(); + $absoluteUrl$$5_opt_skipUrl$$ = $absoluteUrl$$5_opt_skipUrl$$ && $spf$url$absolute$$($absoluteUrl$$5_opt_skipUrl$$); + for (var $key$$51$$ in $prefetches$$3$$) { + $absoluteUrl$$5_opt_skipUrl$$ != $key$$51$$ && $spf$nav$removePrefetch$$($key$$51$$); + } +} +var $spf$nav$clearResourceTimings_$$, $clearResourceTimings$$inline_164$$ = window.performance && (window.performance.clearResourceTimings || window.performance.webkitClearResourceTimings || window.performance.mozClearResourceTimings || window.performance.msClearResourceTimings || window.performance.oClearResourceTimings); +$spf$nav$clearResourceTimings_$$ = $clearResourceTimings$$inline_164$$ ? $spf$bind$$($clearResourceTimings$$inline_164$$, window.performance) : $spf$nullFunction$$; +function $spf$nav$prefetches_$$() { + return "nav-prefetches" in $spf$state$values_$$ ? $spf$state$values_$$["nav-prefetches"] : $spf$state$set$$("nav-prefetches", {}); +} +var $spf$nav$Callback$ERROR$$ = "onError", $spf$nav$Callback$REQUEST$$ = "onRequest", $spf$nav$Callback$PART_PROCESS$$ = "onPartProcess", $spf$nav$Callback$PART_DONE$$ = "onPartDone", $spf$nav$Callback$PROCESS$$ = "onProcess", $spf$nav$Callback$DONE$$ = "onDone", $spf$nav$ReloadReason$INELIGIBLE$$ = "1: Navigation not initialized or limit reached.", $spf$nav$ReloadReason$REQUEST_CANCELED$$ = "2: Navigation canceled by the request event.", $spf$nav$ReloadReason$PART_PROCESS_CANCELED$$ = "3: Navigation canceled by the partprocess event.", +$spf$nav$ReloadReason$PROCESS_CANCELED$$ = "4: Navigation canceled by the process event.", $spf$nav$ReloadReason$RESPONSE_RECEIVED$$ = "5: Reload response received.", $spf$nav$ReloadReason$FORBIDDEN$$ = "9: Destination forbidden by same-origin security.", $spf$nav$ReloadReason$ERROR$$ = "10: An uncaught error occurred processing."; +function $spf$main$discover_$$() { + $spf$net$resource$discover$$($spf$net$resource$Type$JS$$); + $spf$net$resource$discover$$($spf$net$resource$Type$CSS$$); + "complete" == document.readyState && (document.removeEventListener ? document.removeEventListener("DOMContentLoaded", $spf$main$discover_$$, !1) : document.detachEvent && document.detachEvent("onreadystatechange", $spf$main$discover_$$)); +} +document.addEventListener ? document.addEventListener("DOMContentLoaded", $spf$main$discover_$$, !1) : document.attachEvent && document.attachEvent("onreadystatechange", $spf$main$discover_$$); +$spf$main$discover_$$(); +var $spf$main$api_$$ = {init:function($config$$inline_169_opt_config$$1_url$$inline_206$$) { + var $enable$$ = !("function" != typeof window.history.pushState && !$spf$history$getIframe$$().contentWindow.history.pushState); + $spf$debug$info$$("main.init ", "enable=", $enable$$); + $config$$inline_169_opt_config$$1_url$$inline_206$$ = $config$$inline_169_opt_config$$1_url$$inline_206$$ || {}; + for (var $errorCallback$$inline_205_key$$inline_170$$ in $spf$config$defaults$$) { + $spf$config$values$$[$errorCallback$$inline_205_key$$inline_170$$] = $errorCallback$$inline_205_key$$inline_170$$ in $config$$inline_169_opt_config$$1_url$$inline_206$$ ? $config$$inline_169_opt_config$$1_url$$inline_206$$[$errorCallback$$inline_205_key$$inline_170$$] : $spf$config$defaults$$[$errorCallback$$inline_205_key$$inline_170$$]; + } + for ($errorCallback$$inline_205_key$$inline_170$$ in $config$$inline_169_opt_config$$1_url$$inline_206$$) { + $errorCallback$$inline_205_key$$inline_170$$ in $spf$config$defaults$$ || ($spf$config$values$$[$errorCallback$$inline_205_key$$inline_170$$] = $config$$inline_169_opt_config$$1_url$$inline_206$$[$errorCallback$$inline_205_key$$inline_170$$]); + } + if ($enable$$) { + $errorCallback$$inline_205_key$$inline_170$$ = $spf$nav$dispatchError_$$; + if (!$spf$state$values_$$["history-init"] && window.addEventListener) { + $config$$inline_169_opt_config$$1_url$$inline_206$$ = window.location.href; + window.addEventListener("popstate", $spf$history$pop_$$, !1); + $spf$state$set$$("history-init", !0); + $spf$state$set$$("history-callback", $spf$nav$handleHistory_$$); + $spf$state$set$$("history-error-callback", $errorCallback$$inline_205_key$$inline_170$$); + $spf$state$set$$("history-listener", $spf$history$pop_$$); + $spf$state$set$$("history-url", $config$$inline_169_opt_config$$1_url$$inline_206$$); + $spf$state$set$$("history-timestamp", $spf$now$$()); + var $historyState$$inline_207$$ = {"spf-referer":document.referrer}; + try { + $spf$history$replace$$($config$$inline_169_opt_config$$1_url$$inline_206$$, $historyState$$inline_207$$); + } catch ($err$$inline_208$$) { + $errorCallback$$inline_205_key$$inline_170$$ && $errorCallback$$inline_205_key$$inline_170$$($config$$inline_169_opt_config$$1_url$$inline_206$$, $err$$inline_208$$); + } + } + !$spf$state$values_$$["nav-init"] && document.addEventListener && (document.addEventListener("click", $spf$nav$handleClick_$$, !1), !$spf$config$values$$["experimental-prefetch-mousedown"] || "ontouchstart" in window || 0 < window.navigator.maxTouchPoints || 0 < window.navigator.msMaxTouchPoints || (document.addEventListener("mousedown", $spf$nav$handleMouseDown_$$, !1), $spf$state$set$$("prefetch-listener", $spf$nav$handleMouseDown_$$)), $spf$state$set$$("nav-init", !0), $spf$state$set$$("nav-init-time", + $spf$now$$()), $spf$state$set$$("nav-counter", 0), $spf$state$set$$("nav-listener", $spf$nav$handleClick_$$)); + } + return $enable$$; +}, dispose:function() { + "undefined" != typeof History && History.prototype.pushState && ($spf$nav$cancel$$(), $spf$state$values_$$["nav-init"] && (document.removeEventListener && (document.removeEventListener("click", $spf$state$values_$$["nav-listener"], !1), $spf$config$values$$["experimental-prefetch-mousedown"] && document.removeEventListener("mousedown", $spf$state$values_$$["prefetch-listener"], !1)), $spf$state$set$$("nav-init", !1), $spf$state$set$$("nav-init-time", null), $spf$state$set$$("nav-counter", null), + $spf$state$set$$("nav-listener", null)), $spf$state$values_$$["history-init"] && (window.removeEventListener && window.removeEventListener("popstate", $spf$state$values_$$["history-listener"], !1), $spf$state$set$$("history-init", !1), $spf$state$set$$("history-callback", null), $spf$state$set$$("history-error-callback", null), $spf$state$set$$("history-listener", null), $spf$state$set$$("history-url", null), $spf$state$set$$("history-timestamp", 0))); + for (var $key$$inline_174$$ in $spf$config$values$$) { + delete $spf$config$values$$[$key$$inline_174$$]; + } +}, navigate:function($url$$72$$, $opt_options$$18$$) { + $spf$debug$debug$$("nav.navigate ", "(url=", $url$$72$$, "options=", $opt_options$$18$$, ")"); + $url$$72$$ && ($spf$nav$isAllowed_$$($url$$72$$) ? $spf$nav$isEligible_$$() ? $spf$nav$navigate_$$($url$$72$$, $opt_options$$18$$) : $spf$nav$reload$$($url$$72$$, $spf$nav$ReloadReason$INELIGIBLE$$) : $spf$nav$reload$$($url$$72$$, $spf$nav$ReloadReason$FORBIDDEN$$)); +}, load:function($url$$82$$, $opt_options$$20$$) { + $spf$nav$load_$$($url$$82$$, $opt_options$$20$$); +}, prefetch:function($url$$84$$, $opt_options$$22$$) { + $spf$nav$prefetch_$$($url$$84$$, $opt_options$$22$$); +}, process:function($response$$10$$, $opt_callback$$11$$) { + function $done$$($index$$47$$, $max$$2$$, $_$$1$$, $resp$$) { + $index$$47$$ == $max$$2$$ && $opt_callback$$11$$ && $opt_callback$$11$$($resp$$); + } + var $url$$89$$ = window.location.href; + if ("multipart" == $response$$10$$.type) { + for (var $parts$$4$$ = $response$$10$$.parts, $i$$21$$ = 0;$i$$21$$ < $parts$$4$$.length;$i$$21$$++) { + var $fn$$18$$ = $spf$bind$$($done$$, null, $i$$21$$, $parts$$4$$.length - 1); + $spf$nav$response$process$$($url$$89$$, $parts$$4$$[$i$$21$$], $fn$$18$$); + } + } else { + $fn$$18$$ = $spf$bind$$($done$$, null, 0, 0), $spf$nav$response$process$$($url$$89$$, $response$$10$$, $fn$$18$$); + } +}}, $spf$main$extra_$$ = {cache:{remove:$spf$cache$remove$$, clear:function() { + $spf$cache$storage_$$({}); +}}, script:{load:$spf$net$script$load$$, get:$spf$net$script$get$$, ready:$spf$net$script$ready$$, done:function($name$$67$$) { + $spf$net$resource$url$set$$($spf$net$resource$Type$JS$$, $name$$67$$, ""); + $spf$net$resource$check$$($spf$net$resource$Type$JS$$); +}, require:$spf$net$script$require$$, declare:function($deps$$1$$, $opt_urls$$) { + if ($deps$$1$$) { + for (var $name$$72$$ in $deps$$1$$) { + $spf$net$script$deps_$$[$name$$72$$] = $deps$$1$$[$name$$72$$]; + } + if ($opt_urls$$) { + for ($name$$72$$ in $opt_urls$$) { + $spf$net$script$url_$$[$name$$72$$] = $opt_urls$$[$name$$72$$]; + } + } + } +}, path:function($paths$$2$$) { + $spf$state$set$$("rsrc-p-" + $spf$net$resource$Type$JS$$, $paths$$2$$); +}, unload:$spf$net$script$unload$$, ignore:function($names$$2$$, $fn$$11$$) { + $names$$2$$ = $spf$array$toArray$$($names$$2$$); + $spf$debug$debug$$("script.ignore", $names$$2$$); + var $topic$$10$$ = $spf$net$resource$key$$($spf$net$resource$Type$JS$$, $names$$2$$.sort().join("|")); + $spf$debug$debug$$(" unsubscribing", $topic$$10$$); + $spf$pubsub$unsubscribe$$($topic$$10$$, $fn$$11$$); +}, unrequire:$spf$net$script$unrequire$$, prefetch:$spf$net$script$prefetch$$}, style:{load:$spf$net$style$load$$, get:$spf$net$style$get$$, unload:function($name$$74$$) { + $spf$net$resource$unload$$($spf$net$resource$Type$CSS$$, $name$$74$$); +}, path:function($paths$$3$$) { + $spf$state$set$$("rsrc-p-" + $spf$net$resource$Type$CSS$$, $paths$$3$$); +}, prefetch:$spf$net$style$prefetch$$}}, $api$$ = this.spf = this.spf || {}, $fn1$$; +for ($fn1$$ in $spf$main$api_$$) { + $api$$[$fn1$$] = $spf$main$api_$$[$fn1$$]; +} +for (var $ns$$ in $spf$main$extra_$$) { + for (var $fn2$$ in $spf$main$extra_$$[$ns$$]) { + $api$$[$ns$$] = $api$$[$ns$$] || {}, $api$$[$ns$$][$fn2$$] = $spf$main$extra_$$[$ns$$][$fn2$$]; + } +} +$spf$dispatch$$("spfready"); +if(typeof define=='function'&&define.amd)define(spf);else if(typeof exports=='object')for(var f in spf)exports[f]=spf[f];})(); + diff --git a/dist/spf-trace.js b/dist/spf-trace.js new file mode 100644 index 00000000..5d3f8895 --- /dev/null +++ b/dist/spf-trace.js @@ -0,0 +1,77 @@ +/* +SPF 20 (v2.0.0) +(c) 2012-2014 Google, Inc. +License: MIT +*/ +/** + * https://github.com/google/tracing-framework + * Copyright 2013 Google, Inc. All Rights Reserved. + * Use of this source code is governed by a BSD-style license that can be + * found at https://github.com/google/tracing-framework/blob/master/LICENSE. + */ +(function(){function aa(a){return a};function h(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}function ba(a,b){if(a){var c=Array.prototype.slice.call(arguments,1);try{return a.apply(null,c)}catch(d){return d}}}function m(a,b){if(document.createEvent){var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!0,!0,b);return document.dispatchEvent(c)}return!0}function n(){return(new Date).getTime()}function ca(){};function p(a,b){return r[a]=b}var r=window._spf_state||{};window._spf_state=r;var da={"animation-class":"spf-animate","animation-duration":425,"cache-lifetime":6E5,"cache-max":50,"cache-unified":!1,"link-class":"spf-link","nolink-class":"spf-nolink","navigate-limit":20,"navigate-lifetime":864E5,"reload-identifier":null,"request-timeout":0,"url-identifier":"?spf=__type__"},s={};"config"in r||p("config",s);s=r.config;function t(a,b){if(a.forEach)a.forEach(b,void 0);else for(var c=0,d=a.length;c=b))for(var c=0;cg&&(a=k.responseText.substring(g),g=k.responseText.length,e.l(k,a)),clearTimeout(l),e.u&&e.u(k))};a="POST"==a;if(e.headers)for(var A in e.headers)k.setRequestHeader(A,e.headers[A]),"content-type"== +A.toLowerCase()&&(a=!1);a&&k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");0d){if(0==b.lastIndexOf("hash-",0))return b;c=r[c]||"";if("[object String]"==Object.prototype.toString.call(c))b=c+b;else for(var e in c)b=b.replace(e,c[e]);b=0>b.indexOf("."+a)?b+"."+a:b;b=z(b)}else 0==d&&(b=z(b))}return b}function J(a,b,c){return a+"-"+b+(c?"-"+c:"")}function Q(a){return a?String(a).replace(/[^\w]/g,""):""}function P(a,b,c,d){b=J(b,c,d);nb[b]=a}function N(a,b,c){a=J(a,b,c);return nb[a]} +function eb(a,b){var c=J(a,b);delete nb[c]}function kb(a,b){var c=N(a,b);return""==b||c==cb}function M(a,b,c){a=J(a,b);ob[a]=c}function K(a,b){var c=J(a,b);return ob[c]}function Xa(a,b){var c=J(a,b);delete ob[c]}function bb(a,b){var c=K(a,b);return void 0!=c&&kb(a,c)}var nb={},L={},ob={},ib=-1!=navigator.userAgent.indexOf(" Trident/"),db=1,cb=2,R="css",H="js";"rsrc-s"in r||p("rsrc-s",nb);nb=r["rsrc-s"];"rsrc-n"in r||p("rsrc-n",L);L=r["rsrc-n"];"rsrc-u"in r||p("rsrc-u",ob);ob=r["rsrc-u"];Ua=B(Ua,"spf.net.resource.load"); +$a=B($a,"spf.net.resource.unload");Ta=B(Ta,"spf.net.resource.unload_");Ya=B(Ya,"spf.net.resource.check");O=B(O,"spf.net.resource.create");ab=B(ab,"spf.net.resource.destroy");fb=B(fb,"spf.net.resource.discover");gb=B(gb,"spf.net.resource.prefetch");hb=B(hb,"spf.net.resource.prefetch_");jb=B(jb,"spf.net.resource.eval");lb=B(lb,"spf.net.resource.exec");mb=B(mb,"spf.net.resource.path");I=B(I,"spf.net.resource.canonicalize");J=B(J,"spf.net.resource.key");Q=B(Q,"spf.net.resource.label");P=B(P,"spf.net.resource.status.set"); +N=B(N,"spf.net.resource.status.get");eb=B(eb,"spf.net.resource.status.clear");kb=B(kb,"spf.net.resource.status.loaded");M=B(M,"spf.net.resource.url.set");K=B(K,"spf.net.resource.url.get");Xa=B(Xa,"spf.net.resource.url.clear");bb=B(bb,"spf.net.resource.url.loaded");function pb(a){a=u(a);t(a,function(a){gb("img",a)})}pb=B(pb,"spf.net.connect.preconnect");function qb(a,b,c){Ua(H,a,b,c)}function rb(a){$a(H,a)}function sb(){fb(H)}function tb(a,b){O(H,a,b)}function ub(a){a=u(a);t(a,function(a){gb(H,a)})}function vb(a,b,c){a=u(a);a=fa(a,function(a){return!!a});var d=[];t(a,function(a){void 0==K(H,a)&&d.push(a)});var e=!d.length;if(b){var f=ea(a,h(bb,null,H));e&&f?b():(a=J(H,a.sort().join("|")),Ca(a,b))}c&&!e&&c(d)}function wb(a){M(H,a,"");Ya(H)}function xb(a,b){a=u(a);var c=J(H,a.sort().join("|"));Da(c,b)} +function yb(a,b){a=u(a);t(a,function(a){if(a){var b=zb[a]||a,b=I(H,b),e=K(H,a);e&&b!=e&&Ab(a)}});vb(a,b,Bb)}function Bb(a){t(a,function(a){function c(){qb(e,a)}var d=S[a],e=zb[a]||a;d?yb(d,c):c()})}function Ab(a){a=u(a);t(a,function(a){var c=[],d;for(d in S){var e=S[d],e=u(e);t(e,function(e){e==a&&c.push(d)})}t(c,function(a){Ab(a)});rb(a)})}function Cb(a,b){jb(H,a,b)}function Db(a){lb(H,a)}function Eb(a,b){if(a){for(var c in a)S[c]=a[c];if(b)for(c in b)zb[c]=b[c]}}function Fb(a){mb(H,a)}var S={}; +"js-d"in r||p("js-d",S);var S=r["js-d"],zb={};"js-u"in r||p("js-u",zb);zb=r["js-u"];qb=B(qb,"spf.net.script.load");rb=B(rb,"spf.net.script.unload");sb=B(sb,"spf.net.script.discover");tb=B(tb,"spf.net.script.get");ub=B(ub,"spf.net.script.prefetch");vb=B(vb,"spf.net.script.ready");wb=B(wb,"spf.net.script.done");xb=B(xb,"spf.net.script.ignore");yb=B(yb,"spf.net.script.require");Bb=B(Bb,"spf.net.script.require_");Ab=B(Ab,"spf.net.script.unrequire");Cb=B(Cb,"spf.net.script.eval");Eb=B(Eb,"spf.net.script.declare"); +Fb=B(Fb,"spf.net.script.path");function Gb(a,b,c){Ua(R,a,b,c)}function Hb(a){$a(R,a)}function Ib(){fb(R)}function Jb(a,b){O(R,a,b)}function Kb(a){a=u(a);t(a,function(a){gb(R,a)})}function Lb(a,b){jb(R,a,b)}function Mb(a){mb(R,a)}Gb=B(Gb,"spf.net.style.load");Hb=B(Hb,"spf.net.style.unload");Ib=B(Ib,"spf.net.style.discover");Jb=B(Jb,"spf.net.style.get");Kb=B(Kb,"spf.net.style.prefetch");Lb=B(Lb,"spf.net.style.eval");Mb=B(Mb,"spf.net.style.path");function Nb(a,b,c){if(b){b=[];var d,e=0;c&&(a+="\r\n");var f=a.indexOf(Ob,e);for(-1e&&(d=a.substring(e),c&&Fa(d,"\r\n")&&(d=d.substring(0,d.length-2)));return{j:b,a:d}}a=JSON.parse(a);b="number"==typeof a.length?a:[a];return{j:b,a:""}} +function T(a,b,c,d,e){var f="process "+z(a),g=!s["experimental-process-async"],l;l=0;b.timing||(b.timing={});b.title&&(document.title=b.title);d&&b.url&&z(b.url)!=z(window.location.href)&&ta(b.url+window.location.hash,null,!1,!0);b.head&&(l=h(function(a,b){var c=U(a);Rb(c);V(c);F(f);W(c,function(){b.spfProcessHead=n();G(f,g)})},null,b.head,b.timing),l=C(f,l));b.attr&&(l=h(function(a,b){for(var c in a){var d=document.getElementById(c);if(d){var e=a[c],f=void 0;for(f in e){var g=e[f];"class"==f?d.className= +g:"style"==f?d.style.cssText=g:d.setAttribute(f,g)}}}b.spfProcessAttr=n()},null,b.attr,b.timing),l=C(f,l));d=b.body||{};var k=l,q;for(q in d)l=h(function(a,b){var c=document.getElementById(a);if(c){var d=U(b),l=s["animation-class"];if(Sb&&ma(c,l)){F(f);var k=Ra(c);E(k,!0);l={p:d,reverse:!!e,d:null,g:null,f:c,D:l+"-old",G:l+"-new",B:e?l+"-reverse-start":l+"-forward-start",r:e?l+"-reverse-end":l+"-forward-end"};c=h(function(a){V(a.p);na(a.f,a.B);a.d=document.createElement("div");a.d.className=a.D;var b= +a.f,c=a.d;if(c){for(var d;d=b.firstChild;)c.appendChild(d);b.appendChild(c)}a.g=document.createElement("div");a.g.className=a.G;a.g.innerHTML=a.p.i;a.reverse?(b=a.d,b.parentNode.insertBefore(a.g,b)):(b=a.d,b.parentNode.insertBefore(a.g,b.nextSibling))},null,l);C(k,c,0);c=h(function(a){oa(a.f,a.B);na(a.f,a.r)},null,l);C(k,c,0);c=h(function(a){a.f.removeChild(a.d);oa(a.f,a.r);qa(a.g);F(k);W(a.p,function(){G(k)})},null,l);C(k,c,parseInt(s["animation-duration"],10));c=h(function(a,b){G(b)},null,l,f); +C(k,c);E(k)}else{V(d);var q=function(){F(f);W(d,function(){G(f,g)})};(l=s["experimental-html-handler"])?(F(f),l(d.i,c,function(){q();G(f,g)})):(c.innerHTML=d.i,q())}}},null,q,d[q],b.timing),l=C(f,l);q=l-k;b.foot?(l=h(function(a,b,c){c&&(b.spfProcessBody=n());a=U(a);V(a);F(f);W(a,function(){b.spfProcessFoot=n();G(f,g)})},null,b.foot,b.timing,q),l=C(f,l)):q&&(l=h(function(a){a.spfProcessBody=n()},null,b.timing),l=C(f,l));c&&(l=C(f,h(c,null,a,b)));E(f,g)} +function Tb(a,b,c){var d="preprocess "+z(a),e;b.head&&(e=h(function(a){a=U(a);Ub(a);Vb(a);Wb(a)},null,b.head),C(d,e));var f=b.body||{},g;for(g in f)f[g]&&(e=h(function(a,b){var c=U(b);Vb(c);Wb(c)},null,g,f[g]),C(d,e));b.foot&&(e=h(function(a){a=U(a);Vb(a);Wb(a)},null,b.foot),C(d,e));c&&C(d,h(c,null,a,b));E(d)} +function U(a){var b=new Xb;if(!a)return b;if("[object String]"!=Object.prototype.toString.call(a))return a.scripts&&t(a.scripts,function(a){b.scripts.push({url:a.url||"",text:a.text||"",name:a.name||"",async:a.async||!1})}),a.styles&&t(a.styles,function(a){b.c.push({url:a.url||"",text:a.text||"",name:a.name||""})}),a.links&&s["experimental-preconnect"]&&t(a.links,function(a){"spf-preconnect"==a.rel&&b.links.push({url:a.url||"",rel:a.rel||""})}),b.i=a.html||"",b;a=a.replace(Yb,function(a,d,e,f){return"script"== +d?(a=(a=e.match(Zb))?a[1]:"",d=(d=e.match($b))?d[1]:"",e=ac.test(e),b.scripts.push({url:d,text:f,name:a,async:e}),""):"style"==d?(a=(a=e.match(Zb))?a[1]:"",b.c.push({url:"",text:f,name:a}),""):a});a=a.replace(bc,function(a,d){var e=d.match(cc),e=e?e[1]:"";if("stylesheet"==e){var e=(e=d.match(Zb))?e[1]:"",f=d.match(dc),f=f?f[1]:"";b.c.push({url:f,text:"",name:e});return""}return"spf-preconnect"==e&&s["experimental-preconnect"]?(f=(f=d.match(dc))?f[1]:"",b.links.push({url:f,rel:e}),""):a});b.i=a;return b} +function W(a,b){if(0>=a.scripts.length)b&&b();else{var c=-1,d=function(){c++;if(c=a.scripts.length||(a=ga(a.scripts,function(a){return a.url}),ub(a))} +function V(a){if(!(0>=a.c.length))for(var b=0,c=a.c.length;b=a.c.length||(a=ga(a.c,function(a){return a.url}),Kb(a))}function Rb(a){Ub(a)}function Ub(a){0>=a.links.length||(a=ga(a.links,function(a){return"spf-preconnect"==a.rel?a.url:""}),pb(a))}function Xb(){this.i="";this.scripts=[];this.c=[];this.links=[]} +var Sb=function(){var a=document.createElement("div");if("transition"in a.style)return!0;for(var b=["webkit","Moz","Ms","O","Khtml"],c=0,d=b.length;c=g||0>=l||(l=v(),f={data:f,life:g,time:n(),count:0},ka(f),l[e]=f,setTimeout(ia,1E3))}d.timing=c;b.m&&b.m(a,d)} +function fc(a,b,c,d,e){a=z(a);var f;s["cache-unified"]?f=a:"navigate-back"==d||"navigate-forward"==d?f="history "+a:"navigate"==d?f=(e?"history ":"prefetch ")+a:"prefetch"==d&&(f=e?"prefetch "+a:"");b&&"url"==c?f+=" previous "+b:b&&"path"==c&&(f+=" previous "+y(b).pathname);return f||""}ec=B(ec,"spf.nav.request.send");gc=B(gc,"spf.nav.request.handleResponseFromCache_");ic=B(ic,"spf.nav.request.handleHeadersFromXHR_");jc=B(jc,"spf.nav.request.handleChunkFromXHR_");hc=B(hc,"spf.nav.request.handleCompleteFromXHR_"); +kc=B(kc,"spf.nav.request.done_");function lc(){var a=mc,b=nc;if(!r["history-init"]&&window.addEventListener){var c=window.location.href;window.addEventListener("popstate",xa,!1);p("history-init",!0);p("history-callback",a);p("history-error-callback",b);p("history-listener",xa);p("history-url",c);p("history-timestamp",n());a={"spf-referer":document.referrer};try{ta(c,a)}catch(d){b&&b(c,d)}}!r["nav-init"]&&document.addEventListener&&(document.addEventListener("click",oc,!1),!s["experimental-prefetch-mousedown"]||"ontouchstart"in window|| +0b)return!1;a=parseInt(r["nav-init-time"],10);a--;a=n()-a;b=parseInt(s["navigate-lifetime"],10);b=isNaN(b)?Infinity:b;return a>b?!1:!0}function oc(a){if(!a.defaultPrevented){var b=uc(a);b&&vc(b)&&wc()&&m("spfclick",{url:b,target:a.target})&&(xc(b),a.preventDefault())}} +function pc(a){var b=uc(a);b&&setTimeout(function(){yc(b)},0)}function mc(a,b){var c=!(!b||!b["spf-back"]),d=b&&b["spf-referer"],e=b&&b["spf-current"],f=s["reload-identifier"];f&&(a=Ha(a,[f]));vc(a)?wc()?m("spfhistory",{url:a,referer:d,previous:e})&&xc(a,null,e,d,!0,c):Y(a,zc):Y(a,Ac)}function Bc(a,b){a&&(vc(a)?wc()?xc(a,b):Y(a,zc):Y(a,Ac))} +function xc(a,b,c,d,e,f){X();b=b||{};d=void 0==d?window.location.href:d;c=e?c:window.location.href;var g;a:{if(-1!=a.indexOf("#")&&(g=z(a),x(c||window.location.href)[0]==g)){g=!1;break a}g=!0}if(g)if(Cc(a,d,c,b)){p("nav-counter",(parseInt(r["nav-counter"],10)||0)+1);Dc(a);g=z(a);var l="preprocess "+z(g);Qa("preprocess",l);g=Ec()[g];p("nav-request",g);p("nav-promote",null);p("nav-promote-time",null);g&&4!=g.readyState?Fc(a,b,d,!!e,!!f):Gc(a,b,c,d,!!e,!!f)}else Y(a,Hc);else Ic(a),e||Jc(a,d,h(Z,null, +b))}function Fc(a,b,c,d){var e="preprocess "+z(a),f="promote "+z(a);p("nav-promote",a);p("nav-promote-time",n());Oa(e);E(f,!0);d||Jc(a,c,h(Z,null,b))}function Gc(a,b,c,d,e,f){var g=h(Z,null,b),l=h(Kc,null,b,f),k=h(Lc,null,b,f,"");s["advanced-navigate-persist-timing"]||Mc();b=ec(a,{method:b.method,b:l,e:g,m:k,q:b.postData,type:"navigate"+(e?f?"-back":"-forward":""),current:c,A:d});p("nav-request",b);e||Jc(a,d,g)} +function Ic(a){a=x(a);a[1]&&(a[2]?(a=document.getElementById(a[2]))&&a.scrollIntoView():window.scroll(0,0))}function Jc(a,b,c){try{b={"spf-referer":b},z(a,!0)==window.location.href?ta(a,null,!1,!0):ua(!1,a,b,void 0)}catch(d){X(),c(a,d)}}function Z(a,b,c){p("nav-request",null);nc(b,c,a)&&Y(b,Nc,c)}function Kc(a,b,c,d){if(Oc(c,d,a))if(d.reload)Y(c,Pc);else if(d.redirect)Qc(a,d.redirect);else try{T(c,d,function(){Rc(c,d,a)},!0,b)}catch(e){Z(a,c,e)}else Y(c,Sc)} +function Lc(a,b,c,d,e){p("nav-request",null);r["nav-promote"]==c&&(c=e.timing||{},c.navigationStart=r["nav-promote-time"],c.spfPrefetched=!0);c="multipart"==e.type;if(!c){if(!Tc(d,e,a)){Y(d,Uc);return}if(e.reload){Y(d,Pc);return}if(e.redirect){Qc(a,e.redirect);return}}try{T(d,c?{}:e,function(){Ic(d);Vc(d,e,a)},!0,b)}catch(f){Z(a,d,f)}}function Qc(a,b){try{b+=window.location.hash,ta(b,null,!0,!0)}catch(c){X(),Z(a,b,c)}}function X(){var a=r["nav-request"];a&&(a.abort(),p("nav-request",null))} +function $(a,b){var c;a&&(c=Array.prototype.slice.call(arguments),c[0]=a,c=ba.apply(null,c));return!1!==c} +function Y(a,b,c){c=c?c.message:"";X();Dc();var d=b;c&&(d+=" Message: "+c);m("spfreload",{url:a,reason:d});s["experimental-remove-history"]&&window.location.href==a&&(p("history-ignore-pop",!0),window.history.back());setTimeout(function(){var c=s["reload-identifier"];if(c){var d={};d[c]=encodeURIComponent(b);var c=a,g=x(c),c=g[0],l=-1!=c.indexOf("?")?"&":"?",k;for(k in d)c+=l+k,d[k]&&(c+="="+d[k]),l="&";a=c+g[1]+g[2]}window.location.href=a},0)}function Wc(a,b){Xc(a,b)} +function Xc(a,b,c){b=b||{};c=c||a;Cc(a,void 0,void 0,b,!0)&&ec(a,{method:b.method,b:h(Yc,null,!1,b,c),e:h(Zc,null,!1,b,c),m:h($c,null,!1,b,c),q:b.postData,type:"load"})}function yc(a,b){ad(a,b)}function ad(a,b,c){b=b||{};c=c||a;var d=window.location.href;Cc(a,void 0,void 0,b,!0)&&(b=ec(a,{method:b.method,b:h(Yc,null,!0,b,c),e:h(Zc,null,!0,b,c),m:h($c,null,!0,b,c),q:b.postData,type:"prefetch",current:d}),a=z(a),Ec()[a]=b)} +function Zc(a,b,c,d,e){a&&bd(d);a&&r["nav-promote"]==c?Z(b,d,e):nc(d,e,b,!0)}function Yc(a,b,c,d,e){if(Oc(d,e,b,!0)){if(e.reload){if(!a)return;if(r["nav-promote"]==c){Y(d,Pc);return}}if(e.redirect)cd(a,b,c,e.redirect);else{if(a){var f=h(Kc,null,b,!1,d,e),g="promote "+z(c);C(g,f);if(r["nav-promote"]==c){E(g,!0);return}}(a?Tb:T)(d,e,function(){Rc(d,e,b,!0)})}}} +function $c(a,b,c,d,e){var f="multipart"==e.type;if(!f){if(!Tc(d,e,b,!0)){Y(d,Uc);return}if(e.reload){if(!a)return;if(r["nav-promote"]==c){Y(d,Pc);return}}if(e.redirect){cd(a,b,c,e.redirect);return}}var g="promote "+z(c);if(a){bd(d);if(r["nav-promote"]==c){C(g,h(Lc,null,b,!1,c,d,e));E(g,!0);return}Oa(g)}g=a?Tb:T;try{g(d,f?{}:e,function(){Vc(d,e,b,!0)})}catch(l){Zc(a,b,c,d,l)}}function cd(a,b,c,d){a=a?ad:Xc;var e={};t([dd,ed,fd,gd,hd,id],function(a){e[a]=b[a]});a(d,e,c)} +function nc(a,b,c,d){a={url:a,err:b};(c=$((c||{})[dd],a))&&!d&&(c=m("spferror",a));return c}function Cc(a,b,c,d,e){a={url:a,referer:b,previous:c};(d=$((d||{})[ed],a))&&!e&&(d=m("spfrequest",a));return d}function Oc(a,b,c,d){a={url:a,part:b};(c=$((c||{})[fd],a))&&!d&&(c=m("spfpartprocess",a));return c}function Rc(a,b,c,d){a={url:a,part:b};$((c||{})[gd],a)&&!d&&m("spfpartdone",a)}function Tc(a,b,c,d){a={url:a,response:b};(c=$((c||{})[hd],a))&&!d&&(c=m("spfprocess",a));return c} +function Vc(a,b,c,d){a={url:a,response:b};$((c||{})[id],a)&&!d&&m("spfdone",a)}function bd(a){a=z(a);var b=Ec(),c=b[a];c&&c.abort();delete b[a]}function Dc(a){var b=Ec();a=a&&z(a);for(var c in b)a!=c&&bd(c)}var Mc,jd=window.performance&&(window.performance.clearResourceTimings||window.performance.webkitClearResourceTimings||window.performance.mozClearResourceTimings||window.performance.msClearResourceTimings||window.performance.oClearResourceTimings);Mc=jd?h(jd,window.performance):ca; +function Ec(){return"nav-prefetches"in r?r["nav-prefetches"]:p("nav-prefetches",{})} +var dd="onError",ed="onRequest",fd="onPartProcess",gd="onPartDone",hd="onProcess",id="onDone",zc="1",Hc="2",Sc="3",Uc="4",Pc="5",Ac="9",Nc="10",lc=B(lc,"spf.nav.init"),qc=B(qc,"spf.nav.dispose"),oc=B(oc,"spf.nav.handleClick_"),mc=B(mc,"spf.nav.handleHistory_"),Bc=B(Bc,"spf.nav.navigate"),xc=B(xc,"spf.nav.navigate_"),Fc=B(Fc,"spf.nav.navigatePromotePrefetch_"),Gc=B(Gc,"spf.nav.navigateSendRequest_"),Z=B(Z,"spf.nav.handleNavigateError_"),Kc=B(Kc,"spf.nav.handleNavigatePart_"),Lc=B(Lc,"spf.nav.handleNavigateSuccess_"), +X=B(X,"spf.nav.cancel"),$=B($,"spf.nav.callback"),Y=B(Y,"spf.nav.reload"),yc=B(yc,"spf.nav.prefetch"),ad=B(ad,"spf.nav.prefetch_"),Wc=B(Wc,"spf.nav.load"),Zc=B(Zc,"spf.nav.handleLoadError_"),Yc=B(Yc,"spf.nav.handleLoadPart_"),$c=B($c,"spf.nav.handleLoadSuccess_");function kd(){sb();Ib();"complete"==document.readyState&&(document.removeEventListener?document.removeEventListener("DOMContentLoaded",kd,!1):document.detachEvent&&document.detachEvent("onreadystatechange",kd))}document.addEventListener?document.addEventListener("DOMContentLoaded",kd,!1):document.attachEvent&&document.attachEvent("onreadystatechange",kd);kd(); +var ld={init:function(a){var b=!("function"!=typeof window.history.pushState&&!wa().contentWindow.history.pushState);a=a||{};for(var c in da)s[c]=c in a?a[c]:da[c];for(c in a)c in da||(s[c]=a[c]);b&&lc();return b},dispose:function(){"undefined"!=typeof History&&History.prototype.pushState&&qc();for(var a in s)delete s[a]},navigate:Bc,load:Wc,prefetch:yc,process:function(a,b){function c(a,c,d,e){a==c&&b&&b(e)}var d=window.location.href;if("multipart"==a.type)for(var e=a.parts,f=0;f=b))for(var c=0;ch&&(a=g.responseText.substring(h),h=g.responseText.length,e.l(g,a)),clearTimeout(k),e.u&&e.u(g))};a="POST"==a;if(e.headers)for(var y in e.headers)g.setRequestHeader(y,e.headers[y]),"content-type"== +y.toLowerCase()&&(a=!1);a&&g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");0d){if(0==b.lastIndexOf("hash-",0))return b;c=r[c]||"";if("[object String]"==Object.prototype.toString.call(c))b=c+b;else for(var e in c)b=b.replace(e,c[e]);b=0>b.indexOf("."+a)?b+"."+a:b;b=B(b)}else 0==d&&(b=B(b))}return b}function J(a,b,c){return a+"-"+b+(c?"-"+c:"")}function O(a){return a?String(a).replace(/[^\w]/g,""):""}function Va(a,b,c,d){b=J(b,c,d);P[b]=a}function N(a,b,c){a=J(a,b,c);return P[a]} +function cb(a,b){var c=N(a,b);return""==b||c==Wa}function Oa(a,b,c){a=J(a,b);M[a]=c}function K(a,b){var c=J(a,b);return M[c]}function Ua(a,b){var c=K(a,b);return void 0!=c&&cb(a,c)}var P={},L={},M={},ab=-1!=navigator.userAgent.indexOf(" Trident/"),Xa=1,Wa=2,Q="css",H="js";"rsrc-s"in r||q("rsrc-s",P);P=r["rsrc-s"];"rsrc-n"in r||q("rsrc-n",L);L=r["rsrc-n"];"rsrc-u"in r||q("rsrc-u",M);M=r["rsrc-u"];function eb(a){a=u(a);t(a,function(a){Za("img",a)})};function fb(a,b,c){La(H,a,b,c)}function gb(a){Sa(H,a)}function hb(a,b){Ra(H,a,b)}function ib(a){a=u(a);t(a,function(a){Za(H,a)})}function jb(a,b,c){a=u(a);a=ea(a,function(a){return!!a});var d=[];t(a,function(a){void 0==K(H,a)&&d.push(a)});var e=!d.length;if(b){var f=da(a,l(Ua,null,H));e&&f?b():(a=J(H,a.sort().join("|")),Aa(a,b))}c&&!e&&c(d)}function kb(a,b){a=u(a);t(a,function(a){if(a){var b=R[a]||a,b=I(H,b),e=K(H,a);e&&b!=e&&lb(a)}});jb(a,b,mb)} +function mb(a){t(a,function(a){function c(){fb(e,a)}var d=S[a],e=R[a]||a;d?kb(d,c):c()})}function lb(a){a=u(a);t(a,function(a){var c=[],d;for(d in S){var e=S[d],e=u(e);t(e,function(e){e==a&&c.push(d)})}t(c,function(a){lb(a)});gb(a)})}function nb(a,b){bb(H,a,b)}function ob(a){db(H,a)}var S={};"js-d"in r||q("js-d",S);var S=r["js-d"],R={};"js-u"in r||q("js-u",R);R=r["js-u"];function pb(a,b,c){La(Q,a,b,c)}function qb(a,b){Ra(Q,a,b)}function rb(a){a=u(a);t(a,function(a){Za(Q,a)})};function sb(a,b,c){if(b){b=[];var d,e=0;c&&(a+="\r\n");var f=a.indexOf(tb,e);for(-1e&&(d=a.substring(e),c&&Da(d,"\r\n")&&(d=d.substring(0,d.length-2)));return{j:b,a:d}}a=JSON.parse(a);b="number"==typeof a.length?a:[a];return{j:b,a:""}} +function T(a,b,c,d,e){var f="process "+B(a),h=!s["experimental-process-async"],k;k=0;b.timing||(b.timing={});b.title&&(document.title=b.title);d&&b.url&&B(b.url)!=B(window.location.href)&&ra(b.url+window.location.hash,null,!1,!0);b.head&&(k=l(function(a,b){var c=U(a);wb(c);xb(c);F(f);yb(c,function(){b.spfProcessHead=n();G(f,h)})},null,b.head,b.timing),k=C(f,k));b.attr&&(k=l(function(a,b){for(var c in a){var d=document.getElementById(c);if(d){var e=a[c],f=void 0;for(f in e){var h=e[f];"class"==f?d.className= +h:"style"==f?d.style.cssText=h:d.setAttribute(f,h)}}}b.spfProcessAttr=n()},null,b.attr,b.timing),k=C(f,k));d=b.body||{};var g=k,p;for(p in d)k=l(function(a,b){var c=document.getElementById(a);if(c){var d=U(b),g=s["animation-class"];if(zb&&w(c,g)){F(f);var k=Ja(c);E(k,!0);g={p:d,reverse:!!e,d:null,g:null,f:c,D:g+"-old",G:g+"-new",B:e?g+"-reverse-start":g+"-forward-start",r:e?g+"-reverse-end":g+"-forward-end"};c=l(function(a){xb(a.p);la(a.f,a.B);a.d=document.createElement("div");a.d.className=a.D;var b= +a.f,c=a.d;if(c){for(var d;d=b.firstChild;)c.appendChild(d);b.appendChild(c)}a.g=document.createElement("div");a.g.className=a.G;a.g.innerHTML=a.p.i;a.reverse?(b=a.d,b.parentNode.insertBefore(a.g,b)):(b=a.d,b.parentNode.insertBefore(a.g,b.nextSibling))},null,g);C(k,c,0);c=l(function(a){ma(a.f,a.B);la(a.f,a.r)},null,g);C(k,c,0);c=l(function(a){a.f.removeChild(a.d);ma(a.f,a.r);oa(a.g);F(k);yb(a.p,function(){G(k)})},null,g);C(k,c,parseInt(s["animation-duration"],10));c=l(function(a,b){G(b)},null,g,f); +C(k,c);E(k)}else{xb(d);var p=function(){F(f);yb(d,function(){G(f,h)})};(g=s["experimental-html-handler"])?(F(f),g(d.i,c,function(){p();G(f,h)})):(c.innerHTML=d.i,p())}}},null,p,d[p],b.timing),k=C(f,k);p=k-g;b.foot?(k=l(function(a,b,c){c&&(b.spfProcessBody=n());a=U(a);xb(a);F(f);yb(a,function(){b.spfProcessFoot=n();G(f,h)})},null,b.foot,b.timing,p),k=C(f,k)):p&&(k=l(function(a){a.spfProcessBody=n()},null,b.timing),k=C(f,k));c&&(k=C(f,l(c,null,a,b)));E(f,h)} +function Ab(a,b,c){var d="preprocess "+B(a),e;b.head&&(e=l(function(a){a=U(a);wb(a);Bb(a);Cb(a)},null,b.head),C(d,e));var f=b.body||{},h;for(h in f)f[h]&&(e=l(function(a,b){var c=U(b);Bb(c);Cb(c)},null,h,f[h]),C(d,e));b.foot&&(e=l(function(a){a=U(a);Bb(a);Cb(a)},null,b.foot),C(d,e));c&&C(d,l(c,null,a,b));E(d)} +function U(a){var b=new Db;if(!a)return b;if("[object String]"!=Object.prototype.toString.call(a))return a.scripts&&t(a.scripts,function(a){b.scripts.push({url:a.url||"",text:a.text||"",name:a.name||"",async:a.async||!1})}),a.styles&&t(a.styles,function(a){b.c.push({url:a.url||"",text:a.text||"",name:a.name||""})}),a.links&&s["experimental-preconnect"]&&t(a.links,function(a){"spf-preconnect"==a.rel&&b.links.push({url:a.url||"",rel:a.rel||""})}),b.i=a.html||"",b;a=a.replace(Eb,function(a,d,e,f){return"script"== +d?(a=(a=e.match(Fb))?a[1]:"",d=(d=e.match(Gb))?d[1]:"",e=Hb.test(e),b.scripts.push({url:d,text:f,name:a,async:e}),""):"style"==d?(a=(a=e.match(Fb))?a[1]:"",b.c.push({url:"",text:f,name:a}),""):a});a=a.replace(Ib,function(a,d){var e=d.match(Jb),e=e?e[1]:"";if("stylesheet"==e){var e=(e=d.match(Fb))?e[1]:"",f=d.match(Kb),f=f?f[1]:"";b.c.push({url:f,text:"",name:e});return""}return"spf-preconnect"==e&&s["experimental-preconnect"]?(f=(f=d.match(Kb))?f[1]:"",b.links.push({url:f,rel:e}),""):a});b.i=a;return b} +function yb(a,b){if(0>=a.scripts.length)b&&b();else{var c=-1,d=function(){c++;if(c=a.scripts.length||(a=fa(a.scripts,function(a){return a.url}),ib(a))} +function xb(a){if(!(0>=a.c.length))for(var b=0,c=a.c.length;b=a.c.length||(a=fa(a.c,function(a){return a.url}),rb(a))}function wb(a){0>=a.links.length||(a=fa(a.links,function(a){return"spf-preconnect"==a.rel?a.url:""}),eb(a))}function Db(){this.i="";this.scripts=[];this.c=[];this.links=[]} +var zb=function(){var a=document.createElement("div");if("transition"in a.style)return!0;for(var b=["webkit","Moz","Ms","O","Khtml"],c=0,d=b.length;c=h||0>=k||(k=v(),f={data:f,life:h,time:n(),count:0},ja(f),k[e]=f,setTimeout(ha,1E3))}d.timing=c;b.m&&b.m(a,d)} +function Mb(a,b,c,d,e){a=B(a);var f;s["cache-unified"]?f=a:"navigate-back"==d||"navigate-forward"==d?f="history "+a:"navigate"==d?f=(e?"history ":"prefetch ")+a:"prefetch"==d&&(f=e?"prefetch "+a:"");b&&"url"==c?f+=" previous "+b:b&&"path"==c&&(f+=" previous "+A(b).pathname);return f||""};function Sb(a){return pa(a,function(a){return w(a,s["link-class"])})}function Tb(a){return pa(a,function(a){return w(a,s["nolink-class"])})}function Ub(a,b){return pa(a,function(a){return a.href&&"img"!=a.tagName.toLowerCase()},b)}function Vb(a){if(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey||0b)return!1;a=parseInt(r["nav-init-time"],10);a--;a=n()-a;b=parseInt(s["navigate-lifetime"],10);b=isNaN(b)?Infinity:b;return a>b?!1:!0}function Yb(a){if(!a.defaultPrevented){var b=Vb(a);b&&Wb(b)&&Xb()&&m("spfclick",{url:b,target:a.target})&&(Zb(b),a.preventDefault())}}function $b(a){var b=Vb(a);b&&setTimeout(function(){ac(b,void 0)},0)} +function bc(a,b){var c=!(!b||!b["spf-back"]),d=b&&b["spf-referer"],e=b&&b["spf-current"],f=s["reload-identifier"];f&&(a=Fa(a,[f]));Wb(a)?Xb()?m("spfhistory",{url:a,referer:d,previous:e})&&Zb(a,null,e,d,!0,c):V(a,cc):V(a,dc)} +function Zb(a,b,c,d,e,f){W();b=b||{};d=void 0==d?window.location.href:d;c=e?c:window.location.href;var h;a:{if(-1!=a.indexOf("#")&&(h=B(a),z(c||window.location.href)[0]==h)){h=!1;break a}h=!0}if(h)if(ec(a,d,c,b)){q("nav-counter",(parseInt(r["nav-counter"],10)||0)+1);fc(a);h=B(a);var k="preprocess "+B(h),g;for(g in D)k!=g&&0==g.lastIndexOf("preprocess",0)&&Ha(g);g=gc()[h];q("nav-request",g);q("nav-promote",null);q("nav-promote-time",null);g&&4!=g.readyState?(c=!!e,f="preprocess "+B(a),e="promote "+ +B(a),q("nav-promote",a),q("nav-promote-time",n()),Ha(f),E(e,!0),c||hc(a,d,l(X,null,b))):(e=!!e,g=!!f,f=l(X,null,b),h=l(ic,null,b,g),k=l(jc,null,b,g,""),s["advanced-navigate-persist-timing"]||kc(),b=Lb(a,{method:b.method,b:h,e:f,m:k,q:b.postData,type:"navigate"+(e?g?"-back":"-forward":""),current:c,A:d}),q("nav-request",b),e||hc(a,d,f))}else V(a,lc);else mc(a),e||hc(a,d,l(X,null,b))}function mc(a){a=z(a);a[1]&&(a[2]?(a=document.getElementById(a[2]))&&a.scrollIntoView():window.scroll(0,0))} +function hc(a,b,c){try{b={"spf-referer":b},B(a,!0)==window.location.href?ra(a,null,!1,!0):sa(!1,a,b,void 0)}catch(d){W(),c(a,d)}}function X(a,b,c){q("nav-request",null);nc(b,c,a)&&V(b,oc,c)}function ic(a,b,c,d){if(pc(c,d,a))if(d.reload)V(c,qc);else if(d.redirect)rc(a,d.redirect);else try{T(c,d,function(){sc(c,d,a)},!0,b)}catch(e){X(a,c,e)}else V(c,tc)} +function jc(a,b,c,d,e){q("nav-request",null);r["nav-promote"]==c&&(c=e.timing||{},c.navigationStart=r["nav-promote-time"],c.spfPrefetched=!0);c="multipart"==e.type;if(!c){if(!uc(d,e,a)){V(d,vc);return}if(e.reload){V(d,qc);return}if(e.redirect){rc(a,e.redirect);return}}try{T(d,c?{}:e,function(){mc(d);wc(d,e,a)},!0,b)}catch(f){X(a,d,f)}}function rc(a,b){try{b+=window.location.hash,ra(b,null,!0,!0)}catch(c){W(),X(a,b,c)}}function W(){var a=r["nav-request"];a&&(a.abort(),q("nav-request",null))} +function Y(a,b){var c;a&&(c=Array.prototype.slice.call(arguments),c[0]=a,c=aa.apply(null,c));return!1!==c} +function V(a,b,c){c=c?c.message:"";W();fc();var d=b;c&&(d+=" Message: "+c);m("spfreload",{url:a,reason:d});s["experimental-remove-history"]&&window.location.href==a&&(q("history-ignore-pop",!0),window.history.back());setTimeout(function(){var c=s["reload-identifier"];if(c){var d={};d[c]=encodeURIComponent(b);var c=a,h=z(c),c=h[0],k=-1!=c.indexOf("?")?"&":"?",g;for(g in d)c+=k+g,d[g]&&(c+="="+d[g]),k="&";a=c+h[1]+h[2]}window.location.href=a},0)} +function xc(a,b,c){b=b||{};c=c||a;ec(a,void 0,void 0,b,!0)&&Lb(a,{method:b.method,b:l(yc,null,!1,b,c),e:l(zc,null,!1,b,c),m:l(Ac,null,!1,b,c),q:b.postData,type:"load"})}function ac(a,b,c){b=b||{};c=c||a;var d=window.location.href;ec(a,void 0,void 0,b,!0)&&(b=Lb(a,{method:b.method,b:l(yc,null,!0,b,c),e:l(zc,null,!0,b,c),m:l(Ac,null,!0,b,c),q:b.postData,type:"prefetch",current:d}),a=B(a),gc()[a]=b)}function zc(a,b,c,d,e){a&&Bc(d);a&&r["nav-promote"]==c?X(b,d,e):nc(d,e,b,!0)} +function yc(a,b,c,d,e){if(pc(d,e,b,!0)){if(e.reload){if(!a)return;if(r["nav-promote"]==c){V(d,qc);return}}if(e.redirect)Cc(a,b,c,e.redirect);else{if(a){var f=l(ic,null,b,!1,d,e),h="promote "+B(c);C(h,f);if(r["nav-promote"]==c){E(h,!0);return}}(a?Ab:T)(d,e,function(){sc(d,e,b,!0)})}}} +function Ac(a,b,c,d,e){var f="multipart"==e.type;if(!f){if(!uc(d,e,b,!0)){V(d,vc);return}if(e.reload){if(!a)return;if(r["nav-promote"]==c){V(d,qc);return}}if(e.redirect){Cc(a,b,c,e.redirect);return}}var h="promote "+B(c);if(a){Bc(d);if(r["nav-promote"]==c){C(h,l(jc,null,b,!1,c,d,e));E(h,!0);return}Ha(h)}h=a?Ab:T;try{h(d,f?{}:e,function(){wc(d,e,b,!0)})}catch(k){zc(a,b,c,d,k)}}function Cc(a,b,c,d){a=a?ac:xc;var e={};t([Dc,Ec,Fc,Gc,Hc,Ic],function(a){e[a]=b[a]});a(d,e,c)} +function nc(a,b,c,d){a={url:a,err:b};(c=Y((c||{})[Dc],a))&&!d&&(c=m("spferror",a));return c}function ec(a,b,c,d,e){a={url:a,referer:b,previous:c};(d=Y((d||{})[Ec],a))&&!e&&(d=m("spfrequest",a));return d}function pc(a,b,c,d){a={url:a,part:b};(c=Y((c||{})[Fc],a))&&!d&&(c=m("spfpartprocess",a));return c}function sc(a,b,c,d){a={url:a,part:b};Y((c||{})[Gc],a)&&!d&&m("spfpartdone",a)}function uc(a,b,c,d){a={url:a,response:b};(c=Y((c||{})[Hc],a))&&!d&&(c=m("spfprocess",a));return c} +function wc(a,b,c,d){a={url:a,response:b};Y((c||{})[Ic],a)&&!d&&m("spfdone",a)}function Bc(a){a=B(a);var b=gc(),c=b[a];c&&c.abort();delete b[a]}function fc(a){var b=gc();a=a&&B(a);for(var c in b)a!=c&&Bc(c)}var kc,Jc=window.performance&&(window.performance.clearResourceTimings||window.performance.webkitClearResourceTimings||window.performance.mozClearResourceTimings||window.performance.msClearResourceTimings||window.performance.oClearResourceTimings);kc=Jc?l(Jc,window.performance):ba; +function gc(){return"nav-prefetches"in r?r["nav-prefetches"]:q("nav-prefetches",{})}var Dc="onError",Ec="onRequest",Fc="onPartProcess",Gc="onPartDone",Hc="onProcess",Ic="onDone",cc="1",lc="2",tc="3",vc="4",qc="5",dc="9",oc="10";function Z(){Ya(H);Ya(Q);"complete"==document.readyState&&(document.removeEventListener?document.removeEventListener("DOMContentLoaded",Z,!1):document.detachEvent&&document.detachEvent("onreadystatechange",Z))}document.addEventListener?document.addEventListener("DOMContentLoaded",Z,!1):document.attachEvent&&document.attachEvent("onreadystatechange",Z);Z(); +var Kc={init:function(a){var b=!("function"!=typeof window.history.pushState&&!ua().contentWindow.history.pushState);a=a||{};for(var c in ca)s[c]=c in a?a[c]:ca[c];for(c in a)c in ca||(s[c]=a[c]);if(b){c=nc;if(!r["history-init"]&&window.addEventListener){a=window.location.href;window.addEventListener("popstate",va,!1);q("history-init",!0);q("history-callback",bc);q("history-error-callback",c);q("history-listener",va);q("history-url",a);q("history-timestamp",n());var d={"spf-referer":document.referrer}; +try{ra(a,d)}catch(e){c&&c(a,e)}}!r["nav-init"]&&document.addEventListener&&(document.addEventListener("click",Yb,!1),!s["experimental-prefetch-mousedown"]||"ontouchstart"in window||0