/*!

* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard
using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2013 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v1.2.1
*/
(function() {
"use strict";
var _camelizeCssPropName = function() {
var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
return group.toUpperCase();
};
return function(prop) {
return prop.replace(matcherRegex, replacerFn);
};
}();
var _getStyle = function(el, prop) {
var value, camelProp, tagName, possiblePointers, i, len;
if (window.getComputedStyle) {
value = window.getComputedStyle(el, null).getPropertyValue(prop);
} else {
camelProp = _camelizeCssPropName(prop);
if (el.currentStyle) {
value = el.currentStyle[camelProp];
} else {
value = el.style[camelProp];
}
}
if (prop === "cursor") {
if (!value || value === "auto") {
tagName = el.tagName.toLowerCase();
possiblePointers = [ "a" ];
for (i = 0, len = possiblePointers.length; i < len; i++) {
if (tagName === possiblePointers[i]) {
return "pointer";
}
}
}
}
return value;
};
var _elementMouseOver = function(event) {
if (!ZeroClipboard.prototype._singleton) return;
if (!event) {
event = window.event;
}
var target;
if (this !== window) {
target = this;
} else if (event.target) {
target = event.target;
} else if (event.srcElement) {
target = event.srcElement;
}
ZeroClipboard.prototype._singleton.setCurrent(target);
};

attachEvent("on" + method. func. return element. if (element. } }.length.detachEvent) { element. }. ""). } }. c++) { className = className.className. } } } return element.detachEvent("on" + method.split(/\s+/).className + " ").length. var _removeEventHandler = function(element. value) { if (element.replace(/^\s+|\s+$/g. var _addClass = function(element. func). func.className + " ".attachEvent) { element. method.nodeType === 1) { if (!element. } else if (element. cl = classNames. value) { if (element. } else if (element. var _removeClass = function(element. } else { element. } } element.className) { if (value) { var className = (" " + element. func) { if (element.className = className. } if (value && typeof value === "string" || value === undefined) { var classNames = (value || "").removeClass) { element. for (var c = 0. " "). method. "").replace(/^\s+|\s+$/g. }.addEventListener) { element. false). . func). return element.className) { element.removeEventListener(method. for (var c = 0.addClass) { element.removeEventListener) { element. } } } return element. c++) { if (className. cl = classNames. c < cl. if (element.indexOf(" " + classNames[c] + " ") < 0) { setClass += " " + classNames[c].addEventListener(method.className = value.className = "".replace(" " + classNames[c] + " ". setClass = element. c < cl. } if (value && typeof value === "string") { var classNames = (value || ""). } else { var className = " " + element. } element.nodeType === 1 && element.addClass(value).removeClass(value).split(/\s+/). " "). false).className = setClass. var _addEventHandler = function(element. func) { if (element.replace(/[\n\t]/g.

zoomFactor. } else { return "".getBoundingClientRect) { var rect = obj. options) { var useNoCache = !(options && options.trustedOrigins) { if (typeof options.round(physicalWidth / logicalWidth * 100) / 100. info.body. } var leftBorderWidth = document. if (zi && zi !== "auto") { info.left. info.documentElement. }.width : rect. } if (obj.getBoundingClientRect === "function") { rect = document.top + pageYOffset . pageYOffset = window. pageYOffset.clientLeft || 0.left = rect.body.push(options.top.left + pageXOffset .scrollTop / zoomFactor).height : rect.getTime(). logicalWidth. var origins = [].rect. pageXOffset = Math.zIndex = parseInt(zi.getBoundingClientRect(). info.trustedOrigins) { .topBorderWidth. zoomFactor = Math.height = "height" in rect ? rect. var _noCache = function(path. zoomFactor = 1.rect. physicalWidth = rect.pageYOffset. info.indexOf("?") === -1 ? "?" : "&") + "nocache=" + new Date(). var _vars = function(options) { var str = [].useNoCache === false).right . var topBorderWidth = document.trustedOrigins === "object" && "length" in options. } return info.body. top: 0. var zi = _getStyle(obj. zIndex: 999999999 }.round(document.clientTop || 0.trustedOrigins). physicalWidth. pageYOffset = Math. width: 0.trustedOrigins === "string") { origins. if (typeof document. if ("pageXOffset" in window && "pageYOffset" in window) { pageXOffset = window. height: 0. var _getDOMObjectPosition = function(obj) { var info = { left: 0.leftBorderWidth.right .pageXOffset. var _getZoomFactor = function() { var rect.documentElement. } else { zoomFactor = _getZoomFactor().rect.left. 10). } else if (typeof options. if (options.top = rect.getBoundingClientRect().documentElement. "z-index").scrollLeft / zoomFactor).width = "width" in rect ? rect. } return zoomFactor.documentElement.offsetWidth. var pageXOffset.round(document. } }.bottom . logicalWidth = document. if (useNoCache) { return (path. }.

if (ZeroClipboard._singleton) return ZeroClipboard.call(element. if (ZeroClipboard.cjsModuleId === "string" && options.amdModuleId === "string" && options.amdModuleId)).amdModuleId) { str. }.glue(elements).trustedDomains === "string") { origins.options[kd] = _defaults[kd]. i < length. return elements.indexOf) { return array._singleton. }.options[ko] = options[ko].join(". i++) { if (array[i] === elem) { return i.concat(options.prototype.length.push("cjsModuleId=" + encodeURIComponent(options. async) { if (async) { window. if (!elements. } if (typeof options.trustedDomains) { origins = origins. args). origins = origins. }.setTimeout(function() { func.trustedDomains). args.trustedOrigins). var ZeroClipboard = function(elements. var _prepGlue = function(elements) { if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.trustedDomains).detectFlashSupport()) _bridge().concat(options. }.call(element.").handlers = {}. 0). instance.push("trustedOrigins=" + encodeURIComponent(origins.cjsModuleId)). var _dispatchCallback = function(func. options) { if (elements) (ZeroClipboard. array) { if (array. } else { func. } return str.prototype.join("&").push("amdModuleId=" + encodeURIComponent(options._singleton || this). } } return -1. length = array.prototype. ZeroClipboard.cjsModuleId) { str. var _inArray = function(elem. this.options = {}. instance. } if (typeof options. ._singleton = this.length) return [ elements ]. this.length) { str. } for (var i = 0. }.indexOf(elem).push(options. for (var kd in _defaults) this. for (var ko in options) this."))).trustedDomains === "object" && "length" in options.trustedDomains) { if (typeof options. element. args). } else if (typeof options. } } if (options. } } if (origins.prototype. instance. } }.

this.setText(newText)._singleton._singleton.setHandCursor(enabled).setDefaults = function(options) { for (var ko in options) _defaults[ko] = options[ko]. delete ZeroClipboard. return this.setCurrent = function(element) { currentElement = element.prototype. hoverClass: "zeroclipboard-is-hover". allowScriptAccess: "sameDomain". forceHandCursor: false }. }. gluedElements = [].reposition().flashBridge.prototype.call(this.prototype.ready()) this.getAttribute("title").detectFlashSupport = function() { . "cursor") === "pointer". var _setHandCursor = function(enabled) { if (this.forceHandCursor = enabled.prototype.prototype. height) { if (this. }. }.options.setSize(width.setHandCursor = function(enabled) { enabled = typeof enabled === "boolean" ? enabled : !!enabled.ready()) this.setTitle(titleAttr).setSize = function(width. return this.prototype. text: null. return this. var bridge = ZeroClipboard.unglue(gluedElements)._singleton. this. ZeroClipboard.htmlBridge. }. height). _setHandCursor.forceHandCursor === true || _getStyle(element. activeClass: "zeroclipboard-is-active".call(this. _setHandCursor. ZeroClipboard. ZeroClipboard. ZeroClipboard. } return this. ZeroClipboard.setText = function(newText) { if (newText && newText !== "") { this.swf".text = newText. } var useHandCursor = this. useNoCache: true. ZeroClipboard.version = "1.setAttribute("title". }.options.prototype.options.2. useHandCursor). var titleAttr = element. trustedOrigins: null. ZeroClipboard. ZeroClipboard.flashBridge.htmlBridge.prototype. if (titleAttr) { this.ready()) this. if (this. ZeroClipboard.parentNode. var currentElement. newTitle).destroy = function() { ZeroClipboard.flashBridge. }. }.1". }. var _defaults = { moviePath: "ZeroClipboard. enabled). bridge.setTitle = function(newTitle) { if (newTitle && newTitle !== "") this. return this.removeChild(bridge).

container = document.style. } } catch (error) {} } if (!hasFlash && navigator. } return hasFlash.options.left = "-9999px".options. if (typeof ActiveXObject === "function") { try { if (new ActiveXObject("ShockwaveFlash. container. opts. var container = document.options) opts[ko] = client. if (!container) { var opts = {}.options. client. container.flashBridge = document["global-zeroclipboard-flash-bridge"] || container.setAttribute("class".prototype.amdModuleId = _amdModuleId. var _bridge = function() { var client = ZeroClipboard.moviePath + _noCache(client.moviePath.options.allowScriptAccess + '"/> <param name="scale" value="exactfit"/> <param name="loop" value="false"/> <param name="menu" value="false"/> <param name="quality" value="best" /> <param name="bgcolor" value="#ffffff"/> <param name="wmode" value="transparent"/> <param name="flashvars" value="' + flashvars + '"/> <embed src="' + client.setAttribute("data-clipboard-ready". client.createElement("div").body. client. var _amdModuleId = null._singleton.innerHTML = html.style.com/go/getflashplayer" flashvars="' + flashvars + '" scale="exactfit"> </embed> </object>'. container.ShockwaveFlash")) { hasFlash = true.children[0]. for (var ko in client.getElementById("global-zeroclipboard-html-bridge").cjsModuleId = _cjsModuleId. container.height = "15px". var hasFlash = false.width = "15px". container.top = "-9999px".resetBridge = function() { . var _cjsModuleId = null.prototype.zIndex = "9999".options.moviePath.style.macromedia. ZeroClipboard. container.lastElementChild.options) + '" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="global- zeroclipboard-flash-bridge" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www. false). container.style.style.moviePath + _noCache(client.mimeTypes["application/x-shockwave-flash"]) { hasFlash = true. container.options[ko]. document. }. container. var html = ' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8- 444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%"> <param name="movie" value="' + client. opts. }.options) + '"/> <param name="allowScriptAccess" value="' + client.htmlBridge = container. container. var flashvars = _vars(opts). } client.id = "global-zeroclipboard-html-bridge".style.appendChild(container).position = "absolute". "global-zeroclipboard-container").

top + "px".toLowerCase().replace(". this. }.style. this.handlers) { if (event === eventName && this.getAttribute("data-clipboard-ready"). this. this. var pos = _getDOMObjectPosition(currentElement).noflash && !ZeroClipboard.height + "px".height). }.split(/\s/g).left + "px".length.on = function(eventName. for (var i = 0.activeClass).replace(/^on/. } } } return this.htmlBridge.off = function(eventName. ZeroClipboard.on.width = pos.handlers[eventName]) this._singleton. args). "").split(/\s/g).length. pos. }.prototype.handlers.removeEventListener = ZeroClipboard. }.height = pos. this.htmlBridge.prototype.toString().top = "-9999px".zIndex = pos. return ready === "true" || ready === true. } if (this.replace(/[^0- .prototype.prototype.prototype.toLowerCase().zIndex + 1.htmlBridge.text = null.left = "-9999px".removeAttribute("title").style.htmlBridge. this. for (var event in this.off.replace(/^on/.htmlBridge. "").receiveEvent = function(eventName.width. if (!this.receiveEvent(eventName. ZeroClipboard.style.left = pos.dispatch = function(eventName. ZeroClipboard.flashVersion. i < events. i++) { eventName = events[i]. return this.style.htmlBridge. ZeroClipboard.reposition = function() { if (!currentElement) return false."). for (var i = 0.handlers[event] === func) { delete this. ZeroClipboard. args) { eventName = eventName. i++) { eventName = events[i].options. this. return this.options.htmlBridge.prototype. this.prototype. ""). }.toString(). ".htmlBridge. func) { var events = eventName. currentElement = null. func) { var events = eventName. this. var performCallbackAsync = true.prototype. ZeroClipboard.toLowerCase().receiveEvent("onNoFlash".style.detectFlashSupport()) { this.ready = function() { var ready = this.htmlBridge. this.prototype.handlers[eventName] = func. this.addEventListener = ZeroClipboard.style.replace(/^on/.prototype.top = pos.".toString(). _removeClass(currentElement.style. var element = currentElement.htmlBridge. args) { ZeroClipboard. }. this. ZeroClipboard.handlers[event]. switch (eventName) { case "load": if (args && parseFloat(args.setSize(pos.width + "px".removeAttribute("data-clipboard-text"). null). ZeroClipboard. } return this. i < events.

innerText.prototype.length. case "datarequested": var targetId = element. { flashVersion: args. if (textContent) this.handlers[eventName]. break.push(elements[i]). this.flashVersion }). i < elements. } else { var defaultText = element. "")) < 10) { this. .options. for (var i = 0.options. } if (this. } } }.glue = function(elements) { elements = _prepGlue(elements). if (defaultText) this.activeClass). case "mouseup": _removeClass(element. performCallbackAsync). } if (typeof func === "function") { _dispatchCallback(func. break.htmlBridge.activeClass). targetEl = ! targetId ? null : document.hoverClass). ZeroClipboard. case "mouseout": _removeClass(element.receiveEvent("onWrongFlash". break. this. this.getElementById(targetId). args. case "complete": this. this. if (targetEl) { var textContent = targetEl. break.options. break.resetBridge(). if (typeof func === "string" && typeof window[func] === "function") { func = window[func]. break. case "mouseover": _addClass(element. element.options.text = null. gluedElements) == -1) { gluedElements.textContent || targetEl.value || targetEl. i++) { if (_inArray(elements[i]. break. return. this.setText(textContent).handlers[eventName]) { var func = this.hoverClass). } performCallbackAsync = false.9\. this. true).options. } this.getAttribute("data-clipboard-target").getAttribute("data-clipboard-text"). case "mousedown": _addClass(element.]/gi.setAttribute("data-clipboard-ready".setText(defaultText).

"mouseover".unglue = function(elements) { elements = _prepGlue(elements). } } return this. function(require. ZeroClipboard. }). } else { window.length. return ZeroClipboard. i++) { _removeEventHandler(elements[i].amd) { define([ "require". }.prototype. module. 1).id || null. module) { _amdModuleId = module && module.splice(arrayIndex. "mouseover". i < elements. var arrayIndex = _inArray(elements[i].exports === "object" && module. _elementMouseOver). }. _elementMouseOver). exports. "module" ]. _addEventHandler(elements[i]. if (typeof define === "function" && define. } return this. } else if (typeof module === "object" && module && typeof module.id || null. } })(). gluedElements).ZeroClipboard = ZeroClipboard. .exports = ZeroClipboard. if (arrayIndex != -1) gluedElements. "exports". for (var i = 0.exports) { _cjsModuleId = module.