Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Solve TODO "Make this configurable" in "programs/zwift-store-profile.mjs" #42

Open
1 task done
Strajk opened this issue Aug 19, 2023 · 1 comment · May be fixed by #44
Open
1 task done

Sweep: Solve TODO "Make this configurable" in "programs/zwift-store-profile.mjs" #42

Strajk opened this issue Aug 19, 2023 · 1 comment · May be fixed by #44
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@Strajk
Copy link
Owner

Strajk commented Aug 19, 2023

Solve TODO "Make this configurable" located in "programs/zwift-store-profile.mjs" on line 10

Checklist
  • programs/zwift-store-profile.mjs

• Add a new line after line 13 to define a new environment variable for the data file path. The line should be: const dataFilePath = process.env.ZWIFT_DATA_FILE_PATH;
• Modify line 9 to use the dataFilePath variable instead of the hardcoded path. The line should be: const DATA_FILE_PATH = dataFilePath || ${os.homedir()}/zwift-data.csv;

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 19, 2023
@sweep-ai
Copy link

sweep-ai bot commented Aug 19, 2023

Here's the PR! #44.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 2 GPT-4 tickets left for the month and 0 for the day. For more GPT-4 tickets, visit our payment portal. To retrigger Sweep edit the issue.


Step 1: 🔍 Code Search

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

