Uncategorized

Test

(function () {
function wrapped() {

(function (window) {

/**
* This is the SMCX singleton for the publisher DOM
*/
var SMCX = window.SMCX = new (function PublisherSMCX() {
var that = this;

/**
* Before SMCX is initialized, it is an array that holds any user-defined
* settings created via `SMCX.push`. When SMCX is initialized, it consumes
* the original array, passing it along to the App’s Configuration object,
* but continues to act like an array with push semantics (i.e. users can
* still call `SMCX.push`)
*/
that.__settings__ = window.SMCX || [];
that.push = function () {
that.__settings__.push.apply(that.__settings__, arguments);
};

that.onerror = window.onerror;

/**
* Pass this as a query parameter in the publisher page’s URL to enable
* debug mode within the application
*
* Usage:
*
* http://www.example.com/pages/test?smcx_debug=true
*
*/
that.DEBUG_QUERY_PARAM = ‘smcx_debug’;

that.initialize = function (options) {
log(“Initializing SMCX”);

withDocumentBody(function () {
if (shouldAbortInit()) {
log(“Aborted”);
return;
}

// A dictionary of performance data, see `SMCX.Sandbox.T` for usage
that.PERF = {0: +new Date};
options.perf = that.PERF;

options.settings = that.__settings__;

that.env = new SMCX.Publisher.Env;
that.env.initialize(options);
});
};

that.boot = function () {
if (that.env) {
that.env.boot();
}
};

that.destroy = function () {
that.__settings__ = [];

if (that.env) {
that.env.destroy();
that.env = null;
}
};

that.debug = function () {
if (that.env && that.env.DEBUG) {
return true;
}

var queryParams = SMCX.Utils.queryParams(window);
return queryParams.indexOf(that.DEBUG_QUERY_PARAM) !== -1;
};

function withDocumentBody(callback) {
if (document.body) {
return callback();
}

// Poll for up to 10 seconds to see if `document.body`
// shows up for the party
var id, count = 0;
id = setInterval(function () {
if (document.body || count > 100) {
clearInterval(id);
if (document.body) {
callback();
}
}
log(“Called withDocumentBody”);
count++;
}, 100);
}

function shouldAbortInit() {
// Abort if the browser doesn’t support cross-domain messaging
if (!SMCX.Utils.xdmSupported(window)) {
return true;
}

// Abort if on IE8 and we would be adding more stylesheets than it can
// handle (we add 2 and it can support up to 30)
if (SMCX.Utils.browserHasLowStylesLimit(window) &&
SMCX.Utils.numStyles(window) > 28) {
return true;
}

return false;
}

// Logging

function log(message) {
SMCX.log(message);
}

})();

window.SMCX.Publisher = {};

}(window));

(function (window) {

/**
* This is the SMCX JS SDK log function
*
* If you’re looking for the main application’s log function, it lives
* at `/app/assets/javascripts/lib/log.js`
*
*/
window.SMCX.log = function (message, options) {
options = options || {};

if (SMCX.debug() || options.force) {
if (window.console) {
// Only add namespaces to messages that are strings so as not to mess up
// the nice object inspection functionality in modern browsers
if (typeof message === ‘string’) {
if (options.namespace) {
message = ‘[smcx.’ + options.namespace + ‘] ‘ + message;
} else {
message = ‘[smcx] ‘ + message;
}
}

console.log(message);
}
}
};

}(window));

(function (window) {
window.SMCX.Utils = {

/**
* Get the query parameters from the target window’s URL
*
* @param targetWindow Window
* @returns String
*/
queryParams: function (targetWindow) {
return targetWindow.document.location.search;
},

/**
* Determine if the current viewport is a mobile device
*
* @returns Boolean
*/
onMobile: function (targetWindow) {
var innerWidth, clientWidth, width;

clientWidth = targetWindow.document.documentElement.clientWidth;
innerWidth = targetWindow.innerWidth;
width = Math.max(innerWidth, clientWidth || 0);

return width <= 760; }, /** * Check if the browser supports cross-domain messaging (XDM) * * To support XDM, browsers need to implement the `postMessage` method, * which is true for IE8+ and all modern browsers * * @param targetWindow * @returns Boolean */ xdmSupported: function (targetWindow) { return !!targetWindow['postMessage']; }, /** * Detect whether the current browser has a low stylesheet limit * * This is used when determining whether to initialize a widget (which would * inject another stylesheet) because IE8 has a hard limit of 31 stylesheets * and/or style tags on a given page * * FYI: modern browsers have a limit in the thousands, so for all intents * and purposes, we don't need to care about stylesheet limits on any * browser other than IE8 * * @returns Boolean */ browserHasLowStylesLimit: function (targetWindow) { return !('getComputedStyle' in targetWindow); }, /** * Get the # of stylesheets and style tags on the page * * @param targetWindow Window * @returns Integer */ numStyles: function (targetWindow) { var doc, numLinks, numStyles; doc = targetWindow.document; numLinks = doc.getElementsByTagName('link').length; numStyles = doc.getElementsByTagName('style').length; return numLinks + numStyles; } } }(window)); /** * This is the SMCX singleton for the publisher DOM */ (function (window, document, undefined) { var Env = SMCX.Publisher.Env = function () { var that = this; /** * * @param options * @param options.sandbox * @param options.sandbox.init (optional) * @param options.sandbox.boot (optional) * @param options.sandbox.js * @param options.sandbox.data */ this.initialize = function (options) { /** * Set which type of singleton this is so it's possible to differentiate * among the three different types * * @type String * @private */ that.__TYPE__ = 'publisher'; /** * The current environment * * This is originally set by the parameter passed to `InitV{n}View` on * the server * * @type String */ that.NAME = options.env; that.DEBUG = options.debug; log("Initializing environment (type=publisher, mode=" + that.NAME + ")"); that.options = extractOptions(options); that.settings = that.options.settings; // reference to the sandboxed SMCX singleton that.__SMCX__ = null; that.events = { 'smcx.container:sdkjs:loaded': [onSandboxedJSLoaded], 'smcx.sandbox:init': [], 'smcx.sandbox:boot': [] }; that.container = new SMCX.Publisher.Container(); that.container.initialize(optionsForContainer()); }; function extractOptions(options) { if (options.sandbox === undefined) { throw("`options.sandbox` must be defined"); } if (options.sandbox.data === undefined) { throw("`options.sandbox.data` must be defined"); } if (options.sandbox.js === undefined) { throw("`options.sandbox.js` must be defined"); } if (typeof(options.sandbox.js) !== 'string') { throw("`options.sandbox.js` must be a string"); } if (that.DEBUG) { options.sandbox.js = JSON.parse(options.sandbox.js); } if (typeof(options.sandbox.data) !== 'object') { throw("`options.sandbox.data` must be an object"); } if (options.data['cookie_url'] === undefined) { throw("`options.data.cookie_url` must be defined"); } if (options.sandbox.init === undefined) { options.sandbox.init = true; } if (options.sandbox.boot === undefined) { options.sandbox.boot = true; } return options; } this.boot = function () { configureContainer(that.container); that.container.render(); }; this.addCallback = function (eventName, callback) { if (that.events[eventName] === undefined) { throw(eventName + ' is not a valid event name'); } that.events[eventName].push(callback); }; this.trigger = function () { var eventName = Array.prototype.shift.apply(arguments); // pop first arg logEvent(eventName); runCallbacksFor(eventName, arguments); } this.destroy = function () { log("Destroying SMCX (type=publisher)"); that.settings = []; if (that.__SMCX__) { that.__SMCX__.destroy(); that.__SMCX__ = null; } // NB: destroying the container (and its frame) must come after its child // objects are destroyed and events unbound, otherwise it creates a race // condition that can cause script errors if (that.container) { that.container.destroy(); that.container = null; } }; this.debug = function () { return that.DEBUG; }; // Container function optionsForContainer() { return { debug: that.DEBUG, div: { id: '__smcx__' }, frame: { id: 'smcx_frame' } } } /** * Build up the HTML we want to `document.write` into the container's frame * * @param container */ function configureContainer(container) { container.addRemoteScript({src: that.constructor.JQUERY_URL}); container.addRemoteScript({src: buildCookieUrl()}); /** * Inject the script element(s) for the JS SDK * * In debug mode, `js` will be a set of
*
* See `addString` for more details about available options
*
* @param options Object
* @param options.src String (the path or url to the script)
*/
this.addRemoteScript = function (options) {
var script = ‘<' + 'script src="' + options.src + '">‘;
this.addString({text: script, el: options.el});
};

/**
* Add an inline script to the list of strings to be written into the
* frame’s document
*
* Example:
*
* addInlineScript({text: ‘alert(“foo”);’})
*
* This will add the following string to `options.frame.head`:
*
* “
*
* See `addString` for more details about available options
*
* @param options Object
* @param options.text String (escaped Javascript)
*/
this.addInlineScript = function (options) {
var script, text;

if (options[‘on’] === ‘load’) {
text = wrapInOnLoadCallback(options.text);
} else {
text = options.text;
}

script = ‘<' + 'script>‘ + text + ‘‘;

this.addString({text: script, el: options.el});
};

/**
* Build a JS snippet to set a frame’s `document.domain` via its `src`
* attribute
*
* @param domain
* @returns {string}
*/
function domainSrcFor(domain) {
var src = “javascript:”;
src += “var d=document.open(); d.domain='” + document.domain + “‘;”;
src += ‘void(0);’
return src;
}

/**
* Build the HTML markup for the document
*
* NB: we include a DOCTYPE here to ensure that iframes getting rendered
* in IE don’t fall in to Quirks Mode (in which certain standard libraries,
* such as JSON, aren’t available)
*
* @returns {string}
*/
function buildFrameHTML() {
var s = String();

s += ‘‘;
s += ‘<' + 'html>‘;
s += ‘<' + 'head>‘;
s += that.options.frame.head.join(‘\n’);
s += ‘<' + '/head>‘;
s += ‘<' + 'body>‘;
s += that.options.frame.body.join(‘\n’);
s += ‘‘;
s += ‘‘;

return s;
}

/**
* Helper to wrap a script in a callback function that will only execute
* after the page’s `onload` event has fired
*
* @param text
* @returns {string}
*/
function wrapInOnLoadCallback(text) {
var wrapped = String();
wrapped += ‘(function(){‘
wrapped += ‘var eventer = window.addEventListener ? window.addEventListener : window.attachEvent;’;
wrapped += ‘var name = window.addEventListener ? “load” : “onload”;’;
wrapped += ‘eventer(name, function(e){‘ + text + ‘});’;
wrapped += ‘}());’;
return wrapped;
}

// Logging

function log(message) {
SMCX.log(message, {namespace: ‘container’});
}

function logDocumentOpenError(e) {
log(e);
log(“could not open document, falling back to a `javascript:` src”);
}

function logDocumentWriteError(e) {
log(e);
log(“document.write failed, aborting”);
}

};

}(window, document));

SMCX.initialize({
env: ‘prod’,
debug: false,
data: {‘cookie_url’: ‘https://widget.surveymonkey.com/collect/website/js/cookie.js’},
sandbox: {
js: ‘(function(){var e=typeof define===\”function\”&&define.amd;var t={\”function\”:true,object:true};var n=t[typeof exports]&&exports&&!exports.nodeType&&exports;var i=t[typeof window]&&window||this,o=n&&t[typeof module]&&module&&!module.nodeType&&typeof global==\”object\”&&global;if(o&&(o[\”global\”]===o||o[\”window\”]===o||o[\”self\”]===o)){i=o}function r(e,n){e||(e=i[\”Object\”]());n||(n=i[\”Object\”]());var o=e[\”Number\”]||i[\”Number\”],a=e[\”String\”]||i[\”String\”],s=e[\”Object\”]||i[\”Object\”],c=e[\”Date\”]||i[\”Date\”],l=e[\”SyntaxError\”]||i[\”SyntaxError\”],f=e[\”TypeError\”]||i[\”TypeError\”],d=e[\”Math\”]||i[\”Math\”],u=e[\”JSON\”]||i[\”JSON\”];if(typeof u==\”object\”&&u){n.stringify=u.stringify;n.parse=u.parse}var g=s.prototype,p=g.toString,h,S,v;var m=new c(-0xc782b5b800cec);try{m=m.getUTCFullYear()==-109252&&m.getUTCMonth()===0&&m.getUTCDate()===1&&m.getUTCHours()==10&&m.getUTCMinutes()==37&&m.getUTCSeconds()==6&&m.getUTCMilliseconds()==708}catch(C){}function b(e){if(b[e]!==v){return b[e]}var t;if(e==\”bug-string-char-index\”){t=\”a\”[0]!=\”a\”}else if(e==\”json\”){t=b(\”json-stringify\”)&&b(\”json-parse\”)}else{var i,r=\'{\”a\”:[1,true,false,null,\”\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\”]}\’;if(e==\”json-stringify\”){var s=n.stringify,l=typeof s==\”function\”&&m;if(l){(i=function(){return 1}).toJSON=i;try{l=s(0)===\”0\”&&s(new o)===\”0\”&&s(new a)==\’\”\”\’&&s(p)===v&&s(v)===v&&s()===v&&s(i)===\”1\”&&s([i])==\”[1]\”&&s([v])==\”[null]\”&&s(null)==\”null\”&&s([v,p,null])==\”[null,null,null]\”&&s({a:[i,true,false,null,\”\\x00\\b\\n\\f\\r \”]})==r&&s(null,i)===\”1\”&&s([1,2],null,1)==\”[\\n 1,\\n 2\\n]\”&&s(new c(-864e13))==\’\”-271821-04-20T00:00:00.000Z\”\’&&s(new c(864e13))==\’\”+275760-09-13T00:00:00.000Z\”\’&&s(new c(-621987552e5))==\’\”-000001-01-01T00:00:00.000Z\”\’&&s(new c(-1))==\’\”1969-12-31T23:59:59.999Z\”\’}catch(f){l=false}}t=l}if(e==\”json-parse\”){var d=n.parse;if(typeof d==\”function\”){try{if(d(\”0\”)===0&&!d(false)){i=d(r);var u=i[\”a\”].length==5&&i[\”a\”][0]===1;if(u){try{u=!d(\’\” \”\’)}catch(f){}if(u){try{u=d(\”01\”)!==1}catch(f){}}if(u){try{u=d(\”1.\”)!==1}catch(f){}}}}}catch(f){u=false}}t=u}}return b[e]=!!t}if(!b(\”json\”)){var M=\”[object Function]\”,w=\”[object Date]\”,x=\”[object Number]\”,y=\”[object String]\”,_=\”[object Array]\”,X=\”[object Boolean]\”;var O=b(\”bug-string-char-index\”);if(!m){var E=d.floor;var T=[0,31,59,90,120,151,181,212,243,273,304,334];var A=function(e,t){return T[t]+365*(e-1970)+E((e-1969+(t=+(t>1)))/4)-E((e-1901+t)/100)+E((e-1601+t)/400)}}if(!(h=g.hasOwnProperty)){h=function(e){var t={},n;if((t.__proto__=null,t.__proto__={toString:1},t).toString!=p){h=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);this.__proto__=t;return n}}else{n=t.constructor;h=function(e){var t=(this.constructor||n).prototype;return e in this&&!(e in t&&this[e]===t[e])}}t=null;return h.call(this,e)}}S=function(e,n){var i=0,o,r,a;(o=function(){this.valueOf=0}).prototype.valueOf=0;r=new o;for(a in r){if(h.call(r,a)){i++}}o=r=null;if(!i){r=[\”valueOf\”,\”toString\”,\”toLocaleString\”,\”propertyIsEnumerable\”,\”isPrototypeOf\”,\”hasOwnProperty\”,\”constructor\”];S=function(e,n){var i=p.call(e)==M,o,a;var s=!i&&typeof e.constructor!=\”function\”&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||h;for(o in e){if(!(i&&o==\”prototype\”)&&s.call(e,o)){n(o)}}for(a=r.length;o=r[–a];s.call(e,o)&&n(o));}}else if(i==2){S=function(e,t){var n={},i=p.call(e)==M,o;for(o in e){if(!(i&&o==\”prototype\”)&&!h.call(n,o)&&(n[o]=1)&&h.call(e,o)){t(o)}}}}else{S=function(e,t){var n=p.call(e)==M,i,o;for(i in e){if(!(n&&i==\”prototype\”)&&h.call(e,i)&&!(o=i===\”constructor\”)){t(i)}}if(o||h.call(e,i=\”constructor\”)){t(i)}}}return S(e,n)};if(!b(\”json-stringify\”)){var W={92:\”\\\\\\\\\”,34:\’\\\\\”\’,8:\”\\\\b\”,12:\”\\\\f\”,10:\”\\\\n\”,13:\”\\\\r\”,9:\”\\\\t\”};var I=\”000000\”;var $=function(e,t){return(I+(t||0)).slice(-e)};var N=\”\\\\u00\”;var j=function(e){var t=\’\”\’,n=0,i=e.length,o=!O||i>10;var r=o&&(O?e.split(\”\”):e);for(;n-1/0&&s<1/0){if(A){u=E(s/864e5);for(l=E(u/365.2425)+1970-1;A(l+1,0)<=u;l++);for(d=E((u-A(l,0))/30.42);A(l,d+1)<=u;d++);u=1+u-A(l,d);g=(s%864e5+864e5)%864e5;m=E(g/36e5)%24;C=E(g/6e4)%60;b=E(g/1e3)%60;M=g%1e3}else{l=s.getUTCFullYear();d=s.getUTCMonth();u=s.getUTCDate();m=s.getUTCHours();C=s.getUTCMinutes();b=s.getUTCSeconds();M=s.getUTCMilliseconds()}s=(l<=0||l>=1e4?(l<0?\"-\":\"+\")+$(6,l<0?-l:l):$(4,l))+\"-\"+$(2,d+1)+\"-\"+$(2,u)+\"T\"+$(2,m)+\":\"+$(2,C)+\":\"+$(2,b)+\".\"+$(3,M)+\"Z\"}else{s=null}}else if(typeof s.toJSON==\"function\"&&(c!=x&&c!=y&&c!=_||h.call(s,\"toJSON\"))){s=s.toJSON(e)}}if(n){s=n.call(t,e,s)}if(s===null){return\"null\"}c=p.call(s);if(c==X){return\"\"+s}else if(c==x){return s>-1/0&&s<1/0?\"\"+s:\"null\"}else if(c==y){return j(\"\"+s)}if(typeof s==\"object\"){for(I=a.length;I--;){if(a[I]===s){throw f()}}a.push(s);O=[];N=r;r+=o;if(c==_){for(W=0,I=s.length;W0){for(o=\”\”,i>10&&(i=10);o.length=48&&a<=57||a>=97&&a<=102||a>=65&&a<=70)){z()}}n+=k(\"0x\"+e.slice(i,R));break;default:z()}}else{if(a==34){break}a=e.charCodeAt(R);i=R;while(a>=32&&a!=92&&a!=34){a=e.charCodeAt(++R)}n+=e.slice(i,R)}}if(e.charCodeAt(R)==34){R++;return n}z();default:i=R;if(a==45){r=true;a=e.charCodeAt(++R)}if(a>=48&&a<=57){if(a==48&&(a=e.charCodeAt(R+1),a>=48&&a<=57)){z()}r=false;for(;R=48&&a<=57);R++);if(e.charCodeAt(R)==46){o=++R;for(;o=48&&a<=57);o++);if(o==R){z()}R=o}a=e.charCodeAt(R);if(a==101||a==69){a=e.charCodeAt(++R);if(a==43||a==45){R++}for(o=R;o=48&&a<=57);o++);if(o==R){z()}R=o}return+e.slice(i,R)}if(r){z()}if(e.slice(R,R+4)==\"true\"){R+=4;return true}else if(e.slice(R,R+5)==\"false\"){R+=5;return false}else if(e.slice(R,R+4)==\"null\"){R+=4;return null}z()}}return\"$\"};var V=function(e){var t,n;if(e==\"$\"){z()}if(typeof e==\"string\"){if((O?e.charAt(0):e[0])==\"@\"){return e.slice(1)}if(e==\"[\"){t=[];for(;;n||(n=true)){e=P();if(e==\"]\"){break}if(n){if(e==\",\"){e=P();if(e==\"]\"){z()}}else{z()}}if(e==\",\"){z()}t.push(V(e))}return t}else if(e==\"{\"){t={};for(;;n||(n=true)){e=P();if(e==\"}\"){break}if(n){if(e==\",\"){e=P();if(e==\"}\"){z()}}else{z()}}if(e==\",\"||typeof e!=\"string\"||(O?e.charAt(0):e[0])!=\"@\"||P()!=\":\"){z()}t[e.slice(1)]=V(P())}return t}z()}return e};var B=function(e,t,n){var i=F(e,t,n);if(i===v){delete e[t]}else{e[t]=i}};var F=function(e,t,n){var i=e[t],o;if(typeof i==\"object\"&&i){if(p.call(i)==_){for(o=i.length;o--;){B(i,o,n)}}else{S(i,function(e){B(i,e,n)})}}return n.call(e,t,i)};n.parse=function(e,t){var n,i;R=0;L=\"\"+e;n=V(P());if(P()!=\"$\"){z()}R=L=null;return t&&p.call(t)==M?F((i={},i[\"\"]=n,i),\"\",t):n}}}n[\"runInContext\"]=r;return n}if(n&&!e){r(i,n)}else{var a=i.JSON,s=i[\"JSON3\"],c=false;var l=r(i,i[\"JSON3\"]={noConflict:function(){if(!c){c=true;i.JSON=a;i[\"JSON3\"]=s;a=s=null}return l}});i.JSON={parse:l.parse,stringify:l.stringify}}if(e){define(function(){return l})}}).call(this);(function(e){var t=/\\+/g;function n(e){return s.raw?e:encodeURIComponent(e)}function i(e){return s.raw?e:decodeURIComponent(e)}function o(e){return n(s.json?JSON.stringify(e):String(e))}function r(e){if(e.indexOf(\'\"\')===0){e=e.slice(1,-1).replace(/\\\\\"/g,\'\"\').replace(/\\\\\\\\/g,\"\\\\\")}try{e=decodeURIComponent(e.replace(t,\" \"));return s.json?JSON.parse(e):e}catch(n){}}function a(t,n){var i=s.raw?t:r(t);return e.isFunction(n)?n(i):i}var s=e.cookie=function(t,r,c){if(arguments.length>1&&!e.isFunction(r)){c=e.extend({},s.defaults,c);if(typeof c.expires===\”number\”){var l=c.expires,f=c.expires=new Date;f.setTime(+f+l*864e5)}return document.cookie=[n(t),\”=\”,o(r),c.expires?\”; expires=\”+c.expires.toUTCString():\”\”,c.path?\”; path=\”+c.path:\”\”,c.domain?\”; domain=\”+c.domain:\”\”,c.secure?\”; secure\”:\”\”].join(\”\”)}var d=t?undefined:{};var u=document.cookie?document.cookie.split(\”; \”):[];for(var g=0,p=u.length;g1?n[1]:\”\”}})(window);(function(e,t){var n,i;n=e.location.origin;i=e.locationOrigin;e.locationOrigin={noConflict:function(){var t=e.location.origin;e.location.origin=n;e.locationOrigin=i;return t}};if(!e.location.origin){e.location.origin=e.location.protocol+\”//\”+e.location.hostname+(e.location.port?\”:\”+e.location.port:\”\”)}})(window);(function(e){var t=e.SMCX=new function n(){var n=this;this.window=e;this.jQuery=this.$=jQuery.noConflict(true);this.JSON=e[\”JSON3\”].noConflict();this.locationOrigin=e.locationOrigin.noConflict();this.Object=e.CoreObject.noConflict();this.DEBUG_QUERY_PARAM=\”smcx_debug\”;this.FORCE_SHOW_QUERY_PARAM=\”smcx_force_show\”;n.initialize=function(e){n.PERF=e.perf;t.T(\”initializing\”);n.env=new t.Sandbox.Env;n.env.initialize(e)};n.boot=function(e){n.env.boot(e)};n.destroy=function(){if(n.env){n.env.destroy()}};n.debug=function(){if(n.env&&n.env.DEBUG){return true}var i=t.Utils.queryParams(e.parent);return i.indexOf(n.DEBUG_QUERY_PARAM)!==-1};n.T=function(e){n.PERF[e]=new Date-n.PERF[0]};function i(e,n){n=n||{};n.namespace=\”sandbox\”;t.log(e,n)}};e.SMCX.Sandbox={}})(window,document);(function(e){e.SMCX.log=function(t,n){n=n||{};if(SMCX.debug()||n.force){if(e.console){if(typeof t===\”string\”){if(n.namespace){t=\”[smcx.\”+n.namespace+\”] \”+t}else{t=\”[smcx] \”+t}}console.log(t)}}}})(window);(function(e){e.SMCX.Utils={queryParams:function(e){return e.document.location.search},onMobile:function(e){var t,n,i;n=e.document.documentElement.clientWidth;t=e.innerWidth;i=Math.max(t,n||0);return i<=760},xdmSupported:function(e){return!!e[\"postMessage\"]},browserHasLowStylesLimit:function(e){return!(\"getComputedStyle\"in e)},numStyles:function(e){var t,n,i;t=e.document;n=t.getElementsByTagName(\"link\").length;i=t.getElementsByTagName(\"style\").length;return n+i}}})(window);SMCX.UUID={generate:function(){var e=(new Date).getTime();return\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;e=Math.floor(e/16);return(t==\"x\"?n:n&3|8).toString(16)})}};(function(e,t){SMCX.Cookie={filter:function(e,n){this.log(\"Extracting CX cookies\");var i,o,r,a,s;if(e===t){this.log(\"WARNING: tried to extract CX cookies from undefined cookie\");return}o={};e=e.replace(/\\+/g,\" \");e=decodeURIComponent(e);i=e.split(\";\");for(var c=0,l=i.length;c unbinding onMessageReceived\”);if(e.window.addEventListener){e.window.removeEventListener(\”message\”,n)}else{e.window.detachEvent(\”onmessage\”,n)}}function n(e){var t=o(e);if(i(t)){if(t.requestID){a(t,e)}else{r(t,e)}}}function i(e){return e&&e.eventName&&e.eventName.substring(0,3)===\”sm:\”}function o(t){var n=t.data;if(typeof n===\”string\”){try{n=SMCX.JSON.parse(n)}catch(i){e.log(\”Invalid JSON: could not parse data\”);return null}}return n}function r(t,n){var i=t.eventName,o=e.bindings[i];d(t);if(o){s(o,[t,n])}else{e.log(\”No bindings for \”+i)}}function a(t,n){var i=t.eventName,o=t.requestID,r=e.bindings[o];u(t);if(r){s(r,[t,n],function(){delete e.bindings[o]})}else{e.log(\”No bindings for \”+i)}}function s(e,t,n){var i=0,o=e.length,r;for(;i\”:\”>\”,\’\”\’:\”"\”,\”\’\”:\”'\”,\”/\”:\”/\”};SMCX.escapeHTML=function(t){return String(t).replace(/[&<>\”\’\\/]/g,function(t){return e[t]})};SMCX.unescapeBreaks=function(e){return e.replace(/<br>/g,\”
\”)};SMCX.nl2br=function(e){var t=\”
\”;return(e+\”\”).replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g,\”$1\”+t+\”$2\”)}})();(function(e,t){SMCX.Sandbox.Env=function n(){var n=this;this.initialize=function(t){n.NAME=t.env;n.DEBUG=t.debug;this.__TYPE__=\”sandbox\”;i(\”Initializing environment (type=sandbox, debug=\”+n.DEBUG+\”)\”);n.$parentWindow=SMCX.$(e.parent);n.$parentDocument=SMCX.$(e.parent.document);n.$parentBody=SMCX.$(e.parent.document.body);n.$stage=n.$parentBody.find(\”#__smcx__\”);n.CX_COOKIES=SMCX.Cookie.filter(e[\”SM_COOKIE\”],function(e){return e.slice(0,2)===\”CX\”});n.app=SMCX.Sandbox.App.create(t.data,t.settings);SMCX.T(\”initialized\”);n.initialized=true;e.parent.SMCX.env.trigger(\”smcx.sandbox:init\”,e,SMCX)};this.boot=function(o){SMCX.T(\”booting\”);i(\”Booting SMCX\”);SMCX.$(t).ready(function(){n.app.boot(function(){SMCX.T(\”booted\”);n.app.render(function(){SMCX.T(\”rendered\”);i(SMCX.PERF,{force:true});e.parent.SMCX.env.trigger(\”smcx.sandbox:boot\”,e,SMCX);if(o){o(SMCX)}})})})};this.destroy=function(){i(\”Destroying SMCX (type=sandbox)\”);if(n.app){n.app.destroy();n.app=null}};function i(e,t){t=t||{};t.namespace=\”sandbox.env\”;SMCX.log(e,t)}}})(window,document);SMCX.Sandbox.App=SMCX.Object.extend(function e(){var e=this;this.initialize=function(n,i){e.log(\”Initializing SMCX.Sandbox.App\”);e.booted=false;e.widget=null;e.widgetView=null;e.assets={css:[]};e.config=SMCX.Sandbox.Configuration.create(i);e.messenger=new SMCX.Messenger;e.messenger.initialize({window:window.parent});SMCX.TEMPLATES=t(n[\”sdk_html\”]);e.assets.css.push(n[\”sdk_css\”]);e.assets.css.push(n[\”widget_css\”]);e.widget=SMCX.Sandbox.WidgetFactory.create(n[\”widget_attrs\”]);e.widgetView=SMCX.Sandbox.WidgetViewFactory.create(e.widget)};this.boot=function(t){e.log(\”Booting SMCX.Sandbox.App\”);SMCX.$(document).ready(function(){n();e.booted=true;i();if(t){t.call(t)}})};this.render=function(t){e.log(\”Rendering SMCX.Sandbox.App\”);r(t)};this.destroy=function(){e.log(\”Destroying SMCX.Sandbox.App\”);if(e.messenger){e.messenger.destroy();e.messenger=null}if(e.booted){e.widgetView.$el.remove();SMCX.env.$parentBody.find(\”.smcx-style\”).remove()}};this.log=function(e){SMCX.log(e,{namespace:\”app\”})};function t(e){var t={},n,i,o;o=SMCX.$(e);o.map(function(e,o){i=o.id;if(i){i=i.replace(\”smcx_\”,\”\”).replace(\”_template\”,\”\”);n=SMCX.$.trim(o.innerHTML);n=n.replace(/(\\r\\n|\\n|\\r)/gm,\”\”).replace(/\\s{2,}/g,\”\”);t[i]=n}});return t}function n(){var t=e.assets[\”css\”];for(var n=0;n\”+e+\”

\”;SMCX.env.$stage.append(SMCX.$(t))}});SMCX.Sandbox.Configuration=SMCX.Object.extend(function t(){var e=this;this.settings=null;this.initialize=function(e){this.settings=e};this.settingsFor=function(t){var n=0,i=e.settings.length,o,r,a,s={};for(;n13421771){e.classes.on.push(\”smcx-widget-light\”)}else{e.classes.on.push(\”smcx-widget-dark\”)}if(e.widget.hideBranding){e.classes.on.push(\”smcx-hide-branding\”)}};this._bindEvents=function(){};this.render=function(){SMCX.log(\”Rendering an SMCX.Sandbox.WidgetView\”);this.$el.addClass(t(this));return this};this.insert=function(){};this.animateIn=function(e){var i=this;i.$el.removeClass(i[\”HIDE_CLASS\”]).addClass(i[\”SHOW_CLASS\”]);setTimeout(function(){i.$el.removeClass(t(i)).addClass(n(i));i.setLastShownAt();if(e){e.call(e)}},0)};this.animateOut=function(e){var i=this;i.$el.removeClass(n(i)).addClass(t(i));setTimeout(function(){i.$el.removeClass(i[\”SHOW_CLASS\”]).addClass(i[\”HIDE_CLASS\”]);if(e){e.call(e)}},i[\”ANIMATION_DURATION\”])};function t(e){return e.classes.off.join(\” \”)}function n(e){return e.classes.on.join(\” \”)}function i(){var e=SMCX.Utils.queryParams(window.parent);return e.indexOf(SMCX.FORCE_SHOW_QUERY_PARAM)>0||document.location.protocol===\”file:\”}this.isShowable=function(e){var t,n,o,r,a;t=this;n=false;if(i()){n=true;e.call(e,n);return}if(t.widget.isEmbed()&&!SMCX.$(window.parent.document).find(\”body #smcx-sdk\”).length){SMCX.log(\”WidgetView is not showable because script is in \”);n=false;e.call(e,n);return}a=t.respondentStatusFor(t.widget.smCollectorId);SMCX.log(\”User has taken survey? \”+a.userHasTakenSurvey);if(t.widget.collectorIsOpen()){if(a[\”userHasTakenSurvey\”]){if(t.widget.isEmbed()&&!t.widget.hideOnRepeatVisits){n=true}}else{if(t.widget.isEmbed()){n=true}else{if(t.widget.isSampleable()){o=Math.random()>t.widget.sampleRate/100;r=t.getLastShownAt();if(!o&&!r){n=true}}else{n=true}}}}e.call(e,n)};this.getLastShownAt=function(){var t=\”smcx_\”+e.widget.id+\”_last_shown_at\”;return SMCX.$.cookie(t)};this.setLastShownAt=function(){var t=\”smcx_\”+e.widget.id+\”_last_shown_at\”,n=(new Date).getTime();SMCX.$.cookie(t,n)};this.respondentStatusFor=function(e){var t,n,i;i=\”CX_\”+e;n=SMCX.env.CX_COOKIES[i];t={userHasTakenSurvey:Boolean(n)};return t}});SMCX.Sandbox.EmbedWidgetView=SMCX.Sandbox.WidgetView.extend(function c(){var e=SMCX.Sandbox.EmbedWidgetView.prototype;this.templateName=\”embed\”;this.render=function(){e.render.call(this);this.$el.find(\”iframe\”).attr(\”src\”,this.widget.parametrizedUrl());return this};this.insert=function(){SMCX.env.$parentBody.find(\”#smcx-sdk\”).before(this.render().$el);e.insert.call(this);return this};this._setClasses=function(){e._setClasses.call(this)};this._bindEvents=function(){e._bindEvents.call(this)}});SMCX.Sandbox.ModalInvitationWidgetView=SMCX.Sandbox.WidgetView.extend(function l(){var e=this;var t=SMCX.Sandbox.ModalInvitationWidgetView.prototype;e.templateName=\”modal_invitation\”;e.render=function(){t.render.call(e);var n,i,o,r,a;n=SMCX.escapeHTML(e.widget.headline);i=SMCX.unescapeBreaks(SMCX.escapeHTML(SMCX.nl2br(e.widget.message)));o=SMCX.escapeHTML(e.widget.primaryBtnText);r=SMCX.escapeHTML(e.widget.secondaryBtnText);a=e.widget.parametrizedUrl();e.$el.find(\”[smcx-modal-headline]\”).html(n);e.$el.find(\”[smcx-modal-message]\”).html(i);e.$el.find(\”[smcx-btn-primary]\”).html(o);e.$el.find(\”[smcx-btn-secondary]\”).html(r);e.$el.find(\”[smcx-btn-primary]\”).attr(\”href\”,a);return e};e.insert=function(){SMCX.env.$parentBody.append(e.render().$el);t.insert.call(e);return e};e._setClasses=function(){t._setClasses.call(e);e.classes.off.push(\”smcx-modal-offset-bottom\”);e.classes.off.push(\”smcx-transparent\”);e.classes.on.push(\”smcx-opaque\”)};e._bindEvents=function(){t._bindEvents.call(e);e.$el.find(\”.smcx-modal-close\”).on(\”click\”,function(t){t.preventDefault();e.animateOut()});e.$el.find(\”[smcx-btn-primary]\”).on(\”click\”,function(t){e.animateOut()});e.$el.find(\”[smcx-btn-secondary]\”).on(\”click\”,function(t){t.preventDefault();e.animateOut()})}});SMCX.Sandbox.ModalSurveyWidgetView=SMCX.Sandbox.WidgetView.extend(function f(){var e=this;var t=SMCX.Sandbox.ModalSurveyWidgetView.prototype;e.templateName=\”modal_survey\”;e.render=function(){t.render.call(e);var n,i;n=SMCX.escapeHTML(e.widget.headline);i=e.widget.parametrizedUrl();e.$el.find(\”[smcx-modal-headline]\”).html(n);e.$el.find(\”iframe\”).attr(\”src\”,i);return e};e.insert=function(){SMCX.env.$parentBody.append(e.render().$el);t.insert.call(e);return e};e._setClasses=function(){t._setClasses.call(e);e.classes.off.push(\”smcx-modal-offset-bottom\”);e.classes.off.push(\”smcx-transparent\”);e.classes.on.push(\”smcx-opaque\”)};e._bindEvents=function(){t._bindEvents.call(e);e.$el.find(\”.smcx-modal-close\”).on(\”click\”,function(t){t.preventDefault();e.animateOut()})}});(function(e){if(!parent||!parent.SMCX||!parent.SMCX.env||!parent.window.SMCX.env){return}var t=parent.SMCX.env;if(t.NAME===\”test\”){e.onerror=e.parent.SMCX.onerror}t.trigger(\”smcx.container:sdkjs:loaded\”,e);if(t.options.sandbox.init){SMCX.initialize({env:t.NAME,debug:t.DEBUG,data:t.options.sandbox.data,settings:t.settings,perf:parent.SMCX.PERF});if(t.options.sandbox.boot){if(SMCX.env.initialized){SMCX.boot()}}}})(window);’,
data: {
‘sdk_css’: “.smcx-widget{display:block;margin:0;padding:0 !important;position:static;z-index:999997;font-family:’Helvetica Neue’, Helvetica, Arial, sans-serif;font-weight:100;font-size:13px;line-height:13px;color:black;opacity:1.0;transform:translate3d(0, 0, 0);-webkit-transition:all 300ms ease 0;-moz-transition:all 300ms ease 0;-ms-transition:all 300ms ease 0;-o-transition:all 300ms ease 0;transition:all 300ms ease 0}.smcx-widget,.smcx-widget *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.smcx-widget-footer{position:relative;width:100%;height:35px;margin:0;padding:0 10px}.smcx-widget-footer>.smcx-branding{display:block;position:absolute;top:0;right:10px;width:300px;height:35px;line-height:35px;background-position:right 3px;background-attachment:scroll;background-repeat:no-repeat;cursor:pointer}.smcx-widget-footer>.smcx-branding>.smcx-powered-by{position:absolute;top:0;right:146px;height:35px;margin:0;padding:0;font-family:’Helvetica Neue’, Helvetica, Arial, sans-serif;font-size:11px;font-weight:normal;line-height:35px;text-align:right}.smcx-embed{position:static !important;width:470px;height:295px;overflow:hidden;border:1px solid #ccc;background-color:#FFF;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.smcx-embed-footer{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.smcx-modal{position:fixed !important;width:470px;height:295px;left:50%;top:50%;margin:-147.5px 0 0 -235px;padding:0;background:#80802f;background:-webkit-gradient(linear, left top, left bottom, from(#BCD732), to(#B2CB2C));background:-moz-linear-gradient(center top, #BCD732 0%, #B2CB2C 100%);background:-moz-gradient(center top, #BCD732 0%, #B2CB2C 100%);border-radius:5px}.smcx-modal-header{position:relative;width:100%;height:35px;margin:0;padding:0 10px}.smcx-modal-header>.smcx-modal-title{height:35px;line-height:35px;margin:0;padding:0;font-size:14px;font-weight:bold;color:#FFFFFF}.smcx-modal-content{position:relative;height:250px;margin:0;padding:20px;background:white;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;background-clip:padding-box;overflow:none}.smcx-modal-content>.smcx-modal-h1{margin:20px 0 15px 0;padding:0;color:#000;font-family:’Helvetica Neue’, Helvetica, Arial, sans-serif;font-size:28px;font-weight:normal;line-height:28px;text-align:center;word-wrap:break-word}.smcx-modal-content>.smcx-modal-p{color:#333;font-family:’Helvetica Neue’, Helvetica, Arial, sans-serif;font-size:14px;font-weight:normal;line-height:18px;text-align:center;word-wrap:break-word}.smcx-iframe-container{height:100%;overflow:hidden;margin:0 !important}.smcx-modal-actions{position:absolute;bottom:10px;left:0;width:100%;height:57px;padding:10px 20px}.smcx-modal-close{position:absolute;top:10px;right:10px;width:16px;height:16px;background:#E8E8E8 url(\”https://secure.surveymonkey.com/assets/responseweb/responseweb/0.194.0/assets/images/website/x.png\”) 2px 2px scroll no-repeat;cursor:pointer;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;background-clip:padding-box;-webkit-transition:background-color 300ms ease 0;-moz-transition:background-color 300ms ease 0;-ms-transition:background-color 300ms ease 0;-o-transition:background-color 300ms ease 0;transition:background-color 300ms ease 0}.smcx-modal-close:hover{background-color:#C8C8C8}.smcx-modal-invitation>.smcx-modal-content{margin:10px 10px 0 10px}.smcx-modal-survey>.smcx-modal-content{margin:0 10px;padding:0}.smcx-btn{display:inline-block;margin-bottom:0;font-weight:bold;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 14px;font-size:14px;line-height:1.42857;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;background-clip:padding-box}.smcx-btn,.smcx-btn:hover{text-decoration:none}.smcx-btn-secondary{color:#333;background:gray;background:-webkit-gradient(linear, left top, left bottom, from(#F8F8F8), to(#E8E8E8));background:-moz-linear-gradient(center top, #F8F8F8 0%, #E8E8E8 100%);background:-moz-gradient(center top, #F8F8F8 0%, #E8E8E8 100%);border:none;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;background-clip:padding-box}.smcx-btn-secondary:hover{color:#333}.smcx-btn-primary{color:#FFF;background:#808036;background:-webkit-gradient(linear, left top, left bottom, from(#BED830), to(#86A33B));background:-moz-linear-gradient(center top, #BED830 0%, #86A33B 100%);background:-moz-gradient(center top, #BED830 0%, #86A33B 100%);border:none}.smcx-btn-primary:hover{color:#FFF;background:#808044;background:-webkit-gradient(linear, left top, left bottom, from(#c5dc45), to(#95b642));background:-moz-linear-gradient(center top, #c5dc45 0%, #95b642 100%);background:-moz-gradient(center top, #c5dc45 0%, #95b642 100%)}.smcx-widget-light .smcx-widget-footer>.smcx-branding{background-image:url(\”https://secure.surveymonkey.com/assets/responseweb/responseweb/0.194.0/assets/images/website/sm-logo-grey-145×30.png\”)}.smcx-widget-light .smcx-widget-footer>.smcx-branding>.smcx-powered-by{color:#60604A}.smcx-widget-dark .smcx-widget-footer>.smcx-branding{background-image:url(\”https://secure.surveymonkey.com/assets/responseweb/responseweb/0.194.0/assets/images/website/sm-logo-white-145×30.png\”)}.smcx-widget-dark .smcx-widget-footer>.smcx-branding>.smcx-powered-by{color:#FFF}.smcx-widget.smcx-hide-branding .smcx-embed-footer{display:none}.smcx-widget.smcx-hide-branding .smcx-modal-footer{height:10px}.smcx-widget.smcx-hide-branding .smcx-modal-footer>.smcx-branding{display:none}.smcx-show{display:block}.smcx-hide{display:none}.smcx-transparent{opacity:0.0 !important}.smcx-opaque{opacity:1.0 !important}.smcx-offscreen-top{top:-100px !important}.smcx-offscreen-bottom{bottom:-100px !important}.smcx-offscreen-left{left:-100px !important}.smcx-offscreen-right{right:-100px !important}.smcx-modal-offset-top{margin-top:-185px !important}.smcx-modal-offset-bottom{margin-top:-105px !important}.smcx-top{top:0}.smcx-bottom{bottom:0}.smcx-left{left:0}.smcx-right{right:0}.smcx-pull-left{float:left}.smcx-pull-right{float:right}\n”,
‘sdk_html’: “

\n\n

\n

\n

\n

\n\n

\n\n

\n \n \n

\n

\n

\n

\n\n

\n\n

\n\n

\n

\n

\n

\n

\n\n

\n

\n \n

\n

\n\n

\n

\n\n

\n\n

\n\n

\n

\n \n

\n

\n

\n\n

“,
‘widget_css’: “.smcx-modal{width:98%;max-width:500px;height:300px;margin-left:-250px !important;margin-top:-150px !important;background:#333E48}.smcx-modal>.smcx-modal-content{width:480px;height:230px}@media (max-width: 500px){.smcx-modal{left:0 !important;margin-left:1% !important}.smcx-modal>.smcx-modal-content{width:96%;margin-left:2% !important;margin-right:2% !important}}.smcx-modal.smcx-hide-branding>.smcx-modal-content{height:255px}\n”,
‘widget_attrs’: {“sm_collector_id”: 169052273, “survey_url”: “https://www.surveymonkey.com/r/JSBMVTY”, “height”: 300, “branding_url”: “https://www.surveymonkey.com/user/sign-up/?ut_source=powered_by&ut_source2=new_website_collector”, “bg_color_b”: null, “bg_color_a”: “#333E48”, “active”: true, “token_version”: 2, “id”: 0, “width”: 500, “url”: “https://www.surveymonkey.com/r/JSBMVTY”, “headline”: “College Readiness Survey”, “sample_rate”: “100”, “collector_status”: “open”, “hide_branding”: false, “type”: “ModalSurveyWidget”}
}
}
});

SMCX.boot();
}

wrapped.call(wrapped);

Categories: Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *