diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b221d8944b..a06498a419 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,2 @@ -* @4ian \ No newline at end of file +* @4ian +Extensions/Firebase @arthuro555 \ No newline at end of file diff --git a/Extensions/Firebase/A_utils/A_UIDArray.js b/Extensions/Firebase/A_utils/A_UIDArray.js new file mode 100644 index 0000000000..1284f0337b --- /dev/null +++ b/Extensions/Firebase/A_utils/A_UIDArray.js @@ -0,0 +1,56 @@ +/** + * Firebase Tools Collection + * @fileoverview + * @author arthuro555 + */ + +/** + * A special array where push tries to reuse old unused indices. + * Why? This is for storing UIDs. You can see this as a sort of memory optimization: + * Each time an object is removed, it is replaced with null in the array. + * Then a new object can reuse that emplacement when pushing, instead of adding an element + * to the array. Technically the push function is not really pushing anymore, + * but the name is kept to make it easier for new devs to use (almost same API as classic array). + * @class + */ +gdjs.UIDArray = function () { + /** + * The internal array of UIDs. + * @type {Array} + * @private + */ + this._array = []; +}; + +/** + * Adds an object to the UIDs array and returns it's UID. + * @param {any} item - The item to assign a UID to. + * @returns {number} - The new UID of the object. + */ +gdjs.UIDArray.prototype.push = function (item) { + for (let i in this._array) { + if (this._array[i] === null) { + this._array[i] = item; + return parseInt(i); + } + } + return this._array.push(item) - 1; +}; + +/** + * Removes an element from the UIDs array by UID. + * @param {number} uid - The UID of the object to remove. + */ +gdjs.UIDArray.prototype.remove = function (uid) { + if (uid >= this._array.length) return; // Don't pollute the array with unecessary nulls. + this._array[uid] = null; +}; + +/** + * Get an element from the UIDs array by UID. + * @param {number} uid - The UID of the object to get. + */ +gdjs.UIDArray.prototype.get = function (uid) { + if (uid >= this._array.length) return null; // Prevent out of range getting. + return this._array[uid]; +}; diff --git a/Extensions/Firebase/B_firebasejs/A_firebase-base.js b/Extensions/Firebase/B_firebasejs/A_firebase-base.js new file mode 100644 index 0000000000..3340fc66b1 --- /dev/null +++ b/Extensions/Firebase/B_firebasejs/A_firebase-base.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).firebase=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;ra[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||0"})):"Error",l=this.serviceName+": "+s+" ("+o+").",c=new h(o,l),u=0,p=Object.keys(i);u=(null!=o?o:e.logLevel)&&a({level:D[t].toLowerCase(),message:i,args:r,type:e.name})}}(r[e])}}(e,t)},apps:null,SDK_VERSION:X,INTERNAL:{registerComponent:h,removeApp:function(e){delete c[e]},components:u,useAsService:function(e,t){if("serverAuth"===t)return null;return t}}};function f(e){if(!b(c,e=e||K))throw $.create("no-app",{appName:e});return c[e]}function h(r){var t,e,n,i=r.name;if(u.has(i))return Z.debug("There were multiple attempts to register component "+i+"."),"PUBLIC"===r.type?p[i]:null;u.set(i,r),"PUBLIC"===r.type&&(n=function(e){if(void 0===e&&(e=f()),"function"!=typeof e[i])throw $.create("invalid-app-argument",{appName:i});return e[i]()},void 0!==r.serviceProps&&v(n,r.serviceProps),p[i]=n,l.prototype[i]=function(){for(var e=[],t=0;ta[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(){for(var e=[],t=0;t"})):"Error",u=this.serviceName+": "+s+" ("+o+").",c=new p(o,u),l=0,f=Object.keys(i);l>>0),r=0;function s(t,e,n){return t.call.apply(t.bind,arguments)}function g(e,n,t){if(!e)throw Error();if(2/g,Z=/"/g,Q=/'/g,tt=/\x00/g,et=/[\x00&<>"']/;function nt(t,e){return-1!=t.indexOf(e)}function it(t,e){return t"}else o=void 0===t?"undefined":null===t?"null":typeof t;C("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function dt(t,e){this.a=t===mt&&e||"",this.b=vt}function pt(t){return t instanceof dt&&t.constructor===dt&&t.b===vt?t.a:(C("expected object of type Const, got '"+t+"'"),"type_error:Const")}dt.prototype.ra=!0,dt.prototype.qa=function(){return this.a},dt.prototype.toString=function(){return"Const{"+this.a+"}"};var vt={},mt={},gt=new dt(mt,"");function bt(t,e){this.a=t===At&&e||"",this.b=Et}function yt(t){return t instanceof bt&&t.constructor===bt&&t.b===Et?t.a:(C("expected object of type TrustedResourceUrl, got '"+t+"' of type "+n(t)),"type_error:TrustedResourceUrl")}function wt(t,n){var i=pt(t);if(!Tt.test(i))throw Error("Invalid TrustedResourceUrl format: "+i);return t=i.replace(It,function(t,e){if(!Object.prototype.hasOwnProperty.call(n,e))throw Error('Found marker, "'+e+'", in format string, "'+i+'", but no valid label mapping found in args: '+JSON.stringify(n));return(t=n[e])instanceof dt?pt(t):encodeURIComponent(String(t))}),new bt(At,t)}bt.prototype.ra=!0,bt.prototype.qa=function(){return this.a.toString()},bt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var It=/%{(\w+)}/g,Tt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Et={},At={};function kt(t,e){this.a=t===Rt&&e||"",this.b=Ot}function St(t){return t instanceof kt&&t.constructor===kt&&t.b===Ot?t.a:(C("expected object of type SafeUrl, got '"+t+"' of type "+n(t)),"type_error:SafeUrl")}kt.prototype.ra=!0,kt.prototype.qa=function(){return this.a.toString()},kt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Nt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function _t(t){return t instanceof kt?t:(t="object"==typeof t&&t.ra?t.qa():String(t),Nt.test(t)||(t="about:invalid#zClosurez"),new kt(Rt,t))}var Ot={},Rt={};function Ct(){this.a="",this.b=Pt}function Dt(t){return t instanceof Ct&&t.constructor===Ct&&t.b===Pt?t.a:(C("expected object of type SafeHtml, got '"+t+"' of type "+n(t)),"type_error:SafeHtml")}Ct.prototype.ra=!0,Ct.prototype.qa=function(){return this.a.toString()},Ct.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Pt={};function Lt(t){var e=new Ct;return e.a=t,e}Lt("");var Mt=Lt("");function xt(t,e){for(var n=t.split("%s"),i="",r=Array.prototype.slice.call(arguments,1);r.length&&1")&&(t=t.replace($,">")),-1!=t.indexOf('"')&&(t=t.replace(Z,""")),-1!=t.indexOf("'")&&(t=t.replace(Q,"'")),-1!=t.indexOf("\0")&&(t=t.replace(tt,"�"))),t}function Ut(t){return Ut[" "](t),t}Lt("
"),Ut[" "]=a;var Vt,Ft,qt=at("Opera"),Ht=at("Trident")||at("MSIE"),Kt=at("Edge"),Gt=Kt||Ht,Bt=at("Gecko")&&!(nt(X.toLowerCase(),"webkit")&&!at("Edge"))&&!(at("Trident")||at("MSIE"))&&!at("Edge"),Wt=nt(X.toLowerCase(),"webkit")&&!at("Edge");function Xt(){var t=l.document;return t?t.documentMode:void 0}t:{var Jt="",Yt=(Ft=X,Bt?/rv:([^\);]+)(\)|;)/.exec(Ft):Kt?/Edge\/([\d\.]+)/.exec(Ft):Ht?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Ft):Wt?/WebKit\/(\S+)/.exec(Ft):qt?/(?:Version)[ \/]?(\S+)/.exec(Ft):void 0);if(Yt&&(Jt=Yt?Yt[1]:""),Ht){var zt=Xt();if(null!=zt&&zt>parseFloat(Jt)){Vt=String(zt);break t}}Vt=Jt}var $t,Zt={};function Qt(s){return t=s,e=function(){for(var t=0,e=J(String(Vt)).split("."),n=J(String(s)).split("."),i=Math.max(e.length,n.length),r=0;0==t&&r"),a=a.join("")),a=se(o,a),s&&("string"==typeof s?a.className=s:Array.isArray(s)?a.className=s.join(" "):ne(a,s)),2>>0);function fn(e){return v(e)?e:(e[ln]||(e[ln]=function(t){return e.handleEvent(t)}),e[ln])}function dn(){Me.call(this),this.u=new Ye(this),(this.Yb=this).eb=null}function pn(t,e,n,i,r){t.u.add(String(e),n,!1,i,r)}function vn(t,e,n,i,r){t.u.add(String(e),n,!0,i,r)}function mn(t,e,n,i){if(!(e=t.u.a[String(e)]))return!0;e=e.concat();for(var r=!0,o=0;o>4&15).toString(16)+(15&t).toString(16)}kn.prototype.toString=function(){var t=[],e=this.f;e&&t.push(Ln(e,xn,!0),":");var n=this.b;return!n&&"file"!=e||(t.push("//"),(e=this.i)&&t.push(Ln(e,xn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.l)&&t.push(":",String(n))),(n=this.c)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(Ln(n,"/"==n.charAt(0)?Un:jn,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.g)&&t.push("#",Ln(n,Fn)),t.join("")},kn.prototype.resolve=function(t){var e=new kn(this),n=!!t.f;n?Sn(e,t.f):n=!!t.i,n?e.i=t.i:n=!!t.b,n?e.b=t.b:n=null!=t.l;var i,r=t.c;if(n)Nn(e,t.l);else if(n=!!t.c){if("/"!=r.charAt(0)&&(this.b&&!this.c?r="/"+r:-1!=(i=e.c.lastIndexOf("/"))&&(r=e.c.substr(0,i+1)+r)),".."==(i=r)||"."==i)r="";else if(nt(i,"./")||nt(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a2*t.c&&Tn(t)))}function Bn(t,e){return Hn(t),e=Jn(t,e),En(t.a.b,e)}function Wn(t,e,n){Gn(t,e),0'),i=a.document)&&(i.write(Dt(t)),i.close())):(a=i.open(St(e),n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(t){}return a}var ai=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,si=/^[^@]+@[^@]+$/;function ui(){var e=null;return new pe(function(t){"complete"==l.document.readyState?t():(e=function(){t()},nn(window,"load",e))}).o(function(t){throw rn(window,"load",e),t})}function ci(t){return t=t||yi(),!("file:"!==Ai()&&"ionic:"!==Ai()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function hi(){var t=l.window;try{return t&&t!=t.top}catch(t){return}}function li(){return void 0!==l.WorkerGlobalScope&&"function"==typeof l.importScripts}function fi(){return Wl.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":Wl.default.INTERNAL.hasOwnProperty("node")?"Node":li()?"Worker":"Browser"}function di(){var t=fi();return"ReactNative"===t||"Node"===t}var pi="Firefox",vi="Chrome";function mi(t){var e=t.toLowerCase();return nt(e,"opera/")||nt(e,"opr/")||nt(e,"opios/")?"Opera":nt(e,"iemobile")?"IEMobile":nt(e,"msie")||nt(e,"trident/")?"IE":nt(e,"edge/")?"Edge":nt(e,"firefox/")?pi:nt(e,"silk/")?"Silk":nt(e,"blackberry")?"Blackberry":nt(e,"webos")?"Webos":!nt(e,"safari/")||nt(e,"chrome/")||nt(e,"crios/")||nt(e,"android")?!nt(e,"chrome/")&&!nt(e,"crios/")||nt(e,"edge/")?nt(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":vi:"Safari"}var gi={jd:"FirebaseCore-web",ld:"FirebaseUI-web"};function bi(t,e){e=e||[];var n,i=[],r={};for(n in gi)r[gi[n]]=!0;for(n=0;n>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(t,function(t){e+=String.fromCharCode(t)}),e}function Pr(t){var e=Mr(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.g=t,this.c=e.exp,this.h=e.sub,this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function Lr(t){try{return new Pr(t)}catch(t){return null}}function Mr(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n Auth section -> Sign in method tab.",t):"http"==i||"https"==i?n=xt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",I.call(this,e,n)}function jo(t,e,n){I.call(this,t,n),(t=e||{}).Gb&&Fi(this,"email",t.Gb),t.da&&Fi(this,"phoneNumber",t.da),t.credential&&Fi(this,"credential",t.credential),t.Wb&&Fi(this,"tenantId",t.Wb)}function Uo(t){if(t.code){var e=t.code||"";0==e.indexOf(A)&&(e=e.substring(A.length));var n={credential:Oo(t),Wb:t.tenantId};if(t.email)n.Gb=t.email;else if(t.phoneNumber)n.da=t.phoneNumber;else if(!n.credential)return new I(e,t.message||void 0);return new jo(e,n,t.message)}return null}function Vo(){}function Fo(t){return t.c||(t.c=t.b())}function qo(){}function Ho(t){if(t.f||"undefined"!=typeof XMLHttpRequest||"undefined"==typeof ActiveXObject)return t.f;for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n=function t(e){return e.c?e.c:e.a?t(e.a):(C("Root logger has no level set."),null)}(this).value)for(v(e)&&(e=e()),t=new Wo(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var Qo,ta={},ea=null;function na(t){var e,n,i;return ea||(ea=new Xo(""),(ta[""]=ea).c=$o),(e=ta[t])||(e=new Xo(t),i=t.lastIndexOf("."),n=t.substr(i+1),(i=na(t.substr(0,i))).b||(i.b={}),(i.b[n]=e).a=i,ta[t]=e),e}function ia(t,e){t&&t.log(Zo,e,void 0)}function ra(t){this.f=t}function oa(t){dn.call(this),this.s=t,this.readyState=aa,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.i=new Headers,this.b=null,this.m="GET",this.g="",this.a=!1,this.h=na("goog.net.FetchXmlHttp"),this.l=this.c=this.f=null}e(ra,Vo),ra.prototype.a=function(){return new oa(this.f)},ra.prototype.b=(Qo={},function(){return Qo}),e(oa,dn);var aa=0;function sa(t){t.c.read().then(t.nc.bind(t)).catch(t.Sa.bind(t))}function ua(t,e){e&&t.f&&(t.status=t.f.status,t.statusText=t.f.statusText),t.readyState=4,t.f=null,t.c=null,t.l=null,ca(t)}function ca(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function ha(t){dn.call(this),this.headers=new In,this.D=t||null,this.c=!1,this.B=this.a=null,this.h=this.P=this.l="",this.f=this.O=this.i=this.N=!1,this.g=0,this.s=null,this.m=la,this.w=this.R=!1}(t=oa.prototype).open=function(t,e){if(this.readyState!=aa)throw this.abort(),Error("Error reopening a connection");this.m=t,this.g=e,this.readyState=1,ca(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.i,method:this.m,credentials:void 0,cache:void 0};t&&(e.body=t),this.s.fetch(new Request(this.g,e)).then(this.sc.bind(this),this.Sa.bind(this))},t.abort=function(){this.response=this.responseText="",this.i=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,ua(this,!1)),this.readyState=aa},t.sc=function(t){this.a&&(this.f=t,this.b||(this.b=t.headers,this.readyState=2,ca(this)),this.a&&(this.readyState=3,ca(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.qc.bind(this),this.Sa.bind(this)):void 0!==l.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.l=new TextDecoder,sa(this)):t.text().then(this.rc.bind(this),this.Sa.bind(this)))))},t.nc=function(t){var e;this.a&&((e=this.l.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done}))&&(this.response=this.responseText+=e),t.done?ua(this,!0):ca(this),3==this.readyState&&sa(this))},t.rc=function(t){this.a&&(this.response=this.responseText=t,ua(this,!0))},t.qc=function(t){this.a&&(this.response=t,ua(this,!0))},t.Sa=function(t){var e=this.h;e&&e.log(zo,"Failed to fetch url "+this.g,t instanceof Error?t:Error(t)),this.a&&ua(this,!0)},t.setRequestHeader=function(t,e){this.i.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.h)&&t.log(zo,"Attempting to get response header but no headers have been received for url: "+this.g,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.h;return t&&t.log(zo,"Attempting to get all response headers but no headers have been received for url: "+this.g,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},e(ha,dn);var la="";ha.prototype.b=na("goog.net.XhrIo");var fa=/^https?$/i,da=["POST","PUT"];function pa(e,t,n,i,r){if(e.a)throw Error("[goog.net.XhrIo] Object is active with another request="+e.l+"; newUri="+t);n=n?n.toUpperCase():"GET",e.l=t,e.h="",e.P=n,e.N=!1,e.c=!0,e.a=e.D?e.D.a():Lo.a(),e.B=e.D?Fo(e.D):Fo(Lo),e.a.onreadystatechange=b(e.Sb,e);try{ia(e.b,Ea(e,"Opening Xhr")),e.O=!0,e.a.open(n,String(t),!0),e.O=!1}catch(t){return ia(e.b,Ea(e,"Error opening Xhr: "+t.message)),void ma(e,t)}t=i||"";var o,a=new In(e.headers);r&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(p(t)||"string"==typeof t)U(t,e,void 0);else for(var n=wn(t),i=yn(t),r=i.length,o=0;o>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,a=(0|n[e-7])+((i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10)|0;n[e]=o+a|0}i=0|t.a[0],r=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;e<64;e++){var f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&s^r&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|Yu[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=r,r=i,i=a+f|0}t.a[0]=t.a[0]+i|0,t.a[1]=t.a[1]+r|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function oc(t,e,n){void 0===n&&(n=e.length);var i=0,r=t.c;if("string"==typeof e)for(;i>r&255;return F(t,function(t){return 1<(t=t.toString(16)).length?t:"0"+t}).join("")}function fc(t,e){for(var n=0;nt.f&&(t.a=t.f),e)}function eh(t){this.c=t,this.b=this.a=null}function nh(t){return t.b&&1e3*t.b.c||0}function ih(t,e){var n=e.refreshToken;t.b=Lr(e[Ka]||""),t.a=n}function rh(e,t){return i=e.c,r=t,new pe(function(e,n){"refresh_token"==r.grant_type&&r.refresh_token||"authorization_code"==r.grant_type&&r.code?za(i,i.u+"?key="+encodeURIComponent(i.c),function(t){t?t.error?n(Js(t)):t.access_token&&t.refresh_token?e(t):n(new I("internal-error")):n(new I("network-request-failed"))},"POST",Kn(r).toString(),i.g,i.m.get()):n(new I("internal-error"))}).then(function(t){return e.b=Lr(t.access_token),e.a=t.refresh_token,{accessToken:e.b.toString(),refreshToken:e.a}}).o(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t});var i,r}function oh(t,e){this.a=t||null,this.b=e||null,qi(this,{lastSignInTime:Li(e||null),creationTime:Li(t||null)})}function ah(t,e,n,i,r,o){qi(this,{uid:t,displayName:i||null,photoURL:r||null,email:n||null,phoneNumber:o||null,providerId:e})}function sh(t,e,n){var i;this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null,t=Wl.default.SDK_VERSION?bi(Wl.default.SDK_VERSION):null,this.a=new qa(this.l,N(E),t),this.b=new eh(this.a),ph(this,e[Ka]),ih(this.b,e),Fi(this,"refreshToken",this.b.a),gh(this,n||{}),dn.call(this),this.P=!1,this.s&&Ti()&&(this.i=Cc(this.s,this.l,this.m)),this.R=[],this.h=null,this.B=(i=this,new Qc(function(){return i.I(!0)},function(t){return!(!t||"auth/network-request-failed"!=t.code)},function(){var t=nh(i.b)-w()-3e5;return 0nh(this)-3e4?this.a?rh(this,{grant_type:"refresh_token",refresh_token:this.a}):Ie(null):Ie({accessToken:this.b.toString(),refreshToken:this.a})},oh.prototype.v=function(){return{lastLoginAt:this.b,createdAt:this.a}},e(sh,dn),sh.prototype.va=function(t){this.oa=t,Ja(this.a,t)},sh.prototype.ja=function(){return this.oa},sh.prototype.Ea=function(){return W(this.W)},sh.prototype.Ma=function(){this.B.b&&(this.B.stop(),this.B.start())},Fi(sh.prototype,"providerId","firebase"),(t=sh.prototype).reload=function(){var t=this;return Ph(this,yh(this).then(function(){return kh(t).then(function(){return vh(t)}).then(bh)}))},t.mc=function(t){return this.I(t).then(function(t){return new qc(t)})},t.I=function(t){var e=this;return Ph(this,yh(this).then(function(){return e.b.getToken(t)}).then(function(t){if(!t)throw new I("internal-error");return t.accessToken!=e.xa&&(ph(e,t.accessToken),e.dispatchEvent(new zc("tokenChanged"))),Eh(e,"refreshToken",t.refreshToken),t.accessToken}))},t.Ic=function(t){if(!(t=t.users)||!t.length)throw new I("internal-error");gh(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e,n=(e=(e=t).providerUserInfo)&&e.length?F(e,function(t){return new ah(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)}):[],i=0;i=Ol.length)throw new I("internal-error","Argument validator received an unsupported number of arguments.");n=Ol[r],i=(i?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.J+".";break t}i=null}}if(i)throw new I("argument-error",t+" failed: "+i)}(t=yl.prototype).Ga=function(){var e=this;return this.f?this.f:this.f=kl(this,Ie().then(function(){if(Ei()&&!li())return ui();throw new I("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return e.m.g(e.w())}).then(function(t){return e.g=t,Ws(e.s,Os,{})}).then(function(t){e.a[Tl]=t.recaptchaSiteKey}).o(function(t){throw e.f=null,t}))},t.render=function(){Sl(this);var n=this;return kl(this,this.Ga().then(function(){var t,e;return null===n.c&&(e=n.u,n.i||(t=ee(e),e=ae("DIV"),t.appendChild(e)),n.c=n.g.render(e,n.a)),n.c}))},t.verify=function(){Sl(this);var r=this;return kl(this,this.render().then(function(e){return new pe(function(n){var i,t=r.g.getResponse(e);t?n(t):(i=function(t){var e;t&&(e=i,G(r.l,function(t){return t==e}),n(t))},r.l.push(i),r.i&&r.g.execute(r.c))})}))},t.reset=function(){Sl(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){Sl(this),this.D=!0,this.m.c();for(var t,e=0;es[0]&&e[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||0>6|192:(55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128):e[n++]=i>>12|224,e[n++]=i>>6&63|128),e[n++]=63&i|128)}return e}function h(t){try{return p.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}var l={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},C=function(t,e){if(!t)throw c(e)},c=function(t){return new Error("Firebase Database ("+l.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},p={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,c=(3&o)<<4|a>>4,p=(15&a)<<2|l>>6,d=63&l;h||(d=64,s||(p=64)),r.push(n[u],n[c],n[p],n[d])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n>10)),e[r++]=String.fromCharCode(56320+(1023&i))):(o=t[n++],s=t[n++],e[r++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s))}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;r.push(c),64!==a&&(l=s<<4&240|a>>2,r.push(l),64!==h&&(u=a<<6&192|h,r.push(u)))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};function d(t){return function t(e,n){if(!(n instanceof Object))return n;switch(n.constructor){case Date:var r=n;return new Date(r.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return n}for(var i in n)n.hasOwnProperty(i)&&(e[i]=t(e[i],n[i]));return e}(void 0,t)}var y=(v.prototype.wrapCallback=function(n){var r=this;return function(t,e){t?r.reject(t):r.resolve(e),"function"==typeof n&&(r.promise.catch(function(){}),1===n.length?n(t):n(t,e))}},v);function v(){var n=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(t,e){n.resolve=t,n.reject=e})}function g(){return"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"")}function m(){return!0===l.NODE_ADMIN}var E,w="FirebaseError",b=(n(S,E=Error),S);function S(t,e){var n=E.call(this,e)||this;return n.code=t,n.name=w,Object.setPrototypeOf(n,S.prototype),Error.captureStackTrace&&Error.captureStackTrace(n,T.prototype.create),n}var T=(I.prototype.create=function(t){for(var e=[],n=1;n"})):"Error",h=this.serviceName+": "+a+" ("+o+").",l=new b(o,h),u=0,c=Object.keys(i);u>>31)}for(var o,s,a=this.chain_[0],h=this.chain_[1],l=this.chain_[2],u=this.chain_[3],c=this.chain_[4],r=0;r<80;r++){s=r<40?r<20?(o=u^h&(l^u),1518500249):(o=h^l^u,1859775393):r<60?(o=h&l|u&(h|l),2400959708):(o=h^l^u,3395469782);i=(a<<5|a>>>27)+o+c+s+n[r]&4294967295,c=u,u=l,l=4294967295&(h<<30|h>>>2),h=a,a=i}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+h&4294967295,this.chain_[2]=this.chain_[2]+l&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295},L.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r>i&255,++r;return t},L);function L(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t 4. Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}function Q(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(W(t,e,r)+"must be a valid function.")}function q(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(W(t,e,r)+"must be a valid context object.")}function U(t){for(var e=0,n=0;n>6|192:(o<65536?e[n++]=o>>12|224:(e[n++]=o>>18|240,e[n++]=o>>12&63|128),e[n++]=o>>6&63|128),e[n++]=63&o|128)}return e}(t),n=new A;n.update(e);var r=n.digest();return p.encodeByteArray(r)}function st(t,e){C(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(vt.logLevel=H.VERBOSE,Ct=vt.log.bind(vt),e&&yt.set("logging_enabled",!0)):"function"==typeof t?Ct=t:(Ct=null,yt.remove("logging_enabled"))}function at(){for(var t=[],e=0;e=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,Math.round(t/Math.pow(2,-1074))));for(var o=[],s=52;s;--s)o.push(r%2?1:0),r=Math.floor(r/2);for(s=11;s;--s)o.push(n%2?1:0),n=Math.floor(n/2);o.push(e?1:0),o.reverse();var a=o.join(""),h="";for(s=0;s<64;s+=8){var l=parseInt(a.substr(s,8),2).toString(16);1===l.length&&(l="0"+l),h+=l}return h.toLowerCase()}function Dt(t){try{t()}catch(e){setTimeout(function(){var t=e.stack||"";throw lt("Exception was thrown by user callback.",t),e},Math.floor(0))}}function Ot(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n}var xt=new RegExp("^-?(0*)\\d{1,10}$"),kt=function(t){if(xt.test(t)){var e=Number(t);if(-2147483648<=e&&e<=2147483647)return e}return null},Ft=(Object.defineProperty(At,"Empty",{get:function(){return new At("")},enumerable:!1,configurable:!0}),At.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},At.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},At.prototype.popFront=function(){var t=this.pieceNum_;return t=this.pieces_.length)return null;for(var t=[],e=this.pieceNum_;e=this.pieces_.length},At.relativePath=function(t,e){var n=t.getFront(),r=e.getFront();if(null===n)return e;if(n===r)return At.relativePath(t.popFront(),e.popFront());throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")},At.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;it.getLength())return!1;for(;eMt.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+Mt.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>Mt.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+Mt.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},Mt.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},Mt);function Mt(t,e){this.errorPrefix_=e,this.parts_=t.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n"),t},Vt.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},Vt);function Vt(t,e,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.includeNamespaceInQueryParams=o,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=_t.get("host:"+t)||this.host}function Ht(t){var e=ee(t),n=e.namespace;"firebase.com"===e.domain&&ht(e.host+" is no longer supported. Please use .firebaseio.com instead"),n&&"undefined"!==n||"localhost"===e.domain||ht("Cannot parse Firebase url. Please use https://.firebaseio.com"),e.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&<("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new Ut(e.host,e.secure,n,r,"",n!==e.subdomain),path:new Ft(e.pathString)}}function jt(t){return"string"==typeof t&&0!==t.length&&!ne.test(t)}function Bt(t){return"string"==typeof t&&0!==t.length&&!re.test(t)}function Kt(t){return null===t||"string"==typeof t||"number"==typeof t&&!ut(t)||t&&"object"==typeof t&&O(t,".sv")}function Yt(t,e,n,r,i){i&&void 0===n||oe(W(t,e,i),n,r)}function zt(t,e,n,r,i){if(!i||void 0!==n){var o=W(t,e,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var s=[];Rt(n,function(t,e){var n=new Ft(t);if(oe(o,e,r.child(n)),".priority"===n.getBack()&&!Kt(e))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");s.push(n)}),function(t,e){for(var n,r=0;rie/3&&U(t)>ie)throw new Error(n+"contains a string greater than "+ie+" utf8 bytes "+r.toErrorString()+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var i=!1,o=!1;if(Rt(t,function(t,e){if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!jt(t)))throw new Error(n+" contains an invalid key ("+t+") "+r.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(t),oe(n,e,r),r.pop()}),i&&o)throw new Error(n+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},se=(ae.prototype.cancel=function(t){M("OnDisconnect.cancel",0,1,arguments.length),Q("OnDisconnect.cancel",1,t,!0);var e=new y;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},ae.prototype.remove=function(t){M("OnDisconnect.remove",0,1,arguments.length),Zt("OnDisconnect.remove",this.path_),Q("OnDisconnect.remove",1,t,!0);var e=new y;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},ae.prototype.set=function(t,e){M("OnDisconnect.set",1,2,arguments.length),Zt("OnDisconnect.set",this.path_),Yt("OnDisconnect.set",1,t,this.path_,!1),Q("OnDisconnect.set",2,e,!0);var n=new y;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},ae.prototype.setWithPriority=function(t,e,n){M("OnDisconnect.setWithPriority",2,3,arguments.length),Zt("OnDisconnect.setWithPriority",this.path_),Yt("OnDisconnect.setWithPriority",1,t,this.path_,!1),Gt("OnDisconnect.setWithPriority",2,e,!1),Q("OnDisconnect.setWithPriority",3,n,!0);var r=new y;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},ae.prototype.update=function(t,e){if(M("OnDisconnect.update",1,2,arguments.length),Zt("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;rthis.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},Ir.prototype.addMerge=function(t,e,n){C(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},Ir.prototype.getWrite=function(t){for(var e=0;edocument.domain="'+document.domain+'";<\/script>');var o=""+i+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(o),this.myIFrame.doc.close()}catch(t){wt("frame writing exception"),t.stack&&wt(t.stack),wt(t)}}var ai="";var hi=null;"undefined"!=typeof MozWebSocket?hi=MozWebSocket:"undefined"!=typeof WebSocket&&(hi=WebSocket);var li=(ui.connectionURL_=function(t,e,n){var r={v:"5"};return"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(Wt)&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL(Qt,r)},ui.prototype.open=function(t,e){var n,r=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,_t.set("previous_websocket_failure",!0);try{m()||(n={headers:{"X-Firebase-GMPID":this.applicationId||""}},this.mySock=new hi(this.connURL,[],n))}catch(t){this.log_("Error instantiating WebSocket.");var i=t.message||t.data;return i&&this.log_(i),void this.onClosed_()}this.mySock.onopen=function(){r.log_("Websocket connected."),r.everConnected_=!0},this.mySock.onclose=function(){r.log_("Websocket connection was disconnected."),r.mySock=null,r.onClosed_()},this.mySock.onmessage=function(t){r.handleIncomingFrame(t)},this.mySock.onerror=function(t){r.log_("WebSocket error. Closing connection.");var e=t.message||t.data;e&&r.log_(e),r.onClosed_()}},ui.prototype.start=function(){},ui.forceDisallow=function(){ui.forceDisallow_=!0},ui.isAvailable=function(){var t,e=!1;return"undefined"!=typeof navigator&&navigator.userAgent&&((t=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/))&&1=Ii.MAX_TRANSACTION_RETRIES_?(g=!0,m="maxretry",i.concat(this.serverSyncTree_.ackUserWrite(y.currentWriteId,!0))):(a=this.getLatestState_(y.path,o),y.currentInputSnapshot=a,void 0!==(h=t[s].update(a.val()))?(oe("transaction failed: Data returned ",h,y.path),l=an(h),"object"==typeof h&&null!=h&&O(h,".priority")||(l=l.updatePriority(a.getPriority())),u=y.currentWriteId,c=this.generateServerValues(),p=On(l,a,c),y.currentOutputSnapshotRaw=l,y.currentOutputSnapshotResolved=p,y.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(u),1),(i=i.concat(this.serverSyncTree_.applyUserOverwrite(y.path,p,y.currentWriteId,y.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(u,!0))):(g=!0,m="nodata",i.concat(this.serverSyncTree_.ackUserWrite(y.currentWriteId,!0))))),this.eventQueue_.raiseEventsForChangedPath(e,i),i=[],g&&(t[s].status=Mi.COMPLETED,n=t[s].unwatcher,setTimeout(n,Math.floor(0)),t[s].onComplete&&("nodata"===m?(d=new Ai(this,t[s].path),f=t[s].currentInputSnapshot,_=new dn(f,d,ke),r.push(t[s].onComplete.bind(null,null,!1,_))):r.push(t[s].onComplete.bind(null,new Error(m),!1,null))))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(s=0;ss[0]&&e[1]"})):"Error",a=this.serviceName+": "+u+" ("+o+").",c=new b(o,a),h=0,f=Object.keys(i);h=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var S,D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},R={},O=D||self;function x(){}function k(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function L(t){var e=k(t);return"array"==e||"object"==e&&"number"==typeof t.length}function P(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var U="closure_uid_"+(1e9*Math.random()>>>0),C=0;function V(t,e,n){return t.call.apply(t.bind,arguments)}function M(e,n,t){if(!e)throw Error();if(2parseFloat(vt)){st=String(gt);break t}}st=vt}var mt={};function wt(u){return t=u,e=function(){for(var t=0,e=X(String(st)).split("."),n=X(String(u)).split("."),r=Math.max(e.length,n.length),i=0;0==t&&i>>0);function Gt(e){return"function"==k(e)?e:(e[zt]||(e[zt]=function(t){return e.handleEvent(t)}),e[zt])}function Ht(){z.call(this),this.c=new xt(this),(this.J=this).C=null}function Wt(t,e,n,r){if(!(e=t.c.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;oi.length?Fe:(i=i.substr(s,o),r.D=s+o,i)));if(a==Fe){4==e&&(t.h=4,Te(14),u=!1),ge(t.c,t.f,null,"[Incomplete Response]");break}if(a==Me){t.h=4,Te(15),ge(t.c,t.f,n,"[Invalid Chunk]"),u=!1;break}ge(t.c,t.f,a,null),Ke(t,a)}4==e&&0==n.length&&(t.h=1,Te(16),u=!1),t.b=t.b&&u,u?0>4&15).toString(16)+(15&t).toString(16)}tn.prototype.toString=function(){var t=[],e=this.f;e&&t.push(hn(e,ln,!0),":");var n=this.c;return!n&&"file"!=e||(t.push("//"),(e=this.j)&&t.push(hn(e,ln,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(hn(n,"/"==n.charAt(0)?dn:pn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",hn(n,yn)),t.join("")};var ln=/[#\/\?@]/g,pn=/[#\?:]/g,dn=/[#\?]/g,vn=/[#\?@]/g,yn=/#/g;function gn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function mn(n){n.a||(n.a=new Xe,n.b=0,n.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.c&&$e(t)))}function bn(t,e){return mn(t),e=En(t,e),Je(t.a.b,e)}function In(t,e,n){wn(t,e),0=t.f}function Sn(t){return t.b?1:t.a?t.a.size:0}function Dn(t,e){return t.b?t.b==e:t.a&&t.a.has(e)}function Rn(t,e){t.a?t.a.add(e):t.b=e}function On(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function xn(t){var e,n;if(null!=t.b)return t.c.concat(t.b.s);if(null==t.a||0===t.a.size)return Q(t.c);var r=t.c;try{for(var i=N(t.a.values()),o=i.next();!o.done;o=i.next())var s=o.value,r=r.concat(s.s)}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function kn(){}function Ln(){this.a=new kn}function Pn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}_n.prototype.cancel=function(){var e,t;if(this.c=xn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=N(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},kn.prototype.stringify=function(t){return O.JSON.stringify(t,void 0)},kn.prototype.parse=function(t){return O.JSON.parse(t,void 0)};var Un=O.JSON.parse;function Cn(t){Ht.call(this),this.headers=new Xe,this.H=t||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=Vn,this.D=this.F=!1}B(Cn,Ht);var Vn="",Mn=/^https?$/i,Fn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function qn(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,Bn(t),Gn(t)}function Bn(t){t.u||(t.u=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function zn(t){if(t.b&&void 0!==R&&(!t.s[1]||4!=Wn(t)||2!=t.X()))if(t.l&&4==Wn(t))oe(t.za,0,t);else if(t.dispatchEvent("readystatechange"),4==Wn(t)){t.b=!1;try{var e,n,r,i,o=t.X();t:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var s=!0;break t;default:s=!1}if((e=s)||((n=0===o)&&(!(i=String(t.B).match(Ze)[1]||null)&&O.self&&O.self.location&&(i=(r=O.self.location.protocol).substr(0,r.length-1)),n=!Mn.test(i?i.toLowerCase():"")),e=n),e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{t.h=6;try{var u=2=t.b.f-(t.h?1:0))){if(t.h)return t.g=e.s.concat(t.g),1;if(!(1==t.v||2==t.v||t.u>=(t.Ia?0:t.Ja)))return t.h=Ae(F(t.Ba,t,e),hr(t,t.u)),t.u++,1}}(t,e)||2==i&&or(t)))switch(r&&0e.length?1:0},ti),Qr=(o(Zr,Hr=Wr),Zr.prototype.o=function(t,e,n){return new Zr(t,e,n)},Zr.prototype.R=function(){return this.A().join("/")},Zr.prototype.toString=function(){return this.R()},Zr.P=function(t){if(0<=t.indexOf("//"))throw new xr(Or.INVALID_ARGUMENT,"Invalid path ("+t+"). Paths must not contain // in them.");return new Zr(t.split("/").filter(function(t){return 0t.length&&Fr(),void 0===n?n=t.length-e:n>t.length-e&&Fr(),this.segments=t,this.offset=e,this.t=n}function ei(t,e){if(0!==e.length)throw new xr(Or.INVALID_ARGUMENT,"Function "+t+"() does not support arguments, but was called with "+wi(e.length,"argument")+".")}function ni(t,e,n){if(e.length!==n)throw new xr(Or.INVALID_ARGUMENT,"Function "+t+"() requires "+wi(n,"argument")+", but was called with "+wi(e.length,"argument")+".")}function ri(t,e,n){if(e.lengthr)throw new xr(Or.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+wi(e.length,"argument")+".")}function oi(t,e,n,r){fi(t,e,mi(n)+" argument",r)}function si(t,e,n,r){void 0!==r&&oi(t,e,n,r)}function ui(t,e,n,r){fi(t,e,n+" option",r)}function ai(t,e,n,r){void 0!==r&&ui(t,e,n,r)}function ci(t,e,n,r,a){void 0!==r&&function(t,e,n){for(var r=[],i=0,o=a;i=Number.MIN_SAFE_INTEGER}var Wi=function(t,e,n,r,i,o,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.Z=null};function Qi(t,e,n,r,i,o,s){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),new Wi(t,e,n,r,i,o,s)}function Ki(t){var e,n=t;return null===n.Z&&(e=n.path.R(),null!==n.collectionGroup&&(e+="|cg:"+n.collectionGroup),e+="|f:",e+=n.filters.map(function(t){return(e=t).field.R()+e.op.toString()+Yo(e.value);var e}).join(","),e+="|ob:",e+=n.orderBy.map(function(t){return(e=t).field.R()+e.dir;var e}).join(","),zi(n.limit)||(e+="|l:",e+=n.limit),n.startAt&&(e+="|lb:",e+=Oa(n.startAt)),n.endAt&&(e+="|ub:",e+=Oa(n.endAt)),n.Z=e),n.Z}function Yi(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n,r,i=0;i":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},us=function(t,e){this.U=t,this.Ue=e};function as(t){return{integerValue:""+t}}function cs(t,e){if(t.Ue){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Gi(e)?"-0":e}}function hs(t,e){return Hi(e)?as(e):cs(t,e)}function fs(t,e){return t.Ue?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ls(t,e){return t.Ue?e.toBase64():e.toUint8Array()}function ps(t){return jr(!!t),Vi.Y((e=Xo(t),new Ci(e.seconds,e.nanos)));var e}function ds(t,e){return new Qr(["projects",t.projectId,"databases",t.database]).child("documents").child(e).R()}function vs(t){var e=Qr.P(t);return jr(xs(e)),e}function ys(t,e){return ds(t.U,e.path)}function gs(t,e){var n=vs(e);return jr(n.get(1)===t.U.projectId),jr(!n.get(3)&&!t.U.database||n.get(3)===t.U.database),new Xr(Is(n))}function ms(t,e){return ds(t.U,e)}function ws(t){var e=vs(t);return 4===e.length?Qr.g():Is(e)}function bs(t){return new Qr(["projects",t.U.projectId,"databases",t.U.database]).R()}function Is(t){return jr(4":return 0=":return 0<=t;default:return Fr()}},sa.prototype.un=function(){return 0<=["<","<=",">",">=","!="].indexOf(this.op)},sa);function sa(t,e,n){var r=this;return(r=ia.call(this)||this).field=t,r.op=e,r.value=n,r}var ua,aa,ca,ha=(o(va,ca=oa),va.prototype.matches=function(t){var e=Xr.i(t.key,this.key);return this.ln(e)},va),fa=(o(da,aa=oa),da.prototype.matches=function(e){return this.keys.some(function(t){return t.isEqual(e.key)})},da),la=(o(pa,ua=oa),pa.prototype.matches=function(e){return!this.keys.some(function(t){return t.isEqual(e.key)})},pa);function pa(t,e){var n=this;return(n=ua.call(this,t,"not-in",e)||this).keys=ya(0,e),n}function da(t,e){var n=this;return(n=aa.call(this,t,"in",e)||this).keys=ya(0,e),n}function va(t,e,n){var r=this;return(r=ca.call(this,t,e,n)||this).key=Xr.C(n.referenceValue),r}function ya(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map(function(t){return Xr.C(t.referenceValue)})}var ga,ma,wa,ba,Ia=(o(Ra,ba=oa),Ra.prototype.matches=function(t){var e=t.field(this.field);return es(e)&&Wo(e.arrayValue,this.value)},Ra),Ea=(o(Da,wa=oa),Da.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&Wo(this.value.arrayValue,e)},Da),Ta=(o(Sa,ma=oa),Sa.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&!Wo(this.value.arrayValue,e)},Sa),_a=(o(Na,ga=oa),Na.prototype.matches=function(t){var e=this,n=t.field(this.field);return!(!es(n)||!n.arrayValue.values)&&n.arrayValue.values.some(function(t){return Wo(e.value.arrayValue,t)})},Na),Aa=function(t,e){this.position=t,this.before=e};function Na(t,e){return ga.call(this,t,"array-contains-any",e)||this}function Sa(t,e){return ma.call(this,t,"not-in",e)||this}function Da(t,e){return wa.call(this,t,"in",e)||this}function Ra(t,e){return ba.call(this,t,"array-contains",e)||this}function Oa(t){return(t.before?"b":"a")+":"+t.position.map(Yo).join(",")}function xa(t,e,n){for(var r=0,i=0;ithis.mn&&(this.Tn=this.mn)},Ha.prototype.yn=function(){null!==this.En&&(this.En.Vn(),this.En=null)},Ha.prototype.cancel=function(){null!==this.En&&(this.En.cancel(),this.En=null)},Ha.prototype.Pn=function(){return(Math.random()-.5)*this.Tn},Ha),Va=(Ga.prototype.catch=function(t){return this.next(void 0,t)},Ga.prototype.next=function(r,i){var o=this;return this.Sn&&Fr(),this.Sn=!0,this.vn?this.error?this.Dn(i,this.error):this.Cn(r,this.result):new Ga(function(e,n){o.pn=function(t){o.Cn(r,t).next(e,n)},o.bn=function(t){o.Dn(i,t).next(e,n)}})},Ga.prototype.Nn=function(){var n=this;return new Promise(function(t,e){n.next(t,e)})},Ga.prototype.Fn=function(t){try{var e=t();return e instanceof Ga?e:Ga.resolve(e)}catch(t){return Ga.reject(t)}},Ga.prototype.Cn=function(t,e){return t?this.Fn(function(){return t(e)}):Ga.resolve(e)},Ga.prototype.Dn=function(t,e){return t?this.Fn(function(){return t(e)}):Ga.reject(e)},Ga.resolve=function(n){return new Ga(function(t,e){t(n)})},Ga.reject=function(n){return new Ga(function(t,e){e(n)})},Ga.$n=function(t){return new Ga(function(e,n){var r=0,i=0,o=!1;t.forEach(function(t){++r,t.next(function(){++i,o&&i===r&&e()},function(t){return n(t)})}),o=!0,i===r&&e()})},Ga.xn=function(t){for(var n=Ga.resolve(!1),e=0,r=t;e",t),this.store.put(t));return $a(n)},Ya.prototype.add=function(t){return Ur("SimpleDb","ADD",this.store.name,t,t),$a(this.store.add(t))},Ya.prototype.get=function(e){var n=this;return $a(this.store.get(e)).next(function(t){return void 0===t&&(t=null),Ur("SimpleDb","GET",n.store.name,e,t),t})},Ya.prototype.delete=function(t){return Ur("SimpleDb","DELETE",this.store.name,t),$a(this.store.delete(t))},Ya.prototype.count=function(){return Ur("SimpleDb","COUNT",this.store.name),$a(this.store.count())},Ya.prototype.Zn=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.ts(n,function(t,e){r.push(e)}).next(function(){return r})},Ya.prototype.es=function(t,e){Ur("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.ns=!1;var r=this.cursor(n);return this.ts(r,function(t,e,n){return n.delete()})},Ya.prototype.ss=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.ts(r,e)},Ya.prototype.rs=function(i){var t=this.cursor({});return new Va(function(n,r){t.onerror=function(t){var e=Za(t.target.error);r(e)},t.onsuccess=function(t){var e=t.target.result;e?i(e.primaryKey,e.value).next(function(t){t?e.continue():n()}):n()}})},Ya.prototype.ts=function(t,s){var u=[];return new Va(function(o,e){t.onerror=function(t){e(t.target.error)},t.onsuccess=function(t){var e,n,r,i=t.target.result;i?(e=new Fa(i),(n=s(i.primaryKey,i.value,e))instanceof Va&&(r=n.catch(function(t){return e.done(),Va.reject(t)}),u.push(r)),e.vn?o():null===e.Yn?i.continue():i.continue(e.Yn)):o()}}).next(function(){return Va.$n(u)})},Ya.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},Ya.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.ns?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},Ya);function Ya(t){this.store=t}function Xa(t){var n=this;this.transaction=t,this.aborted=!1,this.Xn=new Pa,this.transaction.oncomplete=function(){n.Xn.resolve()},this.transaction.onabort=function(){t.error?n.Xn.reject(new ja(t.error)):n.Xn.resolve()},this.transaction.onerror=function(t){var e=Za(t.target.error);n.Xn.reject(new ja(e))}}function $a(t){return new Va(function(n,r){t.onsuccess=function(t){var e=t.target.result;n(e)},t.onerror=function(t){var e=Za(t.target.error);r(e)}})}var Ja=!1;function Za(t){var e=Ma.Mn(v());if(12.2<=e&&e<13){var n="An internal error was encountered in the Indexed Database server";if(0<=t.message.indexOf(n)){var r=new xr("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Ja||(Ja=!0,setTimeout(function(){throw r},0)),r}}return t}function tc(){return"undefined"!=typeof window?window:null}function ec(){return"undefined"!=typeof document?document:null}var nc=(oc.ls=function(t,e,n,r,i){var o=new oc(t,e,Date.now()+n,r,i);return o.start(n),o},oc.prototype.start=function(t){var e=this;this._s=setTimeout(function(){return e.fs()},t)},oc.prototype.Vn=function(){return this.fs()},oc.prototype.cancel=function(t){null!==this._s&&(this.clearTimeout(),this.hs.reject(new xr(Or.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},oc.prototype.fs=function(){var e=this;this.os.ds(function(){return null!==e._s?(e.clearTimeout(),e.op().then(function(t){return e.hs.resolve(t)})):Promise.resolve()})},oc.prototype.clearTimeout=function(){null!==this._s&&(this.us(this),clearTimeout(this._s),this._s=null)},oc),rc=(Object.defineProperty(ic.prototype,"Vs",{get:function(){return this.Es},enumerable:!1,configurable:!0}),ic.prototype.ds=function(t){this.enqueue(t)},ic.prototype.ps=function(t){this.bs(),this.vs(t)},ic.prototype.Ss=function(){var t;this.Es||(this.Es=!0,(t=ec())&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.ys))},ic.prototype.enqueue=function(t){return this.bs(),this.Es?new Promise(function(t){}):this.vs(t)},ic.prototype.Ds=function(t){var e=this;this.Ts.push(t),this.ds(function(){return e.Cs()})},ic.prototype.Cs=function(){return m(this,void 0,void 0,function(){var e,n=this;return w(this,function(t){switch(t.label){case 0:if(0===this.Ts.length)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.Ts[0]()];case 2:return t.sent(),this.Ts.shift(),this.gs.reset(),[3,4];case 3:if(!Wa(e=t.sent()))throw e;return Ur("AsyncQueue","Operation failed with retryable error: "+e),[3,4];case 4:0h.params.ro?(Ur("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.ro+" from "+t),h.params.ro):t,s=Date.now(),h.Po(e,i)}).next(function(t){return r=t,u=Date.now(),h.Vo(e,r,n)}).next(function(t){return o=t,a=Date.now(),h.po(e,r)}).next(function(t){return c=Date.now(),Pr()<=l.DEBUG&&Ur("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-f)+"ms\n\tDetermined least recently used "+i+" in "+(u-s)+"ms\n\tRemoved "+o+" targets in "+(a-u)+"ms\n\tRemoved "+t+" documents in "+(c-a)+"ms\nTotal Duration: "+(c-f)+"ms"),Va.resolve({Xr:!0,Zr:i,eo:o,no:t})})},nh);function nh(t,e){this.Io=t,this.params=e}function rh(t,e){this.do=t,this.os=e,this.wo=!1,this.mo=null}function ih(t){for(var e="",n=0;n";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return Fr()}}(),n.fieldFilter.value))]:void 0!==e.compositeFilter?e.compositeFilter.filters.map(t).reduce(function(t,e){return t.concat(e)}):Fr():[];var n}(r.where));var u=[];r.orderBy&&(u=r.orderBy.map(function(t){return new La(Os((e=t).field),function(){switch(e.direction){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}());var e}));var a,c,h=null;r.limit&&(a=r.limit,h=zi(c="object"==typeof a?a.value:a)?null:c);var f=null;r.startAt&&(f=Ds(r.startAt));var l=null;return r.endAt&&(l=Ds(r.endAt)),Yu(qu(n,o,u,s,h,"F",f,l))}(t.query);return new to(i,t.targetId,0,t.lastListenSequenceNumber,n,r,Ai.fromBase64String(t.resumeToken))}function yh(t,e){var n=lh(e.et),r=lh(e.lastLimboFreeSnapshotVersion),i=(Xi(e.target)?As:Ns)(t.Do,e.target),o=e.resumeToken.toBase64();return new Kh(e.targetId,Ki(e.target),n,o,e.sequenceNumber,r,i)}var gh=(mh.Fo=function(t,e,n,r){return jr(""!==t.uid),new mh(t.Xs()?t.uid:"",e,n,r)},mh.prototype.$o=function(t){var r=!0,e=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Ih(t).ss({index:qh.userMutationsIndex,range:e},function(t,e,n){r=!1,n.done()}).next(function(){return r})},mh.prototype.xo=function(d,v,y,g){var m=this,w=Eh(d),b=Ih(d);return b.add({}).next(function(t){jr("number"==typeof t);for(var e,n,r,i,o,s=new Dc(t,v,y,g),u=(e=m.serializer,n=m.userId,i=(r=s).baseMutations.map(function(t){return Ts(e.Do,t)}),o=r.mutations.map(function(t){return Ts(e.Do,t)}),new qh(n,r.batchId,r.rr.toMillis(),i,o)),a=[],c=new fo(function(t,e){return Ei(t.R(),e.R())}),h=0,f=g;h=i),o=dh(r.serializer,e)),n.done()}).next(function(){return o})},mh.prototype.Bo=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=-1;return Ih(t).ss({index:qh.userMutationsIndex,range:e,reverse:!0},function(t,e,n){r=e.batchId,n.done()}).next(function(){return r})},mh.prototype.qo=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ih(t).Zn(qh.userMutationsIndex,n).next(function(t){return t.map(function(t){return dh(e.serializer,t)})})},mh.prototype.Cr=function(u,a){var c=this,t=Bh.prefixForPath(this.userId,a.path),e=IDBKeyRange.lowerBound(t),h=[];return Eh(u).ss({range:e},function(t,e,n){var r=t[0],i=t[1],o=t[2],s=sh(i);if(r===c.userId&&a.path.isEqual(s))return Ih(u).get(o).next(function(t){if(!t)throw Fr();jr(t.userId===c.userId),h.push(dh(c.serializer,t))});n.done()}).next(function(){return h})},mh.prototype.Mr=function(r,t){var a=this,c=new fo(Ei),i=[];return t.forEach(function(u){var t=Bh.prefixForPath(a.userId,u.path),e=IDBKeyRange.lowerBound(t),n=Eh(r).ss({range:e},function(t,e,n){var r=t[0],i=t[1],o=t[2],s=sh(i);r===a.userId&&u.path.isEqual(s)?c=c.add(o):n.done()});i.push(n)}),Va.$n(i).next(function(){return a.Uo(r,c)})},mh.prototype.Qr=function(t,e){var u=this,a=e.path,c=a.length+1,n=Bh.prefixForPath(this.userId,a),r=IDBKeyRange.lowerBound(n),h=new fo(Ei);return Eh(t).ss({range:r},function(t,e,n){var r=t[0],i=t[1],o=t[2],s=sh(i);r===u.userId&&a.T(s)?s.length===c&&(h=h.add(o)):n.done()}).next(function(){return u.Uo(t,h)})},mh.prototype.Uo=function(e,t){var n=this,r=[],i=[];return t.forEach(function(t){i.push(Ih(e).get(t).next(function(t){if(null===t)throw Fr();jr(t.userId===n.userId),r.push(dh(n.serializer,t))}))}),Va.$n(i).next(function(){return r})},mh.prototype.Qo=function(e,n){var r=this;return bh(e.Wo,this.userId,n).next(function(t){return e.Vr(function(){r.jo(n.batchId)}),Va.forEach(t,function(t){return r.Co.Ko(e,t)})})},mh.prototype.jo=function(t){delete this.No[t]},mh.prototype.Go=function(n){var o=this;return this.$o(n).next(function(t){if(!t)return Va.resolve();var e=IDBKeyRange.lowerBound(Bh.prefixForUser(o.userId)),i=[];return Eh(n).ss({range:e},function(t,e,n){var r;t[0]===o.userId?(r=sh(t[1]),i.push(r)):n.done()}).next(function(){jr(0===i.length)})})},mh.prototype.zo=function(t,e){return wh(t,this.userId,e)},mh.prototype.Ho=function(t){var e=this;return Th(t).get(this.userId).next(function(t){return t||new jh(e.userId,-1,"")})},mh);function mh(t,e,n,r){this.userId=t,this.serializer=e,this.Sr=n,this.Co=r,this.No={}}function wh(t,o,e){var n=Bh.prefixForPath(o,e.path),s=n[1],r=IDBKeyRange.lowerBound(n),u=!1;return Eh(t).ss({range:r,ns:!0},function(t,e,n){var r=t[0],i=t[1];t[2],r===o&&i===s&&(u=!0),n.done()}).next(function(){return u})}function bh(t,e,n){var r=t.store(qh.store),i=t.store(Bh.store),o=[],s=IDBKeyRange.only(n.batchId),u=0,a=r.ss({range:s},function(t,e,n){return u++,n.delete()});o.push(a.next(function(){jr(1===u)}));for(var c=[],h=0,f=n.mutations;ht.highestListenSequenceNumber&&(t.highestListenSequenceNumber=n),i.Aa(e,t)})},uf.prototype.ya=function(e,n){var r=this;return this.Va(e,n).next(function(){return r.Ia(e).next(function(t){return t.targetCount+=1,r.pa(n,t),r.Aa(e,t)})})},uf.prototype.ba=function(t,e){return this.Va(t,e)},uf.prototype.va=function(e,t){var n=this;return this.Sa(e,t.targetId).next(function(){return cf(e).delete(t.targetId)}).next(function(){return n.Ia(e)}).next(function(t){return jr(0e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},uf.prototype.Da=function(t){return this.Ia(t).next(function(t){return t.targetCount})},uf.prototype.Ca=function(t,i){var e=Ki(i),n=IDBKeyRange.bound([e,Number.NEGATIVE_INFINITY],[e,Number.POSITIVE_INFINITY]),o=null;return cf(t).ss({range:n,index:Kh.queryTargetsIndexName},function(t,e,n){var r=vh(e);Yi(i,r.target)&&(o=r,n.done())}).next(function(){return o})},uf.prototype.Na=function(n,t,r){var i=this,o=[],s=ff(n);return t.forEach(function(t){var e=ih(t.path);o.push(s.put(new Yh(r,e))),o.push(i.Co.Fa(n,r,t))}),Va.$n(o)},uf.prototype.$a=function(n,t,r){var i=this,o=ff(n);return Va.forEach(t,function(t){var e=ih(t.path);return Va.$n([o.delete([r,e]),i.Co.xa(n,r,t)])})},uf.prototype.Sa=function(t,e){var n=ff(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},uf.prototype.ka=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=ff(t),o=bo();return r.ss({range:n,ns:!0},function(t,e,n){var r=sh(t[1]),i=new Xr(r);o=o.add(i)}).next(function(){return o})},uf.prototype.zo=function(t,e){var n=ih(e.path),r=IDBKeyRange.bound([n],[_i(n)],!1,!0),i=0;return ff(t).ss({index:Yh.documentTargetsIndex,ns:!0,range:r},function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())}).next(function(){return 0 "+n),1))},yf.prototype.Xa=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Qa=function(){t._n.ds(function(){return t.inForeground="visible"===t.document.visibilityState,t.Ja()})},this.document.addEventListener("visibilitychange",this.Qa),this.inForeground="visible"===this.document.visibilityState)},yf.prototype.mc=function(){this.Qa&&(this.document.removeEventListener("visibilitychange",this.Qa),this.Qa=null)},yf.prototype.Za=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Ua=function(){e.wc(),e._n.ds(function(){return e.Si()})},this.window.addEventListener("unload",this.Ua))},yf.prototype.Tc=function(){this.Ua&&(this.window.removeEventListener("unload",this.Ua),this.Ua=null)},yf.prototype.dc=function(t){var e;try{var n=null!==(null===(e=this.Ya)||void 0===e?void 0:e.getItem(this.fc(t)));return Ur("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return Cr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},yf.prototype.wc=function(){if(this.Ya)try{this.Ya.setItem(this.fc(this.clientId),String(Date.now()))}catch(t){Cr("Failed to set zombie client id.",t)}},yf.prototype.Ec=function(){if(this.Ya)try{this.Ya.removeItem(this.fc(this.clientId))}catch(t){}},yf.prototype.fc=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},yf);function yf(t,e,n,r,i,o,s,u,a,c){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this._n=i,this.window=o,this.document=s,this.Oa=a,this.La=c,this.Ba=null,this.qa=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ua=null,this.inForeground=!1,this.Qa=null,this.Wa=null,this.ja=Number.NEGATIVE_INFINITY,this.Ka=function(t){return Promise.resolve()},!yf.On())throw new xr(Or.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.Co=new bf(this,r),this.Ga=e+"main",this.serializer=new uh(u),this.za=new Ma(this.Ga,10,new Ph(this.serializer)),this.Ha=new sf(this.Co,this.serializer),this.Sr=new ef,this.br=new Ah(this.serializer,this.Sr),this.window&&this.window.localStorage?this.Ya=this.window.localStorage:(this.Ya=null,!1===c&&Cr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}function gf(t,e){var n=this;return(n=lf.call(this)||this).Wo=t,n.Ma=e,n}function mf(t){return vf.Un(t,Ch.store)}function wf(t){return vf.Un(t,Zh.store)}var bf=(If.prototype.Ro=function(t){var n=this.yc(t);return this.db.Ac().Da(t).next(function(e){return n.next(function(t){return e+t})})},If.prototype.yc=function(t){var e=0;return this.yo(t,function(t){e++}).next(function(){return e})},If.prototype.De=function(t,e){return this.db.Ac().De(t,e)},If.prototype.yo=function(t,n){return this.Vc(t,function(t,e){return n(e)})},If.prototype.Fa=function(t,e,n){return Ef(t,n)},If.prototype.xa=function(t,e,n){return Ef(t,n)},If.prototype.Vo=function(t,e,n){return this.db.Ac().Vo(t,e,n)},If.prototype.Ko=Ef,If.prototype.bc=function(t,e){return r=e,i=!1,Th(n=t).rs(function(t){return wh(n,t,r).next(function(t){return t&&(i=!0),Va.resolve(!t)})}).next(function(){return i});var n,r,i},If.prototype.po=function(r,i){var o=this,s=this.db.Rc().aa(),u=[],a=0;return this.Vc(r,function(e,t){var n;t<=i&&(n=o.bc(r,e).next(function(t){if(!t)return a++,s.Ar(r,e).next(function(){return s.Ir(e),ff(r).delete([0,ih(e.path)])})}),u.push(n))}).next(function(){return Va.$n(u)}).next(function(){return s.apply(r)}).next(function(){return a})},If.prototype.removeTarget=function(t,e){var n=e.nt(t.Ma);return this.db.Ac().ba(t,n)},If.prototype.vc=Ef,If.prototype.Vc=function(t,o){var s,e=ff(t),u=yc.oi;return e.ss({index:Yh.documentTargetsIndex},function(t,e){var n=t[0],r=(t[1],e.path),i=e.sequenceNumber;0===n?(u!==yc.oi&&o(new Xr(sh(s)),u),u=i,s=r):u=yc.oi}).next(function(){u!==yc.oi&&o(new Xr(sh(s)),u)})},If.prototype.vo=function(t){return this.db.Rc().ha(t)},If);function If(t,e){this.db=t,this.do=new eh(this,e)}function Ef(t,e){return ff(t).put((n=t.Ma,new Yh(0,ih(e.path),n)));var n}function Tf(t,e){var n=t.projectId;return t.W||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var _f=(Af.prototype.Eo=function(e){var n=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(t){return e.bo(t,n.Dc)})},Af);function Af(t,e,n){this.persistence=t,this.Sc=e,this.Dc=new io(Ei),this.Cc=new Ui(Ki,Yi),this.Nc=Vi.min(),this.vr=t.Ic(n),this.Fc=t.Rc(),this.Ha=t.Ac(),this.$c=new Lc(this.Fc,this.vr,this.persistence.Pc()),this.Sc.xc(this.$c)}function Nf(t,h){var f=t;return f.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(t){var e,n,i,o,s,r,u,a=h.batch.keys(),c=f.Fc.aa({ua:!0});return e=f,n=t,o=c,s=(i=h).batch,r=s.keys(),u=Va.resolve(),r.forEach(function(r){u=u.next(function(){return o.Ar(n,r)}).next(function(t){var e=t,n=i._r.get(r);jr(null!==n),(!e||e.version.L(n)<0)&&(e=s.ar(r,e,i))&&o.Tr(e,i.lr)})}),u.next(function(){return e.vr.Qo(n,s)}).next(function(){return c.apply(t)}).next(function(){return f.vr.Go(t)}).next(function(){return f.$c.$r(t,a)})})}function Sf(t){var e=t;return e.persistence.runTransaction("Get last remote snapshot version","readonly",function(t){return e.Ha.Ra(t)})}function Df(t,s){var h=t,f=s.et,l=h.Dc;return h.persistence.runTransaction("Apply remote event","readwrite-primary",function(a){var i=h.Fc.aa({ua:!0});l=h.Dc;var c=[];s.Gt.forEach(function(t,e){var n,r,i,o,s,u=l.get(e);u&&(c.push(h.Ha.$a(a,t.ne,e).next(function(){return h.Ha.Na(a,t.te,e)})),0<(n=t.resumeToken).O()&&(r=u.st(n,f).nt(a.Ma),l=l.rt(e,r),i=u,s=t,jr(0<(o=r).resumeToken.O()),(0===i.resumeToken.O()||3e8<=o.et.J()-i.et.J()||0this.query.limit;){var n=zu(this.query)?f.last():f.first(),f=f.delete(n.key),h=h.delete(n.key);a.track({type:1,doc:n})}return{wh:f,Eh:a,Ah:l,Qt:h}},Ll.prototype.Ih=function(t,e){return t.Ye&&e.hasCommittedMutations&&!e.Ye},Ll.prototype.gr=function(t,e,n){var o=this,r=this.wh;this.wh=t.wh,this.Qt=t.Qt;var i=t.Eh.qt();i.sort(function(t,e){return r=t.type,i=e.type,n(r)-n(i)||o.dh(t.doc,e.doc);function n(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Fr()}}var r,i}),this.Rh(n);var s=e?this.Ph():[],u=0===this.fh.size&&this.Zt?1:0,a=u!==this._h;return this._h=u,0!==i.length||a?{snapshot:new _o(this.query,t.wh,r,i,t.Qt,0==u,a,!1),gh:s}:{gh:s}},Ll.prototype.Us=function(t){return this.Zt&&"Offline"===t?(this.Zt=!1,this.gr({wh:this.wh,Eh:new To,Qt:this.Qt,Ah:!1},!1)):{gh:[]}},Ll.prototype.yh=function(t){return!this.lh.has(t)&&!!this.wh.has(t)&&!this.wh.get(t).Ye},Ll.prototype.Rh=function(t){var e=this;t&&(t.te.forEach(function(t){return e.lh=e.lh.add(t)}),t.ee.forEach(function(t){}),t.ne.forEach(function(t){return e.lh=e.lh.delete(t)}),this.Zt=t.Zt)},Ll.prototype.Ph=function(){var e=this;if(!this.Zt)return[];var n=this.fh;this.fh=bo(),this.wh.forEach(function(t){e.yh(t.key)&&(e.fh=e.fh.add(t.key))});var r=[];return n.forEach(function(t){e.fh.has(t)||r.push(new Sl(t))}),this.fh.forEach(function(t){n.has(t)||r.push(new Nl(t))}),r},Ll.prototype.Vh=function(t){this.lh=t.kc,this.fh=bo();var e=this.Th(t.documents);return this.gr(e,!0)},Ll.prototype.ph=function(){return _o.Kt(this.query,this.wh,this.Qt,0===this._h)},Ll),Rl=function(t,e,n){this.query=t,this.targetId=e,this.view=n},Ol=function(t){this.key=t,this.bh=!1},xl=(Object.defineProperty(kl.prototype,"Qh",{get:function(){return!0===this.Uh},enumerable:!1,configurable:!0}),kl.prototype.subscribe=function(t){this.Nh=t},kl.prototype.Wh=function(t){},kl);function kl(t,e,n,r,i){this.zu=t,this.Sh=e,this.Dh=n,this.currentUser=r,this.Ch=i,this.Nh=null,this.Fh=new Ui(ta,Zu),this.$h=new Map,this.xh=[],this.kh=new io(Xr.i),this.Mh=new Map,this.Oh=new Mf,this.Lh={},this.Bh=new Map,this.qh=of.Ta(),this.onlineState="Unknown",this.Uh=void 0}function Ll(t,e){this.query=t,this.lh=e,this._h=null,this.Zt=!1,this.fh=bo(),this.Qt=bo(),this.dh=ra(t),this.wh=new Eo(this.dh)}function Pl(u,a,c,h){return m(this,void 0,void 0,function(){var e,n,r,i,o,s;return w(this,function(t){switch(t.label){case 0:return u.jh=function(t,e,n){return function(i,o,s,u){return m(this,void 0,void 0,function(){var n,e,r;return w(this,function(t){switch(t.label){case 0:return(n=o.view.Th(s)).Ah?[4,xf(i.zu,o.query,!1).then(function(t){var e=t.documents;return o.view.Th(e,n)})]:[3,2];case 1:n=t.sent(),t.label=2;case 2:return e=u&&u.Gt.get(o.targetId),r=o.view.gr(n,i.Qh,e),[2,(Bl(i,o.targetId,r.gh),r.snapshot)]}})})}(u,t,e,n)},[4,xf(u.zu,a,!0)];case 1:return e=t.sent(),n=new Dl(a,e.kc),r=n.Th(e.documents),i=No.Xt(c,h&&"Offline"!==u.onlineState),o=n.gr(r,u.Qh,i),Bl(u,c,o.gh),s=new Rl(a,c,n),[2,(u.Fh.set(a,s),u.$h.has(c)?u.$h.get(c).push(a):u.$h.set(c,[a]),o.snapshot)]}})})}function Ul(n,i){return m(this,void 0,void 0,function(){var r,e;return w(this,function(t){switch(t.label){case 0:(r=n).Wh("applyRemoteEvent()"),t.label=1;case 1:return t.trys.push([1,4,,6]),[4,Df(r.zu,i)];case 2:return e=t.sent(),i.Gt.forEach(function(t,e){var n=r.Mh.get(e);n&&(jr(t.te.size+t.ee.size+t.ne.size<=1),0i?this.vr[i]:null)},ip.prototype.Bo=function(){return Va.resolve(0===this.vr.length?-1:this.tl-1)},ip.prototype.qo=function(t){return Va.resolve(this.vr.slice())},ip.prototype.Cr=function(t,e){var n=this,r=new Ff(e,0),i=new Ff(e,Number.POSITIVE_INFINITY),o=[];return this.el.Nt([r,i],function(t){var e=n.nl(t.Gc);o.push(e)}),Va.resolve(o)},ip.prototype.Mr=function(t,e){var r=this,i=new fo(Ei);return e.forEach(function(t){var e=new Ff(t,0),n=new Ff(t,Number.POSITIVE_INFINITY);r.el.Nt([e,n],function(t){i=i.add(t.Gc)})}),Va.resolve(this.il(i))},ip.prototype.Qr=function(t,e){var n=e.path,r=n.length+1,i=n;Xr.F(i)||(i=i.child(""));var o=new Ff(new Xr(i),0),s=new fo(Ei);return this.el.Ft(function(t){var e=t.key.path;return!!n.T(e)&&(e.length===r&&(s=s.add(t.Gc)),!0)},o),Va.resolve(this.il(s))},ip.prototype.il=function(t){var n=this,r=[];return t.forEach(function(t){var e=n.nl(t);null!==e&&r.push(e)}),r},ip.prototype.Qo=function(n,r){var i=this;jr(0===this.rl(r.batchId,"removed")),this.vr.shift();var o=this.el;return Va.forEach(r.mutations,function(t){var e=new Ff(t.key,r.batchId);return o=o.delete(e),i.Co.Ko(n,t.key)}).next(function(){i.el=o})},ip.prototype.jo=function(t){},ip.prototype.zo=function(t,e){var n=new Ff(e,0),r=this.el.$t(n);return Va.resolve(e.isEqual(r&&r.key))},ip.prototype.Go=function(t){return this.vr.length,Va.resolve()},ip.prototype.rl=function(t,e){return this.sl(t)},ip.prototype.sl=function(t){return 0===this.vr.length?0:t-this.vr[0].batchId},ip.prototype.nl=function(t){var e=this.sl(t);return e<0||e>=this.vr.length?null:this.vr[e]},ip),np=(rp.prototype.Tr=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,s=this.ol(e);return this.docs=this.docs.rt(r,{Zo:e,size:s,readTime:n}),this.size+=s-o,this.Sr.ko(t,r.path.h())},rp.prototype.Ir=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},rp.prototype.Ar=function(t,e){var n=this.docs.get(e);return Va.resolve(n?n.Zo:null)},rp.prototype.getEntries=function(t,e){var n=this,r=po;return e.forEach(function(t){var e=n.docs.get(t);r=r.rt(t,e?e.Zo:null)}),Va.resolve(r)},rp.prototype.Or=function(t,e,n){for(var r=go,i=new Xr(e.path.child("")),o=this.docs._t(i);o.It();){var s=o.Et(),u=s.key,a=s.value,c=a.Zo,h=a.readTime;if(!e.path.T(u.path))break;h.L(n)<=0||c instanceof Lu&&na(e,c)&&(r=r.rt(c.key,c))}return Va.resolve(r)},rp.prototype.al=function(t,e){return Va.forEach(this.docs,function(t){return e(t)})},rp.prototype.aa=function(t){return new rp.ca(this)},rp.prototype.ha=function(t){return Va.resolve(this.size)},rp);function rp(t,e){this.Sr=t,this.ol=e,this.docs=new io(Xr.i),this.size=0}function ip(t,e){this.Sr=t,this.Co=e,this.vr=[],this.tl=1,this.el=new fo(Ff.Oc)}function op(){}function sp(t){var e=this;return(e=Zl.call(this)||this).la=t,e}np.ca=(o(sp,Zl=Oc),sp.prototype.gr=function(n){var r=this,i=[];return this.dr.forEach(function(t,e){e?i.push(r.la.Tr(n,e,r.readTime)):r.la.Ir(t)}),Va.$n(i)},sp.prototype.Rr=function(t,e){return this.la.Ar(t,e)},sp.prototype.Pr=function(t,e){return this.la.getEntries(t,e)},sp);var up,ap,cp=(Np.prototype.De=function(t,n){return this.cl.forEach(function(t,e){return n(e)}),Va.resolve()},Np.prototype.Ra=function(t){return Va.resolve(this.lastRemoteSnapshotVersion)},Np.prototype.Pa=function(t){return Va.resolve(this.ul)},Np.prototype.Ea=function(t){return this.highestTargetId=this.ll.next(),Va.resolve(this.highestTargetId)},Np.prototype.ga=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ul&&(this.ul=e),Va.resolve()},Np.prototype.Va=function(t){this.cl.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ll=new of(e),this.highestTargetId=e),t.sequenceNumber>this.ul&&(this.ul=t.sequenceNumber)},Np.prototype.ya=function(t,e){return this.Va(e),this.targetCount+=1,Va.resolve()},Np.prototype.ba=function(t,e){return this.Va(e),Va.resolve()},Np.prototype.va=function(t,e){return this.cl.delete(e.target),this.hl.Wc(e.targetId),--this.targetCount,Va.resolve()},Np.prototype.Vo=function(n,r,i){var o=this,s=0,u=[];return this.cl.forEach(function(t,e){e.sequenceNumber<=r&&null===i.get(e.targetId)&&(o.cl.delete(t),u.push(o.Sa(n,e.targetId)),s++)}),Va.$n(u).next(function(){return s})},Np.prototype.Da=function(t){return Va.resolve(this.targetCount)},Np.prototype.Ca=function(t,e){var n=this.cl.get(e)||null;return Va.resolve(n)},Np.prototype.Na=function(t,e,n){return this.hl.qc(e,n),Va.resolve()},Np.prototype.$a=function(e,t,n){this.hl.Qc(t,n);var r=this.persistence.Co,i=[];return r&&t.forEach(function(t){i.push(r.Ko(e,t))}),Va.$n(i)},Np.prototype.Sa=function(t,e){return this.hl.Wc(e),Va.resolve()},Np.prototype.ka=function(t,e){var n=this.hl.Kc(e);return Va.resolve(n)},Np.prototype.zo=function(t,e){return Va.resolve(this.hl.zo(e))},Np),hp=(Ap.prototype.start=function(){return Promise.resolve()},Ap.prototype.Si=function(){return this.qa=!1,Promise.resolve()},Object.defineProperty(Ap.prototype,"Ti",{get:function(){return this.qa},enumerable:!1,configurable:!0}),Ap.prototype.nc=function(){},Ap.prototype.sc=function(){},Ap.prototype.Pc=function(){return this.Sr},Ap.prototype.Ic=function(t){var e=this._l[t.Zs()];return e||(e=new ep(this.Sr,this.Co),this._l[t.Zs()]=e),e},Ap.prototype.Ac=function(){return this.Ha},Ap.prototype.Rc=function(){return this.br},Ap.prototype.runTransaction=function(t,e,n){var r=this;Ur("MemoryPersistence","Starting transaction:",t);var i=new fp(this.Ba.next());return this.Co.dl(),n(i).next(function(t){return r.Co.wl(i).next(function(){return t})}).Nn().then(function(t){return i.pr(),t})},Ap.prototype.ml=function(e,n){return Va.xn(Object.values(this._l).map(function(t){return function(){return t.zo(e,n)}}))},Ap),fp=(o(_p,ap=kc),_p),lp=(Tp.Il=function(t){return new Tp(t)},Object.defineProperty(Tp.prototype,"Al",{get:function(){if(this.El)return this.El;throw Fr()},enumerable:!1,configurable:!0}),Tp.prototype.Fa=function(t,e,n){return this.Tl.Fa(n,e),this.Al.delete(n.toString()),Va.resolve()},Tp.prototype.xa=function(t,e,n){return this.Tl.xa(n,e),this.Al.add(n.toString()),Va.resolve()},Tp.prototype.Ko=function(t,e){return this.Al.add(e.toString()),Va.resolve()},Tp.prototype.removeTarget=function(t,e){var n=this;this.Tl.Wc(e.targetId).forEach(function(t){return n.Al.add(t.toString())});var r=this.persistence.Ac();return r.ka(t,e.targetId).next(function(t){t.forEach(function(t){return n.Al.add(t.toString())})}).next(function(){return r.va(t,e)})},Tp.prototype.dl=function(){this.El=new Set},Tp.prototype.wl=function(n){var r=this,i=this.persistence.Rc().aa();return Va.forEach(this.Al,function(t){var e=Xr.D(t);return r.Rl(n,e).next(function(t){t||i.Ir(e)})}).next(function(){return r.El=null,i.apply(n)})},Tp.prototype.vc=function(t,e){var n=this;return this.Rl(t,e).next(function(t){t?n.Al.delete(e.toString()):n.Al.add(e.toString())})},Tp.prototype.fl=function(t){return 0},Tp.prototype.Rl=function(t,e){var n=this;return Va.xn([function(){return Va.resolve(n.Tl.zo(e))},function(){return n.persistence.Ac().zo(t,e)},function(){return n.persistence.ml(t,e)}])},Tp),pp=(Ep.prototype.Vu=function(t){this.yl=t},Ep.prototype.Au=function(t){this.Vl=t},Ep.prototype.onMessage=function(t){this.pl=t},Ep.prototype.close=function(){this.gl()},Ep.prototype.send=function(t){this.Pl(t)},Ep.prototype.bl=function(){this.yl()},Ep.prototype.vl=function(t){this.Vl(t)},Ep.prototype.Sl=function(t){this.pl(t)},Ep),dp={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},vp=(Ip.prototype.Ou=function(e,t,n,r){var i=this.Fl(e,t);Ur("RestConnection","Sending: ",i,n);var o={};return this.$l(o,r),this.xl(e,i,o,n).then(function(t){return Ur("RestConnection","Received: ",t),t},function(t){throw Vr("RestConnection",e+" failed with error: ",t,"url: ",i,"request:",n),t})},Ip.prototype.Lu=function(t,e,n,r){return this.Ou(t,e,n,r)},Ip.prototype.$l=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/7.20.0",t["Content-Type"]="text/plain",e)for(var n in e.zc)e.zc.hasOwnProperty(n)&&(t[n]=e.zc[n])},Ip.prototype.Fl=function(t,e){var n=dp[t];return this.Cl+"/v1/"+e+":"+n},o(bp,up=Ip),bp.prototype.xl=function(a,e,n,r){return new Promise(function(o,s){var u=new Nr;u.listenOnce(_r.COMPLETE,function(){try{switch(u.getLastErrorCode()){case Tr.NO_ERROR:var t=u.getResponseJson();Ur("Connection","XHR received:",JSON.stringify(t)),o(t);break;case Tr.TIMEOUT:Ur("Connection",'RPC "'+a+'" timed out'),s(new xr(Or.DEADLINE_EXCEEDED,"Request time out"));break;case Tr.HTTP_ERROR:var e,n,r=u.getStatus();Ur("Connection",'RPC "'+a+'" failed with status:',r,"response text:",u.getResponseText()),0, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function gv(t){if(Gu(t)&&0===t.rn.length)throw new xr(Or.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var mv,wv=(_v.prototype.where=function(t,e,n){var r;ni("Query.where",arguments,3),di("Query.where",3,n),r="not-in"===e||"!="===e?e:hi("Query.where",["<","<=","==",">=",">","array-contains","in","array-contains-any"],2,e);var i,o,s=Cd("Query.where",t),u=function(t,e,n,r,i,o,s){var u;if(i.p()){if("array-contains"===o||"array-contains-any"===o)throw new xr(Or.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){vv(s,o);for(var a=[],c=0,h=s;c, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=Hu(t);null!==r&&yv(0,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;ns.length)throw new xr(Or.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var u=[],a=0;as[0]&&t[1]"})):"Error",u=this.serviceName+": "+a+" ("+o+").",c=new d(o,u),l=0,f=Object.keys(i);ls[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(){for(var e=[],t=0;t"})):"Error",u=this.serviceName+": "+a+" ("+o+").",c=new d(o,u),l=0,f=Object.keys(i);l=u.createTime+6048e5?[2,function(i,o,s){return v(this,void 0,void 0,function(){var t,n,r;return g(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,5]),[4,function(a,u){return v(this,void 0,void 0,function(){var t,n,r,i,o,s;return g(this,function(e){switch(e.label){case 0:return[4,Ze(a)];case 1:t=e.sent(),n=Qe(u.subscriptionOptions),r={method:"PATCH",headers:t,body:JSON.stringify(n)},e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(Ye(a.appConfig)+"/"+u.token,r)];case 3:return[4,e.sent().json()];case 4:return i=e.sent(),[3,6];case 5:throw o=e.sent(),Ee.create("token-update-failed",{errorInfo:o});case 6:if(i.error)throw s=i.error.message,Ee.create("token-update-failed",{errorInfo:s});if(!i.token)throw Ee.create("token-update-no-token");return[2,i.token]}})})}(o,i)];case 1:return t=e.sent(),n=h(h({},i),{token:t,createTime:Date.now()}),[4,Ge(o,n)];case 2:return e.sent(),[2,t];case 3:return r=e.sent(),[4,et(o,s)];case 4:throw e.sent(),r;case 5:return[2]}})})}({token:u.token,createTime:Date.now(),subscriptionOptions:c},f,p)]:[2,u.token];case 9:return[2]}var t,n,r,i,o,s})})}function et(r,i){return v(this,void 0,void 0,function(){var t,n;return g(this,function(e){switch(e.label){case 0:return[4,$e(r)];case 1:return(t=e.sent())?[4,Je(r,t.token)]:[3,4];case 2:return e.sent(),[4,function(i){return v(this,void 0,void 0,function(){var t,n,r;return g(this,function(e){switch(e.label){case 0:return t=ze(i),[4,He()];case 1:return n=e.sent(),[4,(r=n.transaction(Ue,"readwrite")).objectStore(Ue).delete(t)];case 2:return e.sent(),[4,r.complete];case 3:return e.sent(),[2]}})})}(r)];case 3:e.sent(),e.label=4;case 4:return[4,i.pushManager.getSubscription()];case 5:return(n=e.sent())?[2,n.unsubscribe()]:[2,!0]}})})}function tt(r,i){return v(this,void 0,void 0,function(){var t,n;return g(this,function(e){switch(e.label){case 0:return[4,function(a,u){return v(this,void 0,void 0,function(){var t,n,r,i,o,s;return g(this,function(e){switch(e.label){case 0:return[4,Ze(a)];case 1:t=e.sent(),n=Qe(u),r={method:"POST",headers:t,body:JSON.stringify(n)},e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(Ye(a.appConfig),r)];case 3:return[4,e.sent().json()];case 4:return i=e.sent(),[3,6];case 5:throw o=e.sent(),Ee.create("token-subscribe-failed",{errorInfo:o});case 6:if(i.error)throw s=i.error.message,Ee.create("token-subscribe-failed",{errorInfo:s});if(!i.token)throw Ee.create("token-subscribe-no-token");return[2,i.token]}})})}(r,i)];case 1:return t=e.sent(),n={token:t,createTime:Date.now(),subscriptionOptions:i},[4,Ge(r,n)];case 2:return e.sent(),[2,n.token]}})})}function nt(e){var t={from:e.from,collapseKey:e.collapse_key};return function(e,t){if(!t.notification)return;e.notification={};var n=t.notification.title;n&&(e.notification.title=n);var r=t.notification.body;r&&(e.notification.body=r);var i=t.notification.image;i&&(e.notification.image=i)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){if(!t.fcmOptions)return;e.fcmOptions={};var n=t.fcmOptions.link;n&&(e.fcmOptions.link=n);var r=t.fcmOptions.analytics_label;r&&(e.fcmOptions.analyticsLabel=r)}(t,e),t}function rt(e){return"object"==typeof e&&e&&Ne in e}var it=(Object.defineProperty(ot.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),ot.prototype.setBackgroundMessageHandler=function(e){if(this.isOnBackgroundMessageUsed=!1,!e||"function"!=typeof e)throw Ee.create("invalid-bg-handler");this.bgMessageHandler=e},ot.prototype.onBackgroundMessage=function(e){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=e,function(){t.bgMessageHandler=null}},ot.prototype.getToken=function(){var n,r;return v(this,void 0,void 0,function(){var t;return g(this,function(e){switch(e.label){case 0:return this.vapidKey?[3,2]:[4,$e(this.firebaseDependencies)];case 1:t=e.sent(),this.vapidKey=null!==(r=null===(n=null==t?void 0:t.subscriptionOptions)||void 0===n?void 0:n.vapidKey)&&void 0!==r?r:Me,e.label=2;case 2:return[2,Xe(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},ot.prototype.deleteToken=function(){return et(this.firebaseDependencies,self.registration)},ot.prototype.requestPermission=function(){throw Ee.create("only-available-in-window")},ot.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw Ee.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw Ee.create("invalid-vapid-key");this.vapidKey=e},ot.prototype.useServiceWorker=function(){throw Ee.create("only-available-in-window")},ot.prototype.onMessage=function(){throw Ee.create("only-available-in-window")},ot.prototype.onTokenRefresh=function(){throw Ee.create("only-available-in-window")},ot.prototype.onPush=function(u){return v(this,void 0,void 0,function(){var i,o,s,a;return g(this,function(e){switch(e.label){case 0:return(i=function(e){var t=e.data;if(!t)return null;try{return t.json()}catch(e){return null}}(u))?[4,st()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return(o=e.sent(),o.some(function(e){return"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://")}))?[2,function(e,t){var n,r;t.isFirebaseMessaging=!0,t.messageType=je.PUSH_RECEIVED;try{for(var i=l(e),o=i.next();!o.done;o=i.next()){o.value.postMessage(t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}(o,i)]:(s=!1,i.notification?[4,function(e){var t,n=e.actions,r=Notification.maxActions;n&&r&&n.length>r&&console.warn("This browser only supports "+r+" actions. The remaining actions will not be displayed.");return self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}(((r=h({},(t=i).notification)).data=((n={})[xe]=t,n),r))]:[3,3]);case 2:e.sent(),s=!0,e.label=3;case 3:return!0===s&&!1===this.isOnBackgroundMessageUsed?[2]:(this.bgMessageHandler&&(a=nt(i),"function"==typeof this.bgMessageHandler?this.bgMessageHandler(a):this.bgMessageHandler.next(a)),[2])}var t,n,r})})},ot.prototype.onSubChange=function(n){var r,i;return v(this,void 0,void 0,function(){var t;return g(this,function(e){switch(e.label){case 0:return n.newSubscription?[3,2]:[4,et(this.firebaseDependencies,self.registration)];case 1:return e.sent(),[2];case 2:return[4,$e(this.firebaseDependencies)];case 3:return t=e.sent(),[4,et(this.firebaseDependencies,self.registration)];case 4:return e.sent(),[4,Xe(this.firebaseDependencies,self.registration,null!==(i=null===(r=null==t?void 0:t.subscriptionOptions)||void 0===r?void 0:r.vapidKey)&&void 0!==i?i:Me)];case 5:return e.sent(),[2]}})})},ot.prototype.onNotificationClick=function(a){var u,c;return v(this,void 0,void 0,function(){var n,r,i,o,s;return g(this,function(e){switch(e.label){case 0:return(n=null===(c=null===(u=a.notification)||void 0===u?void 0:u.data)||void 0===c?void 0:c[xe])?a.action?[2]:(a.stopImmediatePropagation(),a.notification.close(),(r=function(e){var t,n,r,i=null!==(n=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==n?n:null===(r=e.notification)||void 0===r?void 0:r.click_action;if(i)return i;return rt(e.data)?self.location.origin:null}(n))?(i=new URL(r,self.location.href),o=new URL(self.location.origin),i.host!==o.host?[2]:[4,function(u){return v(this,void 0,void 0,function(){var t,n,r,i,o,s,a;return g(this,function(e){switch(e.label){case 0:return[4,st()];case 1:t=e.sent();try{for(n=l(t),r=n.next();!r.done;r=n.next())if(i=r.value,o=new URL(i.url,self.location.href),u.host===o.host)return[2,i]}catch(e){s={error:e}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(s)throw s.error}}return[2,null]}})})}(i)]):[2]):[2];case 1:return(s=e.sent())?[3,4]:[4,self.clients.openWindow(r)];case 2:return s=e.sent(),[4,(t=3e3,new Promise(function(e){setTimeout(e,t)}))];case 3:return e.sent(),[3,6];case 4:return[4,s.focus()];case 5:s=e.sent(),e.label=6;case 6:return s?(n.messageType=je.NOTIFICATION_CLICKED,n.isFirebaseMessaging=!0,[2,s.postMessage(n)]):[2]}var t})})},ot);function ot(e){var t=this;this.firebaseDependencies=e,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",function(e){e.waitUntil(t.onPush(e))}),self.addEventListener("pushsubscriptionchange",function(e){e.waitUntil(t.onSubChange(e))}),self.addEventListener("notificationclick",function(e){e.waitUntil(t.onNotificationClick(e))})}function st(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}var at=(Object.defineProperty(ut.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),ut.prototype.messageEventListener=function(i){return v(this,void 0,void 0,function(){var n,r;return g(this,function(e){switch(e.label){case 0:return(n=i.data).isFirebaseMessaging?(this.onMessageCallback&&n.messageType===je.PUSH_RECEIVED&&("function"==typeof this.onMessageCallback?this.onMessageCallback((delete(t=Object.assign({},n)).messageType,delete t.isFirebaseMessaging,t)):this.onMessageCallback.next(Object.assign({},n))),rt(r=n.data)&&"1"===r["google.c.a.e"]?[4,this.logEvent(n.messageType,r)]:[3,2]):[2];case 1:e.sent(),e.label=2;case 2:return[2]}var t})})},ut.prototype.getVapidKey=function(){return this.vapidKey},ut.prototype.getSwReg=function(){return this.swRegistration},ut.prototype.getToken=function(t){return v(this,void 0,void 0,function(){return g(this,function(e){switch(e.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:e.sent(),e.label=2;case 2:if("granted"!==Notification.permission)throw Ee.create("permission-blocked");return[4,this.updateVapidKey(null==t?void 0:t.vapidKey)];case 3:return e.sent(),[4,this.updateSwReg(null==t?void 0:t.serviceWorkerRegistration)];case 4:return e.sent(),[2,Xe(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}})})},ut.prototype.updateVapidKey=function(t){return v(this,void 0,void 0,function(){return g(this,function(e){return t?this.vapidKey=t:this.vapidKey||(this.vapidKey=Me),[2]})})},ut.prototype.updateSwReg=function(t){return v(this,void 0,void 0,function(){return g(this,function(e){switch(e.label){case 0:return t||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:if(!t&&this.swRegistration)return[2];if(!(t instanceof ServiceWorkerRegistration))throw Ee.create("invalid-sw-registration");return this.swRegistration=t,[2]}})})},ut.prototype.registerDefaultSw=function(){return v(this,void 0,void 0,function(){var t,n;return g(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return t.swRegistration=e.sent(),this.swRegistration.update().catch(function(){}),[3,3];case 2:throw n=e.sent(),Ee.create("failed-service-worker-registration",{browserErrorMessage:n.message});case 3:return[2]}})})},ut.prototype.deleteToken=function(){return v(this,void 0,void 0,function(){return g(this,function(e){switch(e.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:return[2,et(this.firebaseDependencies,this.swRegistration)]}})})},ut.prototype.requestPermission=function(){return v(this,void 0,void 0,function(){var t;return g(this,function(e){switch(e.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(t=e.sent()))return[2];throw"denied"===t?Ee.create("permission-blocked"):Ee.create("permission-default")}})})},ut.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw Ee.create("use-vapid-key-after-get-token");if("string"!=typeof e||0===e.length)throw Ee.create("invalid-vapid-key");this.vapidKey=e},ut.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw Ee.create("invalid-sw-registration");if(this.swRegistration)throw Ee.create("use-sw-after-get-token");this.swRegistration=e},ut.prototype.onMessage=function(e){var t=this;return this.onMessageCallback=e,function(){t.onMessageCallback=null}},ut.prototype.setBackgroundMessageHandler=function(){throw Ee.create("only-available-in-sw")},ut.prototype.onBackgroundMessage=function(){throw Ee.create("only-available-in-sw")},ut.prototype.onTokenRefresh=function(){return function(){}},ut.prototype.logEvent=function(n,r){return v(this,void 0,void 0,function(){var t;return g(this,function(e){switch(e.label){case 0:return t=function(e){switch(e){case je.NOTIFICATION_CLICKED:return"notification_open";case je.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(n),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return e.sent().logEvent(t,{message_id:r[Ne],message_name:r["google.c.a.c_l"],message_time:r["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},ut);function ut(e){var t=this;this.firebaseDependencies=e,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",function(e){return t.messageEventListener(e)})}function ct(e){return Ee.create("missing-app-config-values",{valueName:e})}var lt={isSupported:ft};function ft(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}t.default.INTERNAL.registerComponent(new y("messaging",function(e){var t=e.getProvider("app").getImmediate(),n={app:t,appConfig:function(e){var t,n;if(!e||!e.options)throw ct("App Configuration Object");if(!e.name)throw ct("App Name");var r=e.options;try{for(var i=l(["projectId","apiKey","appId","messagingSenderId"]),o=i.next();!o.done;o=i.next()){var s=o.value;if(!r[s])throw ct(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return{appName:e.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(t),installations:e.getProvider("installations").getImmediate(),analyticsProvider:e.getProvider("analytics-internal")};if(!ft())throw Ee.create("unsupported-browser");return new(self&&"ServiceWorkerGlobalScope"in self?it:at)(n)},"PUBLIC").setServiceProps(lt))}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.")}}); diff --git a/Extensions/Firebase/B_firebasejs/B_firebase-performance.js b/Extensions/Firebase/B_firebasejs/B_firebase-performance.js new file mode 100644 index 0000000000..135e834c62 --- /dev/null +++ b/Extensions/Firebase/B_firebasejs/B_firebase-performance.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase)}(this,function(Fe){"use strict";try{(function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=t(Fe),n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;na[0]&&e[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(){for(var t=[],e=0;e"})):"Error",u=this.serviceName+": "+s+" ("+o+").",c=new g(o,u),l=0,f=Object.keys(i);li&&r.push(e.charAt(i));return r.join("")}var Zt,Qt,Xt,te=(ee.prototype.getAppId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!t)throw Wt.create("no app id");return t},ee.prototype.getProjectId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!t)throw Wt.create("no project id");return t},ee.prototype.getApiKey=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!t)throw Wt.create("no api key");return t},ee.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},ee.getInstance=function(){return void 0===Gt&&(Gt=new ee),Gt},ee);function ee(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=Yt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Yt("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}(Xt=Qt=Qt||{})[Xt.UNKNOWN=0]="UNKNOWN",Xt[Xt.VISIBLE=1]="VISIBLE",Xt[Xt.HIDDEN=2]="HIDDEN";var ne=["firebase_","google_","ga_"],re=new RegExp("^[a-zA-Z]\\w*$");function ie(){switch(Jt.getInstance().document.visibilityState){case"visible":return Qt.VISIBLE;case"hidden":return Qt.HIDDEN;default:return Qt.UNKNOWN}}var oe="0.0.1",ae={loggingEnabled:!0},se="FIREBASE_INSTALLATIONS_AUTH";function ue(t){var r,e=function(){var t=Jt.getInstance().localStorage;if(!t)return;var e=t.getItem(Ht);if(!e||!function(t){return Number(t)>Date.now()}(e))return;var n=t.getItem(Ft);if(!n)return;try{return JSON.parse(n)}catch(t){return}}();return e?(le(e),Promise.resolve()):(r=t,function(){var t=te.getInstance().installationsService.getToken();return t.then(function(t){}),t}().then(function(t){var e="https://firebaseremoteconfig.googleapis.com/v1/projects/"+te.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+te.getInstance().getApiKey(),n=new Request(e,{method:"POST",headers:{Authorization:se+" "+t},body:JSON.stringify({app_instance_id:r,app_instance_id_token:t,app_id:te.getInstance().getAppId(),app_version:Ut,sdk_version:oe})});return fetch(n).then(function(t){if(t.ok)return t.json();throw Wt.create("RC response not ok")})}).catch(function(){$t.info(ce)}).then(le).then(function(t){var e=Jt.getInstance().localStorage;if(!t||!e)return;e.setItem(Ft,JSON.stringify(t)),e.setItem(Ht,String(Date.now()+60*te.getInstance().configTimeToLive*60*1e3))},function(){}))}var ce="Could not fetch config, will use default configs";function le(t){if(!t)return t;var e=te.getInstance(),n=t.entries||{};return e.loggingEnabled=void 0!==n.fpr_enabled?"true"===String(n.fpr_enabled):ae.loggingEnabled,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=fe(e.tracesSamplingRate),e.logNetworkAfterSampling=fe(e.networkRequestsSamplingRate),t}function fe(t){return Math.random()<=t}var pe,he=1;function de(){return he=2,pe=pe||function(){var n=Jt.getInstance().document;return new Promise(function(t){var e;n&&"complete"!==n.readyState?(e=function(){"complete"===n.readyState&&(n.removeEventListener("readystatechange",e),t())},n.addEventListener("readystatechange",e)):t()})}().then(function(){return(t=te.getInstance().installationsService.getId()).then(function(t){Zt=t}),t;var t}).then(ue).then(ge,ge)}function ge(){he=3}var ve,me=1e4,ye=5500,be=3,_e=be,we=[],Ie=!1;function Se(t){setTimeout(function(){if(0!==_e)return we.length?void function(){var t=o(we);we=[];var e=t.map(function(t){return{source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)}});(function(t,i){return function(t){var e=te.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}(t).then(function(t){return t.ok||$t.info("Call to Firebase backend failed."),t.json()}).then(function(t){var e=Number(t.nextRequestWaitMillis),n=me;isNaN(e)||(n=Math.max(e,n));var r=t.logResponseDetails;Array.isArray(r)&&0s[0]&&e[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(){for(var t=[],e=0;e"})):"Error",u=this.serviceName+": "+a+" ("+o+").",c=new g(o,u),l=0,f=Object.keys(i);la[0]&&t[1]"})):"Error",u=this.serviceName+": "+s+" ("+i+").",c=new d(i,u),l=0,h=Object.keys(o);l>6,128|63&n):55296==(64512&n)?r>18,128|n>>12&63,128|n>>6&63,128|63&n)):t.push(239,191,189):56320==(64512&n)?t.push(239,191,189):t.push(224|n>>12,128|n>>6&63,128|63&n)}return new Uint8Array(t)}function M(t,e){switch(t){case C.BASE64:var r=-1!==e.indexOf("-"),n=-1!==e.indexOf("_");if(r||n)throw P(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break;case C.BASE64URL:var o=-1!==e.indexOf("+"),i=-1!==e.indexOf("/");if(o||i)throw P(t,"Invalid character '"+(o?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}var a;try{a=atob(e)}catch(e){throw P(t,"Invalid character found")}for(var s=new Uint8Array(a.length),u=0;u][;base64],");var r,n,o=t[1]||null;null!=o&&(this.base64=(n=";base64",(r=o).length>=n.length&&r.substring(r.length-n.length)===n),this.contentType=this.base64?o.substring(0,o.length-";base64".length):o),this.rest=e.substring(e.indexOf(",")+1)};var j,q,F={STATE_CHANGED:"state_changed"},H="running",z="pausing",G="paused",X="success",V="canceling",W="canceled",K="error",Z={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function J(e){switch(e){case H:case z:case V:return Z.RUNNING;case G:return Z.PAUSED;case X:return Z.SUCCESS;case W:return Z.CANCELED;case K:default:return Z.ERROR}}function $(e){return null!=e}function Q(e){return void 0!==e}function Y(e){return"function"==typeof e}function ee(e){return"object"==typeof e}function te(e){return"string"==typeof e||e instanceof String}function re(e){return"number"==typeof e||e instanceof Number}function ne(e){return oe()&&e instanceof Blob}function oe(){return"undefined"!=typeof Blob}(q=j=j||{})[q.NO_ERROR=0]="NO_ERROR",q[q.NETWORK_ERROR=1]="NETWORK_ERROR",q[q.ABORT=2]="ABORT";var ie=(ae.prototype.send=function(e,t,r,n){if(this.sent_)throw S("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),$(n))for(var o in n)n.hasOwnProperty(o)&&this.xhr_.setRequestHeader(o,n[o].toString());return $(r)?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_},ae.prototype.getErrorCode=function(){if(!this.sent_)throw S("cannot .getErrorCode() before sending");return this.errorCode_},ae.prototype.getStatus=function(){if(!this.sent_)throw S("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}},ae.prototype.getResponseText=function(){if(!this.sent_)throw S("cannot .getResponseText() before sending");return this.xhr_.responseText},ae.prototype.abort=function(){this.xhr_.abort()},ae.prototype.getResponseHeader=function(e){return this.xhr_.getResponseHeader(e)},ae.prototype.addUploadProgressListener=function(e){$(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",e)},ae.prototype.removeUploadProgressListener=function(e){$(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",e)},ae);function ae(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=j.NO_ERROR,this.sendPromise_=new Promise(function(e){t.xhr_.addEventListener("abort",function(){t.errorCode_=j.ABORT,e(t)}),t.xhr_.addEventListener("error",function(){t.errorCode_=j.NETWORK_ERROR,e(t)}),t.xhr_.addEventListener("load",function(){e(t)})})}var se=(ue.prototype.createXhrIo=function(){return new ie},ue);function ue(){}function ce(){for(var e=[],t=0;t updater(newEmail)) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + + /** + * Changes the users password. + * Use this when using basic auth. + * @param {string} email - Old email for reauthentication. + * @param {string} oldPassword - Old password for reauthentication. + * @param {string} newPassword - New password for the user. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ + changePassword(email, oldPassword, newPassword, callbackStateVariable) { + let credential = firebase.auth.EmailAuthProvider.credential( + email, + oldPassword + ); + gdjs.evtTools.firebase.auth.currentUser + .reauthenticateWithCredential(credential) + .then(() => + gdjs.evtTools.firebase.auth.currentUser.updatePassword(newPassword) + ) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + + /** + * Deletes the current user. + * Use this when using basic auth. + * @param {string} email - Old email for reauthentication. + * @param {string} password - Old password for reauthentication. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ + deleteUser(email, password, callbackStateVariable) { + let credential = firebase.auth.EmailAuthProvider.credential( + email, + password + ); + gdjs.evtTools.firebase.auth.currentUser + .reauthenticateWithCredential(credential) + .then(() => gdjs.evtTools.firebase.auth.currentUser.delete()) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + + /** + * Changes the users email. + * Use this when using an external provider. + * @param {string} newEmail - New email for the user. + * @param {boolean} sendVerificationEmail - Send a verification email to the old address before changing the email? + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ + changeEmailProvider( + newEmail, + sendVerificationEmail, + callbackStateVariable + ) { + let updater = sendVerificationEmail + ? gdjs.evtTools.firebase.auth.currentUser.updateEmail + : gdjs.evtTools.firebase.auth.currentUser.verifyBeforeUpdateEmail; + + gdjs.evtTools.firebase.auth.currentUser + .reauthenticateWithPopup(gdjs.evtTools.firebase.auth._currentProvider) + .then(() => updater(newEmail)) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + + /** + * Changes the users password. + * Use this when using an external provider. + * @param {string} newPassword - New password for the user. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ + changePasswordProvider(newPassword, callbackStateVariable) { + gdjs.evtTools.firebase.auth.currentUser + .reauthenticateWithPopup(gdjs.evtTools.firebase.auth._currentProvider) + .then(() => + gdjs.evtTools.firebase.auth.currentUser.updatePassword(newPassword) + ) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + + /** + * Deletes the current user. + * Use this when using an external provider. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ + deleteUserProvider(callbackStateVariable) { + gdjs.evtTools.firebase.auth.currentUser + .reauthenticateWithPopup(gdjs.evtTools.firebase.auth._currentProvider) + .then(() => gdjs.evtTools.firebase.auth.currentUser.delete()) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, + }, + + /** + * Verifies if the current users email is verified. + * @returns {boolean} + */ + isEmailVerified() { + return gdjs.evtTools.firebase.auth.currentUser.emailVerified; + }, + + /** + * Gets the users email address. + * @returns {string} + */ + getEmail() { + return gdjs.evtTools.firebase.auth.currentUser.email || ''; + }, + + /** + * Gets the creation date of the logged in users account. + * @returns {string} + */ + getCreationTime() { + return gdjs.evtTools.firebase.auth.currentUser.metadata.creationTime || ''; + }, + + /** + * Gets the last login date of the logged in users account. + * @returns {string} + */ + getLastLoginTime() { + return ( + gdjs.evtTools.firebase.auth.currentUser.metadata.lastSignInTime || '' + ); + }, + + /** + * Gets the display name of the current user. + * @returns {string} + */ + getDisplayName() { + return gdjs.evtTools.firebase.auth.currentUser.displayName || ''; + }, + + /** + * Gets the current users phone number. + * @returns {string} + */ + getPhoneNumber() { + return gdjs.evtTools.firebase.auth.currentUser.phoneNumber || ''; + }, + + /** + * Gets the current users Unique IDentifier. + * @returns {string} + */ + getUID() { + return gdjs.evtTools.firebase.auth.currentUser.uid || ''; + }, + + /** + * Gets the tenant ID. + * For advanced usage only. + * @returns {string} + */ + getTenantID() { + return gdjs.evtTools.firebase.auth.currentUser.tenantId || ''; + }, + + /** + * Gets the refresh token. + * For advanced usage only. + * @returns {string} + */ + getRefreshToken() { + return gdjs.evtTools.firebase.auth.currentUser.refreshToken || ''; + }, + + /** + * Gets the users profile picture URL. + * @returns {string} + */ + getPhotoURL() { + return gdjs.evtTools.firebase.auth.currentUser.photoURL || ''; + }, + + /** + * Changes the display name of an user. + * @param {string} newDisplayName + */ + setDisplayName(newDisplayName) { + gdjs.evtTools.firebase.auth.currentUser.updateProfile({ + displayName: newDisplayName, + }); + }, + + /** + * Changes the URL to the profile picture of the user. + * @param {string} newDisplayName + */ + setPhotoURL(newPhotoURL) { + gdjs.evtTools.firebase.auth.currentUser.updateProfile({ + photoURL: newPhotoURL, + }); + }, + + /** + * Send an email to the users email adress to verify it. + * @note Even though this function is redundant, we keep it for consistency. + * @see gdjs.evtTools.firebase.auth.currentUser.sendEmailVerification + */ + sendVerificationEmail() { + gdjs.evtTools.firebase.auth.currentUser.sendEmailVerification(); + }, +}; + +/** + * Get the logged-in users authentication token. + * Tries to refresh it everytime the function is called. + * @returns {string} + */ +gdjs.evtTools.firebase.auth.token = function () { + this.currentUser + .getIdToken() + .then((token) => (gdjs.evtTools.firebase.auth._token = token)); + return this._token; +}; + +/** + * Returns true if the user is currently authentified. + * @returns {boolean} + * @see gdjs.evtTools.firebase.auth.authentified + */ +gdjs.evtTools.firebase.auth.isAuthentified = function () { + return gdjs.evtTools.firebase.auth.authentified; +}; + +/** + * Signs the user in with basic email-password authentication. + * @param {string} email - The users email. + * @param {string} password - The users password. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.auth.signInWithEmail = function ( + email, + password, + callbackStateVariable +) { + firebase + .auth() + .signInWithEmailAndPassword(email, password) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Creates an account with basic email-password authentication. + * @param {string} email - The users email. + * @param {string} password - The users password. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.auth.createAccountWithEmail = function ( + email, + password, + callbackStateVariable +) { + firebase + .auth() + .createUserWithEmailAndPassword(email, password) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Login with a temporary account. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.auth.anonymSignIn = function (callbackStateVariable) { + firebase + .auth() + .signInAnonymously() + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Signs the user in with an external provider. + * Only works on the web, NOT on Electron/Cordova. + * @param {"google" | "facebook" | "github" | "twitter"} providerName - The external provider to use. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.auth.signInWithProvider = function ( + providerName, + callbackStateVariable +) { + let providerCtor = gdjs.evtTools.firebase.auth.providersList[providerName]; + gdjs.evtTools.firebase.auth._currentProvider = new providerCtor(); + + firebase + .auth() + .signInWithPopup(gdjs.evtTools.firebase.auth._currentProvider) + .then(() => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +// Listen to authentication state changes to regenerate tokens and keep the user and the authenticated state up to date +gdjs.evtTools.firebase.onAppCreated.push(function () { + firebase.auth().onAuthStateChanged(function (user) { + if (user) { + gdjs.evtTools.firebase.auth.authentified = true; + gdjs.evtTools.firebase.auth.currentUser = user; + user + .getIdToken() + .then((token) => (gdjs.evtTools.firebase.auth._token = token)); // Pregenerate the token + } else { + gdjs.evtTools.firebase.auth.authentified = false; + gdjs.evtTools.firebase.auth.currentUser = null; + } + }); +}); diff --git a/Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js b/Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js new file mode 100644 index 0000000000..c7d96e4313 --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js @@ -0,0 +1,352 @@ +/** + * Firebase Tools Collection. + * @fileoverview + * @author arthuro555 + */ + +/** + * Firebase Cloud Firestore Event Tools. + * @namespace + */ +gdjs.evtTools.firebase.firestore = {}; + +/** + * Writes a variable in a collection as document. + * @param {string} collectionName - The collection where to store the variable. + * @param {string} variableName - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} variable - The variable to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.firestore.writeDocument = function ( + collectionName, + variableName, + variable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(variableName) + .set(JSON.parse(gdjs.evtTools.network.variableStructureToJSON(variable))) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Writes a field of a document. + * @param {string} collectionName - The collection where to store the document. + * @param {string} documentName - The name of the document where to write a field. + * @param {string} field - The field where to write. + * @param {string | number} value - The value to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + * @param {boolean} [merge] - Should the new field replace the document or be merged with the document? + */ +gdjs.evtTools.firebase.firestore.writeField = function ( + collectionName, + documentName, + field, + value, + callbackStateVariable, + merge +) { + merge = merge == undefined ? true : merge; + const updateObject = {}; + updateObject[field] = value; + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .set(updateObject, { merge: merge }) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Updates a variable/document. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} variableName - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} variable - The variable to update. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.firestore.updateDocument = function ( + collectionName, + variableName, + variable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(variableName) + .update(JSON.parse(gdjs.evtTools.network.variableStructureToJSON(variable))) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Updates a field of a document. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document where to update a field. + * @param {string} field - The field where to update. + * @param {string | number} value - The value to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.firestore.updateField = function ( + collectionName, + documentName, + field, + value, + callbackStateVariable +) { + const updateObject = {}; + updateObject[field] = value; + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .update(updateObject) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Deletes a document. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document to delete. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.firestore.deleteDocument = function ( + collectionName, + documentName, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .delete() + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Deletes a field of a document. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document where to delete a field. + * @param {string} field - The field to delete. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.firestore.deleteField = function ( + collectionName, + documentName, + field, + callbackStateVariable +) { + const updateObject = {}; + updateObject[field] = firebase.firestore.FieldValue.delete(); + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .update(updateObject) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Gets a document and store it in a variable. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document to get. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.firestore.getDocument = function ( + collectionName, + documentName, + callbackValueVariable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .get() + .then(function (doc) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (callbackValueVariable) + gdjs.evtTools.network._objectToVariable( + doc.data(), + callbackValueVariable + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Gets a field of a document and store it in a variable. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document. + * @param {string} field - The field to get. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.firestore.getField = function ( + collectionName, + documentName, + field, + callbackValueVariable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .get() + .then(function (doc) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (callbackValueVariable) + gdjs.evtTools.network._objectToVariable( + doc.get(field), + callbackValueVariable + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Checks for existence of a document. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document to check. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.firestore.hasDocument = function ( + collectionName, + documentName, + callbackValueVariable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .get() + .then(function (doc) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (callbackValueVariable) + callbackValueVariable.setString(doc.exists ? 'true' : 'false'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Checks for existence of a field. + * @param {string} collectionName - The collection where the document is stored. + * @param {string} documentName - The name of the document. + * @param {string} field - The field to check. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.firestore.hasField = function ( + collectionName, + documentName, + field, + callbackValueVariable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .doc(documentName) + .get() + .then(function (doc) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (callbackValueVariable) + callbackValueVariable.setString( + doc.get(field) === undefined ? 'false' : 'true' + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Lists all the documents in a collection. + * @param {string} collectionName - The collection where to count documents. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.firestore.listDocuments = function ( + collectionName, + callbackValueVariable, + callbackStateVariable +) { + firebase + .firestore() + .collection(collectionName) + .get() + .then(function (snapshot) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(snapshot.empty ? 'empty' : 'ok'); + if (callbackValueVariable) + gdjs.evtTools.network._objectToVariable( + snapshot.docs.map((doc) => doc.id), + callbackValueVariable + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; diff --git a/Extensions/Firebase/C_firebasetools/D_databasetools.js b/Extensions/Firebase/C_firebasetools/D_databasetools.js new file mode 100644 index 0000000000..54d0f5aaaa --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_databasetools.js @@ -0,0 +1,294 @@ +/** + * Firebase Tools Collection. + * @fileoverview + * @author arthuro555 + */ + +/** + * Firebase Cloud database Event Tools. + * @namespace + */ +gdjs.evtTools.firebase.database = {}; + +/** + * (Over)writes a variable in a collection as database variable. + * @param {string} path - The path where to store the variable. + * @param {gdjs.Variable} variable - The variable to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.database.writeVariable = function ( + path, + variable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .set(JSON.parse(gdjs.evtTools.network.variableStructureToJSON(variable))) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * (Over)writes a field of a database variable. + * @param {string} path - The path where to write the field. + * @param {string} field - What field to write. + * @param {string | number} value - The value to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + * @param {boolean} [merge] - Should the new field replace the document or be merged with the document? + */ +gdjs.evtTools.firebase.database.writeField = function ( + path, + field, + value, + callbackStateVariable +) { + const newObject = {}; + newObject[field] = value; + firebase + .database() + .ref(path) + .set(newObject) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Updates a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} variable - The variable to update. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.database.updateVariable = function ( + path, + variable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .update(JSON.parse(gdjs.evtTools.network.variableStructureToJSON(variable))) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Updates a field of a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {string} field - The field where to update. + * @param {string | number} value - The value to write. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.database.updateField = function ( + path, + field, + value, + callbackStateVariable +) { + const updateObject = {}; + updateObject[field] = value; + firebase + .database() + .ref(path) + .update(updateObject) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Deletes a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.database.deleteVariable = function ( + path, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .remove() + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Deletes a field of a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {string} field - The field to delete. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store the result. + */ +gdjs.evtTools.firebase.database.deleteField = function ( + path, + field, + callbackStateVariable +) { + const updateObject = {}; + updateObject[field] = null; + firebase + .database() + .ref(path) + .update(updateObject) + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Gets a database variable and store it in a variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} callbackValueVariable - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.database.getVariable = function ( + path, + callbackValueVariable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .once('value') + .then(function (snapshot) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (typeof callbackValueVariable !== 'undefined') + gdjs.evtTools.network._objectToVariable( + snapshot.val(), + callbackValueVariable + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Gets a field of a database variable and store it in a variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {string} field - The field to get. + * @param {gdjs.Variable} callbackValueVariable - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.database.getField = function ( + path, + field, + callbackValueVariable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .once('value') + .then(function (snapshot) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (typeof callbackValueVariable !== 'undefined') + gdjs.evtTools.network._objectToVariable( + snapshot.val()[field], + callbackValueVariable + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Checks for existence of a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {gdjs.Variable} callbackValueVariable - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.database.hasVariable = function ( + path, + callbackValueVariable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .once('value') + .then(function (snapshot) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (typeof callbackValueVariable !== 'undefined') + callbackValueVariable.setString( + snapshot.exists() && snapshot.val() !== null ? 'true' : 'false' + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Checks for existence of a database variable. + * @param {string} path - The name under wich the variable will be saved (document name). + * @param {string} field - The field to check. + * @param {gdjs.Variable} callbackValueVariable - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.database.hasField = function ( + path, + field, + callbackValueVariable, + callbackStateVariable +) { + firebase + .database() + .ref(path) + .once('value') + .then(function (snapshot) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (typeof callbackValueVariable !== 'undefined') + callbackValueVariable.setString( + snapshot.val() == null || snapshot.val()[field] == null + ? 'false' + : 'true' + ); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; diff --git a/Extensions/Firebase/C_firebasetools/D_functionstools.js b/Extensions/Firebase/C_firebasetools/D_functionstools.js new file mode 100644 index 0000000000..6f4d842355 --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_functionstools.js @@ -0,0 +1,47 @@ +/** + * Firebase Tools Collection. + * @fileoverview + * @author arthuro555 + */ + +/** + * Firebase Functions Event Tools. + * @namespace + */ +gdjs.evtTools.firebase.functions = { + /** + * Call an http function. + * @param {string} httpFunctionName - The name of the function to call + * @param {string | Object} [parameters] - Parameters for the function either as a JS object or a string. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ + call( + httpFunctionName, + parameters, + callbackValueVariable, + callbackStateVariable + ) { + let param; + try { + param = JSON.parse(parameters); + } catch { + param = parameters; + } + + firebase + .functions() + .httpsCallable(httpFunctionName)(param) + .then((response) => response.data) + .then((data) => { + if (callbackValueVariable) + gdjs.evtTools.network._objectToVariable(data, callbackValueVariable); + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch((error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); + }, +}; diff --git a/Extensions/Firebase/C_firebasetools/D_performancetools.js b/Extensions/Firebase/C_firebasetools/D_performancetools.js new file mode 100644 index 0000000000..4afa1596e3 --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_performancetools.js @@ -0,0 +1,62 @@ +/** + * Firebase Tools Collection. + * @fileoverview + * @author arthuro555 + */ + +/** + * Firebase Performance Event Tools. + * @namespace + */ +gdjs.evtTools.firebase.performance = { + /** @type {Object.} */ + tracers: {}, +}; + +/** + * Get a tracer (custom event) by name, if it doesn't exists create it. + * @param {string} tracerName - The name of the tracer. + * @returns {firebase.performance.Trace} The tracer instance. + */ +gdjs.evtTools.firebase.performance.getTracer = function (tracerName) { + if (!gdjs.evtTools.firebase.performance.tracers.hasOwnProperty(tracerName)) { + gdjs.evtTools.firebase.performance.tracers[ + tracerName + ] = firebase.performance().trace(tracerName); + } + return gdjs.evtTools.firebase.performance.tracers[tracerName]; +}; + +/** + * Start measuring performance for a custom event (tracer). + * @param {string} tracerName - The name of the tracer. + */ +gdjs.evtTools.firebase.performance.startTracer = function (tracerName) { + gdjs.evtTools.firebase.performance.getTracer(tracerName).start(); +}; + +/** + * Stop measuring performance for a custom event (tracer). + * @param {string} tracerName - The name of the tracer. + */ +gdjs.evtTools.firebase.performance.stopTracer = function (tracerName) { + gdjs.evtTools.firebase.performance.getTracer(tracerName).stop(); + delete gdjs.evtTools.firebase.performance.tracers[tracerName]; +}; + +/** + * Record performance for a specific time. + * @param {string} tracerName - The name of the tracer. + * @param {number} delay - The delay before starting measuring. + * @param {number} duration - The duration of the measuring. + */ +gdjs.evtTools.firebase.performance.recordPerformance = function ( + tracerName, + delay, + duration +) { + let currentTimeSinceEpoch = Date.now(); + gdjs.evtTools.firebase.performance + .getTracer(tracerName) + .record(currentTimeSinceEpoch + delay, duration); +}; diff --git a/Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js b/Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js new file mode 100644 index 0000000000..529555f1a7 --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js @@ -0,0 +1,35 @@ +/** + * Firebase Tools Collection + * @fileoverview + * @author arthuro555 + */ + +/** + * Remote Config Tools + * @namespace + */ +gdjs.evtTools.firebase.remoteConfig = {}; + +/** + * Set the interval between auto-config updates. + */ +gdjs.evtTools.firebase.remoteConfig.setAutoUpdateInterval = function ( + interval +) { + firebase.remoteConfig().settings.minimumFetchIntervalMillis = interval; +}; + +/** + * Set the default configuration, for when starting the game offline. + * @param {gdjs.Variable} variable - A structure defining the default variables. + */ +gdjs.evtTools.firebase.remoteConfig.setDefaultConfig = function (variable) { + firebase.remoteConfig().defaultConfig = JSON.parse( + gdjs.evtTools.network.variableStructureToJSON(variable) + ); +}; + +gdjs.evtTools.firebase.onAppCreated.push(function () { + // Synchronisation seems to be impossible when that value isn't preset. + firebase.remoteConfig().settings.minimumFetchIntervalMillis = -1; +}); diff --git a/Extensions/Firebase/C_firebasetools/D_storagetools.js b/Extensions/Firebase/C_firebasetools/D_storagetools.js new file mode 100644 index 0000000000..bd13c1b88f --- /dev/null +++ b/Extensions/Firebase/C_firebasetools/D_storagetools.js @@ -0,0 +1,134 @@ +/** + * Firebase Tools Collection + * @fileoverview + * @author arthuro555 + */ + +/** + * Firebase Storage Event Tools + * @namespace + */ +gdjs.evtTools.firebase.storage = { + uploads: new gdjs.UIDArray(), +}; + +/** + * Uploads a file as string to the firebase storage bucket. + * @param {string} file - The entire file as string. + * @param {string} onlinePath - The path under wich the file will be accessible on the bucket. + * @param {"none"|"base64"|"base64url"|"data_url"} [type] - The type/format of the string to upload. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result (url to the file). + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + * @param {gdjs.Variable} [callbackUIDVariable] - The variable where to store the upload ID. + * @param {gdjs.Variable} [callbackProgressVariable] - The variable where to store the progress. + */ +gdjs.evtTools.firebase.storage.upload = function ( + file, + onlinePath, + type, + callbackValueVariable, + callbackStateVariable, + callbackUIDVariable, + callbackProgressVariable +) { + type = type === 'none' ? undefined : type; + + let uploadTask; + try { + uploadTask = firebase + .storage() + .ref() + .child(onlinePath) + .putString(file, type); + } catch (e) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(e.message); + return; + } + + let uploadID; + if (typeof callbackUIDVariable !== 'undefined') { + // Only bother pushing if the ID will be stored. + uploadID = gdjs.evtTools.firebase.storage.uploads.push(uploadTask); + callbackUIDVariable.setNumber(uploadID); + } + + uploadTask.on( + firebase.storage.TaskEvent.STATE_CHANGED, + (uploadProgress) => { + if (typeof callbackProgressVariable !== 'undefined') + gdjs.evtTools.network._objectToVariable( + uploadProgress, + callbackProgressVariable, + ['tasks'] // Remove circular reference. + ); + }, + (error) => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }, + () => { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + if (typeof callbackUIDVariable !== 'undefined') { + gdjs.evtTools.firebase.storage.uploads.remove(uploadID); // Free memory. + } + uploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(downloadURL); + }); + } + ); +}; + +/** + * Generate a download URL for a file. + * @param {string} filePath - The path in the remote storage bucket to the file to download. + * @param {gdjs.Variable} [callbackValueVariable] - The variable where to store the result. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.storage.getDownloadURL = function ( + filePath, + callbackValueVariable, + callbackStateVariable +) { + firebase + .storage() + .ref() + .child(filePath) + .getDownloadURL() + .then(function (downloadURL) { + if (typeof callbackValueVariable !== 'undefined') + callbackValueVariable.setString(downloadURL); + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; + +/** + * Deletes a file on the remote storage bucket. + * @param {string} filePath - The path in the remote storage bucket to the file to download. + * @param {gdjs.Variable} [callbackStateVariable] - The variable where to store if the operation was successful. + */ +gdjs.evtTools.firebase.storage.delete = function ( + filePath, + callbackStateVariable +) { + firebase + .storage() + .ref() + .child(filePath) + .delete() + .then(function () { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString('ok'); + }) + .catch(function (error) { + if (typeof callbackStateVariable !== 'undefined') + callbackStateVariable.setString(error.message); + }); +}; diff --git a/Extensions/Firebase/JsExtension.js b/Extensions/Firebase/JsExtension.js new file mode 100644 index 0000000000..3e0d400893 --- /dev/null +++ b/Extensions/Firebase/JsExtension.js @@ -0,0 +1,1815 @@ +// @flow +/** + * This is a declaration of an extension for GDevelop 5. + * + * ℹ️ Run `node import-GDJS-Runtime.js` (in newIDE/app/scripts) if you make any change + * to this extension file or to any other *.js file that you reference inside. + * + * The file must be named "JsExtension.js", otherwise GDevelop won't load it. + * ⚠️ If you make a change and the extension is not loaded, open the developer console + * and search for any errors. + * + * More information on https://github.com/4ian/GDevelop/blob/master/newIDE/README-extensions.md + */ +module.exports = { + createExtension: function ( + _ /*: (string) => string */, + gd /*: libGDevelop */ + ) { + const extension = new gd.PlatformExtension(); + + extension + .setExtensionInformation( + 'Firebase', + _('Firebase'), + _( + 'Use Google Firebase services (database, functions, storage...) in your game.' + ), + 'Arthur Pacaud (arthuro555)', + 'MIT' + ) + .setExtensionHelpPath('/all-features/firebase'); + + extension + .registerProperty('FirebaseConfig') + .setLabel(_('Firebase configuration string')) + .setType('textarea'); + + /* ====== ANALYTICS ====== */ + extension + .addAction( + 'AnalyticsEnable', + _('Enable analytics'), + _('Enables Analytics for that project.'), + _('Enable analytics'), + _('Firebase/Analytics'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-analytics.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_analyticstools.js') + .setFunctionName('firebase.analytics'); + + extension + .addAction( + 'AnalyticsLog', + _('Log an Event'), + _( + 'Triggers an Event/Conversion for the current user on the Analytics.' + + 'Can also pass additional data to the Analytics' + ), + _('Trigger Event _PARAM0_ with argument _PARAM1_'), + _('Firebase/Analytics'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Event Name'), '', false) + .addParameter('string', _('Additional Data'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-analytics.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_analyticstools.js') + .setFunctionName('gdjs.evtTools.firebase.analytics.log'); + + extension + .addAction( + 'AnalyticsSetUID', + _('Change user UID'), + _( + "Changes the current user's analytics identifier. " + + 'This is what let Analytics differienciate user, ' + + 'so it should always be unique for each user. ' + + 'For advanced usage only.' + ), + _("Set current user's ID to _PARAM0_"), + _('Firebase/Analytics'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('New Unique ID'), '', false) + .markAsComplex() + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-analytics.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_analyticstools.js') + .setFunctionName('gdjs.evtTools.firebase.analytics.setUserID'); + + extension + .addAction( + 'AnalyticsSetProperty', + _("Set a user's property"), + _( + "Sets an user's properties." + + 'Can be used to classify user in Analytics.' + ), + _('Set property _PARAM0_ of the current user to _PARAM1_'), + _('Firebase/Analytics'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Property Name'), '', false) + .addParameter('string', _('Property Data'), '', false) + .markAsAdvanced() + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-analytics.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_analyticstools.js') + .setFunctionName('gdjs.evtTools.firebase.analytics.setProperty'); + + /* ====== REMOTE CONFIGURATION ====== */ + extension + .addStrExpression( + 'GetRemoteConfigString', + _('Get Remote setting as String'), + _('Get a setting from Firebase Remote Config as a string.'), + _('Firebase/Remote Config'), + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Setting Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-remote-config.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js' + ) + .setFunctionName('firebase.remoteConfig().getString'); + + extension + .addExpression( + 'GetRemoteConfigNumber', + _('Get Remote setting as Number'), + _('Get a setting from Firebase Remote Config as Number.'), + _('Firebase/Remote Config'), + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Setting Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-remote-config.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js' + ) + .setFunctionName('firebase.remoteConfig().getNumber'); + + extension + .addAction( + 'SetRemoteConfigAutoUpdateInterval', + _('Set Remote Config Auto Update Inteval'), + _('Sets Remote Config Auto Update Inteval.'), + _('Set Remote Config Auto Update Inteval to _PARAM0_'), + _('Firebase/Remote Config'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('number', _('Update Interval in ms'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-remote-config.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js' + ) + .setFunctionName( + 'gdjs.evtTools.firebase.remoteConfig.setAutoUpdateInterval' + ); + + extension + .addAction( + 'SetRemoteConfigDefaultConfig', + _('Set the default configuration'), + _( + 'As the Remote Config is stored online, you need to set default values ' + + 'or the Remote Config expressions to return while there is no internet or ' + + 'the config is still loading.' + ), + _('Set default config to _PARAM0_'), + _('Firebase/Remote Config'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('scenevar', _('Structure with defaults'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-remote-config.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_remoteconfigtools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.remoteConfig.setDefaultConfig'); + + extension + .addAction( + 'ForceReloadRemoteConfig', + _('Force sync the configuration'), + _('Use this to sync the Remote Config with the client at any time.'), + _('Synchronize Remote Config'), + _('Firebase/Remote Config'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-remote-config.js' + ) + .setFunctionName('firebase.remoteConfig().fetchAndActivate'); + + /* ====== AUTHENTICATION ====== */ + // Auth Instructions + extension + .addAction( + 'CreateBasicAccount', + _('Create account with with email'), + _('Create an account with email and password as credentials.'), + _('Create account with email _PARAM0_ and password _PARAM1_'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Email'), '', false) + .addParameter('string', _('Password'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.createAccountWithEmail'); + + extension + .addAction( + 'BasicAccountSignIn', + _('Sign into an account with email'), + _('Sign into an account with email and password as credentials. '), + _('Connect to account with email _PARAM0_ and password _PARAM1_'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Email'), '', false) + .addParameter('string', _('Password'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.signInWithEmail'); + + extension + .addAction( + 'Logout', + _('Log out of the account'), + _('Logs out of the current account. '), + _('Log out from the account'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('firebase.auth().signOut'); + + extension + .addAction( + 'ProviderAccountSignIn', + _('Sign into an account with auth from provider'), + _( + 'Sign into an account via an external provider. ' + + 'The available providers are: "google", "facebook", "github" and "twitter".\n' + + 'Provider authentication only works in the browser! Not on previews or pc/mobile exports.' + ), + _('Connect to account with Provider _PARAM0_'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.signInWithProvider'); + + extension + .addAction( + 'AnonymousSignIn', + _('Sign In as an anonymous guest'), + _('Sign into a temporary anonymous account.'), + _('Authenticate anonymously'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.anonymSignIn'); + + extension + .addCondition( + 'IsSignedIn', + _('Is the user signed in?'), + _( + 'Checks if the user is signed in. \nYou should always use ' + + 'this before actions requiring authentications.' + ), + _('Check for authentication'), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.isAuthentified'); + + extension + .addStrExpression( + 'GetAuthToken', + _('Get the user authentififcation token'), + _( + 'Get the user authentififcation token. The token is the proof of authentication.' + ), + _('Firebase/Authentication'), + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Setting Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.token'); + + // User management instructions + extension + .addCondition( + 'IsEmailVerified', + _('Is the user email address verified'), + _('Checks if the email address of the user got verified.'), + _('The email of the user is verified'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.isEmailVerified' + ); + + extension + .addStrExpression( + 'GetUserEmail', + _('Get the user email address'), + _('Gets the user email address.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.userManagement.getEmail'); + + extension + .addStrExpression( + 'GetAccountCreationTime', + _('Get the accounts creation time'), + _('Gets the accounts creation time.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getCreationTime' + ); + + extension + .addStrExpression( + 'GetLastLoginTime', + _('Get the user last login time'), + _('Gets the user last login time.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getLastLoginTime' + ); + + extension + .addStrExpression( + 'GetUserDisplayName', + _('Get the user display name'), + _('Gets the user display name.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getDisplayName' + ); + + extension + .addStrExpression( + 'GetPhoneNumber', + _('Get the user phone number'), + _('Gets the user phone number.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getPhoneNumber' + ); + + extension + .addStrExpression( + 'GetUserUID', + _('Get the user UID'), + _( + 'Gets the user Unique IDentifier. Use that to link data to an ' + + 'user instead of the name or email.' + ), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName('gdjs.evtTools.firebase.auth.userManagement.getUID'); + + extension + .addStrExpression( + 'GetTenantID', + _('Get the user tenant ID'), + _('Gets the user tenant ID. For advanced usage only.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getTenantID' + ); + + extension + .addStrExpression( + 'GetRefreshToken', + _('Get the user refresh token'), + _('Gets the user refresh token. For advanced usage only.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getRefreshToken' + ); + + extension + .addStrExpression( + 'GetPhotoURL', + _('Get the user profile picture URL'), + _('Gets an URL to the user profile picture.'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.getPhotoURL' + ); + + extension + .addAction( + 'SendEmailVerification', + _('Send a verification email'), + _('Send a link per email to verify the user email.'), + _('Send verification email'), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.sendVerificationEmail' + ); + + extension + .addAction( + 'SetDisplayName', + _('Set display name'), + _('Sets the user display name.'), + _("Set the user's display name to _PARAM0_"), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('New display name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.setDisplayName' + ); + + extension + .addAction( + 'SetPhotoURL', + _('Set the user profile picture'), + _('Sets the user profile picture URL to a new one.'), + _("Set the user's profile picture URL to _PARAM0_"), + _('Firebase/Authentication/User Management'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('New profile picture URL'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.setPhotoURL' + ); + + // Advanced Authentication Instructions + extension + .addAction( + 'ChangeEmail', + _('Change the user email'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + "Changes the user's email address." + ), + _( + "Change the user's email to _PARAM0_ and store result in _PARAM4_ (send verification email: _PARAM3_)" + ), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Old email'), '', false) + .addParameter('string', _('Password'), '', false) + .addParameter('string', _('New email'), '', false) + .addParameter( + 'yesorno', + _('Send a verification email before doing the change?'), + '', + false + ) + .setDefaultValue('true') + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.changeEmail' + ); + + extension + .addAction( + 'ChangeEmailProvider', + _('Change the user email (Provider)'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + "Changes the user's email address.\n" + + 'This is the same as Change the user email but reauthenticates via an external provider.' + ), + _( + "Change the user's email to _PARAM0_ and store result in _PARAM2_ (send verification email: _PARAM1_)" + ), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('New email'), '', false) + .addParameter( + 'yesorno', + _('Send a verification email before doing the change?'), + '', + false + ) + .setDefaultValue('true') + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.changeEmailProvider' + ); + + extension + .addAction( + 'ChangePassword', + _('Change the user password'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + 'Changes the user password.' + ), + _( + 'Change the user password to _PARAM2_ and store result in ' + + '_PARAM4_ (send verification email: _PARAM3_)' + ), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Email'), '', false) + .addParameter('string', _('Old password'), '', false) + .addParameter('string', _('New password'), '', false) + .addParameter( + 'yesorno', + _('Send a verification email before doing the change?'), + '', + false + ) + .setDefaultValue('true') + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.changePassword' + ); + + extension + .addAction( + 'ChangePasswordProvider', + _('Change the user password (Provider)'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + 'Changes the user password.\n' + + 'This is the same as "Change the user password" but reauthenticates via an external provider.' + ), + _( + 'Change the user password to _PARAM0_ and store result in ' + + '_PARAM2_ (send verification email: _PARAM1_)' + ), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('New Password'), '', false) + .addParameter( + 'yesorno', + _('Send a verification email before doing the change?'), + '', + false + ) + .setDefaultValue('true') + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.changePasswordProvider' + ); + + extension + .addAction( + 'DeleteUser', + _('Delete the user account'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + 'Deletes the user account.' + ), + _('Delete the user account and store result in _PARAM2_'), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Email'), '', false) + .addParameter('string', _('Password'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.deleteUser' + ); + + extension + .addAction( + 'DeleteUserProvider', + _('Delete the user account (Provider)'), + _( + 'This action is dangerous so it requires reauthentication.\n' + + 'Deletes the user account.\n' + + 'This is the same as "Delete the user account" but reauthenticates via an external provider.' + ), + _('Delete the user account and store result in _PARAM0_'), + _('Firebase/Authentication/User Management/Advanced'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-auth.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_authtools.js') + .setFunctionName( + 'gdjs.evtTools.firebase.auth.userManagement.dangerous.deleteUserProvider' + ); + + /* ====== PERFORMANCE ====== */ + + extension + .addAction( + 'EnablePerformance', + _('Enable performance measuring'), + _('Enables performance measuring.'), + _('Enable performance measuring'), + _('Firebase/Performance Measuring'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-performance.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .setFunctionName('firebase.performance'); + + extension + .addAction( + 'AddTracer', + _('Create a custom performance tracker'), + _( + "Creates a new custom performance tracker (If it doesn't already exists). " + + 'They are used to measure performance of custom events.' + ), + _('Create performance tracker: _PARAM0_'), + _('Firebase/Performance Measuring'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Tracker Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-performance.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_performancetools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.performance.getTracer'); + + extension + .addAction( + 'StartTracer', + _('Start a tracer'), + _('Start measuring performance for that tracer'), + _('Start performance measuring on tracer _PARAM0_'), + _('Firebase/Performance Measuring'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Tracker Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-performance.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_performancetools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.performance.startTracer'); + + extension + .addAction( + 'StopTracer', + _('Stop a tracer'), + _('Stop measuring performance for that tracer'), + _('Stop performance measuring on tracer _PARAM0_'), + _('Firebase/Performance Measuring'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Tracker Name'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-performance.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_performancetools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.performance.stopTracer'); + + extension + .addAction( + 'RecordTracer', + _('Record performance'), + _( + 'Record performance for a delimited period of time. ' + + 'Use this if you want to measure the performance for a specified duration.' + ), + _( + 'Record performance for _PARAM1_ms with a delay of _PARAM2_ms (store in tracker _PARAM0_)' + ), + _('Firebase/Performance Measuring'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Tracker Name'), '', false) + .addParameter( + 'number', + _('Delay before measuring start (in ms)'), + '', + false + ) + .addParameter('number', _('Measuring duration (in ms)'), '', false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-performance.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_performancetools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.performance.recordPerformance'); + + /* ====== FUNCTIONS ====== */ + + extension + .addAction( + 'CallHttpFunction', + _('Call a HTTP function'), + _('Calls a HTTP function by name, and store the result in a variable.'), + _( + 'Call HTTP Function _PARAM0_ with parameter(s) _PARAM1_ ' + + '(Callback variables: Value: _PARAM2_ State: _PARAM3_)' + ), + _('Firebase/Functions'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('HTTP Function Name'), '', false) + .addParameter('string', _('Parameter(s) as JSON or string.'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with returned value'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .markAsAdvanced() + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-functions.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_functionstools.js') + .setFunctionName('gdjs.evtTools.firebase.functions.call'); + + /* ====== MESSAGING ====== */ + + /* TODO: reported as needs a service worker, and auto generating one is not currently possible. + extension + .addAction( + 'EnableMessaging', + _('Enable Messaging'), + _('Enables Firebase push messaging.'), + _('Enable Firebase Messaging with Public Key _PARAM0_.'), + _('Firebase/Messaging'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter("string", _("Public Key (VAPID)"), "", false) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-messaging.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/firebase-messaging-sw.js') + .setFunctionName('firebase.messaging().usePublicVapidKey'); + + */ + + /* ====== CLOUD FIRESTORE ====== */ + + extension + .addAction( + 'FirestoreWriteDocument', + _('Write a document to firestore'), + _('Writes a document (variable) to cloud firestore.'), + _( + 'Write _PARAM2_ to firestore in document _PARAM1_ of collection _PARAM0_ (store result state in _PARAM3_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('scenevar', _('Variable to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.writeDocument'); + + extension + .addAction( + 'FirestoreWriteField', + _('Write a field in firestore'), + _('Writes a field of a firestore document.'), + _( + 'Write _PARAM3_ to firestore in field _PARAM2_ of document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM4_, Merge: _PARAM5_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('string', _('Field to write'), '', false) + .addParameter('string', _('Value to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .addParameter('yesorno', _('Merge Document?'), '', true) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.writeField'); + + extension + .addAction( + 'FirestoreUpdateDocument', + _('Update a document in firestore'), + _('Updates a firestore document (variable).'), + _( + 'Update firestore document _PARAM1_ in collection _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('scenevar', _('Variable to update with'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.updateDocument'); + + extension + .addAction( + 'FirestoreUpdateField', + _('Update a field of a document'), + _('Updates a field of a firestore document.'), + _( + 'Update field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with _PARAM3_ (store result state in _PARAM4_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('string', _('Field to update'), '', false) + .addParameter('string', _('Value to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.updateField'); + + extension + .addAction( + 'FirestoreDeleteDocument', + _('Delete a document in firestore'), + _('Deletes a firestore document (variable).'), + _( + 'Delete firestore document _PARAM1_ in collection _PARAM0_ (store result state in _PARAM2_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.deleteDocument'); + + extension + .addAction( + 'FirestoreDeleteField', + _('Delete a field of a document'), + _('Deletes a field of a firestore document.'), + _( + 'Delete field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ with (store result state in _PARAM3_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('string', _('Field to delete'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.deleteField'); + + extension + .addAction( + 'FirestoreGetDocument', + _('Get a document from firestore'), + _('Gets a firestore document and store it in a variable.'), + _( + 'Load firestore document _PARAM1_ from collection _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter( + 'scenevar', + _('Callback variable where to load the document'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.getDocument'); + + extension + .addAction( + 'FirestoreGetField', + _('Get a field of a document'), + _('Gets the value of a field in a firestore document.'), + _( + 'Load field _PARAM2_ of firestore document _PARAM1_ in collection _PARAM0_ into _PARAM3_ (store result state in _PARAM4_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('string', _('Field to get'), '', false) + .addParameter( + 'scenevar', + _("Callback variable where to store the field's value"), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.getField'); + + extension + .addAction( + 'FirestoreHasDocument', + _("Check for a document's existence"), + _( + 'Checks for the existence of a document. Sets the result variable to 1 if it exists else to 2.' + ), + _( + 'Check for existence of _PARAM1_ in collection _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter( + 'scenevar', + _('Callback variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.hasDocument'); + + extension + .addAction( + 'FirestoreHasField', + _("Check for existence of a document's field"), + _( + 'Checks for the existence of a field in a document. Sets the result variable to 1 if it exists else to 2.' + ), + _( + 'Check for existence of _PARAM2_ in document _PARAM1_ of collection _PARAM0_ and store result in _PARAM3_ (store result state in _PARAM4_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter('string', _('Document'), '', false) + .addParameter('string', _('Field to check'), '', false) + .addParameter( + 'scenevar', + _('Callback Variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.hasField'); + + extension + .addAction( + 'FirestoreListDocuments', + _('List all documents of a collection'), + _( + 'Generates a list of all document names in a collection, and stores it as a structure.' + ), + _( + 'List all documents in _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)' + ), + _('Firebase/Cloud Firestore'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Collection'), '', false) + .addParameter( + 'scenevar', + _('Callback Variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile( + 'Extensions/Firebase/B_firebasejs/B_firebase-firestore.js' + ) + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile( + 'Extensions/Firebase/C_firebasetools/D_cloudfirestoretools.js' + ) + .setFunctionName('gdjs.evtTools.firebase.firestore.listDocuments'); + + /* ====== STORAGE ====== */ + + extension + .addAction( + 'StorageUpload', + _('Upload a file'), + _('Upload a file to firebase Storage.'), + _( + 'Save _PARAM0_ in location _PARAM1_ to Firebase storage and store access URL in _PARAM3_ (Format: _PARAM2_, Store result state in _PARAM4_)' + ), + _('Firebase/Storage'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('File content'), '', false) + .addParameter('string', _('Storage path'), '', false) + .addParameter('string', _('File content format'), '', false) + .setDefaultValue('none') + .addParameter( + 'scenevar', + _('Callback Variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback Variable where to store the upload ID'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/A_utils/A_UIDArray.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-storage.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_storagetools.js') + .setFunctionName('gdjs.evtTools.firebase.storage.upload'); + + extension + .addAction( + 'StorageDownload', + _('Get Download URL'), + _('Get a unique download URL for a file.'), + _( + 'Get a download url for _PARAM0_ and store it in _PARAM1_ (store result state in _PARAM2_)' + ), + _('Firebase/Storage'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Storage path to the file'), '', false) + .addParameter( + 'scenevar', + _('Callback variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/A_utils/A_UIDArray.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-storage.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_storagetools.js') + .setFunctionName('gdjs.evtTools.firebase.storage.getDownloadURL'); + + /* ====== REALTIME DATABASE ====== */ + + extension + .addAction( + 'DatabaseWriteVariable', + _('Write a variable to Database'), + _('Writes a variable to Database.'), + _( + 'Write _PARAM1_ to Database in _PARAM0_ (store result state in _PARAM2_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('scenevar', _('Variable to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.writeVariable'); + + extension + .addAction( + 'DatabaseWriteField', + _('Write a field in Database'), + _('Writes a field of a Database document.'), + _( + 'Write _PARAM2_ in field _PARAM1_ of _PARAM0_ (store result state in _PARAM3_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('string', _('Field to write'), '', false) + .addParameter('string', _('Value to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.writeField'); + + extension + .addAction( + 'DatabaseUpdateVariable', + _('Update a document in Database'), + _('Updates a variable on the database.'), + _( + 'Update varable _PARAM0_ with _PARAM1_ (store result state in _PARAM2_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('scenevar', _('Variable to update with'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.updateVariable'); + + extension + .addAction( + 'DatabaseUpdateField', + _('Update a field of a document'), + _('Updates a field of a Database document.'), + _( + 'Update field _PARAM1_ of _PARAM0_ with _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('string', _('Field to update'), '', false) + .addParameter('string', _('Value to write'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.updateField'); + + extension + .addAction( + 'DatabaseDeleteVariable', + _('Delete a database variable'), + _('Deletes a variable from the database.'), + _( + 'Delete variable _PARAM0_ from database (store result state in _PARAM1_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.deleteVariable'); + + extension + .addAction( + 'DatabaseDeleteField', + _('Delete a field of a variable'), + _('Deletes a field of a variable on the database.'), + _( + 'Delete field _PARAM1_ of variable _PARAM0_ on the database (store result state in _PARAM2_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('string', _('Field to delete'), '', false) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.deleteField'); + + extension + .addAction( + 'DatabaseGetVariable', + _('Get a variable from the database'), + _( + 'Gets a variable from the database and store it in a Scene variable.' + ), + _( + 'Load database variable _PARAM0_ into _PARAM1_ (store result state in _PARAM2_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter( + 'scenevar', + _('Callback variable where to store the data'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.getVariable'); + + extension + .addAction( + 'DatabaseGetField', + _('Get a field of a variable'), + _( + 'Gets the value of a field in a variable from the database and store it in a scene variable.' + ), + _( + 'Load field _PARAM1_ of database variable _PARAM0_ into _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('string', _('Field to get'), '', false) + .addParameter( + 'scenevar', + _("Callback variable where to store the field's value"), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.getField'); + + extension + .addAction( + 'DatabaseHasVariable', + _("Check for a variable's existence"), + _( + 'Checks for the existence of a variable. Sets the result variable to 1 if it exists else to 2.' + ), + _( + 'Check for existence of _PARAM0_ and store result in _PARAM1_ (store result state in _PARAM2_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter( + 'scenevar', + _('Callback variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.hasVariable'); + + extension + .addAction( + 'DatabaseHasField', + _("Check for existence of a variable's field"), + _( + 'Checks for the existence of a field in a variable. Sets the result variable to 1 if it exists else to 2.' + ), + _( + 'Check for existence of _PARAM1_ in database variable _PARAM0_ and store result in _PARAM2_ (store result state in _PARAM3_)' + ), + _('Firebase/Realtime Database'), + 'JsPlatform/Extensions/firebase.png', + 'JsPlatform/Extensions/firebase.png' + ) + .addParameter('string', _('Path'), '', false) + .addParameter('string', _('Field to check'), '', false) + .addParameter( + 'scenevar', + _('Callback Variable where to store the result'), + '', + true + ) + .addParameter( + 'scenevar', + _('Callback variable with state (ok or error)'), + '', + true + ) + .getCodeExtraInformation() + .setIncludeFile('Extensions/Firebase/B_firebasejs/A_firebase-base.js') + .addIncludeFile('Extensions/Firebase/B_firebasejs/B_firebase-database.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/C_firebasetools.js') + .addIncludeFile('Extensions/Firebase/C_firebasetools/D_databasetools.js') + .setFunctionName('gdjs.evtTools.firebase.database.hasField'); + + return extension; + }, + runExtensionSanityTests: function ( + gd /*: libGDevelop */, + extension /*: gdPlatformExtension */ + ) { + return []; + }, +}; diff --git a/Extensions/Firebase/README.md b/Extensions/Firebase/README.md new file mode 100644 index 0000000000..ab997b2565 --- /dev/null +++ b/Extensions/Firebase/README.md @@ -0,0 +1,7 @@ +# Firebase Extension + +This is the wrapper for the Firebase SDK for GDevelop. +The files are prefixed with A_, B_, C_ and D_ to classify their import priority (where A has the highest and D the lowest). + +firebasejs contains the Web SDK. +firebasetools contains wrappers for GDevelop. diff --git a/GDJS/Runtime/events-tools/networktools.js b/GDJS/Runtime/events-tools/networktools.js index 37319d0aa2..82509555a4 100644 --- a/GDJS/Runtime/events-tools/networktools.js +++ b/GDJS/Runtime/events-tools/networktools.js @@ -149,11 +149,17 @@ gdjs.evtTools.network.objectVariableStructureToJSON = function ( }; gdjs.evtTools.network._objectToVariable = function (obj, variable) { - if (!isNaN(obj)) { - //Number + if (obj === null) { + variable.setString("null"); + } else if ((typeof obj === "number" || typeof obj === "string") && !isNaN(obj)) { variable.setNumber(obj); - } else if (typeof obj == 'string' || obj instanceof String) { + } else if (typeof obj === 'string' || obj instanceof String) { variable.setString(obj); + } else if (typeof obj === "undefined") { + // Do not modify the variable, as there is no value to set it to. + } else if (typeof obj === "boolean") { + // Convert boolean to string. + variable.setString("" + obj); } else if (Array.isArray(obj)) { for (var i = 0; i < obj.length; ++i) { gdjs.evtTools.network._objectToVariable( @@ -161,12 +167,25 @@ gdjs.evtTools.network._objectToVariable = function (obj, variable) { variable.getChild(i.toString()) ); } - } else { + } else if (typeof obj === "object") { for (var p in obj) { if (obj.hasOwnProperty(p)) { gdjs.evtTools.network._objectToVariable(obj[p], variable.getChild(p)); } } + } else if (typeof obj === "symbol") { + variable.setString(obj.toString()); + } else if (typeof obj === "number" && isNaN(obj)) { + console.warning("Variables cannot be set to NaN, setting it to 0.") + variable.setNumber(0); + } else if (typeof obj === "bigint") { + if(obj > Number.MAX_SAFE_INTEGER) + console.warn("Integers bigger than " + Number.MAX_SAFE_INTEGER + " aren't supported by variables, it will be reduced to that size."); + variable.setNumber(parseInt(obj, 10)); + } else if (typeof obj === "function") { + console.error("Error: Impossible to set variable value to a function.") + } else { + console.error("Cannot identify type of object:", obj); } }; diff --git a/GDevelop.js/package-lock.json b/GDevelop.js/package-lock.json index af8145a655..345f238c6e 100644 --- a/GDevelop.js/package-lock.json +++ b/GDevelop.js/package-lock.json @@ -53,7 +53,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", "dev": true }, "supports-color": { @@ -76,7 +76,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=", "dev": true }, "acorn": { @@ -138,7 +138,7 @@ "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "integrity": "sha1-vLJLTzeTTZqnrBe0ra+J58du8us=", "dev": true, "requires": { "micromatch": "^3.1.4", @@ -160,7 +160,7 @@ "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -273,7 +273,7 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } @@ -281,7 +281,7 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -340,7 +340,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -349,7 +349,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -358,7 +358,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -401,7 +401,7 @@ "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -433,7 +433,7 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", "dev": true, "optional": true }, @@ -525,7 +525,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "arr-union": { @@ -579,7 +579,7 @@ "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", "dev": true }, "async": { @@ -603,7 +603,7 @@ "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k=", "dev": true }, "aws-sign2": { @@ -632,7 +632,7 @@ "babel-core": { "version": "6.26.3", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "integrity": "sha1-suLwnjQtDwyI4vAuBneUEl51wgc=", "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -667,7 +667,7 @@ "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", "dev": true, "requires": { "babel-messages": "^6.23.0", @@ -864,7 +864,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", "dev": true }, "balanced-match": { @@ -876,7 +876,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -900,7 +900,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -909,7 +909,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -918,7 +918,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -1014,7 +1014,7 @@ "browser-resolve": { "version": "1.11.3", "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "integrity": "sha1-m3y7PQ9RDky4a9vXlhJNKLWJCvY=", "dev": true, "requires": { "resolve": "1.1.7" @@ -1047,7 +1047,7 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", "dev": true }, "builtin-modules": { @@ -1059,7 +1059,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -1258,7 +1258,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -1338,7 +1338,7 @@ "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", "dev": true, "requires": { "color-name": "1.1.3" @@ -1593,7 +1593,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -1646,7 +1646,7 @@ "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -1656,7 +1656,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -1665,7 +1665,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -1674,7 +1674,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -1756,7 +1756,7 @@ "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "integrity": "sha1-k3RCZEymoxJh7zbj7Gd/6AVYLJA=", "dev": true, "requires": { "webidl-conversions": "^4.0.2" @@ -1885,7 +1885,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true, "optional": true } @@ -1918,7 +1918,7 @@ "exec-sh": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", - "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", + "integrity": "sha1-Kl5//L19C6J1W97LFuWkJ9+97DY=", "dev": true, "requires": { "merge": "^1.2.0" @@ -2014,7 +2014,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -2105,7 +2105,7 @@ "fill-range": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "integrity": "sha1-6x53OrsFbc2N8r/favWbizqTZWU=", "dev": true, "requires": { "is-number": "^2.1.0", @@ -2779,7 +2779,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "gauge": { @@ -2802,7 +2802,7 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o=", "dev": true }, "get-stdin": { @@ -2977,7 +2977,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", "dev": true }, "graceful-fs": { @@ -3290,7 +3290,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true }, "uglify-js": { @@ -3325,7 +3325,7 @@ "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", "dev": true, "requires": { "function-bind": "^1.1.1" @@ -3511,7 +3511,7 @@ "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "integrity": "sha1-5w2EuU2lOqN14R/jo1G+ZkLKRvg=", "dev": true, "requires": { "whatwg-encoding": "^1.0.1" @@ -3595,7 +3595,7 @@ "import-local": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", - "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "integrity": "sha1-Xk/9wD9P5sAJxnKb6yljHC+CJ7w=", "dev": true, "requires": { "pkg-dir": "^2.0.0", @@ -3649,7 +3649,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -3679,7 +3679,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, "is-builtin-module": { @@ -3700,7 +3700,7 @@ "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "integrity": "sha1-43ecjuF/zPQoSI9uKBGH8uYyhBw=", "dev": true, "requires": { "ci-info": "^1.5.0" @@ -3724,7 +3724,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -3735,7 +3735,7 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } @@ -3812,7 +3812,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -3880,7 +3880,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", "dev": true }, "isarray": { @@ -3913,7 +3913,7 @@ "istanbul-api": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.7.tgz", - "integrity": "sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA==", + "integrity": "sha1-qGx3DSsD4R4/d4zXrt2C0nIgkqo=", "dev": true, "requires": { "async": "^2.1.4", @@ -3965,13 +3965,13 @@ "istanbul-lib-coverage": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", - "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", + "integrity": "sha1-zPftzQoLubj3Kf7rCTBHD5r2ZPA=", "dev": true }, "istanbul-lib-hook": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz", - "integrity": "sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw==", + "integrity": "sha1-vGvwfxKmQfvxyFOR0Nqo8K6mv4Y=", "dev": true, "requires": { "append-transform": "^0.4.0" @@ -3980,7 +3980,7 @@ "istanbul-lib-instrument": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", - "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", + "integrity": "sha1-H1XtEKw8R/K93dUweTUSZ1TQqco=", "dev": true, "requires": { "babel-generator": "^6.18.0", @@ -3995,7 +3995,7 @@ "istanbul-lib-report": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz", - "integrity": "sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw==", + "integrity": "sha1-8qZX/GKC+WFwqvKB6zCkWPf0Fww=", "dev": true, "requires": { "istanbul-lib-coverage": "^1.2.1", @@ -4024,7 +4024,7 @@ "istanbul-lib-source-maps": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz", - "integrity": "sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg==", + "integrity": "sha1-N7n/ZhWA+PyhEjJ1LuQuCMZnXY8=", "dev": true, "requires": { "debug": "^3.1.0", @@ -4057,7 +4057,7 @@ "istanbul-reports": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz", - "integrity": "sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw==", + "integrity": "sha1-l+Tb87UV6MSEyuoV1lJO69P/Tho=", "dev": true, "requires": { "handlebars": "^4.0.3" @@ -4102,7 +4102,7 @@ "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", "dev": true, "requires": { "string-width": "^2.1.1", @@ -4201,7 +4201,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -4251,7 +4251,7 @@ "jest-changed-files": { "version": "23.4.2", "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-23.4.2.tgz", - "integrity": "sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA==", + "integrity": "sha1-Hu1og3DNXuuv5K6T00uztklo/oM=", "dev": true, "requires": { "throat": "^4.0.0" @@ -4459,7 +4459,7 @@ "jest-get-type": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", - "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "integrity": "sha1-46hQTYR5NC3UQgI2syKGnxiQDOQ=", "dev": true }, "jest-haste-map": { @@ -4736,7 +4736,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true }, "source-map-support": { @@ -4809,7 +4809,7 @@ "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", "dev": true, "requires": { "string-width": "^2.1.1", @@ -4841,7 +4841,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -5006,7 +5006,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true }, "supports-color": { @@ -5152,7 +5152,7 @@ "jsdom": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "integrity": "sha1-GoDUDd03ih3lllbp5txaO6hle8g=", "dev": true, "requires": { "abab": "^2.0.0", @@ -5364,7 +5364,7 @@ "kleur": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz", - "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ==", + "integrity": "sha1-twT0lE2V4lXQOPDLBfuKYCxVowA=", "dev": true }, "lazy-cache": { @@ -5394,7 +5394,7 @@ "left-pad": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "integrity": "sha1-W4o6d2Xf4AEmHd6RVYnngvjJTR4=", "dev": true }, "leven": { @@ -5471,7 +5471,7 @@ "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -5640,7 +5640,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5665,7 +5665,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -5706,7 +5706,7 @@ "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "integrity": "sha1-uHqKpPwN6P5r6IiVs4mD/yZb0Rk=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -5867,7 +5867,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "dev": true, "optional": true, "requires": { @@ -6112,7 +6112,7 @@ "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", "dev": true, "requires": { "p-try": "^1.0.0" @@ -6163,7 +6163,7 @@ "parse5": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "integrity": "sha1-bXhlbj2o14tOwLkG98CO8d/j9gg=", "dev": true }, "pascalcase": { @@ -6202,7 +6202,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", "dev": true }, "path-type": { @@ -6266,7 +6266,7 @@ "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "integrity": "sha1-4vTO8OIZ9GPBeas3Rj5OHs3Muvs=", "dev": true }, "posix-character-classes": { @@ -6346,7 +6346,7 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", "dev": true }, "process-nextick-args": { @@ -6358,7 +6358,7 @@ "prompts": { "version": "0.1.14", "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz", - "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==", + "integrity": "sha1-qOFcYSxcnsj4ERhH3zM3ycvUQ7I=", "dev": true, "requires": { "kleur": "^2.0.1", @@ -6414,7 +6414,7 @@ "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=", "dev": true }, "kind-of": { @@ -6505,13 +6505,13 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", "dev": true }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", "dev": true, "requires": { "is-equal-shallow": "^0.1.3" @@ -6520,7 +6520,7 @@ "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -6536,7 +6536,7 @@ "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "integrity": "sha1-eC4NglwMWjuzlzH4Tv7mt0Lmsc4=", "dev": true }, "repeat-string": { @@ -6668,7 +6668,7 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", "dev": true }, "right-align": { @@ -6689,7 +6689,7 @@ "rsvp": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", - "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "integrity": "sha1-LpZJFZmpbN4bUV1WdKj3qRRSkmo=", "dev": true }, "safe-buffer": { @@ -6710,7 +6710,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", "dev": true }, "sane": { @@ -6745,7 +6745,7 @@ "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -6858,7 +6858,7 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } @@ -6866,7 +6866,7 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -6925,7 +6925,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -6934,7 +6934,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -6943,7 +6943,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -6986,7 +6986,7 @@ "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -7009,7 +7009,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, "semver": { @@ -7076,7 +7076,7 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", "dev": true }, "sigmund": { @@ -7106,7 +7106,7 @@ "sisteransi": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz", - "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g==", + "integrity": "sha1-VDFEfV99FnWqxmfM0LhlpJlMs84=", "dev": true }, "slash": { @@ -7118,7 +7118,7 @@ "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", "dev": true, "requires": { "base": "^0.11.1", @@ -7154,7 +7154,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -7174,7 +7174,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -7183,7 +7183,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -7192,7 +7192,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -7217,7 +7217,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -7254,7 +7254,7 @@ "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", "dev": true, "requires": { "source-map": "^0.5.6" @@ -7290,7 +7290,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -7530,7 +7530,7 @@ "test-exclude": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.3.tgz", - "integrity": "sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA==", + "integrity": "sha1-qaXmRHTkOYM5JFoKdprXwvSpfCA=", "dev": true, "requires": { "arrify": "^1.0.1", @@ -7642,7 +7642,7 @@ "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", "dev": true, "requires": { "define-property": "^2.0.2", @@ -7890,7 +7890,7 @@ "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "integrity": "sha1-1QyMrHmhn7wg8pEfVuuXP04QBw8=", "dev": true }, "util-deprecate": { @@ -8015,7 +8015,7 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", "dev": true }, "webidl-tools": { @@ -8070,7 +8070,7 @@ "whatwg-url": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "integrity": "sha1-8t8Cv/F2/WUHDfdK1cy7WhmZZag=", "dev": true, "requires": { "lodash.sortby": "^4.7.0", @@ -8192,7 +8192,7 @@ "ws": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "integrity": "sha1-3/7xSGa46NyRM1glFNG++vlumA8=", "dev": true, "requires": { "async-limiter": "~1.0.0" @@ -8201,7 +8201,7 @@ "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "integrity": "sha1-auc+Bt5NjG5H+fsYH3jWSK1FfGo=", "dev": true }, "xtend": { diff --git a/newIDE/app/public/JsPlatform/Extensions/firebase.png b/newIDE/app/public/JsPlatform/Extensions/firebase.png new file mode 100644 index 0000000000..e3e46f7793 Binary files /dev/null and b/newIDE/app/public/JsPlatform/Extensions/firebase.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/Modal.png b/newIDE/app/resources/examples/firebase-example/Assets/Modal.png new file mode 100644 index 0000000000..eb43bd4436 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/Modal.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/arrow_down.png b/newIDE/app/resources/examples/firebase-example/Assets/arrow_down.png new file mode 100644 index 0000000000..8a169f314b Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/arrow_down.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/arrow_up.png b/newIDE/app/resources/examples/firebase-example/Assets/arrow_up.png new file mode 100644 index 0000000000..d95829946c Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/arrow_up.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/back_arrow.png b/newIDE/app/resources/examples/firebase-example/Assets/back_arrow.png new file mode 100644 index 0000000000..0c76543d32 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/back_arrow.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/button_pressed.png b/newIDE/app/resources/examples/firebase-example/Assets/button_pressed.png new file mode 100644 index 0000000000..e7c6e11a51 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/button_pressed.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/button_up.png b/newIDE/app/resources/examples/firebase-example/Assets/button_up.png new file mode 100644 index 0000000000..fd73794db7 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/button_up.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/green_button_down.png b/newIDE/app/resources/examples/firebase-example/Assets/green_button_down.png new file mode 100644 index 0000000000..692c336150 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/green_button_down.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/green_button_up.png b/newIDE/app/resources/examples/firebase-example/Assets/green_button_up.png new file mode 100644 index 0000000000..7dbd82dead Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/green_button_up.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/inputHighlight.png b/newIDE/app/resources/examples/firebase-example/Assets/inputHighlight.png new file mode 100644 index 0000000000..73a5a5ff09 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/inputHighlight.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/inputInnactive.png b/newIDE/app/resources/examples/firebase-example/Assets/inputInnactive.png new file mode 100644 index 0000000000..70964af298 Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/inputInnactive.png differ diff --git a/newIDE/app/resources/examples/firebase-example/Assets/text_field.png b/newIDE/app/resources/examples/firebase-example/Assets/text_field.png new file mode 100644 index 0000000000..fab325ed2d Binary files /dev/null and b/newIDE/app/resources/examples/firebase-example/Assets/text_field.png differ diff --git a/newIDE/app/resources/examples/firebase-example/README.md b/newIDE/app/resources/examples/firebase-example/README.md new file mode 100644 index 0000000000..4843509300 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/README.md @@ -0,0 +1 @@ +A twitter-like social network called "Not Twitter" using Firestore, and showcase of some other features of Firebase. \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/eventsFunctionsExtensions/sanitizer.json b/newIDE/app/resources/examples/firebase-example/eventsFunctionsExtensions/sanitizer.json new file mode 100644 index 0000000000..39af95d577 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/eventsFunctionsExtensions/sanitizer.json @@ -0,0 +1,233 @@ +{ + "author": "Arthur Pacaud (arthuro555)", + "description": "Have multiple expressions that remove unwanted characters from a string (non-alphanumerical characters, new Lines...)", + "extensionNamespace": "", + "fullName": "Sanitizer", + "name": "Sanitizer", + "shortDescription": "Removes unwanted text from strings", + "tags": "sanitization, string, string manipulation", + "version": "1.0.0", + "eventsFunctions": [ + { + "description": "Removes every non-alphanumerical characters of a string.", + "fullName": "Sanitize Text", + "functionType": "StringExpression", + "name": "sanitize", + "sentence": "", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = eventsFunctionContext.getArgument(\"text\").replace(/\\W/g, '');", + "parameterObjects": "", + "useStrict": true + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "The text to sanitize", + "longDescription": "", + "name": "text", + "optional": false, + "supplementaryInformation": "", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Cuts a string to be sure it doesn't exxceeds a maximum size", + "fullName": "Trim a string", + "functionType": "StringExpression", + "name": "trim", + "sentence": "", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = eventsFunctionContext.getArgument(\"text\").substring(0, eventsFunctionContext.getArgument(\"size\"));", + "parameterObjects": "", + "useStrict": true + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "The string to trim", + "longDescription": "", + "name": "text", + "optional": false, + "supplementaryInformation": "", + "type": "string" + }, + { + "codeOnly": false, + "defaultValue": "", + "description": "The size to limit the string to", + "longDescription": "", + "name": "size", + "optional": false, + "supplementaryInformation": "", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Replaces every new line character with a space", + "fullName": "Remove new lines", + "functionType": "StringExpression", + "name": "removeNewLines", + "sentence": "", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = eventsFunctionContext.getArgument(\"text\").replace(/\\r?\\n|\\r/g, '');", + "parameterObjects": "", + "useStrict": true + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "The text to remove new lines from", + "longDescription": "", + "name": "text", + "optional": false, + "supplementaryInformation": "", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Count the nmber of lines in a string", + "fullName": "Count Lines", + "functionType": "Expression", + "name": "countNewLines", + "sentence": "", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = eventsFunctionContext.getArgument(\"text\").split(/\\r\\n|\\r|\\n/).length;", + "parameterObjects": "", + "useStrict": true + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "The text to count lines from", + "longDescription": "", + "name": "text", + "optional": false, + "supplementaryInformation": "", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "", + "fullName": "", + "functionType": "StringExpression", + "name": "removeFirstLine", + "sentence": "", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = eventsFunctionContext.getArgument(\"text\").substring(eventsFunctionContext.getArgument(\"text\").indexOf(\"\\n\") + 1);", + "parameterObjects": "", + "useStrict": true + } + ], + "parameters": [ + { + "codeOnly": false, + "defaultValue": "", + "description": "String to remove the first line from", + "longDescription": "", + "name": "text", + "optional": false, + "supplementaryInformation": "", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/game.json b/newIDE/app/resources/examples/firebase-example/game.json new file mode 100644 index 0000000000..2778c95317 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/game.json @@ -0,0 +1,241 @@ +{ + "firstLayout": "", + "gdVersion": { + "build": 98, + "major": 4, + "minor": 0, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "folderProject": true, + "linuxExecutableFilename": "", + "macExecutableFilename": "", + "orientation": "landscape", + "packageName": "com.gdexample.firebase", + "projectFile": "D:\\Documents\\documents\\GDevelop projects\\firebaseExample\\game.json", + "scaleMode": "linear", + "sizeOnStartupMode": "", + "useExternalSourceFiles": false, + "version": "1.0.0", + "winExecutableFilename": "", + "winExecutableIconFile": "", + "name": "Firebase Example", + "author": "Arthur Pacaud (arthuro555)", + "windowWidth": 800, + "windowHeight": 600, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": {}, + "loadingScreen": { + "showGDevelopSplash": false + }, + "extensionProperties": [ + { + "extension": "Firebase", + "property": "FirebaseConfig", + "value": "{\n \"apiKey\": \"AIzaSyCbFhG_bCyAvnxlmVSgIgn7Em0XOYE9YXA\",\n \"authDomain\": \"tutorial-gdevelop.firebaseapp.com\",\n \"databaseURL\": \"https://tutorial-gdevelop.firebaseio.com\",\n \"projectId\": \"tutorial-gdevelop\",\n \"storageBucket\": \"tutorial-gdevelop.appspot.com\",\n \"messagingSenderId\": \"386980638073\",\n \"appId\": \"1:386980638073:web:b00afc0ecb3ed7ca4f53a8\",\n \"measurementId\": \"G-R0KBN0HPQ8\"\n }" + } + ], + "extensions": [ + { + "name": "BuiltinObject" + }, + { + "name": "BuiltinAudio" + }, + { + "name": "BuiltinVariables" + }, + { + "name": "BuiltinTime" + }, + { + "name": "BuiltinMouse" + }, + { + "name": "BuiltinKeyboard" + }, + { + "name": "BuiltinJoystick" + }, + { + "name": "BuiltinCamera" + }, + { + "name": "BuiltinWindow" + }, + { + "name": "BuiltinFile" + }, + { + "name": "BuiltinNetwork" + }, + { + "name": "BuiltinScene" + }, + { + "name": "BuiltinAdvanced" + }, + { + "name": "Sprite" + }, + { + "name": "BuiltinCommonInstructions" + }, + { + "name": "BuiltinCommonConversions" + }, + { + "name": "BuiltinStringInstructions" + }, + { + "name": "BuiltinMathematicalTools" + }, + { + "name": "BuiltinExternalLayouts" + } + ], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "alwaysLoaded": false, + "file": "Assets/Modal.png", + "kind": "image", + "metadata": "", + "name": "Assets\\Modal.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/button_up.png", + "kind": "image", + "metadata": "", + "name": "Assets\\button_up.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/button_pressed.png", + "kind": "image", + "metadata": "", + "name": "Assets\\button_pressed.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/inputHighlight.png", + "kind": "image", + "metadata": "", + "name": "Assets\\inputHighlight.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "Assets/inputInnactive.png", + "kind": "image", + "metadata": "", + "name": "Assets\\inputInnactive.png", + "smoothed": true, + "userAdded": false + }, + { + "alwaysLoaded": false, + "file": "Assets/text_field.png", + "kind": "image", + "metadata": "", + "name": "Assets\\text_field.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/green_button_up.png", + "kind": "image", + "metadata": "", + "name": "Assets\\green_button_up.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/back_arrow.png", + "kind": "image", + "metadata": "", + "name": "Assets\\back_arrow.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/arrow_up.png", + "kind": "image", + "metadata": "", + "name": "Assets\\arrow_up.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Assets/arrow_down.png", + "kind": "image", + "metadata": "", + "name": "Assets\\arrow_down.png", + "smoothed": true, + "userAdded": true + } + ], + "resourceFolders": [] + }, + "objects": [], + "objectsGroups": [], + "variables": [], + "layouts": [ + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/main" + }, + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/remote-configuration" + }, + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/performance-measuring" + }, + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/authentification" + }, + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/analytics" + }, + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/layouts/firestore" + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "__REFERENCE_TO_SPLIT_OBJECT": true, + "referenceTo": "/eventsFunctionsExtensions/sanitizer" + } + ], + "externalLayouts": [], + "externalSourceFiles": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/analytics.json b/newIDE/app/resources/examples/firebase-example/layouts/analytics.json new file mode 100644 index 0000000000..17a6c5d5b4 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/analytics.json @@ -0,0 +1,1118 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Analytics", + "name": "Analytics", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": false, + "zoomFactor": 0.3166 + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 599, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "7ada608a-0e32-4bed-819b-d284c5159e0e", + "width": 800, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "Survey", + "persistentUuid": "6c61a4bb-d3bf-464e-8f02-cb079dd864cc", + "width": 0, + "x": 319, + "y": 53, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "SurveyText", + "persistentUuid": "45e77892-3eb5-46f9-9e22-4660cb765d29", + "width": 0, + "x": 112, + "y": 127, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 153, + "layer": "", + "locked": false, + "name": "yes", + "persistentUuid": "e3f02c40-e943-4e6e-b057-1533a9e9f00b", + "width": 207, + "x": 109, + "y": 372, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "yesText", + "persistentUuid": "ceff0d0e-7754-41e9-b5ac-f2b92bcc0b25", + "width": 0, + "x": 183, + "y": 424, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 153, + "layer": "", + "locked": false, + "name": "yes", + "persistentUuid": "1bb09173-f2c7-41db-af56-1ba96f34a9fd", + "width": 207, + "x": 476, + "y": 372, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "yesText", + "persistentUuid": "87d82721-f601-4f6e-b8f7-aa905b304cef", + "width": 0, + "x": 549, + "y": 425, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 599, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "9fb746de-9b7d-48da-ab92-b565be7984d7", + "width": 800, + "x": 823, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "SurveyText2", + "persistentUuid": "b2a2a9e6-0b22-4e33-b08c-fa2a97fc6177", + "width": 0, + "x": 947, + "y": 99, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 133, + "layer": "", + "locked": false, + "name": "yes", + "persistentUuid": "18be0b65-2578-4bf3-88ab-5373f784226c", + "width": 157, + "x": 1390, + "y": 423, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "yesText", + "persistentUuid": "ab7b93be-71dc-46d3-90ba-8c679b92e8f8", + "width": 0, + "x": 1442, + "y": 464, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 133, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "a042f969-60c5-41ca-b6e7-98f4d226a70e", + "width": 157, + "x": 1153, + "y": 423, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 133, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "8f0bac98-3f0f-49ad-9ab5-09b38ca85f31", + "width": 157, + "x": 926, + "y": 423, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "ForgeryForge", + "persistentUuid": "d39cf5d7-59a0-4b22-8eae-9d7942b51e75", + "width": 0, + "x": 1182, + "y": 438, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "TheQuest", + "persistentUuid": "4c82255d-8963-43c2-bf0a-d18fc3353b4f", + "width": 0, + "x": 939, + "y": 441, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 599, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "ba6b3dab-f57c-4095-b737-94551f289081", + "width": 800, + "x": 1636, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "End", + "persistentUuid": "f93a70de-11f1-475e-9202-0cb768d0a195", + "width": 0, + "x": 1859, + "y": 80, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 139, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "c933ae0f-71ad-476f-81bc-ec5edf3bef55", + "width": 447, + "x": 1806, + "y": 386, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "Menu", + "persistentUuid": "cd106c57-23b1-4c50-be66-77b335a534a4", + "width": 0, + "x": 1917, + "y": 431, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "name": "background", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": true, + "name": "Survey", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Survey:", + "font": "", + "characterSize": 43, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "SurveyText", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Hello dear user! Would you mind telling us what you prefer \nwith the game so we can improve it? Thank you very much!", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "yes", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "yesText", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Yes", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "button", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "SurveyText2", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Good! First of all, could you tell us what level is your favorite?", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "ForgeryForge", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Forgery \nforge of \nforging", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "TheQuest", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "The Quest \nOf The \nRing", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": true, + "name": "End", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Thank you very \nmuch for your time \nand data user!", + "font": "", + "characterSize": 40, + "color": { + "b": 194, + "g": 227, + "r": 80 + } + }, + { + "bold": true, + "italic": false, + "name": "Menu", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Return to menu...", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Store survey result", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "button", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "3" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::AnalyticsSetProperty" + }, + "parameters": [ + "\"favoriteLevel\"", + "\"TheQuest\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "button", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "2" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "3" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::AnalyticsSetProperty" + }, + "parameters": [ + "\"favoriteLevel\"", + "\"ForgeryForge\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Store how much the player is annoying", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "yes", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "2" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::AnalyticsLog" + }, + "parameters": [ + "\"PressedYes\"", + "\"\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return to the menu at the end of the survey", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "button", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "3" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "3" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Main\"", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 0, + "ambientLightColorG": 0, + "ambientLightColorR": 0, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/authentification.json b/newIDE/app/resources/examples/firebase-example/layouts/authentification.json new file mode 100644 index 0000000000..bb3744c358 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/authentification.json @@ -0,0 +1,1328 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Authentification", + "name": "Authentification", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": true, + "zoomFactor": 0.427 + }, + "objectsGroups": [], + "variables": [ + { + "name": "error", + "value": "ok" + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 600, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "16172f1a-3b20-46cf-a517-50fe71882f46", + "width": 801, + "x": 0, + "y": 0, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "SignIn", + "persistentUuid": "a118b9b6-9f71-4e3e-9bea-865935ec0764", + "width": 0, + "x": 58, + "y": 67, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 49, + "layer": "", + "locked": false, + "name": "input", + "persistentUuid": "179a0440-37fc-4c6f-bdcf-efd47b7977b2", + "width": 340, + "x": 222, + "y": 217, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "type", + "value": "email" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "username", + "persistentUuid": "c1eb376f-5ddb-4e6c-aac9-4bd9207481e1", + "width": 0, + "x": 243, + "y": 229, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 49, + "layer": "", + "locked": false, + "name": "input", + "persistentUuid": "d7b0d629-0763-4464-917e-06090039fa8a", + "width": 340, + "x": 222, + "y": 331, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "type", + "value": "password" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "password", + "persistentUuid": "e05830b9-5c62-4d3e-802e-c6a163125312", + "width": 0, + "x": 243, + "y": 344, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "emailInput", + "persistentUuid": "33c2cba4-3e2e-4d54-bedc-865bcf68db19", + "width": 0, + "x": 510, + "y": 224, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "passwordInput", + "persistentUuid": "08e7cd59-f1bc-42ba-a375-7be792b4834f", + "width": 0, + "x": 510, + "y": 339, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 140, + "layer": "", + "locked": false, + "name": "logInButton", + "persistentUuid": "93fce929-39da-4e89-a973-eb8a19176cd4", + "width": 208, + "x": 121, + "y": 419, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "logInText", + "persistentUuid": "3a399c89-301b-4f1d-849e-7025788f8fcf", + "width": 0, + "x": 173, + "y": 463, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 140, + "layer": "", + "locked": false, + "name": "createAccountButton", + "persistentUuid": "1f27c831-4ef6-4d35-aa80-bc4874768c5d", + "width": 208, + "x": 465, + "y": 419, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "createAccountText", + "persistentUuid": "67361f96-2339-4440-a1e3-5c7480787bfc", + "width": 0, + "x": 499, + "y": 442, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "error", + "persistentUuid": "1c393468-5e4c-4c73-b7a7-a2b5b48577ca", + "width": 0, + "x": 50, + "y": 154, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "name": "background", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "SignIn", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": " Hello dear user!\nPlease log-in to save your progress on the cloud!", + "font": "", + "characterSize": 31, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "input", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "type", + "value": "null" + } + ], + "behaviors": [], + "animations": [ + { + "name": "innactive", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\inputInnactive.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "activated", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\inputHighlight.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "username", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Email", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "password", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Password", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "emailInput", + "tags": "", + "type": "TextEntryObject::TextEntry", + "variables": [], + "behaviors": [] + }, + { + "name": "passwordInput", + "tags": "", + "type": "TextEntryObject::TextEntry", + "variables": [], + "behaviors": [] + }, + { + "name": "logInButton", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "down", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "logInText", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Log In", + "font": "", + "characterSize": 35, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "createAccountButton", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "down", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "createAccountText", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Create \nAccount", + "font": "", + "characterSize": 35, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": true, + "name": "error", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Error", + "font": "", + "characterSize": 25, + "color": { + "b": 25, + "g": 25, + "r": 238 + } + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "UI", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "DepartScene" + }, + "parameters": [ + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "passwordInput", + "no" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "emailInput", + "no" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Field selecting", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "emailInput", + "no" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "passwordInput", + "no" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::ForEach", + "object": "input", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "input", + "\"innactive\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "input", + "", + "", + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "input", + "\"activated\"" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjetTxt" + }, + "parameters": [ + "input", + "type", + "=", + "\"email\"" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "emailInput", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjetTxt" + }, + "parameters": [ + "input", + "type", + "=", + "\"password\"" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "passwordInput", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove new lines from input", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::String" + }, + "parameters": [ + "emailInput", + "=", + "Sanitizer::trim(Sanitizer::removeNewLines(emailInput.String()), 30)" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextEntryObject::String" + }, + "parameters": [ + "passwordInput", + "=", + "Sanitizer::trim(Sanitizer::removeNewLines(passwordInput.String()), 35)" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Set field values", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "username", + "=", + "emailInput.String()" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "password", + "=", + "StrRepeat(\"•\", StrLength(passwordInput.String()))" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Empty values", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "Egal" + }, + "parameters": [ + "StrLength(emailInput.String())", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "username", + "=", + "\"Email\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "Egal" + }, + "parameters": [ + "StrLength(passwordInput.String())", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "password", + "=", + "\"Password\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show errors if any", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "error", + "=", + "\"Error: \" + VariableString(error)" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "error", + "=", + "\"ok\"" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "error", + "=", + "\"\"" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "Log In", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Continue once logged in", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "Firebase::IsSignedIn" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Main\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Trigger login or account creation", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "logInButton", + "", + "", + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::BasicAccountSignIn" + }, + "parameters": [ + "emailInput.String()", + "passwordInput.String()", + "error" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "createAccountButton", + "", + "", + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::CreateBasicAccount" + }, + "parameters": [ + "emailInput.String()", + "passwordInput.String()", + "error" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 0, + "ambientLightColorG": 0, + "ambientLightColorR": 0, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/firestore.json b/newIDE/app/resources/examples/firebase-example/layouts/firestore.json new file mode 100644 index 0000000000..b57b4c267f --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/firestore.json @@ -0,0 +1,2728 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Firestore", + "name": "Firestore", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": false, + "zoomFactor": 0.4926 + }, + "objectsGroups": [], + "variables": [ + { + "name": "message", + "children": [ + { + "name": "content", + "value": "" + }, + { + "name": "date", + "value": "" + }, + { + "name": "owner", + "value": "" + } + ] + }, + { + "name": "sendMessageStatus", + "value": "" + }, + { + "name": "listMessageStatus", + "value": "" + }, + { + "name": "messagesList", + "value": "" + }, + { + "name": "refreshMessages", + "value": "1" + }, + { + "name": "reloadMessages", + "value": "0" + }, + { + "name": "messageOffset", + "value": "" + }, + { + "name": "messages", + "children": [ + { + "name": "1", + "children": [ + { + "name": "content", + "value": "Loading..." + }, + { + "name": "date", + "value": " " + } + ] + }, + { + "name": "2", + "children": [ + { + "name": "content", + "value": "Loading..." + }, + { + "name": "date", + "value": " " + } + ] + }, + { + "name": "3", + "children": [ + { + "name": "content", + "value": "Loading..." + }, + { + "name": "date", + "value": " " + } + ] + } + ] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 600, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "3aff6e92-596d-4f42-b80f-2cb96e9c958f", + "width": 800, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 600, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "9b485960-a92e-4c09-8aa3-c90403b7240c", + "width": 800, + "x": 866, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 212, + "layer": "", + "locked": false, + "name": "textBoxSprite", + "persistentUuid": "ad700d07-7b0d-42ba-92d7-06f672aa93a0", + "width": 560, + "x": 999, + "y": 126, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 170, + "layer": "", + "locked": false, + "name": "textBoxText", + "persistentUuid": "377ef56e-eba9-4ee3-9e47-04b1c1e305ff", + "width": 498, + "x": 1027, + "y": 132, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 156, + "layer": "", + "locked": false, + "name": "sendbutton", + "persistentUuid": "f348c6b5-0662-4191-986a-6711ac2e96ef", + "width": 197, + "x": 1173, + "y": 405, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "textBoxEntry", + "persistentUuid": "097c93cc-29d3-457e-9ade-3bb4dce15403", + "width": 0, + "x": 1500, + "y": 273, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 43, + "layer": "", + "locked": false, + "name": "sendStatus", + "persistentUuid": "13e13d34-c85f-47f0-8824-4665dcae695c", + "width": 537, + "x": 1016, + "y": 355, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 85, + "layer": "", + "locked": false, + "name": "back", + "persistentUuid": "1cfe3347-9cdb-43a6-8ccc-407600154a74", + "width": 188, + "x": 910, + "y": 30, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 145, + "layer": "", + "locked": false, + "name": "makeTweet", + "persistentUuid": "6e225a25-7ae7-473f-8889-4ee61afca440", + "width": 149, + "x": 601, + "y": 35, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "makeTweetText", + "persistentUuid": "80d2a17e-7a9b-4aec-9c81-53035a767066", + "width": 0, + "x": 624, + "y": 62, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 120, + "layer": "", + "locked": false, + "name": "messagebox", + "persistentUuid": "3bf77d2d-0ab2-4e13-bf67-82ec9423e06b", + "width": 477, + "x": 100, + "y": 54, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 120, + "layer": "", + "locked": false, + "name": "messagebox", + "persistentUuid": "efbbe38a-40e4-4ee5-9d88-e878d159def1", + "width": 477, + "x": 100, + "y": 226, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 120, + "layer": "", + "locked": false, + "name": "messagebox", + "persistentUuid": "2f545cea-9ee6-4e7d-940a-50e0de3dad17", + "width": 477, + "x": 100, + "y": 396, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "loadingText", + "persistentUuid": "ebcc4fe4-e6e3-4730-8835-d1e409c88503", + "width": 0, + "x": 114, + "y": 526, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 89, + "layer": "", + "locked": false, + "name": "messageBoxText", + "persistentUuid": "d4b8bafa-f9e2-44b1-858b-4abbda3393f8", + "width": 427, + "x": 125, + "y": 72, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 89, + "layer": "", + "locked": false, + "name": "messageBoxText", + "persistentUuid": "ad3dd89c-f8d5-4203-a6cc-934625cc67e2", + "width": 427, + "x": 125, + "y": 411, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 89, + "layer": "", + "locked": false, + "name": "messageBoxText", + "persistentUuid": "cb0fb600-e722-4676-94aa-ca4c76ab9786", + "width": 427, + "x": 125, + "y": 245, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 83, + "layer": "", + "locked": false, + "name": "previous", + "persistentUuid": "21857cb7-e3ae-46df-877f-cd0d4930404e", + "width": 88, + "x": 632, + "y": 244, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 83, + "layer": "", + "locked": false, + "name": "next", + "persistentUuid": "f4e63cbe-98c3-4696-9734-b9d93c04de0d", + "width": 88, + "x": 632, + "y": 420, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 64, + "layer": "", + "locked": false, + "name": "back", + "persistentUuid": "2fc529b2-4fde-407f-b77c-aa3210ef0fd5", + "width": 151, + "x": 596, + "y": 513, + "zOrder": 15, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "menu", + "persistentUuid": "d865026f-91a8-4490-b0bb-2dde66fdfc28", + "width": 0, + "x": 659, + "y": 529, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "post", + "persistentUuid": "581b551e-4cca-4642-a075-ee88112e27bf", + "width": 0, + "x": 1232, + "y": 458, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "postDate", + "persistentUuid": "8ad3e3a6-183d-4819-b607-72f548446bd4", + "width": 0, + "x": 495, + "y": 141, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "postDate", + "persistentUuid": "ac9c053e-f938-449f-9f03-61a9b8205193", + "width": 0, + "x": 495, + "y": 313, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "postDate", + "persistentUuid": "091419ff-3980-4889-a3a0-78e693ee3fc2", + "width": 0, + "x": 495, + "y": 483, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "3" + } + ] + } + ], + "objects": [ + { + "name": "background", + "tags": "write-message, display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "textBoxSprite", + "tags": "write-message", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\text_field.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "textBoxText", + "smoothed": true, + "tags": "write-message", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "The tweet content", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "sendbutton", + "tags": "write-message", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\green_button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "textBoxEntry", + "tags": "write-message", + "type": "TextEntryObject::TextEntry", + "variables": [], + "behaviors": [] + }, + { + "bold": true, + "italic": true, + "name": "sendStatus", + "smoothed": true, + "tags": "write-message", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "", + "font": "", + "characterSize": 30, + "color": { + "b": 28, + "g": 231, + "r": 248 + } + }, + { + "name": "back", + "tags": "write-message, display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\back_arrow.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "makeTweet", + "tags": "display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "makeTweetText", + "smoothed": true, + "tags": "display-tweets", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": " Post \n a \nmessage!", + "font": "", + "characterSize": 23, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "messagebox", + "tags": "display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\text_field.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": true, + "name": "loadingText", + "smoothed": true, + "tags": "display-tweets", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Loading...", + "font": "", + "characterSize": 32, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "messageBoxText", + "smoothed": true, + "tags": "display-tweets", + "type": "TextObject::Text", + "underlined": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "string": "Message", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "previous", + "tags": "display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\arrow_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "next", + "tags": "display-tweets", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\arrow_down.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "menu", + "smoothed": true, + "tags": "display-tweets", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Menu", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "post", + "smoothed": true, + "tags": "write-message", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Post!", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "postDate", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "string": "date", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "DepartScene" + }, + "parameters": [ + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "textBoxEntry", + "no" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "UI", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Sanitize text entry", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextEntryObject::String" + }, + "parameters": [ + "textBoxEntry", + "=", + "Sanitizer::removeNewLines(Sanitizer::trim(textBoxEntry.String(), 280))" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "textBoxText", + "=", + "textBoxEntry.String()" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Send message", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "sendbutton", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "message.content", + "=", + "textBoxEntry.String()" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "message.owner", + "=", + "Firebase::GetUserUID()" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "message.date", + "=", + "ToString(Time(\"hour\"))+\":\"+ToString(Time(\"min\"))+\"h\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "sendMessageStatus", + "=", + "\"pending\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::FirestoreWriteDocument" + }, + "parameters": [ + "\"messages\"", + "ToString(Time(\"timestamp\")) + \"--\" + Firebase::GetUserUID() + \"--\" + ToString(RandomFloatInRange(1, 90))", + "message", + "sendMessageStatus" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Switch screens", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "makeTweet", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "2" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "textBoxEntry", + "yes" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "refreshMessages", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "back", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "back", + "id", + "=", + "2" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextEntryObject::Activate" + }, + "parameters": [ + "textBoxEntry", + "no" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Back to menu button", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "back", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "back", + "id", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Main\"", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "messageOffset changing buttons", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "previous", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "messageOffset", + "-", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "reloadMessages", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "next", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "uniqueAction", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "messageOffset", + "+", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "reloadMessages", + "=", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "Error handling", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "sendMessageStatus", + "=", + "\"pending\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "sendStatus", + "=", + "\"Posting message...\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "sendMessageStatus", + "=", + "\"ok\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "sendStatus", + "=", + "\"Message posted successfully!\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "sendMessageStatus", + "=", + "\"error\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "sendStatus", + "=", + "\"An error occured...\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "listMessageStatus", + "=", + "\"pending\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "loadingText", + "=", + "\"Loading...\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Montre" + }, + "parameters": [ + "loadingText", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "listMessageStatus", + "=", + "\"ok\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Cache" + }, + "parameters": [ + "loadingText" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "listMessageStatus", + "=", + "\"error\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "loadingText", + "=", + "\"An error occured...\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Montre" + }, + "parameters": [ + "loadingText", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "messages.1.error", + "=", + "\"error\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "messages.1.content", + "=", + "\"An error occured...\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "messages.2.error", + "=", + "\"error\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "messages.2.content", + "=", + "\"An error occured...\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "messages.3.error", + "=", + "\"error\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "messages.3.content", + "=", + "\"An error occured...\"" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "Reload Messages", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Regularly reload messages", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "Timer" + }, + "parameters": [ + "", + "10", + "\"reload\"" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "refreshMessages", + "=", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"reload\"" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "Fetch messages", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Verify if message offset in bounds", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "messageOffset", + "<", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "messageOffset", + "=", + "0" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "messageOffset", + ">", + "VariableChildCount(messagesList) - 3" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "messageOffset", + "=", + "VariableChildCount(messagesList) - 4" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Download the list of messages", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "refreshMessages", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarSceneTxt" + }, + "parameters": [ + "listMessageStatus", + "=", + "\"pending\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::FirestoreListDocuments" + }, + "parameters": [ + "\"messages\"", + "messagesList", + "listMessageStatus" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "refreshMessages", + "=", + "0" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Download a message", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "reloadMessages", + "=", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": false, + "value": "VarSceneTxt" + }, + "parameters": [ + "listMessageStatus", + "=", + "\"ok\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ] + } + ] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::FirestoreGetDocument" + }, + "parameters": [ + "\"messages\"", + "VariableString(messagesList[ToString(Variable(messageOffset))])", + "messages.1", + "messages.1.error" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::FirestoreGetDocument" + }, + "parameters": [ + "\"messages\"", + "VariableString(messagesList[ToString(Variable(messageOffset) + 1)])", + "messages.2", + "messages.2.error" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::FirestoreGetDocument" + }, + "parameters": [ + "\"messages\"", + "VariableString(messagesList[ToString(Variable(messageOffset) + 2)])", + "messages.3", + "messages.3.error" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "reloadMessages", + "=", + "0" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Display downloaded messages", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "messageBoxText", + "id", + "=", + "1" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "postDate", + "id", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "messageBoxText", + "=", + "VariableString(messages.1.content)" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "postDate", + "=", + "VariableString(messages.1.date)" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "messageBoxText", + "id", + "=", + "2" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "postDate", + "id", + "=", + "2" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "messageBoxText", + "=", + "VariableString(messages.2.content)" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "postDate", + "=", + "VariableString(messages.2.date)" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "messageBoxText", + "id", + "=", + "3" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "postDate", + "id", + "=", + "3" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "messageBoxText", + "=", + "VariableString(messages.3.content)" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "postDate", + "=", + "VariableString(messages.3.date)" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 0, + "ambientLightColorG": 0, + "ambientLightColorR": 0, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/main.json b/newIDE/app/resources/examples/firebase-example/layouts/main.json new file mode 100644 index 0000000000..20f6e09286 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/main.json @@ -0,0 +1,1067 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Main", + "name": "Main", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": false, + "zoomFactor": 0.3808 + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 600, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "1c1c9fa2-faa1-4a03-832a-2608e8bdddae", + "width": 800, + "x": 900, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 600, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "63f4b4e1-0d6d-46a6-9589-6bd5d2acaaf5", + "width": 800, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "welcome", + "persistentUuid": "17066d5e-179e-4679-b3ca-f9bffebfa352", + "width": 0, + "x": 933, + "y": 46, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "welcome", + "persistentUuid": "abeba632-54ad-4584-afcc-f2b3744d6af0", + "width": 0, + "x": 33, + "y": 46, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 157, + "layer": "", + "locked": false, + "name": "logIn", + "persistentUuid": "aa232db2-0cec-4044-bfe8-c0b24d4ecd99", + "width": 516, + "x": 136, + "y": 372, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "logInText", + "persistentUuid": "2cf7402b-e267-4685-9f76-f5330af9a031", + "width": 0, + "x": 317, + "y": 414, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "plsLogin", + "persistentUuid": "550b9b82-8ba3-4655-a7bc-d42fc1592316", + "width": 0, + "x": 95, + "y": 261, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 108, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "af32058a-d7c8-46b4-9e37-da61290ea756", + "width": 206, + "x": 960, + "y": 206, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "1" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "remoteConfig", + "persistentUuid": "4205264f-81e6-40ec-b2b5-9bf151ded231", + "width": 0, + "x": 981, + "y": 226, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 108, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "0f01c463-bb57-49b3-9e04-79c705483bbb", + "width": 206, + "x": 1435, + "y": 206, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "3" + } + ] + }, + { + "angle": 0, + "customSize": true, + "height": 108, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "8576c3db-1464-4533-a234-8d0e95baaac4", + "width": 206, + "x": 1198, + "y": 206, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "2" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "perfMeasuring", + "persistentUuid": "a3e8e2b5-38ca-4b2c-8e7c-6b751d75d9aa", + "width": 0, + "x": 1227, + "y": 226, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "analytics", + "persistentUuid": "4091039a-ac17-4502-a723-fdc57a50883a", + "width": 0, + "x": 1483, + "y": 241, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 158, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "b8e1f19b-4e7b-4f78-9a59-4173f0343990", + "width": 697, + "x": 950, + "y": 336, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "4" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "twitter", + "persistentUuid": "f4c8b3f8-51c3-4e0c-866f-50af090a884d", + "width": 0, + "x": 1150, + "y": 375, + "zOrder": 11, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 49, + "layer": "", + "locked": false, + "name": "button", + "persistentUuid": "f3320f39-2b2c-462c-9b74-86c839f28ac9", + "width": 143, + "x": 1498, + "y": 513, + "zOrder": 12, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "id", + "value": "5" + } + ] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "logout", + "persistentUuid": "c6fc7889-fd5c-4d1a-91bc-b598bb0b545b", + "width": 0, + "x": 1538, + "y": 524, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "name": "background", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "welcome", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Welcome to The Great Amazing And Cool Game™!\n Now With Firebase support!\n We hope you'll get entertained!", + "font": "", + "characterSize": 32, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "logIn", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "logInText", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Login", + "font": "", + "characterSize": 50, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": true, + "name": "plsLogin", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Please log in to play the game", + "font": "", + "characterSize": 45, + "color": { + "b": 35, + "g": 166, + "r": 245 + } + }, + { + "name": "button", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "id", + "value": "0" + } + ], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": true, + "italic": false, + "name": "remoteConfig", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": " Remote \nConfiguration", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "perfMeasuring", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Perfomance \n Measuring", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "twitter", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Not Twitter", + "font": "", + "characterSize": 55, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": true, + "italic": false, + "name": "analytics", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Analytics", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "logout", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Logout", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Enable globally automatic data collection", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "DepartScene" + }, + "parameters": [ + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::AnalyticsEnable" + }, + "parameters": [], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::EnablePerformance" + }, + "parameters": [], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Authentification management", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "Firebase::IsSignedIn" + }, + "parameters": [], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "2" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Firebase::IsSignedIn" + }, + "parameters": [], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "background", + "id", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "CentreCamera" + }, + "parameters": [ + "", + "background", + "no", + "", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "UI management", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + } + ], + "actions": [], + "events": [ + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "button", + "", + "", + "" + ], + "subInstructions": [] + } + ], + "actions": [], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "1" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Remote Configuration\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "2" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Performance Measuring\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "3" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Analytics\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "4" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Firestore\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarObjet" + }, + "parameters": [ + "button", + "id", + "=", + "5" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::Logout" + }, + "parameters": [], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "logIn", + "", + "", + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Authentification\"", + "yes" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/performance-measuring.json b/newIDE/app/resources/examples/firebase-example/layouts/performance-measuring.json new file mode 100644 index 0000000000..4b97a64070 --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/performance-measuring.json @@ -0,0 +1,1152 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Performance_32Measuring", + "name": "Performance Measuring", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": false, + "zoomFactor": 0.4794 + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "Description", + "persistentUuid": "fc808cb3-22a1-4fa5-bc2e-9d9ca2ed6c4a", + "width": 0, + "x": 39, + "y": 97, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "intensity", + "persistentUuid": "bb48b638-e868-4f56-abe0-eb45c54d34a9", + "width": 0, + "x": 368, + "y": 245, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "intensityUp", + "persistentUuid": "1ee0e84c-ab98-44b2-8c68-674f0e294f4a", + "width": 0, + "x": 445, + "y": 240, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "intensityLabel", + "persistentUuid": "661ac7ef-2d3e-436c-9037-b6457d363328", + "width": 0, + "x": 295, + "y": 249, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "intensityDown", + "persistentUuid": "fd3614ef-1522-4dea-8f8d-0aa592e51fc7", + "width": 0, + "x": 274, + "y": 240, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 160, + "layer": "", + "locked": false, + "name": "startButton", + "persistentUuid": "9ad4da74-0254-4ad1-be59-9ae8356b6100", + "width": 203, + "x": 287, + "y": 416, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "startLabel", + "persistentUuid": "982c2e9f-ec0e-4082-85fe-d558ba271546", + "width": 0, + "x": 345, + "y": 470, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "processing", + "persistentUuid": "e275d21a-0303-408c-8908-d783d6d7a7ac", + "width": 0, + "x": 296, + "y": 329, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 601, + "layer": "", + "locked": false, + "name": "background", + "persistentUuid": "961b7262-490e-4b75-a461-f7b38ee82b79", + "width": 800, + "x": 0, + "y": -1, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 54, + "layer": "", + "locked": false, + "name": "back", + "persistentUuid": "7920e2dc-cc32-493e-b00d-eb205029ddd9", + "width": 122, + "x": 44, + "y": 36, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "menu", + "persistentUuid": "72754b98-e825-4cd3-8371-74745ba1cd27", + "width": 0, + "x": 92, + "y": 49, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "bold": false, + "italic": false, + "name": "Description", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Press the button to launch an operation causing lag after selecting intensity.\nThe operation's performance will be measured and sent to the Firebase console.\n\n\n\n Intensity:", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "intensity", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "30", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "intensityDown", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "down", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "intensityUp", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "down", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "intensityLabel", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "- +", + "font": "", + "characterSize": 25, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "startLabel", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Start!", + "font": "", + "characterSize": 35, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "startButton", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "down", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": true, + "name": "processing", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Processing...", + "font": "", + "characterSize": 32, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "background", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "back", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\back_arrow.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "menu", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Menu", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "Performance intensive operation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "i", + "=", + "0" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::StartTracer" + }, + "parameters": [ + "\"Performance Intensive\"" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "inverted": false, + "value": "Egal" + }, + "parameters": [ + "Variable(i)", + "!=", + "ToNumber(intensity.String()) * 29000" + ], + "subInstructions": [] + } + ], + "conditions": [ + { + "type": { + "inverted": false, + "value": "Egal" + }, + "parameters": [ + "nthroot(RandomFloatInRange(0, 9999999), RandomFloatInRange(0, 9999999))", + "<=", + "pow(nthroot(RandomFloatInRange(0, 9999999), RandomFloatInRange(0, 9999999)), RandomFloatInRange(0, 9999999))" + ], + "subInstructions": [] + } + ], + "actions": [], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "i", + "+", + "1" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::StopTracer" + }, + "parameters": [ + "\"Performance Intensive\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Cache" + }, + "parameters": [ + "processing" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "disabled": false, + "folded": true, + "name": "UI", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "DepartScene" + }, + "parameters": [ + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Cache" + }, + "parameters": [ + "processing" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "intensityUp", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "intensityUp", + "\"down\"" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Increase intensity", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "intensity", + "=", + "ToString(ToNumber(intensity.String()) + 1)" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "intensityDown", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "intensityDown", + "\"down\"" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Decrease intensity", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "intensity", + "=", + "ToString(ToNumber(intensity.String()) - 1)" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "intensityDown", + "\"up\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "intensityUp", + "\"up\"" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "startButton", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "i", + "=", + "0" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Montre" + }, + "parameters": [ + "processing", + "" + ], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "back", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Main\"", + "" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "parameters": [] + } + ], + "layers": [ + { + "ambientLightColorB": 0, + "ambientLightColorG": 0, + "ambientLightColorR": 0, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/resources/examples/firebase-example/layouts/remote-configuration.json b/newIDE/app/resources/examples/firebase-example/layouts/remote-configuration.json new file mode 100644 index 0000000000..f33d5c7f6d --- /dev/null +++ b/newIDE/app/resources/examples/firebase-example/layouts/remote-configuration.json @@ -0,0 +1,1070 @@ +{ + "b": 209, + "disableInputWhenNotFocused": true, + "mangledName": "Remote_32Configuration", + "name": "Remote Configuration", + "oglFOV": 90, + "oglZFar": 500, + "oglZNear": 1, + "r": 209, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 209, + "uiSettings": { + "grid": false, + "gridB": 255, + "gridG": 180, + "gridHeight": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridR": 158, + "gridWidth": 32, + "snap": true, + "windowMask": false, + "zoomFactor": 0.706 + }, + "objectsGroups": [], + "variables": [ + { + "name": "defaultsRCVariables", + "children": [ + { + "name": "moneyIncrease", + "value": "5" + }, + { + "name": "potionPrice", + "value": "20" + } + ] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 516, + "layer": "", + "locked": false, + "name": "Modal", + "persistentUuid": "20e573ec-e8e4-4e90-8df0-de18b84523c9", + "width": 516, + "x": 135, + "y": 40, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 72, + "layer": "", + "locked": false, + "name": "shop", + "persistentUuid": "6b9e6ad5-99f6-4c78-b4a5-60ca27e5a3d9", + "width": 253, + "x": 272, + "y": 125, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 163, + "layer": "", + "locked": false, + "name": "getMoney", + "persistentUuid": "543a0418-1912-4d85-9949-91d83fc5ccd7", + "width": 163, + "x": 442, + "y": 370, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 163, + "layer": "", + "locked": false, + "name": "buy", + "persistentUuid": "c3746bd0-9838-422c-87a8-502a14169744", + "width": 163, + "x": 176, + "y": 370, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "buytext", + "persistentUuid": "1156e623-8987-428b-a9d6-5d73397886e7", + "width": 0, + "x": 229, + "y": 434, + "zOrder": 5, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "getmoney", + "persistentUuid": "a84079e8-ebaf-4b98-8c39-686b16a9f331", + "width": 0, + "x": 473, + "y": 434, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "item", + "persistentUuid": "327b60ae-bece-4967-8381-acb4485eb21e", + "width": 0, + "x": 167, + "y": 229, + "zOrder": 7, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 71, + "layer": "", + "locked": false, + "name": "money", + "persistentUuid": "1c2758c1-080b-4b0e-9d46-5ab63acd3b89", + "width": 178, + "x": 433, + "y": 229, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 55, + "layer": "", + "locked": false, + "name": "back", + "persistentUuid": "6f7afa65-dabd-48d1-b41a-d2da11ab68a9", + "width": 97, + "x": 159, + "y": 67, + "zOrder": 9, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "locked": false, + "name": "menu", + "persistentUuid": "29c01724-de0c-4e9a-8925-524901edfb66", + "width": 0, + "x": 190, + "y": 79, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "name": "Modal", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\Modal.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "shop", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "My Shop :)", + "font": "", + "characterSize": 50, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "buy", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "pressed", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "name": "getMoney", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "up", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_up.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + }, + { + "name": "pressed", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\button_pressed.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "buytext", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Buy It", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "getmoney", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Get Money", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "item", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Mega Potion: \n20$", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "bold": false, + "italic": false, + "name": "money", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Your Money:\n0$", + "font": "", + "characterSize": 30, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + }, + { + "name": "back", + "tags": "", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Assets\\back_arrow.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "bold": false, + "italic": false, + "name": "menu", + "smoothed": true, + "tags": "", + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "behaviors": [], + "string": "Menu", + "font": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + } + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "DepartScene" + }, + "parameters": [ + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Firebase::SetRemoteConfigDefaultConfig" + }, + "parameters": [ + "defaultsRCVariables" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::ForceReloadRemoteConfig" + }, + "parameters": [], + "subInstructions": [] + } + ], + "events": [] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reset Buttons", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "buy", + "\"up\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "buy", + "=", + "370" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "getMoney", + "=", + "370" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "getMoney", + "\"up\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "getmoney", + "=", + "434" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "buytext", + "=", + "434" + ], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "back", + "", + "no", + "" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "Scene" + }, + "parameters": [ + "", + "\"Main\"", + "" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Button Handling", + "comment2": "" + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "getMoney", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "getMoney", + "\"pressed\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "getMoney", + "+", + "15" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "getmoney", + "+", + "15" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::ForceReloadRemoteConfig" + }, + "parameters": [], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add some money to the variable mymoney", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "mymoney", + "+", + "Firebase::GetRemoteConfigNumber(\"moneyIncrease\")" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "SourisSurObjet" + }, + "parameters": [ + "buy", + "", + "", + "" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "SourisBouton" + }, + "parameters": [ + "", + "Left" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "SetAnimationName" + }, + "parameters": [ + "buy", + "\"pressed\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "buy", + "+", + "15" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "MettreY" + }, + "parameters": [ + "buytext", + "+", + "15" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "Firebase::ForceReloadRemoteConfig" + }, + "parameters": [], + "subInstructions": [] + } + ], + "events": [ + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove some money from the variable mymoney", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": false, + "value": "VarScene" + }, + "parameters": [ + "mymoney", + ">=", + "Firebase::GetRemoteConfigNumber(\"potionPrice\")" + ], + "subInstructions": [] + } + ], + "actions": [ + { + "type": { + "inverted": false, + "value": "ModVarScene" + }, + "parameters": [ + "mymoney", + "-", + "Firebase::GetRemoteConfigNumber(\"potionPrice\")" + ], + "subInstructions": [] + } + ], + "events": [] + } + ] + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update text fields", + "comment2": "" + }, + { + "disabled": false, + "folded": false, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "money", + "=", + "\"Money:\"+NewLine()+VariableString(mymoney)+\"$\"" + ], + "subInstructions": [] + }, + { + "type": { + "inverted": false, + "value": "TextObject::String" + }, + "parameters": [ + "item", + "=", + "\"Mega Potion:\"+NewLine()+ToString(Firebase::GetRemoteConfigNumber(\"potionPrice\"))+\"$\"" + ], + "subInstructions": [] + } + ], + "events": [] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "followBaseLayerCamera": false, + "isLightingLayer": false, + "name": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "behaviorsSharedData": [] +} \ No newline at end of file diff --git a/newIDE/app/src/JsExtensionsLoader/BrowserJsExtensionsLoader.js b/newIDE/app/src/JsExtensionsLoader/BrowserJsExtensionsLoader.js index a7e6bd9530..f4271f36eb 100644 --- a/newIDE/app/src/JsExtensionsLoader/BrowserJsExtensionsLoader.js +++ b/newIDE/app/src/JsExtensionsLoader/BrowserJsExtensionsLoader.js @@ -56,6 +56,11 @@ const jsExtensions = [ extensionModule: require('GDJS-for-web-app-only/Runtime/Extensions/FileSystem/JsExtension.js'), objectsRenderingServiceModules: {}, }, + { + name: 'Firebase', + extensionModule: require('GDJS-for-web-app-only/Runtime/Extensions/Firebase/JsExtension.js'), + objectsRenderingServiceModules: {}, + }, { name: 'DialogueTree', extensionModule: require('GDJS-for-web-app-only/Runtime/Extensions/DialogueTree/JsExtension.js'), diff --git a/newIDE/app/src/ProjectManager/ProjectErrorsChecker.js b/newIDE/app/src/ProjectManager/ProjectErrorsChecker.js index 3e5603aed6..c8b44da6b7 100644 --- a/newIDE/app/src/ProjectManager/ProjectErrorsChecker.js +++ b/newIDE/app/src/ProjectManager/ProjectErrorsChecker.js @@ -108,3 +108,12 @@ export const displayProjectErrorsBox = ( return false; }; + +export const validateJSON = (jsonString: string): boolean => { + try { + JSON.parse(jsonString); + return true; + } catch { + return false; + } +};