#!/usr/bin/env node --experimental-fetch
/* BEWARE: Requires ZWIFT_USERNAME and ZWIFT_PASSWORD to be set either in ~/.secrets or in env vars */
import fs from "node:fs"
import assert from 'node:assert';
import os from 'node:os';
import jwtDecode from "jwt-decode";
import { config } from 'dotenv';
const DATA_FILE_PATH = `${os.homedir()}/zwift-data.csv` // TODO: Make this configurable
config({ path: `${os.homedir()}/.secrets` }) // file containing ZWIFT_USERNAME and ZWIFT_PASSWORD
const username = process.env.ZWIFT_USERNAME
const password = process.env.ZWIFT_PASSWORD
let accessToken = process.env.ZWIFT_ACCESS_TOKEN
let refreshToken = process.env.ZWIFT_REFRESH_TOKEN
if (!accessToken || jwtDecode(accessToken).exp < Date.now() / 1000) { // access token either doesn't exist or is expired
if (refreshToken && jwtDecode(refreshToken).exp > Date.now() / 1000) { // refresh token exists and is not expired
const res = await fetch('https://secure.zwift.com/auth/realms/zwift/protocol/openid-connect/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
"client_id": "Zwift Game Client",
"grant_type": "refresh_token",
"refresh_token": refreshToken,
}).toString(),
})
const resJson = await res.json()
accessToken = resJson.access_token
refreshToken = resJson.refresh_token
} else if (username && password) {
const res = await fetch('https://secure.zwift.com/auth/realms/zwift/protocol/openid-connect/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
"client_id": "Zwift Game Client",
"grant_type": "password",
"username": username,
"password": password,
}).toString(),
})
const resJson = await res.json()
accessToken = resJson.access_token
refreshToken = resJson.refresh_token
// TODO: Maybe store the refresh token somewhere? Maybe directly to the .secrets file?
} else {
throw new Error('No access token, refresh token or username/password provided')
}
}
assert(accessToken, 'Still no access token')
const apiRes = await fetch("https://us-or-rly101.zwift.com/api/profiles/me", {
"headers": {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9,cs;q=0.8,sk;q=0.7",
"authorization": `Bearer ${accessToken}`,
"cache-control": "no-cache",
"source": "my-zwift",
"x-forwarded-for": "null",
"x-real-ip": "null",
"zwift-api-version": "2.5"
},
"referrer": "https://www.zwift.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
assert(apiRes.status === 200, "API request failed");
let apiData
try {
apiData = await apiRes.json()
} catch (err) {
let apiText = await apiRes.text()
console.error('Invalid API response', apiText)
process.exit(1)
}
const output = [
new Date().toISOString(),
apiData.totalExperiencePoints,
apiData.totalGold,
apiData.totalDistance,
apiData.totalDistanceClimbed,
]
if (fs.existsSync(DATA_FILE_PATH)) {
const lines = fs.readFileSync(DATA_FILE_PATH, 'utf8').split('\n').filter(Boolean)
const lastLine = lines[lines.length - 1]
const lastLineData = lastLine.split(',')
const lastLineDate = lastLineData[0]
const lastLineXp = lastLineData[1]
console.log(`${lastLineXp} XP -> ${apiData.totalExperiencePoints} XP`)
} else {
fs.writeFileSync(DATA_FILE_PATH, "date,xp,coins,distance,climbed\n", "utf-8")
}
fs.appendFileSync(DATA_FILE_PATH, output.join(",") + "\n", "utf-8")
/* Helpers */
/* === */
function unixTimeToHuman (unixTime) {
const date = new Date(unixTime * 1000)
return date.toISOString()
}

(function(k,w){var q=k.document,x=k.navigator,G=k.setTimeout,ha=k.clearTimeout,ia=k.setInterval,ja=k.clearInterval,U=k.getComputedStyle,J=k.encodeURIComponent,V=k.ActiveXObject,ka=k.Error,la=k.Number.parseInt||k.parseInt,D=k.Number.parseFloat||k.parseFloat,ma=k.Number.isNaN||k.isNaN,W=k.Date.now,X=k.Object.keys,na=k.Object.defineProperty,t=k.Object.prototype.hasOwnProperty,oa=k.Array.prototype.slice,pa=function(){var a=function(e){return e};if(typeof k.wrap==="function"&&typeof k.unwrap==="function")try{var c=
q.createElement("div"),b=k.unwrap(c);if(c.nodeType===1&&b&&b.nodeType===1)a=k.unwrap}catch(d){}return a}(),n=function(a){return oa.call(a,0)},p=function(){var a,c,b,d,e,f=n(arguments),h=f[0]||{};a=1;for(c=f.length;a<c;a++)if((b=f[a])!=null)for(d in b)if(t.call(b,d)){e=b[d];if(h!==e&&e!==w)h[d]=e}return h},B=function(a){var c,b,d;if(typeof a!=="object"||a==null||typeof a.nodeType==="number")c=a;else if(typeof a.length==="number"){c=[];b=0;for(d=a.length;b<d;b++)if(t.call(a,b))c[b]=B(a[b])}else{c={};
for(b in a)if(t.call(a,b))c[b]=B(a[b])}return c},Y=function(a,c){if(a&&a.nodeType===1&&a.ownerDocument&&c&&(c.nodeType===1&&c.ownerDocument&&c.ownerDocument===a.ownerDocument||c.nodeType===9&&!c.ownerDocument&&c===a.ownerDocument)){do{if(a===c)return true;a=a.parentNode}while(a)}return false},Z=function(a){var c;if(typeof a==="string"&&a){a.split("#")[0].split("?");c=a.slice(0,a.lastIndexOf("/")+1)}return c},qa=function(){var a,c,b,d=q.getElementsByTagName("script");for(a=d.length;a--;){if(!(b=d[a].src)){c=
null;break}b=Z(b);if(c==null)c=b;else if(c!==b){c=null;break}}return c||w},$=k.opener==null&&(!!k.top&&k!=k.top||!!k.parent&&k!=k.parent),j={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},y,z={},v,K,s={},L=null,M=0,N=0,ra={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},
sa=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],A=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],ta=RegExp("^flash-("+A.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),ua=RegExp("^flash-("+A.slice(1).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),l={swfPath:(Z(function(){var a,c,b;if(q.currentScript&&(a=q.currentScript.src))return a;
c=q.getElementsByTagName("script");if(c.length===1)return c[0].src||w;if("readyState"in c[0])for(b=c.length;b--;)if(c[b].readyState==="interactive"&&(a=c[b].src))return a;if(q.readyState==="loading"&&(a=c[c.length-1].src))return a;var d;try{throw new ka;}catch(e){a=e}if(a){if(!(d=a.sourceURL)){if(!(d=a.fileName)){d=a.stack;var f;if(typeof d==="string"&&d)if((a=d.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&
a[1])f=a[1];else if((a=d.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&a[1])f=a[1];d=f}d=d}d=d}if(a=d)return a;return w}())||qa()||"")+"ZeroClipboard.swf",trustedDomains:k.location.host?[k.location.host]:[],cacheBust:true,forceEnhancedClipboard:false,flashLoadTimeout:3E4,autoActivate:true,bubbleEvents:true,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",
activeClass:"zeroclipboard-is-active",forceHandCursor:false,title:null,zIndex:999999999},va=function(a){if(typeof a==="object"&&a!==null)for(var c in a)if(t.call(a,c))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(c))l[c]=a[c];else if(j.bridge==null)if(c==="containerId"||c==="swfObjectId")if(typeof a[c]==="string"&&a[c]&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a[c]))l[c]=a[c];else throw Error("The specified `"+c+"` value is not valid as an HTML4 Element ID");else l[c]=a[c];if(typeof a==="string"&&
a){if(t.call(l,a))return l[a]}else return B(l)},wa=function(){O();for(var a=["userAgent","platform","appName"],c={},b=0,d=a.length;b<d;b++)if(a[b]in x)c[a[b]]=x[a[b]];a=["bridge"];b={};for(var e in j)if(a.indexOf(e)===-1)b[e]=j[e];return{browser:c,flash:b,zeroclipboard:{version:g.version,config:g.config()}}},xa=function(){return!!(j.disabled||j.outdated||j.sandboxed||j.unavailable||j.degraded||j.deactivated)},ya=function(a,c){var b,d,e,f={};if(typeof a==="string"&&a)e=a.toLowerCase().split(/\s+/);
else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&g.on(b,a[b]);if(e&&e.length){b=0;for(d=e.length;b<d;b++){a=e[b].replace(/^on/,"");f[a]=true;z[a]||(z[a]=[]);z[a].push(c)}f.ready&&j.ready&&g.emit({type:"ready"});if(f.error){b=0;for(d=A.length;b<d;b++)if(j[A[b].replace(/^flash-/,"")]===true){g.emit({type:"error",name:A[b]});break}y!==w&&g.version!==y&&g.emit({type:"error",name:"version-mismatch",jsVersion:g.version,swfVersion:y})}}return g},
za=function(a,c){var b,d,e,f,h;if(arguments.length===0)f=X(z);else if(typeof a==="string"&&a)f=a.split(/\s+/);else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&g.off(b,a[b]);if(f&&f.length){b=0;for(d=f.length;b<d;b++){a=f[b].toLowerCase().replace(/^on/,"");if((h=z[a])&&h.length)if(c)for(e=h.indexOf(c);e!==-1;){h.splice(e,1);e=h.indexOf(c,e)}else h.length=0}}return g},Aa=function(a){return typeof a==="string"&&a?B(z[a])||
null:B(z)},Ca=function(a){var c,b,d;if(a=aa(a)){var e=a,f=e.target||v||null,h=e._source==="swf";delete e._source;switch(e.type){case "error":if(!(f=e.name==="flash-sandboxed")){f=null;if($===false||e&&e.type==="error"&&e.name&&sa.indexOf(e.name)!==-1)f=false;f=f}f=f;if(typeof f==="boolean")j.sandboxed=f;if(A.indexOf(e.name)!==-1)p(j,{disabled:e.name==="flash-disabled",outdated:e.name==="flash-outdated",unavailable:e.name==="flash-unavailable",degraded:e.name==="flash-degraded",deactivated:e.name===
"flash-deactivated",overdue:e.name==="flash-overdue",ready:false});else if(e.name==="version-mismatch"){y=e.swfVersion;p(j,{disabled:false,outdated:false,unavailable:false,degraded:false,deactivated:false,overdue:false,ready:false})}H();break;case "ready":y=e.swfVersion;f=j.deactivated===true;p(j,{disabled:false,outdated:false,sandboxed:false,unavailable:false,degraded:false,deactivated:false,overdue:f,ready:!f});H();break;case "beforecopy":K=f;break;case "copy":var i,m;f=e.relatedTarget;if(!(s["text/html"]||
s["text/plain"])&&f&&(m=f.value||f.outerHTML||f.innerHTML)&&(i=f.value||f.textContent||f.innerText)){e.clipboardData.clearData();e.clipboardData.setData("text/plain",i);m!==i&&e.clipboardData.setData("text/html",m)}else if(!s["text/plain"]&&e.target&&(i=e.target.getAttribute("data-clipboard-text"))){e.clipboardData.clearData();e.clipboardData.setData("text/plain",i)}break;case "aftercopy":Ba(e);g.clearData();if(i=f){var o;try{o=q.activeElement}catch(P){o=null}i=f!==o&&f.focus}i&&f.focus();break;case "_mouseover":g.focus(f);
if(l.bubbleEvents===true&&h){f&&f!==e.relatedTarget&&!Y(e.relatedTarget,f)&&C(p({},e,{type:"mouseenter",bubbles:false,cancelable:false}));C(p({},e,{type:"mouseover"}))}break;case "_mouseout":g.blur();if(l.bubbleEvents===true&&h){f&&f!==e.relatedTarget&&!Y(e.relatedTarget,f)&&C(p({},e,{type:"mouseleave",bubbles:false,cancelable:false}));C(p({},e,{type:"mouseout"}))}break;case "_mousedown":ba(f,l.activeClass);l.bubbleEvents===true&&h&&C(p({},e,{type:e.type.slice(1)}));break;case "_mouseup":E(f,l.activeClass);
l.bubbleEvents===true&&h&&C(p({},e,{type:e.type.slice(1)}));break;case "_click":K=null;l.bubbleEvents===true&&h&&C(p({},e,{type:e.type.slice(1)}));break;case "_mousemove":l.bubbleEvents===true&&h&&C(p({},e,{type:e.type.slice(1)}));break}if(/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type))c=true;if(!c){if(a.type==="ready"&&j.overdue===true)return g.emit({type:"error",name:"flash-overdue"});c=p({},a);if(typeof c==="object"&&c&&c.type){e=ca(c);if((f=(z["*"]||[]).concat(z[c.type]||[]))&&f.length){var r;
i=0;for(m=f.length;i<m;i++){o=f[i];h=this;if(typeof o==="string"&&typeof k[o]==="function")o=k[o];if(typeof o==="object"&&o&&typeof o.handleEvent==="function"){h=o;o=o.handleEvent}if(typeof o==="function"){r=p({},c);da(o,h,[r],e)}}}}if(a.type==="copy"){b={};a={};if(typeof s==="object"&&s){for(d in s)if(d&&t.call(s,d)&&typeof s[d]==="string"&&s[d])switch(d.toLowerCase()){case "text/plain":case "text":case "air:text":case "flash:text":b.text=s[d];a.text=d;break;case "text/html":case "html":case "air:html":case "flash:html":b.html=
s[d];a.html=d;break;case "application/rtf":case "text/rtf":case "rtf":case "richtext":case "air:rtf":case "flash:rtf":b.rtf=s[d];a.rtf=d;break;default:break}d={data:b,formatMap:a}}else d=void 0;b=d.data;L=d.formatMap}return b}}},Ea=function(){var a=j.sandboxed;O();if(typeof j.ready!=="boolean")j.ready=false;if(j.sandboxed!==a&&j.sandboxed===true){j.ready=false;g.emit({type:"error",name:"flash-sandboxed"})}else if(!g.isFlashUnusable()&&j.bridge===null){a=l.flashLoadTimeout;if(typeof a==="number"&&
a>=0)M=G(function(){if(typeof j.deactivated!=="boolean")j.deactivated=true;j.deactivated===true&&g.emit({type:"error",name:"flash-deactivated"})},a);j.overdue=false;Da()}},Ga=function(){g.clearData();g.blur();g.emit("destroy");Fa();g.off()},Ha=function(a,c){var b;if(typeof a==="object"&&a&&typeof c==="undefined"){b=a;g.clearData()}else if(typeof a==="string"&&a){b={};b[a]=c}else return;for(var d in b)if(typeof d==="string"&&d&&t.call(b,d)&&typeof b[d]==="string"&&b[d])s[d]=b[d]},Ia=function(a){if(typeof a===
"undefined"){if(s)for(var c in s)t.call(s,c)&&delete s[c];L=null}else typeof a==="string"&&t.call(s,a)&&delete s[a]},Ja=function(a){if(typeof a==="undefined")return B(s);else if(typeof a==="string"&&t.call(s,a))return s[a]},Ka=function(a){if(a&&a.nodeType===1){if(v){E(v,l.activeClass);v!==a&&E(v,l.hoverClass)}v=a;ba(a,l.hoverClass);var c=a.getAttribute("title")||l.title;if(typeof c==="string"&&c){var b=F(j.bridge);b&&b.setAttribute("title",c)}a=l.forceHandCursor===true||ea(a,"cursor")==="pointer";
if(j.ready===true)if(j.bridge&&typeof j.bridge.setHandCursor==="function")j.bridge.setHandCursor(a);else j.ready=false;var d;if(v&&(d=F(j.bridge))){a=Q(v);p(d.style,{width:a.width+"px",height:a.height+"px",top:a.top+"px",left:a.left+"px",zIndex:""+R(l.zIndex)})}}},La=function(){var a=F(j.bridge);if(a){a.removeAttribute("title");a.style.left="0px";a.style.top="-9999px";a.style.width="1px";a.style.height="1px"}if(v){E(v,l.hoverClass);E(v,l.activeClass);v=null}},Ma=function(){return v||null},aa=function(a){var c;
if(typeof a==="string"&&a){c=a;a={}}else if(typeof a==="object"&&a&&typeof a.type==="string"&&a.type)c=a.type;if(c){c=c.toLowerCase();if(!a.target&&(/^(copy|aftercopy|_click)$/.test(c)||c==="error"&&a.name==="clipboard-error"))a.target=K;p(a,{type:c,target:a.target||v||null,relatedTarget:a.relatedTarget||null,currentTarget:j&&j.bridge||null,timeStamp:a.timeStamp||W()||null});c=ra[a.type];if(a.type==="error"&&a.name&&c)c=c[a.name];if(c)a.message=c;a.type==="ready"&&p(a,{target:null,version:j.version});
if(a.type==="error"){ta.test(a.name)&&p(a,{target:null,minimumVersion:"11.0.0"});ua.test(a.name)&&p(a,{version:j.version})}if(a.type==="copy")a.clipboardData={setData:g.setData,clearData:g.clearData};if(a.type==="aftercopy"){a=a;c=L;if(typeof a==="object"&&a&&typeof c==="object"&&c){var b={};for(var d in a)if(t.call(a,d))if(d==="errors"){b[d]=a[d]?a[d].slice():[];for(var e=0,f=b[d].length;e<f;e++)b[d][e].format=c[b[d][e].format]}else if(d!=="success"&&d!=="data")b[d]=a[d];else{b[d]={};e=a[d];for(var h in e)if(h&&
t.call(e,h)&&t.call(c,h))b[d][c[h]]=e[h]}a=b}else a=a}if(a.target&&!a.relatedTarget){d=a;h=(h=(h=a.target)&&h.getAttribute&&h.getAttribute("data-clipboard-target"))?q.getElementById(h):null;d.relatedTarget=h}if((d=a)&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(d.type)){h=d.target;a=d.type==="_mouseover"&&d.relatedTarget?d.relatedTarget:w;c=d.type==="_mouseout"&&d.relatedTarget?d.relatedTarget:w;e=Q(h);b=e.left+(typeof d._stageX==="number"?d._stageX:0);e=e.top+(typeof d._stageY==="number"?
d._stageY:0);f=b-(q.body.scrollLeft+q.documentElement.scrollLeft);var i=e-(q.body.scrollTop+q.documentElement.scrollTop),m=(k.screenLeft||k.screenX||0)+f,o=(k.screenTop||k.screenY||0)+i,P=typeof d.movementX==="number"?d.movementX:0,r=typeof d.movementY==="number"?d.movementY:0;delete d._stageX;delete d._stageY;p(d,{srcElement:h,fromElement:a,toElement:c,screenX:m,screenY:o,pageX:b,pageY:e,clientX:f,clientY:i,x:f,y:i,movementX:P,movementY:r,offsetX:0,offsetY:0,layerX:0,layerY:0})}return d}},ca=function(a){return!/^(?:(?:before)?copy|destroy)$/.test(a&&
typeof a.type==="string"&&a.type||"")},da=function(a,c,b,d){d?G(function(){a.apply(c,b)},0):a.apply(c,b)},Ba=function(a){if(a.errors&&a.errors.length>0){var c=B(a);p(c,{type:"error",name:"clipboard-error"});delete c.success;G(function(){g.emit(c)},0)}},C=function(a){if(a&&typeof a.type==="string"&&a){var c,b=a.target||null;c=b&&b.ownerDocument||q;a=p({view:c.defaultView||k,canBubble:true,cancelable:true,detail:a.type==="click"?1:0,button:typeof a.which==="number"?a.which-1:typeof a.button==="number"?
a.button:c.createEvent?0:1},a);if(b)if(c.createEvent&&b.dispatchEvent){a=[a.type,a.canBubble,a.cancelable,a.view,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget];c=c.createEvent("MouseEvents");if(c.initMouseEvent){c.initMouseEvent.apply(c,a);c._source="js";b.dispatchEvent(c)}}}},Na=function(){var a=l.flashLoadTimeout;if(typeof a==="number"&&a>=0){var c=l.swfObjectId+"_fallbackContent";N=ia(function(){var b;var d=q.getElementById(c);
if(d){b=U(d,null);var e=D(b.height)>0,f=D(b.width)>0,h=D(b.top)>=0,i=D(b.left)>=0,m=e&&f&&h&&i;d=m?null:Q(d);b=b.display!=="none"&&b.visibility!=="collapse"&&(m||!!d&&(e||d.height>0)&&(f||d.width>0)&&(h||d.top>=0)&&(i||d.left>=0))}else b=false;if(b){H();j.deactivated=null;g.emit({type:"error",name:"swf-not-found"})}},Math.min(1E3,a/10))}},F=function(a){for(a=a&&a.parentNode;a&&a.nodeName==="OBJECT"&&a.parentNode;)a=a.parentNode;return a||null},Da=function(){var a,c=j.bridge,b=F(c);if(!c){c=Oa(k.location.host,
l);var d=c==="never"?"none":"all",e;b=p({jsVersion:g.version},l);var f,h,i,m="",o=[];if(b.trustedDomains)if(typeof b.trustedDomains==="string")e=[b.trustedDomains];else if(typeof b.trustedDomains==="object"&&"length"in b.trustedDomains)e=b.trustedDomains;if(e&&e.length){f=0;for(h=e.length;f<h;f++)if(t.call(e,f)&&e[f]&&typeof e[f]==="string")if(i=S(e[f])){if(i==="*"){o.length=0;o.push(i);break}o.push.apply(o,[i,"//"+i,k.location.protocol+"//"+i])}}if(o.length)m+="trustedOrigins="+J(o.join(","));if(b.forceEnhancedClipboard===
true)m+=(m?"&":"")+"forceEnhancedClipboard=true";if(typeof b.swfObjectId==="string"&&b.swfObjectId)m+=(m?"&":"")+"swfObjectId="+J(b.swfObjectId);if(typeof b.jsVersion==="string"&&b.jsVersion)m+=(m?"&":"")+"jsVersion="+J(b.jsVersion);e=m;f=l.swfPath+(l==null||l&&l.cacheBust===true?(l.swfPath.indexOf("?")===-1?"?":"&")+"noCache="+W():"");b=q.createElement("div");b.id=l.containerId;b.className=l.containerClass;b.style.position="absolute";b.style.left="0px";b.style.top="-9999px";b.style.width="1px";b.style.height=
"1px";b.style.zIndex=""+R(l.zIndex);b=b;h=q.createElement("div");b.appendChild(h);q.body.appendChild(b);i=q.createElement("div");m=j.pluginType==="activex";i.innerHTML='<object id="'+l.swfObjectId+'" name="'+l.swfObjectId+'" width="100%" height="100%" '+(m?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+f+'"')+">"+(m?'<param name="movie" value="'+f+'"/>':"")+'<param name="allowScriptAccess" value="'+c+'"/><param name="allowNetworking" value="'+
d+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+e+'"/><div id="'+l.swfObjectId+'_fallbackContent">&nbsp;</div></object>';c=i.firstChild;pa(c).ZeroClipboard=g;b.replaceChild(c,h);Na()}if(!c){if((c=q[l.swfObjectId])&&(a=c.length))c=c[a-1];if(!c&&b)c=b.firstChild}j.bridge=c||null;return c},Fa=function(){var a=j.bridge;if(a){var c=F(a);if(c)if(j.pluginType==="activex"&&"readyState"in a){a.style.display="none";(function b(){if(a.readyState===
4){for(var d in a)if(typeof a[d]==="function")a[d]=null;a.parentNode&&a.parentNode.removeChild(a);c.parentNode&&c.parentNode.removeChild(c)}else G(b,10)})()}else{a.parentNode&&a.parentNode.removeChild(a);c.parentNode&&c.parentNode.removeChild(c)}H();j.ready=null;j.bridge=null;j.deactivated=null;y=w}},S=function(a){if(a==null||a==="")return null;a=a.replace(/^\s+|\s+$/g,"");if(a==="")return null;var c=a.indexOf("//");a=c===-1?a:a.slice(c+2);var b=a.indexOf("/");if((a=b===-1?a:c===-1||b===0?null:a.slice(0,
b))&&a.slice(-4).toLowerCase()===".swf")return null;return a||null},Oa=function(){return function(a,c){var b=S(c.swfPath);if(b===null)b=a;var d=c.trustedDomains,e,f,h,i=[];if(typeof d==="string")d=[d];if(typeof d==="object"&&d&&typeof d.length==="number"){e=0;for(f=d.length;e<f;e++)if(t.call(d,e)&&(h=S(d[e]))){if(h==="*"){i.length=0;i.push("*");break}i.indexOf(h)===-1&&i.push(h)}}d=i.length;if(d>0){if(d===1&&i[0]==="*")return"always";if(i.indexOf(a)!==-1){if(d===1&&a===b)return"sameDomain";return"always"}}return"never"}}(),
ba=function(a,c){var b,d,e,f=[];if(typeof c==="string"&&c)f=c.split(/\s+/);if(a&&a.nodeType===1&&f.length>0)if(a.classList){b=0;for(d=f.length;b<d;b++)a.classList.add(f[b])}else if(a.hasOwnProperty("className")){e=" "+a.className+" ";b=0;for(d=f.length;b<d;b++)if(e.indexOf(" "+f[b]+" ")===-1)e+=f[b]+" ";a.className=e.replace(/^\s+|\s+$/g,"")}return a},E=function(a,c){var b,d,e,f=[];if(typeof c==="string"&&c)f=c.split(/\s+/);if(a&&a.nodeType===1&&f.length>0)if(a.classList&&a.classList.length>0){b=
0;for(d=f.length;b<d;b++)a.classList.remove(f[b])}else if(a.className){e=(" "+a.className+" ").replace(/[\r\n\t]/g," ");b=0;for(d=f.length;b<d;b++)e=e.replace(" "+f[b]+" "," ");a.className=e.replace(/^\s+|\s+$/g,"")}return a},ea=function(a,c){var b=U(a,null).getPropertyValue(c);if(c==="cursor")if(!b||b==="auto")if(a.nodeName==="A")return"pointer";return b},Q=function(a){var c={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){a=a.getBoundingClientRect();var b=k.pageXOffset,d=k.pageYOffset,
e=q.documentElement.clientLeft||0,f=q.documentElement.clientTop||0,h=0,i=0;if(ea(q.body,"position")==="relative"){i=q.body.getBoundingClientRect();var m=q.documentElement.getBoundingClientRect();h=i.left-m.left||0;i=i.top-m.top||0}c.left=a.left+b-e-h;c.top=a.top+d-f-i;c.width="width"in a?a.width:a.right-a.left;c.height="height"in a?a.height:a.bottom-a.top}return c},H=function(){ha(M);M=0;ja(N);N=0},R=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var c;if(typeof a==="number"&&!ma(a))c=a;else if(typeof a===
"string")c=R(la(a,10));return typeof c==="number"?c:"auto"},O=function(a){var c,b,d,e=j.sandboxed,f=null;a=a===true;if($===false)f=false;else{try{b=k.frameElement||null}catch(h){d={name:h.name,message:h.message}}if(b&&b.nodeType===1&&b.nodeName==="IFRAME")try{f=b.hasAttribute("sandbox")}catch(i){f=null}else{try{c=document.domain||null}catch(m){c=null}if(c===null||d&&d.name==="SecurityError"&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(d.message.toLowerCase()))f=true}}j.sandboxed=f;e!==
f&&!a&&fa(V);return f},fa=function(a){function c(r){r=r.match(/[\d]+/g);r.length=3;return r.join(".")}function b(r){if(r){e=true;if(r.version)i=c(r.version);if(!i&&r.description)i=c(r.description);if(r.filename){r=r.filename;h=!!r&&(r=r.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(r)||r.slice(-13)==="chrome.plugin")}}}var d,e=false,f=false,h=false,i="";if(x.plugins&&x.plugins.length){a=x.plugins["Shockwave Flash"];b(a);if(x.plugins["Shockwave Flash 2.0"]){e=
true;i="2.0.0.11"}}else if(x.mimeTypes&&x.mimeTypes.length){a=(a=x.mimeTypes["application/x-shockwave-flash"])&&a.enabledPlugin;b(a)}else if(typeof a!=="undefined"){f=true;try{d=new a("ShockwaveFlash.ShockwaveFlash.7");e=true;i=c(d.GetVariable("$version"))}catch(m){try{d=new a("ShockwaveFlash.ShockwaveFlash.6");e=true;i="6.0.21"}catch(o){try{d=new a("ShockwaveFlash.ShockwaveFlash");e=true;i=c(d.GetVariable("$version"))}catch(P){f=false}}}}j.disabled=e!==true;j.outdated=i&&D(i)<D("11.0.0");j.version=
i||"0.0.0";j.pluginType=h?"pepper":f?"activex":e?"netscape":"unknown"};fa(V);O(true);var g=function(){if(!(this instanceof g))return new g;typeof g._createClient==="function"&&g._createClient.apply(this,n(arguments))};na(g,"version",{value:"2.2.0",writable:false,configurable:true,enumerable:true});g.config=function(){return va.apply(this,n(arguments))};g.state=function(){return wa.apply(this,n(arguments))};g.isFlashUnusable=function(){return xa.apply(this,n(arguments))};g.on=function(){return ya.apply(this,
n(arguments))};g.off=function(){return za.apply(this,n(arguments))};g.handlers=function(){return Aa.apply(this,n(arguments))};g.emit=function(){return Ca.apply(this,n(arguments))};g.create=function(){return Ea.apply(this,n(arguments))};g.destroy=function(){return Ga.apply(this,n(arguments))};g.setData=function(){return Ha.apply(this,n(arguments))};g.clearData=function(){return Ia.apply(this,n(arguments))};g.getData=function(){return Ja.apply(this,n(arguments))};g.focus=g.activate=function(){return Ka.apply(this,
n(arguments))};g.blur=g.deactivate=function(){return La.apply(this,n(arguments))};g.activeElement=function(){return Ma.apply(this,n(arguments))};var Pa=0,u={},Qa=0,I={},T={};p(l,{autoActivate:true});var Ra=function(a){var c=this;c.id=""+Pa++;u[c.id]={instance:c,elements:[],handlers:{}};a&&c.clip(a);g.on("*",function(b){return c.emit(b)});g.on("destroy",function(){c.destroy()});g.create()},Sa=function(a,c){var b,d,e,f={},h=(d=u[this.id])&&d.handlers;if(!d)throw Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");
if(typeof a==="string"&&a)e=a.toLowerCase().split(/\s+/);else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&this.on(b,a[b]);if(e&&e.length){b=0;for(d=e.length;b<d;b++){a=e[b].replace(/^on/,"");f[a]=true;h[a]||(h[a]=[]);h[a].push(c)}f.ready&&j.ready&&this.emit({type:"ready",client:this});if(f.error){b=0;for(d=A.length;b<d;b++)if(j[A[b].replace(/^flash-/,"")]){this.emit({type:"error",name:A[b],client:this});break}y!==w&&g.version!==
y&&this.emit({type:"error",name:"version-mismatch",jsVersion:g.version,swfVersion:y})}}return this},Ta=function(a,c){var b,d,e,f,h,i=(d=u[this.id])&&d.handlers;if(!i)return this;if(arguments.length===0)f=X(i);else if(typeof a==="string"&&a)f=a.split(/\s+/);else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&this.off(b,a[b]);if(f&&f.length){b=0;for(d=f.length;b<d;b++){a=f[b].toLowerCase().replace(/^on/,"");if((h=i[a])&&h.length)if(c)for(e=
h.indexOf(c);e!==-1;){h.splice(e,1);e=h.indexOf(c,e)}else h.length=0}}return this},Ua=function(a){var c=null,b=u[this.id]&&u[this.id].handlers;if(b)c=typeof a==="string"&&a?b[a]?b[a].slice(0):[]:B(b);return c},Wa=function(a){if(Va.call(this,a)){if(typeof a==="object"&&a&&typeof a.type==="string"&&a.type)a=p({},a);a=p({},aa(a),{client:this});var c=u[this.id];if(typeof a==="object"&&a&&a.type&&c){var b=ca(a);if((c=(c&&c.handlers["*"]||[]).concat(c&&c.handlers[a.type]||[]))&&c.length){var d,e,f,h,i;
d=0;for(e=c.length;d<e;d++){f=c[d];h=this;if(typeof f==="string"&&typeof k[f]==="function")f=k[f];if(typeof f==="object"&&f&&typeof f.handleEvent==="function"){h=f;f=f.handleEvent}if(typeof f==="function"){i=p({},a);da(f,h,[i],b)}}}}}return this},Ya=function(a){if(!u[this.id])throw Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");a=ga(a);for(var c=0;c<a.length;c++)if(t.call(a,c)&&a[c]&&a[c].nodeType===1){if(a[c].zcClippingId)I[a[c].zcClippingId].indexOf(this.id)===
-1&&I[a[c].zcClippingId].push(this.id);else{a[c].zcClippingId="zcClippingId_"+Qa++;I[a[c].zcClippingId]=[this.id];l.autoActivate===true&&Xa(a[c])}var b=u[this.id]&&u[this.id].elements;b.indexOf(a[c])===-1&&b.push(a[c])}return this},Za=function(a){var c=u[this.id];if(!c)return this;c=c.elements;var b;a=typeof a==="undefined"?c.slice(0):ga(a);for(var d=a.length;d--;)if(t.call(a,d)&&a[d]&&a[d].nodeType===1){for(b=0;(b=c.indexOf(a[d],b))!==-1;)c.splice(b,1);var e=I[a[d].zcClippingId];if(e){for(b=0;(b=
e.indexOf(this.id,b))!==-1;)e.splice(b,1);if(e.length===0){if(l.autoActivate===true)if((b=a[d])&&b.nodeType===1){e=T[b.zcClippingId];if(typeof e==="object"&&e){for(var f=void 0,h=void 0,i=["move","leave","enter","out","over"],m=0,o=i.length;m<o;m++){f="mouse"+i[m];h=e[f];typeof h==="function"&&b.removeEventListener(f,h,false)}delete T[b.zcClippingId]}}delete a[d].zcClippingId}}}return this},$a=function(){var a=u[this.id];return a&&a.elements?a.elements.slice(0):[]},ab=function(){if(u[this.id]){this.unclip();
this.off();delete u[this.id]}},Va=function(a){if(!(a&&a.type))return false;if(a.client&&a.client!==this)return false;var c=u[this.id],b=c&&c.elements,d=!!b&&b.length>0,e=!a.target||d&&b.indexOf(a.target)!==-1;b=a.relatedTarget&&d&&b.indexOf(a.relatedTarget)!==-1;a=a.client&&a.client===this;if(!c||!(e||b||a))return false;return true},ga=function(a){if(typeof a==="string")a=[];return typeof a.length!=="number"?[a]:a},Xa=function(a){if(a&&a.nodeType===1){var c=function(d){if(d||(d=k.event)){if(d._source!==
"js"){d.stopImmediatePropagation();d.preventDefault()}delete d._source}},b=function(d){if(d||(d=k.event)){c(d);g.focus(a)}};a.addEventListener("mouseover",b,false);a.addEventListener("mouseout",c,false);a.addEventListener("mouseenter",c,false);a.addEventListener("mouseleave",c,false);a.addEventListener("mousemove",c,false);T[a.zcClippingId]={mouseover:b,mouseout:c,mouseenter:c,mouseleave:c,mousemove:c}}};g._createClient=function(){Ra.apply(this,n(arguments))};g.prototype.on=function(){return Sa.apply(this,
n(arguments))};g.prototype.off=function(){return Ta.apply(this,n(arguments))};g.prototype.handlers=function(){return Ua.apply(this,n(arguments))};g.prototype.emit=function(){return Wa.apply(this,n(arguments))};g.prototype.clip=function(){return Ya.apply(this,n(arguments))};g.prototype.unclip=function(){return Za.apply(this,n(arguments))};g.prototype.elements=function(){return $a.apply(this,n(arguments))};g.prototype.destroy=function(){return ab.apply(this,n(arguments))};g.prototype.setText=function(a){if(!u[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
g.setData("text/plain",a);return this};g.prototype.setHtml=function(a){if(!u[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");g.setData("text/html",a);return this};g.prototype.setRichText=function(a){if(!u[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");g.setData("application/rtf",a);return this};g.prototype.setData=function(){if(!u[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
g.setData.apply(this,n(arguments));return this};g.prototype.clearData=function(){if(!u[this.id])throw Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");g.clearData.apply(this,n(arguments));return this};g.prototype.getData=function(){if(!u[this.id])throw Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return g.getData.apply(this,n(arguments))};if(typeof define==="function"&&define.amd)define(function(){return g});
else if(typeof module==="object"&&module&&typeof module.exports==="object"&&module.exports)module.exports=g;else k.ZeroClipboard=g})(function(){return this||window}());

(function(l,z){var o=l.document,x=l.navigator,I=l.setTimeout,ca=l.clearTimeout,da=l.setInterval,ea=l.clearInterval,U=l.getComputedStyle,L=l.encodeURIComponent,V=l.ActiveXObject,fa=l.Error,ga=l.Number.parseInt||l.parseInt,D=l.Number.parseFloat||l.parseFloat,ha=l.Number.isNaN||l.isNaN,W=l.Date.now,ia=l.Object.keys,ja=l.Object.defineProperty,t=l.Object.prototype.hasOwnProperty,ka=l.Array.prototype.slice,la=function(){var a=function(f){return f};if(typeof l.wrap==="function"&&typeof l.unwrap==="function")try{var c=
o.createElement("div"),b=l.unwrap(c);if(c.nodeType===1&&b&&b.nodeType===1)a=l.unwrap}catch(d){}return a}(),u=function(a){return ka.call(a,0)},p=function(){var a,c,b,d,f,g=u(arguments),e=g[0]||{};a=1;for(c=g.length;a<c;a++)if((b=g[a])!=null)for(d in b)if(t.call(b,d)){f=b[d];if(e!==f&&f!==z)e[d]=f}return e},B=function(a){var c,b,d;if(typeof a!=="object"||a==null||typeof a.nodeType==="number")c=a;else if(typeof a.length==="number"){c=[];b=0;for(d=a.length;b<d;b++)if(t.call(a,b))c[b]=B(a[b])}else{c={};
for(b in a)if(t.call(a,b))c[b]=B(a[b])}return c},X=function(a,c){if(a&&a.nodeType===1&&a.ownerDocument&&c&&(c.nodeType===1&&c.ownerDocument&&c.ownerDocument===a.ownerDocument||c.nodeType===9&&!c.ownerDocument&&c===a.ownerDocument)){do{if(a===c)return true;a=a.parentNode}while(a)}return false},Y=function(a){var c;if(typeof a==="string"&&a){a.split("#")[0].split("?");c=a.slice(0,a.lastIndexOf("/")+1)}return c},ma=function(){var a,c,b,d=o.getElementsByTagName("script");for(a=d.length;a--;){if(!(b=d[a].src)){c=
null;break}b=Y(b);if(c==null)c=b;else if(c!==b){c=null;break}}return c||z},Z=l.opener==null&&(!!l.top&&l!=l.top||!!l.parent&&l!=l.parent),h={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},E,y={},v,M,q={},N=null,O=0,P=0,na={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},
oa=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],F=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],pa=RegExp("^flash-("+F.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),qa=RegExp("^flash-("+F.slice(1).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),m={swfPath:(Y(function(){var a,c,b;if(o.currentScript&&(a=o.currentScript.src))return a;
c=o.getElementsByTagName("script");if(c.length===1)return c[0].src||z;if("readyState"in c[0])for(b=c.length;b--;)if(c[b].readyState==="interactive"&&(a=c[b].src))return a;if(o.readyState==="loading"&&(a=c[c.length-1].src))return a;var d;try{throw new fa;}catch(f){a=f}if(a){if(!(d=a.sourceURL)){if(!(d=a.fileName)){d=a.stack;var g;if(typeof d==="string"&&d)if((a=d.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&
a[1])g=a[1];else if((a=d.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&a[1])g=a[1];d=g}d=d}d=d}if(a=d)return a;return z}())||ma()||"")+"ZeroClipboard.swf",trustedDomains:l.location.host?[l.location.host]:[],cacheBust:true,forceEnhancedClipboard:false,flashLoadTimeout:3E4,autoActivate:true,bubbleEvents:true,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",
activeClass:"zeroclipboard-is-active",forceHandCursor:false,title:null,zIndex:999999999},ra=function(a){if(typeof a==="object"&&a!==null)for(var c in a)if(t.call(a,c))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(c))m[c]=a[c];else if(h.bridge==null)if(c==="containerId"||c==="swfObjectId")if(typeof a[c]==="string"&&a[c]&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a[c]))m[c]=a[c];else throw Error("The specified `"+c+"` value is not valid as an HTML4 Element ID");else m[c]=a[c];if(typeof a==="string"&&
a){if(t.call(m,a))return m[a]}else return B(m)},sa=function(){Q();for(var a=["userAgent","platform","appName"],c={},b=0,d=a.length;b<d;b++)if(a[b]in x)c[a[b]]=x[a[b]];a=["bridge"];b={};for(var f in h)if(a.indexOf(f)===-1)b[f]=h[f];return{browser:c,flash:b,zeroclipboard:{version:i.version,config:i.config()}}},ta=function(){return!!(h.disabled||h.outdated||h.sandboxed||h.unavailable||h.degraded||h.deactivated)},ua=function(a,c){var b,d,f,g={};if(typeof a==="string"&&a)f=a.toLowerCase().split(/\s+/);
else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&i.on(b,a[b]);if(f&&f.length){b=0;for(d=f.length;b<d;b++){a=f[b].replace(/^on/,"");g[a]=true;y[a]||(y[a]=[]);y[a].push(c)}g.ready&&h.ready&&i.emit({type:"ready"});if(g.error){b=0;for(d=F.length;b<d;b++)if(h[F[b].replace(/^flash-/,"")]===true){i.emit({type:"error",name:F[b]});break}E!==z&&i.version!==E&&i.emit({type:"error",name:"version-mismatch",jsVersion:i.version,swfVersion:E})}}return i},
va=function(a,c){var b,d,f,g,e;if(arguments.length===0)g=ia(y);else if(typeof a==="string"&&a)g=a.split(/\s+/);else if(typeof a==="object"&&a&&typeof c==="undefined")for(b in a)t.call(a,b)&&typeof b==="string"&&b&&typeof a[b]==="function"&&i.off(b,a[b]);if(g&&g.length){b=0;for(d=g.length;b<d;b++){a=g[b].toLowerCase().replace(/^on/,"");if((e=y[a])&&e.length)if(c)for(f=e.indexOf(c);f!==-1;){e.splice(f,1);f=e.indexOf(c,f)}else e.length=0}}return i},wa=function(a){return typeof a==="string"&&a?B(y[a])||
null:B(y)},Ca=function(a){var c,b,d;a=a;var f;if(typeof a==="string"&&a){f=a;a={}}else if(typeof a==="object"&&a&&typeof a.type==="string"&&a.type)f=a.type;if(f){f=f.toLowerCase();if(!a.target&&(/^(copy|aftercopy|_click)$/.test(f)||f==="error"&&a.name==="clipboard-error"))a.target=M;p(a,{type:f,target:a.target||v||null,relatedTarget:a.relatedTarget||null,currentTarget:h&&h.bridge||null,timeStamp:a.timeStamp||W()||null});f=na[a.type];if(a.type==="error"&&a.name&&f)f=f[a.name];if(f)a.message=f;a.type===
"ready"&&p(a,{target:null,version:h.version});if(a.type==="error"){pa.test(a.name)&&p(a,{target:null,minimumVersion:"11.0.0"});qa.test(a.name)&&p(a,{version:h.version})}if(a.type==="copy")a.clipboardData={setData:i.setData,clearData:i.clearData};if(a.type==="aftercopy"){a=a;f=N;if(typeof a==="object"&&a&&typeof f==="object"&&f){var g={};for(var e in a)if(t.call(a,e))if(e==="errors"){g[e]=a[e]?a[e].slice():[];for(var j=0,n=g[e].length;j<n;j++)g[e][j].format=f[g[e][j].format]}else if(e!=="success"&&
e!=="data")g[e]=a[e];else{g[e]={};j=a[e];for(var k in j)if(k&&t.call(j,k)&&t.call(f,k))g[e][f[k]]=j[k]}a=g}else a=a}if(a.target&&!a.relatedTarget){e=a;k=(k=(k=a.target)&&k.getAttribute&&k.getAttribute("data-clipboard-target"))?o.getElementById(k):null;e.relatedTarget=k}if((a=a)&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)){e=a.target;k=a.type==="_mouseover"&&a.relatedTarget?a.relatedTarget:z;f=a.type==="_mouseout"&&a.relatedTarget?a.relatedTarget:z;j=R(e);g=j.left+(typeof a._stageX===
"number"?a._stageX:0);j=j.top+(typeof a._stageY==="number"?a._stageY:0);n=g-(o.body.scrollLeft+o.documentElement.scrollLeft);var J=j-(o.body.scrollTop+o.documentElement.scrollTop),s=(l.screenLeft||l.screenX||0)+n,xa=(l.screenTop||l.screenY||0)+J,ya=typeof a.movementX==="number"?a.movementX:0,za=typeof a.movementY==="number"?a.movementY:0;delete a._stageX;delete a._stageY;p(a,{srcElement:e,fromElement:k,toElement:f,screenX:s,screenY:xa,pageX:g,pageY:j,clientX:n,clientY:J,x:n,y:J,movementX:ya,movementY:za,
offsetX:0,offsetY:0,layerX:0,layerY:0})}a=a}else a=void 0;if(a){e=a;k=e.target||v||null;f=e._source==="swf";delete e._source;switch(e.type){case "error":var r;if(!(r=e.name==="flash-sandboxed")){r=null;if(Z===false||e&&e.type==="error"&&e.name&&oa.indexOf(e.name)!==-1)r=false;r=r}r=r;if(typeof r==="boolean")h.sandboxed=r;if(F.indexOf(e.name)!==-1)p(h,{disabled:e.name==="flash-disabled",outdated:e.name==="flash-outdated",unavailable:e.name==="flash-unavailable",degraded:e.name==="flash-degraded",deactivated:e.name===
"flash-deactivated",overdue:e.name==="flash-overdue",ready:false});else if(e.name==="version-mismatch"){E=e.swfVersion;p(h,{disabled:false,outdated:false,unavailable:false,degraded:false,deactivated:false,overdue:false,ready:false})}K();break;case "ready":E=e.swfVersion;r=h.deactivated===true;p(h,{disabled:false,outdated:false,sandboxed:false,unavailable:false,degraded:false,deactivated:false,overdue:r,ready:!r});K();break;case "beforecopy":M=k;break;case "copy":var C,w=e.relatedTarget;if(!(q["text/html"]||
q["text/plain"])&&w&&(C=w.value||w.outerHTML||w.innerHTML)&&(r=w.value||w.textContent||w.innerText)){e.clipboardData.clearData();e.clipboardData.setData("text/plain",r);C!==r&&e.clipboardData.setData("text/html",C)}else if(!q["text/plain"]&&e.target&&(r=e.target.getAttribute("data-clipboard-text"))){e.clipboardData.clearData();e.clipboardData.setData("text/plain",r)}break;case "aftercopy":Aa(e);i.clearData();if(r=k){try{w=o.activeElement}catch(Pa){w=null}r=k!==w&&k.focus}r&&k.focus();break;case "_mouseover":i.focus(k);
if(m.bubbleEvents===true&&f){k&&k!==e.relatedTarget&&!X(e.relatedTarget,k)&&A(p({},e,{type:"mouseenter",bubbles:false,cancelable:false}));A(p({},e,{type:"mouseover"}))}break;case "_mouseout":i.blur();if(m.bubbleEvents===true&&f){k&&k!==e.relatedTarget&&!X(e.relatedTarget,k)&&A(p({},e,{type:"mouseleave",bubbles:false,cancelable:false}));A(p({},e,{type:"mouseout"}))}break;case "_mousedown":$(k,m.activeClass);m.bubbleEvents===true&&f&&A(p({},e,{type:e.type.slice(1)}));break;case "_mouseup":G(k,m.activeClass);
m.bubbleEvents===true&&f&&A(p({},e,{type:e.type.slice(1)}));break;case "_click":M=null;m.bubbleEvents===true&&f&&A(p({},e,{type:e.type.slice(1)}));break;case "_mousemove":m.bubbleEvents===true&&f&&A(p({},e,{type:e.type.slice(1)}));break}if(/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type))c=true;if(!c){if(a.type==="ready"&&h.overdue===true)return i.emit({type:"error",name:"flash-overdue"});c=p({},a);if(typeof c==="object"&&c&&c.type){r=!/^(?:(?:before)?copy|destroy)$/.test(c&&typeof c.type===
"string"&&c.type||"");if((C=(y["*"]||[]).concat(y[c.type]||[]))&&C.length){w=0;for(e=C.length;w<e;w++){k=C[w];f=this;if(typeof k==="string"&&typeof l[k]==="function")k=l[k];if(typeof k==="object"&&k&&typeof k.handleEvent==="function"){f=k;k=k.handleEvent}if(typeof k==="function"){g=p({},c);Ba(k,f,[g],r)}}}}if(a.type==="copy"){b={};c={};if(typeof q==="object"&&q){for(d in q)if(d&&t.call(q,d)&&typeof q[d]==="string"&&q[d])switch(d.toLowerCase()){case "text/plain":case "text":case "air:text":case "flash:text":b.text=
q[d];c.text=d;break;case "text/html":case "html":case "air:html":case "flash:html":b.html=q[d];c.html=d;break;case "application/rtf":case "text/rtf":case "rtf":case "richtext":case "air:rtf":case "flash:rtf":b.rtf=q[d];c.rtf=d;break;default:break}d={data:b,formatMap:c}}else d=void 0;b=d.data;N=d.formatMap}return b}}},Ea=function(){var a=h.sandboxed;Q();if(typeof h.ready!=="boolean")h.ready=false;if(h.sandboxed!==a&&h.sandboxed===true){h.ready=false;i.emit({type:"error",name:"flash-sandboxed"})}else if(!i.isFlashUnusable()&&
h.bridge===null){a=m.flashLoadTimeout;if(typeof a==="number"&&a>=0)O=I(function(){if(typeof h.deactivated!=="boolean")h.deactivated=true;h.deactivated===true&&i.emit({type:"error",name:"flash-deactivated"})},a);h.overdue=false;Da()}},Ga=function(){i.clearData();i.blur();i.emit("destroy");Fa();i.off()},Ha=function(a,c){var b;if(typeof a==="object"&&a&&typeof c==="undefined"){b=a;i.clearData()}else if(typeof a==="string"&&a){b={};b[a]=c}else return;for(var d in b)if(typeof d==="string"&&d&&t.call(b,
d)&&typeof b[d]==="string"&&b[d])q[d]=b[d]},Ia=function(a){if(typeof a==="undefined"){if(q)for(var c in q)t.call(q,c)&&delete q[c];N=null}else typeof a==="string"&&t.call(q,a)&&delete q[a]},Ja=function(a){if(typeof a==="undefined")return B(q);else if(typeof a==="string"&&t.call(q,a))return q[a]},Ka=function(a){if(a&&a.nodeType===1){if(v){G(v,m.activeClass);v!==a&&G(v,m.hoverClass)}v=a;$(a,m.hoverClass);var c=a.getAttribute("title")||m.title;if(typeof c==="string"&&c){var b=H(h.bridge);b&&b.setAttribute("title",
c)}a=m.forceHandCursor===true||aa(a,"cursor")==="pointer";if(h.ready===true)if(h.bridge&&typeof h.bridge.setHandCursor==="function")h.bridge.setHandCursor(a);else h.ready=false;var d;if(v&&(d=H(h.bridge))){a=R(v);p(d.style,{width:a.width+"px",height:a.height+"px",top:a.top+"px",left:a.left+"px",zIndex:""+S(m.zIndex)})}}},La=function(){var a=H(h.bridge);if(a){a.removeAttribute("title");a.style.left="0px";a.style.top="-9999px";a.style.width="1px";a.style.height="1px"}if(v){G(v,m.hoverClass);G(v,m.activeClass);
v=null}},Ma=function(){return v||null},Ba=function(a,c,b,d){d?I(function(){a.apply(c,b)},0):a.apply(c,b)},Aa=function(a){if(a.errors&&a.errors.length>0){var c=B(a);p(c,{type:"error",name:"clipboard-error"});delete c.success;I(function(){i.emit(c)},0)}},A=function(a){if(a&&typeof a.type==="string"&&a){var c,b=a.target||null;c=b&&b.ownerDocument||o;a=p({view:c.defaultView||l,canBubble:true,cancelable:true,detail:a.type==="click"?1:0,button:typeof a.which==="number"?a.which-1:typeof a.button==="number"?
a.button:c.createEvent?0:1},a);if(b)if(c.createEvent&&b.dispatchEvent){a=[a.type,a.canBubble,a.cancelable,a.view,a.detail,a.screenX,a.screenY,a.clientX,a.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.button,a.relatedTarget];c=c.createEvent("MouseEvents");if(c.initMouseEvent){c.initMouseEvent.apply(c,a);c._source="js";b.dispatchEvent(c)}}}},Na=function(){var a=m.flashLoadTimeout;if(typeof a==="number"&&a>=0){var c=m.swfObjectId+"_fallbackContent";P=da(function(){var b;var d=o.getElementById(c);
if(d){b=U(d,null);var f=D(b.height)>0,g=D(b.width)>0,e=D(b.top)>=0,j=D(b.left)>=0,n=f&&g&&e&&j;d=n?null:R(d);b=b.display!=="none"&&b.visibility!=="collapse"&&(n||!!d&&(f||d.height>0)&&(g||d.width>0)&&(e||d.top>=0)&&(j||d.left>=0))}else b=false;if(b){K();h.deactivated=null;i.emit({type:"error",name:"swf-not-found"})}},Math.min(1E3,a/10))}},H=function(a){for(a=a&&a.parentNode;a&&a.nodeName==="OBJECT"&&a.parentNode;)a=a.parentNode;return a||null},Da=function(){var a,c=h.bridge,b=H(c);if(!c){c=Oa(l.location.host,
m);var d=c==="never"?"none":"all",f;b=p({jsVersion:i.version},m);var g,e,j,n="",k=[];if(b.trustedDomains)if(typeof b.trustedDomains==="string")f=[b.trustedDomains];else if(typeof b.trustedDomains==="object"&&"length"in b.trustedDomains)f=b.trustedDomains;if(f&&f.length){g=0;for(e=f.length;g<e;g++)if(t.call(f,g)&&f[g]&&typeof f[g]==="string")if(j=T(f[g])){if(j==="*"){k.length=0;k.push(j);break}k.push.apply(k,[j,"//"+j,l.location.protocol+"//"+j])}}if(k.length)n+="trustedOrigins="+L(k.join(","));if(b.forceEnhancedClipboard===
true)n+=(n?"&":"")+"forceEnhancedClipboard=true";if(typeof b.swfObjectId==="string"&&b.swfObjectId)n+=(n?"&":"")+"swfObjectId="+L(b.swfObjectId);if(typeof b.jsVersion==="string"&&b.jsVersion)n+=(n?"&":"")+"jsVersion="+L(b.jsVersion);f=n;g=m.swfPath+(m==null||m&&m.cacheBust===true?(m.swfPath.indexOf("?")===-1?"?":"&")+"noCache="+W():"");b=o.createElement("div");b.id=m.containerId;b.className=m.containerClass;b.style.position="absolute";b.style.left="0px";b.style.top="-9999px";b.style.width="1px";b.style.height=
"1px";b.style.zIndex=""+S(m.zIndex);b=b;e=o.createElement("div");b.appendChild(e);o.body.appendChild(b);j=o.createElement("div");n=h.pluginType==="activex";j.innerHTML='<object id="'+m.swfObjectId+'" name="'+m.swfObjectId+'" width="100%" height="100%" '+(n?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+g+'"')+">"+(n?'<param name="movie" value="'+g+'"/>':"")+'<param name="allowScriptAccess" value="'+c+'"/><param name="allowNetworking" value="'+
d+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+f+'"/><div id="'+m.swfObjectId+'_fallbackContent">&nbsp;</div></object>';c=j.firstChild;la(c).ZeroClipboard=i;b.replaceChild(c,e);Na()}if(!c){if((c=o[m.swfObjectId])&&(a=c.length))c=c[a-1];if(!c&&b)c=b.firstChild}h.bridge=c||null;return c},Fa=function(){var a=h.bridge;if(a){var c=H(a);if(c)if(h.pluginType==="activex"&&"readyState"in a){a.style.display="none";(function b(){if(a.readyState===
4){for(var d in a)if(typeof a[d]==="function")a[d]=null;a.parentNode&&a.parentNode.removeChild(a);c.parentNode&&c.parentNode.removeChild(c)}else I(b,10)})()}else{a.parentNode&&a.parentNode.removeChild(a);c.parentNode&&c.parentNode.removeChild(c)}K();h.ready=null;h.bridge=null;h.deactivated=null;E=z}},T=function(a){if(a==null||a==="")return null;a=a.replace(/^\s+|\s+$/g,"");if(a==="")return null;var c=a.indexOf("//");a=c===-1?a:a.slice(c+2);var b=a.indexOf("/");if((a=b===-1?a:c===-1||b===0?null:a.slice(0,
b))&&a.slice(-4).toLowerCase()===".swf")return null;return a||null},Oa=function(){return function(a,c){var b=T(c.swfPath);if(b===null)b=a;var d=c.trustedDomains,f,g,e,j=[];if(typeof d==="string")d=[d];if(typeof d==="object"&&d&&typeof d.length==="number"){f=0;for(g=d.length;f<g;f++)if(t.call(d,f)&&(e=T(d[f]))){if(e==="*"){j.length=0;j.push("*");break}j.indexOf(e)===-1&&j.push(e)}}d=j.length;if(d>0){if(d===1&&j[0]==="*")return"always";if(j.indexOf(a)!==-1){if(d===1&&a===b)return"sameDomain";return"always"}}return"never"}}(),
$=function(a,c){var b,d,f,g=[];if(typeof c==="string"&&c)g=c.split(/\s+/);if(a&&a.nodeType===1&&g.length>0)if(a.classList){b=0;for(d=g.length;b<d;b++)a.classList.add(g[b])}else if(a.hasOwnProperty("className")){f=" "+a.className+" ";b=0;for(d=g.length;b<d;b++)if(f.indexOf(" "+g[b]+" ")===-1)f+=g[b]+" ";a.className=f.replace(/^\s+|\s+$/g,"")}return a},G=function(a,c){var b,d,f,g=[];if(typeof c==="string"&&c)g=c.split(/\s+/);if(a&&a.nodeType===1&&g.length>0)if(a.classList&&a.classList.length>0){b=0;
for(d=g.length;b<d;b++)a.classList.remove(g[b])}else if(a.className){f=(" "+a.className+" ").replace(/[\r\n\t]/g," ");b=0;for(d=g.length;b<d;b++)f=f.replace(" "+g[b]+" "," ");a.className=f.replace(/^\s+|\s+$/g,"")}return a},aa=function(a,c){var b=U(a,null).getPropertyValue(c);if(c==="cursor")if(!b||b==="auto")if(a.nodeName==="A")return"pointer";return b},R=function(a){var c={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){a=a.getBoundingClientRect();var b=l.pageXOffset,d=l.pageYOffset,
f=o.documentElement.clientLeft||0,g=o.documentElement.clientTop||0,e=0,j=0;if(aa(o.body,"position")==="relative"){j=o.body.getBoundingClientRect();var n=o.documentElement.getBoundingClientRect();e=j.left-n.left||0;j=j.top-n.top||0}c.left=a.left+b-f-e;c.top=a.top+d-g-j;c.width="width"in a?a.width:a.right-a.left;c.height="height"in a?a.height:a.bottom-a.top}return c},K=function(){ca(O);O=0;ea(P);P=0},S=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var c;if(typeof a==="number"&&!ha(a))c=a;else if(typeof a===
"string")c=S(ga(a,10));return typeof c==="number"?c:"auto"},Q=function(a){var c,b,d,f=h.sandboxed,g=null;a=a===true;if(Z===false)g=false;else{try{b=l.frameElement||null}catch(e){d={name:e.name,message:e.message}}if(b&&b.nodeType===1&&b.nodeName==="IFRAME")try{g=b.hasAttribute("sandbox")}catch(j){g=null}else{try{c=document.domain||null}catch(n){c=null}if(c===null||d&&d.name==="SecurityError"&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(d.message.toLowerCase()))g=true}}h.sandboxed=g;f!==
g&&!a&&ba(V);return g},ba=function(a){function c(s){s=s.match(/[\d]+/g);s.length=3;return s.join(".")}function b(s){if(s){f=true;if(s.version)j=c(s.version);if(!j&&s.description)j=c(s.description);if(s.filename){s=s.filename;e=!!s&&(s=s.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(s)||s.slice(-13)==="chrome.plugin")}}}var d,f=false,g=false,e=false,j="";if(x.plugins&&x.plugins.length){a=x.plugins["Shockwave Flash"];b(a);if(x.plugins["Shockwave Flash 2.0"]){f=

var da = /^([0-9]+)(?:[\._-]([0-9]+))?(?:[\._-]([0-9]+))?(?:[\._+-]?(.*))?$/;
y.prototype.compare = function (a) {
return this.c > a.c || this.c === a.c && this.g > a.g || this.c === a.c && this.g === a.g && this.D > a.D ? 1 : this.c < a.c || this.c === a.c && this.g < a.g || this.c === a.c && this.g === a.g && this.D < a.D ? -1 : 0
};
y.prototype.toString = function () {
return [this.c, this.g || "", this.D || "", this.e || ""].join("")
};
function z(a) {
a = da.exec(a);
var b = null, c = null, d = null, e = null;
a && (null !== a[1] && a[1] && (b = parseInt(a[1], 10)), null !== a[2] && a[2] && (c = parseInt(a[2], 10)), null !== a[3] && a[3] && (d = parseInt(a[3], 10)), null !== a[4] && a[4] && (e = /^[0-9]+$/.test(a[4]) ? parseInt(a[4], 10) : a[4]));
return new y(b, c, d, e)
};
function A(a, b, c, d, e, f, g, h) {
this.N = a;
this.m = h
}
A.prototype.getName = function () {
return this.N
};
function B(a) {
this.a = a
}
var ea = new A("Unknown", 0, 0, 0, 0, 0, 0, new x(!1, !1));
B.prototype.parse = function () {
var a;
if (-1 != this.a.indexOf("MSIE") || -1 != this.a.indexOf("Trident/")) {
a = C(this);
var b = z(D(this)), c = null, d = E(this.a, /Trident\/([\d\w\.]+)/, 1), c = -1 != this.a.indexOf("MSIE") ? z(E(this.a, /MSIE ([\d\w\.]+)/, 1)) : z(E(this.a, /rv:([\d\w\.]+)/, 1));
"" != d && z(d);
a = new A("MSIE", 0, 0, 0, 0, 0, 0, new x("Windows" == a && 6 <= c.c || "Windows Phone" == a && 8 <= b.c, !1))
} else if (-1 != this.a.indexOf("Opera")) a:if (a = z(E(this.a, /Presto\/([\d\w\.]+)/, 1)), z(D(this)), null !== a.c || z(E(this.a, /rv:([^\)]+)/, 1)), -1 != this.a.indexOf("Opera Mini/")) a =
z(E(this.a, /Opera Mini\/([\d\.]+)/, 1)), a = new A("OperaMini", 0, 0, 0, C(this), 0, 0, new x(!1, !1)); else {
if (-1 != this.a.indexOf("Version/") && (a = z(E(this.a, /Version\/([\d\.]+)/, 1)), null !== a.c)) {
a = new A("Opera", 0, 0, 0, C(this), 0, 0, new x(10 <= a.c, !1));
break a
}
a = z(E(this.a, /Opera[\/ ]([\d\.]+)/, 1));
a = null !== a.c ? new A("Opera", 0, 0, 0, C(this), 0, 0, new x(10 <= a.c, !1)) : new A("Opera", 0, 0, 0, C(this), 0, 0, new x(!1, !1))
} else /OPR\/[\d.]+/.test(this.a) ? a = F(this) : /AppleWeb(K|k)it/.test(this.a) ? a = F(this) : -1 != this.a.indexOf("Gecko") ?
(a = "Unknown", b = new y, z(D(this)), b = !1, -1 != this.a.indexOf("Firefox") ? (a = "Firefox", b = z(E(this.a, /Firefox\/([\d\w\.]+)/, 1)), b = 3 <= b.c && 5 <= b.g) : -1 != this.a.indexOf("Mozilla") && (a = "Mozilla"), c = z(E(this.a, /rv:([^\)]+)/, 1)), b || (b = 1 < c.c || 1 == c.c && 9 < c.g || 1 == c.c && 9 == c.g && 2 <= c.D), a = new A(a, 0, 0, 0, C(this), 0, 0, new x(b, !1))) : a = ea;
return a
};
function C(a) {
var b = E(a.a, /(iPod|iPad|iPhone|Android|Windows Phone|BB\d{2}|BlackBerry)/, 1);
if ("" != b) return /BB\d{2}/.test(b) && (b = "BlackBerry"), b;
a = E(a.a, /(Linux|Mac_PowerPC|Macintosh|Windows|CrOS|PlayStation|CrKey)/, 1);
return "" != a ? ("Mac_PowerPC" == a ? a = "Macintosh" : "PlayStation" == a && (a = "Linux"), a) : "Unknown"
}
function D(a) {
var b = E(a.a, /(OS X|Windows NT|Android) ([^;)]+)/, 2);
if (b || (b = E(a.a, /Windows Phone( OS)? ([^;)]+)/, 2)) || (b = E(a.a, /(iPhone )?OS ([\d_]+)/, 2))) return b;
if (b = E(a.a, /(?:Linux|CrOS|CrKey) ([^;)]+)/, 1)) for (var b = b.split(/\s/), c = 0; c < b.length; c += 1) if (/^[\d\._]+$/.test(b[c])) return b[c];
return (a = E(a.a, /(BB\d{2}|BlackBerry).*?Version\/([^\s]*)/, 2)) ? a : "Unknown"
}
function F(a) {
var b = C(a), c = z(D(a)), d = z(E(a.a, /AppleWeb(?:K|k)it\/([\d\.\+]+)/, 1)), e = "Unknown", f = new y, f = "Unknown", g = !1;
/OPR\/[\d.]+/.test(a.a) ? e = "Opera" : -1 != a.a.indexOf("Chrome") || -1 != a.a.indexOf("CrMo") || -1 != a.a.indexOf("CriOS") ? e = "Chrome" : /Silk\/\d/.test(a.a) ? e = "Silk" : "BlackBerry" == b || "Android" == b ? e = "BuiltinBrowser" : -1 != a.a.indexOf("PhantomJS") ? e = "PhantomJS" : -1 != a.a.indexOf("Safari") ? e = "Safari" : -1 != a.a.indexOf("AdobeAIR") ? e = "AdobeAIR" : -1 != a.a.indexOf("PlayStation") && (e = "BuiltinBrowser");
"BuiltinBrowser" ==
e ? f = "Unknown" : "Silk" == e ? f = E(a.a, /Silk\/([\d\._]+)/, 1) : "Chrome" == e ? f = E(a.a, /(Chrome|CrMo|CriOS)\/([\d\.]+)/, 2) : -1 != a.a.indexOf("Version/") ? f = E(a.a, /Version\/([\d\.\w]+)/, 1) : "AdobeAIR" == e ? f = E(a.a, /AdobeAIR\/([\d\.]+)/, 1) : "Opera" == e ? f = E(a.a, /OPR\/([\d.]+)/, 1) : "PhantomJS" == e && (f = E(a.a, /PhantomJS\/([\d.]+)/, 1));
f = z(f);
g = "AdobeAIR" == e ? 2 < f.c || 2 == f.c && 5 <= f.g : "BlackBerry" == b ? 10 <= c.c : "Android" == b ? 2 < c.c || 2 == c.c && 1 < c.g : 526 <= d.c || 525 <= d.c && 13 <= d.g;
return new A(e, 0, 0, 0, 0, 0, 0, new x(g, 536 > d.c || 536 == d.c && 11 > d.g))
}
function E(a, b, c) {
return (a = a.match(b)) && a[c] ? a[c] : ""
};
function G(a) {
this.ma = a || "-"
}
G.prototype.e = function (a) {
for (var b = [], c = 0; c < arguments.length; c++) b.push(arguments[c].replace(/[\W_]+/g, "").toLowerCase());
return b.join(this.ma)
};
function H(a, b) {
this.N = a;
this.Z = 4;
this.O = "n";
var c = (b || "n4").match(/^([nio])([1-9])$/i);
c && (this.O = c[1], this.Z = parseInt(c[2], 10))
}
H.prototype.getName = function () {
return this.N
};

