!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=154)}([function(e,t,n){var r=n(91);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(10))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return _})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return b})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return l})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return u})),n.d(t,"m",(function(){return m})),n.d(t,"n",(function(){return p}));var r=Object.prototype.toString;function o(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b(e,Error)}}function a(e,t){return r.call(e)===`[object ${t}]`}function i(e){return a(e,"ErrorEvent")}function s(e){return a(e,"DOMError")}function c(e){return a(e,"DOMException")}function u(e){return a(e,"String")}function l(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function d(e){return a(e,"Object")}function h(e){return"undefined"!=typeof Event&&b(e,Event)}function _(e){return"undefined"!=typeof Element&&b(e,Element)}function f(e){return a(e,"RegExp")}function p(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function m(e){return d(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function g(e){return"number"==typeof e&&e!=e}function b(e,t){try{return e instanceof t}catch(e){return!1}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(36),o={};function a(){return Object(r.b)()?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:o}function i(e,t,n){var r=n||a(),o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}}).call(this,n(10))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return i})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return l}));var r=n(84),o=n(3),a=n(23);function i(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{c(o,r)}catch(e){}e[t]=o}}function s(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function c(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,s(e,"__sentry_original__",t)}function u(e){return e.__sentry_original__}function l(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function d(e){if(Object(o.d)(e))return{message:e.message,name:e.name,stack:e.stack,..._(e)};if(Object(o.f)(e)){var t={type:e.type,target:h(e.target),currentTarget:h(e.currentTarget),..._(e)};return"undefined"!=typeof CustomEvent&&Object(o.g)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function h(e){try{return Object(o.c)(e)?Object(r.b)(e):Object.prototype.toString.call(e)}catch(e){return""}}function _(e){if("object"==typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function f(e,t=40){var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Object(a.d)(n[0],t);for(let e=n.length;e>0;e--){var r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:Object(a.d)(r,t)}return""}function p(e){return function e(t,n){if(Object(o.i)(t)){if(void 0!==(i=n.get(t)))return i;var r={};for(var a of(n.set(t,r),Object.keys(t)))void 0!==t[a]&&(r[a]=e(t[a],n));return r}if(Array.isArray(t)){var i;if(void 0!==(i=n.get(t)))return i;r=[];return n.set(t,r),t.forEach(t=>{r.push(e(t,n))}),r}return t}(e,new Map)}},function(e,t,n){var r=n(98),o=n(99);e.exports=function(e,t,n){var a=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[a+s]=i[s];return t||o(i)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(7);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(49),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(r(e),t)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(8),o=n(17),a=n(30);e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r,o; /*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */!function(a){if(void 0===(o="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=o),!0,e.exports=a(),!!0){var i=window.Cookies,s=window.Cookies=a();s.noConflict=function(){return window.Cookies=i,s}}}((function(){function e(){for(var e=0,t={};e{((n,o)=>{if(e.exports)return e.exports=o();void 0===(r=(()=>n.TimeMe=o()).apply(t,[]))||(e.exports=r)})(this,()=>{let e={startStopTimes:{},idleTimeoutMs:3e4,currentIdleTimeMs:0,checkIdleStateRateMs:250,isUserCurrentlyOnPage:!0,isUserCurrentlyIdle:!1,currentPageName:"default-page-name",timeElapsedCallbacks:[],userLeftCallbacks:[],userReturnCallbacks:[],trackTimeOnElement:t=>{let n=document.getElementById(t);n&&(n.addEventListener("mouseover",()=>{e.startTimer(t)}),n.addEventListener("mousemove",()=>{e.startTimer(t)}),n.addEventListener("mouseleave",()=>{e.stopTimer(t)}),n.addEventListener("keypress",()=>{e.startTimer(t)}),n.addEventListener("focus",()=>{e.startTimer(t)}))},getTimeOnElementInSeconds:t=>{let n=e.getTimeOnPageInSeconds(t);return n||0},startTimer:(t,n)=>{if(t||(t=e.currentPageName),void 0===e.startStopTimes[t])e.startStopTimes[t]=[];else{let n=e.startStopTimes[t],r=n[n.length-1];if(void 0!==r&&void 0===r.stopTime)return}e.startStopTimes[t].push({startTime:n||new Date,stopTime:void 0})},stopAllTimers:()=>{let t=Object.keys(e.startStopTimes);for(let n=0;n{t||(t=e.currentPageName);let r=e.startStopTimes[t];void 0!==r&&0!==r.length&&void 0===r[r.length-1].stopTime&&(r[r.length-1].stopTime=n||new Date)},getTimeOnCurrentPageInSeconds:()=>e.getTimeOnPageInSeconds(e.currentPageName),getTimeOnPageInSeconds:t=>{let n=e.getTimeOnPageInMilliseconds(t);return void 0===n?void 0:n/1e3},getTimeOnCurrentPageInMilliseconds:()=>e.getTimeOnPageInMilliseconds(e.currentPageName),getTimeOnPageInMilliseconds:t=>{let n=0,r=e.startStopTimes[t];if(void 0===r)return;let o=0;for(let e=0;e{let t=[],n=Object.keys(e.startStopTimes);for(let r=0;r{let n=parseFloat(t);if(!1!==isNaN(n))throw{name:"InvalidDurationException",message:"An invalid duration time ("+t+") was provided."};e.idleTimeoutMs=1e3*t},setCurrentPageName:t=>{e.currentPageName=t},resetRecordedPageTime:t=>{delete e.startStopTimes[t]},resetAllRecordedPageTimes:()=>{let t=Object.keys(e.startStopTimes);for(let n=0;n{e.isUserCurrentlyIdle&&e.triggerUserHasReturned(),e.resetIdleCountdown()},resetIdleCountdown:()=>{e.isUserCurrentlyIdle=!1,e.currentIdleTimeMs=0},callWhenUserLeaves:(t,n)=>{e.userLeftCallbacks.push({callback:t,numberOfTimesToInvoke:n})},callWhenUserReturns:(t,n)=>{e.userReturnCallbacks.push({callback:t,numberOfTimesToInvoke:n})},triggerUserHasReturned:()=>{if(!e.isUserCurrentlyOnPage){e.isUserCurrentlyOnPage=!0,e.resetIdleCountdown();for(let t=0;t0)&&(n.numberOfTimesToInvoke-=1,n.callback())}}e.startTimer()},triggerUserHasLeftPageOrGoneIdle:()=>{if(e.isUserCurrentlyOnPage){e.isUserCurrentlyOnPage=!1;for(let t=0;t0)&&(n.numberOfTimesToInvoke-=1,n.callback())}}e.stopAllTimers()},callAfterTimeElapsedInSeconds:(t,n)=>{e.timeElapsedCallbacks.push({timeInSeconds:t,callback:n,pending:!0})},checkIdleState:()=>{for(let t=0;te.timeElapsedCallbacks[t].timeInSeconds&&(e.timeElapsedCallbacks[t].callback(),e.timeElapsedCallbacks[t].pending=!1);!1===e.isUserCurrentlyIdle&&e.currentIdleTimeMs>e.idleTimeoutMs?(e.isUserCurrentlyIdle=!0,e.triggerUserHasLeftPageOrGoneIdle()):e.currentIdleTimeMs+=e.checkIdleStateRateMs},visibilityChangeEventName:void 0,hiddenPropName:void 0,listenForVisibilityEvents:(t,n)=>{t&&e.listenForUserLeavesOrReturnsEvents(),n&&e.listForIdleEvents()},listenForUserLeavesOrReturnsEvents:()=>{void 0!==document.hidden?(e.hiddenPropName="hidden",e.visibilityChangeEventName="visibilitychange"):void 0!==document.mozHidden?(e.hiddenPropName="mozHidden",e.visibilityChangeEventName="mozvisibilitychange"):void 0!==document.msHidden?(e.hiddenPropName="msHidden",e.visibilityChangeEventName="msvisibilitychange"):void 0!==document.webkitHidden&&(e.hiddenPropName="webkitHidden",e.visibilityChangeEventName="webkitvisibilitychange"),document.addEventListener(e.visibilityChangeEventName,()=>{document[e.hiddenPropName]?e.triggerUserHasLeftPageOrGoneIdle():e.triggerUserHasReturned()},!1),window.addEventListener("blur",()=>{e.triggerUserHasLeftPageOrGoneIdle()}),window.addEventListener("focus",()=>{e.triggerUserHasReturned()})},listForIdleEvents:()=>{document.addEventListener("mousemove",()=>{e.userActivityDetected()}),document.addEventListener("keyup",()=>{e.userActivityDetected()}),document.addEventListener("touchstart",()=>{e.userActivityDetected()}),window.addEventListener("scroll",()=>{e.userActivityDetected()}),setInterval(()=>{!0!==e.isUserCurrentlyIdle&&e.checkIdleState()},e.checkIdleStateRateMs)},websocket:void 0,websocketHost:void 0,setUpWebsocket:t=>{if(window.WebSocket&&t){let n=t.websocketHost;try{e.websocket=new WebSocket(n),window.onbeforeunload=()=>{e.sendCurrentTime(t.appId)},e.websocket.onopen=()=>{e.sendInitWsRequest(t.appId)},e.websocket.onerror=e=>{console&&console.log("Error occurred in websocket connection: "+e)},e.websocket.onmessage=e=>{console&&console.log(e.data)}}catch(e){console&&console.error("Failed to connect to websocket host. Error:"+e)}}},websocketSend:t=>{e.websocket.send(JSON.stringify(t))},sendCurrentTime:t=>{let n={type:"INSERT_TIME",appId:t,timeOnPageMs:e.getTimeOnCurrentPageInMilliseconds(),pageName:e.currentPageName};e.websocketSend(n)},sendInitWsRequest:t=>{let n={type:"INIT",appId:t};e.websocketSend(n)},initialize:t=>{let n=e.idleTimeoutMs||30,r=e.currentPageName||"default-page-name",o=void 0,a=void 0,i=!0,s=!0;t&&(n=t.idleTimeoutInSeconds||n,r=t.currentPageName||r,o=t.websocketOptions,a=t.initialStartTime,!1===t.trackWhenUserLeavesPage&&(i=!1),!1===t.trackWhenUserGoesIdle&&(s=!1)),e.setIdleDurationInSeconds(n),e.setCurrentPageName(r),e.setUpWebsocket(o),e.listenForVisibilityEvents(i,s),e.startTimer(void 0,a)}};return e})}).call(this)},function(e,t){e.exports="https://app.butlerfortrello.com/api/"},function(e,t,n){var r=n(100);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(8),o=n(26),a=n(18),i=n(28),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=i(t,!0),a(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(11);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var r=n(48),o=n(32);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(1),o=n(12);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(1),o=n(20),a=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=a},function(e,t,n){var r=n(59),o=n(1),a=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return o}));var r=n(3);function o(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function a(e,t){let n=e;var r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let a=Math.min(o+140,r);return a>r-5&&(a=r),a===r&&(o=Math.max(a-140,0)),n=n.slice(o,a),o>0&&(n="'{snip} "+n),a{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!o&&l(n,e).includes(e.arrayFormatSeparator);n=a?l(n,e):n;const i=o||a?n.split(e.arrayFormatSeparator).map(t=>l(t,e)):null===n?n:l(n,e);r[t]=i};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?l(n,e):n);const a=null===n?[]:n.split(e.arrayFormatSeparator).map(t=>l(t,e));void 0!==r[t]?r[t]=[].concat(r[t],a):r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,i]=a(t.decode?o.replace(/\+/g," "):o,"=");i=void 0===i?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?i:l(i,t),n(l(e,t),i,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=_(n[e],t);else r[e]=_(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(n):e[t]=n,e},Object.create(null))}t.extract=h,t.parse=f,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[u(t,e),"[",o,"]"].join("")]:[...n,[u(t,e),"[",u(o,e),"]=",u(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[u(t,e),"[]"].join("")]:[...n,[u(t,e),"[]=",u(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[u(t,e),":list="].join("")]:[...n,[u(t,e),":list=",u(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[u(n,e),t,u(o,e)].join("")]:[[r,u(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,u(t,e)]:[...n,[u(t,e),"=",u(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const a=Object.keys(o);return!1!==t.sort&&a.sort(t.sort),a.map(n=>{const o=e[n];return void 0===o?"":null===o?u(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?u(n,t)+"[]":o.reduce(r(n),[]).join("&"):u(n,t)+"="+u(o,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=a(e,"#");return Object.assign({url:n.split("?")[0]||"",query:f(h(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:l(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=d(e.url).split("?")[0]||"",o=t.extract(e.url),a=t.parse(o,{sort:!1}),i=Object.assign(a,e.query);let c=t.stringify(i,n);c&&(c="?"+c);let l=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(l="#"+(n[s]?u(e.fragmentIdentifier,n):e.fragmentIdentifier)),`${r}${c}${l}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:a,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:i(a,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},,function(e,t,n){var r=n(8),o=n(7),a=n(27);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(1),o=n(11),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},function(e,t,n){var r=n(11);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(8),o=n(47),a=n(30),i=n(19),s=n(28),c=n(9),u=n(26),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=i(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(c(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(21),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t){e.exports={}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var o=n(85);function a(){return!Object(o.a)()&&"[object process]"===Object.prototype.toString.call(void 0!==e?e:0)}function i(e,t){return e.require(t)}}).call(this,n(77),n(79)(e))},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"FunctionToString",(function(){return s})),n.d(r,"InboundFilters",(function(){return y}));var o={};n.r(o),n.d(o,"GlobalHandlers",(function(){return Ve})),n.d(o,"TryCatch",(function(){return Ze})),n.d(o,"Breadcrumbs",(function(){return it})),n.d(o,"LinkedErrors",(function(){return dt})),n.d(o,"HttpContext",(function(){return _t})),n.d(o,"Dedupe",(function(){return ft}));var a=n(5);let i;class s{constructor(){s.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=s.id}setupOnce(){i=Function.prototype.toString,Function.prototype.toString=function(...e){var t=Object(a.f)(this)||this;return i.apply(t,e)}}}s.__initStatic();var c=n(4),u=Object(c.a)(),l=["debug","info","warn","error","log","assert"];function d(e){var t=Object(c.a)();if(!("console"in t))return e();var n=t.console,r={};l.forEach(e=>{var o=n[e]&&n[e].__sentry_original__;e in t.console&&o&&(r[e]=n[e],n[e]=o)});try{return e()}finally{Object.keys(r).forEach(e=>{n[e]=r[e]})}}function h(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?l.forEach(n=>{t[n]=(...t)=>{e&&d(()=>{u.console[n](`Sentry Logger [${n}]:`,...t)})}}):l.forEach(e=>{t[e]=()=>{}}),t}let _;_="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Object(c.b)("logger",h):h();var f=n(23);function p(){var e=Object(c.a)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=e=>{let t=e.toString(16);for(;t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function m(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function g(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function b(e){const{message:t,event_id:n}=e;if(t)return t;var r=g(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function E(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],a=o[0]=o[0]||{};a.value||(a.value=t||""),a.type||(a.type=n||"Error")}function T(e,t){var n=g(e);if(n){var r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){var o={...r&&r.data,...t.data};n.mechanism.data=o}}}function A(e){if(e&&e.__sentry_captured__)return!0;try{Object(a.a)(e,"__sentry_captured__",!0)}catch(e){}return!1}var v=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class y{static __initStatic(){this.id="InboundFilters"}__init(){this.name=y.id}constructor(e={}){this._options=e,y.prototype.__init.call(this)}setupOnce(e,t){var n=e=>{var n=t();if(n){var r=n.getIntegration(y);if(r){var o=n.getClient(),a=o?o.getOptions():{};return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Event dropped due to being internal Sentry Error.\nEvent: "+b(e)),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[""+n,`${t}: ${n}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Cannot extract message for event "+b(e)),[]}return[]}(e).some(e=>t.some(t=>Object(f.a)(e,t)))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+b(e)),!0;if(function(e,t){if(!t||!t.length)return!1;var n=O(e);return!!n&&t.some(e=>Object(f.a)(n,e))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${b(e)}.\nUrl: ${O(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var n=O(e);return!n||t.some(e=>Object(f.a)(n,e))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${b(e)}.\nUrl: ${O(e)}`),!0;return!1}(e,function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...v],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(r._options,a))?null:e}}return e};n.id=this.name,e(n)}}function O(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let n=e.length-1;n>=0;n--){var t=e[n];if(t&&""!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Cannot extract url for event "+b(e)),null}}y.__initStatic();var I,C=n(86),N=n(36),D=n(3);function w(e){return new R(t=>{t(e)})}function S(e){return new R((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(I||(I={}));class R{__init(){this._state=I.PENDING}__init2(){this._handlers=[]}constructor(e){R.prototype.__init.call(this),R.prototype.__init2.call(this),R.prototype.__init3.call(this),R.prototype.__init4.call(this),R.prototype.__init5.call(this),R.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new R((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new R((t,n)=>{let r,o;return this.then(t=>{o=!1,r=t,e&&e()},t=>{o=!0,r=t,e&&e()}).then(()=>{o?n(r):t(r)})})}__init3(){this._resolve=e=>{this._setResult(I.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(I.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===I.PENDING&&(Object(D.n)(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==I.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===I.RESOLVED&&e[1](this._value),this._state===I.REJECTED&&e[2](this._value),e[0]=!0)})}}}}function k(e){var t=Object(C.b)(),n={sid:p(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Object(a.c)({sid:""+e.sid,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?""+e.did:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&M(n,e),n}function M(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Object(C.b)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:p()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=""+t.did),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class L{constructor(){L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this),L.prototype.__init5.call(this),L.prototype.__init6.call(this),L.prototype.__init7.call(this),L.prototype.__init8.call(this),L.prototype.__init9.call(this),L.prototype.__init10.call(this)}__init(){this._notifyingListeners=!1}__init2(){this._scopeListeners=[]}__init3(){this._eventProcessors=[]}__init4(){this._breadcrumbs=[]}__init5(){this._user={}}__init6(){this._tags={}}__init7(){this._extra={}}__init8(){this._contexts={}}__init9(){this._attachments=[]}__init10(){this._sdkProcessingMetadata={}}static clone(e){var t=new L;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&M(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof L?t:this}return e instanceof L?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):Object(D.i)(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r={timestamp:Object(C.a)(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags={transaction:n,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors([...x(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new R((o,a)=>{var i=e[r];if(null===t||"function"!=typeof i)o(t);else{var s=i({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.id&&null===s&&_.log(`Event processor "${i.id}" dropped event`),Object(D.n)(s)?s.then(t=>this._notifyEventProcessors(e,t,n,r+1).then(o)).then(null,a):this._notifyEventProcessors(e,s,n,r+1).then(o).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function x(){return Object(c.b)("globalEventProcessors",()=>[])}function F(e){x().push(e)}var P=100;class B{__init(){this._stack=[{}]}constructor(e,t=new L,n=4){this._version=n,B.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},a)}),n}captureMessage(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:p(),o=new Error(e);return this._withClient((a,i)=>{a.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},i)}),r}captureEvent(e,t){var n=t&&t.event_id?t.event_id:p();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient((r,o)=>{r.captureEvent(e,{...t,event_id:n},o)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:a=P}=r.getOptions&&r.getOptions()||{};if(!(a<=0)){var i={timestamp:Object(C.a)(),...e},s=o?d(()=>o(i,t)):i;null!==s&&n.addBreadcrumb(s,a)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){var n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){var n=this.getScope();n&&n.setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){var t=j(this);try{e(this)}finally{j(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),M(e,n)}(n),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:o}=n&&n.getOptions()||{};var a=Object(c.a)();const{userAgent:i}=a.navigator||{};var s=k({release:r,environment:o,...t&&{user:t.getUser()},...i&&{userAgent:i},...e});if(t){var u=t.getSession&&t.getSession();u&&"ok"===u.status&&M(u,{status:"exited"}),this.endSession(),t.setSession(s)}return s}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){var n=$().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function $(){var e=Object(c.a)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function j(e){var t=$(),n=Y(t);return G(t,e),n}function U(){var e=$();return H(e)&&!Y(e).isOlderThan(4)||G(e,new B),Object(N.b)()?function(e){try{var t=$().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return Y(e);if(!H(n)||Y(n).isOlderThan(4)){var r=Y(e).getStackTop();G(n,new B(r.client,L.clone(r.scope)))}return Y(n)}catch(t){return Y(e)}}(e):Y(e)}function H(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Y(e){return Object(c.b)("hub",()=>new B,e)}function G(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function W(e,t){return U().captureException(e,{captureContext:t})}function V(e,t){var n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;return U().captureMessage(e,n,r)}function K(e,t){return U().captureEvent(e,t)}function z(e){U().configureScope(e)}function q(e){U().addBreadcrumb(e)}function X(e,t){U().setContext(e,t)}function J(e){U().setExtras(e)}function Q(e,t){U().setExtra(e,t)}function Z(e){U().setTags(e)}function ee(e,t){U().setTag(e,t)}function te(e){U().setUser(e)}function ne(e){U().withScope(e)}function re(e,t){return U().startTransaction({...e},t)}class oe extends Error{constructor(e){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}}function ae(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.lengthn(o)).then(null,()=>n(o).then(null,()=>{})),o},drain:function(e){return new R((n,r)=>{let o=t.length;if(!o)return n(!0);var a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{w(e).then(()=>{--o||(clearTimeout(a),n(!0))},r)})})}}}function ie(e,t=[]){return[e,t]}function se(e,t){const[n,r]=e;return[n,[...r,t]]}function ce(e,t){e[1].forEach(e=>{var n=e[0].type;t(e,n)})}function ue(e,t){return(t||new TextEncoder).encode(e)}function le(e,t){const[n,r]=e;let o=JSON.stringify(n);function a(e){"string"==typeof o?o="string"==typeof e?o+e:[ue(o,t),e]:o.push("string"==typeof e?ue(e,t):e)}for(var i of r){const[e,t]=i;a(`\n${JSON.stringify(e)}\n`),a("string"==typeof t||t instanceof Uint8Array?t:JSON.stringify(t))}return"string"==typeof o?o:function(e){var t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(var o of e)n.set(o,r),r+=o.length;return n}(o)}function de(e,t){var n="string"==typeof e.data?ue(e.data,t):e.data;return[Object(a.c)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var he={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function _e(e){return he[e]}function fe(e,{statusCode:t,headers:n},r=Date.now()){var o={...e},a=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(a)for(var s of a.trim().split(",")){const[e,t]=s.split(":",2);var c=parseInt(e,10),u=1e3*(isNaN(c)?60:c);if(t)for(var l of t.split(";"))o[l]=r+u;else o.all=r+u}else i?o.all=r+function(e,t=Date.now()){var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}(i,r):429===t&&(o.all=r+6e4);return o}function pe(e,t,n=ae(e.bufferSize||30)){let r={};return{send:function(o){var a=[];if(ce(o,(t,n)=>{var o=_e(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?a.push(t):e.recordDroppedEvent("ratelimit_backoff",o)}),0===a.length)return w();var i=ie(o[0],a),s=t=>{ce(i,(n,r)=>{e.recordDroppedEvent(t,_e(r))})};return n.add(()=>t({body:le(i,e.textEncoder)}).then(e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=fe(r,e)},e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Failed while sending event:",e),s("network_error")})).then(e=>e,e=>{if(e instanceof oe)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Skipped sending event due to full buffer"),s("queue_overflow"),w();throw e})},flush:e=>n.drain(e)}}var me=n(38);function ge(){if(!("fetch"in Object(c.a)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function be(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var Ee=Object(c.a)(),Te={},Ae={};function ve(e){if(!Ae[e])switch(Ae[e]=!0,e){case"console":!function(){if(!("console"in Ee))return;l.forEach((function(e){e in Ee.console&&Object(a.e)(Ee.console,e,(function(t){return function(...n){Oe("console",{args:n,level:e}),t&&t.apply(Ee.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in Ee))return;var e=Oe.bind(null,"dom"),t=Se(e,!0);Ee.document.addEventListener("click",t,!1),Ee.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{var n=Ee[t]&&Ee[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(a.e)(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var a=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=a[n]=a[n]||{refCount:0};if(!i.handler){var s=Se(e);i.handler=s,t.call(this,n,s,o)}i.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Object(a.e)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete this.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))})}();break;case"xhr":!function(){if(!("XMLHttpRequest"in Ee))return;var e=XMLHttpRequest.prototype;Object(a.e)(e,"open",(function(e){return function(...t){var n=this,r=t[1],o=n.__sentry_xhr__={method:Object(D.l)(t[0])?t[0].toUpperCase():t[0],url:t[1]};Object(D.l)(r)&&"POST"===o.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);var i=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}Oe("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?Object(a.e)(n,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(n,t)}})):n.addEventListener("readystatechange",i),e.apply(n,t)}})),Object(a.e)(e,"send",(function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),Oe("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!ge())return!1;var e=Object(c.a)();if(be(e.fetch))return!0;let t=!1;var n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=be(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Object(a.e)(Ee,"fetch",(function(e){return function(...t){var n={args:t,fetchData:{method:Ie(t),url:Ce(t)},startTimestamp:Date.now()};return Oe("fetch",{...n}),e.apply(Ee,t).then(e=>(Oe("fetch",{...n,endTimestamp:Date.now(),response:e}),e),e=>{throw Oe("fetch",{...n,endTimestamp:Date.now(),error:e}),e})}}))}();break;case"history":!function(){if(e=Object(c.a)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState,n||!r)return;var e,t,n,r;var o=Ee.onpopstate;function i(e){return function(...t){var n=t.length>2?t[2]:void 0;if(n){var r=Ne,o=String(n);Ne=o,Oe("history",{from:r,to:o})}return e.apply(this,t)}}Ee.onpopstate=function(...e){var t=Ee.location.href,n=Ne;if(Ne=t,Oe("history",{from:n,to:t}),o)try{return o.apply(this,e)}catch(e){}},Object(a.e)(Ee.history,"pushState",i),Object(a.e)(Ee.history,"replaceState",i)}();break;case"error":Re=Ee.onerror,Ee.onerror=function(e,t,n,r,o){return Oe("error",{column:r,error:o,line:n,msg:e,url:t}),!!Re&&Re.apply(this,arguments)};break;case"unhandledrejection":ke=Ee.onunhandledrejection,Ee.onunhandledrejection=function(e){return Oe("unhandledrejection",e),!ke||ke.apply(this,arguments)};break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("unknown instrumentation type:",e))}}function ye(e,t){Te[e]=Te[e]||[],Te[e].push(t),ve(e)}function Oe(e,t){if(e&&Te[e])for(var n of Te[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Object(me.b)(n)}\nError:`,t)}}function Ie(e=[]){return"Request"in Ee&&Object(D.g)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Ce(e=[]){return"string"==typeof e[0]?e[0]:"Request"in Ee&&Object(D.g)(e[0],Request)?e[0].url:String(e[0])}let Ne;let De,we;function Se(e,t=!1){return n=>{if(n&&we!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===De||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(we,n))&&(e({event:n,name:r,global:t}),we=n),clearTimeout(De),De=Ee.setTimeout(()=>{De=void 0},1e3)}}}let Re=null;let ke=null;var Me=n(84),Le=n(127);function xe(e,t){var n=Pe(e,t),r={type:t&&t.name,value:$e(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Fe(e,t){return{exception:{values:[xe(e,t)]}}}function Pe(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Be.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}var Be=/Minified React error #\d+;/i;function $e(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function je(e,t,n,r,o){let i;if(Object(D.e)(t)&&t.error)return Fe(e,t.error);if(Object(D.a)(t)||Object(D.b)(t)){var s=t;if("stack"in t)i=Fe(e,t);else{var c=s.name||(Object(D.a)(s)?"DOMError":"DOMException"),u=s.message?`${c}: ${s.message}`:c;i=Ue(e,u,n,r),E(i,u)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":""+s.code}),i}return Object(D.d)(t)?Fe(e,t):Object(D.i)(t)||Object(D.f)(t)?(i=function(e,t,n,r){var o={exception:{values:[{type:Object(D.f)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${Object(a.d)(t)}`}]},extra:{__serialized__:Object(Le.b)(t)}};if(n){var i=Pe(e,n);i.length&&(o.exception.values[0].stacktrace={frames:i})}return o}(e,t,n,o),T(i,{synthetic:!0}),i):(i=Ue(e,t,n,r),E(i,""+t,void 0),T(i,{synthetic:!0}),i)}function Ue(e,t,n,r){var o={message:t};if(r&&n){var a=Pe(e,n);a.length&&(o.exception={values:[{value:t,stacktrace:{frames:a}}]})}return o}let He=0;function Ye(){return He>0}function Ge(){He+=1,setTimeout(()=>{He-=1})}function We(e,t={},n){if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Object(a.f)(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map(e=>We(e,t));return e.apply(this,o)}catch(e){throw Ge(),ne(n=>{n.addEventProcessor(e=>(t.mechanism&&(E(e,void 0,void 0),T(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),W(e)}),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Object(a.g)(o,e),Object(a.a)(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:()=>e.name})}catch(e){}return o}class Ve{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Ve.id}__init2(){this._installFunc={onerror:Ke,onunhandledrejection:ze}}constructor(e){Ve.prototype.__init.call(this),Ve.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;var e,t=this._options;for(var n in t){var r=this._installFunc[n];r&&t[n]&&(e=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log("Global Handler attached: "+e),r(),this._installFunc[n]=void 0)}}}function Ke(){ye("error",e=>{const[t,n,r]=Je();if(!t.getIntegration(Ve))return;const{msg:o,url:a,line:i,column:s,error:c}=e;if(!(Ye()||c&&c.__sentry_own_request__)){var u=void 0===c&&Object(D.l)(o)?function(e,t,n,r){let o=Object(D.e)(e)?e.message:e,a="Error";var i=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);i&&(a=i[1],o=i[2]);return qe({exception:{values:[{type:a,value:o}]}},t,n,r)}(o,a,i,s):qe(je(n,c||o,void 0,r,!1),a,i,s);u.level="error",Xe(t,c,u,"onerror")}})}function ze(){ye("unhandledrejection",e=>{const[t,n,r]=Je();if(!t.getIntegration(Ve))return;let o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Ye()||o&&o.__sentry_own_request__)return!0;var a=Object(D.j)(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}}:je(n,o,void 0,r,!0);a.level="error",Xe(t,o,a,"onunhandledrejection")})}function qe(e,t,n,r){var o=e.exception=e.exception||{},a=o.values=o.values||[],i=a[0]=a[0]||{},s=i.stacktrace=i.stacktrace||{},c=s.frames=s.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=Object(D.l)(t)&&t.length>0?t:Object(Me.a)();return 0===c.length&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),e}function Xe(e,t,n,r){T(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Je(){var e=U(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Ve.__initStatic();var Qe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Ze{static __initStatic(){this.id="TryCatch"}__init(){this.name=Ze.id}constructor(e){Ze.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){var e=Object(c.a)();this._options.setTimeout&&Object(a.e)(e,"setTimeout",et),this._options.setInterval&&Object(a.e)(e,"setInterval",et),this._options.requestAnimationFrame&&Object(a.e)(e,"requestAnimationFrame",tt),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Object(a.e)(XMLHttpRequest.prototype,"send",nt);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:Qe).forEach(rt)}}function et(e){return function(...t){var n=t[0];return t[0]=We(n,{mechanism:{data:{function:Object(me.b)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function tt(e){return function(t){return e.apply(this,[We(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Object(me.b)(e)},handled:!0,type:"instrument"}})])}}function nt(e){return function(...t){var n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Object(a.e)(n,e,(function(t){var n={mechanism:{data:{function:e,handler:Object(me.b)(t)},handled:!0,type:"instrument"}},r=Object(a.f)(t);return r&&(n.mechanism.data.handler=Object(me.b)(r)),We(t,n)}))}),e.apply(this,t)}}function rt(e){var t=Object(c.a)(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(a.e)(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=We(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Object(me.b)(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[n,We(r,{mechanism:{data:{function:"addEventListener",handler:Object(me.b)(r),target:e},handled:!0,type:"instrument"}}),o])}})),Object(a.e)(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var a=o&&o.__sentry_wrapped__;a&&e.call(this,t,a,r)}catch(e){}return e.call(this,t,o,r)}})))}Ze.__initStatic();var ot=["fatal","error","warning","log","info","debug"];function at(e){return"warn"===e?"warning":ot.includes(e)?e:"log"}class it{static __initStatic(){this.id="Breadcrumbs"}__init(){this.name=it.id}constructor(e){it.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){var e;this.options.console&&ye("console",st),this.options.dom&&ye("dom",(e=this.options.dom,function(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?Object(Me.b)(t.event.target,r):Object(Me.b)(t.event,r)}catch(e){n=""}0!==n.length&&U().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})})),this.options.xhr&&ye("xhr",ct),this.options.fetch&&ye("fetch",ut),this.options.history&&ye("history",lt)}}function st(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:at(e.level),message:Object(f.b)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(Object(f.b)(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}U().addBreadcrumb(t,{input:e.args,level:e.level})}function ct(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};U().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:o})}else;}function ut(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?U().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):U().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function lt(e){var t=Object(c.a)();let n=e.from,r=e.to;var o=m(t.location.href);let a=m(n);var i=m(r);a.path||(a=o),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),o.protocol===a.protocol&&o.host===a.host&&(n=a.relative),U().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}it.__initStatic();class dt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=dt.id}constructor(e={}){dt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){var e=U().getClient();e&&F((t,n)=>{var r=U().getIntegration(dt);return r?function(e,t,n,r,o){if(!(r.exception&&r.exception.values&&o&&Object(D.g)(o.originalException,Error)))return r;var a=function e(t,n,r,o,a=[]){if(!Object(D.g)(r[o],Error)||a.length+1>=n)return a;var i=xe(t,r[o]);return e(t,n,r[o],o,[i,...a])}(e,n,o.originalException,t);return r.exception.values=[...a,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t})}}dt.__initStatic();var ht=Object(c.a)();class _t{constructor(){_t.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=_t.id}setupOnce(){F(e=>{if(U().getIntegration(_t)){if(!ht.navigator&&!ht.location&&!ht.document)return e;var t=e.request&&e.request.url||ht.location&&ht.location.href;const{referrer:r}=ht.document||{},{userAgent:o}=ht.navigator||{};var n={...t&&{url:t},headers:{...e.request&&e.request.headers,...r&&{Referer:r},...o&&{"User-Agent":o}}};return{...e,request:n}}return e})}}_t.__initStatic();class ft{constructor(){ft.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=ft.id}setupOnce(e,t){var n=e=>{var n=t().getIntegration(ft);if(n){try{if(function(e,t){if(!t)return!1;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!mt(e,t))return!1;if(!pt(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=gt(t),r=gt(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!mt(e,t))return!1;if(!pt(e,t))return!1;return!0}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function pt(e,t){let n=bt(e),r=bt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let e=0;en.call(t,...e)),t=void 0)}return n}ft.__initStatic();var Tt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function At(e,t=!1){const{host:n,path:r,pass:o,port:a,projectId:i,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&o?":"+o:""}@${n}${a?":"+a:""}/${r?r+"/":r}${i}`}function vt(e){var t=Tt.exec(e);if(!t)throw new oe("Invalid Sentry Dsn: "+e);const[n,r,o="",a,i="",s]=t.slice(1);let c="",u=s;var l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){var d=u.match(/^\d+/);d&&(u=d[0])}return yt({host:a,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function yt(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ot(e){var t="string"==typeof e?vt(e):yt(e);return function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach(t=>{if(!e[t])throw new oe(`Invalid Sentry Dsn: ${t} missing`)}),!n.match(/^\d+$/))throw new oe("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new oe("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new oe("Invalid Sentry Dsn: Invalid port "+t)}(t),t}function It(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return`${t}//${e.host}${n}${e.path?"/"+e.path:""}/api/`}function Ct(e,t){return t||`${function(e){return`${It(e)}${e.projectId}/envelope/`}(e)}?${function(e){return Object(a.h)({sentry_key:e.publicKey,sentry_version:"7"})}(e)}`}function Nt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Dt(e,t,n,r){var o=Nt(n),i=e.type||"event";const{transactionSampling:s}=e.sdkProcessingMetadata||{},{method:c,rate:u}=s||{};return function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata,ie(function(e,t,n,r){return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:At(r)},..."transaction"===e.type&&e.contexts&&e.contexts.trace&&{trace:Object(a.c)({trace_id:e.contexts.trace.trace_id,environment:e.environment,release:e.release,transaction:e.transaction,user:e.user&&{id:e.user.id,segment:e.user.segment},public_key:r.publicKey})}}}(e,o,r,t),[[{type:i,sample_rates:[{id:c,rate:u}]},e]])}var wt=[];function St(e){return e.reduce((e,t)=>(e.every(e=>t.name!==e.name)&&e.push(t),e),[])}function Rt(e){var t=e.defaultIntegrations&&[...e.defaultIntegrations]||[],n=e.integrations;let r=[...St(t)];Array.isArray(n)?r=[...r.filter(e=>n.every(t=>t.name!==e.name)),...St(n)]:"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map(e=>e.name);return-1!==o.indexOf("Debug")&&r.push(...r.splice(o.indexOf("Debug"),1)),r}var kt="Not capturing exception because it's already been captured.";class Mt{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(Mt.prototype.__init.call(this),Mt.prototype.__init2.call(this),Mt.prototype.__init3.call(this),Mt.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=Ot(e.dsn);var t=Ct(this._dsn,e.tunnel);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(A(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log(kt));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let o=n&&n.event_id;var a=Object(D.j)(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(a.then(e=>this._captureEvent(e,n,r)).then(e=>{o=e})),o}captureEvent(e,t,n){if(t&&t.originalException&&A(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log(kt));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(e=>{r=e})),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),M(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e)):w(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){var e,t;this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=(e=this._options.integrations,t={},e.forEach(e=>{t[e.name]=e,-1===wt.indexOf(e.name)&&(e.setupOnce(F,U),wt.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log("Integration installed: "+e.name))}),t),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let r=Dt(e,this._dsn,this._options._metadata,this._options.tunnel);for(var n of t.attachments||[])r=se(r,de(n,Et([this,"access",e=>e._options,"access",e=>e.transportOptions,"optionalAccess",e=>e.textEncoder])));this._sendEnvelope(r)}}sendSession(e){if(this._dsn){var t=function(e,t,n,r){var o=Nt(n);return ie({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:At(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){var n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;var o=t.exception&&t.exception.values;if(o)for(var a of(r=!0,o)){var i=a.mechanism;if(i&&!1===i.handled){n=!0;break}}var s="ok"===e.status;(s&&0===e.errors||s&&n)&&(M(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new R(t=>{let n=0;var r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const{normalizeDepth:r=3,normalizeMaxBreadth:o=1e3}=this.getOptions();var a={...e,event_id:e.event_id||t.event_id||p(),timestamp:e.timestamp||Object(C.a)()};this._applyClientOptions(a),this._applyIntegrationsMetadata(a);let i=n;t.captureContext&&(i=L.clone(i).update(t.captureContext));let s=w(a);if(i){var c=[...t.attachments||[],...i.getAttachments()];c.length&&(t.attachments=c),s=i.applyToEvent(a,t)}return s.then(e=>(e&&(e.sdkProcessingMetadata={...e.sdkProcessingMetadata,normalizeDepth:`${Object(Le.a)(r)} (${typeof r})`}),"number"==typeof r&&r>0?this._normalizeEvent(e,r,o):e))}_normalizeEvent(e,t,n){if(!e)return null;var r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Object(Le.a)(e.data,t,n)}}))},...e.user&&{user:Object(Le.a)(e.user,t,n)},...e.contexts&&{contexts:Object(Le.a)(e.contexts,t,n)},...e.extra&&{extra:Object(Le.a)(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&(r.contexts={},r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Object(Le.a)(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>(e.data&&(e.data=Object(Le.a)(e.data,t,n)),e))),r.sdkProcessingMetadata={...r.sdkProcessingMetadata,baseClientNormalized:!0},r}_applyClientOptions(e){var t=this.getOptions();const{environment:n,release:r,dist:o,maxValueLength:a=250}=t;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=Object(f.d)(e.message,a));var i=e.exception&&e.exception.values&&e.exception.values[0];i&&i.value&&(i.value=Object(f.d)(i.value,a));var s=e.request;s&&s.url&&(s.url=Object(f.d)(s.url,a))}_applyIntegrationsMetadata(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn(e)})}_processEvent(e,t,n){const{beforeSend:r,sampleRate:o}=this.getOptions();if(!this._isEnabled())return S(new oe("SDK not enabled, will not capture event."));var a="transaction"===e.type;return!a&&"number"==typeof o&&Math.random()>o?(this.recordDroppedEvent("sample_rate","error"),S(new oe(`Discarding event because it's not included in the random sample (sampling rate = ${o})`))):this._prepareEvent(e,t,n).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new oe("An event processor returned null, will not send event.");return t.data&&!0===t.data.__sentry__||a||!r?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(Object(D.n)(e))return e.then(e=>{if(!Object(D.i)(e)&&null!==e)throw new oe(t);return e},e=>{throw new oe("beforeSend rejected with "+e)});if(!Object(D.i)(e)&&null!==e)throw new oe(t);return e}(r(n,t))}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new oe("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession();return!a&&o&&this._updateSessionFromEvent(o,r),this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof oe)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new oe("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)})}_process(e){this._numProcessing+=1,e.then(e=>(this._numProcessing-=1,e),e=>(this._numProcessing-=1,e))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Error while sending event:",e)}):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}var Lt=Object(c.a)();let xt;function Ft(){if(xt)return xt;if(be(Lt.fetch))return xt=Lt.fetch.bind(Lt);var e=Lt.document;let t=Lt.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return xt=t.bind(Lt)}var Pt=Object(c.a)();class Bt extends Mt{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"7.1.1"}],version:"7.1.1"},super(e),e.sendClientReports&&Pt.document&&Pt.document.addEventListener("visibilitychange",()=>{"hidden"===Pt.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){var o=je(e,t,n&&n.syntheticException||void 0,r);return T(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),w(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){var a=Ue(e,t,r&&r.syntheticException||void 0,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),w(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){var n=this.getIntegrationById("Breadcrumbs");n&&n.options&&n.options.sentry&&U().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:b(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log("Sending outcomes:",e);var t,n,r,o=Ct(this._dsn,this._options.tunnel),a=(t=e,ie((n=this._options.tunnel&&At(this._dsn))?{dsn:n}:{},[[{type:"client_report"},{timestamp:r||Object(C.a)(),discarded_events:t}]]));try{!function(e,t){if("[object Navigator]"===Object.prototype.toString.call(Lt&&Lt.navigator)&&"function"==typeof Lt.navigator.sendBeacon)Lt.navigator.sendBeacon.bind(Lt.navigator)(e,t);else if(ge()){Ft()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error(e)})}}(o,le(a))}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error(e)}}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log("No dsn provided, will not send outcomes");else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.log("No outcomes to send")}}function $t(e,t=Ft()){return pe(e,(function(n){var r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,...e.fetchOptions};return t(e.url,r).then(e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}))}function jt(e){return pe(e,(function(t){return new R((n,r)=>{var o=new XMLHttpRequest;for(var a in o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,a)&&o.setRequestHeader(a,e.headers[a]);o.send(t.body)})}))}function Ut(e,t,n,r){var o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var Ht=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Yt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Gt=[30,e=>{var t=Ht.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=Yt.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}const[e,r]=nn(t[1]||"?",t[2]);return Ut(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Wt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Vt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kt=[50,e=>{var t=Wt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Vt.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}let e=t[3],r=t[1]||"?";return[r,e]=nn(r,e),Ut(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],zt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,qt=[40,e=>{var t=zt.exec(e);return t?Ut(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}],Xt=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Jt=[10,e=>{var t=Xt.exec(e);return t?Ut(t[2],t[3]||"?",+t[1]):void 0}],Qt=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Zt=[20,e=>{var t=Qt.exec(e);return t?Ut(t[5],t[3]||t[4]||"?",+t[1],+t[2]):void 0}],en=[Gt,Kt,qt],tn=Object(me.a)(...en),nn=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};var rn=[new r.InboundFilters,new r.FunctionToString,new Ze,new it,new Ve,new dt,new ft,new _t];function on(e={}){if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=rn),void 0===e.release){var t=Object(c.a)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n={...e,stackParser:Object(me.c)(e.stackParser||tn),integrations:Rt(e),transport:e.transport||(ge()?$t:jt)};!function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?_.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=U(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(Bt,n),e.autoSessionTracking&&function(){if(void 0===Object(c.a)().document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=U();if(!e.captureSession)return;_n(e),ye("history",({from:e,to:t})=>{void 0!==e&&e!==t&&_n(U())})}()}function an(e={},t=U()){var n=Object(c.a)();if(!n.document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Global document not defined in showReportDialog call"));const{client:r,scope:o}=t.getStackTop();var a=e.dsn||r&&r.getDsn();if(a){o&&(e.user={...o.getUser(),...e.user}),e.eventId||(e.eventId=t.lastEventId());var i=n.document.createElement("script");i.async=!0,i.src=function(e,t){var n=Ot(e),r=It(n)+"embed/error-page/";let o="dsn="+At(n);for(var a in t)if("dsn"!==a)if("user"===a){var i=t.user;if(!i)continue;i.name&&(o+="&name="+encodeURIComponent(i.name)),i.email&&(o+="&email="+encodeURIComponent(i.email))}else o+=`&${encodeURIComponent(a)}=${encodeURIComponent(t[a])}`;return`${r}?${o}`}(a,e),e.onLoad&&(i.onload=e.onLoad);var s=n.document.head||n.document.body;s?s.appendChild(i):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("Not injecting report dialog. No injection point found in HTML")}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.error("DSN not configured for showReportDialog call")}function sn(){return U().lastEventId()}function cn(){}function un(e){e()}function ln(e){var t=U().getClient();return t?t.flush(e):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Cannot flush events. No client defined."),w(!1))}function dn(e){var t=U().getClient();return t?t.close(e):(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&_.warn("Cannot flush events and disable SDK. No client defined."),w(!1))}function hn(e){return We(e)()}function _n(e){e.startSession({ignoreDuration:!0}),e.captureSession()}n.d(t,"Integrations",(function(){return mn})),n.d(t,"FunctionToString",(function(){return s})),n.d(t,"Hub",(function(){return B})),n.d(t,"InboundFilters",(function(){return y})),n.d(t,"SDK_VERSION",(function(){return"7.1.1"})),n.d(t,"Scope",(function(){return L})),n.d(t,"addBreadcrumb",(function(){return q})),n.d(t,"addGlobalEventProcessor",(function(){return F})),n.d(t,"captureEvent",(function(){return K})),n.d(t,"captureException",(function(){return W})),n.d(t,"captureMessage",(function(){return V})),n.d(t,"configureScope",(function(){return z})),n.d(t,"createTransport",(function(){return pe})),n.d(t,"getCurrentHub",(function(){return U})),n.d(t,"getHubFromCarrier",(function(){return Y})),n.d(t,"makeMain",(function(){return j})),n.d(t,"setContext",(function(){return X})),n.d(t,"setExtra",(function(){return Q})),n.d(t,"setExtras",(function(){return J})),n.d(t,"setTag",(function(){return ee})),n.d(t,"setTags",(function(){return Z})),n.d(t,"setUser",(function(){return te})),n.d(t,"startTransaction",(function(){return re})),n.d(t,"withScope",(function(){return ne})),n.d(t,"BrowserClient",(function(){return Bt})),n.d(t,"makeFetchTransport",(function(){return $t})),n.d(t,"makeXHRTransport",(function(){return jt})),n.d(t,"chromeStackLineParser",(function(){return Gt})),n.d(t,"defaultStackLineParsers",(function(){return en})),n.d(t,"defaultStackParser",(function(){return tn})),n.d(t,"geckoStackLineParser",(function(){return Kt})),n.d(t,"opera10StackLineParser",(function(){return Jt})),n.d(t,"opera11StackLineParser",(function(){return Zt})),n.d(t,"winjsStackLineParser",(function(){return qt})),n.d(t,"close",(function(){return dn})),n.d(t,"defaultIntegrations",(function(){return rn})),n.d(t,"flush",(function(){return ln})),n.d(t,"forceLoad",(function(){return cn})),n.d(t,"init",(function(){return on})),n.d(t,"lastEventId",(function(){return sn})),n.d(t,"onLoad",(function(){return un})),n.d(t,"showReportDialog",(function(){return an})),n.d(t,"wrap",(function(){return hn})),n.d(t,"GlobalHandlers",(function(){return Ve})),n.d(t,"TryCatch",(function(){return Ze})),n.d(t,"Breadcrumbs",(function(){return it})),n.d(t,"LinkedErrors",(function(){return dt})),n.d(t,"HttpContext",(function(){return _t})),n.d(t,"Dedupe",(function(){return ft}));let fn={};var pn=Object(c.a)();pn.Sentry&&pn.Sentry.Integrations&&(fn=pn.Sentry.Integrations);var mn={...fn,...r,...o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o}));function r(...e){var t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{var r=[];for(var o of e.split("\n").slice(n))for(var a of t){var i=a(o);if(i){r.push(i);break}}return function(e){if(!e.length)return[];let t=e;var n=t[0].function||"",r=t[t.length-1].function||"";-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1));-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1));return t.slice(0,50).map(e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"})).reverse()}(r)}}function o(e){return Array.isArray(e)?r(...e):e}function a(e){try{return e&&"function"==typeof e&&e.name||""}catch(e){return""}}},function(e,t,n){const r=n(37),{compressToEncodedURIComponent:o}=n(80),a=n(81),i=n(95),s=n(78),{getCurrentTab:c}=n(82),u=i.getSanitizingConverter(),l=function(e){return String(e).replace(/[&<>"'/]/g,(function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}[e]}))};window.sanitize=l;const d=function(e){const t=new DOMParser;return u.makeHtml(t.parseFromString(e,"text/html").body.textContent||"")};window.markdownToHtml=d;const h=function(e,t){let n;return null==t&&(t="-"),e&&(n=_(e.toLowerCase()).replace(/[^a-z0-9]+/gi,t).replace(new RegExp(`^${t}|${t}$`,"g"),""),n.length>128&&(n=n.substr(0,128))),n||t},_=function(e){return e.replace(/[àáâãäåāăą]/g,"a").replace(/æ/g,"ae").replace(/[çćĉċč]/g,"c").replace(/[ďđ]/g,"d").replace(/[èéêëēĕėęě]/g,"e").replace(/[ĝğġģ]/g,"g").replace(/[ĥħ]/g,"h").replace(/[ìíîïĩīĭįı]/g,"i").replace(/[ñńņňʼnŋ]/g,"n").replace(/[òóôõöōŏő]/g,"o").replace(/œ/g,"oe").replace(/ř/g,"r").replace(/[śŝşš]/g,"s").replace(/ß/g,"ss").replace(/[ùúûüũūŭůűų]/g,"u").replace(/[ýÿ]/g,"y")};function f(e){switch(e){case"rule":case"rules":return"rules";case"card-button":return"card-buttons";case"board-button":return"board-buttons";case"schedule":case"schedules":case"scheduled":return"schedule";case"on-dates":case"due-dates":case"duedates":case"dates":return"on-dates";case"suggestions":return"suggestions";case"connected-apps":case"app-automations":return"connected-apps";default:return e}}e.exports={sanitize:l,markdownToHtml:d,handleError:function(e,t){/Invalid context, missing board/.test(e.message)||(/Plugin disabled on board/.test(e.message)?console.log("[Butler] Power-Up disabled on board."):s.getTaskSessions().then(e=>{const t=[];Object.keys(e).forEach(n=>{const o=("task_"+n).replace(/\//g,"-");t[o]=e[n],r.setTag(o,e[n])})}).finally(()=>{e?(r.captureException(e),a.logError(e,t)):t&&r.captureMessage(t)}))},makeSlug:h,normalizeTabForUrl:f,normalizeType:function(e){switch(e){case"rule":case"rules":return"rule";case"card-buttons":return"card-button";case"board-buttons":return"board-button";case"schedules":case"schedule":case"scheduled":return"schedule";case"on-dates":case"due-dates":case"duedates":case"dates":return"on-date";default:return e}},updateNavigation:function(){let{tab:e,action:t,commandId:n,newCommand:r,newIcon:a,newLabel:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),u=f(e||c()),l=t?"/"+t:"",d=n?"/"+n:"",_=new URLSearchParams;r&&(_.set("c",o(r)),a&&_.set("i",a),i&&_.set("l",i));const p=r?"?"+_.toString():"";return s.board("shortLink","name").then(e=>{const t=h(e.name),n=`https://trello.com/b/${e.shortLink}/${t}/butler/${u}${l}${d}${p}`;s.navigate({url:n,trigger:!1})})}}},,function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(8),o=n(17),a=n(43),i=n(44).UNSUPPORTED_Y;r&&("g"!=/./g.flags||i)&&o.f(RegExp.prototype,"flags",{configurable:!0,get:a})},function(e,t,n){"use strict";var r=n(18);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(7);function o(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},function(e,t,n){var r=n(46),o=n(1),a=n(68);r({global:!0,bind:!0,enumerable:!0,forced:!o.setImmediate||!o.clearImmediate},{setImmediate:a.set,clearImmediate:a.clear})},function(e,t,n){var r=n(1),o=n(29).f,a=n(12),i=n(50),s=n(20),c=n(57),u=n(67);e.exports=function(e,t){var n,l,d,h,_,f=e.target,p=e.global,m=e.stat;if(n=p?r:m?r[f]||s(f,{}):(r[f]||{}).prototype)for(l in t){if(h=t[l],d=e.noTargetGet?(_=o(n,l))&&_.value:n[l],!u(p?l:f+(m?".":"#")+l,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&a(h,"sham",!0),i(n,l,h,e)}}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(7),o=n(31),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(32);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(1),o=n(12),a=n(9),i=n(20),s=n(33),c=n(51),u=c.get,l=c.enforce,d=String(String).split("String");(e.exports=function(e,t,n,s){var c,u=!!s&&!!s.unsafe,h=!!s&&!!s.enumerable,_=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||o(n,"name",t),(c=l(n)).source||(c.source=d.join("string"==typeof t?t:""))),e!==r?(u?!_&&e[t]&&(h=!0):delete e[t],h?e[t]=n:o(e,t,n)):h?e[t]=n:i(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},function(e,t,n){var r,o,a,i=n(52),s=n(1),c=n(11),u=n(12),l=n(9),d=n(21),h=n(53),_=n(34),f=s.WeakMap;if(i||d.state){var p=d.state||(d.state=new f),m=p.get,g=p.has,b=p.set;r=function(e,t){if(g.call(p,e))throw new TypeError("Object already initialized");return t.facade=e,b.call(p,e,t),t},o=function(e){return m.call(p,e)||{}},a=function(e){return g.call(p,e)}}else{var E=h("state");_[E]=!0,r=function(e,t){if(l(e,E))throw new TypeError("Object already initialized");return t.facade=e,u(e,E,t),t},o=function(e){return l(e,E)?e[E]:{}},a=function(e){return l(e,E)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(1),o=n(33),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(o(a))},function(e,t,n){var r=n(54),o=n(56),a=r("keys");e.exports=function(e){return a[e]||(a[e]=o(e))}},function(e,t,n){var r=n(55),o=n(21);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.13.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(9),o=n(58),a=n(29),i=n(17);e.exports=function(e,t){for(var n=o(t),s=i.f,c=a.f,u=0;uc;)r(s,n=t[c++])&&(~a(u,n)||u.push(n));return u}},function(e,t,n){var r=n(19),o=n(63),a=n(64),i=function(e){return function(t,n,i){var s,c=r(t),u=o(c.length),l=a(i,u);if(e&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r=n(35),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(35),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(7),o=/#|\.prototype\./,a=function(e,t){var n=s[i(e)];return n==u||n!=c&&("function"==typeof t?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},function(e,t,n){var r,o,a,i=n(1),s=n(7),c=n(69),u=n(71),l=n(27),d=n(72),h=n(74),_=i.location,f=i.setImmediate,p=i.clearImmediate,m=i.process,g=i.MessageChannel,b=i.Dispatch,E=0,T={},A=function(e){if(T.hasOwnProperty(e)){var t=T[e];delete T[e],t()}},v=function(e){return function(){A(e)}},y=function(e){A(e.data)},O=function(e){i.postMessage(e+"",_.protocol+"//"+_.host)};f&&p||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return T[++E]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(E),E},p=function(e){delete T[e]},h?r=function(e){m.nextTick(v(e))}:b&&b.now?r=function(e){b.now(v(e))}:g&&!d?(a=(o=new g).port2,o.port1.onmessage=y,r=c(a.postMessage,a,1)):i.addEventListener&&"function"==typeof postMessage&&!i.importScripts&&_&&"file:"!==_.protocol&&!s(O)?(r=O,i.addEventListener("message",y,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),A(e)}}:function(e){setTimeout(v(e),0)}),e.exports={set:f,clear:p}},function(e,t,n){var r=n(70);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(22);e.exports=r("document","documentElement")},function(e,t,n){var r=n(73);e.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var r=n(22);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(31),o=n(1);e.exports="process"==r(o.process)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokenizeIndices=t.tokenize=t.isVariableNameValue=t.isVariableName=t.isTerminal=t.isSymbol=t.isStringVariable=t.isStringValue=t.isOptional=t.isInlineEnd=t.isHiddenSymbol=t.isEnd=t.isAtMentionVariableValue=t.isAtMentionValue=t.isAtMention=t.getOptional=t.parseTokens=t.parseYear=t.parseTimezone=t.parseTime=t.parseNumericDate=t.getTimezoneName=t.parser=t.parseDecimal=t.parseSmallNumeral=t.parseOrdinal=t.parseInlineDate=t.parseEnterpriseCommand=t.parseCondition=t.parseCommand=t.year=t.trap=t.timezone=t.time=t.swappable=t.small_numeral=t.ordinal=t.or=t.or_index=t.optional=t.numeric_date=t.make_sibling=t.hidden=t.enum_value=t.decimal=t.flatten=t.correctParseResult=t.getCommandGrammar=void 0;var r=n(158);Object.defineProperty(t,"getCommandGrammar",{enumerable:!0,get:function(){return r.getCommandGrammar}});var o=n(159);Object.defineProperty(t,"correctParseResult",{enumerable:!0,get:function(){return o.correctParseResult}});var a=n(160);Object.defineProperty(t,"flatten",{enumerable:!0,get:function(){return a.flatten}});var i=n(164);Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return i.decimal}}),Object.defineProperty(t,"enum_value",{enumerable:!0,get:function(){return i.enum_value}}),Object.defineProperty(t,"hidden",{enumerable:!0,get:function(){return i.hidden}}),Object.defineProperty(t,"make_sibling",{enumerable:!0,get:function(){return i.make_sibling}}),Object.defineProperty(t,"numeric_date",{enumerable:!0,get:function(){return i.numeric_date}}),Object.defineProperty(t,"optional",{enumerable:!0,get:function(){return i.optional}}),Object.defineProperty(t,"or_index",{enumerable:!0,get:function(){return i.or_index}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return i.or}}),Object.defineProperty(t,"ordinal",{enumerable:!0,get:function(){return i.ordinal}}),Object.defineProperty(t,"small_numeral",{enumerable:!0,get:function(){return i.small_numeral}}),Object.defineProperty(t,"swappable",{enumerable:!0,get:function(){return i.swappable}}),Object.defineProperty(t,"time",{enumerable:!0,get:function(){return i.time}}),Object.defineProperty(t,"timezone",{enumerable:!0,get:function(){return i.timezone}}),Object.defineProperty(t,"trap",{enumerable:!0,get:function(){return i.trap}}),Object.defineProperty(t,"year",{enumerable:!0,get:function(){return i.year}});var s=n(165);Object.defineProperty(t,"parseCommand",{enumerable:!0,get:function(){return s.parseCommand}}),Object.defineProperty(t,"parseCondition",{enumerable:!0,get:function(){return s.parseCondition}}),Object.defineProperty(t,"parseEnterpriseCommand",{enumerable:!0,get:function(){return s.parseEnterpriseCommand}});var c=n(166);Object.defineProperty(t,"parseInlineDate",{enumerable:!0,get:function(){return c.parseInlineDate}});var u=n(167);Object.defineProperty(t,"parseOrdinal",{enumerable:!0,get:function(){return u.parseOrdinal}}),Object.defineProperty(t,"parseSmallNumeral",{enumerable:!0,get:function(){return u.parseSmallNumeral}}),Object.defineProperty(t,"parseDecimal",{enumerable:!0,get:function(){return u.parseDecimal}});var l=n(168);Object.defineProperty(t,"parser",{enumerable:!0,get:function(){return l.parser}});var d=n(169);Object.defineProperty(t,"getTimezoneName",{enumerable:!0,get:function(){return d.getTimezoneName}}),Object.defineProperty(t,"parseNumericDate",{enumerable:!0,get:function(){return d.parseNumericDate}}),Object.defineProperty(t,"parseTime",{enumerable:!0,get:function(){return d.parseTime}}),Object.defineProperty(t,"parseTimezone",{enumerable:!0,get:function(){return d.parseTimezone}}),Object.defineProperty(t,"parseYear",{enumerable:!0,get:function(){return d.parseYear}});var h=n(171);Object.defineProperty(t,"parseTokens",{enumerable:!0,get:function(){return h.parseTokens}});var _=n(172);Object.defineProperty(t,"getOptional",{enumerable:!0,get:function(){return _.getOptional}}),Object.defineProperty(t,"isAtMention",{enumerable:!0,get:function(){return _.isAtMention}}),Object.defineProperty(t,"isAtMentionValue",{enumerable:!0,get:function(){return _.isAtMentionValue}}),Object.defineProperty(t,"isAtMentionVariableValue",{enumerable:!0,get:function(){return _.isAtMentionVariableValue}}),Object.defineProperty(t,"isEnd",{enumerable:!0,get:function(){return _.isEnd}}),Object.defineProperty(t,"isHiddenSymbol",{enumerable:!0,get:function(){return _.isHiddenSymbol}}),Object.defineProperty(t,"isInlineEnd",{enumerable:!0,get:function(){return _.isInlineEnd}}),Object.defineProperty(t,"isOptional",{enumerable:!0,get:function(){return _.isOptional}}),Object.defineProperty(t,"isStringValue",{enumerable:!0,get:function(){return _.isStringValue}}),Object.defineProperty(t,"isStringVariable",{enumerable:!0,get:function(){return _.isStringVariable}}),Object.defineProperty(t,"isSymbol",{enumerable:!0,get:function(){return _.isSymbol}}),Object.defineProperty(t,"isTerminal",{enumerable:!0,get:function(){return _.isTerminal}}),Object.defineProperty(t,"isVariableName",{enumerable:!0,get:function(){return _.isVariableName}}),Object.defineProperty(t,"isVariableNameValue",{enumerable:!0,get:function(){return _.isVariableNameValue}});var f=n(173);Object.defineProperty(t,"tokenize",{enumerable:!0,get:function(){return f.tokenize}}),Object.defineProperty(t,"tokenizeIndices",{enumerable:!0,get:function(){return f.tokenizeIndices}})},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var c,u=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&_())}function _(){if(!l){var e=s(h);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d1)for(var n=1;ne&&e.id).mapValues(e=>{let{id:t}=e;return{id:t}}).value()}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window._trello;const t=e&&"function"==typeof e.getContext&&e.getContext();return t&&t.board?u({board:{id:t.board},organization:{id:t.organization}}):{}}function d(e){return{trelloMemberId:window._trello.getContext().member,...e.attributes}}function h(e){return c().then(t=>t.sendOperationalEvent({containers:l(),...e,attributes:d(e)}))}function _(e){return c().then(t=>{t.task.completeTaskSession(e)})}function f(){let e="";for(let t=0;t<16;t+=1){e+="0123456789abcdef"[Math.floor(16*Math.random())]}return e}s=("test"===s?"staging":s).toUpperCase(),e.exports={sendUIEvent:function(e){return c().then(t=>t.sendUIEvent({containers:l(),...e,attributes:d(e)}))},sendTrackEvent:function(e){return c().then(t=>t.sendTrackEvent({containers:l(),...e,attributes:d(e)}))},sendScreenEvent:function(e){return c().then(t=>t.sendScreenEvent({containers:l(),...e,attributes:d(e)}))},startTask:function(e){const{taskName:t,source:n,containers:r,attributes:a}=e;if(!t)return o.captureMessage("No taskName passed to startTask"),null;const i=Math.floor(Date.now()/1e3).toString(16)+(f().slice(8)+f());return function(e,t){c().then(n=>{n.task.createTaskSessionWithProvidedId(e,t)})}(t,i),h({action:"taskStart",actionSubject:"ui",source:"ui",containers:r,attributes:{task:t,taskId:i,source:n,...a}}),i},taskSucceeded:function(e){const{taskName:t,traceId:n,source:r,containers:a,attributes:i}=e;return n?t?(_(t),h({action:"taskSuccess",actionSubject:"ui",source:"ui",containers:a,attributes:{task:t,taskId:n,source:r,...i}}),n):(o.captureMessage("No taskName passed to taskSucceeded"),null):(o.captureMessage("No traceID passed to taskSucceeded"),null)},taskFailed:function(e){const{taskName:t,traceId:n,source:r,containers:a,attributes:i,error:s}=e;if(!n)return o.captureMessage("No traceID passed to taskFailed"),null;if(!t)return o.captureMessage("No taskName passed to taskFailed"),null;_(t);const c=function(e){const t={};return e.name&&(t.errorName=e.name),e.message&&(t.errorMessage=e.message.replace(/token=[0-9a-fA-F/%]*/g,"token=").replace(/"X-Butler-Trello-Token":\s*"[0-9a-fA-F]*"/g,'"X-Butler-Trello-Token": ""').replace(/[0-9a-fA-F]{64}/g,"").replace(/(ATT[A-Z])[A-Za-z0-9/-]{16,}([A-F0-9]{8})/g,"")),t}(s);return h({action:"taskFail",actionSubject:"ui",source:"ui",containers:a,attributes:{task:t,taskId:n,source:r,...i,...c}}),n},taskAborted:function(e){const{taskName:t,traceId:n,source:r,containers:a,attributes:i}=e;return n?t?(_(t),h({action:"taskAbort",actionSubject:"ui",source:"ui",containers:a,attributes:{task:t,taskId:n,source:r,...i}}),n):(o.captureMessage("No taskName passed to taskAborted"),null):(o.captureMessage("No traceID passed to taskAborted"),null)},getTaskSessions:function(){return c().then(e=>e.task.getAllTaskSessions())}}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var r,o=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(e,t){if(!r[e]){r[e]={};for(var n=0;n>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(t){if(null==t)return a.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r>=1}else{for(o=1,r=0;r<_;r++)p=p<<1|o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o=0;for(o=l.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1}0==--d&&(d=Math.pow(2,_),_++),delete s[l]}else for(o=i[l],r=0;r<_;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1;0==--d&&(d=Math.pow(2,_),_++),i[u]=h++,l=String(c)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(r=0;r<_;r++)p<<=1,m==t-1?(m=0,f.push(n(p)),p=0):m++;for(o=l.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1}else{for(o=1,r=0;r<_;r++)p=p<<1|o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o=0;for(o=l.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1}0==--d&&(d=Math.pow(2,_),_++),delete s[l]}else for(o=i[l],r=0;r<_;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1;0==--d&&(d=Math.pow(2,_),_++)}for(o=2,r=0;r<_;r++)p=p<<1|1&o,m==t-1?(m=0,f.push(n(p)),p=0):m++,o>>=1;for(;;){if(p<<=1,m==t-1){f.push(n(p));break}m++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:a._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,n,r){var o,a,i,s,c,u,l,d=[],h=4,_=4,f=3,p="",m=[],g={val:r(0),position:n,index:1};for(o=0;o<3;o+=1)d[o]=o;for(i=0,c=Math.pow(2,2),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;switch(i){case 0:for(i=0,c=Math.pow(2,8),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;l=e(i);break;case 1:for(i=0,c=Math.pow(2,16),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;l=e(i);break;case 2:return""}for(d[3]=l,a=l,m.push(l);;){if(g.index>t)return"";for(i=0,c=Math.pow(2,f),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;switch(l=i){case 0:for(i=0,c=Math.pow(2,8),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;d[_++]=e(i),l=_-1,h--;break;case 1:for(i=0,c=Math.pow(2,16),u=1;u!=c;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=r(g.index++)),i|=(s>0?1:0)*u,u<<=1;d[_++]=e(i),l=_-1,h--;break;case 2:return m.join("")}if(0==h&&(h=Math.pow(2,f),f++),d[l])p=d[l];else{if(l!==_)return null;p=a+a.charAt(0)}m.push(p),d[_++]=a+p.charAt(0),a=p,0==--h&&(h=Math.pow(2,f),f++)}}};return a}();void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)},function(e,t){const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||"object"!=typeof e)return e;if(-1!==t.indexOf(e))return"__circular__";t.push(e);const r={};return Object.getOwnPropertyNames(e).forEach((function(o){r[o]=n(e[o],t)})),r},r=function(e,t){let r=e;return"object"==typeof e&&null!==e&&(r=n(e)),JSON.stringify(r,void 0,t)},o=function(){return"function"==typeof ga&&(ga(...arguments),!0)},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n").replace(/"X-Butler-Trello-Token":\s*"[0-9a-fA-F]*"/g,'"X-Butler-Trello-Token": ""').replace(/[0-9a-fA-F]{64}/g,"").replace(/(ATT[A-Z])[A-Za-z0-9/-]{16,}([A-F0-9]{8})/g,""),!o("send","event",i,s,c)},i={init:function(){window.onerror=a.bind({type:"error_onerror"}),$(document).ajaxError(a.bind({type:"error_ajax"})),window.addEventListener("unhandledrejection",a.bind({type:"error_unhandledrejection"}))},logError:a,logEvent:function(e,t,n){o("send","event",e,t,n)},logVirtualPageview:function(e){o("set","page",`${document.location.pathname}#${e}`),o("send","pageview")}};window.Log=i,e.exports=i},function(e,t){const n=function(e){$(e).parent().children(".butler-status").transition("hide")},r=function(){return $(".dashboard-tabs .item.active").attr("data-tab").substr("tab-".length)},o=function(e){n(e),$(e).transition("fade down")},a=function(e,t){const n="tab-"+e;let r;const o=$(".dashboard-tabs .item"),a=$(".dashboard-tab-content").children(".ui.tab");o.each((function(){const e=$(this).attr("data-tab"),o=$(this).attr("data-target-tab")||e;if(e!==n){$(this).removeClass("active");const e=$(this).children(".child-text");e.length&&(e.text(e.attr("data-default")),$(this).removeClass("child-active")),o!==r&&a.filter(`.ui.tab[data-tab="${o}"]`).removeClass("active").filter(":not(.hidden)").transition("hide")}else{const e=$(this).closest(".ui.dropdown");e.length&&(e.children(".child-text").text($(this).text()),e.hasClass("child-active")||e.addClass("child-active"),e.find(".menu").transition("hide")),$(this).hasClass("active")||$(this).addClass("active"),t?a.filter(`.ui.tab[data-tab="${o}"]`).transition("hide").transition("slide down"):a.filter(`.ui.tab.hidden[data-tab="${o}"]`).transition("show"),r=o}}))};window.clearStatus=n,window.getCurrentTab=r,window.showStatus=o,window.showTab=a,e.exports={clearStatus:n,getCurrentTab:r,showStatus:o,showTab:a}},function(e,t,n){const r=n(37),o=n(15),{removeTokenValue:a}=n(139),{TrelloApiError:i,errorForStatus:s,RegistrationError:c,registrationErrorAlert:u}=n(114),l={name:"Butler",key:"446cbc1d6532c596ddc610207ead5576",scope:"read,write,account"};let d,h;const _=function(e,t){return new TrelloPowerUp.Promise((function(n,r){const o=new XMLHttpRequest;o.open("GET",e,!0),o.timeout=3e4,o.onload=function(){if(200===o.status){let e;try{e=JSON.parse(o.responseText)}catch(e){return r(new i.InvalidResponse(e.message))}return n(e)}return r(s(o.status,o.responseText))},o.ontimeout=function(){return r(new i.Timeout(t+" timeout"))},o.send()}))},f=function(e){return e.requestToken(l).then(t=>(d=t,e.set("member","private","token",t).then(()=>t))).catch(t=>{throw r.captureMessage("Authorization Error: "+t.message),e.alert({display:"error",duration:15,message:"Butler is unable to complete setup. Please refresh the page."}).catch(()=>{}),t})},p=function(e,t){return new TrelloPowerUp.Promise((n,a)=>{$.ajax(o+"auth",{type:"POST",data:JSON.stringify({token:d,source:"powerup_trello",tz:moment.tz.guess(),apikey:l.key}),contentType:"application/json"}).done(o=>{if(e.hideAlert().catch(()=>{}),o.success)return h=void 0,void n();let i;"MEMBER_NOT_CONFIRMED"===o.error?(i=new c.NotConfirmed(o.error),t||e.alert({display:"error",duration:10,message:"Your Trello account is not confirmed. Please confirm your Trello account before using Butler."})):(e.alert(u),i=new c.Unknown(o.error),r.captureException(i)),a(i)}).fail(t=>(r.captureMessage(`Registration request failed: ${t.status} - ${t.statusText}`),e.alert(u),a(new c.Unknown(t.responseText)),!1))})},m=function(e){return f(e).then(t=>p(e).catch(()=>{}).then(()=>t))},g=function(e){return"string"==typeof e&&(/^(ATT[A-Z])[A-Za-z0-9]{16,}([A-F0-9]{8})$/i.test(e)||/^[0-9a-fA-F]{64}$/i.test(e))},b=function(e,t){const n=e||window._trello;return new TrelloPowerUp.Promise((e,r)=>d&&g(d)?e(d):n.get("member","private","token").then(r=>r&&g(r)&&h!==r?(d=r,e(r)):e(t?m(n):null)).catch(r))},E=function(e,t){return b().then(n=>{if(!n)throw new i.Unauthorized("No token for API request. Path="+a(e));const r={key:"446cbc1d6532c596ddc610207ead5576",token:n,...t||{}},o=Object.keys(r).map((function(e){return`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`})).join("&");return`https://trello.com/1/${e}?${o}`})},T=function(){return b().then(e=>e?E("tokens/"+e).then(e=>_(e,"checkToken")):null)};const A=function(e){return b(e,!1).then(e=>e&&g(e)).catch(()=>!1)};let v,y=null;let O;const I={authorize:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window._trello;return b(e,!0)},authorizeSoft:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window._trello;return b(e,!1)},checkToken:T,clearMemory:function(){d=null},ensureTokenValidity:function(e){if(v)return v;if(y&&y>Date.now()-6e4)return TrelloPowerUp.Promise.resolve();const t=i;return y=Date.now(),v=b(e).then(n=>n?T().then(()=>null).catch(t.Unauthorized,t.Forbidden,t.NotFound,()=>(this.clearMemory(),h=n,m(e))).catch(t,e=>{r.captureException(e)}):null).catch(()=>{}).finally(()=>{v=null}),v},getToken:b,getActiveToken:function(){return d},reauthorize:m,registerIfNecessary:function(e,t,n,r){return O||(O=TrelloPowerUp.Promise.all([e.get("member","private","registered",!1),A(e),n.getLocalCommands()]).spread((n,o,a)=>o&&n?null:0!==a.commands.length||t?(e.alert({message:"Powering-Up, give us a moment...",duration:30}),o?n?null:p(e,r).then(()=>e.set("member","private","registered",!0)):f(e).then(()=>n&&!h?null:p(e,r).then(()=>e.set("member","private","registered",!0)))):null).finally(()=>{O=null}),O)},resetToken:f},C={Auth:I,getBoard:function(e,t){return E("boards/"+e,t).then(e=>_(e,"getBoard"))},getCards:function(e,t){return E(`boards/${e}/cards`,t).then(e=>_(e,"getCards"))},getLists:function(e,t){return E(`boards/${e}/lists`,t).then(e=>_(e,"getLists"))},getMe:function(e){return E("members/me",e).then(e=>_(e,"getMe"))},getMember:function(e){return E("members/"+e).then(e=>_(e,"getMember"))},getMyBoards:function(e){return E("members/me/boards",e).then(e=>_(e,"getMyBoards"))},getMyTeams:function(){return E("members/me/organizations").then(e=>_(e,"getMyTeams"))}};window.Auth=I,window.TrelloApi=C,e.exports=C},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return a}));var r=n(4),o=n(3);function a(e,t){try{let o=e;var n=[];let a=0,s=0;var r=" > ".length;let c;for(;o&&a++<5&&(c=i(o,t),!("html"===c||a>1&&s+n.length*r+c.length>=80));)n.push(c),s+=c.length,o=o.parentNode;return n.reverse().join(" > ")}catch(e){return""}}function i(e,t){var n=e,r=[];let a,i,s,c,u;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());var l=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(l&&l.length)l.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push("#"+n.id),a=n.className,a&&Object(o.l)(a))for(i=a.split(/\s+/),u=0;uDate.now()/1e3};var i=Object(o.b)()?function(){try{return Object(o.a)(e,"perf_hooks").performance}catch(e){return}}():function(){const{performance:e}=Object(r.a)();if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),s=void 0===i?a:{nowSeconds:()=>(i.timeOrigin+i.now())/1e3},c=a.nowSeconds.bind(a),u=s.nowSeconds.bind(s);let l;(()=>{const{performance:e}=Object(r.a)();if(e&&e.now){var t=e.now(),n=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+t-n):36e5,a=o<36e5,i=e.timing&&e.timing.navigationStart,s="number"==typeof i?Math.abs(i+t-n):36e5;return a||s<36e5?o<=s?(l="timeOrigin",e.timeOrigin):(l="navigationStart",i):(l="dateNow",n)}l="none"})()}).call(this,n(79)(e))},function(e,t,n){"use strict";function r(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e=t||n<0||_&&e-d>=i}function b(){var e=c();if(g(e))return E(e);u=setTimeout(b,function(e){var n=t-(e-l);return _?D(n,i-(e-d)):n}(e))}function E(e){return u=void 0,f&&o?p(e):(o=a=void 0,s)}function T(){var e=c(),n=g(e);if(o=arguments,a=this,l=e,n){if(void 0===u)return m(l);if(_)return u=setTimeout(b,t),p(l)}return void 0===u&&(u=setTimeout(b,t)),s}return t=C(t)||0,r(n)&&(h=!!n.leading,i=(_="maxWait"in n)?N(C(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),T.cancel=function(){void 0!==u&&clearTimeout(u),d=0,o=l=a=u=void 0},T.flush=function(){return void 0===u?s:E(c())},T};var S=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),w(e,t,{leading:o,maxWait:t,trailing:a})},R=["scroll","resize"],k=["wheel","keydown","keyup","mousedown","mousemove","touchstart","touchmove","click","contextmenu"],M=function(){function e(e){var t=e.timeIntervalEllapsedCallbacks,r=void 0===t?[]:t,o=e.absoluteTimeEllapsedCallbacks,a=void 0===o?[]:o,i=e.checkCallbacksIntervalMs,s=void 0===i?100:i,c=e.browserTabInactiveCallbacks,u=void 0===c?[]:c,l=e.idleCallbacks,d=void 0===l?[]:l,h=e.stopTimerOnTabchange,_=void 0===h||h,f=e.activeCallbacks,p=void 0===f?[]:f,m=e.browserTabActiveCallbacks,g=void 0===m?[]:m,b=e.idleTimeoutMs,E=void 0===b?3e3:b,T=this;this.onBrowserTabInactive=function(){T.isRunning()&&T.stopTimerOnTabchange&&T.stopTimer(),T.browserTabInactiveCallbacks.forEach((function(e){return e(T.getTimeInMilliseconds())}))},this.onBrowserTabActive=function(){T.isRunning()||T.startTimer(),T.browserTabActiveCallbacks.forEach((function(e){return e(T.getTimeInMilliseconds())}))},this.onBrowserActiveChange=function(){"visible"===document.visibilityState?T.onBrowserTabActive():T.onBrowserTabInactive()},this.onTimePassed=function(){T.absoluteTimeEllapsedCallbacks.forEach((function(e,t){var n=e.callback,r=e.pending,o=e.timeInMilliseconds;r&&o<=T.getTimeInMilliseconds()&&(n(T.getTimeInMilliseconds()),T.absoluteTimeEllapsedCallbacks[t].pending=!1)})),T.timeIntervalEllapsedCallbacks.forEach((function(e,t){var n=e.callback,r=e.timeInMilliseconds,o=e.multiplier;r<=T.getTimeInMilliseconds()&&(n(T.getTimeInMilliseconds()),T.timeIntervalEllapsedCallbacks[t].timeInMilliseconds=o(r))})),T.currentIdleTimeMs>=T.idleTimeoutMs&&T.isRunning()?(T.idle=!0,T.stopTimer(),T.idleCallbacks.forEach((function(e){return e(T.getTimeInMilliseconds())}))):T.currentIdleTimeMs+=T.checkCallbacksIntervalMs},this.resetIdleTime=function(){T.idle&&T.startTimer(),T.activeCallbacks.forEach((function(e){return e(T.getTimeInMilliseconds())})),T.idle=!1,T.currentIdleTimeMs=0},this.registerEventListeners=function(){var e={passive:!0},t=n({},e,{capture:!0});document.addEventListener("visibilitychange",T.onBrowserActiveChange);var r=S(T.resetIdleTime,2e3,{leading:!0,trailing:!1});R.forEach((function(e){window.addEventListener(e,r,t)})),k.forEach((function(t){return document.addEventListener(t,r,e)}))},this.unregisterEventListeners=function(){document.removeEventListener("visibilitychange",T.onBrowserActiveChange),R.forEach((function(e){return window.removeEventListener(e,T.resetIdleTime)})),k.forEach((function(e){return document.removeEventListener(e,T.resetIdleTime)}))},this.checkCallbacksOnInterval=function(){T.checkCallbackIntervalId=window.setInterval((function(){T.onTimePassed()}),T.checkCallbacksIntervalMs)},this.startTimer=function(){T.checkCallbackIntervalId||T.checkCallbacksOnInterval();var e=T.times[T.times.length-1];e&&null===e.stop||(T.times.push({start:performance.now(),stop:null}),T.running=!0)},this.stopTimer=function(){T.times.length&&(T.times[T.times.length-1].stop=performance.now(),T.running=!1)},this.addTimeIntervalEllapsedCallback=function(e){T.timeIntervalEllapsedCallbacks.push(e)},this.addAbsoluteTimeEllapsedCallback=function(e){T.absoluteTimeEllapsedCallbacks.push(e)},this.addBrowserTabInactiveCallback=function(e){T.browserTabInactiveCallbacks.push(e)},this.addBrowserTabActiveCallback=function(e){T.browserTabActiveCallbacks.push(e)},this.addIdleCallback=function(e){T.idleCallbacks.push(e)},this.addActiveCallback=function(e){T.activeCallbacks.push(e)},this.getTimeInMilliseconds=function(){return T.times.reduce((function(e,t){return t.stop?e+=t.stop-t.start:e+=performance.now()-t.start,e}),0)},this.isRunning=function(){return T.running},this.isIdle=function(){return T.idle},this.reset=function(){T.times=[]},this.destroy=function(){T.unregisterEventListeners(),T.checkCallbackIntervalId&&window.clearInterval(T.checkCallbackIntervalId)},this.running=!1,this.times=[],this.idle=!1,this.currentIdleTimeMs=0,this.marks={},this.measures={},this.stopTimerOnTabchange=_,this.browserTabActiveCallbacks=g,this.browserTabInactiveCallbacks=u,this.checkCallbacksIntervalMs=s,this.idleTimeoutMs=E,this.timeIntervalEllapsedCallbacks=r,this.absoluteTimeEllapsedCallbacks=a,this.idleCallbacks=d,this.activeCallbacks=p,this.registerEventListeners()}return e.prototype.mark=function(e){this.marks[e]||(this.marks[e]=[]),this.marks[e].push({time:this.getTimeInMilliseconds()})},e.prototype.getMarks=function(e){if(!(this.marks[e].length<1))return this.marks[e]},e.prototype.measure=function(e,t,n){var r=this.marks[t],o=r[r.length-1],a=this.marks[n],i=a[a.length-1];this.measures[e]||(this.measures[e]=[]),this.measures[e].push({name:e,startTime:o.time,duration:i.time-o.time})},e.prototype.getMeasures=function(e){if(this.measures[e]||!(this.measures[e].length<1))return this.measures[e]},e}();t.a=M}).call(this,n(10))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(41).default,o=n(97);e.exports=function(e){var t=o(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(e,r){var o; /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var a="Expected a function",i="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",u="[object Array]",l="[object Boolean]",d="[object Date]",h="[object Error]",_="[object Function]",f="[object GeneratorFunction]",p="[object Map]",m="[object Number]",g="[object Object]",b="[object RegExp]",E="[object Set]",T="[object String]",A="[object Symbol]",v="[object WeakMap]",y="[object ArrayBuffer]",O="[object DataView]",I="[object Float32Array]",C="[object Float64Array]",N="[object Int8Array]",D="[object Int16Array]",w="[object Int32Array]",S="[object Uint8Array]",R="[object Uint16Array]",k="[object Uint32Array]",M=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,x=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,B=RegExp(F.source),$=RegExp(P.source),j=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),z=/^\s+/,q=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ae=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,de=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="[\\ud800-\\udfff]",pe="["+_e+"]",me="["+he+"]",ge="\\d+",be="[\\u2700-\\u27bf]",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",Te="[^\\ud800-\\udfff"+_e+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ae="\\ud83c[\\udffb-\\udfff]",ve="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ie="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+Ee+"|"+Te+")",Ne="(?:"+Ie+"|"+Te+")",De="(?:"+me+"|"+Ae+")"+"?",we="[\\ufe0e\\ufe0f]?"+De+("(?:\\u200d(?:"+[ve,ye,Oe].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*"),Se="(?:"+[be,ye,Oe].join("|")+")"+we,Re="(?:"+[ve+me+"?",me,ye,Oe,fe].join("|")+")",ke=RegExp("['’]","g"),Me=RegExp(me,"g"),Le=RegExp(Ae+"(?="+Ae+")|"+Re+we,"g"),xe=RegExp([Ie+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Ie,"$"].join("|")+")",Ne+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Ie+Ce,"$"].join("|")+")",Ie+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ie+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Se].join("|"),"g"),Fe=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Be=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$e=-1,je={};je[I]=je[C]=je[N]=je[D]=je[w]=je[S]=je["[object Uint8ClampedArray]"]=je[R]=je[k]=!0,je[c]=je[u]=je[y]=je[l]=je[O]=je[d]=je[h]=je[_]=je[p]=je[m]=je[g]=je[b]=je[E]=je[T]=je[v]=!1;var Ue={};Ue[c]=Ue[u]=Ue[y]=Ue[O]=Ue[l]=Ue[d]=Ue[I]=Ue[C]=Ue[N]=Ue[D]=Ue[w]=Ue[p]=Ue[m]=Ue[g]=Ue[b]=Ue[E]=Ue[T]=Ue[A]=Ue[S]=Ue["[object Uint8ClampedArray]"]=Ue[R]=Ue[k]=!0,Ue[h]=Ue[_]=Ue[v]=!1;var He={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ye=parseFloat,Ge=parseInt,We="object"==typeof e&&e&&e.Object===Object&&e,Ve="object"==typeof self&&self&&self.Object===Object&&self,Ke=We||Ve||Function("return this")(),ze=t&&!t.nodeType&&t,qe=ze&&"object"==typeof r&&r&&!r.nodeType&&r,Xe=qe&&qe.exports===ze,Je=Xe&&We.process,Qe=function(){try{var e=qe&&qe.require&&qe.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Ze=Qe&&Qe.isArrayBuffer,et=Qe&&Qe.isDate,tt=Qe&&Qe.isMap,nt=Qe&&Qe.isRegExp,rt=Qe&&Qe.isSet,ot=Qe&&Qe.isTypedArray;function at(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function it(e,t,n,r){for(var o=-1,a=null==e?0:e.length;++o-1}function ht(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function xt(e,t){for(var n=e.length;n--&&At(t,e[n],0)>-1;);return n}function Ft(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Pt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Bt=Ct({"&":"&","<":"<",">":">",'"':""","'":"'"});function $t(e){return"\\"+He[e]}function jt(e){return Fe.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ht(e,t){return function(n){return e(t(n))}}function Yt(e,t){for(var n=-1,r=e.length,o=0,a=[];++n",""":'"',"'":"'"});var Xt=function e(t){var n,r=(t=null==t?Ke:Xt.defaults(Ke.Object(),t,Xt.pick(Ke,Be))).Array,o=t.Date,q=t.Error,he=t.Function,_e=t.Math,fe=t.Object,pe=t.RegExp,me=t.String,ge=t.TypeError,be=r.prototype,Ee=he.prototype,Te=fe.prototype,Ae=t["__core-js_shared__"],ve=Ee.toString,ye=Te.hasOwnProperty,Oe=0,Ie=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ce=Te.toString,Ne=ve.call(fe),De=Ke._,we=pe("^"+ve.call(ye).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=Xe?t.Buffer:void 0,Re=t.Symbol,Le=t.Uint8Array,Fe=Se?Se.allocUnsafe:void 0,He=Ht(fe.getPrototypeOf,fe),We=fe.create,Ve=Te.propertyIsEnumerable,ze=be.splice,qe=Re?Re.isConcatSpreadable:void 0,Je=Re?Re.iterator:void 0,Qe=Re?Re.toStringTag:void 0,bt=function(){try{var e=ta(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ct=t.clearTimeout!==Ke.clearTimeout&&t.clearTimeout,Jt=o&&o.now!==Ke.Date.now&&o.now,Qt=t.setTimeout!==Ke.setTimeout&&t.setTimeout,Zt=_e.ceil,en=_e.floor,tn=fe.getOwnPropertySymbols,nn=Se?Se.isBuffer:void 0,rn=t.isFinite,on=be.join,an=Ht(fe.keys,fe),sn=_e.max,cn=_e.min,un=o.now,ln=t.parseInt,dn=_e.random,hn=be.reverse,_n=ta(t,"DataView"),fn=ta(t,"Map"),pn=ta(t,"Promise"),mn=ta(t,"Set"),gn=ta(t,"WeakMap"),bn=ta(fe,"create"),En=gn&&new gn,Tn={},An=Da(_n),vn=Da(fn),yn=Da(pn),On=Da(mn),In=Da(gn),Cn=Re?Re.prototype:void 0,Nn=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function wn(e){if(Wi(e)&&!Li(e)&&!(e instanceof Mn)){if(e instanceof kn)return e;if(ye.call(e,"__wrapped__"))return wa(e)}return new kn(e)}var Sn=function(){function e(){}return function(t){if(!Gi(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Mn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Jn(e,t,n,r,o,a){var i,s=1&t,u=2&t,h=4&t;if(n&&(i=o?n(e,r,o,a):n(e)),void 0!==i)return i;if(!Gi(e))return e;var v=Li(e);if(v){if(i=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ye.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return Eo(e,i)}else{var M=oa(e),L=M==_||M==f;if(Bi(e))return _o(e,s);if(M==g||M==c||L&&!o){if(i=u||L?{}:ia(e),!s)return u?function(e,t){return To(e,ra(e),t)}(e,function(e,t){return e&&To(t,vs(t),e)}(i,e)):function(e,t){return To(e,na(e),t)}(e,Kn(i,e))}else{if(!Ue[M])return o?e:{};i=function(e,t,n){var r=e.constructor;switch(t){case y:return fo(e);case l:case d:return new r(+e);case O:return function(e,t){var n=t?fo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case C:case N:case D:case w:case S:case"[object Uint8ClampedArray]":case R:case k:return po(e,n);case p:return new r;case m:case T:return new r(e);case b:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new r;case A:return o=e,Nn?fe(Nn.call(o)):{}}var o}(e,M,s)}}a||(a=new Bn);var x=a.get(e);if(x)return x;a.set(e,i),Xi(e)?e.forEach((function(r){i.add(Jn(r,t,n,r,e,a))})):Vi(e)&&e.forEach((function(r,o){i.set(o,Jn(r,t,n,o,e,a))}));var F=v?void 0:(h?u?zo:Ko:u?vs:As)(e);return st(F||e,(function(r,o){F&&(r=e[o=r]),Gn(i,o,Jn(r,t,n,o,e,a))})),i}function Qn(e,t,n){var r=n.length;if(null==e)return!r;for(e=fe(e);r--;){var o=n[r],a=t[o],i=e[o];if(void 0===i&&!(o in e)||!a(i))return!1}return!0}function Zn(e,t,n){if("function"!=typeof e)throw new ge(a);return Aa((function(){e.apply(void 0,n)}),t)}function er(e,t,n,r){var o=-1,a=dt,i=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=_t(t,Rt(n))),r?(a=ht,i=!1):t.length>=200&&(a=Mt,i=!1,t=new Pn(t));e:for(;++o-1},xn.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(fn||xn),string:new Ln}},Fn.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Fn.prototype.get=function(e){return Zo(this,e).get(e)},Fn.prototype.has=function(e){return Zo(this,e).has(e)},Fn.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Pn.prototype.add=Pn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new xn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fn(r)}return n.set(e,t),this.size=n.size,this};var tr=yo(ur),nr=yo(lr,!0);function rr(e,t){var n=!0;return tr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function or(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?ir(s,t-1,n,r,o):ft(o,s):r||(o[o.length]=s)}return o}var sr=Oo(),cr=Oo(!0);function ur(e,t){return e&&sr(e,t,As)}function lr(e,t){return e&&cr(e,t,As)}function dr(e,t){return lt(t,(function(t){return Ui(e[t])}))}function hr(e,t){for(var n=0,r=(t=co(t,e)).length;null!=e&&nt}function mr(e,t){return null!=e&&ye.call(e,t)}function gr(e,t){return null!=e&&t in fe(e)}function br(e,t,n){for(var o=n?ht:dt,a=e[0].length,i=e.length,s=i,c=r(i),u=1/0,l=[];s--;){var d=e[s];s&&t&&(d=_t(d,Rt(t))),u=cn(d.length,u),c[s]=!n&&(t||a>=120&&d.length>=120)?new Pn(s&&d):void 0}d=e[0];var h=-1,_=c[0];e:for(;++h=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)}))}function Lr(e,t,n){for(var r=-1,o=t.length,a={};++r-1;)s!==e&&ze.call(s,c,1),ze.call(e,c,1);return e}function Fr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==a){var a=o;ca(o)?ze.call(e,o,1):eo(e,o)}}return e}function Pr(e,t){return e+en(dn()*(t-e+1))}function Br(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function $r(e,t){return va(ma(e,t,Ks),e+"")}function jr(e){return jn(Ss(e))}function Ur(e,t){var n=Ss(e);return Ia(n,Xn(t,0,n.length))}function Hr(e,t,n,r){if(!Gi(e))return e;for(var o=-1,a=(t=co(t,e)).length,i=a-1,s=e;null!=s&&++oa?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var i=r(a);++o>>1,i=e[a];null!==i&&!Qi(i)&&(n?i<=t:i=200){var u=t?null:$o(e);if(u)return Gt(u);i=!1,o=Mt,c=new Pn}else c=t?[]:s;e:for(;++r=r?e:Vr(e,t,n)}var ho=Ct||function(e){return Ke.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var n=e.length,r=Fe?Fe(n):new e.constructor(n);return e.copy(r),r}function fo(e){var t=new e.constructor(e.byteLength);return new Le(t).set(new Le(e)),t}function po(e,t){var n=t?fo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,a=Qi(e),i=void 0!==t,s=null===t,c=t==t,u=Qi(t);if(!s&&!u&&!a&&e>t||a&&i&&c&&!s&&!u||r&&i&&c||!n&&c||!o)return 1;if(!r&&!a&&!u&&e1?n[o-1]:void 0,i=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(n[0],n[1],i)&&(a=o<3?void 0:a,o=1),t=fe(t);++r-1?o[a?t[i]:i]:void 0}}function wo(e){return Vo((function(t){var n=t.length,r=n,o=kn.prototype.thru;for(e&&t.reverse();r--;){var i=t[r];if("function"!=typeof i)throw new ge(a);if(o&&!s&&"wrapper"==Xo(i))var s=new kn([],!0)}for(r=s?r:n;++r1&&E.reverse(),d&&us))return!1;var u=a.get(e),l=a.get(t);if(u&&l)return u==t&&l==e;var d=-1,h=!0,_=2&n?new Pn:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return st(s,(function(n){var r="_."+n[0];t&n[1]&&!dt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(Q):[]}(r),n)))}function Oa(e){var t=0,n=0;return function(){var r=un(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ia(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qa(e,n)}));function ni(e){var t=wn(e);return t.__chain__=!0,t}function ri(e,t){return t(e)}var oi=Vo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Mn&&ca(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new kn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var ai=Ao((function(e,t,n){ye.call(e,n)?++e[n]:zn(e,n,1)}));var ii=Do(Ma),si=Do(La);function ci(e,t){return(Li(e)?st:tr)(e,Qo(t,3))}function ui(e,t){return(Li(e)?ct:nr)(e,Qo(t,3))}var li=Ao((function(e,t,n){ye.call(e,n)?e[n].push(t):zn(e,n,[t])}));var di=$r((function(e,t,n){var o=-1,a="function"==typeof t,i=Fi(e)?r(e.length):[];return tr(e,(function(e){i[++o]=a?at(t,e,n):Er(e,t,n)})),i})),hi=Ao((function(e,t,n){zn(e,n,t)}));function _i(e,t){return(Li(e)?_t:Dr)(e,Qo(t,3))}var fi=Ao((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var pi=$r((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ua(e,t[0],t[1])?t=[]:n>2&&ua(t[0],t[1],t[2])&&(t=[t[0]]),Mr(e,ir(t,1),[])})),mi=Jt||function(){return Ke.Date.now()};function gi(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function bi(e,t){var n;if("function"!=typeof t)throw new ge(a);return e=os(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var Ei=$r((function(e,t,n){var r=1;if(n.length){var o=Yt(n,Jo(Ei));r|=32}return Uo(e,r,t,n,o)})),Ti=$r((function(e,t,n){var r=3;if(n.length){var o=Yt(n,Jo(Ti));r|=32}return Uo(t,r,e,n,o)}));function Ai(e,t,n){var r,o,i,s,c,u,l=0,d=!1,h=!1,_=!0;if("function"!=typeof e)throw new ge(a);function f(t){var n=r,a=o;return r=o=void 0,l=t,s=e.apply(a,n)}function p(e){return l=e,c=Aa(g,t),d?f(e):s}function m(e){var n=e-u;return void 0===u||n>=t||n<0||h&&e-l>=i}function g(){var e=mi();if(m(e))return b(e);c=Aa(g,function(e){var n=t-(e-u);return h?cn(n,i-(e-l)):n}(e))}function b(e){return c=void 0,_&&r?f(e):(r=o=void 0,s)}function E(){var e=mi(),n=m(e);if(r=arguments,o=this,u=e,n){if(void 0===c)return p(u);if(h)return ho(c),c=Aa(g,t),f(u)}return void 0===c&&(c=Aa(g,t)),s}return t=is(t)||0,Gi(n)&&(d=!!n.leading,i=(h="maxWait"in n)?sn(is(n.maxWait)||0,t):i,_="trailing"in n?!!n.trailing:_),E.cancel=function(){void 0!==c&&ho(c),l=0,r=u=o=c=void 0},E.flush=function(){return void 0===c?s:b(mi())},E}var vi=$r((function(e,t){return Zn(e,1,t)})),yi=$r((function(e,t,n){return Zn(e,is(t)||0,n)}));function Oi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(a);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(Oi.Cache||Fn),n}function Ii(e){if("function"!=typeof e)throw new ge(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Oi.Cache=Fn;var Ci=uo((function(e,t){var n=(t=1==t.length&&Li(t[0])?_t(t[0],Rt(Qo())):_t(ir(t,1),Rt(Qo()))).length;return $r((function(r){for(var o=-1,a=cn(r.length,n);++o=t})),Mi=Tr(function(){return arguments}())?Tr:function(e){return Wi(e)&&ye.call(e,"callee")&&!Ve.call(e,"callee")},Li=r.isArray,xi=Ze?Rt(Ze):function(e){return Wi(e)&&fr(e)==y};function Fi(e){return null!=e&&Yi(e.length)&&!Ui(e)}function Pi(e){return Wi(e)&&Fi(e)}var Bi=nn||ic,$i=et?Rt(et):function(e){return Wi(e)&&fr(e)==d};function ji(e){if(!Wi(e))return!1;var t=fr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!zi(e)}function Ui(e){if(!Gi(e))return!1;var t=fr(e);return t==_||t==f||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Hi(e){return"number"==typeof e&&e==os(e)}function Yi(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Gi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wi(e){return null!=e&&"object"==typeof e}var Vi=tt?Rt(tt):function(e){return Wi(e)&&oa(e)==p};function Ki(e){return"number"==typeof e||Wi(e)&&fr(e)==m}function zi(e){if(!Wi(e)||fr(e)!=g)return!1;var t=He(e);if(null===t)return!0;var n=ye.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ve.call(n)==Ne}var qi=nt?Rt(nt):function(e){return Wi(e)&&fr(e)==b};var Xi=rt?Rt(rt):function(e){return Wi(e)&&oa(e)==E};function Ji(e){return"string"==typeof e||!Li(e)&&Wi(e)&&fr(e)==T}function Qi(e){return"symbol"==typeof e||Wi(e)&&fr(e)==A}var Zi=ot?Rt(ot):function(e){return Wi(e)&&Yi(e.length)&&!!je[fr(e)]};var es=Fo(Nr),ts=Fo((function(e,t){return e<=t}));function ns(e){if(!e)return[];if(Fi(e))return Ji(e)?Kt(e):Eo(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=oa(e);return(t==p?Ut:t==E?Gt:Ss)(e)}function rs(e){return e?(e=is(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function os(e){var t=rs(e),n=t%1;return t==t?n?t-n:t:0}function as(e){return e?Xn(os(e),0,4294967295):0}function is(e){if("number"==typeof e)return e;if(Qi(e))return NaN;if(Gi(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gi(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=St(e);var n=ae.test(e);return n||se.test(e)?Ge(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function ss(e){return To(e,vs(e))}function cs(e){return null==e?"":Qr(e)}var us=vo((function(e,t){if(_a(t)||Fi(t))To(t,As(t),e);else for(var n in t)ye.call(t,n)&&Gn(e,n,t[n])})),ls=vo((function(e,t){To(t,vs(t),e)})),ds=vo((function(e,t,n,r){To(t,vs(t),e,r)})),hs=vo((function(e,t,n,r){To(t,As(t),e,r)})),_s=Vo(qn);var fs=$r((function(e,t){e=fe(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&ua(t[0],t[1],o)&&(r=1);++n1),t})),To(e,zo(e),n),r&&(n=Jn(n,7,Go));for(var o=t.length;o--;)eo(n,t[o]);return n}));var Cs=Vo((function(e,t){return null==e?{}:function(e,t){return Lr(e,t,(function(t,n){return gs(e,n)}))}(e,t)}));function Ns(e,t){if(null==e)return{};var n=_t(zo(e),(function(e){return[e]}));return t=Qo(t),Lr(e,n,(function(e,n){return t(e,n[0])}))}var Ds=jo(As),ws=jo(vs);function Ss(e){return null==e?[]:kt(e,As(e))}var Rs=Co((function(e,t,n){return t=t.toLowerCase(),e+(n?ks(t):t)}));function ks(e){return js(cs(e).toLowerCase())}function Ms(e){return(e=cs(e))&&e.replace(ue,Pt).replace(Me,"")}var Ls=Co((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),xs=Co((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Fs=Io("toLowerCase");var Ps=Co((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Bs=Co((function(e,t,n){return e+(n?" ":"")+js(t)}));var $s=Co((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),js=Io("toUpperCase");function Us(e,t,n){return e=cs(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Hs=$r((function(e,t){try{return at(e,void 0,t)}catch(e){return ji(e)?e:new q(e)}})),Ys=Vo((function(e,t){return st(t,(function(t){t=Na(t),zn(e,t,Ei(e[t],e))})),e}));function Gs(e){return function(){return e}}var Ws=wo(),Vs=wo(!0);function Ks(e){return e}function zs(e){return Or("function"==typeof e?e:Jn(e,1))}var qs=$r((function(e,t){return function(n){return Er(n,e,t)}})),Xs=$r((function(e,t){return function(n){return Er(e,n,t)}}));function Js(e,t,n){var r=As(t),o=dr(t,r);null!=n||Gi(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=dr(t,As(t)));var a=!(Gi(n)&&"chain"in n&&!n.chain),i=Ui(e);return st(o,(function(n){var r=t[n];e[n]=r,i&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),o=n.__actions__=Eo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ft([this.value()],arguments))})})),e}function Qs(){}var Zs=Mo(_t),ec=Mo(ut),tc=Mo(gt);function nc(e){return la(e)?It(Na(e)):function(e){return function(t){return hr(t,e)}}(e)}var rc=xo(),oc=xo(!0);function ac(){return[]}function ic(){return!1}var sc=ko((function(e,t){return e+t}),0),cc=Bo("ceil"),uc=ko((function(e,t){return e/t}),1),lc=Bo("floor");var dc,hc=ko((function(e,t){return e*t}),1),_c=Bo("round"),fc=ko((function(e,t){return e-t}),0);return wn.after=function(e,t){if("function"!=typeof t)throw new ge(a);return e=os(e),function(){if(--e<1)return t.apply(this,arguments)}},wn.ary=gi,wn.assign=us,wn.assignIn=ls,wn.assignInWith=ds,wn.assignWith=hs,wn.at=_s,wn.before=bi,wn.bind=Ei,wn.bindAll=Ys,wn.bindKey=Ti,wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Li(e)?e:[e]},wn.chain=ni,wn.chunk=function(e,t,n){t=(n?ua(e,t,n):void 0===t)?1:sn(os(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,i=0,s=r(Zt(o/t));ao?0:o+n),(r=void 0===r||r>o?o:os(r))<0&&(r+=o),r=n>r?0:as(r);n>>0)?(e=cs(e))&&("string"==typeof t||null!=t&&!qi(t))&&!(t=Qr(t))&&jt(e)?lo(Kt(e),0,n):e.split(t,n):[]},wn.spread=function(e,t){if("function"!=typeof e)throw new ge(a);return t=null==t?0:sn(os(t),0),$r((function(n){var r=n[t],o=lo(n,0,t);return r&&ft(o,r),at(e,this,o)}))},wn.tail=function(e){var t=null==e?0:e.length;return t?Vr(e,1,t):[]},wn.take=function(e,t,n){return e&&e.length?Vr(e,0,(t=n||void 0===t?1:os(t))<0?0:t):[]},wn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Vr(e,(t=r-(t=n||void 0===t?1:os(t)))<0?0:t,r):[]},wn.takeRightWhile=function(e,t){return e&&e.length?no(e,Qo(t,3),!1,!0):[]},wn.takeWhile=function(e,t){return e&&e.length?no(e,Qo(t,3)):[]},wn.tap=function(e,t){return t(e),e},wn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new ge(a);return Gi(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ai(e,t,{leading:r,maxWait:t,trailing:o})},wn.thru=ri,wn.toArray=ns,wn.toPairs=Ds,wn.toPairsIn=ws,wn.toPath=function(e){return Li(e)?_t(e,Na):Qi(e)?[e]:Eo(Ca(cs(e)))},wn.toPlainObject=ss,wn.transform=function(e,t,n){var r=Li(e),o=r||Bi(e)||Zi(e);if(t=Qo(t,4),null==n){var a=e&&e.constructor;n=o?r?new a:[]:Gi(e)&&Ui(a)?Sn(He(e)):{}}return(o?st:ur)(e,(function(e,r,o){return t(n,e,r,o)})),n},wn.unary=function(e){return gi(e,1)},wn.union=Wa,wn.unionBy=Va,wn.unionWith=Ka,wn.uniq=function(e){return e&&e.length?Zr(e):[]},wn.uniqBy=function(e,t){return e&&e.length?Zr(e,Qo(t,2)):[]},wn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},wn.unset=function(e,t){return null==e||eo(e,t)},wn.unzip=za,wn.unzipWith=qa,wn.update=function(e,t,n){return null==e?e:to(e,t,so(n))},wn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:to(e,t,so(n),r)},wn.values=Ss,wn.valuesIn=function(e){return null==e?[]:kt(e,vs(e))},wn.without=Xa,wn.words=Us,wn.wrap=function(e,t){return Ni(so(t),e)},wn.xor=Ja,wn.xorBy=Qa,wn.xorWith=Za,wn.zip=ei,wn.zipObject=function(e,t){return ao(e||[],t||[],Gn)},wn.zipObjectDeep=function(e,t){return ao(e||[],t||[],Hr)},wn.zipWith=ti,wn.entries=Ds,wn.entriesIn=ws,wn.extend=ls,wn.extendWith=ds,Js(wn,wn),wn.add=sc,wn.attempt=Hs,wn.camelCase=Rs,wn.capitalize=ks,wn.ceil=cc,wn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=is(n))==n?n:0),void 0!==t&&(t=(t=is(t))==t?t:0),Xn(is(e),t,n)},wn.clone=function(e){return Jn(e,4)},wn.cloneDeep=function(e){return Jn(e,5)},wn.cloneDeepWith=function(e,t){return Jn(e,5,t="function"==typeof t?t:void 0)},wn.cloneWith=function(e,t){return Jn(e,4,t="function"==typeof t?t:void 0)},wn.conformsTo=function(e,t){return null==t||Qn(e,t,As(t))},wn.deburr=Ms,wn.defaultTo=function(e,t){return null==e||e!=e?t:e},wn.divide=uc,wn.endsWith=function(e,t,n){e=cs(e),t=Qr(t);var r=e.length,o=n=void 0===n?r:Xn(os(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},wn.eq=Si,wn.escape=function(e){return(e=cs(e))&&$.test(e)?e.replace(P,Bt):e},wn.escapeRegExp=function(e){return(e=cs(e))&&K.test(e)?e.replace(V,"\\$&"):e},wn.every=function(e,t,n){var r=Li(e)?ut:rr;return n&&ua(e,t,n)&&(t=void 0),r(e,Qo(t,3))},wn.find=ii,wn.findIndex=Ma,wn.findKey=function(e,t){return Et(e,Qo(t,3),ur)},wn.findLast=si,wn.findLastIndex=La,wn.findLastKey=function(e,t){return Et(e,Qo(t,3),lr)},wn.floor=lc,wn.forEach=ci,wn.forEachRight=ui,wn.forIn=function(e,t){return null==e?e:sr(e,Qo(t,3),vs)},wn.forInRight=function(e,t){return null==e?e:cr(e,Qo(t,3),vs)},wn.forOwn=function(e,t){return e&&ur(e,Qo(t,3))},wn.forOwnRight=function(e,t){return e&&lr(e,Qo(t,3))},wn.get=ms,wn.gt=Ri,wn.gte=ki,wn.has=function(e,t){return null!=e&&aa(e,t,mr)},wn.hasIn=gs,wn.head=Fa,wn.identity=Ks,wn.includes=function(e,t,n,r){e=Fi(e)?e:Ss(e),n=n&&!r?os(n):0;var o=e.length;return n<0&&(n=sn(o+n,0)),Ji(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&At(e,t,n)>-1},wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:os(n);return o<0&&(o=sn(r+o,0)),At(e,t,o)},wn.inRange=function(e,t,n){return t=rs(t),void 0===n?(n=t,t=0):n=rs(n),function(e,t,n){return e>=cn(t,n)&&e=-9007199254740991&&e<=9007199254740991},wn.isSet=Xi,wn.isString=Ji,wn.isSymbol=Qi,wn.isTypedArray=Zi,wn.isUndefined=function(e){return void 0===e},wn.isWeakMap=function(e){return Wi(e)&&oa(e)==v},wn.isWeakSet=function(e){return Wi(e)&&"[object WeakSet]"==fr(e)},wn.join=function(e,t){return null==e?"":on.call(e,t)},wn.kebabCase=Ls,wn.last=ja,wn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=os(n))<0?sn(r+o,0):cn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Tt(e,yt,o,!0)},wn.lowerCase=xs,wn.lowerFirst=Fs,wn.lt=es,wn.lte=ts,wn.max=function(e){return e&&e.length?or(e,Ks,pr):void 0},wn.maxBy=function(e,t){return e&&e.length?or(e,Qo(t,2),pr):void 0},wn.mean=function(e){return Ot(e,Ks)},wn.meanBy=function(e,t){return Ot(e,Qo(t,2))},wn.min=function(e){return e&&e.length?or(e,Ks,Nr):void 0},wn.minBy=function(e,t){return e&&e.length?or(e,Qo(t,2),Nr):void 0},wn.stubArray=ac,wn.stubFalse=ic,wn.stubObject=function(){return{}},wn.stubString=function(){return""},wn.stubTrue=function(){return!0},wn.multiply=hc,wn.nth=function(e,t){return e&&e.length?kr(e,os(t)):void 0},wn.noConflict=function(){return Ke._===this&&(Ke._=De),this},wn.noop=Qs,wn.now=mi,wn.pad=function(e,t,n){e=cs(e);var r=(t=os(t))?Vt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Lo(en(o),n)+e+Lo(Zt(o),n)},wn.padEnd=function(e,t,n){e=cs(e);var r=(t=os(t))?Vt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=dn();return cn(e+o*(t-e+Ye("1e-"+((o+"").length-1))),t)}return Pr(e,t)},wn.reduce=function(e,t,n){var r=Li(e)?pt:Nt,o=arguments.length<3;return r(e,Qo(t,4),n,o,tr)},wn.reduceRight=function(e,t,n){var r=Li(e)?mt:Nt,o=arguments.length<3;return r(e,Qo(t,4),n,o,nr)},wn.repeat=function(e,t,n){return t=(n?ua(e,t,n):void 0===t)?1:os(t),Br(cs(e),t)},wn.replace=function(){var e=arguments,t=cs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},wn.result=function(e,t,n){var r=-1,o=(t=co(t,e)).length;for(o||(o=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=cn(e,4294967295);e-=4294967295;for(var o=wt(r,t=Qo(t));++n=a)return e;var s=n-Vt(r);if(s<1)return r;var c=i?lo(i,0,s).join(""):e.slice(0,s);if(void 0===o)return c+r;if(i&&(s+=c.length-s),qi(o)){if(e.slice(s).search(o)){var u,l=c;for(o.global||(o=pe(o.source,cs(re.exec(o))+"g")),o.lastIndex=0;u=o.exec(l);)var d=u.index;c=c.slice(0,void 0===d?s:d)}}else if(e.indexOf(Qr(o),s)!=s){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r},wn.unescape=function(e){return(e=cs(e))&&B.test(e)?e.replace(F,qt):e},wn.uniqueId=function(e){var t=++Oe;return cs(e)+t},wn.upperCase=$s,wn.upperFirst=js,wn.each=ci,wn.eachRight=ui,wn.first=Fa,Js(wn,(dc={},ur(wn,(function(e,t){ye.call(wn.prototype,t)||(dc[t]=e)})),dc),{chain:!1}),wn.VERSION="4.17.21",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){wn[e].placeholder=wn})),st(["drop","take"],(function(e,t){Mn.prototype[e]=function(n){n=void 0===n?1:sn(os(n),0);var r=this.__filtered__&&!t?new Mn(this):this.clone();return r.__filtered__?r.__takeCount__=cn(n,r.__takeCount__):r.__views__.push({size:cn(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Mn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Mn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Qo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Mn.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Mn.prototype[e]=function(){return this.__filtered__?new Mn(this):this[n](1)}})),Mn.prototype.compact=function(){return this.filter(Ks)},Mn.prototype.find=function(e){return this.filter(e).head()},Mn.prototype.findLast=function(e){return this.reverse().find(e)},Mn.prototype.invokeMap=$r((function(e,t){return"function"==typeof e?new Mn(this):this.map((function(n){return Er(n,e,t)}))})),Mn.prototype.reject=function(e){return this.filter(Ii(Qo(e)))},Mn.prototype.slice=function(e,t){e=os(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Mn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=os(t))<0?n.dropRight(-t):n.take(t-e)),n)},Mn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Mn.prototype.toArray=function(){return this.take(4294967295)},ur(Mn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=wn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(wn.prototype[t]=function(){var t=this.__wrapped__,i=r?[1]:arguments,s=t instanceof Mn,c=i[0],u=s||Li(t),l=function(e){var t=o.apply(wn,ft([e],i));return r&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(s=u=!1);var d=this.__chain__,h=!!this.__actions__.length,_=a&&!d,f=s&&!h;if(!a&&u){t=f?t:new Mn(this);var p=e.apply(t,i);return p.__actions__.push({func:ri,args:[l],thisArg:void 0}),new kn(p,d)}return _&&f?e.apply(this,i):(p=this.thru(l),_?r?p.value()[0]:p.value():p)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Li(o)?o:[],e)}return this[n]((function(n){return t.apply(Li(n)?n:[],e)}))}})),ur(Mn.prototype,(function(e,t){var n=wn[t];if(n){var r=n.name+"";ye.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}})),Tn[So(void 0,2).name]=[{name:"wrapper",func:void 0}],Mn.prototype.clone=function(){var e=new Mn(this.__wrapped__);return e.__actions__=Eo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Eo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Eo(this.__views__),e},Mn.prototype.reverse=function(){if(this.__filtered__){var e=new Mn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Mn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Li(e),r=t<0,o=n?e.length:0,a=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},wn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var r=wa(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Mn){var t=e;return this.__actions__.length&&(t=new Mn(this)),(t=t.reverse()).__actions__.push({func:ri,args:[Ga],thisArg:void 0}),new kn(t,this.__chain__)}return this.thru(Ga)},wn.prototype.toJSON=wn.prototype.valueOf=wn.prototype.value=function(){return ro(this.__wrapped__,this.__actions__)},wn.prototype.first=wn.prototype.head,Je&&(wn.prototype[Je]=function(){return this}),wn}();Ke._=Xt,void 0===(o=function(){return Xt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(10),n(90)(e))},,,function(e,t,n){!function(){var e,r;function o(e){return e.replace(/<[^>]*>?/gi,c)}e=t,r=n(96).Converter,e.getSanitizingConverter=function(){var e=new r;return e.hooks.chain("postConversion",o),e.hooks.chain("postConversion",u),e};var a=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol(?: start="\d+")?|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,i=/^(]+")?\s?>|<\/a>)$/i,s=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i;function c(e){if(e.match(a)||e.match(i)||e.match(s))return e;var t=!1,n=e.replace(/^(]*(\s|$|>)/g,o=e.toLowerCase().match(r),a=(o||[]).length;if(0==a)return e;for(var i,s=[],c=[],u=!1,l=0;l

  • ".search("<"+t+">")>-1)){if(n=o[l],i=-1,!/^<\//.test(n))for(var d=l+1;d"){i=d;break}-1==i?u=c[l]=!0:s[i]=!0}if(!u)return e;l=0;return e=e.replace(r,(function(e){var t=c[l]?"":e;return l++,t}))}}()},function(e,t,n){"use strict";var r;r=t,function(){function e(e){return e}function t(e){return!1}function n(){}function o(){}n.prototype={chain:function(t,n){var r=this[t];if(!r)throw new Error("unknown hook "+t);this[t]=r===e?n:function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},r.HookCollection=n,o.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},r.Converter=function(t){var r,a,i,s,c=this.hooks=new n;c.addNoop("plainLinkText"),c.addNoop("preConversion"),c.addNoop("postNormalization"),c.addNoop("preBlockGamut"),c.addNoop("postBlockGamut"),c.addNoop("preSpanGamut"),c.addNoop("postSpanGamut"),c.addNoop("postConversion");var u,l,d,h,_,f=e,p=e;(t=t||{}).nonAsciiLetters&&(u=/[Q\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua67f-\ua697\ua717-\ua71f\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe33-\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]/g,l="Q".charCodeAt(0),d="A".charCodeAt(0),h="Z".charCodeAt(0),_="a".charCodeAt(0)-h-1,f=function(e){return e.replace(u,(function(e){for(var t,n=e.charCodeAt(0),r="";n>0;)(t=n%51+d)>=l&&t++,t>h&&(t+=_),r=String.fromCharCode(t)+r,n=n/51|0;return"Q"+r+"Q"}))},p=function(e){return e.replace(/Q([A-PR-Za-z]{1,3})Q/g,(function(e,t){for(var n,r=0,o=0;oh&&(n-=_),n>l&&n--,r=51*r+(n-=d);return String.fromCharCode(r)}))});var m=t.asteriskIntraWordEmphasis?function(e){return-1===e.indexOf("*")&&-1===e.indexOf("_")?e:(e=(e=(e=f(e)).replace(/(?=[^\r][*_]|[*_])(^|(?=\W__|(?!\*)[\W_]\*\*|\w\*\*\w)[^\r])(\*\*|__)(?!\2)(?=\S)((?:|[^\r]*?(?!\2)[^\r])(?=\S_|\w|\S\*\*(?:[\W_]|$)).)(?=__(?:\W|$)|\*\*(?:[^*]|$))\2/g,"$1$3")).replace(/(?=[^\r][*_]|[*_])(^|(?=\W_|(?!\*)(?:[\W_]\*|\D\*(?=\w)\D))[^\r])(\*|_)(?!\2\2\2)(?=\S)((?:(?!\2)[^\r])*?(?=[^\s_]_|(?=\w)\D\*\D|[^\s*]\*(?:[\W_]|$)).)(?=_(?:\W|$)|\*(?:[^*]|$))\2/g,"$1$3"),p(e))}:function(e){return-1===e.indexOf("*")&&-1===e.indexOf("_")?e:(e=(e=(e=f(e)).replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)\2(?=\S)([^\r]*?\S)\2\2(?!\2)(?=[\W_]|$)/g,"$1$3")).replace(/(^|[\W_])(?:(?!\1)|(?=^))(\*|_)(?=\S)((?:(?!\2)[^\r])*?\S)\2(?!\2)(?=[\W_]|$)/g,"$1$3"),p(e))};function g(e){return e=(e=(e=(e=(e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,E)).replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,E)).replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,E)).replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,E)).replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,E)}function b(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(i.push(e)-1)+"K\n\n"}function E(e,t){return b(t)}this.makeHtml=function(e){if(r)throw new Error("Recursive call to converter.makeHtml");return r=new o,a=new o,i=[],s=0,e=(e=L(e="\n\n"+(e=(e=(e=(e=(e=c.preConversion(e)).replace(/~/g,"~T")).replace(/\$/g,"~D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n"))+"\n\n")).replace(/^[ \t]+$/gm,""),e=(e=(e=function(e){return e=e.replace(/~E(\d+)E/g,(function(e,t){var n=parseInt(t);return String.fromCharCode(n)}))}(e=A(e=function(e){return e=e.replace(/^[ ]{0,3}\[([^\[\]]+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(\n+)/gm,(function(e,t,n,o,i,s,c){return t=t.toLowerCase(),r.set(t,w(n)),i?o+c:(s&&a.set(t,s.replace(/"/g,""")),"")}))}(e=g(e=c.postNormalization(e)))))).replace(/~D/g,"$$")).replace(/~T/g,"~"),e=c.postConversion(e),i=a=r=null,e};var T=function(e){return A(e)};function A(e,t,n){return e=function(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,(function(e,t){var n=t;return b("
    \n"+(n=(n=(n=A(n=(n=(n=n.replace(/^[ \t]*>[ \t]?/gm,"~0")).replace(/~0/g,"")).replace(/^[ \t]+$/gm,""))).replace(/(^|\n)/g,"$1 ")).replace(/(\s*
    [^\r]+?<\/pre>)/gm,(function(e,t){var n=t;return n=(n=n.replace(/^  /gm,"~0")).replace(/~0/g,"")})))+"\n
    ")}))}(e=function(e){return e=(e=(e+="~0").replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,(function(e,t,n){var r=t,o=n;return"\n\n"+(r="
    "+(r=(r=(r=L(r=D(M(r)))).replace(/^\n+/g,"")).replace(/\n+$/g,""))+"\n
    ")+"\n\n"+o}))).replace(/~0/,"")}(e=function(e,t){e+="~0";var n=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;s?e=e.replace(n,(function(e,n,r){var o,a=n,i=r.search(/[*+-]/g)>-1?"ul":"ol";"ol"===i&&(o=parseInt(r,10));var s=N(a,i,t),c="<"+i;return o&&1!==o&&(c+=' start="'+o+'"'),s=c+">"+(s=s.replace(/\s+$/,""))+"\n"})):(n=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(n,(function(e,t,n,r){var o,a=t,i=n,s=r.search(/[*+-]/g)>-1?"ul":"ol";"ol"===s&&(o=parseInt(r,10));var c=N(i,s),u="<"+s;return o&&1!==o&&(u+=' start="'+o+'"'),c=a+u+">\n"+c+"\n"})));return e=e.replace(/~0/,"")}(e=(e=(e=(e=function(e){return e=(e=(e=e.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,(function(e,t){return"

    "+v(t)+"

    \n\n"}))).replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,(function(e,t){return"

    "+v(t)+"

    \n\n"}))).replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,(function(e,t,n){var r=t.length;return""+v(n)+"\n\n"}))}(e=c.preBlockGamut(e,T))).replace(/^[ ]{0,2}( ?\*){3,}[ \t]*$/gm,"
    \n")).replace(/^[ ]{0,2}( ?-){3,}[ \t]*$/gm,"
    \n")).replace(/^[ ]{0,2}( ?_){3,}[ \t]*$/gm,"
    \n")))),e=function(e,t,n){for(var r=(e=(e=e.replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],a=/~K(\d+)K/,s=r.length,c=0;c"),n||(u+="

    "),o.push(u))}if(!t){s=o.length;for(c=0;c\s]+)>/gi,(function(e,t){return'
    '+c.plainLinkText(t)+""}))}(e=function(e){return-1===e.indexOf("[")?e:e=(e=(e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,y)).replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,y)).replace(/(\[([^\[\]]+)\])()()()()()/g,y)}(e=function(e){return-1===e.indexOf("![")?e:e=(e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,I)).replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,I)}(e=function(e){return e=(e=e.replace(/\\(\\)/g,P)).replace(/\\([`*_{}\[\]()>#+-.!])/g,P)}(e=function(e){return e=e.replace(/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi,(function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=F(t,"!"==e.charAt(1)?"\\`*_/":"\\`*_")}))}(e=function(e){return e=e.replace(/(^|[^\\`])(`+)(?!`)([^\r]*?[^`])\2(?!`)/gm,(function(e,t,n,r,o){var a=r;return t+""+(a=(a=D(a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""))).replace(/:\/\//g,"~P"))+""}))}(e=c.preSpanGamut(e)))))))).replace(/~P/g,"://")),e=(e=m(e)).replace(/ +\n/g,"
    \n"),e=c.postSpanGamut(e)}function y(e,t,n,o,i,s,c,u){null==u&&(u="");var l=t,d=n.replace(/:\/\//g,"~P"),h=o.toLowerCase(),_=i,f=u;if(""==_)if(""==h&&(h=d.toLowerCase().replace(/ ?\n/g," ")),_="#"+h,null!=r.get(h))_=r.get(h),null!=a.get(h)&&(f=a.get(h));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;_=""}var p='"}function O(e){return e.replace(/>/g,">").replace(/"}var C={ol:"\\d+[.]",ul:"[*+-]"};function N(e,t,n){s++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var r=C[t],o=new RegExp("(^[ \\t]*)("+r+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+r+")[ \\t]+))","gm"),a=!1;return e=(e=e.replace(o,(function(e,t,n,r){var o=r,i=/\n\n$/.test(o),s=i||o.search(/\n{2,}/)>-1||a;return o=A(M(o),!0,!s),a=i,"
  • "+o+"
  • \n"}))).replace(/~0/g,""),s--,e}function D(e){return e=F(e=(e=(e=e.replace(/&/g,"&")).replace(//g,">"),"*_{}[]\\",!1)}function w(e){return e=(e=e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?!]|~D)/gi,"<")}var S=new RegExp('(="|<)?\\b(https?|ftp)(://[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]*[-A-Z0-9+&@#/%=~_|[\\])])(?=$|\\W)',"gi"),R=new RegExp("[-A-Z0-9+&@#/%=~_|[\\])]","i");function k(e,t,n,r){if(t)return e;if(")"!==r.charAt(r.length-1))return"<"+n+r+">";for(var o=r.match(/[()]/g),a=0,i=0;i"+s}function M(e){return e=(e=e.replace(/^(\t|[ ]{1,4})/gm,"~0")).replace(/~0/g,"")}function L(e){if(!/\t/.test(e))return e;var t,n=[" "," "," "," "],r=0;return e.replace(/[\n\t]/g,(function(e,o){return"\n"===e?(r=o+1,e):(t=(o-r)%4,r=o+1,n[t])}))}function x(e){return e=F(e=O(e),"*_:()[]")}function F(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var o=new RegExp(r,"g");return e=e.replace(o,P)}function P(e,t){return"~E"+t.charCodeAt(0)+"E"}}}()},function(e,t,n){var r=n(41).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;t.parse=function(e){var t=[1,5,6,7,11,12],n=r.exec(e),o=0;if(!n)return new Date(e);for(var a,i=0;a=t[i];i++)n[a]=parseInt(n[a],10)||0;n[2]=parseInt(n[2],10)||1,n[3]=parseInt(n[3],10)||1,n[2]--,n[8]=n[8]?(n[8]+"00").substring(0,3):0," "===n[4]?o=(new Date).getTimezoneOffset():"Z"!==n[9]&&n[10]&&(o=60*n[11]+n[12],"+"===n[10]&&(o=0-o));var s=Date.UTC(n[1],n[2],n[3],n[5],n[6]+o,n[7],n[8]);return new Date(s)},t.is=function(e,t){return"string"==typeof e&&((!t||!1!==/^\d{4}-\d{2}-\d{2}/.test(e))&&r.test(e))}},function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,n){"use strict";var r=new RegExp("(%[a-f0-9]{2})|([^%]+?)","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function a(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],a(n),a(r))}function i(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r)||[],n=1;n{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),a=0;a7776e6&&(delete s[e],c=!0)})),c?h(s).then((function(){return{commands:o}})):{commands:o}}))}function f(){return e.get("member","private","token")}function p(e,n){const{commands:r}=e;return r.forEach((function(e){e.is_own=!0,e.enabled=-1!==e.b.indexOf(n)})),t.commands=r.sort((e,t)=>Number(t.enabled)-Number(e.enabled)),void 0!==e.oboWritable&&(t.oboWritable=e.oboWritable),t}function m(){return t.commands?new n((function(e){e(t)})):f().then((function(t){return new n((function(n,r){const o=e.getContext().board,a="?b="+o,s=u?"&obo="+u:"";$.ajax(`${i}powerup-commands${a}${s}`,{type:"GET",headers:{"X-Butler-Trello-Token":t}}).done((function(e){return e.success?n(p(e.response,o)):r(new Error(e.error||"NO_RESPONSE"))})).fail((function(){r(new Error("NETWORK_ERROR"))}))}))}))}function g(e,t){return(d(e)?_(t):m()).then((function(t){const{commands:n}=t;return{commands:n.filter((function(t){return t.type===e})),obo_writable:t.oboWritable}}))}function b(t,n,o){const i=o.filter((function(e){return e.scope===t&&e.shared===n})),s=r.compressToUTF16(JSON.stringify(i));return e.set(t===c.ScopeTeam?"organization":"board",n?"shared":"private","commands",s).then((function(){e.get(t===c.ScopeTeam?"organization":"board",n?"shared":"private","commands").then((function(e){try{e=JSON.parse(r.decompressFromUTF16(e))}catch(t){a.logError(t,"Context: saveFilteredCommands",{in:JSON.stringify(o),out:e})}}))}))}function E(t,n){const r=t.id;return e.get("board","private","overrides").then((function(e){e||(e={});let o=e[r];return o||(o=e[r]={}),o.enabled=n,o.ot=+new Date,h(e).then((function(){return{...t}}))}))}function T(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.join(f(),e.board("id","name","url")).spread((function(e,a){return new n((function(n,s){$.ajax(`${i}powerup-commands/${t.id}`,{type:"POST",data:JSON.stringify({op:"enable",params:{enabled:r,board:o.board?o.board:a},obo:u}),contentType:"application/json",headers:{"X-Butler-Trello-Token":e}}).done((function(e){if(!e.success)return s(new Error(e.error||"NO_RESPONSE"));const r=p(e.response,a.id).commands;return n(r.find(e=>e.id===t.id))})).fail((function(){return s(new Error("NETWORK_ERROR"))}))}))}))}function A(t,r,o){return n.join(_(!0),m(),e.member("id","username")).spread((function(a,s,c){let l=a.commands.findIndex((function(e){return e.id===t}));return-1!==l?function(e,t,r,o,a){const i=e[t];if(i.uid!==r.id&&!a)return n.reject(new Error("Command not own."));const{scope:s,shared:c}=i,u=o(i);return u?(u.uid=r.id,u.username=r.username,u.t=+new Date,e.splice(t,1,u),u.scope===s&&u.shared===c?b(s,c,e).then((function(){return u})):b(i.scope,i.shared,e).then((function(){return b(s,c,e)})).then((function(){return u}))):(e.splice(t,1),b(s,c,e).then((function(){return i})))}(a.commands,l,c,r,o):(l=s.commands.findIndex((function(e){return e.id===t})),-1!==l?function(t,r,o){const a=t[r],s=o(a);return n.join(f(),e.board("id","name","url")).spread((function(e,t){let r;return r=s?JSON.stringify({op:"update",params:{command:s,board:t},obo:u}):JSON.stringify({op:"delete",params:{board:t},obo:u}),new n((function(n,o){$.ajax(`${i}powerup-commands/${a.id}`,{type:"POST",data:r,contentType:"application/json",headers:{"X-Butler-Trello-Token":e}}).done((function(e){if(!e.success)return o(new Error(e.error||"NO_RESPONSE"));p(e.response,t.id);const r=e.response.commands.find((function(e){return e.id===a.id}));return n(r)})).fail((function(){o(new Error("NETWORK_ERROR"))}))}))}))}(s.commands,l,r):n.reject(new Error("Command not found.")))}))}c.init=function(t){e=t||TrelloPowerUp.iframe({targetOrigin:"https://trello.com"})},c.setAdminOnBehalfOf=function(e){u!==e&&(u=e||void 0,l())},c.getAdminOnBehalfOf=function(){return u},c.ScopeBoard="board",c.ScopeTeam="team",c.getCommand=function(e,t,n){return g(e,n).then((function(e){return e.commands.find((function(e){return e.id===t}))}))},c.getCommandById=function(e,t,n){return _(t).then((function(t){const r=t.commands.find((function(t){return t.id===e}));return r||(n?void 0:m().then((function(t){return t.commands.find((function(t){return t.id===e}))})))}))},c.getCommands=g,c.getAllCommands=function(e){return n.join(_(e),m()).spread((function(e,t){return{commands:e.commands.concat(t.commands),obo_writable:t.oboWritable}}))},c.getLocalCommands=_,c.addCommand=function(t){return d(t.type)?function(t){return n.join(e.member("id","username"),_(!0)).spread((function(e,n){const{commands:r}=n;let a,i=+new Date;do{a=`${e.id}-${++i}`}while(r.some((function(e){return e.id===a})));return t.id=a,t.uid=e.id,t.username=e.username,t.t=i,r.push(t),b(t.scope,t.shared,r).then((function(){t.is_own=!0;const{parse:e}=o(t.cmd);return s({action:"added",actionSubject:"butlerCommand",source:"automationDirectory",attributes:{actions:e.ACTION.map(e=>{let{type:t}=e;return t}),type:t.type}}),t}))}))}(t):function(t){return n.join(f(),e.board("id","name","url")).spread((function(e,r){return new n((function(n,a){$.ajax(i+"powerup-commands",{type:"POST",data:JSON.stringify({op:"new",params:{command:t,board:r},obo:u}),contentType:"application/json",headers:{"X-Butler-Trello-Token":e}}).done((function(e){if(!e.success)return a(new Error(e.error||"NO_RESPONSE"));p(e.response,r.id);const i=e.response.commands.find((function(t){return t.id===e.response.cmd_id})),{parse:c}=o(t.cmd),u=c.TRIGGER;return s({action:"added",actionSubject:"butlerCommand",source:"automationDirectory",attributes:{trigger:u&&u[u.type]&&u[u.type].type||null,actions:c.ACTION.map(e=>{let{type:t}=e;return t}),type:t.type}}),n(i)})).fail((function(){return a(new Error("NETWORK_ERROR"))}))}))}))}(t)},c.removeCommandId=function(e,t){return A(e,(function(){return null}),t)},c.updateCommandId=function(e,t,n){return A(e,(function(e){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}),n)},c.enableCommandId=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.join(_(!0),m()).spread((function(o,a){let i=o.commands.findIndex((function(t){return t.id===e}));return-1!==i?E(o.commands[i],t):(i=a.commands.findIndex((function(t){return t.id===e})),-1!==i?T(a.commands[i],t,r):n.reject(new Error("Command not found.")))}))},c.clearCachedServerCommands=l,c.getSharedLibraries=function(){return f().then((function(t){return new n((function(n,r){const o=`?b=${e.getContext().board}&idOrganization=${e.getContext().organization}`,a=u?"&obo="+u:"";$.ajax(`${i}powerup-commands${o}${a}`,{type:"GET",headers:{"X-Butler-Trello-Token":t}}).done((function(e){return e.success?n(e.response.libs):r(new Error(e.error||"NO_RESPONSE"))})).fail((function(){r(new Error("NETWORK_ERROR"))}))}))}))},c.getSharedLibrary=function(t){return f().then((function(r){return new n((function(n,o){const a=`?b=${e.getContext().board}&idOrganization=${e.getContext().organization}`,s=u?"&obo="+u:"";$.ajax(`${i}powerup-library/${t}${a}${s}`,{type:"GET",headers:{"X-Butler-Trello-Token":r}}).done((function(e){return e.success?n(e.response.lib):o(new Error(e.error||"NO_RESPONSE"))})).fail((function(){o(new Error("NETWORK_ERROR"))}))}))}))},c.startSharing=function(t){return f().then((function(r){return new n((function(n,o){const a={title:t,board:{id:e.getContext().board},idOrganization:e.getContext().organization,obo:u};$.ajax(i+"powerup-library-share",{type:"POST",data:JSON.stringify(a),contentType:"application/json",headers:{"X-Butler-Trello-Token":r}}).done((function(e){return e.success?n(e.response.lib):o(new Error(e.error||"NO_RESPONSE"))})).fail((function(){return o(new Error("NETWORK_ERROR"))}))}))}))},c.stopSharing=function(t){return f().then((function(r){const o={board:{id:e.getContext().board},idOrganization:e.getContext().organization,obo:u};return new n((function(e,n){$.ajax(`${i}powerup-library-unshare/${t.link_id}`,{type:"POST",data:JSON.stringify(o),contentType:"application/json",headers:{"X-Butler-Trello-Token":r}}).done((function(t){return t.success?e():n(new Error(t.error||"NO_RESPONSE"))})).fail((function(){return n(new Error("NETWORK_ERROR"))}))}))}))},c.importLibrary=function(t){return f().then((function(r){const o={board:{id:e.getContext().board},idOrganization:e.getContext().organization,obo:u};return new n((function(n,a){$.ajax(`${i}powerup-library-import/${t}`,{type:"POST",data:JSON.stringify(o),contentType:"application/json",headers:{"X-Butler-Trello-Token":r}}).done((function(t){return t.success?(p(t.response,e.getContext().board),n()):a(new Error(t.error||"NO_RESPONSE"))})).fail((function(){a(new Error("NETWORK_ERROR"))}))}))}))},c.enableLibrary=function(t,r){return n.join(f(),e.board("id","name","url")).spread((function(o,a){const s={title:t,enable:r,board:a,idOrganization:e.getContext().organization,obo:u};return new n((function(e,t){$.ajax(i+"powerup-library-enable",{type:"POST",data:JSON.stringify(s),contentType:"application/json",headers:{"X-Butler-Trello-Token":o}}).done((function(n){return n.success?(p(n.response,a.id),e()):t(new Error(n.error||"NO_RESPONSE"))})).fail((function(){t(new Error("NETWORK_ERROR"))}))}))}))},c.renameLibrary=function(t,r){return f().then((function(o){const a={title:t,new_title:r,board:{id:e.getContext().board},idOrganization:e.getContext().organization,obo:u};return new n((function(t,n){$.ajax(i+"powerup-library-rename",{type:"POST",data:JSON.stringify(a),contentType:"application/json",headers:{"X-Butler-Trello-Token":o}}).done((function(r){return r.success?(p(r.response,e.getContext().board),t()):n(new Error(r.error||"NO_RESPONSE"))})).fail((function(){n(new Error("NETWORK_ERROR"))}))}))}))}}};window.CommandStorage=c,e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.DEBUG=void 0,t.configureGlobals=function({logger:e,debug:t}={}){(0,o.setLogger)((null==e?void 0:e.info)?e:void 0),(0,r.setDebug)(null!=t&&t)};const r=n(128),o=n(129);var a=n(128);Object.defineProperty(t,"DEBUG",{enumerable:!0,get:function(){return a.DEBUG}});var i=n(129);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOKEN_NOT_FOUND_CSS_VAR=t.THEME_DATA_ATTRIBUTE=t.DEFAULT_THEME=t.CSS_VAR_FULL=t.CSS_PREFIX=t.COLOR_MODE_ATTRIBUTE=void 0;t.THEME_DATA_ATTRIBUTE="data-theme";t.COLOR_MODE_ATTRIBUTE="data-color-mode";t.DEFAULT_THEME="light";t.CSS_PREFIX="ds";t.CSS_VAR_FULL=["opacity","font","space","border"];var r="--".concat("ds","-token-not-found");t.TOKEN_NOT_FOUND_CSS_VAR=r},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(6),i=n.n(a);let s=function(e){return e.LOCAL="local",e.DEV="dev",e.STAGING="staging",e.PROD="prod",e}({}),c=function(e){return e.TRACK="track",e.UI="ui",e.OPERATIONAL="operational",e.SCREEN="screen",e.IDENTIFY="identify",e}({}),u=function(e){return e.MAC="mac",e.LINUX="linux",e.WINDOWS="windows",e.DESKTOP="desktop",e.WEB="web",e.MOBILE_WEB="mobileWeb",e}({}),l=function(e){return e.DESKTOP="desktop",e.WEB="web",e}({}),d=function(e){return e.CLOUD_ID="cloudId",e.ORG_ID="orgId",e.OPSGENIE_CUSTOMER_ID="opsgenieCustomerId",e.HALP_TEAM_ID="halpTeamId",e.TRELLO_WORKSPACE_ID="trelloWorkspaceId",e.NONE="none",e}({}),h=function(e){return e.ATLASSIAN_ACCOUNT="atlassianAccount",e.HASHED_EMAIL="hashedEmail",e.TRELLO="trello",e.OPSGENIE="opsgenie",e.HALP="halp",e}({}),_=function(e){return e.TRANSITION="transition",e.INITIAL_LOAD="initialLoad",e}({});const f=Object.freeze([u.DESKTOP,u.MAC,u.LINUX,u.WINDOWS]),p=Object.freeze([u.WEB,u.MOBILE_WEB]);let m=function(e){return e.ATL_ORIGIN="atlOrigin",e}({});function g(e){return Object.values(e)}function b(e,t){return Object.values(e).indexOf(t)>-1}class E{constructor(){o()(this,"_bindEventListeners",()=>{document.addEventListener(this._visibilityChange,this._handleVisibilityChange,!1)}),o()(this,"_handleVisibilityChange",()=>{const e=document[this._hidden];this._isHidden=e,this._callbacks.forEach(t=>t(e))}),this._isHidden=!1,this._callbacks=new Map,this._hidden=void 0,this._visibilityChange=void 0,void 0!==document.hidden?(this._isHidden=document.hidden,this._hidden="hidden",this._visibilityChange="visibilitychange"):void 0!==document.msHidden?(this._isHidden=document.msHidden,this._hidden="msHidden",this._visibilityChange="msvisibilitychange"):void 0!==document.webkitHidden&&(this._isHidden=document.webkitHidden,this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"),void 0!==document.addEventListener&&void 0!==this._hidden&&this._bindEventListeners()}addCallback(e,t){if("string"!=typeof e)throw new Error("Invalid name, must be string");if("function"!=typeof t)throw new Error("Invalid callback, must be function");this._callbacks.set(e,t)}removeCallback(e){this._callbacks.has(e)&&this._callbacks.delete(e)}getIsHidden(){return this._isHidden}}class T{constructor(){this._performance=window.performance}clearMarks(...e){this._performance&&this._performance.clearMarks&&this._performance.clearMarks(...e)}mark(...e){this._performance&&this._performance.mark&&this._performance.mark(...e)}getEntriesByName(...e){return this._performance&&this._performance.getEntriesByName?this._performance.getEntriesByName(...e):[]}getTimeOrigin(){return this._performance&&(this._performance.timeOrigin||this._performance.timing)?this._performance.timeOrigin||this._performance.timing.navigationStart:0}now(){return this._performance&&this._performance.now?this._performance.now():Date.now?Date.now():+new Date}isAvailable(){return!!(this._performance&&this._performance.clearMarks&&this._performance.mark&&this._performance.getEntriesByName&&this._performance.timing)}}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;tt?`${e}.${t}`:e),o()(this,"_getEventTimingByName",e=>{const t=this._performance.getEntriesByName(e);return t[t.length-1]}),o()(this,"_getApdexFields",e=>{const t=this._getApdexTimings(e),n=this._calculateApdex({duration:t.duration,threshold:e.threshold});return v(v({},t),{},{apdex:n})}),o()(this,"_getApdexTimings",e=>{const t=this._getEventKey(e),n=t+"-start",r=e.startTime||this._getStartTime(e,n),o=e.stopTime||this._getStopTime();return this._cleanApdexState(t),{startTime:r,stopTime:o,duration:o-r}}),o()(this,"_getStartTime",(e,t)=>{let n;const r=this._performance.getTimeOrigin();if(e.type===_.INITIAL_LOAD)n=r;else{n=r+this._getEventTimingByName(t).startTime}return n}),o()(this,"_getStopTime",()=>this._performance.getTimeOrigin()+this._performance.now()),o()(this,"_cleanApdexState",e=>{this._performance.clearMarks(e+"-start"),this._performance.clearMarks(e+"-stop"),this._startedEvents.delete(e)}),o()(this,"_getVisibilityFields",e=>{let t;if(e.type===_.INITIAL_LOAD)t=!this._wasPreviouslyHidden;else if(e.type===_.TRANSITION){const n=this._getEventKey(e);t=this._isActiveEvents.get(n)}return(e.startTime||e.stopTime)&&(t=!this._pageVisibility.getIsHidden()),{isActiveTab:t}}),o()(this,"_calculateApdex",({duration:e,threshold:t=this._threshold})=>{let n;return n=e<=t?1:e<=4*t?.5:0,n}),o()(this,"_validateStartEvent",e=>{if(!e)throw new Error('Missing "event" in Apdex start event');if(!e.task)throw new Error('Missing "task" in Apdex start event');if("string"!=typeof e.task)throw new Error('Invalid "task" in Apdex start event');if(e.taskId&&"string"!=typeof e.taskId)throw new Error('Invalid "taskId" in Apdex start event')}),o()(this,"_validateStopEvent",e=>{if(!e)throw new Error('Missing "event" in Apdex stop event');if(!e.task)throw new Error('Missing "task" in Apdex stop event');if("string"!=typeof e.task)throw new Error('Invalid "task" in Apdex stop event');if(e.taskId&&"string"!=typeof e.taskId)throw new Error('Invalid "taskId" in Apdex stop event');if(!e.type)throw new Error('Missing "type" in Apdex stop event');if(e.type&&!b(_,e.type))throw new Error('Invalid "type" in Apdex stop event');if(e.threshold&&"number"!=typeof e.threshold)throw new Error('Invalid "threshold" in Apdex stop event');if(!e.startTime&&e.type===_.TRANSITION){const t=this._getEventKey(e);if(!this._startedEvents.has(t))throw new Error(`Apdex event transition "${t}" was not started`)}if(e.startTime&&!("number"==typeof e.startTime&&e.startTime>=0))throw new Error('Invalid "startTime" in Apdex stop event');if(e.stopTime&&"number"!=typeof e.stopTime)throw new Error('Invalid "stopTime" in Apdex stop event');if(e.stopTime<=e.startTime)throw new Error('"stopTime" should be greater than "startTime" in Apdex stop event')}),o()(this,"_shouldSendEvent",e=>!!e&&"number"==typeof e.apdex),o()(this,"_sendEvent",(e,t)=>{this._shouldSendEvent(e)&&this._onEvent({source:"ui",action:"readyForUser",actionSubject:"ui",attributes:v(v({},e.additionalAttributes),{},{task:e.task,taskId:e.taskId,type:e.type,threshold:e.threshold||this._threshold,apdex:e.apdex,startTime:e.startTime,stopTime:e.stopTime,duration:e.duration,isActiveTab:e.isActiveTab})},t)}),!e)throw new Error("Missing onEvent callback");if("function"!=typeof e)throw new Error("Invalid onEvent, must be function");if(!(t instanceof E))throw new Error("Invalid pageVisibility, must be PageVisibility class");this._startedEvents=new Map,this._performance=new T,this._onEvent=e,this._threshold=1e3,this._wasPreviouslyHidden=t.getIsHidden(),this._isActiveEvents=new Map,this._pageVisibility=t,this._pageVisibility.addCallback("apdexEvent",e=>{this.onVisibilityChange(!e)})}start(e){if(this._validateStartEvent(e),!this._performance.isAvailable())return;const t=this._getEventKey(e),n=t+"-start";this._startedEvents.set(t,!0),this._isActiveEvents.set(t,!this._pageVisibility.getIsHidden()),this._performance.clearMarks(n),this._performance.mark(n)}getStart(e){if(this._validateStartEvent(e),!this._performance.isAvailable())return;const t=this._getEventKey(e)+"-start";return this._getEventTimingByName(t)}stop(e,t){if(this._validateStopEvent(e),!this._performance.isAvailable())return;const n=this._getApdexFields(e),r=this._getVisibilityFields(e);this._sendEvent(v(v(v({},e),n),r),t)}onVisibilityChange(e){e||(this._wasPreviouslyHidden=!0,this._isActiveEvents.forEach((e,t)=>this._isActiveEvents.set(t,!1)))}}var O=(e,t)=>()=>{if((e=>"function"==typeof e)(e))try{return e()}catch(e){return void console.error(`${t} - ${e instanceof Error?e.message:String(e)}`)}return e};function I(e){return!0==(null!==(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function C(e){if(!1===I(e))return!1;const t=e.constructor;if("function"!=typeof t)return!1;const n=t.prototype;return!1!==I(n)&&"isPrototypeOf"in n}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t0}function P(e,t){return F(t)?{[e]:t}:void 0}function B(e){if(F(e)){return P("containers",function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];t[n]={id:r.id,type:r.type}}),t}(e))}}function $(e,t){return D({containerType:e.containerType,containerId:e.containerId,source:e.source,objectType:e.objectType,objectId:e.objectId,actionSubject:e.actionSubject,action:e.action,actionSubjectId:e.actionSubjectId,attributes:e.attributes,nonPrivacySafeAttributes:e.nonPrivacySafeAttributes,tags:e.tags,highPriority:e.highPriority,eventType:t},B(e.containers))}function j(e,t,n,r,o,a,i,s,u,l,d,h,_,f){const p=x(e),m=w(t),g=S(n),b=R(l),E=k(h),T={title:"",path:"",url:"",referrer:"",search:"",eventType:c.SCREEN};return D(D(D(D(D(D(D(D(D(D({},p),m),g),b),T),function(e){return P("attributes",e)}(r)),function(e){return P("nonPrivacySafeAttributes",e)}(o)),B(f)),M(_)),{},{tags:a,tabId:i,sessionId:s,taskSessions:u,pageLoadId:d},E)}function U(e){return`${e.actionSubject} ${e.action}`}function H(e,t,n,r,o,a,i,s,c,u,l){const d=x(e,function(e){const{env:t,product:n,subproduct:r,version:o,origin:a,platform:i}=e;return{env:t,product:n,subproduct:r,version:o,origin:a,platform:i}}(r)),h=w(t),_=R(c),f=k(l),p=S(n),m=$(r,o);return D(D(D(D(D(D(D({},d),h),_),p),m),M(r)),{},{tabId:a,sessionId:i,taskSessions:s,pageLoadId:u},f)}const Y=(e,t)=>Object.keys(e).reduce((n,r)=>(n[t(e[r],r,e)]=e[r],n),{}),G=(e,t)=>Object.keys(e).filter(e=>t.indexOf(e)<0).reduce((t,n)=>(t[n]=e[n],t),{}),W=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||"object"!=typeof e&&"object"!=typeof t)return e===t;if(e.prototype!==t.prototype)return!1;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>W(e[n],t[n]))},V=(e,t)=>e.reduce((e,n,r,o)=>(e[t(n,r,o)?0:1].push(n),e),[[],[]]),K=Object.freeze([c.OPERATIONAL,c.TRACK,c.UI]);function z(e){if(e){if(e&&e.constructor!==Object)throw new Error("properties.containers must be an Object");Object.values(e).forEach(e=>function(e){if(!C(e))throw new Error("properties.containers must be an Object");if(!("id"in e))throw new Error("properties.containers is missing field 'id'");if("string"!=typeof e.id)throw new Error("properties.containers.id must be of type String");if("type"in e&&"string"!=typeof e.type)throw new Error("properties.containers.type must be of type String")}(e))}}function q(e){switch(e){case c.OPERATIONAL:case c.TRACK:case c.UI:return!0;default:return!1}}function X(e){if(!e)throw new Error("Missing event");if(!e.source)throw new Error("Missing event.source");if(!e.actionSubject)throw new Error("Missing event.actionSubject");if(!e.action)throw new Error("Missing event.action");z(e.containers)}function J(e){if(!e)throw new Error("Missing event");if(!e.source)throw new Error("Missing event.source");if(!e.actionSubject)throw new Error("Missing event.actionSubject")}class Q{constructor(e,t){if(o()(this,"canCompress",e=>{try{return e&&q(e.eventType)&&this.predicate(e)}catch(e){return!1}}),o()(this,"compress",e=>{const[t,n]=V(e,e=>this.canCompress(e)),r=this.compressFn(t);if(!r)throw new Error("No events were returned from the compression function");return r.forEach(e=>{!function(e){if(!q(e))throw new Error(`Invalid action event type: ${e}, must be one of: [${K}]`)}(e.eventType),X(e)}),r.concat(n)}),"function"!=typeof e)throw new Error("Invalid predicate, must be a function that accepts an event and returns a boolean");if("function"!=typeof t)throw new Error("Invalid compressFn, must be a function that both accepts and returns an array of events");this.predicate=e,this.compressFn=t}}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ee(e){for(var t=1;tthis.compressionRules.some(t=>t.canCompress(e))),o()(this,"compress",e=>this.createGroups(e).reduce((e,t)=>{const n=this.compressGroup(t);return e.concat(n)},[])),o()(this,"createGroups",e=>e.reduce((e,t)=>{const n=this.compressionRules.find(e=>e.canCompress(t));let r;if(n){const e=$(t,t.eventType);r=G(t,Object.keys(e))}const o=e.find(e=>n===e.compressor&&W(r,e.contextFields));return o?o.events.push(t):e.push({contextFields:r,compressor:n,events:[t]}),e},[])),o()(this,"compressGroup",e=>{if(!e.compressor)return e.events;try{return e.compressor.compress(e.events).map(t=>ee(ee({},t),e.contextFields))}catch(t){return console.warn(`Failed to compress some analytics events. Error: ${t.message}. Sending ${e.events.length} uncompressed events instead`),e.events}}),!Array.isArray(e))throw new Error("Event compressors must be constructed with an array of CompressionRules");if(!e.every(e=>e instanceof Q))throw new Error("Event compressors can only be constructed with instances of CompressionRule");this.compressionRules=e}}class ne{constructor(e,t){o()(this,"push",(e,t,n,r)=>{this.eventArgs.push({identifier:e,builtEvent:t,context:n,userInfo:r})}),o()(this,"size",()=>this.eventArgs.length),o()(this,"startFlush",()=>{try{this.eventArgs=this.compressEventArgs(this.eventArgs)}catch(e){console.warn(`Failed to perform compression on the delayed analytics events. Error: ${e.message}. Sending ${this.eventArgs.length} uncompressed events instead`)}this.flushNextBatch()}),o()(this,"cancelFlush",()=>{this.flushBatchTimeout&&(clearTimeout(this.flushBatchTimeout),this.flushBatchTimeout=null)}),o()(this,"flushNextBatch",()=>{this.eventArgs.splice(0,7).forEach(e=>this.processFn(e.identifier,e.builtEvent,e.context,e.userInfo)),this.eventArgs.length>0?this.flushBatchTimeout=setTimeout(()=>this.flushNextBatch(),100):this.flushBatchTimeout=null}),o()(this,"compressEventArgs",e=>{const[t,n]=V(e,e=>this.compressor.canCompress(e.builtEvent)),r=t.reduce((e,t)=>{const n=e.find(e=>W(e.userInfo,t.userInfo)&&W(e.context,t.context));return n?n.eventArgs.push(t):e.push({userInfo:t.userInfo,context:t.context,eventArgs:[t]}),e},[]).reduce((e,t)=>{try{const n=t.eventArgs.map(e=>e.builtEvent),r=this.compressor.compress(n).map(e=>({identifier:U(e),builtEvent:e,userInfo:t.userInfo,context:t.context}));return e.concat(r)}catch(e){return console.warn(`Failed to compress some analytics events. Error: ${e.message}. Sending ${t.eventArgs.length} uncompressed events instead`),t.eventArgs}},[]);return n.forEach(e=>r.push(e)),r}),this.processFn=e,this.flushBatchTimeout=null,this.eventArgs=[],this.compressor=new te(t)}}let re=function(e){return e.TIMEOUT="timeout",e.MANUAL="manual",e}({});class oe{constructor(e,t){o()(this,"push",(e,t,n,r)=>{this.delayQueue.push(e,t,n,r)}),o()(this,"startLowPriorityEventDelay",(e=1e4,t)=>{if(Number.isNaN(e)||e<=0)throw new Error(`Invalid timeout period: ${e}, must be a number greater than 0`);this.delayTimeout&&clearTimeout(this.delayTimeout);const n=e?Math.min(e,3e4):3e4;this.delayCallback=t,this.delayTimeout=setTimeout(()=>this.stopLowPriorityEventDelay(re.TIMEOUT),n),this.delayQueue.cancelFlush(),this.isDelaying=!0}),o()(this,"stopLowPriorityEventDelay",(e=re.MANUAL)=>{var t;this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=void 0),this.delayQueue.startFlush(),this.isDelaying=!1,null===(t=this.delayCallback)||void 0===t||t.call(this,e),this.delayCallback=void 0}),o()(this,"isDelayingLowPriorityEvents",()=>this.isDelaying),this.isDelaying=!1,this.delayQueue=new ne(e,t)}}let ae=function(e){return e.IN_PROGRESS="inProgress",e.QUEUE="queue",e.RECLAIM_START="reclaimStart",e.RECLAIM_END="reclaimEnd",e.ACK="ack",e}({}),ie=function(e){return e[e.RECLAIM_TIMEOUT=1e4]="RECLAIM_TIMEOUT",e[e.RECLAIM_WAIT=500]="RECLAIM_WAIT",e[e.RECLAIM_WAIT_THRESHOLD=2e3]="RECLAIM_WAIT_THRESHOLD",e}({});const se=(e,t)=>({[ae.ACK]:`${e}.${t}.${ae.ACK}`,[ae.QUEUE]:`${e}.${t}.${ae.QUEUE}`,[ae.IN_PROGRESS]:`${e}.${t}.${ae.IN_PROGRESS}`,[ae.RECLAIM_START]:`${e}.${t}.${ae.RECLAIM_START}`,[ae.RECLAIM_END]:`${e}.${t}.${ae.RECLAIM_END}`}),ce=Object.values(ae);function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function le(e){for(var t=1;tnew Promise(t=>{setTimeout(t,e)}),he=async(e,t)=>{const{queue:n,inProgress:r}=e.storageKeys,o=JSON.parse(localStorage.getItem(n)||"[]"),a=JSON.parse(localStorage.getItem(r)||"{}"),i=[...o,...Object.entries(a).map(([e,t])=>le(le({},t),{},{attemptNumber:t.attemptNumber+1,id:e}))];if(i.length>0){const o=await t(i);if("successful"===o.status)_e(e.storageKeys);else if("partial"===o.status){const e=i.filter(e=>!o.acceptedItemIds.includes(e.id));return localStorage.removeItem(r),localStorage.setItem(n,JSON.stringify(e)),{fullReclaim:!1}}}else _e(e.storageKeys);return{fullReclaim:!0}},_e=e=>{localStorage.removeItem(e.queue),localStorage.removeItem(e.inProgress),localStorage.removeItem(e.reclaimEnd),localStorage.removeItem(e.reclaimStart),localStorage.removeItem(e.ack)};var fe=async(e,t)=>{if("string"!=typeof e||0===e.length)return{fullReclaims:0,partialReclaims:0,failedReclaims:0};const n=i()(),r=(e=>{try{return Object.keys(localStorage).filter(t=>t.startsWith(e)).map(e=>e.split(".")).filter(t=>{if(3===t.length&&t[0]===e&&t[2]===ae.ACK)try{const e=localStorage.getItem(t.join("."));if(e){const t=parseInt(e);return ie.RECLAIM_TIMEOUT+te[1])}catch(e){}return[]})(e).map(r=>(async(e,t)=>{const{ack:n,reclaimStart:r,reclaimEnd:o}=e.storageKeys,a=Date.now();if(localStorage.setItem(r,e.reclaimProcessId),localStorage.setItem(n,a.toString()),await de(ie.RECLAIM_WAIT),Date.now()>a+ie.RECLAIM_WAIT_THRESHOLD||localStorage.getItem(r)!==e.reclaimProcessId)throw new Error("Took to long to callback, reclaim abandonded. After reclaimStart.");if(localStorage.setItem(o,e.reclaimProcessId),await de(ie.RECLAIM_WAIT),Date.now()>a+ie.RECLAIM_WAIT_THRESHOLD||localStorage.getItem(r)!==e.reclaimProcessId||localStorage.getItem(o)!==e.reclaimProcessId)throw new Error("Took to long to callback, reclaim abandonded. After reclaimEnd.");return he(e,t)})({queuePrefix:e,reclaimProcessId:n,storageKeys:se(e,r)},t)),o=await Promise.allSettled(r),a=o.filter(e=>"rejected"===e.status),s=o.filter(e=>"fulfilled"===e.status).map(e=>e.value),c=s.filter(e=>e.fullReclaim),u=s.filter(e=>!e.fullReclaim);return{failedReclaims:a.length,partialReclaims:u.length,fullReclaims:c.length}};let pe=function(e){return e.INDEXEDDB="indexeddb",e.MEMORY="memory",e}({}),me=function(e){return e.IGNORE="ignore",e.ABANDON="abandon",e.EVICT="evict",e}({});class ge extends Error{constructor(){super("window.indexeddb is undefined."),Object.setPrototypeOf(this,ge.prototype),this.name="NoIndexedDbError"}}class be extends Error{constructor(e){super("Event Limit reached. Abandoning write to: "+e),Object.setPrototypeOf(this,be.prototype),this.name="AbandonWriteError"}}class Ee extends Error{constructor(e){super("Error thrown while processing events in callback: "+(e&&"object"==typeof e&&"toString"in e&&"function"==typeof e.toString&&e.toString()||"string"==typeof e&&e||"Argument passed to CallbackProcessingError was not an Error or string.")),Object.setPrototypeOf(this,Ee.prototype),this.name="CallbackProcessingError"}}class Te extends Error{constructor(e,t){super(`Method '${t}' cannot be called with policy '${e}'.`),this.name="InvalidPolicyError"}}const Ae=e=>{if(e&&"object"==typeof e&&"name"in e){const t=e;return"string"==typeof t.name&&("AbandonWriteError"===t.name||"CallbackProcessingError"===t.name||"InvalidPolicyError"===t.name)}return!1};var ve=n(16),ye=n.n(ve);const Oe=(e,t,{id:n,retryAttempts:r,timeToProcessOffset:o})=>({item:e,id:n||i()(),retryAttempts:r||0,timeToBeProcessedAfter:Date.now()+(o||0),namespace:t,timeAdded:Date.now()}),Ie=e=>({logger:e.logger||console,useMemory:e.useMemory||!1,maxAttempts:e.maxAttempts||10,maxEventLimit:e.maxEventLimit||5e3}),Ce=e=>new Promise((t,n)=>{e.onsuccess=e=>{t(e)},e.onerror=e=>{n(e)}}),Ne=(e,t)=>{try{"function"==typeof e.commit&&e.commit()}catch(e){throw t.error("Failed to force commit transaction:",e),e}return(e=>new Promise((t,n)=>{e.oncomplete=()=>{t()},e.onerror=e=>{n(e)},e.onabort=e=>{n(e)}}))(e)},De=(e,t)=>{e.onerror=e=>{t.warn("Error thrown from request:",e)}};class we{constructor(e,t,n,r){if(o()(this,"deleteOldestNEvents",async(e,t)=>{var n;const r=e.index("namespace-timeAdded"),o=IDBKeyRange.bound([this.namespace,0],[this.namespace,Date.now()]),a=r.getAllKeys(o,t),i=await Ce(a),s=null==i||null===(n=i.target)||void 0===n?void 0:n.result;if(s&&Array.isArray(s)&&s.length>0)try{const t=s.map(t=>this.deleteItemHandler(e,t));await Promise.all(t)}catch(e){throw this.logger.warn("Failed to delete items from indexeddb.",e),e}}),!(e>0))throw Error("Event Limit has to be set higher than 1");this.eventLimit=e,this.namespace=t,this.logger=n,this.deleteItemHandler=r}async insertItems(e,t,n=me.ABANDON){const r=[...t];let o=0;switch(n){case me.ABANDON:await this.throwIfNotEnoughSpace(e,t.length);break;case me.EVICT:o=await this.evictIfNotEnoughSpace(e,t.length);break;case me.IGNORE:await this.calculateHowManyEventsWeCanAdd(e,r)}const a=r.map(t=>Ce(e.add(t)));return await Promise.all(a),await Ne(e.transaction,this.logger),{items:r,numberOfEvictedItems:o}}async throwIfNotEnoughSpace(e,t){const n=await this.calculateFreeSpace(e);if(nnew Promise(async(e,t)=>{window.setTimeout(()=>{this.logger.warn("IndexedDB timed out."),t(new ge)},15e3);const n=window.indexedDB.open("analytics-web-client",1);n.onupgradeneeded=e=>{if(0!==e.oldVersion)throw new Error("We cannot upgrade the database. Do not do this.");const t=n.result.createObjectStore("analytics-resilience",{keyPath:"id"});t.createIndex("timeToBeProcessedAfter","timeToBeProcessedAfter",{unique:!1}),t.createIndex("retryAttempts","retryAttempts",{unique:!1}),t.createIndex("timeAdded","timeAdded",{unique:!1}),t.createIndex("namespace-timeAdded",["namespace","timeAdded"],{unique:!1})};try{return await Ce(n),e(n.result)}catch(e){this.logger.warn("IndexedDB failed to initialise.",e),t(new ge)}})),o()(this,"addItem",async(e,t={},n=me.ABANDON)=>{const{logger:r,namespace:o}=this,a=Oe(e,o,t),{objectStore:i}=await this.getObjectStoreAndTransaction("readwrite");if(n===me.IGNORE)throw new Te(n,"IndexedDbConnector#addItem");try{if(!a.namespace||0===a.namespace.length||"string"!=typeof a.namespace)throw new Error("Namespace not specified");const e=await this.globalEventLimitGuard.insertItems(i,[a],n);if(1===e.items.length)return{item:e.items[0],numberOfEvictedItems:e.numberOfEvictedItems};throw new Error("Incorrect number of items added. Expected: 1, got: "+e.items.length)}catch(e){if(Ae(e))throw e;throw r.log("Failed to add item to table",e),new Error("Request to add item to table failed")}}),o()(this,"bulkAddItem",async(e,t=me.ABANDON)=>{const{logger:n,namespace:r}=this,o=e.map(e=>{let{item:t}=e,n=ye()(e,Se);return Oe(t,r,n)}),{objectStore:a}=await this.getObjectStoreAndTransaction("readwrite");try{return await this.globalEventLimitGuard.insertItems(a,o,t)}catch(e){if(Ae(e))throw e;throw n.log("Failed to add item to table",e),new Error("Request to add item to table failed")}}),o()(this,"getItems",async(e=7)=>{const t=e>0?e:7,{logger:n}=this,r=this.options.maxAttempts,{transaction:a,objectStore:i}=await this.getObjectStoreAndTransaction("readwrite"),s=i.index("timeToBeProcessedAfter"),c=IDBKeyRange.upperBound(Date.now()),u=s.openCursor(c),l=await new Promise(async(e,a)=>{const i=[];let s=0;u.onerror=e=>{n.error("Failed to open cursor:",e),a("Failed to open cursor")},u.onsuccess=a=>{const c=a.target.result;if(c){const a=function(e){for(var t=1;t=r){++s;const e=c.delete();De(e,n)}else{const e=c.update(u);De(e,n)}i.length{const{transaction:t,objectStore:n}=await this.getObjectStoreAndTransaction("readwrite");try{const r=e.map(e=>this.deleteItem(n,e));await Ne(t,this.logger),await Promise.all(r)}catch(e){throw this.logger.warn("Failed to delete items from indexeddb.",e),e}}),o()(this,"getItemCount",async()=>{const{transaction:e,objectStore:t}=await this.getObjectStoreAndTransaction("readonly"),n=t.index("timeToBeProcessedAfter"),r=IDBKeyRange.upperBound(Date.now()),o=n.count(r),a=await Ce(o);return await Ne(e,this.logger),a.target.result}),o()(this,"processItems",async(e,t=7)=>{const n=await this.getItems(t),{items:r}=n,o=ye()(n,Re);try{const t=await e(r,o),n=r.map(e=>e.id);return await this.deleteItems(n),t}catch(e){throw new Ee(e)}}),o()(this,"deleteItem",async(e,t)=>{const{logger:n}=this;try{await Ce(e.delete(t))}catch(e){throw n.error("Failed to delete item:",t,e),e}}),o()(this,"getObjectStoreAndTransaction",async e=>{const t=(await this.db).transaction("analytics-resilience",e),n=t.objectStore("analytics-resilience");return{transaction:t,objectStore:n}}),this.options=Ie(t),this.namespace=e,this.logger=this.options.logger,!window.indexedDB)throw new ge;this.db=this.startDB(),this.db.catch(()=>{}),this.globalEventLimitGuard=new we(this.options.maxEventLimit,this.namespace,this.logger,this.deleteItem)}storeType(){return pe.INDEXEDDB}}class Le{constructor(e,t){if(o()(this,"insertItemsToMemoryStore",(e,t)=>{switch(t){case me.ABANDON:return this.handleAbandonIfLimitWillExceedPolicy(e);case me.EVICT:return Promise.resolve(this.handleEvictOldestIfLimitExceededPolicy(e));case me.IGNORE:return this.handleAddAsManyAsPossible(e)}}),!(e>0))throw Error("Event Limit has to be set higher than 1");this.eventLimit=e,this.memoryItemHandlers=t}async handleAbandonIfLimitWillExceedPolicy(e){if(await this.memoryItemHandlers.getItemCount()+e.length>this.eventLimit)throw new be(pe.MEMORY);return this.memoryItemHandlers.addItems(e),{items:e,numberOfEvictedItems:0}}handleEvictOldestIfLimitExceededPolicy(e){this.memoryItemHandlers.addItems(e);return{items:e,numberOfEvictedItems:this.memoryItemHandlers.evictEventsIfNeeded(this.eventLimit)}}async handleAddAsManyAsPossible(e){const t=this.eventLimit-await this.memoryItemHandlers.getItemCount(),n=t>e.length?e:e.slice(0,t);return this.memoryItemHandlers.addItems(n),{items:n,numberOfEvictedItems:0}}}const xe=["item"],Fe=["items"];function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t{let{item:t}=e,n=ye()(e,xe);return Oe(t,this.namespace,n)});return this.bulkAddItemWrapperType(n,t)}bulkAddItemWrapperType(e,t=me.ABANDON){return Promise.resolve(this.globalEventLimitGuard.insertItemsToMemoryStore(e,t))}getItems(e=7){return Promise.resolve(this.synchronousGetItems(e))}synchronousGetItems(e=7){const t=e>0?e:7,n=Date.now(),r=[],o=[];for(let e of this.memoryStore)if(e.timeToBeProcessedAfter<=n&&(r.push(Be({},e)),e.timeToBeProcessedAfter+=6e4,e.retryAttempts+=1,e.retryAttempts>=this.options.maxAttempts&&o.push(e)),r.length>=t)break;return o.forEach(e=>{const t=this.memoryStore.indexOf(e);this.memoryStore.splice(t,1)}),{items:r,numberOfDeletedItems:o.length}}deleteItems(e){return this.memoryStore=this.memoryStore.filter(t=>!e.includes(t.id)),Promise.resolve(void 0)}getItemCount(){const e=Date.now(),t=this.memoryStore.filter(t=>t.timeToBeProcessedAfter<=e).length;return Promise.resolve(t)}async processItems(e,t){const n=this.synchronousGetItems(t),{items:r}=n,o=ye()(n,Fe),a=r.map(e=>e.id);try{const t=await e(r,o);return await this.deleteItems(a),t}catch(e){throw new Ee(e)}}storeType(){return pe.MEMORY}addItems(e){this.memoryStore.push(...e),this.memoryStore.sort((function(e,t){return e.timeAdded-t.timeAdded}))}evictEventsIfNeeded(e){const t=this.memoryStore.length;if(t>e){const n=t-e;return this.memoryStore.splice(0,n),n}return 0}}var je=class{constructor(e,t={}){if(this.namespace=e,this.options=Ie(t),!e||0===e.length||"string"!=typeof e)throw new Error("Invalid namespace provided");this.resilience=this.getResilienceMechanism(e,t)}getResilienceMechanism(e,t){if(!t.useMemory)try{return new Me(e,t)}catch(e){var n;if(!(e instanceof ge))null===(n=t.logger)||void 0===n||n.warn("Attempted to create IndexedDbResilience but failed. Using memory instead.")}return new $e(this.namespace,t)}addItem(e,t,n=me.ABANDON){return this.runOrFailOver(()=>this.resilience.addItem(e,t,n))}bulkAddItem(e,t=me.ABANDON){return this.runOrFailOver(()=>this.resilience.bulkAddItem(e,t))}getItems(e){return this.runOrFailOver(()=>this.resilience.getItems(e))}deleteItems(e){return this.runOrFailOver(()=>this.resilience.deleteItems(e))}getItemCount(){return this.runOrFailOver(()=>this.resilience.getItemCount())}processItems(e,t){return this.runOrFailOver(()=>this.resilience.processItems(e,t))}storeType(){return this.resilience.storeType()}async runOrFailOver(e){try{return await e()}catch(t){if(Ae(t))throw t;return this.resilience.storeType()===pe.INDEXEDDB&&await this.failOver(),e()}}async failOver(){const e=this.resilience,t=new $e(this.namespace,this.options);this.resilience=t;try{const{items:n}=await e.getItems(this.options.maxEventLimit);if(n.length>0){const r=(await t.bulkAddItemWrapperType(n,me.IGNORE)).items.map(e=>e.id);await e.deleteItems(r)}}catch(e){this.options.logger.warn("Unexpected error from ResilienceDb, switching to MemoryDb")}}};let Ue=function(e){return e.INDEXEDDB="indexeddb",e.MEMORY="memory",e}({}),He=function(e){return e[e.ONLINE=0]="ONLINE",e[e.OFFLINE=1]="OFFLINE",e}({});class Ye{constructor(){o()(this,"itemsDiscardedByRetry",0),o()(this,"eventCount",0),o()(this,"itemsDiscardedByOverflow",0),o()(this,"resilienceMechanism",Ue.INDEXEDDB),o()(this,"localstorageNumberOfQueuesPurged",0),o()(this,"localstorageNumberOfFullReclaims",0),o()(this,"localstorageNumberOfPartialReclaims",0),o()(this,"localstorageNumberOfFailedReclaims",0)}addToItemsDiscardedByRetryCounter(e=1){this.itemsDiscardedByRetry+=e}addToEventCount(){this.eventCount++}addToItemsDiscardedByOverflowCounter(e=1){this.itemsDiscardedByOverflow+=e}setResilienceMechanism(e){this.resilienceMechanism=e}addToReclaimMetrics(e){this.localstorageNumberOfFullReclaims+=e.fullReclaims,this.localstorageNumberOfPartialReclaims+=e.partialReclaims,this.localstorageNumberOfFailedReclaims+=e.failedReclaims}addToPurgedQueuesMetrics(e){this.localstorageNumberOfQueuesPurged+=e}subtractFromMetrics(e){this.itemsDiscardedByRetry=this.subtractFromCount(this.itemsDiscardedByRetry,e.itemsDiscardedByRetry),this.eventCount=this.subtractFromCount(this.eventCount,e.eventCount),this.itemsDiscardedByOverflow=this.subtractFromCount(this.itemsDiscardedByOverflow,e.itemsDiscardedByOverflow),this.localstorageNumberOfFullReclaims=this.subtractFromCount(this.localstorageNumberOfFullReclaims,e.fullReclaims),this.localstorageNumberOfPartialReclaims=this.subtractFromCount(this.localstorageNumberOfPartialReclaims,e.partialReclaims),this.localstorageNumberOfFailedReclaims=this.subtractFromCount(this.localstorageNumberOfFailedReclaims,e.failedReclaims),this.localstorageNumberOfQueuesPurged=this.subtractFromCount(this.localstorageNumberOfQueuesPurged,e.localstorageQueuesPurged)}subtractFromCount(e,t){return Math.max(e-(t||0),0)}getMetricsPayload(){return{itemsDiscardedByRetry:this.itemsDiscardedByRetry,eventCount:this.eventCount,itemsDiscardedByOverflow:this.itemsDiscardedByOverflow,resilienceMechanism:this.resilienceMechanism,localstorageQueuesPurged:this.localstorageNumberOfQueuesPurged,fullReclaims:this.localstorageNumberOfFullReclaims,partialReclaims:this.localstorageNumberOfPartialReclaims,failedReclaims:this.localstorageNumberOfFailedReclaims}}}let Ge=null;var We=()=>(Ge||(Ge=new Ye),Ge);class Ve{constructor(e){window.addEventListener("offline",()=>e(He.OFFLINE)),window.addEventListener("online",()=>e(He.ONLINE))}getNetworkStatus(){return window.navigator.onLine?He.ONLINE:He.OFFLINE}}let Ke=function(e){return e.IDLE="idle",e.RUNNING="running",e.COMPLETED="completed",e.TIMED_OUT="timedOut",e}({}),ze=function(e){return e.EXECUTE="execute",e.COMPLETE="complete",e.TIMEOUT="timeout",e}({});class qe{constructor(e){if(o()(this,"timeoutHandle",void 0),o()(this,"callbackStatus",Ke.IDLE),!(e>0))throw new Error("CallbackWithTimeout requires timeout period higher than 0");this.timeoutPeriod=e}transitionCallbackStatus(e,t){switch(e){case Ke.IDLE:case Ke.TIMED_OUT:case Ke.COMPLETED:t===ze.EXECUTE&&(this.callbackStatus=Ke.RUNNING);break;case Ke.RUNNING:switch(t){case ze.COMPLETE:this.callbackStatus=Ke.COMPLETED;break;case ze.TIMEOUT:this.callbackStatus=Ke.TIMED_OUT}break;default:this.callbackStatus=e}}executeCallbackWithTimeout(e,t,n){this.transitionCallbackStatus(this.callbackStatus,ze.EXECUTE),this.timeoutHandle=window.setTimeout(()=>{this.transitionCallbackStatus(this.callbackStatus,ze.TIMEOUT),n()},this.timeoutPeriod),e(e=>{this.cancelTimeout(),this.getCallbackStatus()!==Ke.TIMED_OUT&&(this.transitionCallbackStatus(this.callbackStatus,ze.COMPLETE),t(e))})}getCallbackStatus(){return this.callbackStatus}cancelTimeout(){this.timeoutPeriod>0&&this.timeoutHandle&&(window.clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0)}}let Xe=function(e){return e[e.NOOP=0]="NOOP",e[e.SUCCESS=1]="SUCCESS",e[e.ERROR=2]="ERROR",e}({});const Je=1e3,Qe=3e4,Ze=2,et=0,tt=500,nt=5e3;let rt=function(e){return e[e.NONE=0]="NONE",e[e.IMMEDIATE=1]="IMMEDIATE",e[e.WAIT=2]="WAIT",e}({});class ot{constructor(e,t){o()(this,"schedule",({immediate:e}={immediate:!1})=>{this.operationInFlight?e?this.queuedSchedule=rt.IMMEDIATE:this.queuedSchedule!==rt.IMMEDIATE&&(this.queuedSchedule=rt.WAIT):(e||this.options.waitInterval<=0)&&0===this.failureCount?(this.clearTimeout(),this.run()):this.failureCount>0&&null===this.scheduledTimeout?this.scheduledTimeout=window.setTimeout(this.run,this.calculateBackoff()):null===this.scheduledTimeout&&(this.scheduledTimeout=window.setTimeout(this.run,this.options.waitInterval))}),o()(this,"stop",()=>{this.clearTimeout(),this.queuedSchedule=rt.NONE}),o()(this,"getFailureCount",()=>this.failureCount),o()(this,"getCallbackStatus",()=>this.callbackTimer.getCallbackStatus()),o()(this,"clearTimeout",()=>{null!==this.scheduledTimeout&&(window.clearTimeout(this.scheduledTimeout),this.scheduledTimeout=null)}),o()(this,"run",()=>{this.operationInFlight=!0,this.clearTimeout();try{this.callbackTimer.executeCallbackWithTimeout(this.callback,this.done,()=>this.done(Xe.ERROR))}catch(e){this.done(e)}}),o()(this,"done",e=>{this.operationInFlight=!1,e===Xe.ERROR||this.callbackTimer.getCallbackStatus()===Ke.TIMED_OUT?(this.failureCount++,this.clearTimeout()):e===Xe.SUCCESS&&(this.failureCount=0),this.processQueuedSchedule()}),o()(this,"processQueuedSchedule",()=>{if(this.queuedSchedule!==rt.NONE){const e=this.queuedSchedule===rt.IMMEDIATE;this.queuedSchedule=rt.NONE,this.schedule({immediate:e})}else this.failureCount>0&&this.schedule()}),o()(this,"calculateBackoff",()=>{const{minRetryDelay:e,maxRetryDelay:t,backoffFactor:n,backoffJitterPercentage:r}=this.options;let o=e*n**this.failureCount;if(r){const e=Math.random(),t=Math.floor(e*r*o);Math.floor(10*e)<5?o-=t:o+=t}return Number(Math.min(o,t).toPrecision(1))}),this.options={minRetryDelay:e.minRetryDelay||Je,maxRetryDelay:e.maxRetryDelay||Qe,backoffFactor:e.backoffFactor||Ze,backoffJitterPercentage:e.backoffJitterPercentage||et,waitInterval:void 0!==e.waitInterval?e.waitInterval:tt,callbackTimeoutPeriod:e.callbackTimeoutPeriod||nt},this.scheduledTimeout=null,this.failureCount=0,this.callback=t,this.operationInFlight=!1,this.queuedSchedule=rt.NONE,this.callbackTimer=new qe(this.options.callbackTimeoutPeriod)}}function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function it(e){for(var t=1;t{e===He.OFFLINE?this.scheduler.stop():this.checkEventCountAndReschedule()})}start(e){this.batchFlushCallback=e,this.longPollingScheduler.schedule()}stop(){this.scheduler.stop(),this.longPollingScheduler.stop()}async addItem(e){const t=JSON.parse(JSON.stringify(e)),{numberOfEvictedItems:n}=await this.resilience.addItem(t,{},me.EVICT);this.scheduler.schedule(),this.metricsCollector.addToEventCount(),n>0&&this.metricsCollector.addToItemsDiscardedByOverflowCounter(n)}getGlobalRetryCount(){return this.scheduler.getFailureCount()}async scheduleCallback(e){if(this.networkStatus.getNetworkStatus()!==He.OFFLINE)try{e(await this.resilience.processItems(this.flush.bind(this),this.options.batchFlushSize))}catch(t){if("CallbackProcessingError"===t.name)return void e(Xe.ERROR)}finally{await this.checkEventCountAndReschedule()}else e(Xe.NOOP)}async checkEventCountAndReschedule(){const e=await this.resilience.getItemCount();e>0&&this.scheduler.schedule({immediate:e>=this.options.batchFlushSize})}async scheduleLongCallBack(e){const t=(e=>{if("string"!=typeof e||0===e.length)return 0;try{const t=Object.keys(localStorage).filter(t=>t&&t.startsWith(e+".")||!1).map(e=>e.split(".")).filter(e=>3===e.length&&ce.includes(e[2])).reduce((e,t)=>{const[,n,r]=t;return void 0===e[n]&&(e[n]={}),e[n][r]=!0,e},{}),n=Object.keys(t).filter(e=>!0!==t[e][ae.ACK]);return n.forEach(t=>{const{queue:n,inProgress:r,reclaimStart:o,reclaimEnd:a}=se(e,t);localStorage.removeItem(r),localStorage.removeItem(n),localStorage.removeItem(o),localStorage.removeItem(a)}),n.length}catch(e){}return 0})(this.queuePrefix);this.metricsCollector.addToPurgedQueuesMetrics(t);const n=await fe(this.queuePrefix,async e=>{const t=e.map(e=>({item:e.item,retryAttempts:e.attemptNumber,id:e.id})),{items:n}=await this.resilience.bulkAddItem(t,me.IGNORE);return n.length===t.length?{status:"successful"}:{status:"partial",acceptedItemIds:n.map(e=>e.id)}});this.metricsCollector.addToReclaimMetrics(n),await this.checkEventCountAndReschedule(),e(Xe.SUCCESS),this.longPollingScheduler.schedule()}flush(e,t){this.metricsCollector.setResilienceMechanism(this.resilience.storeType());const{batchFlushCallback:n}=this;if(!n)throw new Error("batchFlushCallback has not been set. Call PullBatchableQueue#start first.");return new Promise((r,o)=>{if(e.length<=0)return void r(Xe.NOOP);const a=e.map(e=>{const t=e.item;return e.retryAttempts>0&&t.msg&&(t.msg._metadata||(t.msg._metadata={}),t.msg._metadata.failedAttempts=e.retryAttempts),t});n(a,e=>{e?(t.numberOfDeletedItems>0&&this.metricsCollector.addToItemsDiscardedByRetryCounter(t.numberOfDeletedItems),o(e)):r(Xe.SUCCESS)})})}buildOptions(e){return{backoffFactor:(null==e?void 0:e.backoffFactor)||ct,backoffJitterPercentage:void 0!==(null==e?void 0:e.backoffJitterPercentage)?e.backoffJitterPercentage:ut,batchFlushSize:(null==e?void 0:e.batchFlushSize)||lt,flushBeforeUnload:(null==e?void 0:e.flushBeforeUnload)||dt,flushWaitMs:(null==e?void 0:e.flushWaitMs)||ht,maxItems:(null==e?void 0:e.maxItems)||ft,maxAttempts:(null==e?void 0:e.maxAttempts)||_t,maxRetryDelay:(null==e?void 0:e.maxRetryDelay)||pt,minRetryDelay:(null==e?void 0:e.minRetryDelay)||mt}}}let bt=function(e){return e.IDENTIFY="identify",e.PAGE="page",e.TRACK="track",e}({});function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;tfunction(e,t){if(!(t&&t instanceof Function))return e;if(e.msg.type===bt.PAGE||e.msg.type===bt.TRACK){const n=t();n&&Array.isArray(n)&&(e.msg.properties=Tt(Tt({},e.msg.properties),{},{xid:n}))}else if(e.msg.traits&&e.msg.type===bt.IDENTIFY){const n=t();n&&Array.isArray(n)&&(e.msg.traits=Tt(Tt({},e.msg.traits),{},{xid:n}))}return e}(e,n))}catch(t){return e}}var vt=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function yt(e,t){if(e.length!==t.length)return!1;for(var n=0;n{var t;const n=null===(t=Nt(e))||void 0===t?void 0:t.signal,r=Dt(e.url),a=await fetch(e.url,function(e){for(var t=1;t=500&&a.status<600)throw new Error(`HTTP Error ${a.status} (${a.statusText})`);return a},Nt=e=>{if(e.abortController)return e.abortController;if(e.timeout){const t=new AbortController;return setTimeout(()=>{t.abort()},e.timeout),t}},Dt=Ot(e=>new URL(e).origin===location.origin?{}:{mode:"cors",credentials:"include"});function wt(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function St(e){return(St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rt(e){wt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===St(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function kt(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function Mt(e){wt(1,arguments);var t=Rt(e);return t.setHours(0,0,0,0),t}function Lt(e,t){wt(2,arguments);var n=Mt(e),r=Mt(t),o=n.getTime()-kt(n),a=r.getTime()-kt(r);return Math.round((o-a)/864e5)}function xt(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var Ft=n(13),Pt=n.n(Ft);const Bt={expires:365,secure:"https:"===window.location.protocol,path:"/"};var $t=new class{constructor(){o()(this,"_data",{}),o()(this,"length",0),o()(this,"setItem",(e,t)=>(this._data[e]=t,this.length=Object.keys(this._data).length,t)),o()(this,"getItem",e=>e in this._data?this._data[e]:null),o()(this,"removeItem",e=>(e in this._data&&delete this._data[e],this.length=Object.keys(this._data).length,null)),o()(this,"clear",()=>{this._data={},this.length=0}),o()(this,"key",e=>Object.keys(this._data)[e])}};function jt(e){if(!e)return!1;try{const t="awc.storage.support";e.setItem(t,"test_value");const n=e.getItem(t);return e.removeItem(t),"test_value"===n}catch(e){return!1}}class Ut{constructor(e,t={}){o()(this,"getStore",()=>this._store),o()(this,"getItem",e=>this._store.getItem(this.createKey(e))),o()(this,"removeItem",e=>this._store.removeItem(this.createKey(e))),o()(this,"setItem",(e,t)=>{try{this._store.setItem(this.createKey(e),t)}catch(n){(function(e){let t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this.swapToInMemory(),this._store.setItem(this.createKey(e),t))}}),o()(this,"swapToInMemory",()=>{if(this._store===$t)return;const e=Object.keys(this._store||{});let t;jt(window.awcInMemoryStorageFallback)?t=window.awcInMemoryStorageFallback:(t=$t,window.awcInMemoryStorageFallback||(window.awcInMemoryStorageFallback=$t)),e.forEach(e=>{if(0===e.indexOf(this.getPrefix())){const n=this._store.getItem(e);n&&t.setItem(e,n)}}),this._store=t}),o()(this,"clear",()=>this._store.clear()),o()(this,"key",e=>this._store.key(e)),o()(this,"getPrefix",()=>this._prefix),o()(this,"createKey",e=>this._prefix?`${this.getPrefix()}.${e}`:e),this.options=t;const n=[];(void 0===t.useStoragePrefix||t.useStoragePrefix)&&n.push("awc"),t.envPrefix&&t.envPrefix!==s.PROD&&n.push(t.envPrefix),this._prefix=n.join("-"),jt(e)?this._store=e:this.swapToInMemory()}}var Ht=class extends Ut{constructor(e){let t;try{t=window.localStorage||$t}catch(e){t=$t}super(t,e)}};class Yt{constructor(){this.safeStorage=new Ht({useStoragePrefix:!1})}set(e,t){return this.safeStorage.setItem(e,t),t}get(e){return this.safeStorage.getItem(e)||void 0}remove(e){this.safeStorage.removeItem(e)}}const Gt=Ot(()=>{const{hostname:e}=location,t=e.split(".");for(let e=1;e<=t.length;e++){const n="."+t.slice(-1*e).join(".");if(Pt.a.set("__awc_tld_test__","tld_test",{domain:n}),"tld_test"===Pt.a.get("__awc_tld_test__"))return Pt.a.remove("__awc_tld_test__",{domain:n}),n}return e});function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t=7)&&(t=!0),e.type){case"SAFE":return t&&this.setAnonymousId(e.anonymousId),e.anonymousId;case"UNSAFE":return e.anonymousId;case"NOT_FOUND":default:return null}}getAnonymousIdFromCookieAndUpdateLocalStorage(){const e=this.getAnonymousIdFromStorage("COOKIE");switch(e.type){case"SAFE":case"UNSAFE":return this.store.setItem("ajs_anonymous_id",JSON.stringify(e.anonymousId)),e.anonymousId;case"NOT_FOUND":default:return null}}generateNewAnonymousId(){const e=i()();return this.setAnonymousId(e),e}}var qt=n(88),Xt=n.n(qt);function Jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t{const t=en(e);return Xt()(t)},en=e=>{if(null===e||"object"!=typeof e)return e;const t={};return Object.keys(e).forEach(n=>{const r=tn(e,n);void 0!==r&&(Array.isArray(r)?t[n]=r.map(e=>en(e)):t[n]="object"==typeof r&&null!==r?en(r):r)}),t},tn=(e,t)=>e[t];function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t{const n=this.resilienceQueue.getGlobalRetryCount(),r=this.metrics.getMetricsPayload(),o=rn(rn({},r),{},{httpRetryCount:n});for(let e in o)0===o[e]&&delete o[e];const a=await this.attachXIDs(e),i=(new Date).toISOString(),s={batch:a.map(e=>(e.msg.sentAt=i,e.msg)),sentAt:i,metadata:o};try{const e=await Ct({url:this.gasv3BatchUrl,batch:s,timeout:this.options.requestTimeout});this.metrics.subtractFromMetrics(r),t(null,e)}catch(e){t(e,null)}}),this.user=new zt,this.options=rn(rn({},e),{},{requestTimeout:e.requestTimeout||1e4,retryQueueOptions:e.retryQueueOptions||{},logger:e.logger||console}),this.xidPromiseCallback=e.xidPromiseGetter(),this.gasv3BatchUrl=`${e.apiHostProtocol}://${e.apiHost}/batch`,this.metrics=We(),this.resilienceQueue=((e,t,n,r)=>new gt(e,t,n||{},r))(e.retryQueuePrefix,e.product,this.options.retryQueueOptions,this.options.logger),this.resilienceQueue.start(this.sendEvents)}getUser(){return this.user}async track(e,t,n,r){const o=rn(rn({},this.buildBaseEvent(n,bt.TRACK,t)),{},{type:bt.TRACK,properties:Zt(t),event:e}),a=rn(rn({},o),{},{messageId:this.createMessageId()}),i=this.packageEvent(a);await this.resilienceQueue.addItem(i),r&&r()}async page(e,t,n,r){const o=rn(rn({},this.buildBaseEvent(n,bt.PAGE,t)),{},{type:bt.PAGE,properties:Zt(t),name:e}),a=rn(rn({},o),{},{messageId:this.createMessageId()}),i=this.packageEvent(a);await this.resilienceQueue.addItem(i),r&&r()}async identify(e,t,n,r){const o=rn(rn({},this.buildBaseEvent(n,bt.IDENTIFY,t)),{},{type:bt.IDENTIFY,traits:Zt(t)}),a=rn(rn({},o),{},{messageId:this.createMessageId()}),i=this.packageEvent(a);await this.resilienceQueue.addItem(i),r&&r()}buildBaseEvent(e,t,n){return{context:(e=>Qt(Qt({},e.context),{},{userAgent:navigator.userAgent}))(Zt(e)),timestamp:(new Date).toISOString(),type:t,userId:this.user.getUserId(),anonymousId:n.anonymousId||this.user.getAnonymousId()}}createMessageId(){return"ajs-"+i()()}packageEvent(e){const{apiHost:t,apiHostProtocol:n}=this.options;return{headers:{"Content-Type":"text/plain"},msg:e,url:`${n}://${t}/${e.type.charAt(0)}`}}async attachXIDs(e){return this.xidPromiseCallback?At(e,this.xidPromiseCallback):Promise.resolve(e)}}var an=n(24);const sn=e=>window.history.replaceState({},"",e);var cn=(e,t=sn)=>{const n=window.location.href,r=window.location.hash,o=""!==r?n.replace(r,""):n,{url:a,query:i}=Object(an.parseUrl)(o),s=(c=i,u=e,Object.keys(c).filter(e=>u(c[e],e)).reduce((e,t)=>(e[t]=c[t],e),{}));var c,u;if(Object.keys(s).length>0){const n=((e,t)=>Object.keys(e).filter(n=>!t(e[n],n)).reduce((t,n)=>(t[n]=e[n],t),{}))(i,e);if(Object.keys(n).length>0){t(`${a}?${Object(an.stringify)(n)}${r}`)}else t(`${a}${r}`)}return s};class un{constructor(){o()(this,"handleOriginParameters",(e,t)=>{const n=Object.keys(e);if(!(n.length>0))throw new Error("Empty parameter mapping provided");const r=n.filter(e=>Object.values(m).indexOf(e)<0);if(r.length>0)throw new Error(`Invalid Origin Tracing Parameter(s) supplied: ${r.join()}!`);const o=cn((e,t)=>n.indexOf(t)>=0,t);return Object.keys(o).map(t=>({[t]:e[t](o[t])})).reduce((e,t)=>Object.assign(e,t),{})}),this._originStore={}}}const ln=/^\d+$/;class dn{constructor(e={}){o()(this,"_generateNewSessionId",()=>{const e=Date.now().toString();return this._safeLocalStorage.setItem("session.id",e),e}),o()(this,"_updateSessionExpiry",()=>{const e=Date.now()+this._sessionExpiryTime;return this._safeLocalStorage.setItem("session.expiry",e.toString()),e}),o()(this,"_debouncedUpdateSessionExpiry",e=>{const{_updateSessionExpiry:t}=this;if(e{t()},this._sessionExpiryDebounce)}),this._sessionExpiryTime=e.sessionExpiryTime||18e5,this._sessionExpiryDebounce=e.sessionExpiryDebounce||5e3,this._sessionExpiryDebounceThresholdPercentage=e.sessionExpiryDebounceThresholdPercentage||.9,this._safeLocalStorage=new Ht}getCurrentSessionId(){const e=this._safeLocalStorage.getItem("session.id"),t=parseInt(this._safeLocalStorage.getItem("session.expiry")||"0",10)||0;return this._debouncedUpdateSessionExpiry(t),!e||t<=Date.now()||Number.isNaN(t)?this._generateNewSessionId():ln.test(e)?e:this._generateNewSessionId()}}var hn=class extends Ut{constructor(e){let t;try{t=window.sessionStorage||$t}catch(e){t=$t}super(t,e)}};class _n{constructor(){o()(this,"_generateNewTabId",()=>{const e=i()();return this._safeSessionStorage.setItem("tab.id",e),e}),this._safeSessionStorage=new hn}getCurrentTabId(){let e=this._safeSessionStorage.getItem("tab.id");return e||(e=this._generateNewTabId()),e}}function fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pn(e){for(var t=1;tnull===this._safeSessionStorage.getItem("taskSessions")||null===this._safeSessionStorage.getItem(mn)||parseInt(this._safeSessionStorage.getItem(mn)||"0",10)t.split("awc.")[1]),o()(this,"_isTaskSessionQueryParam",(e,t)=>t.startsWith("awc.")),o()(this,"getAllTaskSessions",()=>{try{return JSON.parse(this._safeSessionStorage.getItem("taskSessions")||"")}catch(e){return{}}}),o()(this,"_writeToSessionStorage",e=>{try{this._safeSessionStorage.setItem("taskSessions",JSON.stringify(e))}catch(e){}}),o()(this,"_appendTaskSessions",e=>{const t=this.getAllTaskSessions(),n=null===t?e:Object.assign(t,e);this._writeToSessionStorage(n)}),o()(this,"_safelyRemoveKey",(e,t)=>null===e?{}:(delete e[t],e)),o()(this,"createTaskSession",e=>{const t=i()(),n={};return n[e]=t,this._appendTaskSessions(n),t}),o()(this,"createTaskSessionWithProvidedId",(e,t)=>{if("string"!=typeof t)throw new TypeError("invalid taskSessionId, must be string");const n={};n[e]=t,this._appendTaskSessions(n)}),o()(this,"completeTaskSession",e=>{const t=this.getAllTaskSessions(),n=this._safelyRemoveKey(t,e);this._writeToSessionStorage(n)}),o()(this,"formatTaskSessionQueryString",({uri:e,includedTaskSessions:t})=>{const{url:n,query:r}=Object(an.parseUrl)(e),o=this.getAllTaskSessions(),a=t?(i=o,t.reduce((e,t)=>(t in i&&(e[t]=i[t]),e),{})):G(o,Object.values(m));var i;if(0===Object.keys(a).length)return e;const s=pn(pn({},Y(a,(e,t)=>"awc."+t)),r);return`${n}?${Object(an.stringify)(s)}`}),o()(this,"stripQueryParameters",()=>{const e=Y(cn(this._isTaskSessionQueryParam),this._removeTaskSessionPrefix);this._appendTaskSessions(e)});const e=Date.now();this._safeSessionStorage=new hn;try{this._taskSessionsNotRecentlyInitialised(e)&&(this._writeToSessionStorage({}),this._safeSessionStorage.setItem(mn,e.toString()))}catch(e){}}}var bn=class{constructor(){o()(this,"_bind",()=>{window.testAnalytics||(window.testAnalytics={eventCache:[],events:()=>window.testAnalytics.eventCache,clear:()=>{window.testAnalytics.eventCache=[];try{localStorage.removeItem("awc.ui.viewed.last.sent"),localStorage.removeItem("awc-staging.ui.viewed.last.sent"),localStorage.removeItem("awc-dev.ui.viewed.last.sent"),localStorage.removeItem("awc-local.ui.viewed.last.sent")}catch(e){}}})}),o()(this,"_cache",e=>{window.testAnalytics.eventCache.length>=100&&(window.testAnalytics.eventCache=window.testAnalytics.eventCache.slice(1,window.testAnalytics.eventCache.length)),window.testAnalytics.eventCache.push(e)}),o()(this,"_shouldCacheEvent",()=>this._isDebugCookieEnabled),o()(this,"saveEvent",e=>{e&&this._shouldCacheEvent()&&(window.testAnalytics||this._bind(),e.tags instanceof Array?e.tags.push("synthetic"):e.tags=["synthetic"],this._cache(e))}),this._isDebugCookieEnabled=(()=>{try{return JSON.parse(Pt.a.get("atlassian_analytics_debug")||"false")}catch(e){Pt.a.remove("atlassian_analytics_debug")}return!1})(),this._isDebugCookieEnabled&&this._bind()}};const En=["embeddedProduct"];function Tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function An(e){for(var t=1;t{this._startInterval(),this._bindEventListeners()}),o()(this,"stop",()=>{this._stopInterval(),this._unbindEventListeners()}),o()(this,"resetTimers",()=>{this._intervalId&&(this.stop(),this.start())}),o()(this,"_bindEventListeners",()=>{window.addEventListener("focus",this._focusListener),window.addEventListener("blur",this._blurListener)}),o()(this,"_unbindEventListeners",()=>{window.removeEventListener("focus",this._focusListener),window.removeEventListener("blur",this._blurListener)}),o()(this,"_startInterval",()=>{clearInterval(this._intervalId),this._intervalId=setInterval(this._handleInterval,this._delay)}),o()(this,"_stopInterval",()=>{this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)}),o()(this,"_getProductKey",(e,t)=>{let n=e;return t&&(n+="-"+t),n}),o()(this,"_getLastSentTimestamp",(e,t,n)=>(((this._parseLocalStorageData()||{})[n]||{})[t]||{})[e]||null),o()(this,"_parseLocalStorageData",()=>{const e=this._safeLocalStorage.getItem(this._storageKey);try{return JSON.parse(e||"")}catch(e){return this._safeLocalStorage.removeItem(this._storageKey),null}}),o()(this,"_setLastSentTimestamp",(e,t,n)=>{const r=this._parseLocalStorageData()||{},o=r[n]||{},a=o[t]||{};a[e]=Date.now(),o[t]=a,r[n]=o,this._safeLocalStorage.setItem(this._storageKey,JSON.stringify(r))}),o()(this,"_shouldSendEvent",(e,t,n,r)=>{if(!document.hasFocus())return!1;if(t!==d.NONE&&!n||!r)return!1;return Date.now()-this._getLastSentTimestamp(e,n,r)>this._throttle}),o()(this,"_handleInterval",()=>{const e=this._getContext(),{embeddedProduct:t}=e,n=ye()(e,En);this._sendEvent(this._product,n),t&&this._sendEvent(t,n,!0)}),o()(this,"_sendEvent",(e,t,n=!1)=>{const{subproduct:r,tenantIdType:o,tenantId:a,userId:i,lastScreenEvent:s,attributes:c}=t,u=this._getProductKey(e,r);if(this._shouldSendEvent(u,o,a,i)){this._setLastSentTimestamp(u,a,i);const t=this._createEvent(e,r,n,s,c);this._onEvent(t)}}),o()(this,"_createEvent",(e,t,n,r,o)=>{const a={product:e,source:"ui",action:"viewed",actionSubject:"ui",attributes:o};return n&&(a.subproduct=null,a.version=null,a.attributes=An(An({},a.attributes),{},{embeddedInEnv:this._productInfo.env,embeddedInProduct:this._productInfo.product,embeddedInSubproduct:t,embeddedInVersion:this._productInfo.version,embeddedInOrigin:this._productInfo.origin,embeddedInPlatform:this._productInfo.platform})),r&&(a.attributes=An(An({},a.attributes),{},{lastScreenEvent:{name:r.name,attributes:r.attributes}})),a}),!e)throw new Error("Missing productInfo");if(!e.product)throw new Error("Missing productInfo.product");if(!t)throw new Error("Missing getContext callback");if("function"!=typeof t)throw new Error("Invalid getContext, must be function");if(!n)throw new Error("Missing onEvent callback");if("function"!=typeof n)throw new Error("Invalid onEvent, must be function");this._productInfo=e,this._product=e.product,this._getContext=t,this._onEvent=n,this._delay=r.delay||2e3,this._throttle=r.throttle||36e5,this._storageKey=r.storageKey||"ui.viewed.last.sent",this._safeLocalStorage=new Ht({envPrefix:this._productInfo.env}),this._focusListener=()=>{this._startInterval()},this._blurListener=()=>{this._stopInterval()}}}function yn(e,t){return e&&"function"==typeof e?()=>{e(t)}:null}let On=function(e){return e.XC="xc",e.UID="uid",e}({});const In=(e,t)=>{if(e&&t&&"function"==typeof t){const e=()=>new Promise(e=>{setTimeout(()=>e(()=>[{type:On.XC,state:"TIMEOUT"},{type:On.UID,state:"TIMEOUT"}]),5e3)}),n=()=>t().catch(()=>()=>[{type:On.XC,state:"UNKNOWN"},{type:On.UID,state:"UNKNOWN"}]);return Promise.race([n(),e()])}};function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;tnull==e||e),o()(this,"_selectHost",({useStargate:e,env:t,useLegacyUrl:n})=>e?n?t===s.PROD?"api-private.atlassian.com/gasv3/api/v1":"api-private.stg.atlassian.com/gasv3/api/v1":window.location.host+"/gateway/api/gasv3/api/v1":t===s.PROD?"as.atlassian.com/api/v1":"as.staging.atl-paas.net/api/v1"),o()(this,"_endsWith",(e,t)=>-1!==e.indexOf(t,e.length-t.length)),o()(this,"_changeInternalUserId",(e,t)=>{this.eventProcessor.getUser().setUserId(e),t&&t!==this.eventProcessor.getUser().getAnonymousId()&&this.eventProcessor.getUser().setAnonymousId(t)}),o()(this,"_createSubproductGetter",e=>O(e,"Cannot get subproduct from the callback. Proceeding without it.")),o()(this,"_createEmbeddedProductGetter",e=>O(e,"Cannot get embeddedProduct from the callback. Proceeding without it.")),o()(this,"_getLastScreenEvent",()=>{try{return JSON.parse(this._safeSessionStorage.getItem("last.screen.event")||"")}catch(e){return this._safeSessionStorage.removeItem("last.screen.event"),null}}),o()(this,"_setLastScreenEvent",e=>{this._safeSessionStorage.setItem("last.screen.event",JSON.stringify({name:e.name,attributes:e.attributes}))}),o()(this,"_shouldEventBeDelayed",e=>{if(!e.tags||-1===e.tags.indexOf("measurement"))return!1;const t=!1!==e.highPriority;return this.eventDelayQueue.isDelayingLowPriorityEvents()&&!t}),o()(this,"_fireEvent",(e,t,n,r)=>{switch(t.eventType){case c.UI:case c.OPERATIONAL:case c.TRACK:return this.eventProcessor.track(e,t,n,r);case c.SCREEN:return this.eventProcessor.page(e,t,n,r);case c.IDENTIFY:return this.eventProcessor.identify(e,t,n,r);default:throw new Error("No handler has been defined for events of type "+t.eventType)}}),o()(this,"_fireDelayedEvent",(e,t,n,r)=>{try{this._changeInternalUserId(r.userId,r.anonymousId),t.tags=[...t.tags||[],"sentWithDelay"],this._fireEvent(e,t,n,void 0)}finally{this._changeInternalUserId(this._userInfo.userId,this._userInfo.anonymousId)}}),o()(this,"_delayEvent",(e,t,n,r,o)=>{this.eventDelayQueue.push(e,t,n,r),o&&o()}),o()(this,"_processEvent",(e,t,n,r)=>(this._testingCache.saveEvent(t),this._shouldEventBeDelayed(t)?(this._delayEvent(e,t,n,this._userInfo,r),Promise.resolve()):this._fireEvent(e,t,n,r))),o()(this,"setEmbeddedProduct",e=>{this._productInfo.embeddedProduct=this._createEmbeddedProductGetter(e),this.resetUIViewedTimers()}),o()(this,"clearEmbeddedProduct",()=>{this._productInfo.embeddedProduct=this._createEmbeddedProductGetter(null)}),o()(this,"setSubproduct",e=>{this._productInfo.subproduct=this._createSubproductGetter(e),this.resetUIViewedTimers()}),o()(this,"setOriginTracingHandlers",e=>{const t=this.originTracing.handleOriginParameters(e,this._historyReplaceFn);Object.keys(t).forEach(e=>{void 0!==t[e].taskSessionId&&this.task.createTaskSessionWithProvidedId(e,t[e].taskSessionId)});const n={};return Object.keys(t).forEach(e=>{t[e].originTracingAttributes?n[e]=t[e].originTracingAttributes:console.warn(`Handling method for origin parameter ${e} has not returned any attributes`)}),Object.keys(t).length>0?this.sendOperationalEvent({action:"landed",actionSubject:"origin",source:"webClient",attributes:{originTracesLanded:n}},()=>{}):Promise.resolve()}),o()(this,"setTenantInfo",(e,t)=>{if(!e)throw new Error("Missing tenantIdType");if(e!==d.NONE&&!t)throw new Error("Missing tenantId");if(!b(d,e))throw new Error(`Invalid tenantIdType '${e}', must be an tenantType: [${g(d)}]`);this._tenantInfo={tenantIdType:e,tenantId:t}}),o()(this,"clearTenantInfo",()=>{this._tenantInfo={}}),o()(this,"setOrgInfo",e=>{if(!e)throw new Error("Missing orgId");this._orgInfo={orgId:e}}),o()(this,"clearOrgInfo",()=>{this._orgInfo={}}),o()(this,"setWorkspaceInfo",e=>{if(!e)throw new Error("Missing workspaceId");this._workspaceInfo={workspaceId:e}}),o()(this,"clearWorkspaceInfo",()=>{this._workspaceInfo={}}),o()(this,"setUserInfo",(e,t)=>{!function(e,t){if(!e)throw new Error("Missing userIdType");if(!t)throw new Error("Missing userId");if(!b(h,e))throw new Error(`Invalid userIdType '${e}', must be an userType: [${g(h)}]`)}(e,t),this._changeInternalUserId(t),this._userInfo={userIdType:e,userId:t,anonymousId:this.eventProcessor.getUser().getAnonymousId()}}),o()(this,"clearUserInfo",()=>{this._changeInternalUserId(void 0),this._userInfo={anonymousId:this.eventProcessor.getUser().getAnonymousId()}}),o()(this,"getAnonymousId",()=>this._userInfo.anonymousId),o()(this,"setUIViewedAttributes",e=>{if(!e)throw new Error("Missing uiViewedAttributes");if("object"!=typeof e||Array.isArray(e))throw new Error("Invalid uiViewedAttributes type, should be a non array object");this._uiViewedAttributes=Nn({},e)}),o()(this,"getUIViewedAttributes",()=>this._uiViewedAttributes),o()(this,"clearUIViewedAttributes",()=>{this._uiViewedAttributes={}}),o()(this,"sendIdentifyEvent",(e,t,n)=>{this.setUserInfo(e,t);const r={userIdType:e,eventType:c.IDENTIFY};return this._processEvent(t,r,this._context,n)}),o()(this,"sendPageEvent",(e,t)=>this.sendScreenEvent(e,t)),o()(this,"sendScreenEvent",(e,t,n)=>{let r,o,a,i;"object"==typeof e?(r=e.name,o=e.attributes,a=e.containers,i=e.tags):(r=e,o=n),function(e){if(!e)throw new Error("Missing name")}(r),z(a);const s=Nn({name:r},j(this._productInfo,this._tenantInfo,this._userInfo,o,e.nonPrivacySafeAttributes,i,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this.task.getAllTaskSessions(),this._orgInfo,this._pageLoadId,this._workspaceInfo,e,a));return this._setLastScreenEvent(s),this._processEvent(r,s,this._context,yn(t,s))}),o()(this,"sendTrackEvent",(e,t)=>{!function(e){X(e)}(e);const n=H(this._productInfo,this._tenantInfo,this._userInfo,e,c.TRACK,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this.task.getAllTaskSessions(),this._orgInfo,this._pageLoadId,this._workspaceInfo);return this._processEvent(U(e),n,this._context,yn(t,n))}),o()(this,"sendUIEvent",(e,t)=>{!function(e){X(e)}(e);const n=H(this._productInfo,this._tenantInfo,this._userInfo,e,c.UI,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this.task.getAllTaskSessions(),this._orgInfo,this._pageLoadId,this._workspaceInfo);return this._processEvent(U(e),n,this._context,yn(t,n))}),o()(this,"sendOperationalEvent",(e,t)=>{!function(e){X(e)}(e);const n=H(this._productInfo,this._tenantInfo,this._userInfo,e,c.OPERATIONAL,this._tabTracking.getCurrentTabId(),this._sessionTracking.getCurrentSessionId(),this.task.getAllTaskSessions(),this._orgInfo,this._pageLoadId,this._workspaceInfo);return this._processEvent(U(e),n,this._context,yn(t,n))}),o()(this,"startUIViewedEvent",e=>{this.stopUIViewedEvent(),this._uiViewedEvent=new vn(this._productInfo,()=>({embeddedProduct:this._productInfo.embeddedProduct(),subproduct:this._productInfo.subproduct(),tenantIdType:this._tenantInfo.tenantIdType,tenantId:this._tenantInfo.tenantId,userId:this._userInfo.userId,lastScreenEvent:this._getLastScreenEvent(),attributes:this._uiViewedAttributes}),t=>this.sendUIEvent(t,e)),this._uiViewedEvent.start()}),o()(this,"stopUIViewedEvent",()=>{this._uiViewedEvent&&(this._uiViewedEvent.stop(),this._uiViewedEvent=null)}),o()(this,"resetUIViewedTimers",()=>{this._uiViewedEvent&&this._uiViewedEvent.resetTimers()}),o()(this,"startApdexEvent",e=>{this._apdexEvent.start(e)}),o()(this,"getApdexStart",e=>this._apdexEvent.getStart(e)),o()(this,"stopApdexEvent",(e,t)=>{this._apdexEvent.stop(e,t)}),o()(this,"startLowPriorityEventDelay",(e,t)=>{this.eventDelayQueue.startLowPriorityEventDelay(e,t)}),o()(this,"stopLowPriorityEventDelay",()=>{this.eventDelayQueue.stopLowPriorityEventDelay()}),o()(this,"onEvent",(e,t)=>{if(!t)throw new Error("Missing analyticsData");if(!t.eventType)throw new Error("Missing analyticsData.eventType");if(t.eventType===c.TRACK)return this.sendTrackEvent(t);if(t.eventType===c.UI)return this.sendUIEvent(t);if(t.eventType===c.OPERATIONAL)return this.sendOperationalEvent(t);if(t.eventType===c.SCREEN)return this.sendScreenEvent(t.name,null,t.attributes);if(t.eventType===c.IDENTIFY)return this.sendIdentifyEvent(t.userIdType,t.userId);throw new Error(`Invalid analyticsData.eventType '${t.eventType}', must be an eventType: [${g(c)}]`)}),!e)throw new Error("Missing productInfo");if(!e.env)throw new Error("Missing productInfo.env");if(!e.product)throw new Error("Missing productInfo.product");if(!b(s,e.env))throw new Error(`Invalid productInfo.env '${e.env}', must be an envType: [${g(s)}]`);if(e.origin){if(!b(l,e.origin))throw new Error(`Invalid productInfo.origin '${e.origin}', must be an originType: [${g(l)}]`)}else e.origin=l.WEB;e.platform?function(e){if(!b(u,e.platform))throw new Error(`Invalid productInfo.platform '${e.platform}', must be a platformType: [${g(u)}]`);if(e.origin===l.DESKTOP&&!b(f,e.platform))throw new Error(`Invalid productInfo.platform '${e.platform}', must be one of [mac, linux, windows]`);if(e.origin===l.WEB&&!b(p,e.platform))throw new Error(`Invalid productInfo.platform '${e.platform}', must be one of [web, mobileWeb]`)}(e):e.platform=e.origin===l.WEB?u.WEB:u.DESKTOP,this.logger=t.logger||console,this._productInfo=Nn(Nn({},e),{},{subproduct:this._createSubproductGetter(e.subproduct),embeddedProduct:this._createEmbeddedProductGetter(e.embeddedProduct)}),this._tenantInfo={},this._orgInfo={},this._uiViewedAttributes={},this._context=function(e){const t=window.screen||{};return{context:{locale:e.locale,screen:{width:t.width,height:t.height,density:window.devicePixelRatio},library:{name:"analytics.js",version:"4.14.3"}}}}(this._productInfo),this._safeSessionStorage=new hn;const n=this._useStargate(t.useStargate),r=t.apiHost||this._selectHost({useStargate:n,env:e.env,useLegacyUrl:t.useLegacyUrl}),a=t.apiHostProtocol||"https",_={maxRetryDelay:6e4,minRetryDelay:t.minRetryDelay||1e3,backoffFactor:2,flushWaitMs:t.flushWaitInterval,flushBeforeUnload:t.flushBeforeUnload},m="awc-"+e.env;this.eventProcessor=new on({apiHost:r,apiHostProtocol:a,product:e.product,retryQueuePrefix:m,retryQueueOptions:_,xidPromiseGetter:()=>In(t.xidConsent,t.xidPromiseFn),logger:this.logger}),this._userInfo={anonymousId:this.eventProcessor.getUser().getAnonymousId()},this._pageVisibility=new E,this._tabTracking=new _n,this._sessionTracking=new dn({sessionExpiryTime:t.sessionExpiryTime}),this.task=new gn,this.originTracing=new un,this._apdexEvent=new y(this.sendOperationalEvent,this._pageVisibility),this._historyReplaceFn="function"==typeof t.historyReplaceFn?t.historyReplaceFn:sn,this.eventDelayQueue=new oe(this._fireDelayedEvent,t.delayQueueCompressors||[]),this._testingCache=new bn,this._pageLoadId=i()(),this._workspaceInfo={}}}var wn=n(14),Sn=n.n(wn);function Rn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t{if(Sn.a.isUserCurrentlyOnPage)throw new Error("DwellTimeHelper should only be initialised once per page load.");this._initDwellTimeCounterAndPolling(),window.addEventListener("beforeunload",()=>{this.stop()})}),o()(this,"stop",()=>{Sn.a.isUserCurrentlyOnPage&&this._sendDwellEvent(this._eventData,this._searchSessionId,!0),Sn.a.stopAllTimers(),Sn.a.resetAllRecordedPageTimes(),Sn.a.timeElapsedCallbacks=[]}),o()(this,"newPage",(e,t)=>{J(e),this.stop(),this._eventData=e,this._searchSessionId=t,this._initDwellTimeCounterAndPolling()}),o()(this,"_initDwellTimeCounterAndPolling",()=>{Sn.a.initialize({idleTimeoutInSeconds:this._timing.idleTimeout}),this._pollDwellTime(this._timing.initialPollInterval,this._searchSessionId,this._eventData)}),o()(this,"_pollDwellTime",(e,t,n)=>{Sn.a.callAfterTimeElapsedInSeconds(e,()=>{this._sendDwellEvent(n,t,!1),this._pollDwellTime(e*this._timing.pollBackoffRate,t,n)})}),o()(this,"_sendDwellEvent",(e,t,n)=>{const r={dwellTime:Sn.a.getTimeOnCurrentPageInMilliseconds(),searchReferrer:t,finalDwellEvent:n};this._trackCallback({action:"dwelled",actionSubject:e.actionSubject,actionSubjectId:e.actionSubjectId,source:e.source,containerType:e.containerType,containerId:e.containerId,containers:e.containers,objectType:e.objectType,objectId:e.objectId,attributes:kn(kn({},r),e.attributes),tags:e.tags})}),!e)throw new Error("trackCallback is required for DwellTimeHelper");J(t),this._trackCallback=e,this._eventData=t,this._searchSessionId=n,this._timing=kn(kn({},Mn),r)}}var xn=n(89);function Fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pn(e){for(var t=1;te+e};class $n{constructor(e,t,n,r){if(o()(this,"start",()=>{this.browserInteractionTime.startTimer(),this.browserInteractionTime.addTimeIntervalEllapsedCallback({callback:e=>this._sendDwellEvent(this._eventData,this._searchSessionId,e,!1),timeInMilliseconds:this._timing.initialPollInterval,multiplier:this._timing.multiplierCallback}),window.addEventListener("beforeunload",this._onBeforeUnload)}),o()(this,"stop",()=>{this.browserInteractionTime.isRunning()&&this._sendDwellEvent(this._eventData,this._searchSessionId,this.browserInteractionTime.getTimeInMilliseconds(),!0),this.browserInteractionTime.stopTimer()}),o()(this,"newPage",(e,t)=>{J(e),this.stop(),this.browserInteractionTime.reset(),this.setEventData(e),this.setSearchSessionId(t),this.start()}),o()(this,"setEventData",e=>{this._eventData=e}),o()(this,"getEventData",()=>this._eventData),o()(this,"setSearchSessionId",e=>{this._searchSessionId=e}),o()(this,"getSearchSessionId",()=>this._searchSessionId),o()(this,"destroy",()=>{this.browserInteractionTime.destroy(),window.removeEventListener("beforeunload",this._onBeforeUnload)}),o()(this,"_onBeforeUnload",()=>{this.stop(),this.destroy()}),o()(this,"_sendDwellEvent",(e,t,n,r)=>{const o={dwellTime:n,searchReferrer:t,finalDwellEvent:r};this._trackCallback({action:"dwelled",actionSubject:e.actionSubject,actionSubjectId:e.actionSubjectId,source:e.source,containerType:e.containerType,containerId:e.containerId,objectType:e.objectType,objectId:e.objectId,attributes:Pn(Pn({},o),e.attributes),tags:e.tags})}),!e)throw new Error("trackCallback is required for DwellTimeHelper");J(t),this._trackCallback=e,this._eventData=t,this._searchSessionId=n,this._timing=Pn(Pn({},Bn),r),this.browserInteractionTime=new xn.a({idleTimeoutMs:this._timing.idleTimeout,checkCallbacksIntervalMs:500})}}function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Un(e){for(var t=1;tc.handleError.bind(new Error("setAttnStatus: "+e.message),"setAttnStatus"))},_=function(e){let t,n,r="";e&&(r=e.plan_id||"",t=e.is_org,n=e.org_name,function(e){let t=!1;if(e&&"undefined"!=typeof moment){const n=moment.tz.guess();n!==e&&(t=!0,$(".butler-account-tz").text(e),$(".butler-local-tz").text(n),$(".butler-update-tz-btn").off("click").click((function(){$.ajax(i+"settings/pup",{type:"POST",data:JSON.stringify({tz:n}),headers:{"X-Butler-Trello-Token":s.getActiveToken()}}).done((function(){$(".butler-timezone-warning").transition("fade")})).fail((function(){$(this).transition("shake")}))})),$(".butler-ignore-tz-btn").off("click").click((function(){$(".butler-timezone-warning").transition("fade")})))}$(".butler-timezone-warning").transition(t?"show":"hide")}(e.tz));const o=!r.match(/^TRELLO_/);$(".butler-account-type-legacy").transition(o?"show":"hide"),$(".butler-account-type-trello").transition(o?"hide":"show");TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});const a={".butler-bronze":"hide",".butler-enterprise-hide":"show",".butler-enterprise":"hide",".butler-free":"hide",".butler-gold":"hide",".butler-silver":"hide",".butler-standard":"hide",".butler-team":"hide",".butler-unlimited":"hide"},c=function(){for(var e=arguments.length,t=new Array(e),n=0;nr.startsWith(e))};c("ROYAL_TREATMENT")?a[".butler-gold"]="show":c("TRELLO_GOLD","SILVER_PLATTER")?a[".butler-silver"]="show":c("TRELLO_FREE")?a[".butler-free"]="show":c("TRELLO_STANDARD")?a[".butler-standard"]="show":c("TRELLO_BC","TRELLO_PREMIUM","TEAM")?(a[".butler-team"]="show",a[".butler-unlimited"]="show",a[".butler-enterprise-hide"]="hide"):c("TRELLO_ENTERPRISE","ENTERPRISE")?(a[".butler-enterprise"]="show",a[".butler-unlimited"]="show",a[".butler-enterprise-hide"]="hide"):a[".butler-bronze"]="show";for(const e of Object.keys(a))$(e).transition(a[e]);t?($(".butler-no-org").transition("hide"),$(".butler-org").transition("show"),n?$(".butler-org-name").text(n):$(".butler-org-name").closest(".butler-org").transition("hide")):($(".butler-org").transition("hide"),$(".butler-no-org").transition("show"))},f=function(e,t){const n={user_id:e.user_id,plan_id:e.plan_id,is_org:e.is_org,is_admin:e.is_admin,org_name:e.org_name,features:e.features,overrides:e.overrides};return o(e,"no_ui")&&(n.no_ui=e.no_ui),(t||window._trello).get("board","private","plan",{}).then(e=>a(e,n)?null:(t||window._trello).set("board","private","plan",n)).catch(TrelloPowerUp.PostMessageIO.InvalidContext,TrelloPowerUp.PostMessageIO.PluginDisabled,()=>null)},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e||window._trello;if(n.getContext().organization&&n.remove("organization","private","plan").catch((function(){})),TrelloPowerUp.Promise.all([n.remove("board","private","plan"),n.remove("member","private","plan")]).catch(()=>{}),!t)try{_()}catch(e){r.captureException(e)}},m=function(e,t){!function(e,t,n,r){if(void 0!==t&&($(".powerup-usage-quota-unit").text(r&&r.match(/^TRELLO_/)?"workspace":"account"),$(".powerup-usage-quota-exceeded").transition(t?"show":"hide"),h(e||window._trello,"quota",t)),!n)return;$(".powerup-usage").transition("hide"),$(".powerup-nousage").transition("hide");const a=n.usage||0;a||o(n,"quota")?($(".powerup-quota").text(n.quota),$(".powerup-used").text(a),$(".powerup-used-percent").text(Math.round(100*a/n.quota)),$(".powerup-usage").transition("slide down"),n.grant?$(".powerup-grant").transition("show").find(".value").text(n.grant):$(".powerup-grant").transition("hide")):$(".powerup-nousage").transition("slide down")}(t,e.powerup_usage_exceeded,e.powerup_usage,e.plan_id),function(e,t,n,r){if(void 0!==t&&($(".powerup-usage-quota-unit").text(r&&r.match(/^TRELLO_/)?"workspace":"account"),$(".powerup-usage-ops-quota-exceeded").transition(t?"show":"hide"),h(e||window._trello,"quota-ops",t)),!n)return;const o=n.usage||0;$(".ops-quota").text(n.quota),$(".ops-used").text(o),$(".ops-used-percent").text(Math.round(100*o/n.quota)),n.grant?$(".ops-grant").transition("show").find(".value").text(n.grant):$(".ops-grant").transition("hide")}(t,e.usage_exceeded,e.usage,e.plan_id),_(e);const{features:n}=e;"object"==typeof n&&("string"==typeof n.show&&$(n.show.split(",").map((function(e){return"."+e})).join(",")).transition("show"),"string"==typeof n.hide&&$(n.hide.split(",").map((function(e){return"."+e})).join(",")).transition("hide")),f(e,t)},g=e=>{const t=`${i}plan?usage=true&powerup_usage=true&v=${u()}${l(e)}`;return s.getToken(e).then(e=>e?fetch(t,{method:"GET",headers:{"X-Butler-Trello-Token":e}}).then(e=>e.json()).then(e=>e.success?e.response:(console.warn("Unable to fetch Butler plan",e.error),r.captureMessage("Fetch user plan got error: "+e.error),null)).catch(e=>(e instanceof TypeError&&"Failed to fetch"===e.message||r.captureException(e),null)):null)},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window._trello;return s.getToken(e).then((function(t){return e.getContext().dontUpsell&&$(".trello-upsell").transition("hide"),t?d(e).then((function(n){n?_(n):_(),$.ajax(`${i}plan?usage=true&powerup_usage=true&v=${u()}${l(e)}`,{type:"GET",headers:{"X-Butler-Trello-Token":t}}).done((function(t){t.success?m(t.response,e):(p(e),"USER_NOT_FOUND"===t.error&&s.reauthorize(e))})).fail((function(e){r.captureMessage(`Refresh user plan request failed: ${e.status} - ${e.statusText}`)}))})):_()}))};let E=0;const T={checkUserQuota:function(e){const t=Date.now();return t{if(!t)return p(e,!0);const n=t.powerup_usage_exceeded;h(e,"quota",n);const r=t.usage_exceeded;return h(e,"quota-ops",r),f(t,e)}):TrelloPowerUp.Promise.resolve()})))},delayedRefreshUserPlan:function(e,t){_(e),setTimeout(b,t)},fetchUserPlan:g,getAttnStatus:function(e,t){return e.get("board","private","attn").then((function(e){const n=(e||"").split(",").filter((function(e){return!!e}));return t?-1!==n.indexOf(t):n.length})).catch(e=>c.handleError(new Error("getAttnStatus: "+e.message),"getAttnStatus"))},getUserPlanLocal:d,refreshUserPlan:b,savePlan:f,updatePlan:m};window.Plan=T,e.exports=T},function(e,t,n){"use strict";(function(t){var r=n(130); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o=0;u--)if(l[u]!==d[u])return!1;for(u=l.length-1;u>=0;u--)if(s=l[u],!E(e[s],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function T(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function A(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function v(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&g(o,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&o&&!n;if((!e&&i.isError(o)&&a&&A(o,n)||s)&&g(o,n,"Got unwanted exception"+r),e&&o&&n&&!A(o,n)||!e&&o)throw o}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return p(m(e.actual),128)+" "+e.operator+" "+p(m(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=f(t),a=r.indexOf("\n"+o);if(a>=0){var i=r.indexOf("\n",a+1);r=r.substring(i+1)}this.stack=r}}},i.inherits(h.AssertionError,Error),h.fail=g,h.ok=b,h.equal=function(e,t,n){e!=t&&g(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){E(e,t,!1)||g(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){E(e,t,!0)||g(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){E(e,t,!1)&&g(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){E(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",h.notStrictEqual)},h.throws=function(e,t,n){v(!0,e,t,n)},h.doesNotThrow=function(e,t,n){v(!1,e,t,n)},h.ifError=function(e){if(e)throw e},h.strict=r((function e(t,n){t||g(t,!0,n,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var y=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(10))},function(e,t,n){const{compareLabels:r}=n(183),o=n(136),a=n(137),i=n(138),s=n(111),c=n(83),u=n(39),l=function(e){if(!TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).getContext().showCardRole)return;if(!e.length)return;const t=e.find('[name="card-title"]')[0];e.find(".role-select-clause").find(".builder-close").off("click").click((function(n){h(n,".builder-optional",".builder-open"),e.find(".add-role-select").dropdown("set selected","regular"),e.find(".add-metadata-clause").show(),"{cardlink}"===t.value&&(t.value="")})),e.find(".add-role-select").dropdown({on:"hover",onShow(){const e=$(this).closest(".ui.dropdown"),t=e.find(".text"),n=t.innerWidth(),r=t.text().trim().length,o=e.innerWidth()-n,a=e.find(".menu").children(".item");let i=0;return a.each((function(e,t){$(t).text().length>i&&(i=$(t).text().length)})),e.find(".menu").css("min-width",o+1.33*i*n/(r||1)),!0},onChange:(n,r)=>{const o=()=>{e.find(".add-metadata-clause").hide()},a=()=>{"{cardlink}"!==t.value&&"---"!==t.value||(t.value="")};switch(r){case"separator":t.value="---",o();break;case"board":case"link":o(),a();break;case"mirror":o(),t.value="{cardlink}";break;default:e.find(".add-metadata-clause").show(),a()}}})},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$(e).not("[bld-dd]");if(!n.length)return;let r;n.attr("bld-dd",1);const o={on:t.click?"click":"hover",onShow(){const e=$(this).closest(".ui.dropdown"),t=e.find(".text"),n=t.innerWidth(),o=t.text().trim().length,a=e.innerWidth()-n,i=e.find(".menu").children(".item");let s=0;if(i.each((function(e,t){$(t).text().length>s&&(s=$(t).text().length)})),e.find(".menu").css("min-width",a+1.33*s*n/(o||1)),e.hasClass("toggling")){const t=e.find("select")[0],n=t.options[t.selectedIndex];r=$(n).attr("data-toggle")}return!0},onChange(e,t,n){const o=$(this).closest(".ui.dropdown");if(o.hasClass("label-select"))return o.dropdown("set text",u.sanitize(e));if(o.hasClass("list-color-select"))return o.dropdown("set text",u.sanitize(e));if(!o.hasClass("toggling"))return;const a=o.find("select")[0].options[n.index()],i=$(a).attr("data-toggle");i!==r&&(r&&o.siblings(r).transition("toggle"),i&&o.siblings(i).transition("toggle"),r=i)}};n.find(".ui.dropdown").dropdown(o).filter(".label-select").each((function(){const e=$(this).dropdown("get value")||$(this).find(".menu .item").first().attr("data-value");$(this).dropdown("set selected",e)})),l(n)},h=function(e,t,n){const r=$(e.target).closest(t),o=r.parent().children(n);r.addClass("hidden").hide(),o.removeClass("hidden").show()},_=function(e,t){let n,r,o=$(e.target).closest(".clause");for(;(n=o.parent().closest(".clause")).length;)o=n;const a=o.closest(".ui.popup");if(a.length){const e=a.prev("span");r=e.length?e.children(".builder-open.builder-popup"):a.siblings(".builder-open.builder-popup")}else{const e=o.closest(".ui.modal");if(e.length)r=$(e.data("button"));else{r=o.closest(".builder-inline").prev(".builder-clauses").children(".builder-open")}}const i=r.siblings(".builder-optional.clause:last"),s=i.children(".clause-value");let c;t&&$(i).hasClass("multiple-clause")&&(c=i.clone(!1)),s.text(B(o[0])),i.hasClass("hidden")&&(d(i),i.find(".builder-delete").click(p),i.hasClass("multiple-clause")?function(e,t,n){$(e.target).closest(t).parent().children(n).transition({animation:"drop",duration:"0.33s"})}({target:r[0]},r,".builder-optional.clause:last"):h({target:r[0]},r,".builder-optional.clause:last")),c&&c.insertAfter(i)},f=function(e){$(e.target).closest(".clause").find('input[type="text"]:not(.optional):visible').filter((function(){return!this.value})).addClass("error").off("focus").focus((function(){$(this).removeClass("error")})).length||(_(e,!0),$(e.target).closest(".ui.popup").popup("hide all"),$(e.target).closest(".ui.modal").modal("hide"))},p=function(e){const t=$(e.target).closest(".builder-optional");(0===t.siblings(".builder-optional:visible").length?t.add(t.siblings(".prefix")):t).transition({animation:"scale",duration:"0.25s",onComplete(){const e=$(this).parent().closest(".clause");t.detach(),e.length&&_({target:e[0]})}})},m=function(e){const t=$(e.target).closest(".multiple-clause"),n=t.prev(".multiple-clause");n&&t.transition({animation:"scale",duration:"0.25s",onComplete(){t.detach().insertBefore(n).transition("scale")}})},g=function(e){$(this).data("search-select",u.sanitize(e))};let b={};const E=function(e,t){return new TrelloPowerUp.Promise((function(n,r){if(b[e])return n(b[e]);const o=e+"__loading";b[o]||(b[o]=[]),b[o].push({resolve:n,reject:r}),b[o].length>1||t((function(t){b[e]=t;const n=b[o];delete b[o],n.forEach((function(e){e.resolve(t)}))}),(function(e){const t=b[o];delete b[o],t.forEach((function(t){t.reject(e instanceof Error?e:new Error(e))}))}))}))},T=function(){return E("lists",(function(e,t){TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).lists("name").then((function(t){e(t)})).catch((function(e){t(e)}))}))},A=function(e){const t=$(this).data("search-select");return!t||(u.sanitize(e)!==t?($(this).data("search-select",""),!0):($(this).search("search local",""),!1))},v=function(){return E("boards",(function(e,t){c.getMyBoards({filter:"open",lists:"open",count:100,fields:"id,name"}).then(e).catch(t)}))},y=function(){return E("board_cards",(function(e,t){TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).cards("name","url").then((function(t){e(t)})).catch((function(e){t(e)}))}))},O=function(){return E("bitbucket_context",o.getIntegrationDetails("Bitbucket"))},I=function(e){let{lists:t,clear_invalid_value:n,listWarning:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return T().then((function(t){t&&I(e,{lists:t,clear_invalid_value:n})}));const o=t.find((function(e){return e.selected}));o&&e.each((function(){g.bind(this)(o.name),$(this).val(o.name)}));const a={};t=t.filter((function(e){return!a[e.name]&&(a[e.name]=!0,!0)})).map((function(e){return{name:u.sanitize(e.name)}}));const i=e.addClass("prompt").parent().addClass("search").search("clear cache").search("hide results").search({source:t,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery(n){A.call(this,n),r&&(t.some(e=>e.name===n)?(e.css("opacity",1),e.removeClass("quoted-value-highlighted"),r.transition("hide")):(e.css("opacity",.4),e.addClass("quoted-value-highlighted"),r.transition("show")))},onSelect(n){g.call(this,n.name),r&&t.some(e=>e.name===n.name)&&(e.css("opacity",1),e.removeClass("quoted-value-highlighted"),r.transition("hide"))}});i.each((function(){const e=$(this).search("get value");e&&(n&&!a[e]?$(this).search("set value",""):g.call(this,e))}))},C=function(e,t,n){if(!t)return v().then((function(t){t&&C(e,t,n)}));const r=t.find((function(e){return e.selected}));r&&e.each((function(){g.call(this,r.name),$(this).val(r.name)}));const o={};t=t.filter((function(e){return!o[e.name]&&(o[e.name]=e,!0)})).map((function(e){return{name:u.sanitize(e.name),lists:e.lists}}));const a=function(e){const t=$(e).find('[name="board-name"]');let n;return $(e).closest(".phrase,.clause,.output-phrase").find('[name="list-name"],[name="board-name"]').get().find((function(e,r,o){return e===t[0]&&(n=$(o[r-1]).filter('[name="list-name"]'),!0)})),n};e.addClass("prompt").parent().addClass("search").search({source:t,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.call(this,e.name);const t=a(this);t&&I(t,{lists:e.lists,clear_invalid_value:!0});const n=$(this);$(this).closest(".builder-optional").find(".builder-close").on("click",(function(){n.search("set value",""),T().then((function(e){I(t,{lists:e,clear_invalid_value:!0})}))}))}}).each((function(){const e=$(this).search("get value");if(e&&(g.call(this,e),n)){const t=o[e];if(t){const e=a(this);e&&I(e,{lists:t.lists})}}}))},N=function(e,t,n,r){if(!r)return void function(e,t){return E(`jira_issue_types_${e}_${t}`,a.getJiraIssueTypes(e,t)).then(e=>e)}(e,t).then((function(r){r&&N(e,t,n,r)}));console.log(`Fetched ${r.length} issue types for project key ${t}`),1===r.length&&n.val(r[0]);const o=r.find((function(e){return e.selected}));o&&n.each((function(){g.bind(this)(o),$(this).val(o)}));const i={},s=r.filter((function(e){return!i[e.name]&&(i[e.name]=!0,!0)})).map((function(e){return{name:u.sanitize(e.name)}}));console.log("Filtered issue types: "+JSON.stringify(s));n.addClass("prompt").parent().addClass("search").search("clear cache").search("hide results").search({source:s,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.name)}}).each((function(){const e=$(this).search("get value");e&&g.bind(this)(e)}))},D=function(e,t){const n=function(e){return $(e).closest(".phrase,.clause,.output-phrase").find('[name="jira-issue-type"]')};t.addClass("prompt").parent().addClass("search").search("clear cache").search("hide results").search({apiSettings:{dataType:"json",responseAsync:(t,n)=>{t.urlData.query?function(e,t){return E(`jira_projects_${e}_${t}`,a.getJiraProjects(e,t)).then(e=>e.projects.map(e=>({name:e.name,key:e.key})))}(e,t.urlData.query).then((function(e){n({success:!0,results:e})})):n({success:!0,results:[]})}},fields:{title:"key"},searchFields:["name","key"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery(e){if(""===e)return!1;const t=$(this).data("search-select");return console.log(`Query: ${e}, Selected: ${t}`),this.apiSettings=this.apiSettings?{query:e,...this.apiSettings}:{query:e},!t||u.sanitize(e)!==t&&($(this).data("search-select",""),!0)},onSelect(t){g.bind(this)(t.key),console.log("Selected project "+t.key);const r=n(this);return r[0]&&(console.log("Pulling issue types for project key "+t.key),console.log("Issue type element[0]: "+r[0]),N(e,t.key,r,null)),$(this).search("set value",t.key),$(this).search("hide results"),!1}}).each((function(){const t=$(this).search("get value");if(!t)return;g.bind(this)(t);const r=n(this);r[0]&&N(e,t,r,null)}))},w=function(e,t){if(!t)return void E("jira_context",o.getIntegrationDetails("JIRA")).then((function(t){t&&t.length?w(e,t):$(".unauthorized-jira").transition("show")}));1===t.length&&(e.val(t[0].connection_name),e.attr("site_id",t[0].connection_id));const n=t.find((function(e){return e.selected}));n&&e.each((function(){g.bind(this)(n.name),$(this).val(n.name)}));const r={},a={},i=t.filter((function(e){return!r[e.connection_id]&&(r[e.connection_id]=e,!0)})).map((function(e){return a[e.connection_id]=e,{name:u.sanitize(e.connection_name),site_id:u.sanitize(e.connection_id)}})),s=function(e){return $(e).closest(".phrase,.clause,.output-phrase").find('[name="jira-project-ref"]')};e.addClass("prompt").parent().addClass("search").search({source:i,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.name),$(this).attr("site_id",e.site_id);const t=s(this);t[0]&&(console.log("Fetching projects for site id "+e.site_id),D(e.site_id,t))}}).each((function(){const e=$(this).search("get value");if(!e)return;g.bind(this)(e);const t=$(this).parent().find('[name="jira-site-name"]').attr("site_id"),n=s(this);n[0]&&D(t,n);const r=$(this).closest(".phrase,.clause,.output-phrase").find('[name="jira-issue-type"]');r[0]&&N(t,void 0,r,null)}))},S=function(e,t,n){if(!n)return void function(e){return E("slack_channels_"+e,i.getSlackChannelsForWorkspace(e))}(e).then((function(n){n&&S(e,t,n)}));const r=n.find((function(e){return e.selected}));r&&t.each((function(){g.bind(this)(r.name),$(this).val(r.name)}));const o={},a=n.filter((function(e){return!o[e.id]&&(o[e.id]=!0,!0)})).map((function(e){return{name:u.sanitize(e.name),id:u.sanitize(e.id)}}));t.addClass("prompt").parent().addClass("search").search("clear cache").search("hide results").search({source:a,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.name)}}).each((function(){const e=$(this).search("get value");e&&g.bind(this)(e)}))},R=function(e,t){if(!t)return void E("slack_context",o.getIntegrationDetails("Slack")).then((function(t){t&&t.length?R(e,t):$(".unauthorized-slack").transition("show")}));1===t.length&&(e.val(t[0].connection_name),e.attr("workspace_id",t[0].connection_id));const n=t.find((function(e){return e.selected}));n&&e.each((function(){g.bind(this)(n.name),$(this).val(n.name)}));const r={},a=t.filter((function(e){return!r[e.connection_id]&&(r[e.connection_id]=!0,!0)})).map((function(e){return{name:u.sanitize(e.connection_name),workspace_id:u.sanitize(e.connection_id)}})),i=function(e){return $(e).closest(".phrase,.clause,.output-phrase").find('[name="slack-channel"]')};e.addClass("prompt").parent().addClass("search").search({source:a,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.name),$(this).attr("workspace_id",e.workspace_id);const t=i(this);t[0]&&S(e.workspace_id,t,null)}}).each((function(){const e=$(this).search("get value");if(!e)return;g.bind(this)(e);const t=i(this),n=$(this).parent().find('[name="slack-workspace-name"]').attr("workspace_id");t[0]&&S(n,t,null)}))},k=function(e){let{cards:t,clear_invalid_value:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return y().then((function(t){t&&k(e,{cards:t,clear_invalid_value:n})}));const r=t.find((function(e){return e.selected}));r&&e.each((function(){g.bind(this)(r.name),$(this).val(r.name)}));const o={},a=t.filter((function(e){return!o[e.name]&&(o[e.name]=!0,!0)})).map((function(e){return{name:u.sanitize(e.name),link:e.url}})),i=e.addClass("prompt").parent().addClass("search").search("clear cache").search("hide results").search({source:a,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery(e){A.call(this,e)},onSelect(e){g.call(this,e.url)}});i.each((function(){const e=$(this).search("get value");e&&(n&&!o[e]?$(this).search("set value",""):g.call(this,e))}))},M=function(){const e=$(this).search("get value");"string"==typeof e&&g.bind(this)(e)},L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),o=$(e).find(".ui.input>input"),a=$(o).filter('[name="list-name"]');a.length&&T().then((function(e){if(t.select_default){const t=n.getContext().list,r=e.find((function(e){return e.id===t}))||e[0];r&&(r.selected=!0)}I(a,{lists:e})}));const i=$(o).filter('[name="board-name"]');i.length&&v().then((function(e){if(t.select_default){const t=n.getContext().board,r=e.find((function(e){return e.id==t}))||e[0];r&&(r.selected=!0)}C(i,e)}));const c=$(o).filter('[name="card-title-search"]');c.length&&y().then((function(e){k(c,e)}));const l=$(o).filter('[name="jira-site-name"]');l.length&&w(l,null);const d=$(o).filter('[name="slack-workspace-name"]');d.length&&R(d,null);const h=$(o).filter('[name="username"]'),_=$(o).filter('[name="field-name"]'),f=$(e).find(".dropdown.label-select");(h.length||_.length)&&n.board("members","customFields","labels").then((function(t){let o;s.getUserPlanLocal(n).then(e=>e||s.fetchUserPlan(n)).then(t=>{$(e).find(".custom-fields-paid-boards").transition("TRELLO_FREE"===t.plan_id?"show":"hide")}),t.members.forEach((function(e){e.username=u.sanitize(e.username),e.fullName=u.sanitize(e.fullName)})),h.addClass("prompt").parent().addClass("search").search({source:t.members,fields:{title:"username",description:"fullName"},searchFields:["username","fullName"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.username)}}),$(e).find(".no-custom-fields").transition(t.customFields.length?"hide":"show"),t.customFields.forEach((function(e){e.name=u.sanitize(e.name)})),_.addClass("prompt").parent().addClass("search").each((function(){let e=t.customFields;const n=$(this).find('input[name="field-name"]').attr("data-field-type");n&&(e=e.filter((function(e){return-1!=n.indexOf(e.type)}))),$(this).search({source:e,fields:{title:"name",description:"type"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.name);const t=$(this).siblings().find('input[name="field-value"]');t&&(t.val(""),"list"===e.type?t.addClass("prompt").parent().addClass("search").search("clear cache").search({source:e.options.map((function(e){return{name:u.sanitize(e.value.text)}})),fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(t)(e.name)}}):t.removeClass("prompt").parent().removeClass("search"))}})})),f.find(".menu").html(t.labels.sort(r).map((function(e,t){let n=[];if(e.color)if(e.color.includes("_")){const[t,r]=e.color.split("_");n.push(`${r} ${t}`)}else n.push(e.color);return e.name&&n.push(`"${e.name}"`),n=n.join(" "),t||(o=n),`
    ${e.name?sanitize(e.name):" "}
    `}))),f.dropdown("refresh").dropdown("set selected",o)}))},x=function(e){try{return JSON.parse(e)}catch(t){throw console.log("[ERROR] parsing JSON:",e),t}},F=function(e){const t=new RegExp(`["${String.fromCharCode(8220)}${String.fromCharCode(8221)}]`,"g");return e.replace(t,'\\"').split("\n").join("\\n")},P=function(e,t){if(t){if("object"!=typeof e)throw new Error("mergeSchemas: Expected object:\ns="+JSON.stringify(e));if("object"!=typeof t)throw new Error("mergeSchemas: Expected object\nt="+JSON.stringify(t));Object.getOwnPropertyNames(t).forEach((function(n){n in e?P(e[n],t[n]):e[n]=t[n]}))}},B=function(e){if(!e)return null;const t=$(e);if(e.nodeType===Node.TEXT_NODE)return e.nodeValue.replace(/^\s+/," ").replace(/\s+$/," ").replace(/^ ,/,",");if(e.nodeType===Node.ELEMENT_NODE){if(t.hasClass("hidden")||t.hasClass("popup")||t.hasClass("builder-comment")||t.hasClass("results")||"none"===t.css("display"))return null;if(t.hasClass("action-output-text")||t.hasClass("trigger-output-text"))return e.textContent.replace(/^\s+/," ").replace(/\s+$/," ").replace(/^ ,/,",");if(t.hasClass("button")){const e=t.find(".default-value");return e.length?B(e[0]):null}if("SCRIPT"===e.nodeName)return null;if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){let e=t.prop("value").trim();return t.hasClass("optional")&&!e?null:(e||(e=t.prop("placeholder")),t.hasClass("quoted-value")?`"${F(e)}"`:e)}if(t.hasClass("dropdown")&&t.hasClass("label-select")){const e=$(t).dropdown("get value").trim(),n=e.substring(e.indexOf('"'),e.lastIndexOf('"')+1);if(n){const t=n.substring(1,n.length-1).replaceAll('"','\\"');return`${e.substring(0,e.indexOf('"'))}"${t}"${e.substring(e.lastIndexOf('"')+1)}`}return e}const n=[];for(let t=0;t.item").index(r);o=$(e.find("select option")[t]).attr("schema")}return o?(o=o.replace("_v_",n).replace("_q_",`"${F(n)}"`),x(o)):null}let n=$(t).attr("schema");if(n)return x(n);n={};for(let t=0;t{e.length?$(".unauthorized-bitbucket").hide():$(".unauthorized-bitbucket").show()});const r=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});n.find(".builder.popup .clause.segment, .builder.modal .clause.segment, .builder-inline .clause.segment").prepend('
    '),n.find(".select-clause-btn").off("click").click(f),n.find(".builder-open:not(.builder-popup)").off("click").click((function(e){h(e,".builder-open",".builder-optional")})),n.find(".builder-close:not(.builder-popup)").off("click").click((function(e){h(e,".builder-optional",".builder-open")})),n.find(".builder-add-clause").off("click").click((function(e){const n=$(e.target).closest(".builder-add-clause"),r=n.siblings(".multiple-clause"),o=r.first(),a=n.attr("max-clauses");if(a&&r.length>a)return n.transition("shake"),void n.siblings(".builder-max-clauses").transition("hide").transition("scale");const i=o.clone(!1);i.find("input").val(""),d(i,t),L(i,t),i.find(".builder-open-nested").click((function(e){h(e,".builder-open-nested",".builder-optional-nested")})),i.find(".builder-delete").click(p),i.find(".builder-up-clause").click(m),i.insertBefore(n).transition("drop")})),n.find(".builder-open.builder-popup").each((function(e,t){const n=$(t),o=n.attr("data-modal-selector");if(o)return n.off("click").click((function(){const e=$(o);e.modal({onShow(){e.data("button",n),n.siblings(".prefix").transition("show")},onHide(){delete e.__button,n.siblings(".builder-optional:visible").length||n.siblings(".prefix").transition("scale down")}}).modal("show")}));r.getContext().doneStateEnabled?($(".done-state-disabled").hide(),$(".done-state-enabled").show()):($(".done-state-enabled").hide(),$(".done-state-disabled").show());const a=".card-filter.popup"===n.attr("data-popup-selector")||".card-filter-triggers.popup"===n.attr("data-popup-selector"),i=n;n.popup({on:"click",inline:!1,popup:n.attr("data-popup-selector"),target:i,position:"bottom center",lastResort:"bottom left",hoverable:!1,boundary:".builder-wizard-body",onShow(){const e=i.parent("span");e.length&&$(e).after($(this).detach()),n.siblings(".prefix").transition("show"),a&&$(".card-filter.popup").find(".item").tab("change tab","card-filter-base")},onHidden(){n.siblings(".builder-optional:visible").length||n.siblings(".prefix").transition("scale down")}})})),n.find(".builder-close.builder-popup").off("click").click((function(e){h(e,".builder-optional",".builder-open.builder-popup")})),n.find(".close-popup").off("click").click((function(e){$(e.target).closest(".popup").popup("hide all")}))},setupDropdowns:d,setupInputFields:function(e){const t=$(e).not("[bld-if]");if(!t.length)return;t.attr("bld-if",1);const n=new Date;let r=n.getHours(),o=5*Math.ceil(n.getMinutes()/5);o>=60&&(++r,o=0);const a=1===Math.floor(r/12);r=r%12||12;const i=t.find("input");i.filter(".numeric-value").off("blur").blur((function(e){if(e.target.value.match(/^{.*}$/))return;const t=parseInt(e.target.value,10);let n=$(e.target).attr("data-min-value")||0;const r=$(e.target).attr("data-max-value");void 0===n&&(n=0),isNaN(t)||tr&&(e.target.value=r)})),i.filter(".hour").val(r).off("blur").blur((function(e){const t=parseInt(e.target.value,10);isNaN(t)||t<1?e.target.value=12:t>12&&(e.target.value=Math.min(t-12,11),$(e.target).parent().siblings(".dropdown").dropdown("set selected","pm"))})),i.filter(".minutes").val(o>9?o:"0"+o).off("blur").blur((function(e){let t=parseInt(e.target.value,10);isNaN(t)||t<0?t=0:e.target.value>59&&(t=59),e.target.value=t>9?t:"0"+t})),t.find(".dropdown.ampm").dropdown("set selected",a?"pm":"am"),i.filter(".year").off("blur").blur((function(e){const t=parseInt(e.target.value,10);isNaN(t)?e.target.value=(new Date).getYear()+1900:t<100&&(e.target.value=2e3+t)})),i.filter('[name="report-var"]').off("blur").blur((function(e){e.target.value=e.target.value.replace(/[^a-zA-Z0-9_]/g,"_")}))},setupPowerUpAutoComplete:L,setupListNameAutoComplete:I,setupBoardNameAutoComplete:C,setupCardLinkAutoComplete:k,setupBoardNameDropdown:function(e,t,n){const r=t.find(e=>Boolean(e.selected));r&&e.each((function(){g.call(this,r.name),$(this).val(r.name)}));const o={};t=t.filter((function(e){return!o[e.name]&&(o[e.name]=e,!0)})).map((function(e){return{name:u.sanitize(e.name),lists:e.lists,id:e.id}}));e.addClass("prompt").parent().addClass("search").search("clear cache").search({source:t,fields:{title:"name"},searchFields:["name"],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.call(this,e.name),n.removeClass("disabled"),n.attr("command-board",e.name),n.attr("command-board-id",e.id)}}).search("set value","").each((function(){const e=$(this).search("get value");e&&g.call(this,e)}))},setupAutoComplete:function(e,t,n){const r=t.map((function(e){const t={record:e};return t[n]=u.sanitize(e[n]),t}));e.parent().search({source:r,fields:{title:n},searchFields:[n],searchFullText:!1,showNoResults:!1,minCharacters:0,maxResults:20,onSearchQuery:A,onSelect(e){g.bind(this)(e.record[n])}}),M.bind(e.parent())()},collectPhrase:B,collectSchema:j,getSelectedBoards:function(e){return v().then((function(t){return $(e).map((function(){return $(this).val().trim()})).get().map((function(e){return t.find((function(t){return t.name.toLowerCase()===e.toLowerCase()}))||{name:e}}))}))},getAllOpenBoards:function(){return E("all_open_boards",(function(e,t){c.getMe({boards:"open",fields:"",count:100,board_fields:"id,name"}).then((function(t){e(t.boards)})).catch(t)}))},getListsByBoardId:function(e){return c.getLists(e,{})},joinCommandPhrases:function(e,t){let n;return t?(n=e[0]+",\n",e=e.slice(1)):n="",e.length>1?n+e.slice(0,-1).join(",\n")+(e[e.length-2].match(/^for each /)?",\n":",\nand ")+e.slice(-1)[0]:n+e.join()},refreshAutoCompleteCache:function(){b={},L(".builder")},setupCardRoleSelect:l};e.exports=U},function(e,t){const n=(e,t)=>{class n extends Error{constructor(t){super(t),this.name=e+"::Error"}}return t.forEach(t=>{n[t]=class extends n{constructor(n){super(n),this.name=`${e}::${t}`}}}),n},r=n("TrelloApi",["BadRequest","Conflict","Forbidden","InvalidResponse","NotFound","RateLimited","Timeout","Unauthorized","Unknown"]);let o;const a=n("Registration",["NoNewUsers","NotConfirmed","NoEnterpriseBeta","Unknown"]);e.exports={TrelloApiError:r,RegistrationError:a,errorForStatus:function(e,t){return o||(o={400:r.BadRequest,401:r.Unauthorized,403:r.Forbidden,404:r.NotFound,409:r.Conflict,429:r.RateLimited}),new(o[e]||r.Unknown)(t)},registrationErrorAlert:{display:"error",duration:10,message:"Unable to complete setup. Please refresh the page and try again."}}},function(e,t,n){var r=n(206),o=n(207),a=n(145),i=n(208);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(76);Object.defineProperty(t,"__esModule",{value:!0}),t.themeStringToObject=t.themeObjectToString=void 0;var o=r(n(115)),a=n(117),i=["light","dark","spacing","typography","shape"],s=function(e){return void 0!==i.find((function(t){return t===e}))},c=function(e){return void 0!==a.themeIds.find((function(t){return t===e}))},u=function(e){return["light","dark","auto"].includes(e)};t.themeStringToObject=function(e){return e.split(" ").map((function(e){return e.split(":")})).reduce((function(e,t){var n=(0,o.default)(t,2),r=n[0],a=n[1];return"colorMode"===r&&u(a)&&(e[r]=a),s(r)&&c(a)&&(e[r]=a),e}),{})};t.themeObjectToString=function(e){return Object.entries(e).reduce((function(e,t){var n=(0,o.default)(t,2),r=n[0],a=n[1];return"colorMode"!==r&&!s(r)||!c(a)&&!u(a)?e:e+"".concat(e?" ":"")+"".concat(r,":").concat(a)}),"")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themeOverrideIds=t.themeIds=t.themeColorModes=t.default=void 0;t.themeColorModes=["light","dark","auto"];t.themeIds=["light","dark","legacy-light","legacy-dark","spacing","typography","shape"];t.themeOverrideIds=["light-new-input-border","dark-new-input-border"];var r={"atlassian-light":{id:"light",displayName:"Light Theme",palette:"defaultPalette",attributes:{type:"color",mode:"light"}},"atlassian-dark":{id:"dark",displayName:"Dark Theme",palette:"defaultPalette",attributes:{type:"color",mode:"dark"}},"atlassian-legacy-light":{id:"legacy-light",displayName:"Light Theme (legacy)",palette:"legacyPalette",attributes:{type:"color",mode:"light"}},"atlassian-legacy-dark":{id:"legacy-dark",displayName:"Dark Theme (legacy)",palette:"legacyPalette",attributes:{type:"color",mode:"dark"}},"atlassian-spacing":{id:"spacing",displayName:"Atlassian Spacing",palette:"spacingScale",attributes:{type:"spacing"}},"atlassian-typography":{id:"typography",displayName:"Atlassian Typography",palette:"typographyPalette",attributes:{type:"typography"}},"atlassian-shape":{id:"shape",displayName:"Atlassian Shape",palette:"shapePalette",attributes:{type:"shape"}},"atlassian-light-new-input-border":{id:"light-new-input-border",displayName:"Light Theme New Input Border",palette:"defaultPalette",override:"light",attributes:{type:"color",mode:"light"}},"atlassian-dark-new-input-border":{id:"dark-new-input-border",displayName:"Dark Theme New Input Border",palette:"defaultPalette",override:"dark",attributes:{type:"color",mode:"dark"}}};t.default=r},function(e,t,n){"use strict";var r=n(76);Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalTheme=void 0;var o=r(n(0)),a=n(108),i=n(117),s=n(116);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t=u){p[b]="[MaxProperties ~]";break}var E=g[b];p[b]=t(b,E,c-1,u,l),m+=1}return h(s),p}("",t,n,s)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function c(e,t=3,n=102400){var r,o=s(e,t);return r=o,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(r))>n?c(e,t-1,n):o}}).call(this,n(10))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.setDebug=function(e=!1){t.DEBUG=e},t.DEBUG=!1},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0,t.setLogger=function(e=r){t.Logger=e};const r={info:console.log};t.Logger=r},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=i(e),u=1;uArray.isArray(e)?e:[e]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.l10nizeTitle=void 0;t.l10nizeTitle=e=>e?{key:"title",$TITLE:e}:void 0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalizationKeysForCondition=function(e){switch(e.type){case"WITH_NO_LABELS":return"with no labels";case"WITHOUT_DUE_DATE":return"without due date";case"WITH_OVERDUE_DATE":return{key:"overdue"};case"ASSIGNED_TO":{let t;return e.ASSIGNED_TO.MEMBER["@MEMBER_USERNAME"]?t={key:"member username","@MEMBER_USERNAME":e.ASSIGNED_TO.MEMBER["@MEMBER_USERNAME"]}:e.ASSIGNED_TO.MEMBER.MEMBER_ME&&(t="me"),{key:"assigned to member",member:t}}case"DUE_DATE_CONDITION":{let t={};const{DUE_IN_LESS_THAN_DAYS:n,DUE_IN_MORE_THAN_DAYS:r,DUE_IN_EXACTLY_DAYS:o,DUE_IN_BETWEEN:a,DUE_TODAY:i,DUE_TOMORROW:s,DUE_THIS_WEEK:c,DUE_NEXT_WEEK:u,DUE_THIS_MONTH:l,DUE_NEXT_MONTH:d,WORKING_DAYS:h}=e.DUE_DATE_CONDITION;return n&&(t={key:"due in comparison days",$NUM_DAYS:n,operator:"less than"}),r&&(t={key:"due in comparison days",$NUM_DAYS:r,operator:"more than"}),o&&(t={key:"due in comparison days",$NUM_DAYS:o,operator:"exactly"}),a&&(t={key:"due in between days",$MIN_DAYS:a.MIN_DAYS,$MAX_DAYS:a.MAX_DAYS}),i?t={key:"due when",when:"today"}:s?t={key:"due when",when:"tomorrow"}:c?t={key:"due when",when:"this week"}:u?t={key:"due when",when:"next week"}:l?t={key:"due when",when:"this month"}:d?t={key:"due when",when:"next month"}:t.days=h?"working days":"days",t}}throw new r.LocalizationKeysError(e.type)},t.getTriggerConditions=function(e){var t,n,r,o;const a=e.type,i=null===(t=e[a])||void 0===t?void 0:t.type;return(null===(n=e[a])||void 0===n?void 0:n.CONDITION)||(null===(o=null===(r=e[a])||void 0===r?void 0:r[i])||void 0===o?void 0:o.CONDITION)||[]},t.getActionConditions=function(e){var t;const n=e.type;return(null===(t=e[n])||void 0===t?void 0:t.CONDITION)||[]};const r=n(110)},function(e,t,n){const r=n(135),o=n(15),{joinCommandPhrases:a}=n(113),{Auth:i}=n(83),{handleError:s,sanitize:c}=n(39);function u(e,t,n){const{suggestions:o,date:i}=e;let s;if(e.first_action_date&&(s=moment(e.first_action_date).fromNow(!0)),o&&o.length){const e={};t.forEach((function(t){e[t.cmd]=!0}));const c=o.filter((function(t){const n=["rule","schedule","on-date"].includes(t.type),o=a(t.cmd,n);return!r(e,o)})).slice(0,20),u={};c.forEach(e=>{let{type:t}=e;t||(t="card"),(!n||new Date(e.t)>new Date(n))&&(u[t]=(u[t]||0)+1)});return{since:s,suggestions:c,suggestionDataToCache:{dateLastSeen:n,dateLastUpdate:new Date(i).toISOString(),counts:u}}}return{since:s,suggestions:o,suggestionDataToCache:{dateLastSeen:n,dateLastUpdate:new Date(i).toISOString(),counts:{}}}}const l={},d=function(e,t){return l[t]||!1===t&&l.true?l[t]||!1===t&&l.true:(l[t]=new TrelloPowerUp.Promise((function(n,r){if(!i.getActiveToken())return r(new Error("NOT_AUTHENTICATED"));const a=e||TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),s=moment.tz.guess(),c=a.getContext().board;return $.ajax(`${o}powerup-suggest/${c}?tz=${s}${t?"&refresh=true":""}`,{type:"GET",headers:{"X-Butler-Trello-Token":i.getActiveToken()}}).done((function(e){return e.success?n(e.response):r(new Error(e.error||"NO_RESPONSE"))})).fail((function(){return r(new Error("NETWORK_ERROR"))}))})).finally((function(e){if(delete l[t],e)throw e})),l[t])},h=function(e){return(e||TrelloPowerUp.iframe({targetOrigin:"https://trello.com"})).get("board","private","suggestions")},_=function(e){return h(e).then((function(e){if(!e)return 0;const t=e.counts||{};return t.total=Object.values(t).reduce((e,t)=>e+t,0),t}))};let f;const p=function(e,t){if(!i.getActiveToken())return new TrelloPowerUp.Promise((function(e,t){t(new Error("NOT_AUTHENTICATED"))}));const n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).getContext().board;return new TrelloPowerUp.Promise((function(r,a){$.ajax(`${o}powerup-suggest/${n}`,{type:"POST",data:JSON.stringify({suggestion:e,action:t}),contentType:"application/json",headers:{"X-Butler-Trello-Token":i.getActiveToken()}}).done((function(e){e.success?r(e.response):a(new Error(e.error||"NO_RESPONSE"))})).fail((function(){a(new Error("NETWORK_ERROR"))}))}))},m={processSuggestionData:u,getCachedSuggestionData:h,getSuggestions:d,getUnseenSuggestionCount:_,setSuggestionTabUnseenCount:function(e){return _(e).then((function(e){if(e.total)if($(".unseen-suggestion-count").length)$(".unseen-suggestion-count").text(c(e.total));else{const t=$(`
    ${c(e.total)}
    `);$('.dashboard-tabs .item[data-tab="tab-suggestions"]').append(t)}else $(".unseen-suggestion-count").length&&(f&&clearTimeout(f),f=setTimeout((function(){$(".unseen-suggestion-count").remove()}),4e3))}))},updateSuggestionCounts:function(e,t){const n=e||TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});return TrelloPowerUp.Promise.all([h(n),n.get("member","private","registered",!1)]).spread((n,r)=>{if(!r)return n&&n.counts||{};const o=n&&n.dateLastUpdate,a=n&&n.dateLastSeen;return function(e){const t=e&&new Date(e).getTime();if(t){return new Date>new Date(t+6048e5)}return!0}(o)?TrelloPowerUp.Promise.join(d(e,!0),t.getLocalCommands()).spread((t,n)=>{let{commands:r}=n;const{suggestionDataToCache:o}=u(t,r,a);return o?e.set("board","private","suggestions",o).then(()=>o.counts||{}).catch(e=>(s(new Error("updateSuggestionCounts: "+e.message),"updateSuggestionCounts"),{})):o.counts}).catch(e=>("NOT_AUTHENTICATED"!==e.message&&s(new Error("getCachedSuggestions: "+e.message),"getCachedSuggestions"),{})):n&&n.counts||{}})},accept:function(e){return p(e,"accept")},discard:function(e){return p(e,"discard")}};e.exports=m},function(e,t,n){(function(t){var n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/,o=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,u="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,d=u||l||Function("return this")();var h,_=Array.prototype,f=Function.prototype,p=Object.prototype,m=d["__core-js_shared__"],g=(h=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",b=f.toString,E=p.hasOwnProperty,T=p.toString,A=RegExp("^"+b.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=d.Symbol,y=p.propertyIsEnumerable,O=_.splice,I=F(d,"Map"),C=F(Object,"create"),N=v?v.prototype:void 0,D=N?N.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1&&e%1==0&&e-1},S.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new w,map:new(I||S),string:new w}},R.prototype.delete=function(e){return x(this,e).delete(e)},R.prototype.get=function(e){return x(this,e).get(e)},R.prototype.has=function(e){return x(this,e).has(e)},R.prototype.set=function(e,t){return x(this,e).set(e,t),this};var B=j((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(V(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return o.test(e)&&n.push(""),e.replace(a,(function(e,t,r,o){n.push(r?o.replace(i,"$1"):t||e)})),n}));function $(e){if("string"==typeof e||V(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function j(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i),i};return n.cache=new(j.Cache||R),n}j.Cache=R;var U=Array.isArray;function H(e){var t=G(e)?T.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function Y(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function G(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function W(e){return!!e&&"object"==typeof e}function V(e){return"symbol"==typeof e||W(e)&&"[object Symbol]"==T.call(e)}e.exports=function(e,t){return null!=e&&P(e,t,M)}}).call(this,n(10))},function(e,t,n){const r=n(37),o=n(137),a=n(138),i=n(184),s=n(15),c={};let u;const l=()=>(u||(u=TrelloPowerUp.util.makeErrorEnum("Integration",["Unknown"])),u);let d,h=!1;const _=(e,t)=>{if(c.hasOwnProperty(e)&&console.error("App already registered",e),"function"!=typeof t)throw new Error(`Invalid handler for ${e}: ${JSON.stringify(t)}`);c[e]={handler:t}},f=(e,t)=>new TrelloPowerUp.Promise((n,o)=>{$.ajax(s+"integration-connect",{type:"POST",data:JSON.stringify({appName:e,data:t}),contentType:"application/json",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()}}).done(t=>{if(t.success)return d.refreshAutoCompleteCache(),$(".unauthorized-"+e.toLowerCase()).transition("hide"),void n(t.response);const a=(new l).Unknown(t.error);r.captureException(a),o(a)}).fail(e=>(r.captureMessage(`Integration connect request failed: ${e.status} - ${e.statusText}`),o((new l).Unknown(e.responseText)),!1))});e.exports={init:e=>{h||(h=!0,d=e,o.registerApps(_),a.registerApps(_),i.registerApps(_))},getIntegrationDetails:function(e){return function(t,n){$.ajax(`${s}integration-details?integrationType=${e}`,{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},contentType:"application/json"}).done((function(e){return console.log(e),e.success?t(e.response):n(new Error(e.error||"Unknown error"))})).fail((function(e){return n(e)}))}},getUserIntegrations:()=>new TrelloPowerUp.Promise((e,t)=>{$.ajax(s+"integrations",{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()}}).done(n=>{if(n.success)return void e(n.response);const o=(new l).Unknown(n.error);r.captureException(o),t(o)}).fail(e=>(r.captureMessage(`Get user integrations failed: ${e.status} - ${e.statusText}`),t((new l).Unknown(e.responseText)),!1))}),handleAction:(e,t,n)=>{const r=c[e];if(!r)return new TrelloPowerUp.Promise((t,n)=>n(`Unknown app "${e}"`));const o={t:window._trello||TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),params:n,submitIntegrationConnectRequest:f.bind(null,e)};return new TrelloPowerUp.Promise(e=>e(r.handler(t,o)))},handleActionSync:(e,t,n)=>{const r=c[e];if(!r)throw new Error(`Unknown app "${e}"`);const o={params:n};return r.handler(t,o)}}},function(e,t,n){const r=n(15),o=(e,t)=>{switch(e){case"describe":return a(t);case"connect":return i(t);case"setupRevocation":return"";default:return console.error("Unknown verb: "+e),""}},a=e=>`Connected sites: \`${e.params.map(e=>""+Object.values(e).map(e=>e.name).join(", ")).join(", ")}\``,i=e=>{const{t:t}=e;let n;return Auth.getToken(t).then(e=>{if(!e)throw new Error("ATLASSIAN OAUTH: NO TRELLO TOKEN");const{crypto:n}=TrelloPowerUp.util,r=[];return n.generateInitVector().forEach(e=>r.push(("0"+e.toString(16)).substr(-2))),n.sha256Digest(`${r.join("")}:${t.getContext().member}:${e}`)}).then(e=>{n=e;const r=`https://auth.atlassian.com/authorize?audience=api.atlassian.com&client_id=wX2bLMmD2VP17QmjP9OfJFdvpMlRWjGS&scope=${encodeURIComponent(["read:jira-user","read:jira-work","write:jira-work","offline_access"].join(" "))}&redirect_uri=${encodeURIComponent("https://app.butlerfortrello.com/internal/powerup-oauth-atlassian.html")}&state=${n}&response_type=code&prompt=consent`;return t.authorize(r,{})}).then(t=>{const[r,o]=t.split(":");if(o!==n)throw new Error("ATLASSIAN OAUTH: STATUS MISMATCH");return e.submitIntegrationConnectRequest({code:r})})},s=e=>{$(".oauth-atlassian-status").addClass("hidden"),$(".oauth-atlassian-status.status-"+e).removeClass("hidden")};e.exports={registerApps:e=>{e("JIRA",o)},getJiraSiteData:e=>function(t,n){$.ajax(`${r}jira-site-data?site_id=${e}`,{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},contentType:"application/json"}).done((function(e){return e.success?t(e.response):n(new Error(e.error||"Unknown error"))})).fail((function(e){return n(e)}))},getJiraProjects:(e,t)=>{const n=["site_id="+e];return t&&n.push("query="+encodeURIComponent(t)),function(e,t){$.ajax(`${r}jira-projects?${n.join("&")}`,{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},contentType:"application/json"}).done((function(n){return n.success?e(n.response):t(new Error(n.error||"Unknown error"))})).fail((function(e){return t(e)}))}},getJiraIssueTypes:(e,t)=>function(n,o){$.ajax(`${r}jira-issue-types?site_id=${e}&project_key=${t}`,{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},contentType:"application/json"}).done((function(e){return e.success?n(e.response):o(new Error(e.error||"Unknown error"))})).fail((function(e){return o(e)}))}},window.AtlassianOAuthCallback=()=>{const e=(window.location.search.match(/[?&]code=([-_.a-zA-Z0-9]*)/)||[])[1],t=(window.location.search.match(/[?&]state=([a-fA-F0-9]*)/)||[])[1];if(!e)return void s("error");s("requesting");const n=`${e}:${t}`;try{window.opener.authorize(n)}catch(e){try{localStorage.setItem("token",n)}catch(e){throw s("error"),new Error("ATLASSIAN OAUTH: CANNOT RETURN CODE")}}s("success"),setTimeout(window.close,1e3)}},function(e,t,n){const r=n(15),o=(e,t)=>{switch(e){case"describe":return a(t);case"connect":return i(t);case"revoke":return s(t);case"setupRevocation":return c(t);default:return console.error("Unknown verb: "+e),""}},a=e=>`Connected workspaces: \`${e.params.map(e=>""+Object.values(e).map(e=>e.team_name).join(", ")).join(", ")}\``,i=e=>{const{t:t}=e;let n;return Auth.getToken(t).then(e=>{if(!e)throw new Error("SLACK OAUTH: NO TRELLO TOKEN");const{crypto:n}=TrelloPowerUp.util,r=[];return n.generateInitVector().forEach(e=>r.push(("0"+e.toString(16)).substr(-2))),n.sha256Digest(`${r.join("")}:${t.getContext().member}:${e}`)}).then(e=>{n=e;const r=`https://slack.com/oauth/v2/authorize?client_id=522979612549.970973374022&scope=${encodeURIComponent(["chat:write","chat:write.public"].join(" "))}&user_scope=${encodeURIComponent(["channels:read","chat:write","groups:read","identify","im:read","mpim:read","team:read","users.profile:read","users:read","users:read.email"].join(" "))}&redirect_uri=${encodeURIComponent("https://app.butlerfortrello.com/internal/powerup-oauth-slack.html")}&state=${n}`;return t.authorize(r,{})}).then(t=>{const[r,o]=t.split(":");if(o!==n)throw new Error("SLACK OAUTH: STATUS MISMATCH");return e.submitIntegrationConnectRequest({code:r})})},s=e=>{const{t:t,params:n}=e,o=$(n.event.target).text().trim(" ");return o?Auth.getToken(t).then(e=>{if(!e)throw new Error("SLACK DISCONNECT: NO TRELLO TOKEN");return new Promise((e,t)=>{$.ajax(r+"integration-disconnect",{type:"POST",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},data:JSON.stringify({appName:"Slack",resourceName:o}),contentType:"application/json"}).done((function(n){return n.success?e():t(new Error(n.error||"Unknown error"))})).fail((function(e){return t(e)}))})}):""},c=e=>{const t=[];return e.params.forEach(e=>{Object.values(e).forEach(e=>{t.push(e.team_name)})}),t},u=e=>{$(".oauth-slack-status").addClass("hidden"),$(".oauth-slack-status.status-"+e).removeClass("hidden")};e.exports={getSlackChannelsForWorkspace:e=>function(t,n){$.ajax(`${r}slack-channels-for-workspace?team_id=${e}`,{type:"GET",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},contentType:"application/json"}).done((function(e){return e.success?t(e.response):n(new Error(e.error||"Unknown error"))})).fail((function(e){return n(e)}))},registerApps:e=>{e("Slack",o)}},window.SlackOAuthCallback=()=>{const e=(window.location.search.match(/[?&]code=([-_a-zA-Z0-9.]*)/)||[])[1],t=(window.location.search.match(/[?&]state=([a-fA-F0-9]*)/)||[])[1];if(!e)return void u("error");u("requesting");const n=`${e}:${t}`;try{window.opener.authorize(n)}catch(e){try{localStorage.setItem("token",n)}catch(e){throw u("error"),new Error("SLACK OAUTH: CANNOT RETURN CODE")}}u("success"),setTimeout(window.close,1e3)}},function(e,t,n){"use strict";const{parse:r}=n(186),o=e=>e&&e.substring&&e.substring(0,Math.min(e.length/2,32)),a=/(eyJ[a-zA-z0-9-_]+\.){2}[a-zA-z0-9-_]*/g,i=new RegExp("([^0-9a-zA-Z]|(?:%2F))([0-9a-zA-Z]{64})([^0-9a-zA-Z]|$)","g"),s=/(ATT[A-Z])([A-Za-z0-9/-]{16,})[A-F0-9]{8}/g,c=new RegExp("(devices?/)([0-9a-zA-Z:_-]{100,})","g"),u=new RegExp("([^0-9a-zA-Z]|(?:%2F))([0-9a-zA-Z]{24}[-/][0-9a-zA-Z]{24}[-/][0-9a-zA-Z]{32}|[0-9a-zA-Z]{24}[-/][0-9]{13}[-/][0-9a-zA-Z]{32}|invite/(?:b/)?[^/]+/[0-9a-zA-Z]{32}|invitationSecret/[0-9a-zA-Z]{32})([^0-9a-zA-Z]|$)","g"),l="[TOKEN_TRUNCATED_BY_URL_LIBRARY]",d="[UGC_TRUNCATED_BY_URL_LIBRARY]";const h=e=>{if(!e||"string"!=typeof e)return e;const t=new RegExp(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,"g");return e.replace(t,e=>(e=>{if(!e||"string"!=typeof e)return e;const t=(e=>{if(!e)return null;const t=e.lastIndexOf("@");return-1===t?null:e.slice(t+1)||null})(e),n=e.slice(0,e.lastIndexOf("@")),r=Math.floor(n.length/4);return`${n.split("").map((e,t)=>t1&&void 0!==arguments[1])||arguments[1],_=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t)return t;if("string"==typeof t){let e=t;if(n){e=e.replace(/([a-z0-9]{32})[a-z0-9]{32}/g,"$1"),e=e.replace(/secret=[0-9a-f]+/gi,"secret="),e=e.replace(/Bearer [A-Za-z0-9\-._+/]+/gi,""),e=e.replace(i,(e,t,n,r)=>`${t}${o(n)}${l}${r}`),e=e.replace(s,(e,t,n)=>`${t}${o(n)}${l}`),e=e.replace(u,(e,t,n,r)=>{const o=n.includes("/")?"/":"-";return`${t}${n.split(o).slice(0,-1).join(o)+o}${l}${r}`});try{const{pathname:t,query:n}=r(e,{parseQueryString:!0});if("/1/search"===t){const t=n.query;if(null!==t){const n=encodeURIComponent(t);e=e.includes("query="+n)?e.replace("query="+n,"query="+d):e.replace("query="+t,"query="+d)}}}catch{}e=e.replace(a,l),e=e.replace(c,(e,t,n)=>`${t}${o(n)}${l}`),e=e.replace(/(^|\W)([0-9a-f]{64})(\W|$)/gim,"$1[REDACTED]$3"),e=h(e),e=e.replace(/(\d+\.\d+)(\.\d+){2}/g,"$1.*.*")}return e}if(-1!==_.indexOf(t))return"__circular__";_.push(t);const f={};return Object.getOwnPropertyNames(t).forEach((function(r){let o=t[r];switch(r){case"token":o&&(o=e(o,n,_));break;case"secret":o&&(o=n?"":o);break;case"Authorization":o&&"string"==typeof o&&o.startsWith("Bearer ")&&(o=n?"":o)}switch(typeof o){case"object":o&&(o=e(o,n,_));break;case"string":o=e(o,n)}f[r]=o})),f}}},function(e,t,n){const{Auth:r}=n(83),o=n(15),a=n(39),i=n(106),s={openCommandLog:function(e,t,n){const s=$("#powerup-command-log"),c=s.find(".content"),u=s.find(".loading.message"),l=s.find(".filter.checkbox"),d=s.find(".more.button"),h=s.find(".no-more-entries"),_=s.find(".no-match-filter"),f=u.siblings(".error.message"),p=s.find(".command-log"),m=s.find(".runs"),g=t?"&obo="+t:"",b=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).getContext().board,E=b?"&b="+b:"",T=s.find(".skip-missing");function A(t){const n=T.find(".skip-missing-action-checkbox").prop("checked");T.find(".skip-missing-action-checkbox").prop("disabled",!0),i.updateCommandId(e.id,{skipMissingFailureAction:t}).then(()=>{T.find(".skip-missing-action-checkbox").prop("disabled",!1),e.skipMissingFailureAction=t}).catch(()=>{T.find(".skip-missing-action-checkbox").prop("disabled",!1),T.find(".skip-missing-action-checkbox").prop("checked",n),T.find(".error").transition("show"),setTimeout(()=>{T.find(".error").transition("hide")},5e3)})}function v(){c.animate({scrollTop:c.prop("scrollHeight")},500)}e.skipMissingFailureAction?T.find(".skip-missing-action-checkbox").prop("checked",!1):T.find(".skip-missing-action-checkbox").prop("checked",!0),T.checkbox({onChecked(){A(!1)},onUnchecked(){A(!0)}}),p.empty(),s.modal({detachable:!0,autofocus:!1,onHide(){p.empty(),n()}}).modal("show"),l.find(".filter-checkbox").prop("checked",!1),l.checkbox({onChecked(){p.find(".valid").addClass("hidden").hide(),0===p.find(".invalid").length&&_.transition("show")},onUnchecked(){p.find(".valid").removeClass("hidden").show(),_.transition("hide")}}),function t(n){u.show(),m.hide(),l.hide(),d.transition("hide"),h.transition("hide"),f.transition("hide"),_.transition("hide"),r.authorize().then((function(){$.ajax(`${o}powerup-command-log/${e.id}?before=${n}${g}${E}`,{type:"GET",headers:{"X-Butler-Trello-Token":r.getActiveToken()}}).done((function(e){u.hide(),e.success?e.response.log.length?(Number.isInteger(e.response.monthUsage)&&m.text("Current estimated monthly runs: "+e.response.monthUsage).show(),e.response.log.forEach((function(e){let{output:t}=e;"string"==typeof t&&(t=[{message:t,type:"MESSAGE"}]);const r=e.data&&e.data.command_card&&Number.isInteger(e.data.command_card.operations)?e.data.command_card.operations:"",o=function(e){return e?e.map((function(e){let t='
    ';switch(e.type){case"ERROR":t+='';break;case"WARNING":t+='';break;case"MESSAGE":t+=''}return t+=`
    ${a.markdownToHtml(e.message)}
    `,t+="
    ",t})).join(""):'
    No details.
    '}(t),i=function(e){return e&&e.some((function(e){return["ERROR","WARNING"].includes(e.type)}))}(t)?'':'';p.append(i+'
    '+moment(e.t).format("LLLL")+"
    "+o+(r?`
    Total operations: ${r}
    `:"")+"
    "),n=e.t})),p.find(".content a").attr("target","_blank"),l.find(".filter-checkbox").prop("checked")?(p.find(".valid").addClass("hidden").hide(),0===p.find(".invalid").length&&_.transition("show")):(p.find(".valid").removeClass("hidden").show(),_.transition("hide")),d.transition("show").off("click").click((function(){v(),t(n)})),l.show(),s.modal("refresh")):(Number.isInteger(e.response.monthUsage)&&m.text("Current estimated monthly runs: "+e.response.monthUsage).show(),l.show(),d.transition("hide"),h.transition("show")):(f.transition("show"),v(),s.find(".retry-btn").off("click").click((function(){return t(n),!1})))})).fail((function(){u.hide(),f.transition("show"),v()}))}))}((new Date).toISOString())}};e.exports=s},function(e,t,n){const r=n(192);let o;const a=function(){return o&&o.isConnected()},i=function(){},s={connect:function(e){o=null;const t=new r.Client(e.url,e.client_id),n={useSSL:!0,timeout:15,mqttVersion:4,onSuccess(){e.topic&&t.subscribe(e.topic),o=t,(e.onConnectionSuccess||i)(t)},onFailure(t){let{errorCode:n,errorMessage:r}=t;console.warn((new Date).toISOString(),"MQTT CONNECTION FAILURE"),console.warn((new Date).toISOString(),{errorCode:n,errorMessage:r}),(e.onConnectionFailure||i)("MQTT_CONNECTION_FAILURE")}};t.connect(n),t.onConnectionLost=function(){console.warn((new Date).toISOString(),"MQTT CONNECTION LOST"),o=null,e.onConnectionLost&&e.onConnectionLost(t)},t.onMessageArrived=function(n){e.onMessageReceived&&e.onMessageReceived(t,n.destinationName,n.payloadString)}},getSessionClient:function(){return a()?o:null},getSessionId:function(){return a()?o.clientId:null},isSessionActive:a};window.MessageBroker=s,e.exports=s},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return o}));var r={};function o(e){r[e]||(r[e]=!0,"undefined"!=typeof window&&console.warn(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={"color.text":"--ds-text","color.text.accent.lime":"--ds-text-accent-lime","color.text.accent.lime.bolder":"--ds-text-accent-lime-bolder","color.text.accent.red":"--ds-text-accent-red","color.text.accent.red.bolder":"--ds-text-accent-red-bolder","color.text.accent.orange":"--ds-text-accent-orange","color.text.accent.orange.bolder":"--ds-text-accent-orange-bolder","color.text.accent.yellow":"--ds-text-accent-yellow","color.text.accent.yellow.bolder":"--ds-text-accent-yellow-bolder","color.text.accent.green":"--ds-text-accent-green","color.text.accent.green.bolder":"--ds-text-accent-green-bolder","color.text.accent.teal":"--ds-text-accent-teal","color.text.accent.teal.bolder":"--ds-text-accent-teal-bolder","color.text.accent.blue":"--ds-text-accent-blue","color.text.accent.blue.bolder":"--ds-text-accent-blue-bolder","color.text.accent.purple":"--ds-text-accent-purple","color.text.accent.purple.bolder":"--ds-text-accent-purple-bolder","color.text.accent.magenta":"--ds-text-accent-magenta","color.text.accent.magenta.bolder":"--ds-text-accent-magenta-bolder","color.text.accent.gray":"--ds-text-accent-gray","color.text.accent.gray.bolder":"--ds-text-accent-gray-bolder","color.text.disabled":"--ds-text-disabled","color.text.inverse":"--ds-text-inverse","color.text.selected":"--ds-text-selected","color.text.brand":"--ds-text-brand","color.text.danger":"--ds-text-danger","color.text.warning":"--ds-text-warning","color.text.warning.inverse":"--ds-text-warning-inverse","color.text.success":"--ds-text-success","color.text.discovery":"--ds-text-discovery","color.text.information":"--ds-text-information","color.text.subtlest":"--ds-text-subtlest","color.text.subtle":"--ds-text-subtle","color.link":"--ds-link","color.link.pressed":"--ds-link-pressed","color.icon":"--ds-icon","color.icon.accent.lime":"--ds-icon-accent-lime","color.icon.accent.red":"--ds-icon-accent-red","color.icon.accent.orange":"--ds-icon-accent-orange","color.icon.accent.yellow":"--ds-icon-accent-yellow","color.icon.accent.green":"--ds-icon-accent-green","color.icon.accent.teal":"--ds-icon-accent-teal","color.icon.accent.blue":"--ds-icon-accent-blue","color.icon.accent.purple":"--ds-icon-accent-purple","color.icon.accent.magenta":"--ds-icon-accent-magenta","color.icon.accent.gray":"--ds-icon-accent-gray","color.icon.disabled":"--ds-icon-disabled","color.icon.inverse":"--ds-icon-inverse","color.icon.selected":"--ds-icon-selected","color.icon.brand":"--ds-icon-brand","color.icon.danger":"--ds-icon-danger","color.icon.warning":"--ds-icon-warning","color.icon.warning.inverse":"--ds-icon-warning-inverse","color.icon.success":"--ds-icon-success","color.icon.discovery":"--ds-icon-discovery","color.icon.information":"--ds-icon-information","color.icon.subtle":"--ds-icon-subtle","color.border":"--ds-border","color.border.accent.lime":"--ds-border-accent-lime","color.border.accent.red":"--ds-border-accent-red","color.border.accent.orange":"--ds-border-accent-orange","color.border.accent.yellow":"--ds-border-accent-yellow","color.border.accent.green":"--ds-border-accent-green","color.border.accent.teal":"--ds-border-accent-teal","color.border.accent.blue":"--ds-border-accent-blue","color.border.accent.purple":"--ds-border-accent-purple","color.border.accent.magenta":"--ds-border-accent-magenta","color.border.accent.gray":"--ds-border-accent-gray","color.border.disabled":"--ds-border-disabled","color.border.focused":"--ds-border-focused","color.border.input":"--ds-border-input","color.border.inverse":"--ds-border-inverse","color.border.selected":"--ds-border-selected","color.border.brand":"--ds-border-brand","color.border.danger":"--ds-border-danger","color.border.warning":"--ds-border-warning","color.border.success":"--ds-border-success","color.border.discovery":"--ds-border-discovery","color.border.information":"--ds-border-information","color.border.bold":"--ds-border-bold","color.background.accent.lime.subtlest":"--ds-background-accent-lime-subtlest","color.background.accent.lime.subtler":"--ds-background-accent-lime-subtler","color.background.accent.lime.subtle":"--ds-background-accent-lime-subtle","color.background.accent.lime.bolder":"--ds-background-accent-lime-bolder","color.background.accent.red.subtlest":"--ds-background-accent-red-subtlest","color.background.accent.red.subtler":"--ds-background-accent-red-subtler","color.background.accent.red.subtle":"--ds-background-accent-red-subtle","color.background.accent.red.bolder":"--ds-background-accent-red-bolder","color.background.accent.orange.subtlest":"--ds-background-accent-orange-subtlest","color.background.accent.orange.subtler":"--ds-background-accent-orange-subtler","color.background.accent.orange.subtle":"--ds-background-accent-orange-subtle","color.background.accent.orange.bolder":"--ds-background-accent-orange-bolder","color.background.accent.yellow.subtlest":"--ds-background-accent-yellow-subtlest","color.background.accent.yellow.subtler":"--ds-background-accent-yellow-subtler","color.background.accent.yellow.subtle":"--ds-background-accent-yellow-subtle","color.background.accent.yellow.bolder":"--ds-background-accent-yellow-bolder","color.background.accent.green.subtlest":"--ds-background-accent-green-subtlest","color.background.accent.green.subtler":"--ds-background-accent-green-subtler","color.background.accent.green.subtle":"--ds-background-accent-green-subtle","color.background.accent.green.bolder":"--ds-background-accent-green-bolder","color.background.accent.teal.subtlest":"--ds-background-accent-teal-subtlest","color.background.accent.teal.subtler":"--ds-background-accent-teal-subtler","color.background.accent.teal.subtle":"--ds-background-accent-teal-subtle","color.background.accent.teal.bolder":"--ds-background-accent-teal-bolder","color.background.accent.blue.subtlest":"--ds-background-accent-blue-subtlest","color.background.accent.blue.subtler":"--ds-background-accent-blue-subtler","color.background.accent.blue.subtle":"--ds-background-accent-blue-subtle","color.background.accent.blue.bolder":"--ds-background-accent-blue-bolder","color.background.accent.purple.subtlest":"--ds-background-accent-purple-subtlest","color.background.accent.purple.subtler":"--ds-background-accent-purple-subtler","color.background.accent.purple.subtle":"--ds-background-accent-purple-subtle","color.background.accent.purple.bolder":"--ds-background-accent-purple-bolder","color.background.accent.magenta.subtlest":"--ds-background-accent-magenta-subtlest","color.background.accent.magenta.subtler":"--ds-background-accent-magenta-subtler","color.background.accent.magenta.subtle":"--ds-background-accent-magenta-subtle","color.background.accent.magenta.bolder":"--ds-background-accent-magenta-bolder","color.background.accent.gray.subtlest":"--ds-background-accent-gray-subtlest","color.background.accent.gray.subtler":"--ds-background-accent-gray-subtler","color.background.accent.gray.subtle":"--ds-background-accent-gray-subtle","color.background.accent.gray.bolder":"--ds-background-accent-gray-bolder","color.background.disabled":"--ds-background-disabled","color.background.input":"--ds-background-input","color.background.input.hovered":"--ds-background-input-hovered","color.background.input.pressed":"--ds-background-input-pressed","color.background.inverse.subtle":"--ds-background-inverse-subtle","color.background.inverse.subtle.hovered":"--ds-background-inverse-subtle-hovered","color.background.inverse.subtle.pressed":"--ds-background-inverse-subtle-pressed","color.background.neutral":"--ds-background-neutral","color.background.neutral.hovered":"--ds-background-neutral-hovered","color.background.neutral.pressed":"--ds-background-neutral-pressed","color.background.neutral.subtle":"--ds-background-neutral-subtle","color.background.neutral.subtle.hovered":"--ds-background-neutral-subtle-hovered","color.background.neutral.subtle.pressed":"--ds-background-neutral-subtle-pressed","color.background.neutral.bold":"--ds-background-neutral-bold","color.background.neutral.bold.hovered":"--ds-background-neutral-bold-hovered","color.background.neutral.bold.pressed":"--ds-background-neutral-bold-pressed","color.background.selected":"--ds-background-selected","color.background.selected.hovered":"--ds-background-selected-hovered","color.background.selected.pressed":"--ds-background-selected-pressed","color.background.selected.bold":"--ds-background-selected-bold","color.background.selected.bold.hovered":"--ds-background-selected-bold-hovered","color.background.selected.bold.pressed":"--ds-background-selected-bold-pressed","color.background.brand.bold":"--ds-background-brand-bold","color.background.brand.bold.hovered":"--ds-background-brand-bold-hovered","color.background.brand.bold.pressed":"--ds-background-brand-bold-pressed","color.background.danger":"--ds-background-danger","color.background.danger.hovered":"--ds-background-danger-hovered","color.background.danger.pressed":"--ds-background-danger-pressed","color.background.danger.bold":"--ds-background-danger-bold","color.background.danger.bold.hovered":"--ds-background-danger-bold-hovered","color.background.danger.bold.pressed":"--ds-background-danger-bold-pressed","color.background.warning":"--ds-background-warning","color.background.warning.hovered":"--ds-background-warning-hovered","color.background.warning.pressed":"--ds-background-warning-pressed","color.background.warning.bold":"--ds-background-warning-bold","color.background.warning.bold.hovered":"--ds-background-warning-bold-hovered","color.background.warning.bold.pressed":"--ds-background-warning-bold-pressed","color.background.success":"--ds-background-success","color.background.success.hovered":"--ds-background-success-hovered","color.background.success.pressed":"--ds-background-success-pressed","color.background.success.bold":"--ds-background-success-bold","color.background.success.bold.hovered":"--ds-background-success-bold-hovered","color.background.success.bold.pressed":"--ds-background-success-bold-pressed","color.background.discovery":"--ds-background-discovery","color.background.discovery.hovered":"--ds-background-discovery-hovered","color.background.discovery.pressed":"--ds-background-discovery-pressed","color.background.discovery.bold":"--ds-background-discovery-bold","color.background.discovery.bold.hovered":"--ds-background-discovery-bold-hovered","color.background.discovery.bold.pressed":"--ds-background-discovery-bold-pressed","color.background.information":"--ds-background-information","color.background.information.hovered":"--ds-background-information-hovered","color.background.information.pressed":"--ds-background-information-pressed","color.background.information.bold":"--ds-background-information-bold","color.background.information.bold.hovered":"--ds-background-information-bold-hovered","color.background.information.bold.pressed":"--ds-background-information-bold-pressed","color.blanket":"--ds-blanket","color.blanket.selected":"--ds-blanket-selected","color.blanket.danger":"--ds-blanket-danger","color.interaction.hovered":"--ds-interaction-hovered","color.interaction.pressed":"--ds-interaction-pressed","color.skeleton":"--ds-skeleton","color.skeleton.subtle":"--ds-skeleton-subtle","color.chart.categorical.1":"--ds-chart-categorical-1","color.chart.categorical.1.hovered":"--ds-chart-categorical-1-hovered","color.chart.categorical.2":"--ds-chart-categorical-2","color.chart.categorical.2.hovered":"--ds-chart-categorical-2-hovered","color.chart.categorical.3":"--ds-chart-categorical-3","color.chart.categorical.3.hovered":"--ds-chart-categorical-3-hovered","color.chart.categorical.4":"--ds-chart-categorical-4","color.chart.categorical.4.hovered":"--ds-chart-categorical-4-hovered","color.chart.categorical.5":"--ds-chart-categorical-5","color.chart.categorical.5.hovered":"--ds-chart-categorical-5-hovered","color.chart.categorical.6":"--ds-chart-categorical-6","color.chart.categorical.6.hovered":"--ds-chart-categorical-6-hovered","color.chart.categorical.7":"--ds-chart-categorical-7","color.chart.categorical.7.hovered":"--ds-chart-categorical-7-hovered","color.chart.categorical.8":"--ds-chart-categorical-8","color.chart.categorical.8.hovered":"--ds-chart-categorical-8-hovered","color.chart.lime.bold":"--ds-chart-lime-bold","color.chart.lime.bold.hovered":"--ds-chart-lime-bold-hovered","color.chart.lime.bolder":"--ds-chart-lime-bolder","color.chart.lime.bolder.hovered":"--ds-chart-lime-bolder-hovered","color.chart.lime.boldest":"--ds-chart-lime-boldest","color.chart.lime.boldest.hovered":"--ds-chart-lime-boldest-hovered","color.chart.neutral":"--ds-chart-neutral","color.chart.neutral.hovered":"--ds-chart-neutral-hovered","color.chart.red.bold":"--ds-chart-red-bold","color.chart.red.bold.hovered":"--ds-chart-red-bold-hovered","color.chart.red.bolder":"--ds-chart-red-bolder","color.chart.red.bolder.hovered":"--ds-chart-red-bolder-hovered","color.chart.red.boldest":"--ds-chart-red-boldest","color.chart.red.boldest.hovered":"--ds-chart-red-boldest-hovered","color.chart.orange.bold":"--ds-chart-orange-bold","color.chart.orange.bold.hovered":"--ds-chart-orange-bold-hovered","color.chart.orange.bolder":"--ds-chart-orange-bolder","color.chart.orange.bolder.hovered":"--ds-chart-orange-bolder-hovered","color.chart.orange.boldest":"--ds-chart-orange-boldest","color.chart.orange.boldest.hovered":"--ds-chart-orange-boldest-hovered","color.chart.yellow.bold":"--ds-chart-yellow-bold","color.chart.yellow.bold.hovered":"--ds-chart-yellow-bold-hovered","color.chart.yellow.bolder":"--ds-chart-yellow-bolder","color.chart.yellow.bolder.hovered":"--ds-chart-yellow-bolder-hovered","color.chart.yellow.boldest":"--ds-chart-yellow-boldest","color.chart.yellow.boldest.hovered":"--ds-chart-yellow-boldest-hovered","color.chart.green.bold":"--ds-chart-green-bold","color.chart.green.bold.hovered":"--ds-chart-green-bold-hovered","color.chart.green.bolder":"--ds-chart-green-bolder","color.chart.green.bolder.hovered":"--ds-chart-green-bolder-hovered","color.chart.green.boldest":"--ds-chart-green-boldest","color.chart.green.boldest.hovered":"--ds-chart-green-boldest-hovered","color.chart.teal.bold":"--ds-chart-teal-bold","color.chart.teal.bold.hovered":"--ds-chart-teal-bold-hovered","color.chart.teal.bolder":"--ds-chart-teal-bolder","color.chart.teal.bolder.hovered":"--ds-chart-teal-bolder-hovered","color.chart.teal.boldest":"--ds-chart-teal-boldest","color.chart.teal.boldest.hovered":"--ds-chart-teal-boldest-hovered","color.chart.blue.bold":"--ds-chart-blue-bold","color.chart.blue.bold.hovered":"--ds-chart-blue-bold-hovered","color.chart.blue.bolder":"--ds-chart-blue-bolder","color.chart.blue.bolder.hovered":"--ds-chart-blue-bolder-hovered","color.chart.blue.boldest":"--ds-chart-blue-boldest","color.chart.blue.boldest.hovered":"--ds-chart-blue-boldest-hovered","color.chart.purple.bold":"--ds-chart-purple-bold","color.chart.purple.bold.hovered":"--ds-chart-purple-bold-hovered","color.chart.purple.bolder":"--ds-chart-purple-bolder","color.chart.purple.bolder.hovered":"--ds-chart-purple-bolder-hovered","color.chart.purple.boldest":"--ds-chart-purple-boldest","color.chart.purple.boldest.hovered":"--ds-chart-purple-boldest-hovered","color.chart.magenta.bold":"--ds-chart-magenta-bold","color.chart.magenta.bold.hovered":"--ds-chart-magenta-bold-hovered","color.chart.magenta.bolder":"--ds-chart-magenta-bolder","color.chart.magenta.bolder.hovered":"--ds-chart-magenta-bolder-hovered","color.chart.magenta.boldest":"--ds-chart-magenta-boldest","color.chart.magenta.boldest.hovered":"--ds-chart-magenta-boldest-hovered","color.chart.gray.bold":"--ds-chart-gray-bold","color.chart.gray.bold.hovered":"--ds-chart-gray-bold-hovered","color.chart.gray.bolder":"--ds-chart-gray-bolder","color.chart.gray.bolder.hovered":"--ds-chart-gray-bolder-hovered","color.chart.gray.boldest":"--ds-chart-gray-boldest","color.chart.gray.boldest.hovered":"--ds-chart-gray-boldest-hovered","color.chart.brand":"--ds-chart-brand","color.chart.brand.hovered":"--ds-chart-brand-hovered","color.chart.danger":"--ds-chart-danger","color.chart.danger.hovered":"--ds-chart-danger-hovered","color.chart.danger.bold":"--ds-chart-danger-bold","color.chart.danger.bold.hovered":"--ds-chart-danger-bold-hovered","color.chart.warning":"--ds-chart-warning","color.chart.warning.hovered":"--ds-chart-warning-hovered","color.chart.warning.bold":"--ds-chart-warning-bold","color.chart.warning.bold.hovered":"--ds-chart-warning-bold-hovered","color.chart.success":"--ds-chart-success","color.chart.success.hovered":"--ds-chart-success-hovered","color.chart.success.bold":"--ds-chart-success-bold","color.chart.success.bold.hovered":"--ds-chart-success-bold-hovered","color.chart.discovery":"--ds-chart-discovery","color.chart.discovery.hovered":"--ds-chart-discovery-hovered","color.chart.discovery.bold":"--ds-chart-discovery-bold","color.chart.discovery.bold.hovered":"--ds-chart-discovery-bold-hovered","color.chart.information":"--ds-chart-information","color.chart.information.hovered":"--ds-chart-information-hovered","color.chart.information.bold":"--ds-chart-information-bold","color.chart.information.bold.hovered":"--ds-chart-information-bold-hovered","elevation.surface":"--ds-surface","elevation.surface.hovered":"--ds-surface-hovered","elevation.surface.pressed":"--ds-surface-pressed","elevation.surface.overlay":"--ds-surface-overlay","elevation.surface.overlay.hovered":"--ds-surface-overlay-hovered","elevation.surface.overlay.pressed":"--ds-surface-overlay-pressed","elevation.surface.raised":"--ds-surface-raised","elevation.surface.raised.hovered":"--ds-surface-raised-hovered","elevation.surface.raised.pressed":"--ds-surface-raised-pressed","elevation.surface.sunken":"--ds-surface-sunken","elevation.shadow.overflow":"--ds-shadow-overflow","elevation.shadow.overflow.perimeter":"--ds-shadow-overflow-perimeter","elevation.shadow.overflow.spread":"--ds-shadow-overflow-spread","elevation.shadow.overlay":"--ds-shadow-overlay","elevation.shadow.raised":"--ds-shadow-raised","opacity.disabled":"--ds-opacity-disabled","opacity.loading":"--ds-opacity-loading","utility.UNSAFE.transparent":"--ds-UNSAFE-transparent","border.radius.050":"--ds-border-radius-050","border.radius":"--ds-border-radius","border.radius.100":"--ds-border-radius-100","border.radius.200":"--ds-border-radius-200","border.radius.300":"--ds-border-radius-300","border.radius.400":"--ds-border-radius-400","border.radius.circle":"--ds-border-radius-circle","border.width":"--ds-border-width","border.width.0":"--ds-border-width-0","border.width.050":"--ds-border-width-050","border.width.100":"--ds-border-width-100","space.0":"--ds-space-0","space.025":"--ds-space-025","space.050":"--ds-space-050","space.075":"--ds-space-075","space.100":"--ds-space-100","space.150":"--ds-space-150","space.200":"--ds-space-200","space.250":"--ds-space-250","space.300":"--ds-space-300","space.400":"--ds-space-400","space.500":"--ds-space-500","space.600":"--ds-space-600","space.800":"--ds-space-800","space.1000":"--ds-space-1000","font.family.monospace":"--ds-font-family-monospace","font.family.sans":"--ds-font-family-sans","font.size.050":"--ds-font-size-050","font.size.075":"--ds-font-size-075","font.size.100":"--ds-font-size-100","font.size.200":"--ds-font-size-200","font.size.300":"--ds-font-size-300","font.size.400":"--ds-font-size-400","font.size.500":"--ds-font-size-500","font.size.600":"--ds-font-size-600","font.weight.bold":"--ds-font-weight-bold","font.weight.medium":"--ds-font-weight-medium","font.weight.regular":"--ds-font-weight-regular","font.weight.semibold":"--ds-font-weight-semibold","font.lineHeight.100":"--ds-font-lineHeight-100","font.lineHeight.200":"--ds-font-lineHeight-200","font.lineHeight.300":"--ds-font-lineHeight-300","font.lineHeight.400":"--ds-font-lineHeight-400","font.lineHeight.500":"--ds-font-lineHeight-500","font.lineHeight.600":"--ds-font-lineHeight-600"};t.default=r},function(e,t,n){var r=n(205)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){var r=n(146);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{console.log("[ERROR] Could not load Butler - jQuery not available."),"undefined"!=typeof TrelloPowerUp&&TrelloPowerUp.initialize({"board-buttons":()=>[],"card-buttons":()=>[],"show-settings":()=>[],"remove-data":()=>[]},{targetOrigin:r()})}},new Error("jQuery is undefined");const o=n(37),a=n(80),i=n(78),s=n(81),c=n(39),u=n(106),l=n(134),d=n(111),h=n(83),{RegistrationError:_}=n(114);n(15),n(113),n(82),n(140),n(141),n(193),n(194),n(198),n(199),n(200),s.init();const f={},{Auth:p}=h;!function(){function e(e){return window.isSentryInitialized||window.SentryInitializer.init(e),e.isMemberSignedIn()&&e.memberCanWriteToModel("board")?(u.init(e),u.getLocalCommands().then((function(t){const n=t.commands.filter(e=>{let{enabled:t,type:n}=e;return t&&"board-button"===n});return n.length>0?e.board("members").then((function(t){return t.members.find(t=>{let{id:n}=t;return n===e.getContext().member})?n.sort((function(e,t){return e.is_own?t.is_own?0:-1:t.is_own?1:0})).slice(0,20).map((function(e){return{icon:`./assets/fa-5.1.1/icons/white/${e.image}.svg`,text:e.label,callback(t){t.boardBar({height:38,title:"Automation",url:`./powerup-command-runner.html?cmd=${e.id}&type=boardButton`}).catch(e=>c.handleError(new Error("boardButtonClick: "+e.message),"boardButtonClick"))}}})):[]})):[]})).catch(e=>(c.handleError(new Error("getBoardButtons: "+e.message),"getBoardButtons"),[]))):[]}function t(e,t){return!e.getContext().omitCardButtons&&e.isMemberSignedIn()&&e.memberCanWriteToModel("card")?(u.init(e),d.checkUserQuota(e).catch(e=>{c.handleError(new Error("getCardButtons-checkUserQuota: "+e.message),"getCardButtons-checkUserQuota")}),TrelloPowerUp.Promise.all([d.getUserPlanLocal(e),u.getLocalCommands(),l.getUnseenSuggestionCount(e)]).spread((function(e,n,r){const o=n.commands.filter((function(e){return"card-button"===e.type&&e.enabled}));let a;r.total&&(a={icon:"./img/butler-powerup-card-btn.svg",text:`Butler Tip${r.total>1?"s":""} (${r.total})`,callback:e=>(i.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"butlerUnseenSuggestionsButton",source:"cardDetailScreen",attributes:{numUnseenSuggestions:r.total,section:"powerupsSection"}}),p.registerIfNecessary(e,!0,u).then(()=>e.hideCard().then((function(){return e.overlay({url:`./powerup-dashboard.html?board=${t.context.board}&tab=suggestions`,inset:!0})}))).catch(_,()=>{}).catch(e=>{c.handleError(new Error("getCardButtons-registerIfNecessary: "+e.message),"getCardButtons-registerIfNecessary")}))});const s=o.sort((function(e,t){return e.is_own?t.is_own?0:-1:t.is_own?1:0})).slice(0,20).map((function(e){return{icon:`./assets/fa-5.1.1/icons/grey/${e.image}.svg`,text:e.label,callback(t){i.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"butlerCardButton",source:"cardDetailScreen",attributes:{close:e.close,section:"powerupsSection"}}),t.boardBar({height:38,title:"Automation",url:"./powerup-command-runner.html?cmd="+e.id}),e.close&&t.hideCard().catch((function(){}))}}}));return a&&s.push(a),s})).catch(e=>(c.handleError("getCardButtons",e),[{icon:"./img/butler-powerup-card-attn-btn.svg",text:"Butler",callback:e=>p.registerIfNecessary(e,!0,u).then(()=>e.overlay({url:"./powerup-dashboard.html?board="+t.context.board,inset:!0})).catch(_,()=>{}).catch(e=>c.handleError(new Error("getCardButtons-registerIfNecessary: "+e.message),"getCardButtons-registerIfNecessary"))}]))):[]}function n(e,t){if(e.closePopup().catch(()=>{}),"canShowButlerUI"in e.getContext()&&!e.getContext().canShowButlerUI)return e.alert({message:"Your enterprise has restricted the Butler dashboard to workspace admins.",duration:10});if(!e.isMemberSignedIn()||!e.memberCanWriteToModel("board"))return e.alert({display:"warning",duration:10,message:"To use Butler on this board you must be a member of the board."});let n;u.init(e);const r={board:t.context.board},o=new URLSearchParams;if(t.butlerTab&&(r.tab=t.butlerTab),t.butlerCmdEdit&&(r.commandEdit=t.butlerCmdEdit),t.butlerCmdLog&&(r.commandLog=t.butlerCmdLog),t.newCommand)try{n=a.decompressFromEncodedURIComponent(t.newCommand)?t.newCommand:a.compressToEncodedURIComponent(t.newCommand),r.newCommand=n,o.set("c",n)}catch(e){n=null}t.butlerUsage&&(r.usage=t.butlerUsage),t.butlerAccount&&(r.account=t.butlerAccount),t.newIcon&&(r.newIcon=t.newIcon,o.set("i",t.newIcon)),t.newLabel&&(r.newLabel=t.newLabel,o.set("l",t.newLabel)),t.highlightCommand&&(r.highlightCommand=t.highlightCommand);const i=new URLSearchParams(r),s=TrelloPowerUp.util.relativeUrl("./powerup-dashboard.html?"+i.toString());return e.signUrl(s,{inset:!0})}function s(e){return p.clearMemory(e),!0}f.init=function(){if("undefined"==typeof TrelloPowerUp)return o.captureException(new Error("TrelloPowerUp script failed to load.")),console.log("[ERROR] TrelloPowerUp script failed to load.");window._trello=TrelloPowerUp.initialize({"board-buttons":e,"card-buttons":t,"show-settings":n,"remove-data":s},{targetOrigin:r()});window._trello.member("id").then((function(e){o.configureScope((function(t){e&&"notLoggedIn"!==e.id&&t.setUser({id:e.id})}))})).catch(e=>c.handleError(new Error("configureSentry: "+e.message),"configureSentry"))}}(),window.ButlerPowerUp=f},function(e,t){e.exports={getTargetOrigin:function(){var e;return"undefined".split(",").includes(null===(e=document)||void 0===e?void 0:e.referrer)?document.referrer:"https://trello.com"}}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalizationKeysForCommand=t.localizeCommandToButlerEnglish=t.parseInlineDate=t.parseEnterpriseCommand=t.parseCondition=t.parseCommand=t.getTimezoneName=t.correctParseResult=t.configureCommandParser=void 0;var a=n(107);Object.defineProperty(t,"configureCommandParser",{enumerable:!0,get:function(){return a.configureGlobals}});var i=n(157);Object.defineProperty(t,"correctParseResult",{enumerable:!0,get:function(){return i.correctParseResult}}),Object.defineProperty(t,"getTimezoneName",{enumerable:!0,get:function(){return i.getTimezoneName}}),Object.defineProperty(t,"parseCommand",{enumerable:!0,get:function(){return i.parseCommand}}),Object.defineProperty(t,"parseCondition",{enumerable:!0,get:function(){return i.parseCondition}}),Object.defineProperty(t,"parseEnterpriseCommand",{enumerable:!0,get:function(){return i.parseEnterpriseCommand}}),Object.defineProperty(t,"parseInlineDate",{enumerable:!0,get:function(){return i.parseInlineDate}});var s=n(174);Object.defineProperty(t,"localizeCommandToButlerEnglish",{enumerable:!0,get:function(){return s.localizeCommandToButlerEnglish}}),Object.defineProperty(t,"getLocalizationKeysForCommand",{enumerable:!0,get:function(){return s.getLocalizationKeysForCommand}}),o(n(182),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInlineDate=t.parseEnterpriseCommand=t.parseCondition=t.parseCommand=t.getTimezoneName=t.correctParseResult=void 0;var r=n(75);Object.defineProperty(t,"correctParseResult",{enumerable:!0,get:function(){return r.correctParseResult}}),Object.defineProperty(t,"getTimezoneName",{enumerable:!0,get:function(){return r.getTimezoneName}}),Object.defineProperty(t,"parseCommand",{enumerable:!0,get:function(){return r.parseCommand}}),Object.defineProperty(t,"parseCondition",{enumerable:!0,get:function(){return r.parseCondition}}),Object.defineProperty(t,"parseEnterpriseCommand",{enumerable:!0,get:function(){return r.parseEnterpriseCommand}}),Object.defineProperty(t,"parseInlineDate",{enumerable:!0,get:function(){return r.parseInlineDate}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommandGrammar=void 0;const r=n(75);let o;t.getCommandGrammar=()=>(o||(o=o||{_COMMA:(0,r.optional)((0,r.or)(",",";")),_COMMA__HELP:",",_A:(0,r.or)("a","an","one","the"),_A__HELP:"a",_AN:"_A",_AN__HELP:"an",_THE:(0,r.or)("the","a","an"),_THE__HELP:"the",_AND:(0,r.or)(["_COMMA",(0,r.optional)("and")],"and"),_AND__HELP:"and",_OR:(0,r.or)(["_COMMA",(0,r.optional)("or")],"or"),_OR__HELP:"or",_AND_OR:(0,r.or)(["_COMMA",(0,r.optional)((0,r.or)("and","or"))],(0,r.or)("and","or")),_AND_OR__HELP:"and",_THAT_IS:(0,r.or)(["that","is"],"that's"),_THAT_IS_NOT:(0,r.or)(["that","is","not"],["that","isn't"],["that's","not"]),_EVERY:(0,r.or)("every","each"),_EVERY__HELP:"every",_IN:(0,r.or)("in","on","of"),_IN__HELP:"in",_INTO:(0,r.or)(["in","to"],"in","into","to","at","on"),_INTO__HELP:"into",_OUTOF:(0,r.or)(["out","of"],[(0,r.optional)("away"),"from"]),_OUTOF__HELP:["out","of"],_TO:"_INTO",_TO__HELP:"to",_FROM:"from",_CALLED:(0,r.or)("called","named","titled",["with","name"],["with","title"]),_THE_CARD:(0,r.or)("it",[(0,r.optional)((0,r.or)("the","this","that")),(0,r.optional)("same"),"card"]),THE_CARD:"_THE_CARD",_THE_CARD__HELP:["the","card"],_TO_THE_CARD:["_TO","_THE_CARD"],_IN_THE_CARD:["_IN","_THE_CARD"],_THE_CARD_S:(0,r.or)("its",[(0,r.optional)((0,r.or)("the","this","that")),(0,r.optional)("same"),(0,r.or)("card's","card")],"the"),_THE_CARD_S__HELP:["the","card's"],_ALL_THE_CARDS:(0,r.or)(["all",(0,r.optional)("the"),"cards"],["the","cards"],["_EVERY","card"],["any",(0,r.or)("card","cards")]),_ALL_THE_CARDS_NEW:(0,r.or)(["all",(0,r.optional)("the"),"cards"],["the","cards"],["any",(0,r.or)("card","cards")]),_ALL_THE_CARDS__HELP:(0,r.or)(["all","the","cards"],["_EVERY","card"]),_THE_LIST:(0,r.or)("it",[(0,r.optional)((0,r.or)("the","this","that")),(0,r.optional)("same"),"list"]),THE_LIST:"_THE_LIST",_THE_LIST__HELP:["the","list"],_THIS_BOARD:[(0,r.or)("this","the"),"board"],THIS_BOARD:"_THIS_BOARD",_THIS_BOARD__HELP:["this","board"],_IN_THIS_BOARD:[(0,r.or)("in","on","of"),"_THIS_BOARD"],_INTO_BOARD:["_INTO","_THIS_BOARD"],_OUTOF_BOARD:["_OUTOF","_THIS_BOARD"],_TEAM:(0,r.or)("team","workspace"),_IN_A_CHECKLIST:["in","a","checklist"],_TO_A_CHECKLIST:["to","a","checklist"],_FROM_A_CHECKLIST:["from","a","checklist"],DAY:(0,r.or_index)((0,r.or)("sunday","sun"),(0,r.or)("monday","mon"),(0,r.or)("tuesday","tue"),(0,r.or)("wednesday","wed"),(0,r.or)("thursday","thu"),(0,r.or)("friday","fri"),(0,r.or)("saturday","sat")),_DAY_LIST:["DAY",(0,r.optional)(["_AND_OR?","_DAY_LIST"])],_DAY_LIST__HELP:(0,r.or)("DAY",["DAY","and","DAY"]),LAST_MONTH_WEEK:"last",MONTH_WEEK_NUMBER:(0,r.or)((0,r.or_index)("","first","second","third","fourth"),(0,r.or_index)("","1st","2nd","3rd","4th")),NOW:"now",IN_MINUTES:(0,r.small_numeral)("a number of minutes, e.g. 30 minutes",!0),_IN_MINUTES:[(0,r.optional)("in"),(0,r.or)("IN_MINUTES","{IN_MINUTES}"),(0,r.or)("minute","minutes"),(0,r.optional)((0,r.or)(["from","now"],"later"))],IN_HOURS:(0,r.small_numeral)("a number of hours, e.g. 24",!0),_IN_HOURS:[(0,r.optional)("in"),(0,r.or)("IN_HOURS","{IN_HOURS}"),(0,r.or)("hour","hours"),(0,r.optional)((0,r.or)(["from","now"],"later"))],TODAY:"today",TOMORROW:"tomorrow",YESTERDAY:"yesterday",END_OF_DAY:["the","end","of"],BEFORE_DAY:["before","END_OF_DAY?","DAY"],NEXT_DAY:["_THE?",(0,r.optional)("next"),"DAY"],NEXT_WEEK:["_THE?","next","week",(0,r.optional)(["on","DAY"])],NEXT_MONTH:["_THE?","next","month",(0,r.optional)(["on","the","MONTH_DAY_NUMBER"])],MONTH_DAY_NUMBER:(0,r.or)((0,r.ordinal)("an ordinal day of the month, e.g. fifth",1,31),(0,r.small_numeral)("a day of the month, e.g. 21",!1,1,31)),WHICH_MONTH_THIS:"this",WHICH_MONTH_THE:"the",WHICH_MONTH_NEXT:[(0,r.optional)("the"),(0,r.or)("next","upcoming")],_WHICH_MONTH:[(0,r.optional)("of"),(0,r.or)("WHICH_MONTH_THIS","WHICH_MONTH_NEXT","WHICH_MONTH_THE"),"month"],NTH_WEEK_DAY:[(0,r.optional)("the"),(0,r.or)("MONTH_WEEK_NUMBER","LAST_MONTH_WEEK"),"DAY","_WHICH_MONTH?"],WORKING:"working",FIRST_MONTH_DAY:(0,r.or)(["first","WORKING?","day"],"start"),_LAST_MONTH_DAY:(0,r.or)(["last","WORKING?","day"],"end"),LAST_MONTH_DAY:"_LAST_MONTH_DAY",MONTH_DAY:(0,r.or)(["the","MONTH_DAY_NUMBER",(0,r.optional)("day"),"_WHICH_MONTH?"],["the",(0,r.or)("FIRST_MONTH_DAY","LAST_MONTH_DAY"),"_WHICH_MONTH"]),X_DAYS:(0,r.small_numeral)("a number of days, e.g. two days",!0),X_WORKING_DAYS:(0,r.small_numeral)("a number of days, e.g. two days",!0),X_WEEKS:(0,r.small_numeral)("a number of weeks, e.g. two weeks"),X_MONTHS:(0,r.small_numeral)("a number of months, e.g. two months"),IN_X_FROM_TODAY:[(0,r.optional)("in"),(0,r.or)([(0,r.or)("X_DAYS","{X_DAYS}"),(0,r.or)("day","days")],[(0,r.or)("X_WORKING_DAYS","{X_WORKING_DAYS}"),"working",(0,r.or)("day","days")],[(0,r.or)("X_WEEKS","{X_WEEKS}"),(0,r.or)("week","weeks")],[(0,r.or)("X_MONTHS","{X_MONTHS}"),(0,r.or)("month","months")]),(0,r.optional)((0,r.or)(["from",(0,r.or)("now","today")],"later"))],THE_NEXT_WORKING_DAY:["the","next","working","day"],_RELATIVE_DATE:(0,r.or)("NOW","_IN_MINUTES","_IN_HOURS","TODAY","TOMORROW","YESTERDAY","BEFORE_DAY","NEXT_DAY","NEXT_WEEK","NEXT_MONTH","NTH_WEEK_DAY","MONTH_DAY","IN_X_FROM_TODAY","THE_NEXT_WORKING_DAY"),TIME:(0,r.time)(),MONTH:(0,r.or)((0,r.or_index)("","january","february","march","april",["may",(0,r.optional)(".")],"june","july","august","september","october","november","december"),(0,r.or_index)("",["jan",(0,r.optional)(".")],["feb",(0,r.optional)(".")],["mar",(0,r.optional)(".")],["apr",(0,r.optional)(".")],["may",(0,r.optional)(".")],["jun",(0,r.optional)(".")],["jul",(0,r.optional)(".")],["aug",(0,r.optional)(".")],[(0,r.or)("sep","sept"),(0,r.optional)(".")],["oct",(0,r.optional)(".")],["nov",(0,r.optional)(".")],["dec",(0,r.optional)(".")])),YEAR:(0,r.year)(),END_OF_MONTH:[(0,r.optional)("the"),"_LAST_MONTH_DAY",(0,r.optional)("of")],WRITTEN_DATE:[(0,r.or)([(0,r.optional)(["DAY","_COMMA"]),(0,r.or)(["MONTH",(0,r.optional)("the"),"MONTH_DAY_NUMBER"],[(0,r.optional)("the"),"MONTH_DAY_NUMBER",(0,r.optional)("of"),"MONTH"])],["END_OF_MONTH?","MONTH"]),(0,r.optional)(["_COMMA",(0,r.optional)("of"),"YEAR"])],INLINE_WRITTEN_DATE:[(0,r.or)([(0,r.optional)(["DAY","_COMMA"]),(0,r.or)(["MONTH",(0,r.optional)("the"),"MONTH_DAY_NUMBER"],[(0,r.optional)("the"),"MONTH_DAY_NUMBER",(0,r.optional)("of"),"MONTH"])],["END_OF_MONTH?","MONTH"]),(0,r.optional)(["_COMMA",(0,r.optional)("of"),"YEAR"])],NUMERIC_DATE:(0,r.numeric_date)(),_DATE:(0,r.or)("NUMERIC_DATE","WRITTEN_DATE","_RELATIVE_DATE"),FROM_DATE:[(0,r.or)("from",["starting",(0,r.optional)("on")]),"_DATE"],_DATE_TIME:(0,r.or)(["_DATE","TIME?"],"TIME"),DATE_TIME:"_DATE_TIME",_INLINE_DATE:(0,r.or)("NUMERIC_DATE","INLINE_WRITTEN_DATE=>WRITTEN_DATE","_RELATIVE_DATE"),_INLINE_DATE_TIME:(0,r.or)(["_INLINE_DATE","TIME?"],"TIME"),INLINE_DATE_TIME:["_INLINE_DATE_TIME",""],END_DATE_TIME:["_INLINE_DATE_TIME",(0,r.optional)("."),""],EVERY_DAY:["_EVERY","day"],EVERY_WEEKDAY:["_EVERY","weekday"],_OF_THE_MONTH:["of","the","month"],CERTAIN_DAYS:["_EVERY",(0,r.optional)((0,r.or)("MONTH_WEEK_NUMBER","LAST_MONTH_WEEK")),"_DAY_LIST","_OF_THE_MONTH?"],_ON_DAY_LIST:["on","_DAY_LIST"],EVERY_WEEK:["_EVERY",(0,r.or)("week",["X_WEEKS","weeks"]),"_ON_DAY_LIST?"],EVERY_MONTH:(0,r.or)(["_EVERY",(0,r.or)("month",["X_MONTHS","months"]),(0,r.optional)(["on","the",(0,r.or)("FIRST_MONTH_DAY","LAST_MONTH_DAY","MONTH_DAY_NUMBER"),"_OF_THE_MONTH?"])],["_EVERY",(0,r.or)("FIRST_MONTH_DAY","LAST_MONTH_DAY"),"_OF_THE_MONTH?"],["on","the",(0,r.or)("MONTH_DAY_NUMBER","FIRST_MONTH_DAY","LAST_MONTH_DAY"),"of","_EVERY","month"],["at","the",(0,r.or)("FIRST_MONTH_DAY","LAST_MONTH_DAY"),"of","_EVERY","month"]),EVERY_YEAR:(0,r.or)(["_EVERY",(0,r.optional)(["year","on"]),"MONTH","MONTH_DAY_NUMBER"],["_EVERY",(0,r.optional)(["year","on","the"]),"MONTH_DAY_NUMBER","of","MONTH"],["_EVERY",(0,r.optional)(["year","in"]),"MONTH"],["_EVERY","year"],["on","MONTH","MONTH_DAY_NUMBER",(0,r.optional)([(0,r.optional)("of"),"_EVERY","year"])],["on",(0,r.optional)("the"),"MONTH_DAY_NUMBER","of",(0,r.or)(["_EVERY?","MONTH"],["MONTH",(0,r.optional)([(0,r.optional)("of"),"_EVERY","year"])])]),FROM_HOUR:["from",(0,r.time)()],TO_HOUR:["to",(0,r.time)()],FROM_DAY:["from","DAY",(0,r.optional)((0,r.time)())],TO_DAY:["to","DAY",(0,r.optional)((0,r.time)())],MINUTE:(0,r.small_numeral)("the minute number, between 0 and 59",!1,0,59),_ON_MINUTE:["_COMMA","on","minute","MINUTE","_COMMA"],EVERY_HOUR:["_EVERY","hour","_COMMA","_ON_MINUTE?",(0,r.optional)(["FROM_HOUR","TO_HOUR?"]),(0,r.optional)(["FROM_DAY","TO_DAY"])],EVERY:(0,r.or)([(0,r.or)("EVERY_DAY","EVERY_WEEKDAY","EVERY_YEAR","CERTAIN_DAYS"),"TIME?"],[(0,r.or)("EVERY_WEEK","EVERY_MONTH"),(0,r.optional)((0,r.or)((0,r.swappable)("TIME","FROM_DATE"),"TIME","FROM_DATE"))],"EVERY_HOUR"),WHO_I:"i",WHO_ANYONE:(0,r.or)("someone","anyone"),WHO_ANYONE_BUT:["anyone",(0,r.or)("but","except"),"MEMBER"],WHO:(0,r.or)("WHO_I","WHO_ANYONE_BUT","WHO_ANYONE","MEMBER"),_BY_WHOM:["by","WHO"],COLOR:(0,r.or)("blue","green","orange","purple","red","yellow","sky","lime","pink","black"),LIST_COLOR:(0,r.or)("green","yellow","orange","red","purple","blue","teal","lime","magenta","gray"),COLOR_VARIANT:(0,r.or)("light","dark","bold","subtle"),LABEL:["_A?",(0,r.or)(["COLOR_VARIANT?","COLOR","label",(0,r.optional)(["_CALLED?","$TITLE"])],["COLOR_VARIANT?","COLOR","$TITLE?","label"],["label","_CALLED?","$TITLE"],["$TITLE",(0,r.optional)(["COLOR_VARIANT?","COLOR"]),"label"])],ANY_LABEL:[(0,r.or)("a","any"),"label"],_ATTACHMENT_CONDITION:(0,r.or)("_STARTING_WITH","_NOT_STARTING_WITH","_ENDING_WITH","_NOT_ENDING_WITH","_CONTAINING","_NOT_CONTAINING"),ATTACHMENT_ADDED:(0,r.or)(["_AN?","attachment","_ATTACHMENT_CONDITION?",(0,r.optional)("is"),"added","_INTO_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("add","adds"),"_AN?","attachment","_ATTACHMENT_CONDITION?","_INTO_TARGET_CARD?"]),ATTACHMENT_REMOVED:(0,r.or)(["_AN?","attachment","_ATTACHMENT_CONDITION?",(0,r.optional)("is"),"removed","_FROM_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("remove","removes"),"_AN?","attachment","_ATTACHMENT_CONDITION?","_FROM_TARGET_CARD?"]),LINK_ADDED:(0,r.or)(["_A?","link","_ATTACHMENT_CONDITION?",(0,r.optional)("is"),"added","_INTO_TARGET_CARD","_BY_WHOM?"],["WHO",(0,r.or)("add","adds"),"_A?","link","_ATTACHMENT_CONDITION?","_INTO_TARGET_CARD"]),_LABEL_ADDED_VERB:(0,r.or)("add","adds","added","apply","applies","applied","put","puts"),LABEL_ADDED:(0,r.or)([(0,r.or)("LABEL","ANY_LABEL"),(0,r.optional)("is"),"_LABEL_ADDED_VERB","_INTO_TARGET_CARD?","_BY_WHOM?"],["WHO","_LABEL_ADDED_VERB",(0,r.or)("LABEL","ANY_LABEL"),"_INTO_TARGET_CARD?"]),LABEL_REMOVED:(0,r.or)([(0,r.or)("LABEL","ANY_LABEL"),(0,r.optional)("is"),"removed",(0,r.optional)(["from","_TARGET_CARD"]),"_BY_WHOM?"],["WHO",(0,r.or)("remove","removes"),(0,r.or)("LABEL","ANY_LABEL"),(0,r.optional)(["from","_TARGET_CARD"])]),MEMBER_ADDED:(0,r.or)(["MEMBER",(0,r.optional)("is"),(0,r.or)("added","assigned"),(0,r.optional)(["_TO?","_TARGET_CARD"]),"_BY_WHOM?"],["WHO",(0,r.or)("add","adds","assign","assigns"),"MEMBER",(0,r.optional)(["_TO?","_TARGET_CARD"])],["WHO",(0,r.or)("assign","assigns"),["_TARGET_CARD","_TO"],"MEMBER"],["_TARGET_CARD","is","assigned","_TO","MEMBER"]),MEMBER_REMOVED:(0,r.or)(["MEMBER",(0,r.optional)("is"),(0,r.or)("removed"),(0,r.optional)(["from","_TARGET_CARD"]),"_BY_WHOM?"],["WHO",(0,r.or)("remove","removes"),"MEMBER",(0,r.optional)(["from","_TARGET_CARD"])]),CHECKLIST_ADDED:(0,r.or)([(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),(0,r.optional)("is"),"added","_INTO_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("add","adds"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),"_INTO_TARGET_CARD?"]),CHECKLIST_REMOVED:(0,r.or)([(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),(0,r.optional)("is"),"removed",(0,r.optional)(["from","_TARGET_CARD"]),"_BY_WHOM?"],["WHO",(0,r.or)("remove","removes"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),(0,r.optional)(["from","_TARGET_CARD"])]),_A_CARD:[(0,r.or)("_A","_THE"),"card"],_A_COMMENT:["_A","comment"],_COMMENT_ADDED_VERB_PASSIVE:(0,r.or)("added","posted"),_COMMENT_ADDED_VERB:(0,r.or)("add","adds","write","writes","post","posts"),_COMMENT_CONDITION:(0,r.or)("_STARTING_WITH","_NOT_STARTING_WITH","_ENDING_WITH","_NOT_ENDING_WITH","_CONTAINING","_NOT_CONTAINING"),COMMENT_ADDED:(0,r.or)(["_A_COMMENT","_COMMENT_CONDITION?",(0,r.optional)("is"),"_COMMENT_ADDED_VERB_PASSIVE","_INTO_TARGET_CARD?","_BY_WHOM?"],["WHO","_COMMENT_ADDED_VERB","_A_COMMENT","_COMMENT_CONDITION?","_INTO_TARGET_CARD?"]),VOTE_ADDED:["a","vote","is","added",(0,r.or)("to","on")],_ADDS_VOTE_TO:(0,r.or)([(0,r.or)("votes","vote"),(0,r.optional)("on")],[(0,r.or)("adds","add"),"a","vote",(0,r.or)("to","on")]),VOTE_REMOVED:["a","vote","is","removed","from"],_REMOVES_VOTE_FROM:(0,r.or)([(0,r.or)("unvotes","unvote"),(0,r.optional)("on")],[(0,r.or)("removes","remove"),(0,r.or)("a","the"),"vote",(0,r.or)("from","on")]),_CARD_VOTED:["voted",(0,r.optional)("on")],_CARD_UNVOTED:["unvoted"],VOTE_ON_CARD:(0,r.or)(["VOTE_ADDED","_TARGET_CARD?","_BY_WHOM?"],["WHO","_ADDS_VOTE_TO=>VOTE_ADDED","_TARGET_CARD?"],["VOTE_REMOVED","_TARGET_CARD?","_BY_WHOM?"],["WHO","_REMOVES_VOTE_FROM=>VOTE_REMOVED","_TARGET_CARD?"],["_TARGET_CARD","is",(0,r.or)("_CARD_VOTED=>VOTE_ADDED","_CARD_UNVOTED=>VOTE_REMOVED")]),_A_START_DATE:[(0,r.or)("_A","_THE"),"start","date"],_A_DUE_DATE:[(0,r.or)("_A","_THE"),"due","date"],THE_DUE_DATE:[(0,r.optional)((0,r.or)("the","its")),"due","date"],_DATE_ADDED_VERB_PASSIVE:(0,r.or)("added","applied","assigned","set","given","scheduled"),_DATE_ADDED_VERB:(0,r.or)("add","adds","apply","applies","assign","assigns","set","give","gives","schedule","schedules"),DUE_DATE_MOVED:(0,r.or)("moved","move","moves"),START_DATE_MOVED:(0,r.or)("moved","move","moves"),ON_CHECKLIST_ITEM:["on","_CHECKLIST_ITEM"],FROM_CHECKLIST_ITEM:["from","_CHECKLIST_ITEM"],DUE_DATE_ADDED:(0,r.or)(["_A_DUE_DATE","DATE_CONDITION?",(0,r.optional)("is"),(0,r.or)("_DATE_ADDED_VERB_PASSIVE","DUE_DATE_MOVED"),(0,r.optional)((0,r.or)("_INTO_TARGET_CARD","ON_CHECKLIST_ITEM")),"_BY_WHOM?"],["WHO",(0,r.or)("_DATE_ADDED_VERB","DUE_DATE_MOVED"),"_A_DUE_DATE","_INTO_TARGET_CARD?"],["_TARGET_CARD","is","scheduled","_BY_WHOM?"],["WHO",(0,r.or)("schedule","schedules"),"_TARGET_CARD"],["_TARGET_CARD","is","given","_A_DUE_DATE","_BY_WHOM?"],["WHO",(0,r.or)("give","gives"),"_TARGET_CARD","_A_DUE_DATE"]),START_DATE_ADDED:(0,r.or)(["_A_START_DATE","DATE_CONDITION?",(0,r.optional)("is"),(0,r.or)("_DATE_ADDED_VERB_PASSIVE","START_DATE_MOVED"),"_INTO_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("_DATE_ADDED_VERB","START_DATE_MOVED"),"_A_START_DATE","_INTO_TARGET_CARD?"],["_TARGET_CARD","is","scheduled","_BY_WHOM?"],["WHO",(0,r.or)("schedule","schedules"),"_TARGET_CARD"],["_TARGET_CARD","is","given","_A_START_DATE","_BY_WHOM?"],["WHO",(0,r.or)("give","gives"),"_TARGET_CARD","_A_START_DATE"]),_DATE_REMOVED_VERB_PASSIVE:(0,r.or)("removed","deleted"),_DATE_REMOVED_VERB:(0,r.or)("remove","removes","delete","deletes"),DUE_DATE_REMOVED:(0,r.or)(["_A_DUE_DATE",(0,r.optional)("is"),"_DATE_REMOVED_VERB_PASSIVE",(0,r.optional)((0,r.or)("_FROM_TARGET_CARD","FROM_CHECKLIST_ITEM")),"_BY_WHOM?"],["WHO","_DATE_REMOVED_VERB","_A_DUE_DATE","_FROM_TARGET_CARD?"]),START_DATE_REMOVED:(0,r.or)(["_A_START_DATE",(0,r.optional)("is"),"_DATE_REMOVED_VERB_PASSIVE","_FROM_TARGET_CARD?","_BY_WHOM?"],["WHO","_DATE_REMOVED_VERB","_A_START_DATE","_FROM_TARGET_CARD?"]),WITH_CARD_COMPLETE:["marked",(0,r.optional)("as"),(0,r.or)("COMPLETE","INCOMPLETE")],CARD_COMPLETED:(0,r.or)(["_A_CARD",(0,r.optional)("is"),(0,r.or)("completed","checked",["marked",(0,r.optional)("as"),"complete"]),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)([(0,r.or)("completes","complete","checks","check"),"_A_CARD","_ON_TARGET_CARD?"],[(0,r.or)("marks","mark"),"_A_CARD",(0,r.swappable)([(0,r.optional)("as"),"complete"],"_ON_TARGET_CARD?")])]),CARD_INCOMPLETED:(0,r.or)(["_A_CARD",(0,r.optional)("is"),(0,r.or)("incompleted","unchecked",["marked",(0,r.optional)("as"),"incomplete"],["unmarked",(0,r.optional)("as"),"complete"]),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)([(0,r.or)("incompletes","incomplete","unchecks","uncheck"),"_A_CARD","_ON_TARGET_CARD?"],[(0,r.or)("marks","mark"),"_A_CARD",(0,r.swappable)([(0,r.optional)("as"),"incomplete"],"_ON_TARGET_CARD?")],[(0,r.or)("unmarks","unmark"),"_A_CARD",(0,r.swappable)([(0,r.optional)("as"),"complete"],"_ON_TARGET_CARD?")])]),DUE_DATE_COMPLETED:(0,r.or)(["_A_DUE_DATE",(0,r.optional)("is"),(0,r.or)("completed","checked",["marked",(0,r.optional)("as"),"complete"]),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)([(0,r.or)("completes","complete","checks","check"),"_A_DUE_DATE","_ON_TARGET_CARD?"],[(0,r.or)("marks","mark"),"_A_DUE_DATE",(0,r.swappable)([(0,r.optional)("as"),"complete"],"_ON_TARGET_CARD?")])]),DUE_DATE_INCOMPLETED:(0,r.or)(["_A_DUE_DATE",(0,r.optional)("is"),(0,r.or)("incompleted","unchecked",["marked",(0,r.optional)("as"),"incomplete"],["unmarked",(0,r.optional)("as"),"complete"]),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)([(0,r.or)("incompletes","incomplete","unchecks","uncheck"),"_A_DUE_DATE","_ON_TARGET_CARD?"],[(0,r.or)("marks","mark"),"_A_DUE_DATE",(0,r.swappable)([(0,r.optional)("as"),"incomplete"],"_ON_TARGET_CARD?")],[(0,r.or)("unmarks","unmark"),"_A_DUE_DATE",(0,r.swappable)([(0,r.optional)("as"),"complete"],"_ON_TARGET_CARD?")])]),_FROM_LIST_CONDITION:"_FROM_LISTS",DESTINATION_POSITION:[(0,r.optional)("the"),"POSITION_TOP",(0,r.optional)("position"),"of"],_DESTINATION_POSITION_CONDITION:"DESTINATION_POSITION",CARD_INTO_LIST:(0,r.or)(["_TARGET_CARD","is","_CARD_VERBS","_FROM_LIST_CONDITION=>CONDITION?","_INTO","_DESTINATION_POSITION_CONDITION=>CONDITION?","_LISTS","_BY_WHOM?"],["WHO","_CARD_VERBS","_TARGET_CARD","_INTO","_DESTINATION_POSITION_CONDITION=>CONDITION?","_LIST"]),CARD_OUTOF_LIST:(0,r.or)(["_TARGET_CARD","is","MOVED","_OUTOF","_LIST","_BY_WHOM?"],["WHO","MOVED","_TARGET_CARD","_OUTOF","_LIST"]),CARD_MOVED:(0,r.or)(["_TARGET_CARD","is","MOVED","_BY_WHOM?"],["WHO","MOVED","_TARGET_CARD"]),DAYS_IN_LIST:(0,r.small_numeral)("a number of days, e.g. two days"),MATCH_START:[(0,r.optional)(["the",(0,r.or)("text","word","words")]),"$TEXT"],_MATCH_START_LIST:["MATCH_START",(0,r.optional)([(0,r.optional)(","),"or","_MATCH_START_LIST"])],_STARTS_WITH:[(0,r.or)("starts","begins"),"with","_MATCH_START_LIST"],_NOT_STARTS_WITH:[(0,r.or)("doesn't",["does","not"]),(0,r.or)("start","begin"),"with","_MATCH_START_LIST","NEGATIVE_MATCH"],_STARTING_WITH:[(0,r.or)("starting","beginning",["that",(0,r.or)("starts","begins")]),"with","_MATCH_START_LIST"],_NOT_STARTING_WITH:[(0,r.or)(["not",(0,r.or)("starting","beginning")],["that",(0,r.or)("doesn't",["does","not"]),(0,r.or)("start","begin")]),"with","_MATCH_START_LIST","NEGATIVE_MATCH"],MATCH_END:[(0,r.optional)(["the",(0,r.or)("text","word","words")]),"$TEXT"],_MATCH_END_LIST:["MATCH_END",(0,r.optional)([(0,r.optional)(","),"or","_MATCH_END_LIST"])],_ENDS_WITH:["ends","with","_MATCH_END_LIST"],_NOT_ENDS_WITH:[(0,r.or)("doesn't",["does","not"]),"end","with","_MATCH_END_LIST","NEGATIVE_MATCH"],_ENDING_WITH:[(0,r.or)("ending",["that","ends"]),"with","_MATCH_END_LIST"],_NOT_ENDING_WITH:[(0,r.or)(["not","ending"],["that",(0,r.or)("doesn't",["does","not"]),"end"]),"with","_MATCH_END_LIST","NEGATIVE_MATCH"],MATCH_CONTENT:[(0,r.optional)(["the",(0,r.or)("text","word","words")]),"$TEXT"],_MATCH_CONTENT_LIST:["MATCH_CONTENT",(0,r.optional)([(0,r.optional)(","),"or","_MATCH_CONTENT_LIST"])],_CONTAINS:["contains","_MATCH_CONTENT_LIST"],NEGATIVE_MATCH:[],_WITHOUT:["without","NEGATIVE_MATCH"],_NOT_CONTAINS:[(0,r.or)("doesn't",["does","not"]),"contain","_MATCH_CONTENT_LIST","NEGATIVE_MATCH"],_CONTAINING:[(0,r.or)("containing",["that","contains"]),"_MATCH_CONTENT_LIST"],_NOT_CONTAINING:[(0,r.or)(["not","containing"],["that",(0,r.or)("doesn't",["does","not"]),"contain"]),"_MATCH_CONTENT_LIST","NEGATIVE_MATCH"],_AFTER_TEXT:["after",(0,r.optional)(["the",(0,r.or)("text","word","words")]),"$AFTER_TEXT"],_A_DATE_AFTER:["a","date","_AFTER_TEXT?"],DATE_AT_START:[(0,r.or)("starts","begins"),"with","_A_DATE_AFTER"],NOT_DATE_AT_START:[(0,r.or)("doesn't",["does","not"]),(0,r.or)("start","begin"),"with","_A_DATE_AFTER"],_NOT_DATE_AT_START:["NOT_DATE_AT_START=>DATE_AT_START","NEGATIVE_MATCH"],STARTING_WITH_DATE:[(0,r.or)("starting","beginning",["that","starts"],["that","begins"]),"with","_A_DATE_AFTER"],_STARTING_WITH_DATE:"STARTING_WITH_DATE=>DATE_AT_START",NOT_STARTING_WITH_DATE:[(0,r.or)(["not",(0,r.or)("starting","beginning")],["that",(0,r.or)("doesn't",["does","not"]),(0,r.or)("start","begin")]),"with","_A_DATE_AFTER"],_NOT_STARTING_WITH_DATE:["NOT_STARTING_WITH_DATE=>DATE_AT_START","NEGATIVE_MATCH"],DATE_AT_END:["ends","with","_A_DATE_AFTER"],NOT_DATE_AT_END:[(0,r.or)("doesn't",["does","not"]),"end","with","_A_DATE_AFTER"],_NOT_DATE_AT_END:["NOT_DATE_AT_END=>DATE_AT_END","NEGATIVE_MATCH"],ENDING_WITH_DATE:[(0,r.or)("ending",["that","ends"]),"with","_A_DATE_AFTER"],_ENDING_WITH_DATE:"ENDING_WITH_DATE=>DATE_AT_END",NOT_ENDING_WITH_DATE:[(0,r.or)(["not","ending"],["that",(0,r.or)("doesn't",["does","not"]),"end"]),"with","_A_DATE_AFTER"],_NOT_ENDING_WITH_DATE:["NOT_ENDING_WITH_DATE=>DATE_AT_END","NEGATIVE_MATCH"],CONTAINS_DATE:["contains","_A_DATE_AFTER"],NOT_CONTAINS_DATE:[(0,r.or)("doesn't",["does","not"]),"contain","_A_DATE_AFTER"],_NOT_CONTAINS_DATE:["NOT_CONTAINS_DATE=>CONTAINS_DATE","NEGATIVE_MATCH"],CONTAINING_DATE:[(0,r.or)("containing",["that","contains"]),"_A_DATE_AFTER"],_CONTAINING_DATE:"CONTAINING_DATE=>CONTAINS_DATE",NOT_CONTAINING_DATE:[(0,r.or)(["not","containing"],["that",(0,r.or)("doesn't",["does","not"]),"contain"]),"_A_DATE_AFTER"],_NOT_CONTAINING_DATE:["NOT_CONTAINING_DATE=>CONTAINS_DATE","NEGATIVE_MATCH"],LONGER_THAN:(0,r.small_numeral)(),_TEXT_LENGTH:[(0,r.optional)("is"),"longer","than","LONGER_THAN",(0,r.optional)("characters")],NAME_FIELD:[(0,r.optional)((0,r.or)("a","the")),(0,r.optional)("card"),(0,r.or)("name","title")],DESCRIPTION_FIELD:[(0,r.optional)((0,r.or)("a","the")),(0,r.optional)("card"),"description"],_WHAT_FIELD:[(0,r.or)(["NAME_FIELD","or","DESCRIPTION_FIELD"],"NAME_FIELD","DESCRIPTION_FIELD")],CARD_MATCHES:[(0,r.or)(["_TARGET_CARD",(0,r.optional)((0,r.or)("title","name"))],["_WHAT_FIELD","of","_TARGET_CARD"]),(0,r.or)("_STARTS_WITH","_NOT_STARTS_WITH","_ENDS_WITH","_NOT_ENDS_WITH","_CONTAINS","_NOT_CONTAINS","DATE_AT_START","_NOT_DATE_AT_START","DATE_AT_END","_NOT_DATE_AT_END","CONTAINS_DATE","_NOT_CONTAINS_DATE","_TEXT_LENGTH")],ENTERED:[],ENTERED_CARD_FIELD_MATCHES:["WHO",(0,r.or)("enter","enters","entered"),"_WHAT_FIELD",(0,r.or)("_STARTING_WITH","_NOT_STARTING_WITH","_ENDING_WITH","_NOT_ENDING_WITH","_CONTAINING","_NOT_CONTAINING","_STARTING_WITH_DATE","_NOT_STARTING_WITH_DATE","_ENDING_WITH_DATE","_NOT_ENDING_WITH_DATE","_CONTAINING_DATE","_NOT_CONTAINING_DATE"),"ENTERED"],_ENTERED_CARD_FIELD_MATCHES:"ENTERED_CARD_FIELD_MATCHES=>CARD_MATCHES",CARD_CHANGED:(0,r.or)(["WHO",(0,r.or)("change","changes","changed"),"_WHAT_FIELD",(0,r.or)("of","in"),"_TARGET_CARD"],["_WHAT_FIELD","of","_TARGET_CARD",(0,r.or)("is","was"),"changed","_BY_WHOM?"],["_WHAT_FIELD","of","_TARGET_CARD","changes"]),CREATED:(0,r.or)("create","creates","created"),MOVED:(0,r.or)("move","moves","moved","transfer","transfers","transferred","tranferred"),COPIED:(0,r.or)("copy","copies","copied"),EMAILED:(0,r.or)("email","emails","emailed","e-mail","e-mails","e-mailed"),ADDED:(0,r.or)("add","adds","added","put","puts"),_CARD_VERB:(0,r.or)("CREATED","MOVED","COPIED","ADDED","EMAILED"),_CARD_VERBS:["_CARD_VERB",(0,r.optional)(["_OR?","_CARD_VERB",(0,r.optional)(["_OR?","_CARD_VERB"])])],_CARD_VERBS__HELP:["_CARD_VERB"],_LIST:(0,r.or)(["_THE?","list","_CALLED?","$LIST"],["_THE?","$LIST",(0,r.optional)("list")]),_LISTS:["_LIST",(0,r.optional)(["_COMMA","_OR","_LISTS"])],CARD_INTO_BOARD:(0,r.or)(["_TARGET_CARD","is","MOVED","_INTO_BOARD","_BY_WHOM?"],["WHO","MOVED","_TARGET_CARD","_INTO_BOARD"],["_TARGET_CARD","is",(0,r.or)("CREATED","ADDED"),"_INTO_BOARD?","_BY_WHOM?"],["WHO",(0,r.or)("CREATED","ADDED"),"_TARGET_CARD","_INTO_BOARD?"],["_TARGET_CARD","is",(0,r.or)("EMAILED"),(0,r.or)("in","_INTO_BOARD?"),"_BY_WHOM?"],["WHO",(0,r.or)("EMAILED"),"_TARGET_CARD",(0,r.or)("in","_INTO_BOARD?")]),CARD_OUTOF_BOARD:(0,r.or)(["_TARGET_CARD","is","MOVED","_OUTOF_BOARD","_BY_WHOM?"],["WHO","MOVED","_TARGET_CARD","_OUTOF_BOARD"]),CARD_ARCHIVED:(0,r.or)(["_TARGET_CARD","is","archived","_BY_WHOM?"],["WHO",(0,r.or)("archive","archives"),"_TARGET_CARD"]),CARD_UNARCHIVED:(0,r.or)(["_TARGET_CARD","is","unarchived","_BY_WHOM?"],["WHO",(0,r.or)("unarchive","unarchives"),"_TARGET_CARD"]),CARD_DELETED:(0,r.or)(["_TARGET_CARD","is","deleted","_BY_WHOM?"],["WHO",(0,r.or)("delete","deletes"),"_TARGET_CARD"]),MENTION_IN_DESCRIPTION:["in",(0,r.optional)((0,r.or)(["_A",(0,r.or)("card's","card")],"_THE")),"description"],MENTION_IN_COMMENT:["in","_A?","comment"],MENTION_IN_CHECKLIST:["in","_A?","checklist",(0,r.optional)("item")],MENTIONING_CARD:"_TARGET_CARD",_MENTION_CONTEXT:(0,r.or)([(0,r.or)("MENTION_IN_DESCRIPTION","MENTION_IN_COMMENT","MENTION_IN_CHECKLIST"),(0,r.optional)([(0,r.or)("in","of","on"),"MENTIONING_CARD"])],["_IN","MENTIONING_CARD"]),CARD_MENTIONED:(0,r.or)(["_TARGET_CARD","is","mentioned","_MENTION_CONTEXT?","_BY_WHOM?"],["WHO",(0,r.or)("mention","mentions"),"_TARGET_CARD","_MENTION_CONTEXT?"]),_MEMBER_MENTIONED_VERB:(0,r.or)("mention","mentions"),MEMBER_MENTIONED:(0,r.or)(["MEMBER",(0,r.optional)("is"),"mentioned","_MENTION_CONTEXT?","_BY_WHOM?"],["WHO",(0,r.or)("mention","mentions"),"MEMBER","_MENTION_CONTEXT?"]),ALL_CHECKLISTS:["all",(0,r.optional)("of"),(0,r.optional)((0,r.or)("the",["a","card's"])),"checklists"],_UNNAMED_CHECKLIST:["_THE?","checklist"],CHECKLIST_COMPLETE:(0,r.or)([(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),(0,r.optional)("is"),(0,r.or)([(0,r.optional)("made"),"complete"],"completed"),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("complete","completes"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),"_IN_TARGET_CARD?"],["ALL_CHECKLISTS","_IN_TARGET_CARD?",(0,r.optional)("are"),(0,r.or)([(0,r.optional)("made"),"complete"],"completed"),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("complete","completes"),"ALL_CHECKLISTS","_IN_TARGET_CARD?"]),CHECKLIST_INCOMPLETE:(0,r.or)([(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),(0,r.optional)("is"),(0,r.or)([(0,r.optional)("made"),"incomplete"],"incompleted"),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)("incomplete","incompletes"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),"_IN_TARGET_CARD?"]),_NAMED_CHECKLIST_ITEM:["_THE?",(0,r.swappable)("$ITEM_NAME",[(0,r.optional)("checklist"),"item"])],_ITEM_CONDITION:(0,r.or)("_STARTING_WITH","_NOT_STARTING_WITH","_ENDING_WITH","_NOT_ENDING_WITH","_CONTAINING","_NOT_CONTAINING","_STARTING_WITH_DATE","_ENDING_WITH_DATE","_CONTAINING_DATE","_NOT_CONTAINING_DATE"),_UNNAMED_CHECKLIST_ITEM:["_A?",(0,r.optional)("checklist"),"item","_ITEM_CONDITION?"],_CHECKLIST_ITEM:(0,r.or)("_NAMED_CHECKLIST_ITEM","_UNNAMED_CHECKLIST_ITEM"),ITEM_CHECKED:[(0,r.or)("check","checks","checked","complete","completes","completed"),(0,r.optional)("off")],ITEM_UNCHECKED:(0,r.or)("uncheck","unchecks","unchecked","incomplete"),_ITEM_VERB:(0,r.or)("ITEM_CHECKED","ITEM_UNCHECKED"),ITEM_ADDED:(0,r.or)("add","adds","added"),ITEM_REMOVED:(0,r.or)("remove","removes","removed"),ITEM_CONVERTED:(0,r.or)("convert","converts","converted"),_IN_CHECKLIST:(0,r.or)(["in","_CHECKLIST"],"_IN_A_CHECKLIST"),_TO_CHECKLIST:(0,r.or)(["to","_CHECKLIST"],"_TO_A_CHECKLIST"),_FROM_CHECKLIST:(0,r.or)(["from","_CHECKLIST"],"_FROM_A_CHECKLIST"),_ITEM_FILTERS_TO:(0,r.or)(["_TO_CHECKLIST","_IN_TARGET_CARD?"],"_TO_TARGET_CARD"),_ITEM_FILTERS_FROM:(0,r.or)(["_FROM_CHECKLIST","_IN_TARGET_CARD?"],"_FROM_TARGET_CARD"),CHECKLIST_ITEM:(0,r.or)(["_CHECKLIST_ITEM",(0,r.optional)("is"),"_ITEM_VERB","_IN_CHECKLIST?","_IN_TARGET_CARD?","_BY_WHOM?"],["WHO","_ITEM_VERB","_CHECKLIST_ITEM","_IN_CHECKLIST?","_IN_TARGET_CARD?"],["_CHECKLIST_ITEM","is","ITEM_ADDED","_ITEM_FILTERS_TO?","_BY_WHOM?"],["WHO","ITEM_ADDED","_CHECKLIST_ITEM","_ITEM_FILTERS_TO?"],["_CHECKLIST_ITEM","is","ITEM_REMOVED","_ITEM_FILTERS_FROM?","_BY_WHOM?"],["WHO","ITEM_REMOVED","_CHECKLIST_ITEM","_ITEM_FILTERS_FROM?"],["_CHECKLIST_ITEM","_IN_CHECKLIST?","_IN_TARGET_CARD?","is","ITEM_CONVERTED",(0,r.optional)(["_INTO","a","card"]),"_BY_WHOM?"],["WHO","ITEM_CONVERTED","_CHECKLIST_ITEM","_IN_CHECKLIST?","_IN_TARGET_CARD?",(0,r.optional)(["_INTO","a","card"])]),CHECKLIST_ITEM_MATCHES:[(0,r.or)(["_A","checklist","item","_IN_CHECKLIST?"],["an","item","_IN_CHECKLIST"]),"_IN_TARGET_CARD?",(0,r.or)("_STARTS_WITH","_NOT_STARTS_WITH","_ENDS_WITH","_NOT_ENDS_WITH","_CONTAINS","_NOT_CONTAINS","DATE_AT_START","_NOT_DATE_AT_START","DATE_AT_END","_NOT_DATE_AT_END","CONTAINS_DATE","_NOT_CONTAINS_DATE")],_A_LIST:["_A?","list"],LIST_CREATED:(0,r.or)(["_A_LIST","is","CREATED","_BY_WHOM?"],["WHO","CREATED","_A_LIST"]),LIST_RENAMED:(0,r.or)(["_A_LIST","is","renamed","_BY_WHOM?"],["WHO","renamed","_A_LIST"]),LIST_ARCHIVED:(0,r.or)(["_A_LIST","is","archived","_BY_WHOM?"],["WHO",(0,r.or)("archive","archives"),"_A_LIST"]),LIST_UNARCHIVED:(0,r.or)(["_A_LIST","is","unarchived","_BY_WHOM?"],["WHO",(0,r.or)("unarchive","unarchives"),"_A_LIST"]),LIST_CARD_COUNT_MATCHES:["_LIST_NAME","has","_NUMBER_CONDITIONS","cards"],MEMBER_ADDED_TO_BOARD:(0,r.or)(["MEMBER","is","added","to","the","board","_BY_WHOM?"],["WHO",(0,r.or)("add","adds"),"MEMBER","to","the","board"]),_CUSTOM_FIELD:(0,r.or)(["custom","field","$FIELD_NAME"],[(0,r.or)("a","any"),"custom","field"]),_CUSTOM_FIELD_LIST:["$FIELD_NAME",(0,r.optional)(["_AND","_CUSTOM_FIELD_LIST"])],_SET_TO_VALUE:["to","$VALUE"],DATE_LESS_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),DATE_MORE_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),DATE_FROM_NOW:["from","now"],DATE_AGO:["ago"],HOURS_NOT_DAYS:(0,r.or)("hour","hours"),_DATE_OFFSET:[(0,r.or)(["WORKING_DAYS?",(0,r.or)("day","days")],"HOURS_NOT_DAYS"),(0,r.or)("DATE_FROM_NOW","DATE_AGO")],_DATE_LESS:[(0,r.optional)("in"),"less","than","DATE_LESS_THAN_DAYS","_DATE_OFFSET"],_DATE_MORE:[(0,r.optional)("in"),"more","than","DATE_MORE_THAN_DAYS","_DATE_OFFSET"],DATE_BETWEEN:[(0,r.optional)("between"),"MIN_DAYS",(0,r.or)("to","and"),"MAX_DAYS"],_DATE_BETWEEN:["DATE_BETWEEN","_DATE_OFFSET"],NOT:"not",DATE_THIS_WEEK:["NOT?","in","this","week"],DATE_NEXT_WEEK:["NOT?","in","next","week"],DATE_THIS_MONTH:["NOT?","in","this","month"],DATE_NEXT_MONTH:["NOT?","in","next","month"],DATE_CONDITION:(0,r.or)("_DATE_LESS","_DATE_MORE","_DATE_BETWEEN","DATE_THIS_WEEK","DATE_NEXT_WEEK","DATE_THIS_MONTH","DATE_NEXT_MONTH"),_SET_TO_DATE:["to","a","date","DATE_CONDITION?"],NUMBER_THAN:(0,r.decimal)(),NUMBER_EQ:(0,r.or)(["equal","to"],"exactly"),NUMBER_GREATER_EQ:[(0,r.or)("more","greater"),(0,r.optional)("than"),"or",(0,r.or)(["equal","to"],"exactly")],NUMBER_GREATER:[(0,r.or)("more","greater"),"than"],NUMBER_LOWER_EQ:[(0,r.or)("lower","fewer"),(0,r.optional)("than"),"or",(0,r.or)(["equal","to"],"exactly")],NUMBER_LOWER:[(0,r.or)("lower","fewer"),"than"],NUMBER_CONDITION:[(0,r.or)("NUMBER_EQ","NUMBER_GREATER_EQ","NUMBER_GREATER","NUMBER_LOWER_EQ","NUMBER_LOWER"),"NUMBER_THAN"],_NUMBER_CONDITIONS:["NUMBER_CONDITION",(0,r.optional)(["and","NUMBER_CONDITION"])],_SET_TO_NUMBER:["to","a","number","_NUMBER_CONDITIONS"],FIELD_CHECKED:[],_FIELD_CHECKED:["checked",(0,r.optional)("off"),"FIELD_CHECKED"],_CHECKS_FIELD:[(0,r.or)("check","checks"),(0,r.optional)("off"),"FIELD_CHECKED"],FIELD_UNCHECKED:[],_FIELD_UNCHECKED:["unchecked",(0,r.optional)("off"),"FIELD_UNCHECKED"],_UNCHECKS_FIELD:[(0,r.or)("uncheck","unchecks"),"FIELD_UNCHECKED"],FIELD_CLEARED:[],_FIELD_CLEARED:["cleared","FIELD_CLEARED"],_CLEARS_FIELD:[(0,r.or)("clear","clears"),"FIELD_CLEARED"],CUSTOM_FIELD_SET:(0,r.or)(["_CUSTOM_FIELD","is",(0,r.or)(["set",(0,r.optional)((0,r.or)("_SET_TO_VALUE","_SET_TO_DATE","_SET_TO_NUMBER"))],"_FIELD_CHECKED","_FIELD_UNCHECKED","_FIELD_CLEARED"),"_IN_TARGET_CARD?","_BY_WHOM?"],["WHO",(0,r.or)([(0,r.or)("set","sets"),"_CUSTOM_FIELD",(0,r.optional)((0,r.or)("_SET_TO_VALUE","_SET_TO_DATE","_SET_TO_NUMBER"))],[(0,r.or)("_CHECKS_FIELD","_UNCHECKS_FIELD"),"_CUSTOM_FIELD"],["_CLEARS_FIELD","_CUSTOM_FIELD"]),"_IN_TARGET_CARD?"]),CUSTOM_FIELD_VALUE_CONDITION:[(0,r.or)("with","_WITHOUT"),"_CUSTOM_FIELD",(0,r.or)(["set",(0,r.optional)((0,r.or)("_SET_TO_VALUE","_SET_TO_DATE","_SET_TO_NUMBER"))],"_FIELD_CHECKED","_FIELD_UNCHECKED","_FIELD_CLEARED")],CUSTOM_FIELDS_COMPLETE:[(0,r.or)(["all",(0,r.optional)("the"),"custom","fields"],["custom","fields","_CUSTOM_FIELD_LIST"]),"are",(0,r.or)("full","filled","complete","completed"),"_IN_TARGET_CARD?"],CUSTOM_FIELDS_COMPLETE_CONDITION:[(0,r.or)("with","_WITHOUT"),(0,r.or)(["all",(0,r.optional)("the"),"custom","fields"],["custom","fields","_CUSTOM_FIELD_LIST"]),(0,r.or)("full","filled","complete","completed")],WHEN:[(0,r.or)("when","if"),(0,r.or)("MEMBER_ADDED_TO_BOARD","ATTACHMENT_ADDED","ATTACHMENT_REMOVED","LINK_ADDED","LABEL_ADDED","LABEL_REMOVED","MEMBER_ADDED","MEMBER_REMOVED","CHECKLIST_ADDED","CHECKLIST_REMOVED","COMMENT_ADDED","VOTE_ON_CARD","START_DATE_ADDED","START_DATE_REMOVED","DUE_DATE_ADDED","DUE_DATE_REMOVED","DUE_DATE_COMPLETED","DUE_DATE_INCOMPLETED","CARD_COMPLETED","CARD_INCOMPLETED","CARD_INTO_LIST","CARD_OUTOF_LIST","CARD_INTO_BOARD","CARD_OUTOF_BOARD","CARD_MOVED","CARD_ARCHIVED","CARD_UNARCHIVED","CARD_DELETED","CARD_MATCHES","_ENTERED_CARD_FIELD_MATCHES","CARD_CHANGED","CARD_MENTIONED","MEMBER_MENTIONED","CHECKLIST_COMPLETE","CHECKLIST_INCOMPLETE","CHECKLIST_ITEM","CHECKLIST_ITEM_MATCHES","LIST_CREATED","LIST_RENAMED","LIST_ARCHIVED","LIST_UNARCHIVED","LIST_CARD_COUNT_MATCHES",(0,r.hidden)("CUSTOM_FIELD_SET"),(0,r.hidden)("CUSTOM_FIELDS_COMPLETE"))],IN_LIST:[(0,r.or)("in","from"),"_LIST"],_IN_LISTS_OR:["_LIST",(0,r.optional)(["or",(0,r.optional)((0,r.or)("in","from")),"_IN_LISTS_OR"])],_FROM_LISTS_OR:["_LIST",(0,r.optional)(["or",(0,r.optional)("from"),"_IN_LISTS_OR"])],IN_LISTS:[(0,r.or)("in","from"),"_IN_LISTS_OR"],FROM_LISTS:["from","_FROM_LISTS_OR=>IN_LISTS"],_FROM_LISTS:"FROM_LISTS=>IN_LISTS",NOT_IN_LIST:["not","in","_LIST"],NOT_IN_LISTS:["not","in","_IN_LISTS_OR"],WITH_LABEL:[(0,r.or)("with","having",["that",(0,r.or)("has","have")]),"LABEL"],WITHOUT_LABEL:[(0,r.or)("without",["not","having"],["that",(0,r.or)("doesn't",["does","not"]),"have"]),"LABEL"],WITH_ANY_LABEL:[(0,r.or)("with","having",["that",(0,r.or)("has","have")]),(0,r.or)([(0,r.optional)((0,r.or)("a","any")),"label"],[(0,r.optional)("any"),"labels"])],WITH_NO_LABELS:[(0,r.or)(["without",(0,r.optional)("any")],[(0,r.or)("with","having",["that",(0,r.or)("has","have")]),"no"]),(0,r.or)("label","labels")],ONLY_MEMBER:"only",ASSIGNED_TO:[(0,r.or)("with",["assigned","ONLY_MEMBER?","_TO"]),"MEMBER"],NOT_ASSIGNED_TO:[(0,r.or)("without",["not","assigned","_TO"]),"MEMBER"],WITH_DUE_COMPLETE:[(0,r.optional)("a"),(0,r.or)("complete","completed")],WITHOUT_DUE_COMPLETE:[(0,r.optional)("an"),(0,r.or)("incomplete","incompleted")],WITH_DUE_DATE:["with",(0,r.optional)((0,r.or)("WITH_DUE_COMPLETE","WITHOUT_DUE_COMPLETE","a")),"due","date"],WITH_START_DATE:["with",(0,r.optional)((0,r.or)("a")),"start","date"],WITHOUT_DUE_DATE:["without",(0,r.optional)((0,r.or)("WITH_DUE_COMPLETE","WITHOUT_DUE_COMPLETE","a")),"due","date"],WITHOUT_START_DATE:["without","_A_START_DATE"],WITH_OVERDUE_DATE:(0,r.or)([(0,r.optional)((0,r.or)("that's",["that","is"])),"overdue"],["with",(0,r.optional)("an"),"overdue",(0,r.optional)("due"),"date"]),WITHOUT_OVERDUE_DATE:(0,r.or)([(0,r.optional)((0,r.or)("that's",["that","is"])),"not","overdue"],["without",(0,r.optional)("an"),"overdue",(0,r.optional)("due"),"date"]),EXACT_NAME_CONDITION:"$TEXT",_EXACT_NAME_CONDITION_LIST:["EXACT_NAME_CONDITION",(0,r.optional)([(0,r.optional)(","),"or","_EXACT_NAME_CONDITION_LIST"])],_EXACT_NAME_CONDITION:[(0,r.optional)((0,r.or)("called","named","titled")),"_EXACT_NAME_CONDITION_LIST"],CARD_MATCHES_CONDITION:[(0,r.optional)(["with","_WHAT_FIELD"]),(0,r.or)("_STARTING_WITH","_NOT_STARTING_WITH","_ENDING_WITH","_NOT_ENDING_WITH","_CONTAINING","_NOT_CONTAINING","_STARTING_WITH_DATE","_NOT_STARTING_WITH_DATE","_ENDING_WITH_DATE","_NOT_ENDING_WITH_DATE","_CONTAINING_DATE","_NOT_CONTAINING_DATE")],EMPTY_DESCRIPTION:"with",NON_EMPTY_DESCRIPTION:"without",EMPTY_DESCRIPTION_CONDITION:[(0,r.or)("EMPTY_DESCRIPTION","NON_EMPTY_DESCRIPTION"),"an","empty","description"],INACTIVE_DAYS:(0,r.small_numeral)("a number of days",!1,1),INACTIVITY_CONDITION:["inactive",(0,r.optional)("for"),(0,r.optional)(["more","than"]),"INACTIVE_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],DUE_DATE_CONDITION:["NOT?",(0,r.or)("_DUE_IN_LESS","_DUE_IN_MORE","_DUE_IN_EXACTLY","DUE_IN_BETWEEN","DUE_TODAY","DUE_TOMORROW","DUE_THIS_WEEK","DUE_NEXT_WEEK","DUE_THIS_MONTH","DUE_NEXT_MONTH")],START_DATE_CONDITION:["NOT?",(0,r.or)("_STARTING_IN_LESS","_STARTING_IN_MORE","_STARTING_IN_EXACTLY","STARTING_IN_BETWEEN","STARTING_TODAY","STARTING_TOMORROW","STARTING_THIS_WEEK","STARTING_NEXT_WEEK","STARTING_THIS_MONTH","STARTING_NEXT_MONTH")],COMPLETE:"complete",INCOMPLETE:"incomplete",MARKED_AS_COMPLETE:["marked",(0,r.optional)("as"),"complete",(0,r.optional)((0,r.or)("_CONDITION","IN_THE_LIST"))],WITH_ALL_CHECKLISTS:["with","all","checklists",(0,r.optional)((0,r.or)("COMPLETE","INCOMPLETE"))],WITH_CHECKLIST:[(0,r.optional)("with"),"_A?",(0,r.swappable)((0,r.or)("_CHECKLIST","checklist"),(0,r.optional)((0,r.or)("COMPLETE","INCOMPLETE")))],WITHOUT_CHECKLIST:["without",(0,r.or)("_CHECKLIST","checklists")],CARD_ROLE_CONDITION:["with",(0,r.optional)("the"),"role","CARD_ROLE"],CONDITION:(0,r.or)("IN_LISTS","NOT_IN_LISTS","WITH_LABEL","WITHOUT_LABEL","WITH_ANY_LABEL","WITH_NO_LABELS","ASSIGNED_TO","NOT_ASSIGNED_TO","WITH_DUE_DATE","WITH_START_DATE","WITHOUT_DUE_DATE","WITHOUT_START_DATE","WITH_OVERDUE_DATE","WITHOUT_OVERDUE_DATE","DUE_DATE_CONDITION","START_DATE_CONDITION","_EXACT_NAME_CONDITION","EMPTY_DESCRIPTION_CONDITION","CARD_MATCHES_CONDITION","INACTIVITY_CONDITION","WITH_ALL_CHECKLISTS","WITH_CHECKLIST","WITHOUT_CHECKLIST","CUSTOM_FIELD_VALUE_CONDITION","CUSTOM_FIELDS_COMPLETE_CONDITION","CARD_ROLE_CONDITION","WITH_CARD_COMPLETE"),_CONDITION:["CONDITION",(0,r.optional)([(0,r.optional)("and"),"_CONDITION"])],CONDITION_LIST:"_CONDITION",_TARGET_CARD:["_A?","card","_CONDITION?"],CARD_ROLE:(0,r.or)("link","board","separator","regular","mirror","none"),_CARD_WITH_TYPE:["CARD_ROLE?","card"],_IN_TARGET_CARD:["in","_TARGET_CARD"],_ON_TARGET_CARD:[(0,r.or)("on","in"),"_TARGET_CARD"],_TO_TARGET_CARD:["_TO","_TARGET_CARD"],_INTO_TARGET_CARD:["_INTO","_TARGET_CARD"],_FROM_TARGET_CARD:["_FROM","_TARGET_CARD"],THE_DAY_BEFORE:[(0,r.or)([(0,r.optional)("on"),"the"],"a")],THE_DAY_AFTER:[(0,r.or)([(0,r.optional)("on"),"the"],"a")],DAYS_BEFORE:(0,r.small_numeral)("a number of days, e.g. two days"),DAYS_AFTER:(0,r.small_numeral)("a number of days, e.g. two days"),WORKING_DAYS:["working"],_BEFORE_DATE:[(0,r.or)("THE_DAY_BEFORE","DAYS_BEFORE"),"WORKING_DAYS?",(0,r.or)("day","days"),"before"],_AFTER_DATE:[(0,r.or)("THE_DAY_AFTER","DAYS_AFTER"),"WORKING_DAYS?",(0,r.or)("day","days"),"after"],HOURS_BEFORE:(0,r.small_numeral)("a number of hours, e.g. two hours"),HOURS_AFTER:(0,r.small_numeral)("a number of hours, e.g. two hours"),_BEFORE_DATE_TIME:["HOURS_BEFORE",(0,r.or)("hour","hours"),"before"],_AFTER_DATE_TIME:["HOURS_AFTER",(0,r.or)("hour","hours"),"after"],NAMED_DAY_BEFORE:["on","the","DAY","before"],NAMED_DAY_AFTER:["on","the","DAY","after"],WEEK_BEFORE:["week","before"],NAMED_WEEKDAY:["on","the","DAY","of","the",(0,r.or)("WEEK_BEFORE","week")],USE_START_TIME:[],STARTING_TODAY:["starting","today"],STARTING_TOMORROW:["starting","tomorrow"],STARTING_THIS_WEEK:["starting","this","week"],STARTING_NEXT_WEEK:["starting","next","week"],STARTING_THIS_MONTH:["starting","this","month"],STARTING_NEXT_MONTH:["starting","next","month"],STARTING_IN_LESS_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),STARTING_IN_MORE_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),STARTING_IN_EXACTLY_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),_STARTING_IN_LESS:["starting","in","less","than","STARTING_IN_LESS_THAN_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],_STARTING_IN_MORE:["starting","in","more","than","STARTING_IN_MORE_THAN_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],_STARTING_IN_EXACTLY:["starting","in","STARTING_IN_EXACTLY_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],STARTING_IN_BETWEEN:["starting","in",(0,r.optional)("between"),"MIN_DAYS",(0,r.or)("to","and"),"MAX_DAYS","WORKING_DAYS?","days"],_STARTING_TARGET_CARD:[(0,r.or)("OPEN_CARD","ARCHIVED_CARD","_A?"),"card","_CONDITION?"],ON_START_DATE:(0,r.or)([(0,r.or)("_BEFORE_DATE","_AFTER_DATE","on"),(0,r.optional)(["_A","card's"]),"start","date","TIME?"],[(0,r.or)("NAMED_DAY_BEFORE","NAMED_DAY_AFTER"),(0,r.optional)(["_A","card's"]),"start","date","TIME?"],[(0,r.or)("NAMED_DAY_BEFORE","NAMED_DAY_AFTER","NAMED_WEEKDAY"),"_STARTING_TARGET_CARD","is","due","TIME?"],[(0,r.or)("_BEFORE_DATE_TIME","_AFTER_DATE_TIME","at"),(0,r.optional)(["_A","card's"]),"start","time","USE_START_TIME"],[(0,r.or)("_BEFORE_DATE_TIME","_AFTER_DATE_TIME",[(0,r.optional)("at"),"the",(0,r.or)("time","moment")]),"_STARTING_TARGET_CARD","is","due","USE_START_TIME"],["when","_STARTING_TARGET_CARD","is",(0,r.or)(["USE_START_TIME"],"_STARTING_IN_LESS","_STARTING_IN_MORE","_STARTING_IN_EXACTLY","STARTING_IN_BETWEEN","STARTING_TODAY","STARTING_TOMORROW")]),USE_DUE_TIME:[],OVERDUE:"overdue",DUE_TODAY:["due","today"],DUE_TOMORROW:["due","tomorrow"],DUE_THIS_WEEK:["due","this","week"],DUE_NEXT_WEEK:["due","next","week"],DUE_THIS_MONTH:["due","this","month"],DUE_NEXT_MONTH:["due","next","month"],DUE_IN_LESS_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),DUE_IN_MORE_THAN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),DUE_IN_EXACTLY_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),_DUE_IN_LESS:["due","in","less","than","DUE_IN_LESS_THAN_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],_DUE_IN_MORE:["due","in","more","than","DUE_IN_MORE_THAN_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],_DUE_IN_EXACTLY:["due","in","DUE_IN_EXACTLY_DAYS","WORKING_DAYS?",(0,r.or)("day","days")],MIN_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),MAX_DAYS:(0,r.small_numeral)("a number of days, e.g. two days"),DUE_IN_BETWEEN:["due","in",(0,r.optional)("between"),"MIN_DAYS",(0,r.or)("to","and"),"MAX_DAYS","WORKING_DAYS?","days"],OPEN_CARD:["an","open"],ARCHIVED_CARD:["an","archived"],_DUE_TARGET_CARD:[(0,r.or)("OPEN_CARD","ARCHIVED_CARD","_A?"),"card","_CONDITION?"],ON_DUE_DATE:(0,r.or)([(0,r.or)("_BEFORE_DATE","_AFTER_DATE","on"),(0,r.optional)(["_A","card's"]),"due","date","TIME?"],[(0,r.or)("_BEFORE_DATE","_AFTER_DATE",[(0,r.optional)("on"),"the","day"]),"_DUE_TARGET_CARD","is","due","TIME?"],[(0,r.or)("NAMED_DAY_BEFORE","NAMED_DAY_AFTER"),(0,r.optional)(["_A","card's"]),"due","date","TIME?"],[(0,r.or)("NAMED_DAY_BEFORE","NAMED_DAY_AFTER","NAMED_WEEKDAY"),"_DUE_TARGET_CARD","is","due","TIME?"],[(0,r.or)("_BEFORE_DATE_TIME","_AFTER_DATE_TIME","at"),(0,r.optional)(["_A","card's"]),"due","time","USE_DUE_TIME"],[(0,r.or)("_BEFORE_DATE_TIME","_AFTER_DATE_TIME",[(0,r.optional)("at"),"the",(0,r.or)("time","moment")]),"_DUE_TARGET_CARD","is","due","USE_DUE_TIME"],["when","_DUE_TARGET_CARD","is",(0,r.or)(["OVERDUE","USE_DUE_TIME"],"_DUE_IN_LESS","_DUE_IN_MORE","_DUE_IN_EXACTLY","DUE_IN_BETWEEN","DUE_TODAY","DUE_TOMORROW")]),POSITION_TOP:"top",POSITION_BOTTOM:"bottom",_POSITION:[(0,r.optional)((0,r.or)("at","to","in")),(0,r.optional)("the"),(0,r.or)("POSITION_TOP","POSITION_BOTTOM"),(0,r.optional)("position")],POSITION_NUMBER:(0,r.small_numeral)("a number for the position"),_POSITION_NUMBER:(0,r.or)("_POSITION",[(0,r.or)("in","at"),"position","POSITION_NUMBER"]),_TO_POSITION:(0,r.or)("_POSITION",["to","position","POSITION_NUMBER"]),_LIST_NAME:(0,r.or)(["_THE?","list","_CALLED?","$LIST"],["_THE?","$LIST",(0,r.optional)("list")]),_BOARD_NAME:(0,r.or)(["_THE?","board","_CALLED?","$BOARD"],["_THE?","$BOARD","board"]),_IN_BOARD_NAME:[(0,r.optional)((0,r.or)("in","on")),"_BOARD_NAME"],_FROM_BOARD_NAME:["from","_BOARD_NAME"],_DESTINATION_BOARD_NAME:(0,r.or)(["_THE?","board","_CALLED?","$DESTINATION_BOARD"],["_THE?","$DESTINATION_BOARD","board"]),SOURCE:[(0,r.or)("in","from"),"_LIST"],SOURCE_WITH_BOARD:[(0,r.or)("in","from"),"_LIST","_IN_BOARD_NAME?"],_SOURCE_WITH_BOARD:"SOURCE_WITH_BOARD=>SOURCE",DESTINATION:["_INTO",(0,r.or)(["_LIST_NAME",(0,r.optional)(["_COMMA","_IN_BOARD_NAME"])],["_POSITION","of","_LIST_NAME","_IN_BOARD_NAME?"],["_POSITION",(0,r.optional)(["of","the","list"])],"_THE_LIST")],THE_NEXT_LIST:[(0,r.optional)("the"),"next","list"],THE_PREVIOUS_LIST:[(0,r.optional)("the"),"previous","list"],RELATIVE_DESTINATION:["_TO",(0,r.optional)(["_POSITION","of"]),(0,r.or)("THE_NEXT_LIST","THE_PREVIOUS_LIST"),"_ON_THE_BOARD?"],_RELATIVE_DESTINATION:"RELATIVE_DESTINATION=>DESTINATION",SAME_NAME:["with","the","same",(0,r.or)("name","title")],SAME_DESCRIPTION:["and",(0,r.optional)("with"),(0,r.optional)("the"),(0,r.optional)("same"),"description"],_CARD_PARAMETERS:(0,r.or)(["_CALLED?","$TITLE",(0,r.optional)(["_AND?","_THE?","description","$DESCRIPTION"])],["SAME_NAME","SAME_DESCRIPTION?"]),_CARD_PARAMETERS__HELP:["_CALLED?","$TITLE",(0,r.optional)(["_AND","description","$DESCRIPTION"])],FIND_OR_CREATE_CARD:["find","or","create"],CREATE_UNIQUE_CARD:"unique",CREATE_CARD_ACTION:[(0,r.or)("FIND_OR_CREATE_CARD","create","add"),"_A?",(0,r.optional)((0,r.or)("new","CREATE_UNIQUE_CARD")),"_CARD_WITH_TYPE",(0,r.or)(["DESTINATION","_COMMA","_CARD_PARAMETERS"],["_CARD_PARAMETERS",(0,r.optional)("DESTINATION")])],CREATE_CARD_ACTION__HELP:[(0,r.or)("create","add"),"_A","card","DESTINATION","_COMMA","_CARD_PARAMETERS"],WITHOUT_COMMENTS:["without","comments"],COPY_CARD_ACTION:["copy","_THE_CARD",(0,r.swappable)("DESTINATION","WITHOUT_COMMENTS?"),"CAN_SWITCH_TO_COPY"],CAN_SWITCH_TO_COPY:[],SWITCH_TO_COPY_ACTION:["on","the","copy",(0,r.trap)("!CAN_SWITCH_TO_COPY","`on the copy` can only be used after copying a card")],SWITCH_TO_TRIGGER_CARD_ACTION:[(0,r.or)("on","in"),"the","trigger","card"],MOVE_CARD_ACTION:["move","_THE_CARD",(0,r.or)("_RELATIVE_DESTINATION","DESTINATION")],MOVE_ALL_CARDS_ACTION:["move","_ALL_THE_CARDS_NEW",(0,r.or)(["_SOURCE_WITH_BOARD","WITH_LABEL?"],["WITH_LABEL","_SOURCE_WITH_BOARD?"],"TIME_IN_LIST_CONDITION"),"DESTINATION"],COPY_ALL_CARDS_ACTION:["copy","_ALL_THE_CARDS_NEW","_SOURCE_WITH_BOARD","DESTINATION"],ARCHIVE_EACH_CARD:[],_ARCHIVE_EACH_CARD_ACTION:["archive","_FOR_EACH_CARD_IMPLICIT",(0,r.make_sibling)(),"ARCHIVE_EACH_CARD=>ARCHIVE_CARD_ACTION"],MOVE_EACH_CARD:["DESTINATION"],_MOVE_EACH_CARD_ACTION:["move","_FOR_EACH_CARD_IMPLICIT",(0,r.make_sibling)(),"MOVE_EACH_CARD=>MOVE_CARD_ACTION"],COPY_EACH_CARD:["DESTINATION","CAN_SWITCH_TO_COPY"],_COPY_EACH_CARD_ACTION:["copy","_FOR_EACH_CARD_IMPLICIT",(0,r.make_sibling)(),"COPY_EACH_CARD=>COPY_CARD_ACTION"],MIRROR_EACH_CARD:["DESTINATION"],_MIRROR_EACH_CARD_ACTION:["mirror","_FOR_EACH_CARD_IMPLICIT",(0,r.make_sibling)(),"MIRROR_EACH_CARD=>MIRROR_CARD_ACTION"],RANDOM_CARD_COUNT:(0,r.small_numeral)("a number of random cards, e.g. two random cards"),RANDOM_COPY:["copy","CAN_SWITCH_TO_COPY"],RANDOM_MOVE:"move",RANDOM_CARDS_ACTION:[(0,r.or)("RANDOM_COPY","RANDOM_MOVE"),"RANDOM_CARD_COUNT",(0,r.or)([(0,r.or)("random",["randomly","selected"],"randomly-selected"),(0,r.or)("card","cards")],[(0,r.or)("card","cards"),"at","random"]),"SOURCE?","DESTINATION"],ALL_CARDS_IN_LIST:["_ALL_THE_CARDS",(0,r.optional)(["_IN","_LIST"])],ALL_CARDS_IN_NAMED_LIST:["_ALL_THE_CARDS","_IN","_LIST"],ALL_ARCHIVED_CARDS:["all","archived","cards"],THE_LABEL:["the","label"],ADD_LABEL_ACTION:(0,r.or)([(0,r.or)("apply","add","set"),(0,r.or)("LABEL","THE_LABEL"),(0,r.optional)((0,r.or)("_TO_THE_CARD",["_TO","ALL_CARDS_IN_NAMED_LIST=>ALL_CARDS_IN_LIST"]))],["give","it","LABEL"],["give","LABEL","to","it"]),ADD_LABEL_ACTION__HELP:["add","LABEL",(0,r.or)("_TO_THE_CARD",["_TO","ALL_CARDS_IN_NAMED_LIST"])],STICKER_TYPE:(0,r.or_index)("check",(0,r.or)("heart","love"),"warning","clock","smile","laugh","huh","frown",(0,r.or)(["thumbs","up"],"thumbsup"),(0,r.or)(["thumbs","down"],"thumbsdown"),"star","rocket"),STICKER_LOCATION_LEFT:[(0,r.or)("to","at"),(0,r.optional)("the"),"left"],STICKER_LOCATION_RIGHT:[(0,r.or)("to","at"),(0,r.optional)("the"),"right"],STICKER_LOCATION_CENTER:[(0,r.or)("to","at","in"),(0,r.optional)("the"),"center"],STICKER_LOCATION_RANDOM:[(0,r.or)("at","in"),(0,r.optional)("a"),"random",(0,r.or)("position","location")],_STICKER_LOCATION:(0,r.or)("STICKER_LOCATION_LEFT","STICKER_LOCATION_RIGHT","STICKER_LOCATION_CENTER","STICKER_LOCATION_RANDOM"),_STICKER:["_THE?","STICKER_TYPE","sticker"],ADD_STICKER_ACTION:[(0,r.or)("apply","add"),"_STICKER",(0,r.optional)((0,r.or)(["_STICKER_LOCATION",(0,r.optional)([(0,r.or)("of","in"),(0,r.or)("_THE_CARD","ALL_CARDS_IN_LIST")])],["_TO_THE_CARD"],["_TO","ALL_CARDS_IN_LIST"]))],DUE_DATE:"_DATE_TIME",START_DATE:"_DATE_TIME",THE_DATE:["the","date"],NO_PARSE_RESET:["or",(0,r.or)("clear","reset"),"the","date"],_PARSED_DATE:["$TEXT","TIME?","NO_PARSE_RESET?"],PLUS:"plus",MINUS:"minus",DATE_ADJUST:[(0,r.or)("PLUS","MINUS"),(0,r.or)([(0,r.or)("X_DAYS","{X_DAYS}"),(0,r.or)("day","days")],[(0,r.or)("X_WORKING_DAYS","{X_WORKING_DAYS}"),"working",(0,r.or)("day","days")],[(0,r.or)("X_WEEKS","{X_WEEKS}"),(0,r.or)("week","weeks")],[(0,r.or)("X_MONTHS","{X_MONTHS}"),(0,r.or)("month","months")])],DATE_IN_CUSTOM_FIELD:["the","date","in","custom","field","$FIELD_NAME","DATE_ADJUST?"],ADD_DUE_DATE_ACTION:[(0,r.or)("apply","add","assign","set",["give","_THE_CARD?"],"schedule"),(0,r.optional)((0,r.or)("_A","_THE_CARD_S","it")),"due",(0,r.optional)("date"),(0,r.optional)((0,r.or)("of","on","at","for","to")),(0,r.or)("DATE_IN_CUSTOM_FIELD","DUE_DATE","THE_DATE","_PARSED_DATE"),"_TO_THE_CARD?"],ADD_DUE_DATE_ACTION__HELP:["add","a","due","date","of","DUE_DATE","_TO_THE_CARD"],ADD_START_DATE_ACTION:[(0,r.or)("apply","add","assign","set",["give","_THE_CARD?"],"schedule"),(0,r.optional)((0,r.or)("_A","_THE_CARD_S","it")),"start",(0,r.optional)("date"),(0,r.optional)((0,r.or)("of","on","at","for","to")),(0,r.or)("DATE_IN_CUSTOM_FIELD","START_DATE","THE_DATE","_PARSED_DATE"),"_TO_THE_CARD?"],ADD_START_DATE_ACTION__HELP:["add","_A_START_DATE","of","START_DATE","_TO_THE_CARD"],MARK_CARD_COMPLETE_ACTION:[(0,r.or)("mark","check"),(0,r.optional)("the"),"card",(0,r.optional)("as"),(0,r.or)("complete","completed")],UNMARK_CARD_COMPLETE_ACTION:(0,r.or)([(0,r.or)("unmark","uncheck"),(0,r.optional)("the"),"card",(0,r.optional)("as"),(0,r.or)("complete","completed")],[(0,r.or)("mark","check"),(0,r.optional)("the"),"card",(0,r.optional)("as"),(0,r.or)("incomplete","incompleted")]),MARK_DUE_COMPLETE_ACTION:[(0,r.or)("mark","check"),(0,r.optional)("the"),"due","date",(0,r.optional)("as"),(0,r.or)("complete","completed")],UNMARK_DUE_COMPLETE_ACTION:(0,r.or)([(0,r.or)("unmark","uncheck"),(0,r.optional)("the"),"due","date",(0,r.optional)("as"),(0,r.or)("complete","completed")],[(0,r.or)("mark","check"),(0,r.optional)("the"),"due","date",(0,r.optional)("as"),(0,r.or)("incomplete","incompleted")]),TO_PREVIOUS_DAY:["to","the","previous","day"],TO_PREVIOUS_WORKING_DAY:["to","the","previous","working","day"],TO_NEXT_DAY:["to","the","next","day"],TO_NEXT_WORKING_DAY:["to","the","next","working","day"],TO_SAME_DAY_NEXT_WEEK:["next","week"],TO_SAME_DAY_NEXT_MONTH:["next","month"],TO_SAME_DAY_NEXT_YEAR:["next","year"],_TO_SAME_DAY:["to","the","same","day",(0,r.or)("TO_SAME_DAY_NEXT_WEEK","TO_SAME_DAY_NEXT_MONTH","TO_SAME_DAY_NEXT_YEAR")],TO_TIME:["to",(0,r.time)()],TO_DATE:["to","_DATE"],BY_DATE:["by","_DATE"],BY_SAME_TIME_AMOUNT:["by","the","same","amount","of","time",(0,r.trap)(["!DUE_DATE_ADDED","!START_DATE_ADDED"],"`by the same amount of time` can only be used with a suitable trigger such as `when a due date is added to a card`")],ADJUST_START_DATE_ACTION:["move",(0,r.or)("the","_THE_CARD_S","its"),"start",(0,r.optional)("date"),(0,r.or)("TO_PREVIOUS_DAY","TO_PREVIOUS_WORKING_DAY","TO_NEXT_DAY","TO_NEXT_WORKING_DAY","_TO_SAME_DAY","TO_TIME","TO_DATE","BY_DATE","BY_SAME_TIME_AMOUNT")],ADJUST_DUE_DATE_ACTION:["move",(0,r.or)("ADJUST_ITEM","ADJUST_CARD"),"due",(0,r.optional)("date"),(0,r.or)("TO_PREVIOUS_DAY","TO_PREVIOUS_WORKING_DAY","TO_NEXT_DAY","TO_NEXT_WORKING_DAY","_TO_SAME_DAY","TO_TIME","TO_DATE","BY_DATE","BY_SAME_TIME_AMOUNT")],ADJUST_CARD:[(0,r.or)("_THE_CARD_S","the","its")],ADJUST_ITEM:["the",(0,r.optional)("checklist"),"item"],_CHECKLIST:(0,r.or)(["_THE?",(0,r.swappable)("$CHECKLIST_NAME","checklist")],["_A","checklist",(0,r.or)("called","named","titled"),"$CHECKLIST_NAME"]),_CHECKLIST__HELP:["checklist","$CHECKLIST_NAME"],NEW_CHECKLIST:[(0,r.or)("new","empty"),"checklist"],_NEW_CHECKLIST:["_A?","NEW_CHECKLIST",(0,r.optional)((0,r.or)("called","named","titled")),"$CHECKLIST_NAME"],_RENAME_CHECKLIST:[(0,r.or)(["with","name"],["renamed","to"],"as"),"$NEW_CHECKLIST_NAME"],THE_CHECKLIST:["the","checklist"],_FROM_CARD:["from","card","$FROM_CARD"],ADD_CHECKLIST_ACTION:(0,r.or)(["add","_CHECKLIST","_FROM_CARD?",(0,r.or)((0,r.swappable)("_TO_THE_CARD","_RENAME_CHECKLIST?"),"_RENAME_CHECKLIST?")],["add",(0,r.or)("_NEW_CHECKLIST","THE_CHECKLIST"),"_TO_THE_CARD?"]),MOVE_CHECKLIST_ACTION:["move",(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),"to",(0,r.optional)("the"),(0,r.or)("POSITION_TOP","POSITION_BOTTOM"),(0,r.optional)("position")],UNIQUE_ITEM:["_A?","unique"],ADD_CHECKLIST_ITEM_ACTION:["add","UNIQUE_ITEM?",(0,r.optional)("checklist"),"item","$CHECKLIST_ITEM_NAME",(0,r.or)(["_TO","_CHECKLIST"],(0,r.optional)(["_TO","the","checklist"])),"_IN_THE_CARD?"],_TARGET_CHECKLIST_ITEM:[(0,r.optional)("the"),(0,r.swappable)([(0,r.optional)("checklist"),"item"],"$CHECKLIST_ITEM_NAME?"),(0,r.optional)([(0,r.or)("in","from"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST")])],RENAME_CHECKLIST_ITEM_ACTION:["rename","_TARGET_CHECKLIST_ITEM",(0,r.optional)((0,r.or)("to","as")),"$CHECKLIST_ITEM_NEW_NAME"],REMOVE_CHECKLIST_ITEM_ACTION:["remove","_TARGET_CHECKLIST_ITEM"],REMOVE_DUE_DATE_CHECKLIST_ACTION:["remove","the","due","dates","from",(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST")],MOVE_CHECKLIST_ITEM_ACTION:["move","_TARGET_CHECKLIST_ITEM","to",(0,r.optional)("the"),(0,r.or)("POSITION_TOP","POSITION_BOTTOM"),(0,r.optional)("position"),(0,r.optional)(["of","the",(0,r.or)("checklist","list")])],CHECK_ITEM_ACTION:[(0,r.or)(["check",(0,r.optional)("off")],"complete"),"_TARGET_CHECKLIST_ITEM"],UNCHECK_ITEM_ACTION:[(0,r.or)("uncheck","uncomplete","reset","clear"),"_TARGET_CHECKLIST_ITEM"],REMOVE_DUE_DATE_ITEM_ACTION:["remove","THE_DUE_DATE","_IN_THE_ITEMS"],SET_ITEM_DUE_DATE_ACTION:[(0,r.or)("set","schedule"),"the","item","due",(0,r.optional)("date"),(0,r.optional)((0,r.or)("on","to")),(0,r.or)("DATE_IN_CUSTOM_FIELD","DUE_DATE","THE_DATE","_PARSED_DATE")],MEMBER_ME:(0,r.or)("me","myself",(0,r.or)(["i","am"],"i'm")),MEMBER_ANYONE:(0,r.or)("anyone","someone",["a","member"],["any","member"],["some","member"]),MEMBER:(0,r.or)([(0,r.optional)("member"),"@MEMBER_USERNAME"],[(0,r.optional)("member"),"$MEMBER_FULLNAME"],"MEMBER_ME","MEMBER_ANYONE"),AT_RANDOM:["at","random"],IN_TURN:["in","turn"],_MEMBER_SELECTION:(0,r.or)("AT_RANDOM","IN_TURN"),PICK_MEMBER:["a","member","_MEMBER_SELECTION","_FROM_CARD?"],_RANDOM_MEMBER_LIST:["MEMBER",(0,r.optional)(["or","_RANDOM_MEMBER_LIST"])],RANDOM_MEMBER_LIST:["MEMBER","or","_RANDOM_MEMBER_LIST"],ADD_MEMBER_ACTION:(0,r.or)(["add",(0,r.or)("PICK_MEMBER","RANDOM_MEMBER_LIST","MEMBER"),"_TO_THE_CARD?"],["assign","_THE_CARD?","to","MEMBER"]),ASSIGN_ITEM_ACTION:(0,r.or)(["assign","the",(0,r.optional)("checklist"),"item","to","MEMBER"]),JOIN_CARD_ACTION:["join","_THE_CARD"],LEAVE_CARD_ACTION:["leave","_THE_CARD"],SUBSCRIBE_THE_MEMBER:["the","member"],_SUBSCRIBE_WHO:(0,r.or)("me","SUBSCRIBE_THE_MEMBER"),SUBSCRIBE:["subscribe","_SUBSCRIBE_WHO?","to"],UNSUBSCRIBE:["unsubscribe","_SUBSCRIBE_WHO?","from"],SUBSCRIBE_TO_CARD_ACTION:[(0,r.or)("SUBSCRIBE","UNSUBSCRIBE"),"_THE_CARD"],_RANDOM_COMMENT:["or","$COMMENT","_RANDOM_COMMENT?"],ADD_COMMENT_ACTION:[(0,r.or)("add","post"),"_A?","comment","$COMMENT","_RANDOM_COMMENT?"],ADD_COMMENT_ACTION__HELP:["add","a","comment","$COMMENT"],DELETE_COMMENT_ACTION:["delete","the","comment"],_NAME_LINK:[(0,r.or)(["with","name"],"as"),"$LINK_NAME"],ADD_LINK_ACTION:[(0,r.or)("add","post"),"_A?","link","$LINK","_NAME_LINK?"],LINK_IN_ATTACHMENTS:[(0,r.or)("as","using","with",["in","the"]),"attachments"],LINK_IN_DESCRIPTION:[(0,r.or)("using","in"),"the","description"],UNLINK:"unlink",LINK_CARDS_ACTION:[(0,r.or)("link","UNLINK"),(0,r.or)(["the",(0,r.optional)("two")],"both"),"cards",(0,r.optional)((0,r.or)("together",["to","each","other"])),(0,r.optional)((0,r.or)("LINK_IN_ATTACHMENTS","LINK_IN_DESCRIPTION"))],LINK_CARD_TO_ITEM_ACTION:["link","the","card",(0,r.or)("with","and","to"),"the","item"],RENAME_CARD_ACTION:(0,r.or)(["rename","_THE_CARD?",(0,r.optional)((0,r.or)("to","as")),"$NEW_NAME"],["change","_THE_CARD_S?",(0,r.or)("name","title"),"to","$NEW_NAME"]),REPLACE_TEXT_ACTION:["replace",(0,r.optional)("the"),"matched","text","with","$TEXT"],REPLACE_ALL_ACTION:["replace",(0,r.optional)(["all","occurrences","of"]),"$PATTERN","with","$TEXT","in","the","description"],DELETE_TEXT_ACTION:[(0,r.or)("delete","remove"),(0,r.optional)("the"),"matched","text"],SET_DESCRIPTION_ACTION:["set","_THE_CARD_S?","description",(0,r.optional)("to"),"$NEW_DESCRIPTION"],SET_DESCRIPTION_ACTION__HELP:["set","_THE_CARD_S","description","to","$NEW_DESCRIPTION"],CLEAR_FIELD:"clear",CHECK_FIELD:"check",UNCHECK_FIELD:"uncheck",INCREASE_FIELD:"increase",DECREASE_FIELD:"decrease",ADJUST_FIELD_DATE:(0,r.or)("TO_PREVIOUS_DAY","TO_PREVIOUS_WORKING_DAY","TO_NEXT_DAY","TO_NEXT_WORKING_DAY","_TO_SAME_DAY","TO_TIME","TO_DATE","BY_DATE","BY_SAME_TIME_AMOUNT"),SET_CUSTOM_FIELD_ACTION:(0,r.or)(["set","custom","field","$FIELD_NAME","to","_VALUE"],[(0,r.or)("CLEAR_FIELD","CHECK_FIELD","UNCHECK_FIELD"),"custom","field","$FIELD_NAME"],[(0,r.or)("INCREASE_FIELD","DECREASE_FIELD"),"the","number","in","custom","field","$FIELD_NAME","_BY_AMOUNT?"],["set","date","custom","field","$FIELD_NAME","to",(0,r.or)("DATE_TIME","THE_DATE","_PARSED_DATE")],["move","the","date","in","custom","field","$FIELD_NAME","ADJUST_FIELD_DATE"]),CHECK_ALL:(0,r.or)("complete",["check","all","_THE","items","in"]),_UNCHECK_ALL:(0,r.or)("reset",["uncheck","all","_THE","items","in"]),RESET_CHECKLIST_ACTION:[(0,r.or)("_UNCHECK_ALL","CHECK_ALL"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST","ALL_CHECKLISTS"),"_IN_THE_CARD?"],COMPLETE_ITEMS:[(0,r.or)("complete","completed"),"items"],INCOMPLETE_ITEMS:["incomplete","items"],_EXPLODE_ITEM_FILTER:[(0,r.optional)("all"),"_THE?",(0,r.or)("items","COMPLETE_ITEMS","INCOMPLETE_ITEMS"),"in"],COPY_LABELS:[(0,r.optional)("all"),(0,r.optional)("the"),"labels"],COPY_MEMBERS:[(0,r.optional)("all"),(0,r.optional)("the"),"members"],_COPY_FROM_SOURCE_CARD:["copying",(0,r.or)((0,r.swappable)("COPY_LABELS","COPY_MEMBERS",(0,r.or)(",","and")),"COPY_LABELS","COPY_MEMBERS")],_IN_THE_ITEMS:[(0,r.or)("in","from"),"the",(0,r.or)("item","items")],_OF_THE_ITEMS:["of","the",(0,r.or)("item","items")],_FIND_DATE_IN_ITEMS:["_IN_THE_ITEMS?","_AFTER_TEXT?"],FIND_DATE_AT_START:[(0,r.or)("at","from"),"the","start","_OF_THE_ITEMS?","_AFTER_TEXT?"],FIND_DATE_AT_END:[(0,r.or)("at","from"),"the","end","_OF_THE_ITEMS?","_AFTER_TEXT?"],DELETE_FOUND:["extracting"],FIND_DUE_DATES:[(0,r.or)("finding","DELETE_FOUND"),"_THE?","due",(0,r.or)("dates","date"),(0,r.optional)((0,r.or)("FIND_DATE_AT_START=>DATE_AT_START","FIND_DATE_AT_END=>DATE_AT_END","_FIND_DATE_IN_ITEMS"))],FIND_MEMBERS:[(0,r.or)("finding","DELETE_FOUND"),"members","_IN_THE_ITEMS?"],_FIND_IN_ITEM:[(0,r.or)((0,r.swappable)("FIND_DUE_DATES","FIND_MEMBERS?",(0,r.optional)("and")),"FIND_MEMBERS")],LINKED:["linked"],UNLINKED:["unlinked"],EXPLODE_CHECKLIST_ACTION:["convert","_EXPLODE_ITEM_FILTER?",(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST"),"_INTO",(0,r.optional)((0,r.or)("LINKED","UNLINKED")),"cards","DESTINATION?","_USING_PATTERN?",(0,r.optional)((0,r.or)((0,r.swappable)("_COPY_FROM_SOURCE_CARD","_FIND_IN_ITEM?",(0,r.optional)("and")),"_FIND_IN_ITEM"))],_USING_PATTERN:["using","pattern","$ITEM_PATTERN"],LINKS:"links",COLLECT_CHECKLIST_ACTION:["collect",(0,r.optional)("all"),(0,r.optional)("the"),"cards","_CONDITION?","into",(0,r.or)([(0,r.optional)((0,r.or)("LINKED","UNLINKED")),"items"],"LINKS"),(0,r.swappable)(["in","_CHECKLIST"],"_USING_PATTERN?")],REMOVE_CHECKLIST_ITEMS_ACTION:[(0,r.or)("remove","delete"),(0,r.optional)("all"),"_THE?",(0,r.or)("items","COMPLETE_ITEMS","INCOMPLETE_ITEMS"),(0,r.or)("in","from"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST","ALL_CHECKLISTS")],FIRST_INCOMPLETE_ITEM:(0,r.or)("incomplete","unchecked"),FIRST_COMPLETE_ITEM:(0,r.or)("complete","completed","checked"),FIRST_CHECKLIST_ITEM:["the","first",(0,r.optional)((0,r.or)("FIRST_INCOMPLETE_ITEM","FIRST_COMPLETE_ITEM")),(0,r.optional)("checklist"),"item"],_FIRST_CHECKLIST_ITEM:["FIRST_CHECKLIST_ITEM",(0,r.optional)([(0,r.or)("in","from"),(0,r.or)("_CHECKLIST","_UNNAMED_CHECKLIST")])],CONVERT_ITEM_ACTION:["convert",(0,r.or)("_TARGET_CHECKLIST_ITEM","_FIRST_CHECKLIST_ITEM"),"_INTO",(0,r.optional)((0,r.or)([(0,r.optional)("a"),"LINKED"],[(0,r.optional)("an"),"UNLINKED"],"a")),"card","DESTINATION?","_USING_PATTERN?",(0,r.optional)((0,r.or)((0,r.swappable)("_COPY_FROM_SOURCE_CARD","_FIND_IN_ITEM?",(0,r.optional)("and")),"_FIND_IN_ITEM"))],REMOVE_ALL_LABELS:(0,r.or)([(0,r.optional)((0,r.or)("any",["all",(0,r.optional)([(0,r.optional)("of"),(0,r.or)("the","its")])])),"labels"],[(0,r.optional)("the"),"labels"],"label"),REMOVE_ALL_LABELS__HELP:["all","the","labels"],REMOVE_ALL_STICKERS:(0,r.or)([(0,r.optional)((0,r.or)("any",["all",(0,r.optional)([(0,r.optional)("of"),(0,r.or)("the","its")])])),"stickers"],[(0,r.optional)("the"),(0,r.or)("sticker","stickers")]),REMOVE_ALL_STICKERS__HELP:["all","the","stickers"],REMOVE_DUE_DATE:[(0,r.optional)((0,r.or)("the","its")),"due","date"],REMOVE_START_DATE:[(0,r.optional)((0,r.or)("the","its")),"start","date"],REMOVE_ALL_CHECKLISTS:["all",(0,r.optional)("the"),"checklists"],REMOVE_CHECKLIST:"_CHECKLIST",REMOVE_COVER:[(0,r.optional)((0,r.or)("the","its")),"cover",(0,r.optional)((0,r.or)("image","picture","attachment"))],REMOVE_ALL_MEMBERS:["all",(0,r.optional)("the"),"members"],THE_ATTACHMENT:["_THE?","attachment"],REMOVE_ATTACHMENT:(0,r.or)(["_THE?","attachment","_CALLED?","$ATTACHMENT_NAME"],"THE_ATTACHMENT",["_THE?","link","$ATTACHMENT_LINK"]),_REMOVE_WHAT_FROM_CARD:(0,r.or)("LABEL","THE_LABEL","REMOVE_ALL_LABELS","_STICKER","REMOVE_ALL_STICKERS","REMOVE_START_DATE","REMOVE_DUE_DATE","REMOVE_CHECKLIST","REMOVE_ALL_CHECKLISTS","REMOVE_COVER","MEMBER","REMOVE_ALL_MEMBERS","REMOVE_ATTACHMENT"),_REMOVE_WHAT_FROM_CARD_LIST:["_REMOVE_WHAT_FROM_CARD",(0,r.optional)(["_AND?","_REMOVE_WHAT_FROM_CARD_LIST"])],_REMOVE_WHAT_FROM_CARD_LIST__HELP:(0,r.or)("_REMOVE_WHAT_FROM_CARD",["_REMOVE_WHAT_FROM_CARD","and","_REMOVE_WHAT_FROM_CARD"]),REMOVE_FROM_CARD_ACTION:[(0,r.or)("remove","delete"),"_REMOVE_WHAT_FROM_CARD_LIST",(0,r.optional)((0,r.or)(["_FROM","_THE_CARD"],["_FROM","ALL_CARDS_IN_LIST"],["_FROM","ALL_ARCHIVED_CARDS"]))],COPY_DESCRIPTION:[(0,r.optional)("the"),"description"],COPY_ALL_LABELS:[(0,r.optional)("all"),(0,r.optional)("the"),"labels"],COPY_DUE_DATE:[(0,r.optional)("the"),"due","date"],COPY_ALL_MEMBERS:[(0,r.optional)("all"),(0,r.optional)("the"),"members"],COPY_ALL_CHECKLISTS:[(0,r.optional)("all"),(0,r.optional)("the"),"checklists"],COPY_CHECKLIST:"_CHECKLIST",COPY_ALL_ATTACHMENTS:[(0,r.optional)("all"),(0,r.optional)("the"),"attachments"],_COPY_WHAT:(0,r.or)("COPY_DESCRIPTION","COPY_ALL_LABELS","COPY_DUE_DATE","COPY_CHECKLIST","COPY_ALL_CHECKLISTS","COPY_ALL_MEMBERS","COPY_ALL_ATTACHMENTS"),_COPY_WHAT_LIST:["_COPY_WHAT",(0,r.optional)(["_AND?","_COPY_WHAT_LIST"])],THE_TRIGGER_CARD:["the","trigger","card"],THE_FOUND_CARD:["the","found","card"],_WHICH_CARD:(0,r.or)("THE_TRIGGER_CARD","THE_FOUND_CARD"),TO_WHICH_CARD:["to","_WHICH_CARD"],FROM_WHICH_CARD:["from","_WHICH_CARD"],COPY_PARTS_ACTION:["copy","_COPY_WHAT_LIST",(0,r.or)("TO_WHICH_CARD","FROM_WHICH_CARD")],USE_TRIGGER_CARD:"trigger",ARCHIVE_CARD_ACTION:["archive",(0,r.or)("_THE_CARD",["the","USE_TRIGGER_CARD","card"])],UNARCHIVE_CARD_ACTION:["unarchive",(0,r.or)("_THE_CARD",["the","USE_TRIGGER_CARD","card"])],TIME_IN_LIST_CONDITION:["more","than","DAYS_IN_LIST","WORKING_DAYS?","days","in","_LIST"],ARCHIVE_ALL_CARDS_ACTION:["archive","all",(0,r.optional)("the"),"cards",(0,r.or)("WITH_LABEL","IN_LIST","TIME_IN_LIST_CONDITION","MARKED_AS_COMPLETE")],DELETE_CARD_ACTION:["delete","_THE_CARD",(0,r.trap)("!FOR_EACH_CARD","`delete` can only be used in `for each archived card inactive for more than X days`"),(0,r.trap)("!ARCHIVED","`delete` can only be used in `for each archived card inactive for more than X days`"),(0,r.trap)("!INACTIVITY_CONDITION","`delete` can only be used in `for each archived card inactive for more than X days`")],DONT_SWITCH_TO_CARD:"lookup",_FIND_OR_LOOKUP:(0,r.or)("find","DONT_SWITCH_TO_CARD"),FIND_CARD_BY_TITLE:["_FIND_OR_LOOKUP","_A?","card","_CALLED?","$TITLE",(0,r.optional)(["in","_LIST_NAME"]),"_IN_BOARD_NAME?"],FIND_CARD_BY_ID:["_FIND_OR_LOOKUP","_A?","card","with",(0,r.or)("id","link","url"),"$ID"],CARD_IN_POSITION:(0,r.ordinal)("The position of the card, e.g. first, 3rd."),CARD_IN_LAST_POSITION:"last",FIND_CARD_BY_POSITION:["_FIND_OR_LOOKUP","the",(0,r.or)("CARD_IN_POSITION","CARD_IN_LAST_POSITION"),"card","in","_LIST_NAME","_IN_BOARD_NAME?"],FIND_CARD_ABOVE:["_FIND_OR_LOOKUP",(0,r.optional)("the"),"card","above"],FIND_CARD_ACTION:(0,r.or)("FIND_CARD_BY_TITLE","FIND_CARD_BY_ID","FIND_CARD_BY_POSITION","FIND_CARD_ABOVE","FIND_SOURCE_CARD","FIND_MIRROR_CARD"),FIND_MENTIONED_CARD_ACTION:["_FIND_OR_LOOKUP","_THE?",(0,r.or)("linked","mentioned"),"card"],FIND_CARD_IN_DESCRIPTION_ACTION:["_FIND_OR_LOOKUP","_THE?","card",(0,r.or)("linked","mentioned"),"in","the","description"],FIRST_CARD_IN_ATTACHMENTS:"first",LAST_CARD_IN_ATTACHMENTS:"last",FIND_CARD_IN_ATTACHMENTS_ACTION:["_FIND_OR_LOOKUP","_THE?",(0,r.optional)((0,r.or)("FIRST_CARD_IN_ATTACHMENTS","LAST_CARD_IN_ATTACHMENTS")),"card","linked",(0,r.or)("in","from"),(0,r.or)(["the","attachments"],["an","attachment"])],FIND_SOURCE_CARD:["_FIND_OR_LOOKUP","_THE?","source","card"],FIND_MIRROR_CARD:["_FIND_OR_LOOKUP","_A?","mirror","card",(0,r.optional)(["in","_LIST_NAME"]),"_IN_BOARD_NAME?"],DECIMAL_VALUE:(0,r.decimal)(),DISPLAY_VALUE_ACTION:["display",(0,r.optional)("value"),(0,r.or)("$TEXT_VALUE","{VARIABLE_VALUE}","DECIMAL_VALUE"),(0,r.or)((0,r.swappable)("_DASH_TITLE","_DASH_COLOR?"),"_DASH_COLOR?")],CREATE_REPORT_ACTION:["create","_A?","report",(0,r.optional)(["in","variable","$REPORT_VAR"]),"with",(0,r.optional)("all"),(0,r.optional)("the"),"cards","_CONDITION?","_REPORT_USING_PATTERN?","_REPORT_GROUP_BY_CLAUSE?"],REPORT_GROUP_BY:(0,r.enum_value)("THE_LIST","THE_DUE_DATE"),_REPORT_GROUP_BY_CLAUSE:[(0,r.or)("group","grouped"),"by","REPORT_GROUP_BY"],_REPORT_USING_PATTERN:"_USING_PATTERN",CONFETTI_TARGET_LOCATION:[(0,r.or)("THE_CHECKLIST","THE_DUE_DATE","THE_LIST","THE_CARD","THIS_BOARD"),(0,r.optional)(["_CALLED?","$NAME"])],THROW_CONFETTI_ACTION:["throw","confetti","on","CONFETTI_TARGET_LOCATION"],MIRROR_CARD_ACTION:["mirror","_THE_CARD","DESTINATION"],_CARD_ACTION:(0,r.or)("CREATE_CARD_ACTION","COPY_CARD_ACTION","SWITCH_TO_COPY_ACTION","SWITCH_TO_TRIGGER_CARD_ACTION","MOVE_CARD_ACTION","MOVE_ALL_CARDS_ACTION","COPY_ALL_CARDS_ACTION","RANDOM_CARDS_ACTION","_ARCHIVE_EACH_CARD_ACTION","_MOVE_EACH_CARD_ACTION","_COPY_EACH_CARD_ACTION","_MIRROR_EACH_CARD_ACTION","ADD_LABEL_ACTION","ADD_STICKER_ACTION","ADD_DUE_DATE_ACTION","ADD_START_DATE_ACTION","ADJUST_DUE_DATE_ACTION","ADJUST_START_DATE_ACTION","MARK_CARD_COMPLETE_ACTION","UNMARK_CARD_COMPLETE_ACTION","MARK_DUE_COMPLETE_ACTION","UNMARK_DUE_COMPLETE_ACTION","ADD_CHECKLIST_ACTION","MOVE_CHECKLIST_ACTION","ADD_CHECKLIST_ITEM_ACTION","RENAME_CHECKLIST_ITEM_ACTION","REMOVE_CHECKLIST_ITEM_ACTION","REMOVE_DUE_DATE_CHECKLIST_ACTION","MOVE_CHECKLIST_ITEM_ACTION","ADD_MEMBER_ACTION","ADD_COMMENT_ACTION","ADD_LINK_ACTION","RENAME_CARD_ACTION","SET_DESCRIPTION_ACTION","LINK_CARDS_ACTION","LINK_CARD_TO_ITEM_ACTION",(0,r.hidden)("SET_CUSTOM_FIELD_ACTION"),"DELETE_COMMENT_ACTION","REPLACE_TEXT_ACTION","REPLACE_ALL_ACTION","DELETE_TEXT_ACTION","JOIN_CARD_ACTION","LEAVE_CARD_ACTION","SUBSCRIBE_TO_CARD_ACTION","CONVERT_ITEM_ACTION","CHECK_ITEM_ACTION","UNCHECK_ITEM_ACTION","REMOVE_DUE_DATE_ITEM_ACTION","ASSIGN_ITEM_ACTION","SET_ITEM_DUE_DATE_ACTION","RESET_CHECKLIST_ACTION","EXPLODE_CHECKLIST_ACTION","COLLECT_CHECKLIST_ACTION","REMOVE_CHECKLIST_ITEMS_ACTION","REMOVE_FROM_CARD_ACTION","COPY_PARTS_ACTION","ARCHIVE_CARD_ACTION","ARCHIVE_ALL_CARDS_ACTION","UNARCHIVE_CARD_ACTION","DELETE_CARD_ACTION","FIND_CARD_ACTION","FIND_MENTIONED_CARD_ACTION","FIND_CARD_IN_DESCRIPTION_ACTION","FIND_CARD_IN_ATTACHMENTS_ACTION","DISPLAY_VALUE_ACTION","CREATE_REPORT_ACTION","THROW_CONFETTI_ACTION","MIRROR_CARD_ACTION"),_IN_TEAM:["in","_TEAM","$TEAM"],CREATE_BOARD_ACTION:[(0,r.or)("create","add","start"),"_A?",(0,r.optional)("new"),"board","_CALLED?","$NAME","_IN_TEAM?"],_TO_TEAM:[(0,r.or)("in","to"),"_TEAM","$TEAM"],COPY_BOARD_ACTION:["copy",(0,r.or)(["board","$NAME"],[(0,r.optional)((0,r.or)("the","this")),"board"]),"_TO_TEAM?",(0,r.optional)(["with","name","$NEW_NAME"])],SWITCH_CURRENT_BOARD_ACTION:["switch","to","_BOARD_NAME",(0,r.trap)("_ACTION_MULTIPLIER","`switch to board` can not be used within a multiplier")],CREATE_UNIQUE_LIST:"unique",CREATE_LIST_ACTION:[(0,r.or)("create","add","start"),"_A?",(0,r.optional)((0,r.or)("new","CREATE_UNIQUE_LIST")),"list","_CALLED?","$NAME",(0,r.or)(["_POSITION_NUMBER",(0,r.optional)([(0,r.or)("of","in","on"),(0,r.or)("_BOARD_NAME",[(0,r.or)("the","this"),"board"])])],["_IN_BOARD_NAME?","_POSITION_NUMBER?"])],RENAME_LIST_ACTION:["rename","_LIST",(0,r.or)("to","as"),"$NEW_NAME"],CHANGE_LIST_COLOR_ACTION:["change","_LIST","color","to","LIST_COLOR"],DESTINATION_THIS_BOARD:[(0,r.or)("this","the"),"board"],MOVE_LIST_ACTION:["move",(0,r.optional)("the"),(0,r.swappable)("list","$LIST"),(0,r.optional)((0,r.or)("_IN_BOARD_NAME","_FROM_BOARD_NAME")),(0,r.or)(["_TO_POSITION",(0,r.optional)(["_IN",(0,r.or)("_DESTINATION_BOARD_NAME","DESTINATION_THIS_BOARD")])],["_TO",(0,r.or)("_DESTINATION_BOARD_NAME","DESTINATION_THIS_BOARD")])],COPY_LIST_ACTION:["copy",(0,r.optional)("the"),(0,r.swappable)("list","$LIST"),(0,r.optional)((0,r.or)("_IN_BOARD_NAME","_FROM_BOARD_NAME")),(0,r.optional)((0,r.or)(["_TO_POSITION",(0,r.optional)(["_IN",(0,r.or)("_DESTINATION_BOARD_NAME","DESTINATION_THIS_BOARD")])],["_TO",(0,r.or)("_DESTINATION_BOARD_NAME","DESTINATION_THIS_BOARD")])),(0,r.optional)(["with","name","$NEW_NAME"])],ARCHIVE_LIST_ACTION:["archive","list","$LIST","_IN_BOARD_NAME?"],UNARCHIVE_LIST_ACTION:["unarchive","list","$LIST","_IN_BOARD_NAME?"],SHUFFLE_LIST_ACTION:["shuffle",(0,r.optional)(["_ALL_THE_CARDS","_IN"]),"_LIST_NAME"],SORT_BY_TITLE:["by",(0,r.or)("name","title")],SORT_BY_DATE_IN_TITLE:["by",(0,r.optional)("the"),"date","in",(0,r.optional)("the"),"title"],SORT_BY_START_DATE:["by","start","date"],SORT_BY_DUE_DATE:["by","due","date"],SORT_BY_VOTES:["by","votes"],SORT_LABEL:(0,r.or)(["COLOR_VARIANT?","COLOR","$TITLE?"],"$TITLE"),_SORT_LABEL_LIST:[(0,r.or)("SORT_LABEL","LABEL=>SORT_LABEL"),(0,r.optional)(["_AND","_SORT_LABEL_LIST"])],SORT_BY_LABEL:["by",(0,r.optional)("label"),"_SORT_LABEL_LIST"],SORT_BY_TIME_IN_LIST:["by","time","in",(0,r.optional)("the"),"list"],SORT_BY_AGE:["by",(0,r.optional)("card"),"age"],SORT_BY_CUSTOM_FIELD:["by","custom","field","$CUSTOM_FIELD_NAME"],SORT_ASCENDING:[(0,r.optional)(","),"ascending"],SORT_DESCENDING:[(0,r.optional)(","),"descending"],_SORT_CRITERION:[(0,r.or)("SORT_BY_TITLE","SORT_BY_DATE_IN_TITLE","SORT_BY_START_DATE","SORT_BY_DUE_DATE","SORT_BY_VOTES","SORT_BY_TIME_IN_LIST","SORT_BY_AGE","SORT_BY_LABEL","SORT_BY_CUSTOM_FIELD"),(0,r.optional)((0,r.or)("SORT_ASCENDING","SORT_DESCENDING"))],SECONDARY_SORT:["_AND?",(0,r.optional)("then"),"_SORT_CRITERION"],SORT_LIST_ACTION:["sort",(0,r.or)([(0,r.optional)(["_ALL_THE_CARDS","_IN"]),"_LIST_NAME","_IN_BOARD_NAME?"],[(0,r.optional)("the"),"list"]),"_SORT_CRITERION","SECONDARY_SORT?"],EXCEPT_LIST_COUNT:(0,r.small_numeral)("a number of lists"),_EXCEPT_LIST_COUNT:[(0,r.optional)("the"),(0,r.optional)("first"),(0,r.or)("list",["EXCEPT_LIST_COUNT","lists"])],EXCEPT_LEFT_LISTS:["_EXCEPT_LIST_COUNT",(0,r.optional)(["on","the","left"])],EXCEPT_RIGHT_LISTS:["_EXCEPT_LIST_COUNT","on","the","right"],_EXCEPT_LISTS:["except",(0,r.or)("EXCEPT_RIGHT_LISTS",["EXCEPT_LEFT_LISTS",(0,r.optional)(["and","EXCEPT_RIGHT_LISTS"])])],SPECIFIC_LIST:["position","the","list"],ARRANGE_LISTS_ACTION:[(0,r.or)(["arrange","the","lists","_IN_THIS_BOARD?"],"SPECIFIC_LIST"),(0,r.or)("SORT_BY_TITLE","SORT_BY_DATE_IN_TITLE"),(0,r.optional)((0,r.or)("SORT_ASCENDING","SORT_DESCENDING")),"_EXCEPT_LISTS?"],COUNT_LABELS_ACTION:["count",(0,r.optional)("the"),"labels",(0,r.or)(["in","_LIST_NAME"],"_IN_THIS_BOARD?")],IN_ALL_LISTS:["in",(0,r.optional)((0,r.or)(["all",(0,r.optional)("of"),(0,r.optional)("the")],"_EVERY","the")),(0,r.or)("list","lists"),"_IN_THIS_BOARD?"],COUNT_CARDS_ACTION:["count",(0,r.optional)("the"),"ARCHIVED?","cards",(0,r.optional)((0,r.or)("_CONDITION","IN_THE_LIST","IN_ALL_LISTS","_IN_THIS_BOARD"))],COUNT_CARDS_ACTION__HELP:["count","the","cards",(0,r.or)(["in","_LIST_NAME"],"IN_ALL_LISTS","_IN_THIS_BOARD")],_TO_THE_BOARD:["to","the","board"],INVITE_MEMBER_TO_BOARD_ACTION:["invite","MEMBER","_TO_THE_BOARD","_AS_BOARD_MEMBER_TYPE?"],DO_NOTHING_ACTION:(0,r.or)(["do","nothing"],"nop"),MAKE_COMMAND_ACTION:["convert","_THE_CARD","_INTO","_A?","command"],MATCH_TEXT_ACTION:["match",(0,r.or)("$TEXT","{TEXT}"),(0,r.or)("to","with"),"$PATTERN"],PRINT_VARIABLES:"variables",PRINT_CARD_VARIABLES:["card","variables"],PRINT_BOARD_VARIABLES:["board","variables"],_PRINT_VARIABLES:(0,r.or)("PRINT_VARIABLES","PRINT_CARD_VARIABLES","PRINT_BOARD_VARIABLES"),PRINT_USAGE:"usage",PRINT_ACTION:["print",(0,r.or)("$TEXT","_PRINT_VARIABLES","PRINT_USAGE")],TIMEZONE:(0,r.timezone)(),SET_TIMEZONE_ACTION:(0,r.or)(["set","timezone",(0,r.optional)("to"),"TIMEZONE"],[(0,r.optional)((0,r.or)("the","my","our")),"timezone",(0,r.optional)("is"),"TIMEZONE"]),SILENT:(0,r.or_index)("off","on"),SET_SILENT_ACTION:["set","silent","SILENT"],BOT_STICKERS:(0,r.or_index)("off","on"),SET_BOT_STICKERS_ACTION:["set","stickers","BOT_STICKERS"],_BOARD_ACTION:(0,r.or)("SET_TIMEZONE_ACTION","SET_SILENT_ACTION","SET_BOT_STICKERS_ACTION","CREATE_BOARD_ACTION","COPY_BOARD_ACTION",(0,r.hidden)("INVITE_MEMBER_TO_BOARD_ACTION"),(0,r.hidden)("SWITCH_CURRENT_BOARD_ACTION"),"CREATE_LIST_ACTION","RENAME_LIST_ACTION","CHANGE_LIST_COLOR_ACTION","MOVE_LIST_ACTION","COPY_LIST_ACTION","SHUFFLE_LIST_ACTION","SORT_LIST_ACTION","ARRANGE_LISTS_ACTION","ARCHIVE_LIST_ACTION","UNARCHIVE_LIST_ACTION","COUNT_LABELS_ACTION","COUNT_CARDS_ACTION","MAKE_COMMAND_ACTION","MATCH_TEXT_ACTION",(0,r.hidden)("DO_NOTHING_ACTION"),(0,r.hidden)("PRINT_ACTION")),CARD_VARIABLE:"card",BOARD_VARIABLE:"board",VARIABLE_VALUE:(0,r.or)((0,r.small_numeral)("a number"),(0,r.decimal)("a decimal number")),SET_VARIABLE_ACTION:[(0,r.or)(["set","_THE?",(0,r.or)("CARD_VARIABLE","BOARD_VARIABLE"),"variable","$VARIABLE_NAME"],["set",(0,r.optional)("variable"),"{VARIABLE_NAME}"]),"to",(0,r.or)("$VARIABLE_VALUE","VARIABLE_VALUE")],AMOUNT:(0,r.or)((0,r.small_numeral)("a number"),(0,r.decimal)("a decimal number")),_BY_AMOUNT:["by",(0,r.or)("AMOUNT","{AMOUNT}")],INCREASE_VARIABLE_ACTION:(0,r.or)(["increase",(0,r.or)("CARD_VARIABLE","BOARD_VARIABLE"),"variable","$VARIABLE_NAME","_BY_AMOUNT?"],["increase",(0,r.optional)("variable"),"{VARIABLE_NAME}","_BY_AMOUNT?"]),DECREASE_VARIABLE_ACTION:(0,r.or)(["decrease",(0,r.or)("CARD_VARIABLE","BOARD_VARIABLE"),"variable","$VARIABLE_NAME","_BY_AMOUNT?"],["decrease",(0,r.optional)("variable"),"{VARIABLE_NAME}","_BY_AMOUNT?"]),_VARIABLE_ACTION:(0,r.or)("SET_VARIABLE_ACTION","INCREASE_VARIABLE_ACTION","DECREASE_VARIABLE_ACTION"),HTTP_GET_METHOD:"get",HTTP_POST_METHOD:"post",HTTP_PUT_METHOD:"put",HTTP_FORM_PAYLOAD:"form",_HTTP_GET_ACTION:["HTTP_GET_METHOD","url","$URL"],_HTTP_POST_ACTION:["HTTP_POST_METHOD",(0,r.optional)("to"),"url","$URL",(0,r.optional)([(0,r.optional)("with"),"headers","$HEADERS",(0,r.optional)("and")]),(0,r.optional)("with"),"HTTP_FORM_PAYLOAD?","payload","$PAYLOAD"],_HTTP_PUT_ACTION:["HTTP_PUT_METHOD",(0,r.optional)("to"),"url","$URL",(0,r.optional)([(0,r.optional)("with"),"headers","$HEADERS",(0,r.optional)("and")]),(0,r.optional)("with"),"HTTP_FORM_PAYLOAD?","payload","$PAYLOAD"],HTTP_REQUEST_ACTION:(0,r.or)("_HTTP_GET_ACTION","_HTTP_POST_ACTION","_HTTP_PUT_ACTION"),ALL_MEMBERS_ON_BOARD:(0,r.or)("@board",["every","member","on","the","board"]),ALL_MEMBERS_ON_CARD:(0,r.or)("@card",["every","member","on","the","card"]),SEND_EMAIL_ACTION:["send",(0,r.optional)("an"),"email",(0,r.optional)("notification"),"to",(0,r.or)("$ADDRESS","ALL_MEMBERS_ON_BOARD","ALL_MEMBERS_ON_CARD"),(0,r.optional)(","),(0,r.optional)("with"),"subject","$SUBJECT",(0,r.optional)([(0,r.optional)(","),(0,r.optional)("and"),(0,r.optional)("with"),(0,r.or)("message","body"),"$MESSAGE"])],_MISC_ACTION:(0,r.or)("HTTP_REQUEST_ACTION","SEND_EMAIL_ACTION"),IN_THE_CARD:"_IN_THE_CARD",_ON_THE_BOARD:[(0,r.or)("on","in"),"the","board"],ON_THE_BOARD:"_ON_THE_BOARD",FOR_EACH_MEMBER:["for","each","member",(0,r.or)("IN_THE_CARD","ON_THE_BOARD")],FOR_EACH_LABEL:["for","each","label",(0,r.optional)((0,r.or)("IN_THE_CARD","ON_THE_BOARD"))],FOR_EACH_CHECKLIST:["for","each","checklist","IN_THE_CARD?"],FOR_EACH_ATTACHMENT:["for","each","attachment","IN_THE_CARD?"],COMPLETE_ITEM:(0,r.or)("complete","completed","checked"),INCOMPLETE_ITEM:(0,r.or)("incomplete","unchecked"),FOR_EACH_CHECKLIST_ITEM:["for","each",(0,r.optional)((0,r.or)("COMPLETE_ITEM","INCOMPLETE_ITEM")),(0,r.optional)("checklist"),"item","_IN_CHECKLIST?","IN_THE_CARD?"],EMPTY_LIST:(0,r.or)(["empty","list","ON_THE_BOARD?"],["list","ON_THE_BOARD?","_THAT_IS","empty"]),NON_EMPTY_LIST:(0,r.or)([(0,r.or)("non-empty",["non","empty"],["not","empty"]),"list","ON_THE_BOARD?"],["list","ON_THE_BOARD?","_THAT_IS_NOT","empty"]),FOR_EACH_LIST:["for","each",(0,r.or)("NON_EMPTY_LIST","EMPTY_LIST",["list","ON_THE_BOARD?"])],ARCHIVED:"archived",IN_THE_LIST:["in","the","list"],EXCEPT_TRIGGER_CARD:["except","the","trigger",(0,r.optional)("card")],INCLUDE_COMMANDS:["including","commands"],FOR_EACH_CARD:["for","each","ARCHIVED?","card",(0,r.optional)((0,r.or)("_CONDITION","IN_THE_LIST")),"_IN_BOARD_NAME?","EXCEPT_TRIGGER_CARD?","INCLUDE_COMMANDS?"],FOR_EACH_CARD_IMPLICIT:[(0,r.or)("each","every"),"card",(0,r.optional)((0,r.or)("_CONDITION","IN_THE_LIST")),"_IN_BOARD_NAME?","EXCEPT_TRIGGER_CARD?"],_FOR_EACH_CARD_IMPLICIT:"FOR_EACH_CARD_IMPLICIT=>FOR_EACH_CARD",MENTIONED_IN_DESCRIPTION:["the","description"],MENTIONED_IN_ATTACHMENTS:["the","attachments"],MENTIONED_IN_CHECKLIST:[(0,r.optional)(["_A",(0,r.optional)((0,r.or)("COMPLETE_ITEM","INCOMPLETE_ITEM")),"item","in"]),"_CHECKLIST"],FOR_EACH_MENTIONED_CARD:["for","each","card",(0,r.or)("linked","mentioned"),(0,r.or)("from","in"),(0,r.or)("MENTIONED_IN_DESCRIPTION","MENTIONED_IN_ATTACHMENTS","MENTIONED_IN_CHECKLIST"),(0,r.optional)(["of","the","card"]),"EXCEPT_TRIGGER_CARD?"],START_VALUE:(0,r.small_numeral)(),END_VALUE:(0,r.small_numeral)(),LOOP:["loop","START_VALUE","to","END_VALUE"],_WITH_TAG:[(0,r.or)(["with","tag"],["in","collection"]),"$TAG"],SWITCH_TO_BOARD:"on",FOR_EACH_BOARD:[(0,r.or)("for",(0,r.hidden)("SWITCH_TO_BOARD")),"each","BOARD_VISIBILITY_CONDITION?","board",(0,r.swappable)("_IN_TEAM","_WITH_TAG?"),"INACTIVITY_CONDITION?"],_ACTION_MULTIPLIER:(0,r.or)("FOR_EACH_MEMBER","FOR_EACH_LABEL","FOR_EACH_CHECKLIST_ITEM","FOR_EACH_CHECKLIST","FOR_EACH_ATTACHMENT","FOR_EACH_LIST","FOR_EACH_MENTIONED_CARD","FOR_EACH_CARD","FOR_EACH_BOARD",(0,r.hidden)("LOOP")),_VALUE:(0,r.or)("$TEXT_VALUE","{VARIABLE_VALUE}","NUMERIC_VALUE"),OP_CMP_EQ:(0,r.or)("equals","="),OP_CMP_LT:(0,r.or)(["is",(0,r.or)("less","lower"),"than"],"<"),OP_CMP_LE:(0,r.or)(["is","lower",(0,r.optional)("than"),"or","equal","to"],"<=","≤"),OP_CMP_GT:(0,r.or)(["is",(0,r.or)("more","greater"),"than"],">"),OP_CMP_GE:(0,r.or)(["is","greater",(0,r.optional)("than"),"or","equal","to"],">=","≥"),COMPARE_OP:(0,r.or)("OP_CMP_LT","OP_CMP_LE","OP_CMP_GT","OP_CMP_GE","OP_CMP_EQ"),L_VALUE:"_VALUE",R_VALUE:"_VALUE",_COMPARE_EXPRESSION:["L_VALUE","COMPARE_OP","R_VALUE"],MATCH_EXACT:"$TEXT",_MATCH_EXACT:[(0,r.or)("is",["matches",(0,r.optional)("with")]),"MATCH_EXACT"],_NOT_MATCH_EXACT:[(0,r.or)("isn't",["is","not"],[(0,r.or)("doesn't",["does","not"]),"match",(0,r.optional)("with")]),"MATCH_EXACT","NEGATIVE_MATCH"],NUMERIC_VALUE:(0,r.or)((0,r.decimal)("a number",!0),(0,r.small_numeral)("a number")),TEXT_MATCH_OP:(0,r.or)("_MATCH_EXACT","_NOT_MATCH_EXACT","_STARTS_WITH","_NOT_STARTS_WITH","_ENDS_WITH","_NOT_ENDS_WITH","_CONTAINS","_NOT_CONTAINS","DATE_AT_START","_NOT_DATE_AT_START","DATE_AT_END","_NOT_DATE_AT_END","CONTAINS_DATE","_NOT_CONTAINS_DATE","_TEXT_LENGTH"),TEXT_VALUE:"_VALUE",_TEXT_MATCH_EXPRESSION:["TEXT_VALUE","TEXT_MATCH_OP"],COMPARE_AND:["and","_COMPARE_EXPRESSION_LIST"],COMPARE_OR:["or","_COMPARE_EXPRESSION_LIST"],COMPARE_GROUP:["(","_COMPARE_EXPRESSION_LIST",")"],_COMPARE_EXPRESSION_LIST:[(0,r.or)("_COMPARE_EXPRESSION","COMPARE_GROUP","_TEXT_MATCH_EXPRESSION"),(0,r.optional)((0,r.or)("COMPARE_AND","COMPARE_OR"))],IF_ACTION:["if","_COMPARE_EXPRESSION_LIST","_COMMA",(0,r.optional)("then"),"ELSE_ALLOWED"],_EXISTS:"exists",NOT_EXISTS:[(0,r.or)(["does","not"],"doesn't"),"exist"],_IF_EXISTS_LIST:["_LIST",(0,r.or)("_EXISTS","NOT_EXISTS"),"_IN_BOARD_NAME?"],IF_EXISTS_ACTION:["if","_IF_EXISTS_LIST",(0,r.optional)("then"),"ELSE_ALLOWED"],ELSE_ALLOWED:[],ELSE_ACTION:["else",(0,r.trap)("!ELSE_ALLOWED","`else` can only be used after `if`")],APP_ACTION:(0,r.or)("APP_JIRA_ACTION","APP_SLACK_ACTION","APP_BITBUCKET_ACTION"),APP_JIRA_ACTION:(0,r.or)("APP_JIRA_CREATE_ISSUE_ACTION","APP_JIRA_POST_ISSUE_COMMENT_ACTION"),_APP_JIRA_PROJECT:["in","project","$PROJECT"],_APP_JIRA_SITE:["in","site","$SITE"],APP_JIRA_CREATE_ISSUE_ACTION:["create","a","jira","$ISSUE_TYPE","with",(0,r.or)("summary","title"),"$SUMMARY",(0,r.optional)(["_AND","description","$DESCRIPTION"]),"_APP_JIRA_PROJECT","_APP_JIRA_SITE"],APP_JIRA_POST_ISSUE_COMMENT_ACTION:["post","a","comment","to","jira","issue","$ISSUE_REF","_APP_JIRA_SITE","with","message","$COMMENT"],APP_SLACK_ACTION:(0,r.or)("APP_SLACK_POST_MESSAGE_ACTION"),_APP_SLACK_WORKSPACE:["in","workspace","$WORKSPACE"],APP_SLACK_VIA_AUTOMATION:"automation",APP_SLACK_AS_BUTLER:"butler",APP_SLACK_AS_MYSELF:"myself",_APP_SLACK_ACT_AS:(0,r.or)(["via","APP_SLACK_VIA_AUTOMATION"],["as","APP_SLACK_AS_MYSELF"],["as","APP_SLACK_AS_BUTLER"]),APP_SLACK_POST_MESSAGE_ACTION:["post","message","$MESSAGE","to","slack","channel","$CHANNEL","_APP_SLACK_WORKSPACE","_APP_SLACK_ACT_AS"],APP_BITBUCKET_ACTION:(0,r.or)("APP_BITBUCKET_CREATE_PR_ACTION","APP_BITBUCKET_SET_REVIEWERS_ACTION"),SCOPE_SELECTOR:(0,r.or)("first","all"),APP_BITBUCKET_CREATE_PR_ACTION:["open","_A","pull","request","with",(0,r.optional)("the"),"SCOPE_SELECTOR","bitbucket",(0,r.or)("branch","branches"),"linked","in","the","attachments"],APP_BITBUCKET_SET_REVIEWERS_ACTION:["set","card","members","as","reviewers","for",(0,r.optional)("the"),"SCOPE_SELECTOR","pull",(0,r.or)("request","requests"),"linked","in","the","attachments"],ACTION:(0,r.or)("_BOARD_ACTION","_CARD_ACTION","_VARIABLE_ACTION",(0,r.hidden)("_MISC_ACTION"),"_ACTION_MULTIPLIER","IF_ACTION","IF_EXISTS_ACTION","ELSE_ACTION","APP_ACTION"),_ACTION_LIST_LIST:["_ACTION_LIST",(0,r.optional)([".","_ACTION_LIST_LIST"])],RETURN_MESSAGE:["return","message","$MESSAGE"],SCRIPT_RETURN:"RETURN_MESSAGE",SCRIPT:["script:","_ACTION_LIST_LIST",(0,r.optional)([(0,r.or)(",","."),"SCRIPT_RETURN"])],IN_THIS_BOARD:"_IN_THIS_BOARD",_DASH_CARDS_FILTER:(0,r.or)(["in","_LIST_NAME"],"IN_THIS_BOARD",[(0,r.optional)("with"),"LABEL"],["assigned","to","MEMBER"],"WITH_CHECKLIST","WITH_ALL_CHECKLISTS"),DASH_CARDS_FILTER_AND:[(0,r.optional)(","),(0,r.optional)("and"),"_DASH_CARDS_FILTER_LIST"],DASH_CARDS_FILTER_OR:[(0,r.optional)(","),"or","_DASH_CARDS_FILTER_LIST"],_DASH_CARDS_FILTER_LIST:["_DASH_CARDS_FILTER",(0,r.optional)([(0,r.or)("DASH_CARDS_FILTER_AND","DASH_CARDS_FILTER_OR")])],DASH_CARDS_FILTER:"_DASH_CARDS_FILTER_LIST",COUNT_CARDS_DASH:["cards","DASH_CARDS_FILTER?"],SUM_AVERAGE:["average"],SUM_CARDS_DASH:[(0,r.or)("sum","SUM_AVERAGE"),"custom","field","$CUSTOM_FIELD",(0,r.optional)(["for","cards"]),"DASH_CARDS_FILTER?"],NO_TITLE:[(0,r.optional)(","),(0,r.optional)("with"),"no","title"],_DASH_TITLE:(0,r.or)([(0,r.optional)(","),(0,r.or)([(0,r.optional)("with"),"title"],"titled"),"$DASH_TITLE"],"NO_TITLE"),_DASH_COLOR:[(0,r.optional)(","),(0,r.optional)("in"),(0,r.swappable)("COLOR",(0,r.optional)((0,r.or)("color","background")))],DASH_CARD:[(0,r.or)("COUNT_CARDS_DASH","SUM_CARDS_DASH"),(0,r.or)((0,r.swappable)("_DASH_TITLE","_DASH_COLOR?"),"_DASH_COLOR?")],_TRIGGERED_DASH_CARD:["TRIGGER","_COMMA",(0,r.optional)(["update","with"]),"DASH_CARD"],_IMMEDIATE_DASH_CARD:"DASH_CARD",TRIGGER:[(0,r.or)("EVERY","WHEN","ON_DUE_DATE","ON_START_DATE")],_ACTION_LIST:["ACTION",(0,r.optional)(["_AND?","_ACTION_LIST"])],_ACTION_LIST__HELP:"ACTION",_TRIGGERED_COMMAND:["TRIGGER","_COMMA","_ACTION_LIST"],_IMMEDIATE_COMMAND:"_ACTION_LIST",COMMAND:[(0,r.or)("_TRIGGERED_COMMAND","_IMMEDIATE_COMMAND",(0,r.hidden)("_TRIGGERED_DASH_CARD"),(0,r.hidden)("_IMMEDIATE_DASH_CARD"),(0,r.hidden)("SCRIPT")),(0,r.optional)("."),""],_USER:(0,r.or)("user","member"),USER_NEGATIVE_MATCH:"not",ADMIN_USER:["_AN",(0,r.or)("administrator","admin"),"_USER?"],NON_ADMIN_USER:["_A",(0,r.or)("non-administrator","non-admin"),"_USER?"],USER_TEAM_CONDITION:["USER_NEGATIVE_MATCH?","in","_TEAM","$TEAM_NAME"],USER_ENTERPRISE_CONDITION:["USER_NEGATIVE_MATCH?","in","the","enterprise"],_USER_FILTER:[(0,r.or)("ADMIN_USER","NON_ADMIN_USER",["_A","_USER?"]),(0,r.optional)((0,r.or)("USER_ENTERPRISE_CONDITION","USER_TEAM_CONDITION"))],USER_FILTER:"_USER_FILTER",BY_USER_FILTER:["by","_USER_FILTER"],_BOARD_CONDITION:(0,r.or)(["named","$BOARD_NAME"],["not","named","$BOARD_NAME","NEGATIVE_MATCH"]),VISIBILITY_PUBLIC:"public",VISIBILITY_PRIVATE:"private",VISIBILITY_TEAM:(0,r.or)("team-visible","workspace-visible"),_BOARD_VISIBILITY:(0,r.or)("VISIBILITY_PUBLIC","VISIBILITY_PRIVATE","VISIBILITY_TEAM"),BOARD_VISIBILITY_CONDITION:"_BOARD_VISIBILITY",ANY_TEAM:[(0,r.or)("a","any","the","its"),"_TEAM"],_NAMED_TEAM:["_TEAM","$TEAM_NAME"],_TEAM_CONDITION:(0,r.or)(["named","$TEAM_NAME"],["not","named","$TEAM_NAME","NEGATIVE_MATCH"]),BOARD_CREATED:["_A","board","_BOARD_CONDITION?","is","created","BY_USER_FILTER?"],TEAM_CREATED:["_A","_TEAM","_TEAM_CONDITION?","is","created","BY_USER_FILTER?"],BOARD_VISIBILITY_CHANGED:["_A","board","is","made","_BOARD_VISIBILITY","BY_USER_FILTER?"],BOARD_REMOVED_FROM_TEAM:["_A","board","is","removed","from",(0,r.or)("ANY_TEAM","_NAMED_TEAM"),"BY_USER_FILTER?"],MEMBER_TYPE_ADMIN:["_AN?",(0,r.or)("admin","administrator")],MEMBER_TYPE_NORMAL:["_A?","normal","_USER"],MEMBER_TYPE_OBSERVER:["_AN?","observer"],BOARD_MEMBER_TYPE:(0,r.or)("MEMBER_TYPE_ADMIN","MEMBER_TYPE_NORMAL","MEMBER_TYPE_OBSERVER"),_AS_BOARD_MEMBER_TYPE:["as","BOARD_MEMBER_TYPE"],ENT_MEMBER_ADDED_TO_BOARD:["USER_FILTER","is","added","to","a","board","_AS_BOARD_MEMBER_TYPE?","BY_USER_FILTER?"],MEMBER_ADDED_TO_TEAM:["USER_FILTER","is","added","to",(0,r.or)("ANY_TEAM","_NAMED_TEAM"),"BY_USER_FILTER?"],UNCONFIRMED_TEAM_INVITATION_ISSUED:["_AN?","unconfirmed","invitation","is","added","to",(0,r.or)("ANY_TEAM","_NAMED_TEAM"),"BY_USER_FILTER?"],_POWERUP:(0,r.or)("power-up","powerup"),POWERUP_NEGATIVE_MATCH:"not",_POWERUP_NAME_LIST:["$POWERUP_NAME",(0,r.optional)(["or","_POWERUP_NAME_LIST"])],POWERUP_FILTER:["POWERUP_NEGATIVE_MATCH?","named","_POWERUP_NAME_LIST"],POWERUP_ENABLED:"enabled",POWERUP_DISABLED:"disabled",POWERUP_ENABLED_STATE_CHANGED:["_A","_POWERUP","POWERUP_FILTER?","is",(0,r.or)("POWERUP_ENABLED","POWERUP_DISABLED"),"BY_USER_FILTER?"],_THE_BOARD:[(0,r.optional)("the"),"board"],MOVE_BOARD_TO_TEAM_ACTION:["move","_THE_BOARD","to","_TEAM","$TEAM_NAME"],ADD_BOARD_TO_COLLECTION_ACTION:["add","_THE_BOARD","to","collection","$COLLECTION_NAME"],CHANGE_BOARD_VISIBILITY_ACTION:["make","_THE_BOARD",(0,r.or)("VISIBILITY_PUBLIC","VISIBILITY_PRIVATE","VISIBILITY_TEAM")],ALLOW:"allow",DO_NOT_ALLOW:[(0,r.or)("don't",["do","not"]),"allow"],ALLOW_TEAM_MEMBERS_TO_JOIN_ACTION:[(0,r.or)("ALLOW","DO_NOT_ALLOW"),"_TEAM","members","to","join","_THE_BOARD?"],CLOSE_BOARD_ACTION:[(0,r.or)("close","archive"),"_THE_BOARD"],REOPEN_BOARD_ACTION:[(0,r.or)("reopen","unarchive"),"_THE_BOARD"],RESTRICT_TEAM_MEMBERSHIP_ACTION:["restrict","_TEAM","membership","to","users","in","domain","$DOMAIN"],TEAM_MEMBERS:["_TEAM","members"],TEAM_ADMINS:["_TEAM",(0,r.or)("administrators","admins")],NOBODY:["nobody"],ANYBODY:["anybody"],RESTRICT_TEAM_BOARD_CREATION_ACTION:["restrict","_BOARD_VISIBILITY","board","creation",(0,r.optional)(["for","the","_TEAM"]),"to",(0,r.or)("TEAM_MEMBERS","TEAM_ADMINS","NOBODY")],RESTRICT_TEAM_BOARD_INVITATIONS_ACTION:["allow",(0,r.or)([(0,r.optional)("only"),"TEAM_MEMBERS"],"ANYBODY"),"to","be","invited",(0,r.optional)(["to",(0,r.optional)("the"),"boards",(0,r.or)("in","inside"),"the","_TEAM"])],ENABLE_POWERUP:"enable",DISABLE_POWERUP:"disable",THE_POWERUP:["the","_POWERUP"],CHANGE_POWERUP_ENABLED_STATE_ACTION:[(0,r.or)("ENABLE_POWERUP","DISABLE_POWERUP"),(0,r.or)("THE_POWERUP",["_POWERUP","$POWERUP_NAME"])],SET_BOARD_MEMBER_TYPE_ACTION:["make","the",(0,r.or)("member","user"),"BOARD_MEMBER_TYPE",(0,r.optional)(["of","the","board"])],REMOVE_MEMBER_FROM_BOARD_ACTION:["remove","the",(0,r.or)("member","user"),"from","the","board"],REMOVE_MEMBER_FROM_TEAM_ACTION:["remove","the",(0,r.or)("member","user"),"from","the","_TEAM"],REMOVE_UNCONFIRMED_TEAM_INVITATIONS_ACTION:["remove","all","the","unconfirmed","invitations","from","the","_TEAM"],DELETE_TEAM_ACTION:["delete","the","_TEAM"],ENTERPRISE_WHEN:["when",(0,r.or)("BOARD_CREATED","BOARD_VISIBILITY_CHANGED","BOARD_REMOVED_FROM_TEAM","ENT_MEMBER_ADDED_TO_BOARD","MEMBER_ADDED_TO_TEAM","UNCONFIRMED_TEAM_INVITATION_ISSUED","POWERUP_ENABLED_STATE_CHANGED","TEAM_CREATED")],ENTERPRISE_TRIGGER:["ENTERPRISE_WHEN"],ENTERPRISE_ACTION:(0,r.or)("MOVE_BOARD_TO_TEAM_ACTION","ADD_BOARD_TO_COLLECTION_ACTION","CHANGE_BOARD_VISIBILITY_ACTION","ALLOW_TEAM_MEMBERS_TO_JOIN_ACTION","CLOSE_BOARD_ACTION","REOPEN_BOARD_ACTION","CHANGE_POWERUP_ENABLED_STATE_ACTION","SET_BOARD_MEMBER_TYPE_ACTION","REMOVE_MEMBER_FROM_BOARD_ACTION","REMOVE_MEMBER_FROM_TEAM_ACTION","REMOVE_UNCONFIRMED_TEAM_INVITATIONS_ACTION","RESTRICT_TEAM_MEMBERSHIP_ACTION","RESTRICT_TEAM_BOARD_CREATION_ACTION","RESTRICT_TEAM_BOARD_INVITATIONS_ACTION","DELETE_TEAM_ACTION"),_ENTERPRISE_ACTION_LIST:[(0,r.or)("ENTERPRISE_ACTION=>ACTION","ACTION"),(0,r.optional)(["_AND?","_ENTERPRISE_ACTION_LIST"])],_ENTERPRISE_TRIGGERED_COMMAND:[(0,r.or)("ENTERPRISE_TRIGGER","TRIGGER"),"_COMMA","_ENTERPRISE_ACTION_LIST"],_ENTERPRISE_IMMEDIATE_COMMAND:["_ENTERPRISE_ACTION_LIST"],ENTERPRISE_COMMAND:[(0,r.or)("_ENTERPRISE_TRIGGERED_COMMAND","_ENTERPRISE_IMMEDIATE_COMMAND"),(0,r.optional)("."),""]}),o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.correctParseResult=function(e,t,n){void 0===n&&(n=1);void 0===t&&(t=1);return e.corrections={corrected_errors:0,tokens:e.hint?e.hint.tokens:[],replaced_tokens:[],added_tokens:[]},function e(t,n,r){if(t.parse||t.halt_message||!n)return t;const o=function(e){return e.parse&&e.corrections.corrected_errors===t.corrections.corrected_errors+2},i=function(e,t){return e.parse?!t.parse||e.corrections.corrected_errorsn[a]?(++s,++a):(++i,++o,++a);for(;o{e.type=Object.keys(e)[0]});else if("TRIGGER"===e){const t=Object.keys(r[e])[0];r[e].type=t;const n=r[e][t];"object"==typeof n&&(n.type=Object.keys(n)[0])}return r}const r=Object.keys(t);(0,o.default)(1===r.length&&((0,i.isSymbol)(r[0])||(0,i.isStringVariable)(r[0])||(0,i.isVariableName)(r[0])||(0,i.isAtMention)(r[0])),"Expecting one symbol and only one symbol as key for object: "+JSON.stringify(t));const s=r[0];let c=e(t[s],s);if(a.DEBUG&&a.Logger.info("flatten object value",{left_symbol:n,parse_tree_key:t[s],value:c}),s===n||(0,i.isHiddenSymbol)(s))return c;const u={};return"string"==typeof c&&((0,i.isStringValue)(c)?c=c.slice(1,-1):(0,i.isAtMentionValue)(c)&&(c=c.slice(1))),u[s]=c,u}default:return(0,o.default)(!1,"Unexpected branch type: "+JSON.stringify(t)),!0}};const o=r(n(112)),a=n(107),i=n(75)},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=a)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),l(r,e,r.depth)}function c(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function u(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&y(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return g(o)||(o=l(e,o,r)),o}var a=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(m(t))return e.stylize(""+t,"number");if(f(t))return e.stylize(""+t,"boolean");if(p(t))return e.stylize("null","null")}(e,n);if(a)return a;var i=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(n)),v(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return d(n);if(0===i.length){if(y(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(E(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(A(n))return e.stylize(Date.prototype.toString.call(n),"date");if(v(n))return d(n)}var u,T="",O=!1,I=["{","}"];(_(n)&&(O=!0,I=["[","]"]),y(n))&&(T=" [Function"+(n.name?": "+n.name:"")+"]");return E(n)&&(T=" "+RegExp.prototype.toString.call(n)),A(n)&&(T=" "+Date.prototype.toUTCString.call(n)),v(n)&&(T=" "+d(n)),0!==i.length||O&&0!=n.length?r<0?E(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=O?function(e,t,n,r,o){for(var a=[],i=0,s=t.length;i=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,T,I)):I[0]+T+I[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,a){var i,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),D(r,o)||(i="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=p(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(i)){if(a&&o.match(/^\d+$/))return s;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+s}function _(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function p(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function E(e){return T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"==typeof e&&null!==e}function A(e){return T(e)&&"[object Date]"===O(e)}function v(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function y(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(a)&&(a=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!i[n])if(new RegExp("\\b"+n+"\\b","i").test(a)){var r=e.pid;i[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else i[n]=function(){};return i[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=_,t.isBoolean=f,t.isNull=p,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=E,t.isObject=T,t.isDate=A,t.isError=v,t.isFunction=y,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(162);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",N(),t.format.apply(t,arguments))},t.inherits=n(163),t._extend=function(e,t){if(!t||!T(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var w="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function S(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(w&&e[w]){var t;if("function"!=typeof(t=e[w]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,w,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],a=0;a(0,a.normalizeArray)(e).every((function(e){return"!"!==e[0]?-1!==r.indexOf(e):-1===r.indexOf(e.slice(1))}))?o(n,null,t):"_"}},t.time=function(){return{parse:(e,t,n)=>{const r=(0,i.parseTime)(e);return r||n(e,"a time, e.g. 8:30am")}}},t.numeric_date=function(){return{parse:(e,t,n)=>{const r=(0,i.parseNumericDate)(e);return r||n(e,"a date in numeric format, e.g. 07/29/2016")}}},t.year=function(){return{parse:(e,t,n)=>{const r=(0,i.parseYear)(e);return r||n(e,"a year, e.g. 2016")}}},t.timezone=function(){return{parse:(e,t,n)=>{const r=(0,i.parseTimezone)(e);return r||n(e,"a timezone (check out [this Trello card](https://trello.com/c/7Qd0SKIe/41-timezones) for examples)")}}},t.ordinal=function(e,t,n){return{parse:(r,o,a)=>{const s=(0,i.parseOrdinal)(r);return null===s?a(r,e||"an ordinal number, e.g. third"):"number"==typeof t&&sn?a(r,e||"a smaller ordinal number"):s}}},t.small_numeral=function(e,t,n,r){return{parse:(o,a,s)=>{const c=(0,i.parseSmallNumeral)(o,t);return null===c?s(o,e||"a number"):"number"==typeof n&&cr?s(o,e||"a number smaller than or equal to "+r):c}}},t.decimal=function(e,t,n,r){return{parse:(o,a,s)=>{const c=(0,i.parseDecimal)(o,t);return null===c?s(o,e||"a decimal number"):"number"==typeof n&&cr?s(o,e||"a number smaller than or equal to "+r):c}}},t.optional=function(e){return(0,o.default)(1===arguments.length),{parse:(t,n,r)=>{const o=t.slice(),a=n.slice(),s=(0,i.parser)(o,e,a,r);return null===s?"_":(t.splice(0,t.length-o.length),n.push(...a.slice(n.length)),s)}}},t.hidden=function(e){return(0,o.default)(1===arguments.length),{parse:(t,n,r)=>(0,i.parser)(t,e,n,(function(e){return r(e)}))}},t.or=function(...e){const t=[...e];return{parse:(e,n,r)=>{for(let o=0;o{for(let o=0;o{for(const o of t){const t=e.slice(),a=n.slice();if((0,i.parser)(t,o,a,r))return e.splice(0,e.length-t.length),n.push(...a.slice(n.length)),o}return null}}},t.swappable=function(e,t,n){return{parse:(r,a,s)=>{(0,o.default)(!("string"==typeof e&&(0,i.isOptional)(e)||"function"==typeof e.parse&&"optional"===e.parse.name),"Setting the first argument in a swappable as optional prevents the swap from being accepted.");let c=r.slice(),u=a.slice(),l=(0,i.parser)(c,e,u,s),d=n?(0,i.parser)(c,n,u,s):[],h=(0,i.parser)(c,t,u,s);return l&&h&&d?(r.splice(0,r.length-c.length),a.push(...u.slice(a.length)),[].concat(l,h,d)):(c=r.slice(),u=a.slice(),d=(0,i.parser)(c,t,u,s),h=n?(0,i.parser)(c,n,u,s):[],l=(0,i.parser)(c,e,u,s),d&&h&&l?(r.splice(0,r.length-c.length),a.push(...u.slice(a.length)),[].concat(d,h,l)):null)}}};const o=r(n(112)),a=n(131),i=n(75);t.make_sibling=()=>({parse:()=>"__⤣"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEnterpriseCommand=t.parseCondition=t.parseCommand=void 0;const r=n(75);t.parseCommand=(e,t)=>(0,r.parseTokens)((0,r.tokenize)(e),t);t.parseCondition=e=>(0,t.parseCommand)(e,"CONDITION_LIST");t.parseEnterpriseCommand=e=>(0,t.parseCommand)(e,"ENTERPRISE_COMMAND")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInlineDate=function(e,t={}){var n,o,a;const i=(0,r.tokenize)(e),s=(0,r.tokenize)((null==t?void 0:t.after)||"");for(let c=0;ci[c+t]!==e)){if(null==t?void 0:t.at_start)break;continue}const u=(0,r.parseTokens)(i.slice(c+s.length),(null==t?void 0:t.at_end)?"END_DATE_TIME":"INLINE_DATE_TIME");if(null==u?void 0:u.parse){const t=(0,r.tokenizeIndices)(e).slice(c,u.extra_tokens?-u.extra_tokens.length:void 0);return u.match={source_text:e,matched_text:e.slice(null===(n=t[0])||void 0===n?void 0:n.from,null===(o=t.slice(-1)[0])||void 0===o?void 0:o.to),match_pos:null===(a=t[0])||void 0===a?void 0:a.from},u}if(null==t?void 0:t.at_start)break}return{}};const r=n(75)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseOrdinal=function(e){const t=r[e[0]];if(!t)return null;return e.shift(),t},t.parseSmallNumeral=function(e,t=!1){let n=o[e[0]];if(void 0===n)try{if(n=parseInt(e[0]),Number.isNaN(n)||!e[0].match(/^[+-]?\d+$/))return null;if(n<0&&!t)return null}catch(e){return null}return e.shift(),n},t.parseDecimal=function(e,t=!1){let n;try{if(n=parseFloat(e[0]),Number.isNaN(n)||!e[0].match(/^[+-]?\d+(?:\.\d+)?$/))return null;if(n<0&&!t)return null}catch(e){return null}return e.shift(),n};const r={"1st":1,first:1,"2nd":2,second:2,"3rd":3,third:3,"4th":4,fourth:4,"5th":5,fifth:5,"6th":6,sixth:6,"7th":7,seventh:7,"8th":8,eighth:8,"9th":9,ninth:9,"10th":10,tenth:10,"11th":11,eleventh:11,"12th":12,twelfth:12,"13th":13,thirteenth:13,"14th":14,fourteenth:14,"15th":15,fifteenth:15,"16th":16,sixteenth:16,"17th":17,seventeenth:17,"18th":18,eighteenth:18,"19th":19,nineteenth:19,"20th":20,twentieth:20,"21st":21,"twenty-first":21,twentyfirst:21,"22nd":22,"twenty-second":22,twentysecond:22,"23rd":23,"twenty-third":23,twentythird:23,"24th":24,"twenty-fourth":24,twentyfourth:24,"25th":25,"twenty-fifth":25,twentyfifth:25,"26th":26,"twenty-sixth":26,twentysixth:26,"27th":27,"twenty-seventh":27,twentyseventh:27,"28th":28,"twenty-eighth":28,twentyeighth:28,"29th":29,"twenty-ninth":29,twentyninth:29,"30th":30,thirtieth:30,"31st":31,"thirty-first":31,thirtyfirst:31};const o={zero:0,one:1,a:1,an:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,"twenty-one":21,twentyone:21,"twenty-two":22,twentytwo:22,"twenty-three":23,twentythree:23,"twenty-four":24,twentyfour:24,"twenty-five":25,twentyfive:25,"twenty-six":26,twentysix:26,"twenty-seven":27,twentyseven:27,"twenty-eight":28,twentyeight:28,"twenty-nine":29,twentynine:29,thirty:30,sixty:60,ninety:90}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parser=function e(t,n,r,u){a.DEBUG&&a.Logger.info("parser",{numTokens:t.length,firstToken:t.length&&t[0],seen:s(r),rule:c(n)});switch(typeof n){case"string":{if((0,i.isEnd)(n))return t.length?u(t,null):n;if((0,i.isInlineEnd)(n))return n;if((0,i.isOptional)(n))return(0,i.optional)((0,i.getOptional)(n)).parse(t,r,u);if((0,i.isStringVariable)(n)){if(!t[0]||'"'!==t[0][0])return u(t,'quoted text, e.g. "Name"');const e={};return e[n]=t.shift(),e}if((0,i.isVariableName)(n)){if(!t[0]||!(0,i.isVariableNameValue)(t[0]))return u(t,"a variable name, e.g. {{name}}");const e={};return e[n.slice(1,-1)]=t.shift(),e}if((0,i.isAtMention)(n)){if(!t[0]||"@"!==t[0][0])return u(t,"a mention, e.g. @username");const e={};return e[n]=t.shift(),e}if((0,i.isTerminal)(n))return t[0]===n?t.shift():u(t,n);const l=function(e,t,n){const r=e.split(t);return n&&n1){const s=l[0],c=function(e,t,n){const r=e.split(t);return n&&n");if(2===h.length&&(0,i.isSymbol)(h[0])&&(0,i.isSymbol)(h[1])?(d=h[1],n=(0,i.getCommandGrammar)()[h[0]]):((0,o.default)((0,i.isSymbol)(n),"Not a symbol: "+n),d=n,n=(0,i.getCommandGrammar)()[d]),!n)return(0,o.default)(!1,`Symbol '${d}' not found.`),null;const _={};return _[d]=e(t,n,r,u),null===_[d]?(a.DEBUG&&a.Logger.info("-prune",{numTokens:t.length,firstToken:t.length&&t[0],seen:s(r),symbol:d,rule:c(n)}),null):(a.DEBUG&&a.Logger.info("+accept",{numTokens:t.length,firstToken:t.length&&t[0],seen:s(r),symbol:d,rule:c(n)}),r.push(d),_)}case"object":if(Array.isArray(n)){const o=t.slice(),a=r.slice(),i=[];for(let t=0;t1&&(t=o.default[`${e[0]}_${e[1]}`],t))return e.splice(0,2),t}return null}},function(e){e.exports=JSON.parse('{"british":"Europe/London","bst":"Europe/London","cest":"Europe/Brussels","mesz":"Europe/Brussels","cet":"Europe/Brussels","mez":"Europe/Brussels","eest":"Europe/Athens","oesz":"Europe/Athens","eet":"Europe/Athens","oez":"Europe/Athens","fet":"Europe/Minsk","gmt":"Europe/London","irish":"Europe/Dublin","ireland":"Europe/Dublin","msd":"Europe/Moscow","msk":"Europe/Moscow","samt":"Europe/Samara","west":"Europe/Lisbon","wet":"Europe/Lisbon","atlantic":"America/Halifax","at":"America/Halifax","adt":"America/Halifax","haa":"America/Halifax","ast":"America/Halifax","hna":"America/Halifax","alaska":"America/Anchorage","akdt":"America/Anchorage","akst":"America/Anchorage","central":"America/Chicago","ct":"America/Chicago","cdt":"America/Chicago","hac":"America/Chicago","cst":"America/Chicago","hnc":"America/Chicago","eastern":"America/New_York","et":"America/New_York","edt":"America/New_York","hae":"America/New_York","est":"America/New_York","hne":"America/New_York","hawaii":"America/Adak","hadt":"America/Adak","hast":"America/Adak","mountain":"America/Denver","mt":"America/Denver","mdt":"America/Denver","har":"America/Denver","mst":"America/Denver","hnr":"America/Denver","arizona":"America/Phoenix","ndt":"America/St_Johns","nst":"America/St_Johns","pacific":"America/Los_Angeles","pt":"America/Los_Angeles","pdt":"America/Los_Angeles","hap":"America/Los_Angeles","pst":"America/Los_Angeles","hnp":"America/Los_Angeles","pmdt":"America/Miquelon","pmst":"America/Miquelon","wgst":"America/Godthab","wgt":"America/Godthab","act":"Australia/Adelaide","acdt":"Australia/Adelaide","acst":"Australia/Adelaide","acwst":"Australia/Eucla","aet":"Australia/Sydney","aedt":"Australia/Sydney","aest":"Australia/Sydney","awdt":"Australia/Perth","awst":"Australia/Perth","lhdt":"Australia/Lord_Howe","lhst":"Australia/Lord_Howe","sast":"Africa/Johannesburg","africa/abidjan":"Africa/Abidjan","abidjan":"Africa/Abidjan","africa/accra":"Africa/Accra","accra":"Africa/Accra","africa/algiers":"Africa/Algiers","algiers":"Africa/Algiers","africa/bissau":"Africa/Bissau","bissau":"Africa/Bissau","africa/cairo":"Africa/Cairo","cairo":"Africa/Cairo","africa/casablanca":"Africa/Casablanca","casablanca":"Africa/Casablanca","africa/ceuta":"Africa/Ceuta","ceuta":"Africa/Ceuta","africa/el_aaiun":"Africa/El_Aaiun","el_aaiun":"Africa/El_Aaiun","africa/johannesburg":"Africa/Johannesburg","johannesburg":"Africa/Johannesburg","africa/khartoum":"Africa/Khartoum","khartoum":"Africa/Khartoum","africa/lagos":"Africa/Lagos","lagos":"Africa/Lagos","africa/maputo":"Africa/Maputo","maputo":"Africa/Maputo","africa/monrovia":"Africa/Monrovia","monrovia":"Africa/Monrovia","africa/nairobi":"Africa/Nairobi","nairobi":"Africa/Nairobi","africa/ndjamena":"Africa/Ndjamena","ndjamena":"Africa/Ndjamena","africa/tripoli":"Africa/Tripoli","tripoli":"Africa/Tripoli","africa/tunis":"Africa/Tunis","tunis":"Africa/Tunis","africa/windhoek":"Africa/Windhoek","windhoek":"Africa/Windhoek","america/adak":"America/Adak","adak":"America/Adak","america/anchorage":"America/Anchorage","anchorage":"America/Anchorage","america/araguaina":"America/Araguaina","araguaina":"America/Araguaina","america/argentina/buenos_aires":"America/Argentina/Buenos_Aires","buenos_aires":"America/Argentina/Buenos_Aires","america/argentina/catamarca":"America/Argentina/Catamarca","catamarca":"America/Argentina/Catamarca","america/argentina/cordoba":"America/Argentina/Cordoba","cordoba":"America/Argentina/Cordoba","america/argentina/jujuy":"America/Argentina/Jujuy","jujuy":"America/Argentina/Jujuy","america/argentina/la_rioja":"America/Argentina/La_Rioja","la_rioja":"America/Argentina/La_Rioja","america/argentina/mendoza":"America/Argentina/Mendoza","mendoza":"America/Argentina/Mendoza","america/argentina/rio_gallegos":"America/Argentina/Rio_Gallegos","rio_gallegos":"America/Argentina/Rio_Gallegos","america/argentina/salta":"America/Argentina/Salta","salta":"America/Argentina/Salta","america/argentina/san_juan":"America/Argentina/San_Juan","san_juan":"America/Argentina/San_Juan","america/argentina/san_luis":"America/Argentina/San_Luis","san_luis":"America/Argentina/San_Luis","america/argentina/tucuman":"America/Argentina/Tucuman","tucuman":"America/Argentina/Tucuman","america/argentina/ushuaia":"America/Argentina/Ushuaia","ushuaia":"America/Argentina/Ushuaia","america/asuncion":"America/Asuncion","asuncion":"America/Asuncion","america/atikokan":"America/Atikokan","atikokan":"America/Atikokan","america/bahia":"America/Bahia","bahia":"America/Bahia","america/bahia_banderas":"America/Bahia_Banderas","bahia_banderas":"America/Bahia_Banderas","america/barbados":"America/Barbados","barbados":"America/Barbados","america/belem":"America/Belem","belem":"America/Belem","america/belize":"America/Belize","belize":"America/Belize","america/blanc-sablon":"America/Blanc-Sablon","blanc-sablon":"America/Blanc-Sablon","america/boa_vista":"America/Boa_Vista","boa_vista":"America/Boa_Vista","america/bogota":"America/Bogota","bogota":"America/Bogota","america/boise":"America/Boise","boise":"America/Boise","america/cambridge_bay":"America/Cambridge_Bay","cambridge_bay":"America/Cambridge_Bay","america/campo_grande":"America/Campo_Grande","campo_grande":"America/Campo_Grande","america/cancun":"America/Cancun","cancun":"America/Cancun","america/caracas":"America/Caracas","caracas":"America/Caracas","america/cayenne":"America/Cayenne","cayenne":"America/Cayenne","america/chicago":"America/Chicago","chicago":"America/Chicago","america/chihuahua":"America/Chihuahua","chihuahua":"America/Chihuahua","america/costa_rica":"America/Costa_Rica","costa_rica":"America/Costa_Rica","america/creston":"America/Creston","creston":"America/Creston","america/cuiaba":"America/Cuiaba","cuiaba":"America/Cuiaba","america/curacao":"America/Curacao","curacao":"America/Curacao","america/danmarkshavn":"America/Danmarkshavn","danmarkshavn":"America/Danmarkshavn","america/dawson":"America/Dawson","dawson":"America/Dawson","america/dawson_creek":"America/Dawson_Creek","dawson_creek":"America/Dawson_Creek","america/denver":"America/Denver","denver":"America/Denver","america/detroit":"America/Detroit","detroit":"America/Detroit","america/edmonton":"America/Edmonton","edmonton":"America/Edmonton","america/eirunepe":"America/Eirunepe","eirunepe":"America/Eirunepe","america/el_salvador":"America/El_Salvador","el_salvador":"America/El_Salvador","america/fort_nelson":"America/Fort_Nelson","fort_nelson":"America/Fort_Nelson","america/fortaleza":"America/Fortaleza","fortaleza":"America/Fortaleza","america/glace_bay":"America/Glace_Bay","glace_bay":"America/Glace_Bay","america/godthab":"America/Godthab","godthab":"America/Godthab","america/goose_bay":"America/Goose_Bay","goose_bay":"America/Goose_Bay","america/grand_turk":"America/Grand_Turk","grand_turk":"America/Grand_Turk","america/guatemala":"America/Guatemala","guatemala":"America/Guatemala","america/guayaquil":"America/Guayaquil","guayaquil":"America/Guayaquil","america/guyana":"America/Guyana","guyana":"America/Guyana","america/halifax":"America/Halifax","halifax":"America/Halifax","america/havana":"America/Havana","havana":"America/Havana","america/hermosillo":"America/Hermosillo","hermosillo":"America/Hermosillo","america/indiana/indianapolis":"America/Indiana/Indianapolis","indianapolis":"America/Indiana/Indianapolis","america/indiana/knox":"America/Indiana/Knox","knox":"America/Indiana/Knox","america/indiana/marengo":"America/Indiana/Marengo","marengo":"America/Indiana/Marengo","america/indiana/petersburg":"America/Indiana/Petersburg","petersburg":"America/Indiana/Petersburg","america/indiana/tell_city":"America/Indiana/Tell_City","tell_city":"America/Indiana/Tell_City","america/indiana/vevay":"America/Indiana/Vevay","vevay":"America/Indiana/Vevay","america/indiana/vincennes":"America/Indiana/Vincennes","vincennes":"America/Indiana/Vincennes","america/indiana/winamac":"America/Indiana/Winamac","winamac":"America/Indiana/Winamac","america/inuvik":"America/Inuvik","inuvik":"America/Inuvik","america/iqaluit":"America/Iqaluit","iqaluit":"America/Iqaluit","america/jamaica":"America/Jamaica","jamaica":"America/Jamaica","america/juneau":"America/Juneau","juneau":"America/Juneau","america/kentucky/louisville":"America/Kentucky/Louisville","louisville":"America/Kentucky/Louisville","america/kentucky/monticello":"America/Kentucky/Monticello","monticello":"America/Kentucky/Monticello","america/la_paz":"America/La_Paz","la_paz":"America/La_Paz","america/lima":"America/Lima","lima":"America/Lima","america/los_angeles":"America/Los_Angeles","los_angeles":"America/Los_Angeles","america/maceio":"America/Maceio","maceio":"America/Maceio","america/managua":"America/Managua","managua":"America/Managua","america/manaus":"America/Manaus","manaus":"America/Manaus","america/martinique":"America/Martinique","martinique":"America/Martinique","america/matamoros":"America/Matamoros","matamoros":"America/Matamoros","america/mazatlan":"America/Mazatlan","mazatlan":"America/Mazatlan","america/menominee":"America/Menominee","menominee":"America/Menominee","america/merida":"America/Merida","merida":"America/Merida","america/metlakatla":"America/Metlakatla","metlakatla":"America/Metlakatla","america/mexico_city":"America/Mexico_City","mexico_city":"America/Mexico_City","america/miquelon":"America/Miquelon","miquelon":"America/Miquelon","america/moncton":"America/Moncton","moncton":"America/Moncton","america/monterrey":"America/Monterrey","monterrey":"America/Monterrey","america/montevideo":"America/Montevideo","montevideo":"America/Montevideo","america/nassau":"America/Nassau","nassau":"America/Nassau","america/new_york":"America/New_York","new_york":"America/New_York","america/nipigon":"America/Nipigon","nipigon":"America/Nipigon","america/nome":"America/Nome","nome":"America/Nome","america/noronha":"America/Noronha","noronha":"America/Noronha","america/north_dakota/beulah":"America/North_Dakota/Beulah","beulah":"America/North_Dakota/Beulah","america/north_dakota/center":"America/North_Dakota/Center","center":"America/North_Dakota/Center","america/north_dakota/new_salem":"America/North_Dakota/New_Salem","new_salem":"America/North_Dakota/New_Salem","america/ojinaga":"America/Ojinaga","ojinaga":"America/Ojinaga","america/panama":"America/Panama","panama":"America/Panama","america/pangnirtung":"America/Pangnirtung","pangnirtung":"America/Pangnirtung","america/paramaribo":"America/Paramaribo","paramaribo":"America/Paramaribo","america/phoenix":"America/Phoenix","phoenix":"America/Phoenix","america/port-au-prince":"America/Port-au-Prince","port-au-prince":"America/Port-au-Prince","america/port_of_spain":"America/Port_of_Spain","port_of_spain":"America/Port_of_Spain","america/porto_velho":"America/Porto_Velho","porto_velho":"America/Porto_Velho","america/puerto_rico":"America/Puerto_Rico","puerto_rico":"America/Puerto_Rico","america/rainy_river":"America/Rainy_River","rainy_river":"America/Rainy_River","america/rankin_inlet":"America/Rankin_Inlet","rankin_inlet":"America/Rankin_Inlet","america/recife":"America/Recife","recife":"America/Recife","america/regina":"America/Regina","regina":"America/Regina","america/resolute":"America/Resolute","resolute":"America/Resolute","america/rio_branco":"America/Rio_Branco","rio_branco":"America/Rio_Branco","america/santarem":"America/Santarem","santarem":"America/Santarem","america/santiago":"America/Santiago","santiago":"America/Santiago","america/santo_domingo":"America/Santo_Domingo","santo_domingo":"America/Santo_Domingo","america/sao_paulo":"America/Sao_Paulo","sao_paulo":"America/Sao_Paulo","america/scoresbysund":"America/Scoresbysund","scoresbysund":"America/Scoresbysund","america/sitka":"America/Sitka","sitka":"America/Sitka","america/st_johns":"America/St_Johns","st_johns":"America/St_Johns","america/swift_current":"America/Swift_Current","swift_current":"America/Swift_Current","america/tegucigalpa":"America/Tegucigalpa","tegucigalpa":"America/Tegucigalpa","america/thule":"America/Thule","thule":"America/Thule","america/thunder_bay":"America/Thunder_Bay","thunder_bay":"America/Thunder_Bay","america/tijuana":"America/Tijuana","tijuana":"America/Tijuana","america/toronto":"America/Toronto","toronto":"America/Toronto","america/vancouver":"America/Vancouver","vancouver":"America/Vancouver","america/whitehorse":"America/Whitehorse","whitehorse":"America/Whitehorse","america/winnipeg":"America/Winnipeg","winnipeg":"America/Winnipeg","america/yakutat":"America/Yakutat","yakutat":"America/Yakutat","america/yellowknife":"America/Yellowknife","yellowknife":"America/Yellowknife","antarctica/casey":"Antarctica/Casey","casey":"Antarctica/Casey","antarctica/davis":"Antarctica/Davis","davis":"Antarctica/Davis","antarctica/dumontdurville":"Antarctica/DumontDUrville","dumontdurville":"Antarctica/DumontDUrville","antarctica/macquarie":"Antarctica/Macquarie","macquarie":"Antarctica/Macquarie","antarctica/mawson":"Antarctica/Mawson","mawson":"Antarctica/Mawson","antarctica/palmer":"Antarctica/Palmer","palmer":"Antarctica/Palmer","antarctica/rothera":"Antarctica/Rothera","rothera":"Antarctica/Rothera","antarctica/syowa":"Antarctica/Syowa","syowa":"Antarctica/Syowa","antarctica/troll":"Antarctica/Troll","troll":"Antarctica/Troll","antarctica/vostok":"Antarctica/Vostok","vostok":"Antarctica/Vostok","asia/almaty":"Asia/Almaty","almaty":"Asia/Almaty","asia/amman":"Asia/Amman","amman":"Asia/Amman","asia/anadyr":"Asia/Anadyr","anadyr":"Asia/Anadyr","asia/aqtau":"Asia/Aqtau","aqtau":"Asia/Aqtau","asia/aqtobe":"Asia/Aqtobe","aqtobe":"Asia/Aqtobe","asia/ashgabat":"Asia/Ashgabat","ashgabat":"Asia/Ashgabat","asia/baghdad":"Asia/Baghdad","baghdad":"Asia/Baghdad","asia/baku":"Asia/Baku","baku":"Asia/Baku","asia/bangkok":"Asia/Bangkok","bangkok":"Asia/Bangkok","asia/barnaul":"Asia/Barnaul","barnaul":"Asia/Barnaul","asia/beirut":"Asia/Beirut","beirut":"Asia/Beirut","asia/bishkek":"Asia/Bishkek","bishkek":"Asia/Bishkek","asia/brunei":"Asia/Brunei","brunei":"Asia/Brunei","asia/chita":"Asia/Chita","chita":"Asia/Chita","asia/choibalsan":"Asia/Choibalsan","choibalsan":"Asia/Choibalsan","asia/colombo":"Asia/Colombo","colombo":"Asia/Colombo","asia/damascus":"Asia/Damascus","damascus":"Asia/Damascus","asia/dhaka":"Asia/Dhaka","dhaka":"Asia/Dhaka","asia/dili":"Asia/Dili","dili":"Asia/Dili","asia/dubai":"Asia/Dubai","dubai":"Asia/Dubai","asia/dushanbe":"Asia/Dushanbe","dushanbe":"Asia/Dushanbe","asia/gaza":"Asia/Gaza","gaza":"Asia/Gaza","asia/hebron":"Asia/Hebron","hebron":"Asia/Hebron","asia/ho_chi_minh":"Asia/Ho_Chi_Minh","ho_chi_minh":"Asia/Ho_Chi_Minh","asia/hong_kong":"Asia/Hong_Kong","hong_kong":"Asia/Hong_Kong","hkt":"Asia/Hong_Kong","asia/hovd":"Asia/Hovd","hovd":"Asia/Hovd","asia/irkutsk":"Asia/Irkutsk","irkutsk":"Asia/Irkutsk","asia/jakarta":"Asia/Jakarta","jakarta":"Asia/Jakarta","asia/jayapura":"Asia/Jayapura","jayapura":"Asia/Jayapura","asia/jerusalem":"Asia/Jerusalem","jerusalem":"Asia/Jerusalem","asia/kabul":"Asia/Kabul","kabul":"Asia/Kabul","asia/kamchatka":"Asia/Kamchatka","kamchatka":"Asia/Kamchatka","asia/karachi":"Asia/Karachi","karachi":"Asia/Karachi","asia/kathmandu":"Asia/Kathmandu","kathmandu":"Asia/Kathmandu","asia/khandyga":"Asia/Khandyga","khandyga":"Asia/Khandyga","asia/kolkata":"Asia/Kolkata","kolkata":"Asia/Kolkata","india":"Asia/Kolkata","ist":"Asia/Kolkata","asia/krasnoyarsk":"Asia/Krasnoyarsk","krasnoyarsk":"Asia/Krasnoyarsk","asia/kuala_lumpur":"Asia/Kuala_Lumpur","kuala_lumpur":"Asia/Kuala_Lumpur","asia/kuching":"Asia/Kuching","kuching":"Asia/Kuching","asia/macau":"Asia/Macau","macau":"Asia/Macau","asia/magadan":"Asia/Magadan","magadan":"Asia/Magadan","asia/makassar":"Asia/Makassar","makassar":"Asia/Makassar","asia/manila":"Asia/Manila","manila":"Asia/Manila","asia/nicosia":"Asia/Nicosia","nicosia":"Asia/Nicosia","asia/novokuznetsk":"Asia/Novokuznetsk","novokuznetsk":"Asia/Novokuznetsk","asia/novosibirsk":"Asia/Novosibirsk","novosibirsk":"Asia/Novosibirsk","asia/omsk":"Asia/Omsk","omsk":"Asia/Omsk","asia/oral":"Asia/Oral","oral":"Asia/Oral","asia/pontianak":"Asia/Pontianak","pontianak":"Asia/Pontianak","asia/pyongyang":"Asia/Pyongyang","pyongyang":"Asia/Pyongyang","asia/qatar":"Asia/Qatar","qatar":"Asia/Qatar","asia/qyzylorda":"Asia/Qyzylorda","qyzylorda":"Asia/Qyzylorda","asia/rangoon":"Asia/Rangoon","rangoon":"Asia/Rangoon","asia/riyadh":"Asia/Riyadh","riyadh":"Asia/Riyadh","asia/sakhalin":"Asia/Sakhalin","sakhalin":"Asia/Sakhalin","asia/samarkand":"Asia/Samarkand","samarkand":"Asia/Samarkand","asia/seoul":"Asia/Seoul","seoul":"Asia/Seoul","asia/shanghai":"Asia/Shanghai","shanghai":"Asia/Shanghai","asia/singapore":"Asia/Singapore","singapore":"Asia/Singapore","asia/srednekolymsk":"Asia/Srednekolymsk","srednekolymsk":"Asia/Srednekolymsk","asia/taipei":"Asia/Taipei","taipei":"Asia/Taipei","asia/tashkent":"Asia/Tashkent","tashkent":"Asia/Tashkent","asia/tbilisi":"Asia/Tbilisi","tbilisi":"Asia/Tbilisi","asia/tehran":"Asia/Tehran","tehran":"Asia/Tehran","asia/thimphu":"Asia/Thimphu","thimphu":"Asia/Thimphu","asia/tokyo":"Asia/Tokyo","tokyo":"Asia/Tokyo","asia/ulaanbaatar":"Asia/Ulaanbaatar","ulaanbaatar":"Asia/Ulaanbaatar","asia/urumqi":"Asia/Urumqi","urumqi":"Asia/Urumqi","asia/ust-nera":"Asia/Ust-Nera","ust-nera":"Asia/Ust-Nera","asia/vladivostok":"Asia/Vladivostok","vladivostok":"Asia/Vladivostok","asia/yakutsk":"Asia/Yakutsk","yakutsk":"Asia/Yakutsk","asia/yekaterinburg":"Asia/Yekaterinburg","yekaterinburg":"Asia/Yekaterinburg","asia/yerevan":"Asia/Yerevan","yerevan":"Asia/Yerevan","atlantic/azores":"Atlantic/Azores","azores":"Atlantic/Azores","atlantic/bermuda":"Atlantic/Bermuda","bermuda":"Atlantic/Bermuda","atlantic/canary":"Atlantic/Canary","canary":"Atlantic/Canary","atlantic/cape_verde":"Atlantic/Cape_Verde","cape_verde":"Atlantic/Cape_Verde","atlantic/faroe":"Atlantic/Faroe","faroe":"Atlantic/Faroe","atlantic/madeira":"Atlantic/Madeira","madeira":"Atlantic/Madeira","atlantic/reykjavik":"Atlantic/Reykjavik","reykjavik":"Atlantic/Reykjavik","atlantic/south_georgia":"Atlantic/South_Georgia","south_georgia":"Atlantic/South_Georgia","atlantic/stanley":"Atlantic/Stanley","stanley":"Atlantic/Stanley","australia/adelaide":"Australia/Adelaide","adelaide":"Australia/Adelaide","australia/brisbane":"Australia/Brisbane","brisbane":"Australia/Brisbane","australia/broken_hill":"Australia/Broken_Hill","broken_hill":"Australia/Broken_Hill","australia/currie":"Australia/Currie","currie":"Australia/Currie","australia/darwin":"Australia/Darwin","darwin":"Australia/Darwin","australia/eucla":"Australia/Eucla","eucla":"Australia/Eucla","australia/hobart":"Australia/Hobart","hobart":"Australia/Hobart","australia/lindeman":"Australia/Lindeman","lindeman":"Australia/Lindeman","australia/lord_howe":"Australia/Lord_Howe","lord_howe":"Australia/Lord_Howe","australia/melbourne":"Australia/Melbourne","melbourne":"Australia/Melbourne","australia/perth":"Australia/Perth","perth":"Australia/Perth","australia/sydney":"Australia/Sydney","sydney":"Australia/Sydney","europe/amsterdam":"Europe/Amsterdam","amsterdam":"Europe/Amsterdam","europe/andorra":"Europe/Andorra","andorra":"Europe/Andorra","europe/astrakhan":"Europe/Astrakhan","astrakhan":"Europe/Astrakhan","europe/athens":"Europe/Athens","athens":"Europe/Athens","europe/belgrade":"Europe/Belgrade","belgrade":"Europe/Belgrade","europe/berlin":"Europe/Berlin","berlin":"Europe/Berlin","europe/brussels":"Europe/Brussels","brussels":"Europe/Brussels","europe/bucharest":"Europe/Bucharest","bucharest":"Europe/Bucharest","europe/budapest":"Europe/Budapest","budapest":"Europe/Budapest","europe/chisinau":"Europe/Chisinau","chisinau":"Europe/Chisinau","europe/copenhagen":"Europe/Copenhagen","copenhagen":"Europe/Copenhagen","europe/dublin":"Europe/Dublin","dublin":"Europe/Dublin","europe/gibraltar":"Europe/Gibraltar","gibraltar":"Europe/Gibraltar","europe/helsinki":"Europe/Helsinki","helsinki":"Europe/Helsinki","europe/istanbul":"Europe/Istanbul","istanbul":"Europe/Istanbul","europe/kaliningrad":"Europe/Kaliningrad","kaliningrad":"Europe/Kaliningrad","europe/kiev":"Europe/Kiev","kiev":"Europe/Kiev","europe/lisbon":"Europe/Lisbon","lisbon":"Europe/Lisbon","europe/london":"Europe/London","london":"Europe/London","europe/luxembourg":"Europe/Luxembourg","luxembourg":"Europe/Luxembourg","europe/madrid":"Europe/Madrid","madrid":"Europe/Madrid","europe/malta":"Europe/Malta","malta":"Europe/Malta","europe/minsk":"Europe/Minsk","minsk":"Europe/Minsk","europe/monaco":"Europe/Monaco","monaco":"Europe/Monaco","europe/moscow":"Europe/Moscow","moscow":"Europe/Moscow","europe/oslo":"Europe/Oslo","oslo":"Europe/Oslo","europe/paris":"Europe/Paris","paris":"Europe/Paris","europe/prague":"Europe/Prague","prague":"Europe/Prague","europe/riga":"Europe/Riga","riga":"Europe/Riga","europe/rome":"Europe/Rome","rome":"Europe/Rome","europe/samara":"Europe/Samara","samara":"Europe/Samara","europe/simferopol":"Europe/Simferopol","simferopol":"Europe/Simferopol","europe/sofia":"Europe/Sofia","sofia":"Europe/Sofia","europe/stockholm":"Europe/Stockholm","stockholm":"Europe/Stockholm","europe/tallinn":"Europe/Tallinn","tallinn":"Europe/Tallinn","europe/tirane":"Europe/Tirane","tirane":"Europe/Tirane","europe/ulyanovsk":"Europe/Ulyanovsk","ulyanovsk":"Europe/Ulyanovsk","europe/uzhgorod":"Europe/Uzhgorod","uzhgorod":"Europe/Uzhgorod","europe/vienna":"Europe/Vienna","vienna":"Europe/Vienna","europe/vilnius":"Europe/Vilnius","vilnius":"Europe/Vilnius","europe/volgograd":"Europe/Volgograd","volgograd":"Europe/Volgograd","europe/warsaw":"Europe/Warsaw","warsaw":"Europe/Warsaw","europe/zaporozhye":"Europe/Zaporozhye","zaporozhye":"Europe/Zaporozhye","europe/zurich":"Europe/Zurich","zurich":"Europe/Zurich","indian/chagos":"Indian/Chagos","chagos":"Indian/Chagos","indian/christmas":"Indian/Christmas","christmas":"Indian/Christmas","indian/cocos":"Indian/Cocos","cocos":"Indian/Cocos","indian/kerguelen":"Indian/Kerguelen","kerguelen":"Indian/Kerguelen","indian/mahe":"Indian/Mahe","mahe":"Indian/Mahe","indian/maldives":"Indian/Maldives","maldives":"Indian/Maldives","indian/mauritius":"Indian/Mauritius","mauritius":"Indian/Mauritius","indian/reunion":"Indian/Reunion","reunion":"Indian/Reunion","pacific/apia":"Pacific/Apia","apia":"Pacific/Apia","pacific/auckland":"Pacific/Auckland","auckland":"Pacific/Auckland","pacific/bougainville":"Pacific/Bougainville","bougainville":"Pacific/Bougainville","pacific/chatham":"Pacific/Chatham","chatham":"Pacific/Chatham","pacific/chuuk":"Pacific/Chuuk","chuuk":"Pacific/Chuuk","pacific/easter":"Pacific/Easter","easter":"Pacific/Easter","pacific/efate":"Pacific/Efate","efate":"Pacific/Efate","pacific/enderbury":"Pacific/Enderbury","enderbury":"Pacific/Enderbury","pacific/fakaofo":"Pacific/Fakaofo","fakaofo":"Pacific/Fakaofo","pacific/fiji":"Pacific/Fiji","fiji":"Pacific/Fiji","pacific/funafuti":"Pacific/Funafuti","funafuti":"Pacific/Funafuti","pacific/galapagos":"Pacific/Galapagos","galapagos":"Pacific/Galapagos","pacific/gambier":"Pacific/Gambier","gambier":"Pacific/Gambier","pacific/guadalcanal":"Pacific/Guadalcanal","guadalcanal":"Pacific/Guadalcanal","pacific/guam":"Pacific/Guam","guam":"Pacific/Guam","pacific/honolulu":"Pacific/Honolulu","honolulu":"Pacific/Honolulu","pacific/kiritimati":"Pacific/Kiritimati","kiritimati":"Pacific/Kiritimati","pacific/kosrae":"Pacific/Kosrae","kosrae":"Pacific/Kosrae","pacific/kwajalein":"Pacific/Kwajalein","kwajalein":"Pacific/Kwajalein","pacific/majuro":"Pacific/Majuro","majuro":"Pacific/Majuro","pacific/marquesas":"Pacific/Marquesas","marquesas":"Pacific/Marquesas","pacific/nauru":"Pacific/Nauru","nauru":"Pacific/Nauru","pacific/niue":"Pacific/Niue","niue":"Pacific/Niue","pacific/norfolk":"Pacific/Norfolk","norfolk":"Pacific/Norfolk","pacific/noumea":"Pacific/Noumea","noumea":"Pacific/Noumea","pacific/pago_pago":"Pacific/Pago_Pago","pago_pago":"Pacific/Pago_Pago","pacific/palau":"Pacific/Palau","palau":"Pacific/Palau","pacific/pitcairn":"Pacific/Pitcairn","pitcairn":"Pacific/Pitcairn","pacific/pohnpei":"Pacific/Pohnpei","pohnpei":"Pacific/Pohnpei","pacific/port_moresby":"Pacific/Port_Moresby","port_moresby":"Pacific/Port_Moresby","pacific/rarotonga":"Pacific/Rarotonga","rarotonga":"Pacific/Rarotonga","pacific/tahiti":"Pacific/Tahiti","tahiti":"Pacific/Tahiti","pacific/tarawa":"Pacific/Tarawa","tarawa":"Pacific/Tarawa","pacific/tongatapu":"Pacific/Tongatapu","tongatapu":"Pacific/Tongatapu","pacific/wake":"Pacific/Wake","wake":"Pacific/Wake","pacific/wallis":"Pacific/Wallis","wallis":"Pacific/Wallis","utc":"Etc/UTC","universal":"Etc/UTC","etc/utc":"Etc/UTC"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTokens=function(e,t="COMMAND"){const n={tokens_left:1/0,expecting:[],halt_message:void 0},a=(0,o.parser)(e,t,[],(function(e,t,o){return r.DEBUG&&(o?r.Logger.info("!halt",{numTokens:e.length,message:o}):r.Logger.info("!stall",{numTokens:e.length,expecting:t})),e.length");return 2===t.length&&s(t[0])&&s(t[1])}(e)||r(e)||o(e)||a(e))}function s(e){return null!=e.match(/^[A-Z_]+\??$/)}Object.defineProperty(t,"__esModule",{value:!0}),t.isEnd=function(e){return""===e},t.isInlineEnd=function(e){return""===e},t.isStringVariable=r,t.isVariableName=o,t.isAtMention=a,t.isTerminal=i,t.isOptional=function(e){return!i(e)&&"?"===e.slice(-1)},t.getOptional=function(e){return e.slice(0,-1)},t.isSymbol=s,t.isHiddenSymbol=function(e){return s(e)&&"_"===e[0]},t.isStringValue=function(e){return'"'===e[0]&&'"'===e[e.length-1]},t.isAtMentionValue=function(e){return null!=e.match(/^@.*$/)},t.isVariableNameValue=function(e){return null!=e.match(/^{{[#%]?[a-zA-Z0-9_+-]+}}$|^{\$?[a-zA-Z0-9_+-]+}$/)},t.isAtMentionVariableValue=function(e){return null!=e.match(/^@{.*}$/)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokenize=function(e){if(!e)return[];return e.replace(/\\"/g,"__QUOTE__").replace(/\.(\d)/g,"__DECIMAL__$1").split(/["“”]/).map((e,t)=>t%2?[`"${e}"`]:a(e,",",".","(",")").map(e=>e.split(/\s/).filter(Boolean).map(e=>(0,r.isVariableNameValue)(e)||(0,r.isAtMentionVariableValue)(e)?e:e.toLowerCase())).reduce(o,[])).reduce(o,[]).map(e=>e.replace(/__QUOTE__/gi,'"').replace(/__DECIMAL__/gi,"."))},t.tokenizeIndices=function(e){let t=0;return e.replace(/\\"/g,"__").replace(/\.(\d)/g,"_$1").split(/["“”]/).map((e,n)=>n%2?{from:t,to:t+=e.length+2}:a(e,",",".","(",")").map(e=>e.split(/\s/).map((e,n,r)=>{const o=t;return t+=e.length+(n!==r.length-1?1:0),e.length?{from:o,to:o+e.length}:null}).filter(Boolean)).reduce(o,[])).reduce(o,[])};const r=n(75),o=(e,t)=>e.concat(t);function a(e,...t){let n=[e];return t.forEach(e=>{n=Array.prototype.concat.apply([],n.map(t=>t.split(e).reduce((n,r,o)=>(o&&n.push(e),t.length&&n.push(r),n),[])))}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalizationKeysForCommand=s,t.localizeCommandToButlerEnglish=function(e){const{actions:t,trigger:n}=s(e),o=function(e){const t=e.map(e=>(0,r.localize)(e));return t.length>1?t.slice(0,-1).join(",\n")+(t[t.length-2].match(/^for each /)?",\n":",\nand ")+t.slice(-1)[0]:t[0]}(t);if(n)return`${(0,r.localize)(n)},\n${o}`;return o};const r=n(175),o=n(178),a=n(181);function i(e){return"string"==typeof e?e.replace(/"/g,'\\"'):Array.isArray(e)?e.map(i):e&&"object"==typeof e?Object.keys(e).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:i(e[n])}),{}):e}function s(e){const{ACTION:t,TRIGGER:n}=(({TRIGGER:e,ACTION:t})=>({TRIGGER:i(e),ACTION:i(t)}))(e),r={actions:t.map(o.getLocalizationKeysForAction)};return n&&(r.trigger=(0,a.getLocalizationKeysForTrigger)(n)),r}},function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oe,"*DATE":({month:e,day:t=1,year:n})=>{let r=`${a.default.months[e]} ${t}`;return n&&(r+=", "+n),r},"*MONTH":e=>a.default.months[e],"*ORDINAL":e=>{const t=e%100;switch(t<20?t:t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd";case void 0:return;default:return e+"th"}},"*STICKER":e=>a.default.stickers[e],"*TIME":({HOUR:e,MINUTES:t,AM:n,PM:r})=>{let o=String(e);if(void 0!==t){let e=String(t);e.length<2&&(e="0"+e),o+=":"+e}return(n||r)&&(o+=" "+(n||r||"").toUpperCase()),o},"*WEEKDAY":e=>a.default.weekdays[e],"*COUNT":({key:e,COUNT:t})=>{if(t&&t>1){return`${t} ${u(""+e)}`}return u(e+"_singular")}},c=new Set(["verb_custom_field_to_value_action","due in between days","due in comparison days"]);function u(e,t){let n=i.default[e];if(!n)throw new Error(e+" not found in translations");if(t)for(const[e,r]of Object.entries(t))n=n.replace(`{${e}}`,r);return n}function l(e){var{key:t}=e,n=r(e,["key"]);const o=Object.entries(n).reduce((e,[t,n])=>{const r=function e(t,n){var r;if(Array.isArray(n))return n.map(n=>e(t,n)).join(" and ");if(t.startsWith("*")&&void 0!==n)return null===(r=s[t])||void 0===r?void 0:r.call(s,n);switch(typeof n){case"number":return String(n);case"string":if(t.startsWith("$"))return n;if(t.startsWith("@"))return"@"+n;if(!u(n))throw new Error("Could not localize "+n);return n;case"object":return l(n);default:return}}(t,n);return r&&(e[t]=r),e},{});return u(t,o)}t.localize=e=>function(e,t){const n=t.replace(/("[^"]+")/g,"").match(/{[^{}]+}/g);return n&&!c.has(e)&&n.forEach(e=>{t=t.replace(" "+e,"")}),t}(e.key,l(e))},function(e){e.exports=JSON.parse('{"months":["","January","February","March","April","May","June","July","August","September","October","November","December"],"stickers":["check","heart","warning","clock","smile","laugh","huh","frown","thumbs up","thumbs down","star","rocket"],"weekdays":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}')},function(e){e.exports=JSON.parse('{"every_certain_days_trigger":"every {*ORDINAL} {*WEEKDAY} {time}","every_day_trigger":"every day","every_weekday_trigger":"every weekday","every_week_trigger":"every {x_weeks} on {*WEEKDAY} {time}","every_month_trigger":"every {x_months} on the {month_day} {time}","every_year_trigger":"every year on {*MONTH} {month_day} {time}","on_due_date_days_before_trigger":"{$X} days before a card {conditions} is due","on_due_date_use_due_time_trigger":"at the time a card is due","when_card_into_list_trigger":"when a card {conditions} is added into {list}","when_date_added_trigger":"when a {date_type} is added","add_checklist_action":"add checklist {title} {from} {new_name}","add_comment_action":"post the comment {title}","add_date_action":"set the {date_type} to {date} {time}","add_label_action":"add {label} to {target}","add_member_action":"add {member} to the card","copy_card_action":"copy the card to {position} {list} {board} {comments}","find_card_by_id_action":"find the card with id {title}","count_cards_action":"count the cards {conditions}","create_report_action":"create a report {report_var} with all the cards {conditions} {item_pattern} {grouped_by}","increment_custom_field_action":"{verb} the number in custom field {title} by {$AMOUNT}","join_card_action":"join the card","leave_card_action":"leave the card","mark_due_date_complete_action":"mark due date {field}","mark_card_complete_action":"mark card {field}","move_card_action":"move the card to {position} {list} {board}","remove_from_card_action":"remove {fields} from {location}","send_email_to_recipient_action":"send email to {$ADDRESS} {subject} {message}","sort_list_action":"sort the list {title} by {field} {direction} {secondary_sort}","verb_custom_field_action":"{verb} custom field {title}","verb_custom_field_to_value_action":"{verb} custom field {title} {to_value}","age":"age","all archived cards":"all archived cards","all checklists":"all checklists","all labels":"all labels","all members":"all members","all stickers":"all stickers","all the cards in list":"all the cards in {list}","anyone":"anyone","ascending":"ascending","assigned to member":"assigned to {member}","at time":"at {*TIME}","before day":"before {*WEEKDAY}","before the end of day":"before the end of {*WEEKDAY}","bottom":"bottom","check":"check","clear":"clear","complete":"complete","custom field":"custom field {title}","date in title":"date in title","days":"days","decrease":"decrease","descending":"descending","due date":"due date","due in between days":"due in between {$MIN_DAYS} and {$MAX_DAYS} {days}","due in comparison days":"due in {operator} {$NUM_DAYS} {days}","due when":"due {when}","exactly":"exactly","from card":"from card {title}","grouped by":"grouped by {group}","hours":"hours","in variable":"in variable {title}","incomplete":"incomplete","increase":"increase","item pattern":"using pattern {title}","last day":"last day","last weekday":"last {*WEEKDAY}","last working day":"last working day","less than":"less than","list":"list","me":"me","member username":"{@MEMBER_USERNAME}","minutes":"minutes","month":"{*MONTH}","months":"months","months_singular":"month","month day":"{*ORDINAL}","more than":"more than","name":"name","next day":"next {*WEEKDAY}","next month on the day":"next month on the {*ORDINAL}","next month":"next month","next week on day":"next week on {*WEEKDAY}","next week":"next week","now":"now","nth day":"{*ORDINAL} {*WEEKDAY}","of the list":"of the list {title}","on board":"on board {title}","ordinal":"{*ORDINAL}","overdue":"overdue","secondary sort":"and then by {field} {direction}","set":"set","start date":"start date","the attachment":"the attachment {title}","the card":"the card","the checklist":"the checklist {title}","the cover":"the cover","the day of month":"the {day} of {month}","the due date":"the due date","the label":"the {*COLOR} {title} label","the link":"the link {title}","the list":"the list {title}","the month":"the month","the next working day":"the next working day","the start date":"the start date","the sticker":"the {*STICKER} sticker","this month":"this month","this week":"this week","time in list":"time in list","title":"\\"{$TITLE}\\"","to all cards":"to all cards","to value":"to {$VALUE}","today":"today","tomorrow":"tomorrow","top":"top","uncheck":"uncheck","votes":"votes","weeks":"weeks","weeks_singular":"week","with message":"with message {title}","with name":"with name {title}","with no labels":"with no labels","with subject":"with subject {title}","without comments":"without comments","without due date":"without due date","working days":"working days","written date":"{*DATE}","x time frame later":"{$X} {time_frame} later","x weeks":"{*COUNT}","x months":"{*COUNT}","yesterday":"yesterday"}')},function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{if(e.SORT_BY_CUSTOM_FIELD)return{key:"custom field",title:{key:"title",$TITLE:e.SORT_BY_CUSTOM_FIELD.$CUSTOM_FIELD_NAME}};if(e.SORT_BY_LABEL){const{SORT_LABEL:t}=e.SORT_BY_LABEL;return(Array.isArray(t)?t:[t]).map(({COLOR:e,COLOR_VARIANT:t,$TITLE:n})=>({key:"the label","*COLOR":t?`${t} ${e}`:e,title:n?{key:"title",$TITLE:n}:void 0}))}return e.SORT_BY_DUE_DATE?"due date":e.SORT_BY_START_DATE?"start date":e.SORT_BY_VOTES?"votes":e.SORT_BY_TIME_IN_LIST?"time in list":e.SORT_BY_AGE?"age":e.SORT_BY_DATE_IN_TITLE?"date in title":e.SORT_BY_TITLE?"name":void 0},u={key:"sort_list_action",title:(0,a.l10nizeTitle)(o),field:c(s),direction:n?"descending":"ascending"};return i&&(u.secondary_sort={key:"secondary sort",field:c(i),direction:i.SORT_DESCENDING?"ascending":"descending"}),u}case"SEND_EMAIL_ACTION":{const{$ADDRESS:t,$SUBJECT:n,$MESSAGE:r}=e.SEND_EMAIL_ACTION,o={subject:{key:"with subject",title:{key:"title",$TITLE:n}},message:{key:"with message",title:{key:"title",$TITLE:r}}};return t&&(o.$ADDRESS=`"${t}"`),e.SEND_EMAIL_ACTION.ALL_MEMBERS_ON_BOARD&&(o.$ADDRESS="@board"),e.SEND_EMAIL_ACTION.ALL_MEMBERS_ON_CARD&&(o.$ADDRESS="@card"),Object.assign({key:"send_email_to_recipient_action"},o)}case"SET_CUSTOM_FIELD_ACTION":{const t=e.SET_CUSTOM_FIELD_ACTION;let n={title:{key:"title",$TITLE:t.$FIELD_NAME}};return t.$TEXT_VALUE?(n=Object.assign({verb:{key:"set"},to_value:{key:"to value",$VALUE:`"${t.$TEXT_VALUE}"`}},n),Object.assign({key:"verb_custom_field_to_value_action"},n)):t.NUMERIC_VALUE?(n=Object.assign({verb:{key:"set"},to_value:{key:"to value",$VALUE:t.NUMERIC_VALUE}},n),Object.assign({key:"verb_custom_field_to_value_action"},n)):t.VARIABLE_VALUE?(n=Object.assign({verb:{key:"set"},to_value:{key:"to value",$VALUE:t.VARIABLE_VALUE}},n),Object.assign({key:"verb_custom_field_to_value_action"},n)):t.INCREASE_FIELD?(n=Object.assign({verb:{key:"increase"},$AMOUNT:t.AMOUNT||1},n),Object.assign({key:"increment_custom_field_action"},n)):t.DECREASE_FIELD?(n=Object.assign({verb:{key:"decrease"},$AMOUNT:t.AMOUNT||1},n),Object.assign({key:"increment_custom_field_action"},n)):(t.CLEAR_FIELD?n=Object.assign({verb:{key:"clear"}},n):t.CHECK_FIELD?n=Object.assign({verb:{key:"check"}},n):t.UNCHECK_FIELD&&(n=Object.assign({verb:{key:"uncheck"}},n)),Object.assign({key:"verb_custom_field_action"},n))}case"ADD_START_DATE_ACTION":case"ADD_DUE_DATE_ACTION":return(0,i.l10nizeAddDateAction)(e);case"COUNT_CARDS_ACTION":return{key:"count_cards_action",conditions:n};case"FIND_CARD_BY_ID":return{key:"find_card_by_id_action",title:(0,a.l10nizeTitle)(e.FIND_CARD_BY_ID.$ID)};default:throw new o.LocalizationKeysError(e.type)}};const o=n(110),a=n(132),i=n(179),s=n(180),c=n(133)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.l10nizeAddDateAction=function(e){const t="ADD_START_DATE_ACTION"===e.type?e.ADD_START_DATE_ACTION.START_DATE:e.ADD_DUE_DATE_ACTION.DUE_DATE,n=(e=>{if(e.NOW)return"now";if(e.TODAY)return"today";if(e.TOMORROW)return"tomorrow";if(e.YESTERDAY)return"yesterday";if(e.NEXT_WEEK)return void 0!==e.NEXT_WEEK.DAY?{key:"next week on day","*WEEKDAY":e.NEXT_WEEK.DAY}:"next week";if(e.NEXT_MONTH)return{key:e.NEXT_MONTH.MONTH_DAY_NUMBER?"next month on the day":"next month","*ORDINAL":e.NEXT_MONTH.MONTH_DAY_NUMBER};if(e.THE_NEXT_WORKING_DAY)return"the next working day";if(o(e.IN_MINUTES))return{key:"x time frame later",$X:e.IN_MINUTES,time_frame:"minutes"};if(o(e.IN_HOURS))return{key:"x time frame later",$X:e.IN_HOURS,time_frame:"hours"};if(e.IN_X_FROM_TODAY){if(o(e.IN_X_FROM_TODAY.X_WORKING_DAYS))return{key:"x time frame later",$X:e.IN_X_FROM_TODAY.X_WORKING_DAYS,time_frame:"working days"};if(o(e.IN_X_FROM_TODAY.X_DAYS))return{key:"x time frame later",$X:e.IN_X_FROM_TODAY.X_DAYS,time_frame:"days"};if(o(e.IN_X_FROM_TODAY.X_WEEKS))return{key:"x time frame later",$X:e.IN_X_FROM_TODAY.X_WEEKS,time_frame:"weeks"};if(o(e.IN_X_FROM_TODAY.X_MONTHS))return{key:"x time frame later",$X:e.IN_X_FROM_TODAY.X_MONTHS,time_frame:"months"}}if(e.BEFORE_DAY)return{key:void 0!==e.BEFORE_DAY.END_OF_DAY?"before the end of day":"before day","*WEEKDAY":e.BEFORE_DAY.DAY};if(void 0!==e.NEXT_DAY)return{key:"next day","*WEEKDAY":e.NEXT_DAY.DAY};if(e.MONTH_DAY){let t;return t=e.MONTH_DAY.LAST_MONTH_DAY?Object.prototype.hasOwnProperty.call(e.MONTH_DAY.LAST_MONTH_DAY,"WORKING")?"last working day":"last day":{key:"ordinal","*ORDINAL":e.MONTH_DAY.MONTH_DAY_NUMBER},{key:"the day of month",day:t,month:e.MONTH_DAY.WHICH_MONTH_NEXT?"next month":"the month"}}if(e.NTH_WEEK_DAY)return{key:"the day of month",day:e.NTH_WEEK_DAY.LAST_MONTH_WEEK?{key:"last weekday","*WEEKDAY":e.NTH_WEEK_DAY.DAY}:{key:"nth day","*ORDINAL":e.NTH_WEEK_DAY.MONTH_WEEK_NUMBER,"*WEEKDAY":e.NTH_WEEK_DAY.DAY},month:"the month"};if(e.WRITTEN_DATE)return e.WRITTEN_DATE.END_OF_MONTH?{key:"the day of month",day:"last day",month:{key:"month","*MONTH":e.WRITTEN_DATE.MONTH}}:{key:"written date","*DATE":{key:"date",month:e.WRITTEN_DATE.MONTH,day:e.WRITTEN_DATE.MONTH_DAY_NUMBER,year:e.WRITTEN_DATE.YEAR}};return})(t);if(!n&&!t.TIME)throw new r.LocalizationKeysError(e.type,["NUMERIC_DATE","DATE_IN_CUSTOM_FIELD"].find(e=>Object.prototype.hasOwnProperty.call(t,e)));return{key:"add_date_action",date_type:{key:"ADD_START_DATE_ACTION"===e.type?"start date":"due date"},date:n,time:t.TIME?{key:"at time","*TIME":Object.assign({key:"time"},t.TIME)}:void 0}};const r=n(110),o=e=>Number.isFinite(e)&&(null!=e?e:0)>=0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.l10nizeRemoveFromCardAction=function({REMOVE_FROM_CARD_ACTION:e}){const t=[];if(e.LABEL)for(const{COLOR:n,$TITLE:a}of(0,r.normalizeArray)(e.LABEL))t.push({key:"the label","*COLOR":null!=n?n:void 0,title:(0,o.l10nizeTitle)(a)});if(e.MEMBER)for(const n of(0,r.normalizeArray)(e.MEMBER))n["@MEMBER_USERNAME"]?t.push({key:"member username","@MEMBER_USERNAME":n["@MEMBER_USERNAME"]}):n.$MEMBER_FULLNAME?t.push((0,o.l10nizeTitle)(n.$MEMBER_FULLNAME)):n.MEMBER_ME?t.push("me"):n.MEMBER_ANYONE&&t.push("anyone");if(e.REMOVE_ATTACHMENT)for(const n of(0,r.normalizeArray)(e.REMOVE_ATTACHMENT))n.$ATTACHMENT_LINK?t.push({key:"the link",title:(0,o.l10nizeTitle)(n.$ATTACHMENT_LINK)}):t.push({key:"the attachment",title:(0,o.l10nizeTitle)(n.$ATTACHMENT_NAME)});if(e.REMOVE_CHECKLIST)for(const{$CHECKLIST_NAME:n}of(0,r.normalizeArray)(e.REMOVE_CHECKLIST))t.push({key:"the checklist",title:(0,o.l10nizeTitle)(n)});if(e.STICKER_TYPE)for(const n of(0,r.normalizeArray)(e.STICKER_TYPE))t.push({key:"the sticker","*STICKER":n});e.REMOVE_COVER&&t.push("the cover");e.REMOVE_DUE_DATE&&t.push("the due date");e.REMOVE_START_DATE&&t.push("the start date");e.THE_LABEL&&t.push("the label");e.REMOVE_ALL_CHECKLISTS&&t.push("all checklists");e.REMOVE_ALL_LABELS&&t.push("all labels");e.REMOVE_ALL_MEMBERS&&t.push("all members");e.REMOVE_ALL_STICKERS&&t.push("all stickers");let n;n=e.ALL_CARDS_IN_LIST?{key:"all the cards in list",list:{key:"the list",title:(0,o.l10nizeTitle)(e.ALL_CARDS_IN_LIST.$LIST)}}:e.ALL_ARCHIVED_CARDS?"all archived cards":"the card";return{key:"remove_from_card_action",fields:t,location:n}};const r=n(131),o=n(132)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalizationKeysForTrigger=function(e){var t;const n=null===(t=(0,o.getTriggerConditions)(e))||void 0===t?void 0:t.map(o.getLocalizationKeysForCondition),a=e.type;switch(a){case"EVERY":switch(e[a].type){case"EVERY_DAY":return{key:"every_day_trigger"};case"EVERY_WEEKDAY":return{key:"every_weekday_trigger"};case"EVERY_WEEK":{const{X_WEEKS:t,DAY:n,TIME:r}=e[a].EVERY_WEEK;return{key:"every_week_trigger",x_weeks:{key:"x weeks","*COUNT":{key:"weeks",COUNT:t||1}},"*WEEKDAY":n,time:r?{key:"at time","*TIME":Object.assign({key:"time"},r)}:void 0}}case"EVERY_MONTH":{const{X_MONTHS:t,MONTH_DAY_NUMBER:n,TIME:r}=e[a].EVERY_MONTH;return{key:"every_month_trigger",x_months:{key:"x months","*COUNT":{key:"months",COUNT:t||1}},month_day:{key:"month day","*ORDINAL":n},time:r?{key:"at time","*TIME":Object.assign({key:"time"},r)}:void 0}}case"EVERY_YEAR":{const{MONTH:t,MONTH_DAY_NUMBER:n,TIME:r}=e[a].EVERY_YEAR;return{key:"every_year_trigger","*MONTH":t,month_day:{key:"month day","*ORDINAL":n},time:r?{key:"at time","*TIME":Object.assign({key:"time"},r)}:void 0}}case"CERTAIN_DAYS":{const{MONTH_WEEK_NUMBER:t,DAY:n,TIME:r}=e[a].CERTAIN_DAYS;return{key:"every_certain_days_trigger","*ORDINAL":t,"*WEEKDAY":n,time:r?{key:"at time","*TIME":Object.assign({key:"time"},r)}:void 0}}}break;case"ON_DUE_DATE":switch(e[a].type){case"DAYS_BEFORE":return{key:"on_due_date_days_before_trigger",$X:e[a].DAYS_BEFORE,conditions:n};case"USE_DUE_TIME":if(e[a].USE_DUE_TIME)return{key:"on_due_date_use_due_time_trigger"}}break;case"WHEN":switch(e[a].type){case"CARD_INTO_LIST":{const{$LIST:t}=e[a].CARD_INTO_LIST;return{key:"when_card_into_list_trigger",list:{key:"the list",title:{key:"title",$TITLE:t}},conditions:n}}case"START_DATE_ADDED":case"DUE_DATE_ADDED":return{key:"when_date_added_trigger",date_type:{key:"START_DATE_ADDED"===e[a].type?"start date":"due date"}}}}throw new r.LocalizationKeysError(e[a].type)};const r=n(110),o=n(133)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t){const n=["green","yellow","orange","red","purple","blue","sky","lime","pink","black",null].reduce((e,t)=>t?[...e,t+"_light",t,t+"_dark"]:[...e,t],[]);e.exports={compareLabels:(e,t)=>n.indexOf(e.color)-n.indexOf(t.color)||(e.name||"").localeCompare(t.name||"")}},function(e,t,n){const r=n(15),o=(e,t)=>{switch(e){case"describe":return a(t);case"connect":return i(t);case"revoke":return s(t);default:return console.error("Unknown verb: "+e),""}},a=e=>`Connected Account: \`${e.params.map(e=>""+Object.values(e).map(e=>e.connection_name).join(", ")).join(", ")}\``,i=e=>{const{t:t}=e;let n;return Auth.getToken(t).then(e=>{if(!e)throw new Error("Bitbucket OAUTH: NO TRELLO TOKEN");const{crypto:n}=TrelloPowerUp.util,r=[];return n.generateInitVector().forEach(e=>r.push(("0"+e.toString(16)).substr(-2))),n.sha256Digest(`${r.join("")}:${t.getContext().member}:${e}`)}).then(e=>{n=e;console.log("clientId","qTaYTtxwPXWFn4jeLv");const r="https://bitbucket.org/site/oauth2/authorize?client_id=qTaYTtxwPXWFn4jeLv&response_type=code&state="+n;return t.authorize(r,{})}).then(t=>{const[r,o]=t.split(":");if(o!==n)throw new Error("Bitbucket OAUTH: STATUS MISMATCH");return e.submitIntegrationConnectRequest({code:r})})},s=e=>{const{t:t,params:n}=e;console.log(n,"params");const o=$(n.event.target).siblings('.integration-description[data-app-name="Bitbucket"]');if(o.length&&o.find("code")){const e=o.find("code").text();return Auth.getToken(t).then(t=>{if(!t)throw new Error("BITBUCKET DISCONNECT: NO TRELLO TOKEN");return new Promise((t,n)=>{$.ajax(r+"integration-disconnect",{type:"POST",headers:{"X-Butler-Trello-Token":Auth.getActiveToken()},data:JSON.stringify({appName:"Bitbucket",resourceName:e}),contentType:"application/json"}).done((function(e){return e.success?t():n(new Error(e.error||"Unknown error"))})).fail((function(e){return n(e)}))})})}return""},c=e=>{$(".oauth-bitbucket-status").addClass("hidden"),$(".oauth-bitbucket-status.status-"+e).removeClass("hidden")};e.exports={registerApps:e=>{e("Bitbucket",o)}},window.BitbucketOAuthCallback=()=>{const e=(window.location.search.match(/[?&]code=([-_a-zA-Z0-9]*)/)||[])[1],t=(window.location.search.match(/[?&]state=([a-fA-F0-9]*)/)||[])[1];if(!e)return void c("error");c("requesting");const n=`${e}:${t}`;try{window.opener.authorize(n)}catch(e){try{localStorage.setItem("token",n)}catch(e){throw c("error"),new Error("Bitbucket OAUTH: CANNOT RETURN CODE")}}c("success"),setTimeout(window.close,1e3)}},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Map]",a="[object Object]",i="[object Set]",s=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[r]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[o]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u[i]=u["[object String]"]=u["[object WeakMap]"]=!1;var l="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,h=l||d||Function("return this")(),_=t&&!t.nodeType&&t,f=_&&"object"==typeof n&&n&&!n.nodeType&&n,p=f&&f.exports===_,m=p&&l.process,g=function(){try{return m&&m.binding&&m.binding("util")}catch(e){}}(),b=g&&g.isTypedArray;function E(e,t){for(var n=-1,r=null==e?0:e.length;++ns))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var l=-1,d=!0,h=2&n?new ae:void 0;for(a.set(e,t),a.set(t,e);++l-1},re.prototype.set=function(e,t){var n=this.__data__,r=ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(G||re),string:new ne}},oe.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return me(this,e).get(e)},oe.prototype.has=function(e){return me(this,e).has(e)},oe.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ae.prototype.add=ae.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ae.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.clear=function(){this.__data__=new re,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};var be=j?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}function De(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function we(e){return null!=e&&"object"==typeof e}var Se=b?function(e){return function(t){return e(t)}}(b):function(e){return we(e)&&Ne(e.length)&&!!u[ue(e)]};function Re(e){return null!=(t=e)&&Ne(t.length)&&!Ce(t)?se(e):_e(e);var t}n.exports=function(e,t){return de(e,t)}}).call(this,n(10),n(90)(e))},function(e,t,n){"use strict";var r=n(187),o=n(188);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=E,t.resolve=function(e,t){return E(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?E(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=E(e));return e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),h=["/","?","#"],_=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(189);function E(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?M+="x":M+=k[L];if(!M.match(_)){var F=S.slice(0,N),P=S.slice(N+1),B=k.match(f);B&&(F.push(B[1]),P.unshift(B[2])),P.length&&(E="/"+P.join(".")+E),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=r.toASCII(this.hostname));var $=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+$,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==E[0]&&(E="/"+E))}if(!p[v])for(N=0,R=l.length;N0)&&n.host.split("@"))&&(n.auth=w.shift(),n.host=n.hostname=w.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!y.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var I=y.slice(-1)[0],C=(n.host||e.host||y.length>1)&&("."===I||".."===I)||""===I,N=0,D=y.length;D>=0;D--)"."===(I=y[D])?y.splice(D,1):".."===I?(y.splice(D,1),N++):N&&(y.splice(D,1),N--);if(!A&&!v)for(;N--;N)y.unshift("..");!A||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),C&&"/"!==y.join("/").substr(-1)&&y.push("");var w,S=""===y[0]||y[0]&&"/"===y[0].charAt(0);O&&(n.hostname=n.host=S?"":y.length?y.shift():"",(w=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=w.shift(),n.host=n.hostname=w.shift()));return(A=A||n.host&&y.length)&&!S&&y.unshift(""),y.length?n.pathname=y.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var s,c=2147483647,u=/^xn--/,l=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=Math.floor,f=String.fromCharCode;function p(e){throw new RangeError(h[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],o=0,a=e.length;o=55296&&t<=56319&&o65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=f(e)})).join("")}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,n){var r=0;for(e=n?_(e/700):e>>1,e+=_(e/t);e>455;r+=36)e=_(e/35);return _(r+36*e/(e+38))}function v(e){var t,n,r,o,a,i,s,u,l,d,h,f=[],m=e.length,g=0,b=128,T=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&p("not-basic"),f.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=m&&p("invalid-input"),((u=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||u>_((c-g)/i))&&p("overflow"),g+=u*i,!(u<(l=s<=T?1:s>=T+26?26:s-T));s+=36)i>_(c/(d=36-l))&&p("overflow"),i*=d;T=A(g-a,t=f.length+1,0==a),_(g/t)>c-b&&p("overflow"),b+=_(g/t),g%=t,f.splice(g++,0,b)}return E(f)}function y(e){var t,n,r,o,a,i,s,u,l,d,h,m,g,E,v,y=[];for(m=(e=b(e)).length,t=128,n=0,a=72,i=0;i=t&&h_((c-n)/(g=r+1))&&p("overflow"),n+=(s-t)*g,t=s,i=0;ic&&p("overflow"),h==t){for(u=n,l=36;!(u<(d=l<=a?1:l>=a+26?26:l-a));l+=36)v=u-d,E=36-d,y.push(f(T(d+v%E,0))),u=_(v/E);y.push(f(T(u,0))),a=A(n,g,r==o),n=0,++r}++n,++t}return y.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:E},decode:v,encode:y,toASCII:function(e){return g(e,(function(e){return l.test(e)?"xn--"+y(e):e}))},toUnicode:function(e){return g(e,(function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(90)(e),n(10))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(190),t.encode=t.stringify=n(191)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(t);var c=1e3;a&&"number"==typeof a.maxKeys&&(c=a.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l=0?(d=p.substr(0,m),h=p.substr(m+1)):(d=p,h=""),_=decodeURIComponent(d),f=decodeURIComponent(h),r(i,_)?o(i[_])?i[_].push(f):i[_]=[i[_],f]:i[_]=f}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),(function(i){var s=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[i]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0){var i=n.substring(0,o),s=n.substring(o+r.length);n=i+t[a]+s}return n},v=[0,6,77,81,73,115,100,112,3],y=[0,4,77,81,84,84,4],O=function(e,t){for(var n in this.type=e,t)t.hasOwnProperty(n)&&(this[n]=t[n])};function I(e,t){var n,r=t,l=e[t],h=l>>4,f=l&=15;t+=1;var p=0,m=1;do{if(t==e.length)return[null,r];p+=(127&(n=e[t++]))*m,m*=128}while(0!=(128&n));var g=t+p;if(g>e.length)return[null,r];var b=new O(h);switch(h){case o:1&e[t++]&&(b.sessionPresent=!0),b.returnCode=e[t++];break;case a:var E=f>>1&3,T=D(e,t),A=R(e,t+=2,T);t+=T,E>0&&(b.messageIdentifier=D(e,t),t+=2);var v=new x(e.subarray(t,g));1==(1&f)&&(v.retained=!0),8==(8&f)&&(v.duplicate=!0),v.qos=E,v.destinationName=A,b.payloadMessage=v;break;case i:case s:case c:case u:case _:b.messageIdentifier=D(e,t);break;case d:b.messageIdentifier=D(e,t),t+=2,b.returnCode=e.subarray(t,g)}return[b,g]}function C(e,t,n){return t[n++]=e>>8,t[n++]=e%256,n}function N(e,t,n,r){return S(e,n,r=C(t,n,r)),r+t}function D(e,t){return 256*e[t]+e[t+1]}function w(e){for(var t=0,n=0;n2047?(55296<=r&&r<=56319&&(n++,t++),t+=3):r>127?t+=2:t++}return t}function S(e,t,n){for(var r=n,o=0;o>6&31|192,t[r++]=63&a|128):a<=65535?(t[r++]=a>>12&15|224,t[r++]=a>>6&63|128,t[r++]=63&a|128):(t[r++]=a>>18&7|240,t[r++]=a>>12&63|128,t[r++]=a>>6&63|128,t[r++]=63&a|128)}return t}function R(e,t,n){for(var r,o="",a=t;a65535&&(r-=65536,o+=String.fromCharCode(55296+(r>>10)),r=56320+(1023&r)),o+=String.fromCharCode(r)}return o}O.prototype.encode=function(){var e,t=(15&this.type)<<4,n=0,o=[],i=0;switch(void 0!==this.messageIdentifier&&(n+=2),this.type){case r:switch(this.mqttVersion){case 3:n+=v.length+3;break;case 4:n+=y.length+3}n+=w(this.clientId)+2,void 0!==this.willMessage&&(n+=w(this.willMessage.destinationName)+2,(e=this.willMessage.payloadBytes)instanceof Uint8Array||(e=new Uint8Array(u)),n+=e.byteLength+2),void 0!==this.userName&&(n+=w(this.userName)+2),void 0!==this.password&&(n+=w(this.password)+2);break;case l:t|=2;for(var s=0;s>=7)>0&&(r|=128),t[n++]=r}while(e>0&&n<4);return t}(n),_=d.length+1,f=new ArrayBuffer(n+_),p=new Uint8Array(f);if(p[0]=t,p.set(d,1),this.type==a)_=N(this.payloadMessage.destinationName,i,p,_);else if(this.type==r){switch(this.mqttVersion){case 3:p.set(v,_),_+=v.length;break;case 4:p.set(y,_),_+=y.length}var m=0;this.cleanSession&&(m=2),void 0!==this.willMessage&&(m|=4,m|=this.willMessage.qos<<3,this.willMessage.retained&&(m|=32)),void 0!==this.userName&&(m|=128),void 0!==this.password&&(m|=64),p[_++]=m,_=C(this.keepAliveInterval,p,_)}switch(void 0!==this.messageIdentifier&&(_=C(this.messageIdentifier,p,_)),this.type){case r:_=N(this.clientId,w(this.clientId),p,_),void 0!==this.willMessage&&(_=N(this.willMessage.destinationName,w(this.willMessage.destinationName),p,_),_=C(e.byteLength,p,_),p.set(e,_),_+=e.byteLength),void 0!==this.userName&&(_=N(this.userName,w(this.userName),p,_)),void 0!==this.password&&(_=N(this.password,w(this.password),p,_));break;case a:p.set(u,_);break;case l:for(s=0;s0&&(this.timeout=setTimeout(r(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},M=function(e,t,n,r){t||(t=30),this.timeout=setTimeout(function(e,t,n){return function(){return e.apply(t,n)}}(n,e,r),1e3*t),this.cancel=function(){clearTimeout(this.timeout)}},L=function(t,r,o,a,i){if(!("WebSocket"in e)||null===e.WebSocket)throw new Error(A(E.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in e)||null===e.ArrayBuffer)throw new Error(A(E.UNSUPPORTED,["ArrayBuffer"]));for(var s in this._trace("Paho.Client",t,r,o,a,i),this.host=r,this.port=o,this.path=a,this.uri=t,this.clientId=i,this._wsuri=null,this._localKey=r+":"+o+("/mqtt"!=a?":"+a:"")+":"+i+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0,n)0!==s.indexOf("Sent:"+this._localKey)&&0!==s.indexOf("Received:"+this._localKey)||this.restore(s)};L.prototype.host=null,L.prototype.port=null,L.prototype.path=null,L.prototype.uri=null,L.prototype.clientId=null,L.prototype.socket=null,L.prototype.connected=!1,L.prototype.maxMessageIdentifier=65536,L.prototype.connectOptions=null,L.prototype.hostIndex=null,L.prototype.onConnected=null,L.prototype.onConnectionLost=null,L.prototype.onMessageDelivered=null,L.prototype.onMessageArrived=null,L.prototype.traceFunction=null,L.prototype._msg_queue=null,L.prototype._buffered_msg_queue=null,L.prototype._connectTimeout=null,L.prototype.sendPinger=null,L.prototype.receivePinger=null,L.prototype._reconnectInterval=1,L.prototype._reconnecting=!1,L.prototype._reconnectTimeout=null,L.prototype.disconnectedPublishing=!1,L.prototype.disconnectedBufferSize=5e3,L.prototype.receiveBuffer=null,L.prototype._traceBuffer=null,L.prototype._MAX_TRACE_ENTRIES=100,L.prototype.connect=function(e){var t=this._traceMask(e,"password");if(this._trace("Client.connect",t,this.socket,this.connected),this.connected)throw new Error(A(E.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(A(E.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=e,this._reconnectInterval=1,this._reconnecting=!1,e.uris?(this.hostIndex=0,this._doConnect(e.uris[0])):this._doConnect(this.uri)},L.prototype.subscribe=function(e,t){if(this._trace("Client.subscribe",e,t),!this.connected)throw new Error(A(E.INVALID_STATE,["not connected"]));var n=new O(l);n.topics=e.constructor===Array?e:[e],void 0===t.qos&&(t.qos=0),n.requestedQos=[];for(var r=0;r0?this._requires_ack(t):this.onMessageDelivered&&(this._notify_msg_sent[t]=this.onMessageDelivered(t.payloadMessage)),this._schedule_message(t);else{if(!this._reconnecting||!this.disconnectedPublishing)throw new Error(A(E.INVALID_STATE,["not connected"]));if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw new Error(A(E.BUFFER_FULL,[this.disconnectedBufferSize]));e.qos>0?this._requires_ack(t):(t.sequence=++this._sequence,this._buffered_msg_queue.unshift(t))}},L.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(A(E.INVALID_STATE,["not connecting or connected"]));var e=new O(m);this._notify_msg_sent[e]=b(this._disconnected,this),this._schedule_message(e)},L.prototype.getTraceLog=function(){if(null!==this._traceBuffer){for(var e in this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length),this._sentMessages)this._trace("_sentMessages ",e,this._sentMessages[e]);for(var e in this._receivedMessages)this._trace("_receivedMessages ",e,this._receivedMessages[e]);return this._traceBuffer}},L.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,"@VERSION@-@BUILDLEVEL@")},L.prototype.stopTrace=function(){delete this._traceBuffer},L.prototype._doConnect=function(e){if(this.connectOptions.useSSL){var t=e.split(":");t[0]="wss",e=t.join(":")}this._wsuri=e,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(e,["mqttv3.1"]):this.socket=new WebSocket(e,["mqtt"]),this.socket.binaryType="arraybuffer",this.socket.onopen=b(this._on_socket_open,this),this.socket.onmessage=b(this._on_socket_message,this),this.socket.onerror=b(this._on_socket_error,this),this.socket.onclose=b(this._on_socket_close,this),this.sendPinger=new k(this,this.connectOptions.keepAliveInterval),this.receivePinger=new k(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new M(this,this.connectOptions.timeout,this._disconnected,[E.CONNECT_TIMEOUT.code,A(E.CONNECT_TIMEOUT)])},L.prototype._schedule_message=function(e){this._msg_queue.unshift(e),this.connected&&this._process_queue()},L.prototype.store=function(e,t){var r={type:t.type,messageIdentifier:t.messageIdentifier,version:1};switch(t.type){case a:t.pubRecReceived&&(r.pubRecReceived=!0),r.payloadMessage={};for(var o="",i=t.payloadMessage.payloadBytes,s=0;s=2;){var l=parseInt(i.substring(0,2),16);i=i.substring(2,i.length),c[u++]=l}var d=new x(c);d.qos=r.payloadMessage.qos,d.destinationName=r.payloadMessage.destinationName,r.payloadMessage.duplicate&&(d.duplicate=!0),r.payloadMessage.retained&&(d.retained=!0),o.payloadMessage=d;break;default:throw Error(A(E.INVALID_STORED_DATA,[e,t]))}0===e.indexOf("Sent:"+this._localKey)?(o.payloadMessage.duplicate=!0,this._sentMessages[o.messageIdentifier]=o):0===e.indexOf("Received:"+this._localKey)&&(this._receivedMessages[o.messageIdentifier]=o)},L.prototype._process_queue=function(){for(var e=null;e=this._msg_queue.pop();)this._socket_send(e),this._notify_msg_sent[e]&&(this._notify_msg_sent[e](),delete this._notify_msg_sent[e])},L.prototype._requires_ack=function(e){var t=Object.keys(this._sentMessages).length;if(t>this.maxMessageIdentifier)throw Error("Too many messages:"+t);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;e.messageIdentifier=this._message_identifier,this._sentMessages[e.messageIdentifier]=e,e.type===a&&this.store("Sent:",e),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},L.prototype._on_socket_open=function(){var e=new O(r,this.connectOptions);e.clientId=this.clientId,this._socket_send(e)},L.prototype._on_socket_message=function(e){this._trace("Client._on_socket_message",e.data);for(var t=this._deframeMessages(e.data),n=0;n0)for(var g=null;g=this._buffered_msg_queue.pop();)h.push(g),this.onMessageDelivered&&(this._notify_msg_sent[g]=this.onMessageDelivered(g.payloadMessage));h=h.sort((function(e,t){return e.sequence-t.sequence}));for(var b=0,v=h.length;b65535)throw new Error(A(E.INVALID_ARGUMENT,[r,"clientId"]));var l=new L(o,e,t,n,r);Object.defineProperties(this,{host:{get:function(){return e},set:function(){throw new Error(A(E.UNSUPPORTED_OPERATION))}},port:{get:function(){return t},set:function(){throw new Error(A(E.UNSUPPORTED_OPERATION))}},path:{get:function(){return n},set:function(){throw new Error(A(E.UNSUPPORTED_OPERATION))}},uri:{get:function(){return o},set:function(){throw new Error(A(E.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return l.clientId},set:function(){throw new Error(A(E.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return l.onConnected},set:function(e){if("function"!=typeof e)throw new Error(A(E.INVALID_TYPE,[typeof e,"onConnected"]));l.onConnected=e}},disconnectedPublishing:{get:function(){return l.disconnectedPublishing},set:function(e){l.disconnectedPublishing=e}},disconnectedBufferSize:{get:function(){return l.disconnectedBufferSize},set:function(e){l.disconnectedBufferSize=e}},onConnectionLost:{get:function(){return l.onConnectionLost},set:function(e){if("function"!=typeof e)throw new Error(A(E.INVALID_TYPE,[typeof e,"onConnectionLost"]));l.onConnectionLost=e}},onMessageDelivered:{get:function(){return l.onMessageDelivered},set:function(e){if("function"!=typeof e)throw new Error(A(E.INVALID_TYPE,[typeof e,"onMessageDelivered"]));l.onMessageDelivered=e}},onMessageArrived:{get:function(){return l.onMessageArrived},set:function(e){if("function"!=typeof e)throw new Error(A(E.INVALID_TYPE,[typeof e,"onMessageArrived"]));l.onMessageArrived=e}},trace:{get:function(){return l.traceFunction},set:function(e){if("function"!=typeof e)throw new Error(A(E.INVALID_TYPE,[typeof e,"onTrace"]));l.traceFunction=e}}}),this.connect=function(e){if(g(e=e||{},{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),void 0===e.keepAliveInterval&&(e.keepAliveInterval=60),e.mqttVersion>4||e.mqttVersion<3)throw new Error(A(E.INVALID_ARGUMENT,[e.mqttVersion,"connectOptions.mqttVersion"]));if(void 0===e.mqttVersion?(e.mqttVersionExplicit=!1,e.mqttVersion=4):e.mqttVersionExplicit=!0,void 0!==e.password&&void 0===e.userName)throw new Error(A(E.INVALID_ARGUMENT,[e.password,"connectOptions.password"]));if(e.willMessage){if(!(e.willMessage instanceof x))throw new Error(A(E.INVALID_TYPE,[e.willMessage,"connectOptions.willMessage"]));if(e.willMessage.stringPayload=null,void 0===e.willMessage.destinationName)throw new Error(A(E.INVALID_TYPE,[typeof e.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(void 0===e.cleanSession&&(e.cleanSession=!0),e.hosts){if(!(e.hosts instanceof Array))throw new Error(A(E.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));if(e.hosts.length<1)throw new Error(A(E.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));for(var t=!1,r=0;r=3&&(o.qos=n),arguments.length>=4&&(o.retained=r),l.send(o)},this.publish=function(e,t,n,r){var o;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof x)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(o=e).destinationName)throw new Error(A(E.INVALID_ARGUMENT,[o.destinationName,"Message.destinationName"]));l.send(o)}else(o=new x(t)).destinationName=e,arguments.length>=3&&(o.qos=n),arguments.length>=4&&(o.retained=r),l.send(o)},this.disconnect=function(){l.disconnect()},this.getTraceLog=function(){return l.getTraceLog()},this.startTrace=function(){l.startTrace()},this.stopTrace=function(){l.stopTrace()},this.isConnected=function(){return l.connected}},Message:x}}(r)},e.exports=n()}).call(this,n(10))},function(e,t,n){const{Auth:r}=n(83),o=n(106),a=n(15),i=n(141),s=n(39),c=n(78),u={init:function(){const e=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),{Promise:t}=TrelloPowerUp;function n(e){let t='
    ';switch(e.type){case"ERROR":t+='';break;case"WARNING":t+='';break;case"MESSAGE":case"END":t+=''}return t+=`
    ${s.markdownToHtml(e.message)}
    `,t+="
    ",t}function u(e){const t=(e||[]).map(n)||'
    Automation started.
    ';$("#butler-command-run-details .list").html(t).find(".content a").attr("target","_blank")}function l(t){switch(t.error){case"CANT_PARSE_COMMAND":$("#butler-error-command-parse").transition("slide up");break;case"COMMAND_NOT_FOUND":$("#butler-error-command-not-found").transition("slide up");break;case"USER_NOT_FOUND":$("#butler-error-user-not-found").transition("slide up");break;case"INVALID_TOKEN":r.reauthorize(e),$("#butler-error-auth").transition("slide up");break;case"BAD_REQUEST":case"INTERNAL_ERROR":default:$("#butler-error-internal").transition("slide up")}}function d(t){$("#butler-running-command").transition({animation:"slide up",onComplete:()=>{if(t.success){const n=t.response.powerup_usage_exceeded;n?($("#butler-error-quota").transition("slide up"),$(".butler-account-details-btn").off("click").click((function(){return e.overlay({url:"./powerup-account.html?tab=account"}),e.closeBoardBar().done(),!1}))):(t.response.messages||[]).some((function(e){return"ERROR"===e.type}))?$("#butler-error-running-command").transition("slide up"):(t.response.messages||[]).some((function(e){return"WARNING"===e.type}))?$("#butler-warning-running-command").transition("slide up"):$("#butler-success-running-command").transition("slide up"),n||setTimeout((function(){$("#butler-command-run-details:visible").length||e.closeBoardBar().done()}),5e3)}else l(t)}})}function h(t,r){const{messages:o}=t.response,s=t.response.async;s.onConnectionSuccess=function(){$.ajax(a+"powerup-resume-command",{type:"POST",data:JSON.stringify({job_id:s.job_id}),headers:{"X-Butler-Trello-Token":r},contentType:"application/json"}).done((function(t){t.success?(u(o),$("#butler-command-run-details").transition("slide up"),$(".butler-command-run-details-btn").transition("hide"),e.sizeTo("body")):l(t)})).fail((function(){$("#butler-running-command").transition("slide up"),$("#butler-error-running-command-network").transition("slide up")}))},s.onConnectionFailure=function(){$("#butler-error-running-command-network").transition("slide up")};let c=!1;s.onConnectionLost=function(){c||$("#butler-error-running-command-network").transition("slide up")},s.onMessageReceived=function(e,r,a){const i=JSON.parse(a);o.push(i),function(e){const t=$(n(e));t.find(".content a").attr("target","_blank"),$("#butler-command-run-details .list").append(t),$("#butler-command-run-details > .segment").animate({scrollTop:t.offset().top},500)}(i),"END"===i.type&&(c=!0,d(t))},i.connect(s)}o.init();const _=(window.location.search.match(/cmd=([-_a-zA-Z0-9]*)/)||[])[1],f=(window.location.search.match(/obo=([a-fA-F0-9]*)/)||[])[1],p=(window.location.search.match(/type=([-_a-zA-Z0-9]*)/)||[])[1];f&&o.setAdminOnBehalfOf(f),r.ensureTokenValidity(e).catch(e=>s.handleError(new Error("runBoardButtons-ensureTokenValidity: "+e.message),"ensureTokenValidity")).then(()=>r.registerIfNecessary(e,!0,o,!0)).catch(e=>{s.handleError(new Error("runBoardButtons-registerIfNecessary: "+e.message),"registerIfNecessary")}).then((function(){!function(n,r,i){const l="run-butlerCommand/"+(["boardButton","schedule"].includes(i)?i:"rule"),_=c.startTask({taskName:l,source:"commandRunner"});t.join(e.board("id","name"),e.card("id").catch((function(){return{}})),e.member("id"),o.getCommandById(r,!1,!0)).spread((function(t,i,f,p){const m=p&&p.label?`"${p.label}"`:$(".butler-command-name").attr("default-text");$(".butler-command-name").text(m),$(".butler-cancel-command").transition("hide"),$("#butler-running-command").transition("slide up"),$.ajax(a+"powerup-run-command",{type:"POST",data:JSON.stringify({cmd_id:r,command:p,board_data:{board_id:t.id,board_name:t.name,tz:moment.tz.guess(),context:navigator.userAgent},parameters:{card_id:i.id},obo:o.getAdminOnBehalfOf()}),headers:{"X-Butler-Trello-Token":n},contentType:"application/json"}).done((function(t){if(c.taskSucceeded({traceId:_,taskName:l,source:"commandRunner"}),t.response){if(t.response.async)return void h(t,n);$(".butler-command-run-details-btn").transition("show").off("click").click((function(){u(t.response.messages),$(".butler-command-run-details-btn").transition("hide"),$("#butler-command-run-details").transition("show"),e.sizeTo("body")}))}else $(".butler-command-run-details-btn").transition("hide");d(t)})).fail((function(e){const t=new Error(`Run automation request failed: ${e.status} - ${e.statusText}`);s.handleError(t,"commandRunner"),$("#butler-running-command").transition("slide up"),504===e.status?$("#butler-error-running-command-gateway-timeout").transition("slide up"):$("#butler-error-running-command-network").transition("slide up"),c.taskFailed({traceId:_,taskName:l,source:"commandRunner",error:t})}))}))}(r.getActiveToken(),_,p)}))}};window.CommandRunner=u,e.exports=u},function(e,t,n){const r=n(92),o=n(37),{decompressFromEncodedURIComponent:a}=n(80),i=n(195).default,{Auth:s}=n(83),c=n(113),{getCurrentTab:u,showTab:l}=n(82),d=n(140),h=n(106),_=n(196),f=n(15),p=n(81),m=n(111),{handleError:g,markdownToHtml:b,sanitize:E,makeSlug:T,normalizeType:A,updateNavigation:v}=n(39),y=n(136),O=n(134),I=n(78),{RegistrationError:C}=n(114),{onClickAndKeypress:N}=n(197),D={suggestions:"butlerSuggestionsScreen",rules:"butlerRulesScreen","card-buttons":"butlerCardButtonsScreen","board-buttons":"bulterBoardButtonsScreen",schedules:"butlerSchedulesScreen","on-dates":"butlerOnDatesScreen","app-automations":"butlerConnectedAppsScreen"},w={rules:"rule",rule:"rule","card-button":"card-button","card-buttons":"card-button","board-button":"board-button","board-buttons":"board-button",schedule:"schedule",schedules:"schedule","on-date":"on-date","on-dates":"on-date"},S={"card-button":"fBwJEfhPUYM","board-button":"yoa83q7R9m8",rule:"WSMfGoXrL9I",schedule:"-f7Xw8iomW8","on-date":"-jtrkSAjmz8"},R=[".remove-command-popup",".card-board-more-options-popup",".card-board-hide-button-popup",".add-command-to-board-popup",".enabled-on-x-boards-popup",".header-more-info-popup"];let k;function M(e,t){return(t?"https://www.youtube.com/embed/":"https://www.youtube.com/watch?v=")+S[e]}function L(){return P(u().replace(/s$/,"")),l("app-automations"),v(),y.init(c),s.authorize().then(()=>y.getUserIntegrations().then(e=>($(".integration-disconnected").transition("show"),$(".integration-connected").transition("hide"),e.forEach(e=>{$(`.integration-connected[data-app-name="${E(e.appName)}"]`).transition("show"),$(`.integration-disconnected[data-app-name="${E(e.appName)}"]`).transition("hide");const t=$(`.integration-description[data-app-name="${E(e.appName)}"]`);t.transition("hide");const n=y.handleActionSync(e.appName,"describe",e.appData);n&&t.html(b(n)).transition("show");const r=$(`.revoke-integration[data-app-name="${E(e.appName)}"]`),o=y.handleActionSync(e.appName,"setupRevocation",e.appData);o&&(r.empty(),o.forEach(e=>{r.append(`
    ${E(e)}
    `)}),r.closest(".ui,.dropdown").dropdown("clear"))}),N($(".integration-action"),(function(t){const n=$(t.target).closest(".integration-action"),r=n.attr("data-app-name"),a=n.attr("data-verb"),i={event:t};"connect"===a?I.sendUIEvent({action:"clicked",actionSubject:"link",actionSubjectId:"integrationActionConnectLink",source:"butlerIntegrationsScreen",attributes:{appName:r,numOfConnections:(e||[]).length}}):"revoke"===a&&I.sendUIEvent({action:"clicked",actionSubject:"link",actionSubjectId:"integrationActionRevokeLink",source:"butlerIntegrationsScreen",attributes:{appName:r}}),y.handleAction(r,a,i).then(L).catch(e=>{o.captureException(e);window._trello.alert({display:"error",duration:10,message:"App connection failed. Please retry."})})}),{offClick:!0,hasEvent:!0}),e)))}function x(e,t,n,r){const o=()=>{TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).overlay({url:`./powerup-account.html?tab=${t}&butler-tab=${e}`}).catch(e=>g(new Error(`${n}: ${e.message}`),n)),v({action:t})};r?o():"suggestions"===e?(Re(),o()):"app-automations"===e?(L(),o()):B(A(e),()=>{o()})}const F=new Set(["rules","on-dates","schedules","board-buttons","card-buttons"]);function P(e){const t=u();if(F.has(t)){$("."+w[t]+"-embed").empty()}const n=$("."+e+"-embed");n.append("

    Loading...

    "),n.append("")}function B(e,t){let n;switch(P(e),$(".starter-page").transition("show"),R.forEach(e=>{const t=$(e);$("body").append(t.detach()),t.transition("hide")}),ie.shareCommand=void 0,ie.done=void 0,l(e+"s"),$(".builder-batch-select,.builder-batch,.card-button,.board-button,.rule,.schedule,.on-date,.command-list-filter,.command-list,.empty-command-list,.admin-empty-command-list,.builder-wizard,.builder").hide(),$("."+e).show(),e){case"card-button":n="Card buttons";break;case"board-button":n="Board buttons";break;case"rule":n="Rules";break;case"schedule":n="Scheduled automations";break;case"on-date":n="Due date automations"}$(".your-commands-header").text(n),$(".video-link").attr("href",M(e,!1)),function(e){const t=$(".header-more-info-popup");t.closest(".popup").popup("hide all"),$(".info-icon").popup({popup:".header-more-info-popup",position:"right center",on:"click",duration:0,exclusive:!0,lastResort:!0,boundary:".command-section"}),$(".popup-content").transition("hide"),$("."+e+"-popup").transition("show"),$("body").append(t.detach()),t.transition("hide")}(e),void 0===t&&v(),s.authorizeSoft().then((function(){$(".command-section .new-command-btn").transition("show"),$(".command-section .get-started-btn").transition("hide"),de(e,t)})).catch((function(){var n;ee(),n=function(){s.authorize().then((function(){B(e,t)}))},$(".command-section .new-command-btn").transition("hide"),$(".command-section .get-started-btn").off("click").click(n).transition("show")}))}function j(e){return e.sort((function(e,t){return e.label{let{members:n}=t;return!!n.find(t=>{let{id:n}=t;return n===e.getContext().member})})}function H(e){return TrelloPowerUp.Promise.join(m.getUserPlanLocal(),h.getCommands(e)).spread((function(e,t){const{commands:n,obo_writable:r}=t;return{commands:j(n),is_admin:!!(e||{}).is_admin,obo_writable:r}}))}function Y(){let{command:e,share:t,board:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};H(e.type).then((function(r){e=r.commands.find((function(t){return t.id===e.id}))||e,Ce({type:e.type,command:e,duplicate:!0,share:t,board:n})}))}function G(e){$(".command-list > .highlighted").removeClass("highlighted"),$(".command-list > .command").transition("stop all");const t=$(".command-list-filter .ui.dropdown.filter").dropdown("get value");let n;switch(t){case"":case"all":n=function(){return!0};break;case"enabled":n=function(e){return!e.find(".disable-command-tgl")[0].checked};break;case"disabled":n=function(e){return e.find(".disable-command-tgl")[0].checked};break;case"search":const e=$(".command-list-filter .command-search input").val().toLowerCase();n=function(t){return-1!==t.find(".code-area").text().toLowerCase().indexOf(e)};break;default:n=function(e){return e.find(".command-lib-name>.text").text()===t}}let r=0;$(".command-list > .command").filter((function(){const e=n($(this)),t=$(this).filter(":visible").length>0;return e&&++r,e!==t})).transition(e?"scale":"toggle"),$(".filter-no-commands").transition(r?"hide":"show")}function W(){return h.getAllCommands().then((function(e){const{commands:t}=e;return t.map((function(e){return e.lib})).sort().filter((function(e,t,n){return e&&e!==n[t-1]}))}))}function V(e,t,n){t!==e.lib&&(n.addClass("disabled"),n.find(">.text").text(t),h.updateCommandId(e.id,{lib:t}).then((function(r){e.lib=r.lib,n.removeClass("disabled"),n.removeAttr("data-tooltip"),G(!0),p.logEvent("engagement","lib_set",!!t)})).catch((function(t){o.captureException(t),n.find(">.text").text(e.lib),n.removeClass("disabled").attr("data-tooltip","Error saving.").transition("shake")})))}function K(e,t){t.popup({popup:".add-command-to-board-popup",on:"click",position:"bottom center",lastResort:"bottom left",boundary:".command-list",duration:0,exclusive:!0,onShow(){if($(".add-command-to-board-popup").parent()[0]===$("body")[0])return!1;$(this).attr("command-id",e.id);const t=$(this).find(".add-automation-btn");t.addClass("disabled");const n=$(this).find('[name="board-name"]');c.getAllOpenBoards().then((function(r){const o=r.filter(t=>!e.b.includes(t.id));c.setupBoardNameDropdown(n,o,t)})),I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"addToBoardButtonPopup",source:D[u().trim()]})},onHidden(){J(e,t),K(e,$("#"+e.id).find(".add-to-board-btn"))}})}const z=e=>`
    \n \n \n
    `;function q(e,t,n){const r={popup:t,on:"click",position:"bottom left",lastResort:!0,boundary:".command-list",duration:0,onShow:function(){e.find(n).after($(this).detach())}};e.find(n).popup(r),$(".close-popup").off("click").click((function(e){$(e.target).closest(".popup").popup("hide all")}));const o=$(t);$("body").append(o.detach()),o.transition("hide")}function X(e,t){const n={popup:".remove-command-popup",on:"click",position:"bottom center",lastResort:"bottom left",boundary:".command-list",duration:0,onShow:function(){$(this).attr("command-id",t.id),e.find(".command-btns").after($(this).detach())}};e.find(".remove-command-btn").popup(n)}function J(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"click";t.popup({popup:".enabled-on-x-boards-popup",on:n,position:"bottom center",lastResort:"bottom right",boundary:".command-list",duration:0,exclusive:!0,onShow(){if($(".enabled-on-x-boards-popup").parent()[0]===$("body")[0])return!1;$(this).attr("command-id",e.id);const t=$(this).find(".enabled-on-board-menu");c.getAllOpenBoards().then((function(n){const r=n.filter(t=>e.b.includes(t.id));t.empty(),r.forEach((function(n){t.append(z(n.name));const r=t.find(".enabled-on-board-checkbox").last();r.checkbox("check"),r.checkbox({onChange(){const t=$(".sharing-btns");t.addClass("disabled");let r=e.b;this.checked?r.push(n.id):r=r.filter(e=>e!==n.id),$(".enabled-on-x-boards-popup").transition("hide"),$("body").append($(".enabled-on-x-boards-popup").detach()),ie={},he(e.id,e.type,e.cmd,{boards:r}).then((function(){t.removeClass("disabled")}))}})}))})),I.sendUIEvent({action:"clicked",actionSubject:"link",actionSubjectId:"enabledOnXBoardsLink",source:D[u().trim()]})}})}function Q(e){const t=moment(Math.min(+new Date,e.t)).fromNow();let n="Last modified "+t;c.getAllOpenBoards().then((function(r){const o=e.b?r.filter(t=>e.b.includes(t.id)).length:0;o>0&&(n=`Enabled on ${o} board${1===o?"":"s"}, last modified ${t}`),e.is_own||(n+=` by @${E(e.username)}`),$(`#${e.id} .modified-by`).html(n),J(e,$("#"+e.id).find(".enabled-on-x-boards"))}))}function Z(e){const t=$(e.target).closest(".command").attr("id"),n=$(".sharing-btns");I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"shareCommandButton",source:D[u().trim()],attributes:{isChecked:e.target.checked}}),n.addClass("disabled"),h.updateCommandId(t,{shared:e.target.checked}).then((function(e){n.removeClass("disabled"),Q(e)})).catch((function(t){o.captureException(t),n.removeClass("disabled"),$(e.target).closest(".ui.checkbox").checkbox("set "+(e.target.checked?"unchecked":"checked")).attr("data-tooltip","Error saving.").transition("shake")})),e.target.checked&&p.logEvent("engagement","share_button")}function ee(e){$(".command-list,.command-list-filter").transition("hide");const t=h.getAdminOnBehalfOf()?$(".admin-empty-command-list"):$(".empty-command-list");e?t.transition({animation:"fade down",duration:"0.33s"}):t.transition("show"),$(".library-manage").transition("show")}function te(e){e.transition({animation:"fade down",duration:"0.33s",onComplete(){e.remove(),$(".command-list").children().length||ee(!0)}})}function ne(){if($(".command-list").children().length)$(".empty-command-list,.admin-empty-command-list").transition("hide"),$(".command-list,.command-list-filter,.create-command-buttons.top").transition("show"),G(),$(".library-manage").transition("show");else{(h.getAdminOnBehalfOf()?$(".admin-empty-command-list"):$(".empty-command-list")).transition("show"),ee()}$(".command-section:visible").length||$(".command-section").transition({animation:"fade left",duration:"0s",onComplete(){}})}function re(){$(".builder-wizard:visible").length?$(".builder-wizard").transition({animation:"fade left",duration:"0.33s",onComplete:ne}):ne()}function oe(e){const t=$(e.target).closest(".command").attr("id"),n=$(".sharing-btns");I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"scopeCommandButton",source:D[u().trim()],attributes:{isChecked:e.target.checked}}),n.addClass("disabled"),h.updateCommandId(t,{scope:e.target.checked?h.ScopeTeam:h.ScopeBoard}).then((function(e){n.removeClass("disabled"),Q(e)})).catch((function(t){t.message&&-1===t.message.indexOf("member is not in the organization")&&o.captureException(t),n.removeClass("disabled"),$(e.target).closest(".ui.checkbox").checkbox("set "+(e.target.checked?"unchecked":"checked")).attr("data-tooltip","Board is not in a workspace.").transition("shake")})),e.target.checked&&p.logEvent("engagement","team_scope_button")}function ae(e,t){const n=$(e.target).closest(".command"),r=n.attr("id"),o=$(".sharing-btns"),a=D[u().trim()],i=t?"enable-butlerCommand":"disable-butlerCommand",s=I.startTask({taskName:i,source:a});I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"enableCommandButton",source:D[u().trim()],attributes:{isChecked:t}}),o.addClass("disabled"),h.enableCommandId(r,t).then((function(e){void 0===e&&te(n),o.removeClass("disabled"),G(!0),Q(e),I.taskSucceeded({taskName:i,traceId:s,source:a})})).catch((function(n){g(new Error("enableCommand: "+n.message),"enableCommand"),I.taskFailed({taskName:i,traceId:s,source:a,error:n}),o.removeClass("disabled");const r=$(e.target).attr("data-id"),c=t?"#disable-id-"+r:"#enable-id-"+r;$(e.target).closest(".visibility-radio-buttons").attr("data-tooltip","Error saving.").transition("shake"),$(e.target).closest(".ui.checkbox").checkbox("set unchecked"),$(c).closest(".ui.checkbox").checkbox("set checked")}))}let ie={};function se(e,t,n,r){let o=!1;$(t).modal({onApprove(){o=!0,n(e)},onDeny(){o=!0,r(e)},onHidden(){o||r(e)}}).modal("show")}function ce(e){const t=u();"rules"===t||"schedules"===t||"on-dates"===t?se(e,"#prevention-modal-disable-automation",(function(e){ae({target:e},!1)}),(function(e){const t=$(e).attr("data-id");$("#enable-id-"+t).closest(".ui.checkbox").checkbox("set checked"),$("#disable-id-"+t).closest(".ui.checkbox").checkbox("set unchecked")})):ae({target:e},!1)}function ue(e,t,n,r,o){const{is_admin:a}=ie,i=_.buttonItem(e,a,o);n?i.insertBefore($("#"+n)):i.appendTo($(".command-list")),Q(e),i.transition({animation:"fade down",duration:t?"0s":"0.33s",onComplete(){}}),i.find(".edit-command-btn").click((function(){h.getCommand(e.type,e.id,!0).then((function(t){Ce({type:e.type,command:t})})),$(".command-list > .highlighted").removeClass("highlighted")})),i.find(".copy-command-btn").click((function(){Y({command:e})})),q(i,".card-board-more-options-popup",".card-board-more-options-info-icon"),q(i,".card-board-hide-button-popup",".card-board-hide-button-info-icon"),X(i,e),r?i.find(".enable-command-tgl").closest(".ui.checkbox").checkbox({onChange(){ae({target:this},!0)}}):i.find(".enable-command-tgl").closest(".ui.checkbox").checkbox("set disabled").attr("data-tooltip","You must be a member of the board to perform this action.").attr("data-position","top left"),i.find(".disable-command-tgl").closest(".ui.checkbox").checkbox({onChange(){ce(this)}}),i.find(".share-command-tgl").closest(".ui.checkbox").checkbox({onChange(){$(this).is(":checked")?Z({target:this}):se(this,"#prevention-modal-private-button",(function(e){Z({target:e})}),(function(e){$(e).closest(".ui.checkbox").checkbox("set checked")}))}}),i.find(".scope-command-tgl").closest(".ui.checkbox").checkbox({onChange(){$(this).is(":checked")?oe({target:this}):se(this,"#prevention-modal-remove-from-workspace",(function(e){oe({target:e})}),(function(e){$(e).closest(".ui.checkbox").checkbox("set checked")}))}}),i.find(".command-log-btn").click((function(){v({action:"log",commandId:e.id}),d.openCommandLog(e,null,v)})),o&&i.find(".scope-command-tgl").closest(".ui.checkbox").checkbox("set disabled").attr("data-tooltip","You must be a member of the workspace to perform this action.").attr("data-position","top left")}function le(e,t,n,r,o,a){if(-1!==e.type.indexOf("button"))return void ue(e,t,n,o,a);const{is_admin:i}=ie,s=_.commandItem(e,r,i);s.find("enable-board").transition("show"),n?s.insertBefore($("#"+n)):s.appendTo($(".command-list")),Q(e),s.transition({animation:"fade down",duration:t?"0s":"0.33s",onComplete(){}}),s.find(".edit-command-btn").click((function(){h.getCommand(e.type,e.id,!0).then((function(e){Ce({type:e.type,command:e})})),$(".command-list > .highlighted").removeClass("highlighted")})),s.find(".copy-command-btn").click((function(){Y({command:e})})),q(s,".card-board-more-options-popup",".card-board-more-options-info-icon"),q(s,".card-board-hide-button-popup",".card-board-hide-button-info-icon"),X(s,e),K(e,s.find(".add-to-board-btn")),J(e,s.find(".enabled-on-x-boards")),s.find(".disable-command-tgl").closest(".ui.checkbox").checkbox({onChange(){ce(this)}}),s.find(".enable-command-tgl").closest(".ui.checkbox").checkbox({onChange(){ae({target:this},!0)}}),o||s.find(".enable-command-tgl").closest(".ui.checkbox").checkbox("set disabled").attr("data-tooltip","You must be a member of the board to perform this action.").attr("data-position","top left"),s.find(".command-log-btn").click((function(){v({tab:e.type,action:"log",commandId:e.id}),d.openCommandLog(e,h.getAdminOnBehalfOf(),v)})),s.find(".run-command-btn").click((function(){const t=h.getAdminOnBehalfOf();TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).boardBar({height:38,title:"Automation",url:`./powerup-command-runner.html?cmd=${e.id}&type=${e.type}${t?"&obo="+t:""}`})})),function(e,t){const n=$(".command-lib-name-popup>.popup").clone(),r=n.find(".lib-select");t.popup({popup:n,on:"click",position:"right center",target:t.find("i"),exclusive:!0,onShow(){r.dropdown({allowAdditions:!1,forceSelection:!1,action:"hide",message:{addResult:"",noResults:"Press enter to create tag"},onChange(n){t.popup("hide"),V(e,n,t)},onHide(){r.find("input.search").off("keydown")}}).dropdown(e.lib?"set text":"clear text",E(e.lib||"")),W().then((function(n){const o=n.map((function(t){return{name:E(t),value:E(t),selected:t===e.lib}}));r.dropdown("setup menu",{values:o}),setTimeout((function(){const n=r.find("input.search");n.on("keydown",r=>{const o=r.keyCode||r.which;return"Enter"!==r.key&&"13"!==o||(t.popup("hide"),V(e,n.val(),t),n.off("keydown"),!1)}),n.focus()}),0)})),r.find("> a.info").transition(e.lib?"hide":"show"),r.find("> a.remove").transition(e.lib?"show":"hide").off("click").click((function(){t.popup("hide"),V(e,"",t)}))},onHidden(){t.append($(this).popup().detach())}})}(e,s.find(".command-lib-name"))}function de(e,t){const n=D[u().trim()],r=I.startTask({taskName:"view-butlerCommands/dashboard",source:n});$(".command-list").empty(),$(".command-list-filter").transition("hide"),$(".command-list-error").transition("hide"),$(".command-list-loading").transition("show"),$(".create-command-buttons").transition("hide"),$(".library-manage").transition("hide"),H(e).then(e=>U().then(t=>{return{...e,is_board_member:t,is_workspace_guest:"read"===(null===(n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}).getContext().permissions)||void 0===n?void 0:n.organization)};var n})).then((function(o){u()===e+"s"&&($(".command-list-loading").transition("hide"),$(".create-command-buttons").transition("show"),o.is_admin?function(e){const t=$(".admin-ui .admin-member-select");if(e.match(/button/))return h.setAdminOnBehalfOf(),void t.dropdown({onChange(){}}).dropdown("clear");const n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});TrelloPowerUp.Promise.join(n.board("members"),n.member("all")).spread((function(n,r){const o=t.find(".menu");o.find(">.item").remove(),o.append(`
    ${E(r.fullName)} (@${E(r.username)})
    `),n.members.forEach((function(e){e.id!==r.id&&o.append(`
    ${E(e.fullName)} (@${E(e.username)})
    `)}));const a=o.find(".ui.search.input");n.members.length>9?a.show():a.hide(),t.dropdown({onChange(t){t===r.id&&(t=void 0),h.getAdminOnBehalfOf()!==t&&(h.setAdminOnBehalfOf(t),de(e),p.logEvent("engagement","admin_select"))}}),$(".admin-ui").transition("show")}))}(e):$(".admin-ui").transition("hide"),ie.is_admin=o.is_admin,$(".command-section .new-command-btn").transition(!1===o.obo_writable?"hide":"show"),o.commands.forEach((function(e){le(e,!0,null,o.obo_writable,o.is_board_member,o.is_workspace_guest)})),re(),I.taskSucceeded({taskName:"view-butlerCommands/dashboard",traceId:r,source:n}),t&&t())})).catch((function(e){g(new Error("loadCommands: "+e.message),"loadCommands"),I.taskFailed({taskName:"view-butlerCommands/dashboard",traceId:r,source:n,error:e}),$(".command-list-loading").transition("hide"),"NOT_AUTHORIZED"===e.message?$(".command-list-error.not-authorized").transition("show"):$(".command-list-error.error-loading").transition("show")}))}function he(e,t,n,r){let{label:o,icon:a,image:i,enabled:s,close_card:c,boards:u,skipDoneRedirect:l}=r;const d={label:o,icon:a,image:i,cmd:n,enabled:s,close:c?1:void 0,b:u};return h.updateCommandId(e,d).then((function(){return h.getCommands(t)})).then(e=>U().then(t=>({...e,is_board_member:t}))).then((function(t){const{commands:n,is_board_member:r}=t;if(l)return;re(),v(),j(n);const a=n.findIndex((function(t){return t.id===e})),i=n.splice(a,1)[0];$("#"+e).remove();const s=n.findIndex((function(e){return e.label>o}));le(i,!1,-1===s?null:n[s].id,t.obo_writable,r),G(!0)}))}let _e=!1;const{collectPhrase:fe}=c;function pe(){const e="rules"===u();e?$(".command-actions").removeClass("basic segment"):$(".command-actions").addClass("basic segment");let t=$(".builder-output .item").length;if(ie.has_trigger){const n=$(".builder.triggers"),r=$(".builder.actions");if(!$(".builder-output .output-trigger .list").children().length)return e?(Ie(1,"active"),Ie(2,"default"),Ie(3,"default"),$(".command-creation-container").transition("hide")):($(".command-creation-container").transition("show"),$(".js-empty-trigger").transition("show")),$(".save-builder-output-btn").toggleClass("disabled",!0),$(".add-automation-builder-output-btn").addClass("disabled"),$(".output-trigger .command-trigger").transition("hide"),$(".output-actions").transition("hide"),r.transition("hide"),void(ie.has_trigger&&n.transition("fade down"));e&&(Ie(1,"completed"),Ie(2,"active"),$(".command-creation-container").transition("show")),$(".js-empty-trigger").transition("hide"),$(".output-trigger .command-trigger").transition("show"),t-=1,r.hasClass("hidden")&&n.transition({animation:"fade down",duration:"0.33s",onComplete(){r.transition("fade down")}})}const n=$(".builder-output"),o=$(".builder-output .output-actions");$(".save-builder-output-btn").toggleClass("disabled",!t),$(".add-automation-builder-output-btn").toggleClass("disabled",!t),$(".add-actions").transition("hide"),t?(e?(Ie(2,"completed"),Ie(3,"active"),ie.shareCommand||($(".add-another-action-container").transition("show"),$(".actions-body").hasClass("visible")&&$(".actions-body").transition("hide")),1===t?$(".remove-action-btn").removeClass("enabled").addClass("disabled"):$(".remove-action-btn").removeClass("disabled").addClass("enabled")):($(".actions-body").transition("show"),$(".first-action").transition("hide"),$(".another-action").transition("show")),$(".js-empty-actions").transition("hide"),$(".js-empty-actions-command-sharing").transition("hide"),$(".output-actions .command-actions").transition("show"),n.hasClass("hidden")?(o.transition("show"),n.transition("fade down")):o.hasClass("hidden")&&o.transition("fade down")):($(".output-actions .command-actions").transition("hide"),e?($(".output-actions").transition("hide"),$(".actions-body").hasClass("hidden")&&$(".actions-body").transition("fade in")):($(".output-actions").transition("show"),$(".actions-body").transition("show"),$(".first-action").transition("show"),$(".another-action").transition("hide")),ie.shareCommand&&$(".js-empty-actions-command-sharing").transition("show")),ie.shareCommand&&($(".builder.actions-body").transition("hide"),$(".builder-output .review-command").transition("show"),ie.done&&($(".first-action").transition("hide"),$(".js-empty-actions").transition("hide"),$(".js-empty-actions-command-sharing").transition("hide"),$(".output-actions .command-actions").transition("hide"),$(".builder-output .review-command").transition("hide"),$(".builder-output .output-done-command").transition("show"),window.matchMedia("(prefers-reduced-motion: reduce)").matches||i({angle:r.random(55,125),spread:r.random(50,70),particleCount:r.random(40,75),origin:{x:(parseInt($(".left-pane").css("width"),10)+parseInt($(".right-pane").css("padding-left"),10))/window.innerWidth}})))}function me(e,t){e?($(".js-empty-trigger").transition("show"),$(".output-trigger .command-trigger").transition("hide"),$(".output-actions").transition("hide"),$(".builder.triggers").transition("show"),$(".builder.actions").transition("hide")):($(".js-empty-trigger").transition("hide"),$(".output-trigger .command-trigger").transition("show"),$(".output-actions").transition("show"),$(".builder.triggers").transition("hide"),$(".builder.actions").transition("show")),t?$(".builder-output .output-trigger").transition("show"):$(".builder-output .output-trigger").transition("hide")}function ge(){const e=this.closest(".item");$(e).prev().detach().insertAfter(e)}function be(e){const t=$(e.target).closest(".item");t.transition({animation:"fade down",duration:"0.33s",onComplete(){t.remove(),Te()}}),$(".too-many-actions").transition("hide"),$(".implicit-multiplier-stop").transition("hide")}function Ee(e,t){$(".list-does-not-exist-trigger").transition("hide");const n=_.triggerOutput(e);n.appendTo($(".builder-output .output-trigger .list")),n.find(".remove-trigger-btn").off("click").click((function(e){be(e)}));const r=n.find('[name="list-name"]');if(r.length&&t){const e=r.val();c.getListsByBoardId(t.id).then((function(n){n.some(t=>t.name===e)?c.setupListNameAutoComplete(r,{lists:n}):($(".list-does-not-exist-trigger").html(`The list ${E(e)} does not exist on ${t.name}. Please pick a different list.`).transition("show"),r.css("opacity",.4),c.setupListNameAutoComplete(r,{lists:n,clear_invalid_value:!0,listWarning:$(".list-does-not-exist-trigger")}),r.addClass("quoted-value-highlighted"),$(".prompt:first").focus())}))}else r.length&&c.setupListNameAutoComplete(r);const o=n.find('[name="board-name"]');o.length&&c.setupBoardNameAutoComplete(o,null,!0),Te()}const Te=()=>requestAnimationFrame(pe);function Ae(e,t){if($(".builder-output .output-actions .list .item").length>=(k||20))return void $(".too-many-actions").transition("show");if($(".too-many-actions").transition("hide"),$(".builder-output .output-actions .list .item.implicit-multiplier").length)return void $(".implicit-multiplier-stop").transition("show");$(".implicit-multiplier-stop").transition("hide"),$(".list-does-not-exist-action").transition("hide");const n=_.actionOutput(e);n.appendTo($(".builder-output .output-actions .list")),n.find(".remove-action-btn").off("click").click((function(e){$(".builder-output .output-actions .list .item").length-1==0&&(Ie(1,"completed"),Ie(2,"active"),Ie(3,"default")),be(e)})),n.find(".move-up-action-btn").off("click").click(ge);const r=n.find('[name="list-name"]');if(r.length&&t){const e=r.val();c.getListsByBoardId(t.id).then((function(n){n.some(t=>t.name===e)?c.setupListNameAutoComplete(r,{lists:n}):($(".list-does-not-exist-action").html(`The list ${E(e)} does not exist on ${t.name}. Please pick a different list.`).transition("show"),r.css("opacity",.4),c.setupListNameAutoComplete(r,{lists:n,clear_invalid_value:!0,listWarning:$(".list-does-not-exist-action")}),r.addClass("quoted-value-highlighted"),$(".prompt:first").focus())}))}else r.length&&c.setupListNameAutoComplete(r);const o=n.find('[name="board-name"]');o.length&&c.setupBoardNameAutoComplete(o,null,!0);const a=n.find('[name="card-title-search"]');a.length&&c.setupCardLinkAutoComplete(a),Te()}function ve(){const e=[];return $(".builder-output .output-phrase").each((function(t,n){e.push(fe($(n)[0]).trim())})),c.joinCommandPhrases(e,ie.has_trigger)}function ye(e){let t,{type:n,command:o,board:a,resetCallback:s,skipDoneRedirect:c}=e;switch(n){case"card-button":case"board-button":t=!0}if(t&&!$(".ui.form.button-config").form("is valid"))return;const l=ve(),d=$('.ui.form.button-config input[name="button-label"]').val().substring(0,100),_=$(".ui.form.button-config .button-icon-select > i").attr("class"),f=$(".ui.form.button-config .button-icon-select > i").attr("data-image"),b=$(".ui.form.button-config .button-enabled").prop("checked"),E=$(".ui.form.button-config .button-close-card").prop("checked"),T=$(".cancel-btn");T.addClass("disabled");const A=$(".save-builder-output-btn");$(".add-automation-builder-output-btn").addClass("disabled"),A.addClass("disabled");const y=A.find("i"),O=y.attr("class");y.attr("class","notched circle loading icon");const C=function(e){setTimeout((function(){T.removeClass("disabled"),s?s(e):(A.removeClass("disabled"),y.attr("class",O),e?(g(new Error("saveBuilderOutput: "+e.message),"saveBuilderOutput"),A.attr("data-tooltip","Error saving: "+("object"==typeof e?e.message:e)).transition("shake")):A.attr("data-tooltip",null))}),0)};if(o&&o.id){const e=D[u().trim()],t=I.startTask({taskName:"edit-butlerCommand/dashboard",source:e});I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"saveBuilderOutputButton",source:D[u().trim()],attributes:{commandType:r.camelCase(o.type),idCommand:o.id,saveType:"update"}}),a&&!o.b.some(e=>e===a.id)&&o.b.push(a.id),he(o.id,o.type,l,{label:d,icon:_,image:f,enabled:b,close_card:E,boards:o.b,skipDoneRedirect:c}).then((function(){window.matchMedia("(prefers-reduced-motion: reduce)").matches||i({angle:r.random(55,125),spread:r.random(50,70),particleCount:r.random(40,75)}),I.taskSucceeded({taskName:"edit-butlerCommand/dashboard",traceId:t,source:e}),C()})).catch((function(n){I.taskFailed({taskName:"edit-butlerCommand/dashboard",traceId:t,source:e,error:n}),C(n)}))}else{const e=D[u().trim()],t=I.startTask({taskName:"create-butlerCommand/dashboard",source:e});I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"saveBuilderOutputButton",source:e,attributes:{commandType:r.camelCase(n),idCommand:"",saveType:"new"}}),function(e,t,n){let{label:o,icon:a,image:i,enabled:s,close_card:c,boards:l,skipDoneRedirect:d}=n,_={label:o,icon:a,image:i,cmd:t,type:e,shared:!1,scope:h.ScopeBoard,enabled:s,close:c?1:void 0,b:l};return H(e).then((function(n){return h.addCommand(_).then((function(t){return _=t,h.getCommands(e)})).then(e=>U().then(t=>({...e,is_board_member:t}))).then((function(a){let{commands:i,is_board_member:s}=a;const c=j(i).findIndex((function(e){return e.label>o}));return le(_,!1,-1===c?null:i[c].id,n.obo_writable,s),d||(re(),v()),m.getUserPlanLocal().then(e=>{let{plan_id:t}=e;I.sendTrackEvent({action:"created",actionSubject:"command",source:D[u().trim()],attributes:{commandType:r.camelCase(_.type),plan:t}})}),p.logEvent("engagement","add_command_"+e,{type:e,length:t.length}),!0}))}))}(n,l,{label:d,icon:_,image:f,enabled:b,close_card:E,boards:a?[a.id]:void 0,skipDoneRedirect:c}).then((function(){window.matchMedia("(prefers-reduced-motion: reduce)").matches||i({angle:r.random(55,125),spread:r.random(50,70),particleCount:r.random(40,75)}),I.taskSucceeded({taskName:"create-butlerCommand/dashboard",traceId:t,source:e}),C()})).catch((function(n){I.taskFailed({taskName:"create-butlerCommand/dashboard",traceId:t,source:e,error:n}),C(n)}))}}function Oe(e){"rules"===u()?($(""+e).hide(),$(e+"-rules").show()):($(""+e).show(),$(e+"-rules").hide())}function Ie(e,t){const n=$("#step-circle-"+e);$("#step-description-"+e).removeClass().addClass("step-description step-description-"+t),n.removeClass().addClass("step-circle step-circle-"+t),"completed"===t?n.html(""):n.text(e)}function Ce(e){let{type:t,command:n,suggestion:r,duplicate:o,share:a,done:i,board:s}=e;!function(e){let{type:t,share:n,done:r}=e;ie={};let o="";$(".rules-steps-section").transition("hide"),$(".command-creation-container").addClass("command-creation-padding");const a=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});switch(t){case"card-button":o="Create a Card Button",ie.has_trigger=!1;break;case"board-button":o="Create a Board Button",ie.has_trigger=!1;break;case"rule":o="Create a Rule",Ie(1,"default"),Ie(2,"default"),Ie(3,"default"),ie.has_trigger=!0;break;case"schedule":o="Create a scheduled automation",ie.has_trigger=!0;break;case"on-date":o="Create a due date automation",ie.has_trigger=!0}if($(".video-link").attr("href",M(t,!1)),n?(o="Review your automation",ie.shareCommand=!0):"rules"===u()&&($(".rules-steps-section").transition("show"),$(".command-creation-container").removeClass("command-creation-padding")),r&&(o="Done!",ie.done=!0),$(".create-header").text(o),_e)return;ie.has_trigger||$(".add-triggers").transition("hide"),_e=!0,$(".builder-start-hidden").transition("hide"),$(".builder-tabs .item").tab({onFirstLoad(){c.setupDropdowns(this)}}),c.setupDropdowns(".builder .ui.tab.active"),$(".user-timezone").text(moment.tz.guess()),c.setupClauses(),c.setupInputFields(".builder"),c.setupPowerUpAutoComplete(".builder"),$("#builder-open-help").popup({on:"click",inline:!1,popup:$(".builder-help"),position:"top right",lastResort:"top right",hoverable:!1}),$(".builder-example").click((function(){return!1})).each((function(e,t){const n=$(t),r=n.next(".ui.popup");$(t).popup({on:"click",popup:r,target:!!n.length&&n,position:"top center",lastResort:!0,hoverable:!1,boundary:".builder-wizard-body"})})),$(".builder-advanced-toggle").checkbox({onChecked(){a.set("member","private","advanced",!0),$(".builder-basic").addClass("hidden").hide(),$(".builder-advanced").removeClass("hidden").show()},onUnchecked(){a.set("member","private","advanced",!1),$(".builder-basic").removeClass("hidden").show(),$(".builder-advanced").addClass("hidden").hide()}}),$(".builder-basic").removeClass("hidden").show(),$(".builder-advanced").addClass("hidden").hide(),$(".builder-advanced-toggle").checkbox("set unchecked"),a.get("member","private","advanced").then((function(e){e?($(".builder-basic").addClass("hidden").hide(),$(".builder-advanced").removeClass("hidden").show(),$(".builder-advanced-toggle").checkbox("set checked")):($(".builder-basic").removeClass("hidden").show(),$(".builder-advanced").addClass("hidden").hide(),$(".builder-advanced-toggle").checkbox("set unchecked"))})),$(".builder-show-more-content").hide(),$(".builder-show-more").click((function(){return $(".builder-show-more").hide(),$(".builder-show-more-content").show(),!1})),$(".triggers .phrase").prepend(''),$(".actions .phrase").prepend('
    '),$("form.ui.vertical.segment.phrase").submit(e=>{e.preventDefault();if($(e.target).closest(".phrase").find('input[type="text"]:not(.optional):visible').filter((function(){return!this.value})).addClass("error").off("focus").focus((function(){$(this).removeClass("error")})).length)return;const t=$(e.target).closest(".phrase"),n=fe(t[0]).split("\n");if(t.hasClass("multiday")&&n.some(e=>e.includes("select")))return $(t).transition("shake"),void $(t).children(".dropdown").addClass("error").off("hover").hover((function(){$(this).removeClass("error")}));n.slice(1).forEach(e=>Ae(e));const{top:r}=$(".builder-wizard").offset();r<$("html").scrollTop()&&$("html,body").animate({scrollTop:r},"slow"),Ee(n[0])}),$(".select-action-btn").click((function(e){if($(e.target).closest(".phrase").find('input[type="text"]:not(.optional):visible').filter((function(){return!this.value})).addClass("error").off("focus").focus((function(){$(this).removeClass("error")})).length)return;const t=$(e.target).closest(".phrase"),n=fe(t[0]),{top:r}=$(".builder-wizard").offset();r<$("html").scrollTop()&&$("html,body").animate({scrollTop:r},"slow"),"rules"===u()&&$(".add-another-action-container").show(),Ae(n),$(".select-action-btn").blur()}))}({type:t,share:a,done:i}),R.forEach(e=>{$("body").append($(e).detach())}),n&&n.id?v(a?{action:"share",commandId:n.id}:{action:"edit",commandId:n.id}):v(n?{action:"new",newCommand:n.cmd,newIcon:n.image,newLabel:n.label}:{action:"new"}),N($(".builder .cancel-btn, .builder-wizard .cancel-btn"),r?function(){re(),Re()}:function(){re(),v()},{offClick:!0});const l=$(".builder-wizard:visible").length,d=function(){!function(e){let{command:t,suggestion:n,duplicate:r,share:o,done:a,board:i}=e;if($(".ui.form.button-config").form("clear"),$(".ui.form.button-config .button-enabled").prop("checked",!0),$(".phrase input.error").removeClass("error"),$(".builder-output .list").empty(),"rules"===u()?($(".js-empty-trigger").transition("hide"),$(".js-empty-actions").transition("hide"),$(".add-triggers").addClass("blue"),$(".command-trigger").removeClass("basic segment"),$(".command-creation-container").transition("hide"),$(".output-trigger").addClass("output-trigger-padding")):($(".js-empty-trigger").transition("show"),$(".js-empty-actions").transition("show"),$(".add-triggers").removeClass("blue"),$(".command-trigger").addClass("basic segment"),$(".command-creation-container").transition("show"),$(".command-creation-container").removeClass("command-creation-padding"),$(".output-trigger").removeClass("output-trigger-padding"),$(".add-another-action-container").transition("hide")),Oe(".select-trigger-heading"),Oe(".trigger-heading"),Oe(".action-heading"),Oe(".select-action-heading"),$(".js-empty-actions-command-sharing").transition("hide"),$(".add-actions").transition("show"),$(".actions-body").transition("hide"),$(".add-triggers").transition("show"),$(".triggers-body").transition("hide"),$(".output-actions .command-trigger").transition("hide"),$(".output-actions .command-actions").transition("hide"),$(".builder-output .review-command").transition("hide"),$(".save-builder-output-btn").toggleClass("disabled",!0),$(".save-builder-output-btn").show(),$(".cancel-btn").show(),$(".another-action").transition("hide"),$(".builder-output .output-done-command").transition("hide"),$(".add-automation-builder-output-btn").transition("hide"),$(".add-automation-cancel-btn").transition("hide"),$(".back-to-rules-btn").transition("hide"),$(".add-automation-builder-output-btn").toggleClass("disabled",!0),$(".multiday-select").dropdown("clear"),t){let{label:e}=t;e&&r&&(e+=" (copy)"),$('.ui.form.button-config input[name="button-label"]').val(e),$(".ui.form.button-config .button-enabled").prop("checked",t.enabled),$(".ui.form.button-config .button-close-card").prop("checked",t.close);const n=$(".ui.form.button-config .button-icon-select .menu i").removeClass("selected").filter(`[data-image="${t.image}"]`).addClass("selected");n.length&&$(".ui.form.button-config .button-icon-select > i").replaceWith(n.clone())}const s=t?t.cmd.split(",\n").map((function(e){return"and "===e.substr(0,"and ".length)?e.substr("and ".length):e})):n?n.cmd:[];ie.has_trigger?s.length?(Ee(s.shift(),i),me(!1,!0)):me(!0,!0):me(!1,!1),o&&($(".add-another-action-container").transition("hide"),$(".save-builder-output-btn").hide(),$(".cancel-btn").hide(),$(".add-automation-builder-output-btn").transition("show"),$(".add-automation-cancel-btn").transition("show"),$(".js-review-command").html(`Your automation will be added to ${i.name}.`)),a?($(".add-automation-builder-output-btn").transition("hide"),$(".add-automation-cancel-btn").transition("hide"),$(".actions-body").transition("hide"),$(".back-to-rules-btn").transition("show"),me(!1,!1),$(".builder-output .output-actions").transition("hide"),$(".js-done-command").text(a.cmd),$(".js-done-command-board").html(`was added to ${i.name}`)):s.forEach(e=>Ae(e,i))}({command:n,suggestion:r,duplicate:o,share:a,done:i,board:s}),"rules"===u()?$(".select-trigger-heading-label").transition("show"):$(".select-trigger-heading-label").transition("hide"),l||$(".builder-wizard").transition({animation:"fade right",duration:"0s",onComplete(){}}),$(".add-automation-builder-output-btn").off("click").click((function(){I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"addAutomationButton",source:"adjustYourAutomationScreen"});const e=ve(),i=i=>{const c=$(".add-automation-builder-output-btn");i?(c.toggleClass("disabled",!1),g(new Error("addToAnotherBoard: "+i.message),"addToAnotherBoard"),c.attr("data-tooltip","Error saving: "+("object"==typeof error?i.message:i)).transition("shake")):(c.attr("data-tooltip",null),Ce({type:t,command:n,suggestion:r,duplicate:o,share:a,done:{cmd:e},board:s}))};e===n.cmd?($(".add-automation-builder-output-btn").toggleClass("disabled",!0),h.enableCommandId(n.id,!0,{board:s}).then((function(e){G(!0),Q(e),i()})).catch((function(e){g(new Error("enableCommand: "+e.message),"enableCommand"),i(e)}))):ye({type:t,command:void 0,board:s,resetCallback:i,skipDoneRedirect:!0})})),$(".add-automation-cancel-btn").off("click").click((function(){I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"addAutomationCancelButton",source:"adjustYourAutomationScreen"}),ie.share=void 0,ie.done=void 0,re(),v(),K(n,$("#"+n.id).find(".add-to-board-btn"))})),$(".back-to-rules-btn").off("click").click((function(){I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"backToRulesButton",source:"reviewYourAutomationScreen"});return H(u().replace(/s$/,"")).then((function(e){let{commands:t}=e;ie.share=void 0,ie.done=void 0,re(),v(),K(n,$("#"+n.id).find(".add-to-board-btn")),Q(n),j(t)}))})),$(".save-builder-output-btn").off("click").click((function(){o?ye({type:t}):n&&n.b&&(n.b.length>1||1===n.b.length&&!n.enabled)?$("#butler-confirm-edit-command").modal({onApprove(){ye({type:t,command:n})},onDeny(){ye({type:t})}}).modal("show"):ye({type:t,command:n})})),$(".role-select-clause").hide(),$(".mirror-action").hide(),$(".find-mirror-action").hide();const e=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});e.getContext().showCardRole&&$(".role-select-clause").show(),e.getContext().showMirrorAction&&$(".mirror-action").show(),e.getContext().showFindMirror&&$(".find-mirror-action").show()};l?d():$(".command-section").transition({animation:"fade right",duration:"0.33s",onComplete:d})}function Ne(){const e=u().replace(/s$/,"");return H(e).then((function(){ie.share=void 0,ie.done=void 0,Ce({type:e})}))}function De(){const e=$(".discarded-suggestion").length;if(!e)return $(".discarded-suggestions").transition("hide");$(".discarded-suggestions-count").text(e),$(".discarded-suggestions-btn").off("click").click((function(){return $(".discarded-suggestions").transition("scale"),$(".discarded-suggestion").transition("scale"),!1})),$(".discarded-suggestions").transition("show")}function we(e,t){let n,r;switch(e.type){case"rule":r=!0,n="Rule";break;case"schedule":r=!0,n="Scheduled (Calendar)";break;case"on-date":r=!0,n="Scheduled (Due Date)";break;case"board":r=!1,n="Board Button";break;default:r=!1,n="Card Button"}const o=$(`
    \n
    \n
    \n
    \n \n
    \n ${E(n)}\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n + Add\n
    \n
    \n
    \n\n
    \n
    \n
    ${E(c.joinCommandPhrases(e.cmd,r))}\n
    \n
    \n
    \n
    \n ${E(e.admin?"Recommended by a system administrator.":`Performed ${e.count} times, most recently ${moment(e.until).fromNow()}.`)+E("discard"===(e.user_action||{}).value?`Discarded ${moment(e.user_action.date).fromNow()}.`:"")}\n
    \n
    \n
    \n
    \n `);o.appendTo($(".suggestion-list")),o.find(".accept-suggestion-btn").click((function(){!function(e,t){const n=t.find(".accept-suggestion-btn");n.addClass("disabled");const r=n.children("i"),o=r.attr("class");r.attr("class","notched circle loading icon"),O.accept(e).then((function(){t.transition("scale"),t.removeClass("discarded-suggestion"),r.attr("class",o),n.removeClass("disabled");let a=e.type||"card";switch(a){case"board":case"card":a+="-button"}$(".video-link").attr("href",M(a,!1)),I.sendTrackEvent({action:"accepted",actionSubject:"suggestion",source:D[u().trim()],attributes:{suggestionType:e.type||"card",admin:e.admin,utility:e.utility}}),B(a,(function(){Ce({type:a,suggestion:e})}))})).catch((function(){r.attr("class","yellow warning sign icon"),n.transition("shake"),n.attr("data-tooltip","Error contacting server. Press to retry."),n.removeClass("disabled")})),p.logEvent("engagement","accept_suggestion",{utility:e.utility,admin:e.admin})}(e,o)})),o.find(".discard-suggestion-btn").click((function(){!function(e,t){const n=t.find(".discard-suggestion-btn");n.addClass("disabled");const r=n.children("i"),o=r.attr("class");r.attr("class","notched circle loading icon"),O.discard(e).then((function(){t.transition("scale"),t.addClass("discarded-suggestion"),r.attr("class",o),n.removeClass("disabled"),I.sendTrackEvent({action:"discarded",actionSubject:"suggestion",source:D[u().trim()],attributes:{suggestionType:e.type||"card",admin:e.admin,utility:e.utility}}),De()})).catch((function(){r.attr("class","yellow warning sign icon"),n.transition("shake"),n.attr("data-tooltip","Error contacting server. Press to retry."),n.removeClass("disabled")})),p.logEvent("engagement","discard_suggestion",{utility:e.utility,admin:e.admin})}(e,o)}))}function Se(e){$(".suggestion-list").empty(),$(".butler-no-suggestions").transition("hide"),$(".butler-no-more-suggestions").transition("hide"),$(".butler-refresh-wait").transition("hide"),$(".discarded-suggestions").transition("hide"),$(".more-suggestions").transition("hide"),$(".butler-error-loading-suggestions").transition("hide"),$(".butler-suggestions-loading").transition("show"),$(".refresh-suggestions-btn").addClass("disabled");const t=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});TrelloPowerUp.Promise.join(O.getSuggestions(t,e),h.getAllCommands()).spread((function(e,n){let{commands:r}=n;e.admin_suggestions&&(e.suggestions=[].concat(e.admin_suggestions,e.suggestions),delete e.admin_suggestions);const o=(new Date).toISOString(),{since:a,suggestions:i,suggestionDataToCache:s}=O.processSuggestionData(e,r,o);if($(".butler-suggestions-loading").transition("hide"),$(".refresh-suggestions-btn").removeClass("disabled"),i.length){e.refresh_wait&&($(".suggestions-refresh-wait").text(moment(e.refresh_wait).fromNow(!0)),$(".butler-refresh-wait").transition("slide down")),$(".suggestions-date").text(moment(s.dateLastUpdate).fromNow()),$(".suggestions-action-count").text(e.action_count),$(".suggestions-since").text(" in the last "+a),$(".suggestions-header").transition("show");let n=0,r=0;if(i.forEach((function(e){"discard"===(e.user_action||{}).value?we(e):n>=5?(r+=1,we(e,!0)):(n+=1,we(e))})),n||$(".butler-no-more-suggestions").transition("slide down"),r>0&&($(".more-suggestions-count").text(r),$(".more-suggestions-btn").off("click").click((function(){return $(".more-suggestions").transition("scale"),$(".hidden-suggestion").transition("scale"),!1})),$(".more-suggestions").transition("show")),De(),s)return s.dateLastSeen=o,t.set("board","private","suggestions",s)}else if($(".butler-no-suggestions").transition("slide down"),s)return s.dateLastSeen=o,t.set("board","private","suggestions",s)})).then((function(){O.setSuggestionTabUnseenCount(t)})).catch((function(e){if(o.captureException(e),"INVALID_TOKEN"===e.message||"USER_NOT_FOUND"===e.message)return s.reauthorize(t).then((function(){B("card-button")}));$(".butler-suggestions-loading").transition("hide"),$(".refresh-suggestions-btn").removeClass("disabled"),$(".butler-error-loading-suggestions").transition("slide down")})),p.logEvent("engagement",e?"refresh_suggestions":"load_suggestions")}function Re(){P(u().replace(/s$/,""));const e=parseInt($(".unseen-suggestion-count").text()||"0",10);I.sendScreenEvent({name:"butlerSuggestionsScreen",attributes:{numUnseenSuggestions:e}}),$(".refresh-suggestions-btn").off("click").click((function(){Se(!0)})),l("suggestions",!0),v(),Se(!1)}function ke(){const e=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});function t(t){const n=t;let r=!1;const a=$("#butler-command-importer-modal"),i=a.find(".js-importable-commands");a.modal({selector:{close:".right.corner.label"},onHide(){if(i.empty(),r){h.clearCachedServerCommands();const e=u();B("s"===e[e.length-1]?e.slice(0,-1):e),r=!1}}}),a.modal("show"),i.empty();const c={rules:"Rules",due_date:"Due date automations",calendar:"Scheduled automations",non_importable:"Non-Importable Commands"};function l(e,t){n[t]&&(n[t]=n[t].filter((function(t){return t.ccid!==e})),r=!0)}function d(t){const r=n[t]||[],a=$(`\n \n \n \n \n \n
    ${E(c[t])}
    `);r.forEach((function(r,i){let c=`${E(r.cmd)}`;c+='',"non_importable"!==t&&(c+='
    '),c+='',c+='',c+='
    ',c+="";const u=$(c);u.appendTo(a.find(`.${E(t)}-data-rows`)),"non_importable"!==t&&u.find(".command-import-btn").click((function(){!function(t,r,a){r.find(".command-import-btn").transition("hide"),r.find(".import-loading-icon").transition("show"),s.getToken(e).then((function(n){return new TrelloPowerUp.Promise((function(r,o){const a=e.getContext().board;$.ajax(f+"bot-command-import",{type:"POST",headers:{"X-Butler-Trello-Token":n},data:JSON.stringify({board_id:a,cmd:t.cmd,ccid:t.ccid})}).done((function(e){return e.success?r(e.response):o(new Error(e.error||"NO_RESPONSE"))})).fail((function(){return o(new Error("NETWORK_ERROR"))}))}))})).then((function(e){r.find(".import-loading-icon").transition("hide"),r.find(".import-success-icon").transition("show"),r.transition({animation:"fade down",duration:"1.13s",onComplete(){r.remove(),0===n[a].length&&$(".table."+a).transition("hide"),$(".rules-data-rows").children().length||$(".due_date-data-rows").children().length||$(".calendar-data-rows").children().length||$(".empty-list").transition("show")}}),e.ccid&&l(e.ccid,a)})).catch((function(e){r.find(".import-loading-icon").transition("hide"),r.find(".command-import-btn").attr("data-tooltip",e||"NO_RESPONSE").attr("alt",e).transition("shake"),r.find(".command-archive-btn").transition("show"),console.log("Error importing command",e),o.captureException(e)}))}(r,u,t)})),u.find(".command-archive-btn").click((function(){!function(t,r,a){r.find(".command-archive-btn").transition("hide"),r.find(".import-loading-icon").transition("show"),s.getToken(e).then((function(n){return new TrelloPowerUp.Promise((function(r,o){const a=e.getContext().board;$.ajax(f+"bot-command-archive",{type:"POST",headers:{"X-Butler-Trello-Token":n},data:JSON.stringify({board_id:a,cmd:t.cmd,ccid:t.ccid})}).done((function(e){return e.success?r(e.response):o(new Error(e.error||"NO_RESPONSE"))})).fail((function(){return o(new Error("NETWORK_ERROR"))}))}))})).then((function(e){r.find(".import-loading-icon").transition("hide"),r.find(".import-success-icon").transition("show"),r.transition({animation:"fade down",duration:"1.13s",onComplete(){r.remove(),0===n[a].length&&$(".table."+a).transition("hide"),$(".rules-data-rows").children().length||$(".due_date-data-rows").children().length||$(".calendar-data-rows").children().length||$(".empty-list").transition("show")}}),e.ccid&&l(e.ccid,a)})).catch((function(e){r.find(".import-loading-icon").transition("hide"),r.find(".command-archive-btn").attr("data-tooltip",e).attr("alt",e).transition("shake"),console.log("Error archiving bot command",e),o.captureException(e)}))}(r,u,t)}))})),a.appendTo($(".js-importable-commands")),r.length||$(".table."+t).transition("hide")}d("rules"),d("due_date"),d("calendar"),d("non_importable"),n.rules.length||n.due_date.length||n.calendar.length||a.find(".empty-list").transition("show"),a.modal("refresh")}s.getToken(e).then((function(t){return new TrelloPowerUp.Promise((function(n,r){const o=e.getContext().board;$.ajax(`${f}importable-commands?b=${o}`,{type:"GET",headers:{"X-Butler-Trello-Token":t}}).done((function(e){return e.success?n(e.response):r(new Error(e.error||"NO_RESPONSE"))})).fail((function(){return r(new Error("NETWORK_ERROR"))}))}))})).then((function(e){const n=e||{rules:[],calendar:[],due_date:[],non_importable:[]};(n.rules.length||n.calendar.length||n.due_date.length||n.non_importable.length)&&($(".butler-bot-command-import-btn").off("click").click((function(){return t(n),!1})),$(".butler-importable-commands").transition("show"))})).catch((function(e){"NOT_AUTHORIZED"!==e.message&&(console.log("Error fetching importable commands",e),o.captureException(e))}))}function Me(){const e=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),t=h.getAdminOnBehalfOf()||e.getContext().member;return TrelloPowerUp.Promise.join(h.getAllCommands(),h.getSharedLibraries()).spread((function(e,n){const{commands:r,obo_writable:o}=e,a={},i={};let s=n.map((function(e){return e.user_id===t?(e.is_own=!0,e.count=0,e.enabled=0,a[e.title]=e):i[e.title]=e,e}));return r.forEach((function(e){if(!e.lib)return;let n=a[e.lib];n||(n={user_id:t,title:e.lib,is_own:!0,count:0,enabled:0,src:i[e.lib]},a[e.lib]=n,n.src&&(n.src.used=!0),s.push(n)),++n.count,e.enabled&&++n.enabled})),s=s.filter((function(e){return!e.used})),s.sort((function(e,t){return e.is_own&&!t.is_own?-1:!e.is_own&&t.is_own?1:e.title.localeCompare(t.title)})),{libs:s,obo_writable:o}}))}function Le(e,t){const n=t?$("#butler-library-enable-modal"):$("#butler-library-disable-modal"),r=n.find(".library-command-list"),a=n.find("> .actions .ok");let i=!1;a.addClass("disabled"),n.find("> .content > .message").transition("hide").filter(".updating").transition("show"),n.find(".library-command-list").empty(),n.modal({transition:"fade",selector:{close:".right.corner.label"},onHide(){if(r.empty(),i){de(u().replace(/s$/,""))}},onApprove:()=>(n.find("> .content > .updating.message").transition("hide"),n.find("> .content > .enabling.message").transition("show"),n.find("> .content > .error-enabling.message").transition("hide"),a.addClass("disabled"),h.enableLibrary(e,t).then((function(){n.find("> .content > .enabling.message").transition("hide"),n.find("> .content > .success-enabling.message").transition("show"),i=!0,p.logEvent("engagement","lib_enable",t)})).catch((function(e){o.captureException(e),a.removeClass("disabled"),n.find("> .content > .enabling.message").transition("hide"),e&&"LIBRARY_SHARE_INVALID"===e.message?n.find("> .content > .message.error-share-access").transition("show"):n.find("> .content > .error-enabling.message").transition("show")})),!1)}),n.modal("show"),h.getAllCommands().then((function(t){const{commands:o}=t;r.empty();let i=``;o.forEach((function(t){if(t.lib!==e)return;const n=t.cmd.replace(/\n/g," ");i+=``})),i+="
    ${E(e)}
    ${E(n)}
    ",r.html(i),setTimeout((function(){n.find("> .content > .updating.message").transition("hide")})),n.modal("refresh"),a.removeClass("disabled")})).catch((function(e){o.captureException(e),n.find("> .content > .message.updating").transition("hide"),e&&"LIBRARY_SHARE_INVALID"===e.message?n.find("> .content > .message.error-share-access").transition("show"):n.find("> .content > .message.error-updating").transition("show")}))}function xe(){const e=$("#butler-library-sharing-modal"),t=e.find(".library-list");e.find("> .content > .message").transition("hide").filter(".updating").transition("show"),e.modal({selector:{close:".right.corner.label"},onHide(){t.empty()}}),e.modal("show");const n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});return TrelloPowerUp.Promise.all([m.getUserPlanLocal(n),Me()]).spread((function(n,r){const{libs:a,obo_writable:i}=r;t.empty();const s=a.filter((function(e){return e.is_own&&e.enabled||!1!==i}));s.forEach((function(e,r){let s=`",e.is_own&&!1!==i?(s+=``,n&&n.plan_id&&(!n.plan_id.startsWith("TRELLO_")||n.is_org&&"TRELLO_FREE"!==n.plan_id)&&(s+=``),e.src&&(s+=``)):s+=``,s+="
    ${E(e.title)}`;e.is_own?(!1!==i&&(s+='
    '),s+='
    '):s+='
    ',s+="
    ${E(e.count)} automations (${E(e.enabled)} enabled)
    A library with this name is shared by ${E(e.src.username?"@"+e.src.username:"another user")}
    ${E(e.username?"Shared by @"+e.username:"Shared by another user")}
    ";const c=$(s);c.appendTo(t),c.find(".library-share-tgl").closest(".ui.checkbox").checkbox({onChange(){!function(e,t){const n=$(e.target),r=e.target.checked;n.addClass("disabled"),(r?h.startSharing(t.title):h.stopSharing(t)).then((function(e){n.removeClass("disabled"),r?(t.link_id=e.link_id,t.org_id=e.org_id):(delete t.link_id,delete t.org_id),p.logEvent("engagement","lib_share",r)})).catch((function(t){o.captureException(t),n.removeClass("disabled"),$(e.target).closest(".ui.checkbox").checkbox("set "+(e.target.checked?"unchecked":"checked")).attr("data-tooltip","Error saving.").transition("shake")}))}({target:this},e)}}),c.find(".library-import-btn").click((function(){!function(e){const t=$("#butler-library-import-modal"),n=t.find(".library-command-list"),r=t.find("> .actions .ok");let a=!1;r.addClass("disabled"),t.find("> .content > .message").transition("hide").filter(".updating").transition("show"),t.find(".library-command-list").empty(),t.modal({transition:"fade",selector:{close:".right.corner.label"},onHide(){if(n.empty(),a){de(u().replace(/s$/,""))}},onApprove:()=>(t.find("> .content > .updating.message").transition("hide"),t.find("> .content > .importing.message").transition("show"),t.find("> .content > .error-importing.message").transition("hide"),t.find("> .content > .message.error-share-access").transition("hide"),r.addClass("disabled"),h.importLibrary(e).then((function(){t.find("> .content > .importing.message").transition("hide"),t.find("> .content > .success-importing.message").transition("show"),a=!0,p.logEvent("engagement","lib_import")})).catch((function(e){o.captureException(e),r.removeClass("disabled"),t.find("> .content > .importing.message").transition("hide"),e&&"LIBRARY_SHARE_INVALID"===e.message?t.find("> .content > .message.error-share-access").transition("show"):t.find("> .content > .error-importing.message").transition("show")})),!1)}),t.modal("show"),h.getSharedLibrary(e).then((function(e){n.empty();let o=``;0===e.cmds.length?t.find("> .content > .message.no-cmds-in-library").transition("show"):e.cmds.forEach((function(e){const t=e.cmd.replace(/\n/g," ");o+=``})),o+="
    ${E(e.title)}
    ${E(t)}
    ",n.html(o),setTimeout((function(){t.find("> .content > .updating.message").transition("hide")})),t.modal("refresh"),r.removeClass("disabled")})).catch((function(e){o.captureException(e),t.find("> .content > .message.updating").transition("hide"),e&&"LIBRARY_SHARE_INVALID"===e.message?t.find("> .content > .message.error-share-access").transition("show"):t.find("> .content > .message.error-updating").transition("show")}))}(e.src?e.src.link_id:e.link_id)})),c.find(".library-enable-btn").click((function(){Le(e.title,!0)})),c.find(".library-disable-btn").click((function(){Le(e.title,!1)})),c.find(".library-rename-btn").click((function(){!function(e,t){const n=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"}),r=h.getAdminOnBehalfOf()||n.getContext().member,a=$("#butler-library-rename-modal"),i=a.find('input[name="lib-name"]'),s=a.find('input[name="new-name"]');let c=!1;a.find("> .content > .message").transition("hide"),a.find(".ok.button").removeClass("disabled"),s.attr("disabled",!1);const l={};t.forEach((function(e){e.user_id===r&&(l[e.title]=!0)}));const d=function(){const t=s.val().trim();a.find(".rename-lib,.merge-libs,.remove-tag").transition("hide"),t?t===e.title?a.find(".rename-lib").transition("show").filter(".ok.button").addClass("disabled"):l[t]?a.find(".merge-libs").transition("show"):a.find(".rename-lib").transition("show").filter(".ok.button").removeClass("disabled"):a.find(".remove-tag").transition("show")};i.val(e.title),s.val(e.title).off("input").on("input",d),d(),a.modal({transition:"fade",selector:{close:".right.corner.label"},onHide(){if(c){de(u().replace(/s$/,""))}},onApprove(){s.attr("disabled",!0),a.find(".ok.button").addClass("disabled"),a.find("> .content > .renaming.message").transition("show"),a.find("> .content > .error-renaming.message").transition("hide");const t=s.val().trim();return h.renameLibrary(e.title,t).then((function(){a.find("> .content > .renaming.message").transition("hide"),a.find("> .content > .success-renaming.message").transition("show"),c=!0})).catch((function(e){o.captureException(e),s.attr("disabled",!1),a.find(".ok.button").removeClass("disabled"),a.find("> .content > .renaming.message").transition("hide"),a.find("> .content > .error-renaming.message").transition("show")})),!1}}),a.modal("show")}(e,a)}))})),s.length||e.find("> .content > .message.empty-list").transition("show"),setTimeout((function(){e.find("> .content > .updating.message").transition("hide")})),e.modal("refresh")})).catch((function(t){o.captureException(t),e.find("> .content > .message.updating").transition("hide"),e.find("> .content > .message.error-updating").transition("show")}))}function Fe(){$(".help-popup").click((function(){return!1})).each((function(e,t){const n=$(t),r=n.attr("data-popup-selector"),o=r?$(r):n.next(".ui.popup");n.popup({on:"click",popup:o,target:!!n.length&&n,position:"top center",lastResort:!0,hoverable:!1,boundary:".builder-wizard-body"})})),$(".close-popup").off("click").click((function(e){$(e.target).closest(".popup").popup("hide all")})),N($(".butler-account-details-btn"),(function(){return P(u().replace(/s$/,"")),Pe("activityLink",u()),x(u(),"account","showAccountOverlay",!0),!1}),{offClick:!0}),$(".butler-usage-details-btn").off("click").click((function(){return x(u(),"usage","showUsageOverlay",!0),!1})),$(".remove-command-popup .ok.button").click((function(e){const{is_admin:t}=ie;$(e.target).addClass("disabled"),function(e,t){const n=$(e.target).closest(".popup"),r=n.attr("command-id"),o=D[u().trim()],a=I.startTask({taskName:"delete-butlerCommand/dashboard",source:o});h.removeCommandId(r,t).then((function(){te(n.closest("#"+r)),n.transition("hide"),$("body").append($(".remove-command-popup").detach()),$(e.target).removeClass("disabled"),I.taskSucceeded({traceId:a,taskName:"delete-butlerCommand/dashboard",source:o})})).catch((function(t){g(new Error("removeCommand: "+t.message),"removeCommand"),I.taskFailed({traceId:a,taskName:"delete-butlerCommand/dashboard",source:o,error:t}),$(e.target).removeClass("disabled"),$(e.target).closest(".ui.button").transition("shake")}))}(e,t)})),$(".enabled-on-x-boards-popup .add-to-another-board-btn").click((function(e){const t=$(e.target).closest(".enabled-on-x-boards-popup"),n=t.attr("command-id");h.getCommandById(n,!0).then((function(e){t.transition("hide"),K(e,t.parent().find(".enabled-on-x-boards")),t.parent().find(".enabled-on-x-boards").popup("show")}))})),$(".add-command-to-board-popup .ok.button.add-automation-btn").click((function(e){$(e.target).addClass("disabled");const t=$(e.target).closest(".add-command-to-board-popup"),n=t.attr("command-id"),r=$(e.target).attr("command-board"),o=$(e.target).attr("command-board-id");r&&h.getCommandById(n,!0).then((function(e){t.transition("hide"),Y({command:e,share:!0,board:{name:r,id:o}}),I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"addAutomationToBoardButton",source:D[u().trim()]})}))})),$(".command-list-filter .ui.dropdown.filter").dropdown({onShow(){const e=$(this);W().then((function(t){const n=t.map((function(e){return`
    ${E(e)}`}));e.find('.item[data-type="lib"]').detach(),n.length?e.find(".divider.libs").transition("show").after(n):e.find(".divider.libs").transition("hide")}))},onChange(e){$(".command-list-filter .command-search").transition("search"===e?"show":"hide"),G(!0),$("html,body").animate({scrollTop:0},"slow")}}),$(".command-list-filter .command-search").off("input").on("input",(function(){G(!0)})),$(".builder.actions .add-actions").click((function(e){$(".builder.actions .actions-body").transition("show"),$(e.target).transition("hide")})),$(".builder.triggers .add-triggers").click((function(e){$(".select-trigger-heading-label").transition("hide"),Ie(1,"active"),$(".builder.triggers .triggers-body").transition("fade down"),$(e.target).transition("hide")})),$(".add-another-action-btn").click((function(){$(".actions-body").transition("fade down"),$(".add-another-action-container").transition("hide")})),$(".library-manage .button").off("click").click((function(){xe()}))}function Pe(e,t){I.sendUIEvent({action:"clicked",actionSubject:"link",actionSubjectId:e,source:D[t.trim()]})}const Be={init:function(){const e=TrelloPowerUp.iframe({targetOrigin:"https://trello.com"});h.init(e),s.ensureTokenValidity().then(()=>s.registerIfNecessary(e,!0,h)).then(()=>{$(".nav-bar").transition("show"),O.setSuggestionTabUnseenCount(e),$(".dashboard-tabs .ui.dropdown").dropdown({on:"hover"}),N($('.dashboard-tabs .item[data-tab="tab-suggestions"]'),(function(){Pe("suggestionsLink",u()),Re(),$(".left-pane").toggleClass("hidden")})),N($('.dashboard-tabs .item[data-tab="tab-card-buttons"]'),(function(){Pe("cardButtonLink",u()),B("card-button"),$(".left-pane").toggleClass("hidden")})),N($('.dashboard-tabs .item[data-tab="tab-board-buttons"]'),(function(){Pe("boardButtonLink",u()),B("board-button"),$(".left-pane").toggleClass("hidden")})),N($('.dashboard-tabs .item[data-tab="tab-rules"]'),(function(){Pe("ruleLink",u()),B("rule"),$(".left-pane").toggleClass("hidden")})),N($('.dashboard-tabs .item[data-tab="tab-schedules"]'),(function(){Pe("scheduleLink",u()),B("schedule"),$(".left-pane").toggleClass("hidden")})),N($('.dashboard-tabs .item[data-tab="tab-on-dates"]'),(function(){Pe("dueDateLink",u()),B("on-date"),$(".left-pane").toggleClass("hidden")})),N($(".feedback-nav"),(function(){Pe("feedbackLink",u())})),N($(".help-nav"),(function(){Pe("helpLink",u())})),N($('.dashboard-tabs .item[data-tab="tab-app-automations"],.integrations-tab-link'),(function(){L().then(e=>{I.sendScreenEvent({name:"butlerIntegrationsScreen",attributes:{numOfConnections:(e||[]).length}})}),$(".left-pane").toggleClass("hidden")})),$(".feedback").show();const t=new URLSearchParams(window.location.search),n=t.get("tab"),o=t.get("commandEdit"),i=t.get("commandLog"),c=t.get("usage"),l=t.get("account"),_=t.get("newCommand")?a(t.get("newCommand")):null,f=t.get("newIcon"),p=t.get("newLabel"),b=t.get("highlightCommand");function E(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=e=>{I.sendTrackEvent({action:"clicked",actionSubject:"link",actionSubjectId:"butlerDeepLink",attributes:{tab:n},source:D[e]})};switch(n){case"rules":B("rule",e),t("rules");break;case"card-buttons":case"card-button":B("card-button",e),t("card-buttons");break;case"board-buttons":case"board-button":B("board-button",e),t("board-buttons");break;case"schedule":case"schedules":case"scheduled":B("schedule",e),t("schedules");break;case"on-dates":case"due-dates":case"duedates":case"dates":B("on-date",e),t("on-dates");break;case"connected-apps":case"app-automations":L(),t("app-automations");break;case"suggestions":s.authorizeSoft().then((function(){Re()})),t("suggestions")}}if(o){const e=o;if("new"===o)if(_)try{const e={type:w[n],cmd:_,image:f,label:p?p.substring(0,100):null};B(w[n],()=>{Ce({type:w[n],command:e})})}catch(e){E(Ne)}else E(Ne);else h.getCommandById(e,!0).then((function(e){void 0!==e?B(e.type,()=>{e.is_own&&Ce({type:e.type,command:e}),I.sendTrackEvent({action:"clicked",actionSubject:"link",actionSubjectId:"butlerDeepLink",attributes:{tab:e.type,tabAction:"commandEdit",commandOwned:e.is_own},source:D[u().trim()]})}):E()}))}else if(i){const e=i;h.getCommandById(e,!0).then((function(t){void 0!==t?B(t.type,()=>{v({action:"log",commandId:t.id}),d.openCommandLog({id:e},null,v),I.sendTrackEvent({action:"clicked",actionSubject:"link",actionSubjectId:"butlerDeepLink",attributes:{tab:t.type,tabAction:"commandLog"},source:D[u().trim()]})}):E()}))}else c?x(n,c,"showUsageOverlay"):l?x(n,l,"showAccountOverlay"):b?h.getCommandById(b,!0).then((function(e){void 0!==e?B(e.type,()=>{$("#"+b).addClass("highlighted").get(0).scrollIntoView()}):E()})):E();s.authorizeSoft().then((function(){m.refreshUserPlan(e),m.getUserPlanLocal(e).then(e=>{var t;k=null==e||null===(t=e.overrides)||void 0===t?void 0:t.powerup_max_actions}).catch(e=>{g(e,"setPowerupMaxActions")}),ke()})).catch((function(){})).finally(()=>{$(".left-pane .item.tab-suggestions").hasClass("active")&&Re()}),N($(".command-section .new-command-btn"),(function(){const e=u().replace(/s$/,"");Ne().then(()=>{P(e),I.sendUIEvent({action:"clicked",actionSubject:"button",actionSubjectId:"newCommandButton",source:D[u().trim()],attributes:{commandType:r.camelCase(e)}})})})),$(".ui.form.button-config").form({fields:{"button-label":"empty"},on:"blur"}),$(".button-icon-select").dropdown({onChange(e){$(this).find(">i").replaceWith($(e))}}),Fe()}).catch(C,t=>{e.board("shortLink","name").then(t=>{const n=T(t.name);e.navigate({url:`https://trello.com/b/${t.shortLink}/${n}`,trigger:!0})}).catch(()=>{})}).catch(e=>{g(new Error("showDashboard-registerIfNecessary: "+e.message),"showDashboard-registerIfNecessary")})}};window.PowerUpDashboard=Be,e.exports=Be},function(e,t,n){"use strict";n.r(t),n.d(t,"create",(function(){return o}));var r={};!function e(t,n,r,o){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);function i(){}function s(e){var r=n.exports.Promise,o=void 0!==r?r:t.Promise;return"function"==typeof o?new o(e):(e(i,i),null)}var c,u,l,d,h,_,f,p,m=(l=Math.floor(1e3/60),d={},h=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(c=function(e){var t=Math.random();return d[t]=requestAnimationFrame((function n(r){h===r||h+l-1\n
    \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n `,i=`\n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n ${!e.is_own||n?'\n
    \n

    Anyone in this workspace can enable this button.

    \n
    \n ':a}\n
    \n
    `;return $(``)},commandItem:function(e,t,n){let r;r=`\n \n `;return $(`