#legacySave > dl > dd:last-child,
#legacySave > dl:last-child {
display: block;
}
/* Integrate with Diigo - revision 2
save page list view
----------------------------------*/
/* overide */
/* #saveOnline, #legacySave, #saveLocal {
display:none !important;
} */
#saveOnline,
#legacySave,
#saveOptionList .local {
display: none !important;
}
#save-tip {
overflow: hidden;
margin: 10px;
}
.button.save::before {
display: none;
}
.loginByDiigo li input {
width: 95px !important;
border: none !important;
border-radius: 2px;
}
/*.save #re-edit {
display:none;
}*/
/* share button */
.share a {
float: left;
margin-right: 10px;
color: #f5f5f5;
}
.share a:hover {
text-decoration: underline;
}
.share a span {
float: left;
margin-right: 4px;
padding: 2px 0;
background-image: url(../images/icons-16.png);
background-repeat: no-repeat;
width: 16px;
height: 16px;
}
.share a.gmail span {
background-position: 0 50%;
}
.share a.yahoo span { /*background-position:-16px 50%;*/
background-image: url(../images/yahoo.png);
}
.share a.hotmail span { /* background-position:-32px 50%; */
background-image: url(../images/hotmail.png);
}
.share a.twitter span {
background-position: -48px 50%;
}
.share a.facebook span {
background-position: -64px 50%;
}
.share a.weibo span {
background-image: url(../images/weibo16.png);
}
.share a.buzz span {
background-position: -80px 50%;
}
/* general */
.loader {
padding-left: 22px;
background: url('../images/loader.gif') no-repeat 0 4px;
}
.back {
/* display: inline-block;
margin-top: 12px; */
padding: 3px 5px;
/* background-color: #202020; */
color: #EEE;
text-decoration: none;
border-radius: 5px;
-webkit-transition: all ease-in .2s;
}
.back:hover {
background-color: #101010;
color: #FFF;
}
/* save option head */
#saveOptionHead {
/* line-height: 21px;
margin-bottom: 10px; */
font-weight: bold;
font-size: 13px;
line-height: 16px;
}
#saveOptionHead .back {
display: none;
cursor: pointer;
}
/* #saveOptionHead .back::before {
content: '\00AB';
float:left;
margin-right:4px;
} */
#saveOptionHead.showContent .back {
display: inline;
}
#saveOptionHead.showContent .title {
display: none;
}
/* save option body */
#saveOptionBody {
/* position:relative; */
/* overflow:hidden; */
/* padding:5px 10px 0; */
width: 200%;
border-radius: 5px;
-webkit-transition: margin-left 0.2s ease-out;
}
#saveOptionBody.showContent {
margin-left: -100%;
}
#saveOptionList,
#saveOptionContent {
float: left;
padding-top: 10px;
width: 50%;
border-radius: 5px;


Step 2: 🧐 Snippet Analysis

From looking through the relevant snippets, I decided to make the following modifications:

File Path Proposed Changes
programs/zwift-store-profile.mjs Modify programs/zwift-store-profile.mjs with contents:
• Add a new line after line 13 to define a new environment variable for the data file path. The line should be: const dataFilePath = process.env.ZWIFT_DATA_FILE_PATH;
• Modify line 9 to use the dataFilePath variable instead of the hardcoded path. The line should be: const DATA_FILE_PATH = dataFilePath

Step 3: 📝 Planning

I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:

Make data file path configurable
sweep/make-data-file-path-configurable

Description

This PR addresses the TODO "Make this configurable" in the "programs/zwift-store-profile.mjs" file. Currently, the data file path is hardcoded, but this PR makes it configurable by introducing a new environment variable.

Summary of Changes

  • Added a new line after line 13 to define a new environment variable for the data file path: const dataFilePath = process.env.ZWIFT_DATA_FILE_PATH;
  • Modified line 9 to use the dataFilePath variable instead of the hardcoded path: const DATA_FILE_PATH = dataFilePath || ${os.homedir()}/zwift-data.csv;

These changes allow users to set the data file path by setting the ZWIFT_DATA_FILE_PATH environment variable. If the environment variable is not set, the program falls back to the current hardcoded path.

Please review and merge this PR at your earliest convenience.


Step 4: ⌨️ Coding

File Instructions Progress
programs/zwift-store-profile.mjs Modify programs/zwift-store-profile.mjs with contents:
• Add a new line after line 13 to define a new environment variable for the data file path. The line should be: const dataFilePath = process.env.ZWIFT_DATA_FILE_PATH;
• Modify line 9 to use the dataFilePath variable instead of the hardcoded path. The line should be: const DATA_FILE_PATH = dataFilePath

Step 5: 🔁 Code Review

Here are my self-reviews of my changes at sweep/make-data-file-path-configurable.

Here is the 1st review

No changes required. The changes made in programs/zwift-store-profile.mjs correctly address the issue. The data file path is now configurable through the ZWIFT_DATA_FILE_PATH environment variable. Good job!

I finished incorporating these changes.


To recreate the pull request edit the issue title or description.
Join Our Discord

@sweep-ai sweep-ai bot linked a pull request Aug 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant