diff --git a/calc.b61e25e429566c9e70cd.css b/calc.75808e4b525444cf6e03.css similarity index 100% rename from calc.b61e25e429566c9e70cd.css rename to calc.75808e4b525444cf6e03.css diff --git a/calc.b61e25e429566c9e70cd.css.gz b/calc.75808e4b525444cf6e03.css.gz similarity index 100% rename from calc.b61e25e429566c9e70cd.css.gz rename to calc.75808e4b525444cf6e03.css.gz diff --git a/index.html b/index.html index a75b421f3..92c96a5cd 100644 --- a/index.html +++ b/index.html @@ -116,7 +116,7 @@ } } - +
@@ -125,6 +125,6 @@
- + \ No newline at end of file diff --git a/index.html.gz b/index.html.gz index 84cdd8a46..74302fb71 100644 Binary files a/index.html.gz and b/index.html.gz differ diff --git a/js/calc.b61e25e429566c9e70cd.bundle.js b/js/calc.75808e4b525444cf6e03.bundle.js similarity index 87% rename from js/calc.b61e25e429566c9e70cd.bundle.js rename to js/calc.75808e4b525444cf6e03.bundle.js index e6899bfe2..af43e3d85 100644 --- a/js/calc.b61e25e429566c9e70cd.bundle.js +++ b/js/calc.75808e4b525444cf6e03.bundle.js @@ -109,4 +109,4 @@ var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r,o,i,a,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,c=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(e){throw setTimeout(c,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(c,0))},o=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.performance,f=window.Date,m=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof h&&"function"==typeof h.now)t.unstable_now=function(){return h.now()};else{var y=f.now();t.unstable_now=function(){return f.now()-y}}var b=!1,v=null,_=-1,w=5,E=0;a=function(){return t.unstable_now()>=E},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0T(a,n))void 0!==l&&0>T(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],x=[],L=1,R=null,A=3,D=!1,N=!1,P=!1;function I(e){for(var t=O(x);null!==t;){if(null===t.callback)k(x);else{if(!(t.startTime<=e))break;k(x),t.sortIndex=t.expirationTime,S(M,t)}t=O(x)}}function H(e){if(P=!1,I(e),!N)if(null!==O(M))N=!0,r(Y);else{var t=O(x);null!==t&&o(H,t.startTime-e)}}function Y(e,n){N=!1,P&&(P=!1,i()),D=!0;var r=A;try{for(I(n),R=O(M);null!==R&&(!(R.expirationTime>n)||e&&!a());){var s=R.callback;if(null!==s){R.callback=null,A=R.priorityLevel;var l=s(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?R.callback=l:R===O(M)&&k(M),I(n)}else k(M);R=O(M)}if(null!==R)var u=!0;else{var c=O(x);null!==c&&o(H,c.startTime-n),u=!1}return u}finally{R=null,A=r,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,r(Y))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return O(M)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0s?(e.sortIndex=l,S(x,e),null===O(M)&&e===O(x)&&(P?i():P=!0,o(H,l-s))):(e.sortIndex=a,S(M,e),N||D||(N=!0,r(Y))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();I(e);var n=O(M);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/warning/warning.js":function(e,t,n){"use strict";var r=function(){};e.exports=r},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/harmony-module.js":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/calc2/calculator.entry.tsx":function(e,t,n){"use strict";n.r(t);var r=n("./src/calc2/i18n.tsx"),o=n("./src/calc2/utils/groupUtils.ts"),i=n("./node_modules/immutable/dist/immutable.es.js"),a=function(e){return"@@redux-saga/"+e},s=a("CANCEL_PROMISE"),l=a("CHANNEL_END"),u=a("IO"),c=a("MATCH"),d=a("MULTICAST"),h=a("SAGA_ACTION"),f=a("SELF_CANCELLATION"),m=a("TASK"),p=a("TASK_CANCEL"),g=a("TERMINATE"),y=a("LOCATION"),b=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),v=function(e){return null==e},_=function(e){return null!=e},w=function(e){return"function"==typeof e},E=function(e){return"string"==typeof e},j=Array.isArray,C=function(e){return e&&w(e.then)},S=function(e){return e&&w(e.next)&&w(e.throw)},O=function e(t){return t&&(E(t)||M(t)||w(t)||j(t)&&t.every(e))},k=function(e){return e&&w(e.take)&&w(e.close)},T=function(e){return w(e)&&e.hasOwnProperty("toString")},M=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var x=function(e){return function(){return e}}(!0),L=function(){};var R=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var A=function(e,t){Object(b.a)(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function D(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function N(e){var t=!1;return function(){t||(t=!0,e())}}var P=function(e){throw e},I=function(e){return{value:e,done:!0}};function H(e,t,n){void 0===t&&(t=P),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:I,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Y(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var F=function(e){return Array.apply(null,new Array(e))},W=function(e){return function(t){return e(Object.defineProperty(t,h,{value:!0}))}},B=function(e){return e===g},U=function(e){return e===p},z=function(e){return B(e)||U(e)};function V(e,t){var n=Object.keys(e),r=n.length;var o,i=0,a=j(e)?F(r):{},s={};return n.forEach((function(e){var n=function(n,s){o||(s||z(n)?(t.cancel(),t(n,s)):(a[e]=n,++i===r&&(o=!0,t(a))))};n.cancel=L,s[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return s[e].cancel()})))},s}function q(e){return{name:e.name||"anonymous",location:G(e)}}function G(e){return e[y]}function K(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},s=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},l=function(){for(var e=[];r;)e.push(s());return e};return{isEmpty:function(){return 0==r},put:function(s){var u;if(r1?t-1:0),r=1;r1?t-1:0),r=1;r2?n-2:0),o=2;oe.groupInfo.source===n&&e.groupInfo.id===r&&e.groupInfo.filename===o&&e.groupInfo.index===i);return a?Object.assign(Object.assign({},e),{current:Object.assign(Object.assign({},e.current),{group:a})}):(console.error("could not find group ",a),e)}case"GROUPS_LOAD_SUCCESS":{const{loadedGroups:n}=t;let r=e;for(const e of n)r=Object.assign(Object.assign({},r),{groups:r.groups.set(le(e),e)});return r}case"GROUP_SET_DRAFT":{let{draft:n}=t;n=Object.assign(Object.assign({},n),{isDraft:!0}),e=Object.assign(Object.assign({},e),{groups:e.groups.set(le(n),n),current:Object.assign(Object.assign({},e.current),{group:n})})}default:return e}}function le(e){const{source:t,id:n,filename:r,index:o}=e.groupInfo;return`${t}/${n}/${r}/${o}`}n("./node_modules/custom-event-polyfill/polyfill.js");var ue=n("./node_modules/react/index.js"),ce=n("./node_modules/react-dom/index.js"),de=n("./node_modules/react-hot-loader/index.js"),he=(n.p,n("./src/calc2/main.hot.tsx")),fe=n("./node_modules/redux/es/redux.js"),me=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");function pe(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var ge=pe,ye=[],be=0;function ve(e){try{Ee(),e()}finally{je()}}function _e(e){ye.push(e),be||(Ee(),Ce())}function we(e){try{return Ee(),e()}finally{Ce()}}function Ee(){be++}function je(){be--}function Ce(){var e;for(je();!be&&void 0!==(e=ye.shift());)ve(e)}var Se=function(e){return function(t){return e.some((function(e){return xe(e)(t)}))}},Oe=function(e){return function(t){return e(t)}},ke=function(e){return function(t){return t.type===String(e)}},Te=function(e){return function(t){return t.type===e}},Me=function(){return x};function xe(e){var t="*"===e?Me:E(e)?ke:j(e)?Se:T(e)?ke:w(e)?Oe:M(e)?Te:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var Le={type:l},Re=function(e){return e&&e.type===l};function Ae(e){void 0===e&&(e=X());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(Le):e.isEmpty()?(n.push(r),r.cancel=function(){D(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(Le):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r2?h-2:0),m=2;m2?n-2:0),o=2;o1?t-1:0),r=1;r!(e.groupInfo.source!==t||e.groupInfo.id!==n||!r||"first"!==r&&r.filename!==e.groupInfo.filename||!r||"first"!==r&&r.index!==e.groupInfo.index));if(s){const{source:e,id:t,filename:n,index:r}=s.groupInfo,o={type:"GROUP_SET_CURRENT",source:e,id:t,filename:n,index:r};yield Q(o)}else try{if("local"!==t&&"gist"!==t)throw new Error(`unsupported source-type ${t}`);const e=yield ee(o.b,t,n,i,a),s={type:"GROUPS_LOAD_SUCCESS",loadedGroups:e};if(yield Q(s),void 0!==r&&e.length>0){const{source:t,id:n,filename:r}=e[0].groupInfo,o={type:"GROUP_SET_CURRENT",source:t,id:n,filename:r,index:0};yield Q(o)}}catch(e){console.error("could not fetch group",e),window.alert("Could not fetch group!\nDefault group loaded.\n"+e)}}))})),ce.render(ue.createElement(de.AppContainer,null,ue.createElement(he.a,{store:et})),document.getElementById("root"));{const e={type:"SET_LOCALE",locale:r.c.language};et.dispatch(e)}for(const e of function(){const e=[{maintainerGroup:Object(r.d)("calc.maintainer-groups.misc"),maintainer:"",source:"local",id:"uibk"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'mtschu',source:"gist",id:"2923a30a474fdcb46bee"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Wolfgang Gassler',source:"gist",id:"7d1871f79a8bcb4788de"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"b58108eacc9c5916726b2327789204ab"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"963d8b886fb468d742c71d34ba0dbbed"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"41cf5ce652756d9331eec7562644e074"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"c306ecf21c6e6d175508d3ac6b4355e7"}];let t=!0;return e.map(({source:e,id:n,maintainer:r,maintainerGroup:o})=>{const i={type:"GROUPS_LOAD_REQUEST",source:e,id:n,setCurrent:t?"first":void 0,maintainer:r,maintainerGroup:o};return t=!1,i})}())et.dispatch(e)},"./src/calc2/components/calculator.scss":function(e,t,n){},"./src/calc2/components/dropdownList.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("./node_modules/react/index.js"),o=n("./node_modules/reactstrap/lib/Dropdown.js"),i=n.n(o),a=n("./node_modules/reactstrap/lib/DropdownItem.js"),s=n.n(a),l=n("./node_modules/reactstrap/lib/DropdownMenu.js"),u=n.n(l),c=n("./node_modules/reactstrap/lib/DropdownToggle.js"),d=n.n(c);class h extends r.Component{constructor(e){super(e),this.id=`dropdown-${Math.random().toString(36).substr(2,10)}`,this.state={isOpen:!1},this.toggle=this.toggle.bind(this)}toggle(){this.setState({isOpen:!this.state.isOpen})}render(){const{label:e,elements:t,value:n,onChange:o,disabled:a=!1}=this.props,{isOpen:l}=this.state;return r.createElement(i.a,{isOpen:l,toggle:this.toggle},r.createElement(d.a,{color:"",disabled:a||0===t.length},e),r.createElement(u.a,null,t.map((e,t)=>"separator"===e.type?r.createElement(s.a,{key:t,divider:!0}):"header"===e.type?r.createElement(s.a,{key:t,header:!0},e.label):r.createElement(s.a,{key:t,onClick:t=>{t.preventDefault(),o&&o(e.value)},active:e.active||e.value===n},e.label))))}}},"./src/calc2/components/editorBase.tsx":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return T}));var r=n("./node_modules/@fortawesome/free-solid-svg-icons/index.es.js"),o=n("./node_modules/@fortawesome/react-fontawesome/index.es.js"),i=n("./src/calc2/components/dropdownList.tsx"),a=n("./src/calc2/components/toolbar.tsx"),s=n("./src/calc2/i18n.tsx"),l=n("./node_modules/classnames/index.js"),u=n("./node_modules/codemirror/lib/codemirror.js"),c=(n("./node_modules/codemirror/addon/hint/show-hint.js"),n("./src/db/exec/RANode.ts")),d=n("./src/db/translate/utils.ts"),h=n("./node_modules/react/index.js"),f=n("./node_modules/react-dom/index.js"),m=n("./node_modules/react-toastify/esm/react-toastify.js"),p=n("./node_modules/reactstrap/es/Button.js"),g=n("./node_modules/reactstrap/es/Modal.js"),y=n("./node_modules/reactstrap/es/ModalHeader.js"),b=n("./node_modules/reactstrap/es/ModalBody.js"),v=n("./node_modules/reactstrap/es/ModalFooter.js"),_=n("./node_modules/reactstrap/es/Input.js"),w=n("./node_modules/@handsontable/react/es/react-handsontable.js");n("./node_modules/codemirror/lib/codemirror.css"),n("./node_modules/codemirror/theme/eclipse.css"),n("./node_modules/codemirror/addon/hint/show-hint.css"),n("./node_modules/codemirror/addon/lint/lint.js"),n("./node_modules/codemirror/addon/lint/lint.css"),n("./node_modules/codemirror/addon/display/placeholder.js"),n("./node_modules/codemirror/addon/display/autorefresh.js"),n("./node_modules/codemirror/mode/sql/sql.js"),n("./node_modules/handsontable/dist/handsontable.full.css"),u.defineMode("relalg",(function(){const e=["pi","sigma","rho","tau","<-","->","intersect","union","except","/","-","\\\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","left semi join","right semi join","anti join","anti semi join","and","or","xor"],t=["π","σ","ρ","τ","←","→","∩","∪","÷","-","⨯","⨝","⟕","⟖","⟗","⋉","⋊","▷"],n=["<-","->",">=","<=","=","∧","∨","⊻","⊕","≠","=","¬",">","<","≥","≤"],r=(e,t,n,r="")=>{for(let o=0;o({inBlockComment:!1}),token:(o,i)=>i.inBlockComment?(o.match(/.*?\*\//,!0)?i.inBlockComment=!1:o.match(/.*/,!0),"comment"):o.match(/\/\*.*?\*\//,!0)?"comment":!i.inBlockComment&&o.match(/^\/\*.*/,!0)?(i.inBlockComment=!0,"comment"):i.inInlineRelation?(o.match(/.*?}/,!0)?i.inInlineRelation=!1:o.match(/.*/,!0),"inlineRelation"):o.match(/^{/,!0)?(i.inInlineRelation=!0,"inlineRelation"):o.match(/^--[\t ]/,!0)?(o.skipToEnd(),"comment"):o.match(/^\/\*.*?$/,!0)?"comment":r(o,t,!0)?"keyword math":r(o,e,!0,"([\\(\\)[\\]{\\}, \\.\\t]|$)")?"keyword":r(o,n,!0)?"operator math":o.match(/^\[[0-9]+]/,!0)?"attribute":o.match(/^[0-9]+(\.[0-9]+)?/,!0)?"number":o.match(/\^'[^']*'/i,!0)?"string":o.match(/\^[a-z]+\.[a-z]*/i,!0)?"qualified-column":o.match(/^[\(\)\[]\{},]/i,!0)?"bracket":o.match(/^[a-z][a-z0-9\.]*/i,!0)?"word":(o.next(),"else")}}));const E=e=>{const{editor:t}=e,{type:n,message:r,position:o}=e.alert,i={error:Object(s.d)("editor.alert-message-headers.error"),warning:Object(s.d)("editor.alert-message-headers.warning")}[n];return h.createElement("div",{className:l("alert ",{"alert-danger":"error"===n,"alert-warning":"warning"===n})},o?h.createElement("strong",null,i,": ",h.createElement("a",{onClick:e=>{if(t)return t.focus(),t.getDoc().setCursor(o),t.scrollIntoView(null,42),e.preventDefault(),!1;console.warn("editor not initialized yet")},href:"#"},Object(s.d)("editor.error-at-line-x",{line:o.line+1})),": ",r):h.createElement("strong",null,i,": ",r))};class j{constructor(){this.name="",this.type="",this.data=[]}}class C{constructor(){this.name="",this.attributes=[]}toString(e){let t="";t=!1===e?this.name+" = {\n":"{ ";const n=new Array;for(let e=0;e<1+this.attributes[0].data.length;e++)n.push("");return this.attributes.forEach((e,t)=>{t>0&&(n[0]+=", "),n[0]+=e.name,e.data.forEach((r,o)=>{t>0&&(n[o+1]+=", "),"number"===e.type?n[o+1]+=r:n[o+1]+="'"+r+"'"})}),t+=n.join("\n"),t+="\n}\n",t}fromTableData(e){if(null==e)return;const t=new Array;t.push([]),t.push([]),e.columns.forEach(e=>{t[0].push(e.name),t[1].push(e.type)}),e.rows.forEach(e=>{t.push(e)}),this.fromData(t)}toData(){const e=new Array;if(0===this.attributes.length)return[[]];for(let t=0;t<2+this.attributes[0].data.length;t++)e.push([]);return this.attributes.forEach(t=>{e[0].push(t.name),e[1].push(t.type),t.data.forEach((t,n)=>{e[n+2].push(t)})}),e}fromData(e){for(let t=0;t{const r=new Array,i=e.split(t);-1===o&&(o=i.length),i.length===o&&(i.forEach(e=>{r.push(e)}),n.push(r))}),this.fromData(n)}toCSV(e=";"){let t="";return this.toData().forEach(n=>{t+=n.join(e)+"\n"}),t}}const S="CodeMirror-table-edit-markers";class O extends h.Component{constructor(e){super(e);const t=Object.assign({theme:"eclipse",smartdent:!0,tabSize:2,indentWithTabs:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseBrackets:!0,smartIndent:!0,autofocus:!1,autoRefresh:!0,enableInlineRelationEditor:!0,gutters:["CodeMirror-lint-markers",S],mode:e.mode,viewportMargin:1/0,extraKeys:{"Shift-Tab":"indentLess","Ctrl-Enter":e=>{this.exec(!1)},"Shift-Ctrl-Enter":e=>{const{editor:t}=this.state;t&&t.getDoc().somethingSelected()&&this.exec(!0)},"Ctrl-S":e=>{this.downloadEditorText()},"Ctrl-Space":e=>{u.showHint(e,e=>this.genericHint(e),{closeOnUnfocus:!0})}},placeholder:Object(s.d)("editor.codemirror-placeholder"),textChange:null},e.codeMirrorOptions);this.hotTableSettings={colHeaders:!1,rowHeaders:function(e){return 0===e?Object(s.d)("calc.editors.ra.inline-editor.row-name"):1===e?Object(s.d)("calc.editors.ra.inline-editor.row-type"):e-1},height:function(){return.7*document.body.clientHeight},fixedRowsTop:2,minRows:2,minCols:1,minSpareRows:1,minSpareCols:1,colWidths:"100px",contextMenu:!0,cells:function(e,t){return 1===e?{type:"dropdown",source:["number","string","date"]}:{}}},this.state={editor:null,codeMirrorOptions:t,history:[],isSelectionSelected:!1,execSuccessful:!1,execErrors:[],isExecutionDisabled:!1,execResult:null,modal:!1,inlineRelationModal:!1,relationEditorName:"",replSelStart:null,replSelEnd:null},this.toggle=this.toggle.bind(this),this.inlineRelationEditorOk=this.inlineRelationEditorOk.bind(this),this.toggleInlineRelationEditor=this.toggleInlineRelationEditor.bind(this),this.inlineRelationEditorClose=this.inlineRelationEditorClose.bind(this),this.inlineRelationEditorUpload=this.inlineRelationEditorUpload.bind(this),this.inlineRelationEditorDownload=this.inlineRelationEditorDownload.bind(this),this.hinterCache={hints:[],hintsFromLinter:[],changed:!0},this.linter=this.linter.bind(this),this.exec=this.exec.bind(this),this.applyHistory=this.applyHistory.bind(this),this.downloadEditorText=this.downloadEditorText.bind(this),this.uploadCSVRef=h.createRef()}getInlineRelationData(){return this.hotTableSettings.data}setInlineRelationData(e){this.hotTableSettings.datta=e}inlineRelationEditorOpen(e){const t=new C,{editor:n}=this.state;if(n){let r=n.getDoc().getCursor(),o=n.getDoc().getCursor();e?(t.name=e.assignmentName,t.fromTableData(e.content),r=u.Pos(e.line-1,0),o=u.Pos(e.end.line,e.end.column)):(t.attributes.push(new j),t.attributes.push(new j)),this.setState({inlineRelationModal:!0,relationEditorName:t.name,replSelStart:r,replSelEnd:o},()=>{this.hotTableSettings.data=t.toData()})}}inlineRelationEditorOk(){const e=new C;e.name=this.state.relationEditorName,e.fromData(this.getInlineRelationData());const{editor:t,replSelStart:n,replSelEnd:r}=this.state;t&&t.getDoc().replaceRange(e.toString("relalg"===this.props.tab),n,r),this.inlineRelationEditorClose()}inlineRelationEditorClose(){this.setState({inlineRelationModal:!1})}inlineRelationEditorUpload(e){const t=e.target.files;if(t.length>0){const e=new FileReader;e.onload=e=>{const n=e.target.result,r=new C;r.fromCSV(n),r.name=t[0].name.replace(".csv",""),this.setInlineRelationData(r.toData())},e.readAsText(t[0])}}inlineRelationEditorDownload(){const e=new C;e.fromData(this.getInlineRelationData());const t=e.toCSV(),n=(document.createElement("a"),document.createElement("a"));n.href=window.URL.createObjectURL(new Blob([t],{type:"text/csv"})),n.download=this.state.relationEditorName+".csv",n.click()}componentDidMount(){const e=Object(f.findDOMNode)(this).querySelector("textarea");if(!e)throw new Error("could not fid textarea");const t=u.fromTextArea(e,this.state.codeMirrorOptions);this.setState({editor:t,relationEditorName:""}),null!=this.props.linterFunction&&t.setOption("lint",{getAnnotations:this.linter}),t.on("cursorActivity",e=>{this.setState({isSelectionSelected:e.getDoc().somethingSelected()})}),t.on("change",e=>{this.props.textChange(e)})}render(){const{execErrors:e,isSelectionSelected:t,editor:n,history:u,execSuccessful:c,isExecutionDisabled:d,execResult:f}=this.state,{toolbar:m,disableHistory:j=!1,execButtonLabel:C}=this.props;return h.createElement("div",null,h.createElement("div",{className:"editor-base"},h.createElement(a.a,{groups:m}),h.createElement("textarea",null),h.createElement("div",{className:"exec-errors"},e.map((e,t)=>h.createElement(E,{key:t,alert:e,editor:n}))),h.createElement("div",{className:"input-buttons"},h.createElement("button",{type:"button",disabled:d,className:l("btn btn-primary exec-button selection",{"selection-selected":t,"btn-danger":e.length>0,"btn-success":c,disabled:d}),onClick:()=>{n?this.exec(n.getDoc().somethingSelected()):console.warn("editor not initialized yet")}},C?h.createElement("span",null,h.createElement(o.a,{icon:r.o})," ",h.createElement(s.b,{id:C})):h.createElement(h.Fragment,null,h.createElement("span",{className:"glyphicon glyphicon-play"})," ",h.createElement("span",{className:"query"},h.createElement(o.a,{icon:r.n})," ",h.createElement(s.b,{id:"calc.editors.ra.button-execute-query"})),h.createElement("span",{className:"selection"},h.createElement(s.b,{id:"calc.editors.ra.button-execute-selection"})))),h.createElement("div",{style:{float:"right"}},h.createElement(p.a,{color:"Link",type:"button",className:"hideOnSM",onClick:this.downloadEditorText},h.createElement(o.a,{icon:r.h})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.ra.button-download"}))),j?null:h.createElement("div",{className:"btn-group history-container"},h.createElement(i.a,{label:h.createElement("span",null,h.createElement(o.a,{icon:r.k})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.button-history"}))),elements:u.map(e=>({label:h.createElement(h.Fragment,null,h.createElement("small",{className:"muted text-muted"},e.time.toLocaleTimeString()),h.createElement("div",null,e.code)),value:e})),onChange:this.applyHistory})))),h.createElement("div",{className:"exec-result"},f),h.createElement(g.a,{isOpen:this.state.modal,toggle:this.toggle,className:"showOnSM"},h.createElement(y.a,{toggle:this.toggle},Object(s.d)("calc.result.modal.title")),h.createElement(b.a,null,h.createElement("div",null,f)),h.createElement(v.a,null,h.createElement("span",null),h.createElement(p.a,{color:"secondary",onClick:this.toggle},Object(s.d)("calc.result.modal.close")))),h.createElement(g.a,{isOpen:this.state.inlineRelationModal,toggle:this.toggleInlineRelationEditor},h.createElement(y.a,{toggle:this.toggleInlineRelationEditor},Object(s.d)("calc.editors.ra.inline-editor.title")),h.createElement(b.a,null,h.createElement("div",null,"group"===this.props.tab?h.createElement("div",null,h.createElement(_.a,{placeholder:Object(s.d)("calc.editors.ra.inline-editor.input-relation-name"),value:this.state.relationEditorName,onChange:e=>{this.setState({relationEditorName:e.target.value})}}),h.createElement("br",null)):null,h.createElement(w.a,{settings:this.hotTableSettings,licenseKey:"non-commercial-and-evaluation"}))),h.createElement(v.a,null,h.createElement(p.a,{color:"light",onClick:this.inlineRelationEditorDownload},h.createElement(o.a,{icon:r.h})," ",Object(s.d)("calc.editors.ra.inline-editor.button-download-csv")),h.createElement(p.a,{color:"light",onClick:()=>{var e;null===(e=this.uploadCSVRef.current)||void 0===e||e.click()}},h.createElement(o.a,{icon:r.s})," ",Object(s.d)("calc.editors.ra.inline-editor.button-upload-csv")),h.createElement("input",{className:"hidden",ref:this.uploadCSVRef,onChange:this.inlineRelationEditorUpload,type:"file"}),h.createElement("span",{className:"flexSpan"}),h.createElement(p.a,{color:"primary",onClick:this.inlineRelationEditorOk},h.createElement(o.a,{icon:r.e})," ",Object(s.d)("calc.editors.ra.inline-editor.button-ok")),h.createElement(p.a,{color:"secondary",onClick:this.inlineRelationEditorClose},h.createElement(o.a,{icon:r.r})," ",Object(s.d)("calc.editors.ra.inline-editor.button-cancel"))))))}isMobile(){return window.innerWidth<=992}toggleInlineRelationEditor(){this.setState({inlineRelationModal:!this.state.inlineRelationModal})}toggle(){this.isMobile()&&this.setState({modal:!this.state.modal})}applyHistory(e){this.replaceAll(e.code)}forceLinterRun(){const{editor:e}=this.state;if(!e)return void console.warn("editor not initialized yet");const t=e.getValue();e.setValue(""),e.setValue(t)}historyAddEntry(e){const{historyMaxEntries:t=10,historyMaxLabelLength:n=20}=this.props,r={time:new Date,label:e.length>n?e.substr(0,n-4)+" ...":e,code:e};this.setState({history:[r,...this.state.history].slice(-t)})}clearExecutionAlerts(){this.state.execErrors.splice(0,this.state.execErrors.length),m.b.dismiss()}addExecutionWarning(e,t){this._addExecutionAlert(e,t,"warning"),this.isMobile()&&m.b.warn(e,{className:"fancyToastWarning"})}addExecutionError(e,t){this._addExecutionAlert(e,t,"error"),this.isMobile()&&m.b.error(e,{className:"fancyToastError"})}_addExecutionAlert(e,t,n){this.isMobile();const{editor:r}=this.state,o={type:n,message:e,position:t},i=this.state.execErrors;i.push(o),this.setState({execErrors:i})}setText(e,t){const{editor:n}=this.state;n?("selection"===t?n.getDoc().replaceSelection(e,"end"):n.setValue(e),this.clearExecutionAlerts(),this.setState({execSuccessful:!1})):console.warn("editor not initialized yet")}getText(){const{editor:e}=this.state;if(e)return e.getValue();console.warn("editor not initialized yet")}focus(){const{editor:e}=this.state;e?e.focus():console.warn("editor not initialized yet")}refresh(){const{editor:e}=this.state;e?e.refresh():console.warn("editor not initialized yet")}downloadEditorText(){let e="query";const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");switch(t.getOption("mode")){case"sql":case"text/x-mysql":e+=".sql";break;case"ra":default:e+=".txt"}((e,t)=>{const n=document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"text/plain"})),n.download=e,n.click()})(e,t.getValue())}resetHinter(){this.hinterCache={hints:[],hintsFromLinter:[],changed:!0}}linter(t){const{editor:n}=this.state;if(!n)return console.warn("editor not initialized yet"),[];if(0===t.length||!this.props.linterFunction)return[];try{const e=this.props.linterFunction(this,n,t);return 0===e.length&&0===this.hinterCache.hintsFromLinter.length||(this.hinterCache.hintsFromLinter=e,this.hinterCache.changed=!0),[]}catch(t){const r=[];console.log(t);const o=O._generateErrorFromException(t,0,0),i=e("").append(o.message).text();if(!o.codemirrorPositions)return this.clearExecutionAlerts(),this.addExecutionError(i),[];const a=o.codemirrorPositions.from;let s=o.codemirrorPositions.to;const l=n.getTokenAt({line:a.line,ch:a.ch+1},!0),u=n.getDoc().getRange(a,s);return void 0!==l.string&&l.string.length>u.length&&(s=n.getDoc().posFromIndex(n.getDoc().indexFromPos(a)+l.string.length)),r.push({from:a,to:s,message:i,severity:"error"}),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers(),r}}genericHint(e){const{getHintsFunction:t}=this.props,n=e.getDoc().getCursor(),r=e.getTokenAt(n),o=(e,t="unknown")=>({text:e,displayText:e,className:`hint-${t}`});let i=[];if(!0===this.hinterCache.changed){const e={},n=t?t():[];for(let t=0;t0)for(let e=0;es.length&&0===t.indexOf(s)&&a.push(i[e])}else a=i;return{list:a,from:u.Pos(n.line,r.start),to:u.Pos(n.line,r.end)}}exec(e){const{editor:t}=this.state;if(!t)throw new Error("editor not initialized yet");this.setState({execResult:h.createElement("div",{className:"spinner"},h.createElement("div",{className:"rect1"}),h.createElement("div",{className:"rect2"}),h.createElement("div",{className:"rect3"}),h.createElement("div",{className:"rect4"}),h.createElement("div",{className:"rect5"}))},()=>{this.clearExecutionAlerts();let n="",r={line:0,ch:0};!0!==e?n=t.getValue():(n=t.getDoc().getSelection(),r=t.getDoc().getCursor("from")),0===n.length&&(this.clearExecutionAlerts(),this.addExecutionError(Object(s.d)("editor.error-no-query-found"))),this.clearExecutionAlerts();try{const{result:e}=this.props.execFunction(this,n,r);this.setState({execResult:e});const t=new CustomEvent("editor.execSuccessful",{detail:{editor:this}});return document.dispatchEvent(t),this.toggle(),!0}catch(e){console.error(e,e.stack);const t=O._generateErrorFromException(e,r.line,r.ch);this.addExecutionError(t.message,t.codemirrorPositions?t.codemirrorPositions.from:void 0),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers()}})}static _generateErrorFromException(e,t,n){let r=void 0!==e.message?e.message:e;r=r.replace(/(\\(u|x)[0-9A-F]+)/g,(e,t)=>`${String.fromCharCode(parseInt(t.substr(2),16))}`);let o=null;void 0!==e.codeInfo&&void 0!==e.codeInfo.location?o=e.codeInfo.location:void 0!==e.location&&(o=e.location);let i=null;return null!==o&&(i={from:{line:o.start.line+(t||0)-1,ch:o.start.column+(n||0)-1},to:{line:o.end.line+(t||0)-1,ch:o.end.column+(n||0)-1}}),{message:r,location:o,codemirrorPositions:i}}static buildTranslatedPegJsMessage(e,t){return null!==e&&function(e){let t=1;for(e.sort((e,t)=>e.descriptiont.description?1:0);t1?`${n.slice(0,-1).join(", ")} ${Object(s.d)("editor.pegjs-error.or")} ${n[e.length-1]}`:n[0],o=t?`"${function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)}"`:Object(s.d)("editor.pegjs-error.end-of-input");return Object(s.d)("editor.pegjs-error.expected-found",{expected:r,found:o})}(e,t)}setExecutionDisabled(e){this.setState({isExecutionDisabled:e})}replaceText(e,t){const n="string"==typeof e.label?e.label:"";this.replaceSelection(n,t)}replaceSelection(e,t){this.setText(t||e,"selection"),this.focus()}replaceAll(e,t){this.setText(t||e,"all"),this.focus()}setReadOnly(t){const{editor:n}=this.state;if(!n)throw new Error("editor not initialized yet");const r=e(n.getWrapperElement());!1===t?(n.setOption("readOnly",!1),r.removeClass("readonly")):(n.setOption("readOnly","nocursor"),r.addClass("readonly"))}addInlineRelationMarkers(e){const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");const n=function(e){const t=[];return Object(d.a)(e,e=>{const n=e;if(n&&"table"===n.type){const e={name:n.name,line:n.codeInfo.location.start.line-1,column:n.codeInfo.location.start.column-1,length:n.codeInfo.text.length,assignmentName:n.assignmentName?n.assignmentName:"",content:{columns:n.columns,rows:n.rows},start:n.codeInfo.location.start,end:n.codeInfo.location.end};t.push(e)}}),t}(e);this.clearInlineRelationMarkers();for(let e=0;e{this.inlineRelationEditorOpen(n[e])},f.render(h.createElement(o.a,{icon:r.q}),i,()=>{i.style.marginLeft="-15px",t.setGutterMarker(n[e].line++,S,i)})}}clearInlineRelationMarkers(){const{editor:e}=this.state;e?e.clearGutter(S):console.warn("editor not initialized yet")}}function k(e){const t=[],n=function(e){const r=e.getSchema();for(let e=0;e-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())},n.onMouseLeaveTooltipContent=function(e){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),e.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide")))},n.onEscKeyDown=function(e){"Escape"===e.key&&this.hide(e)},n.getRef=function(e){var t=this.props.innerRef;t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),this._popover=e},n.getDelay=function(e){var t=this.props.delay;return"object"==typeof t?isNaN(t[e])?S[e]:t[e]:t},n.show=function(e){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=e?e.currentTarget||e.target:null,e&&e.composedPath&&"function"==typeof e.composedPath){var t=e.composedPath();this.currentTargetElement=t&&t[0]||this.currentTargetElement}this.toggle(e)}},n.showWithDelay=function(e){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,e),this.getDelay("show"))},n.hide=function(e){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(e))},n.hideWithDelay=function(e){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide"))},n.clearShowTimeout=function(){clearTimeout(this._showTimeout),this._showTimeout=void 0},n.clearHideTimeout=function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0},n.handleDocumentClick=function(e){var t=this.props.trigger.split(" ");t.indexOf("legacy")>-1&&(this.props.isOpen||T(e.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!k(e.target,this._popover)?this.hideWithDelay(e):this.props.isOpen||this.showWithDelay(e)):t.indexOf("click")>-1&&T(e.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(e):this.showWithDelay(e))},n.addEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.addEventListener(e,t,n)}))},n.removeEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.removeEventListener(e,t,n)}))},n.addTargetEvents=function(){if(this.props.trigger){var e=this.props.trigger.split(" ");-1===e.indexOf("manual")&&((e.indexOf("click")>-1||e.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(e.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),e.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}},n.removeTargetEvents=function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)},n.updateTarget=function(){var e=Object(b.i)(this.props.target,!0);e!==this._targets&&(this.removeTargetEvents(),this._targets=e?Array.from(e):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())},n.toggle=function(e){return this.props.disabled||!this._isMounted?e&&e.preventDefault():this.props.toggle(e)},n.render=function(){if(!this.props.isOpen)return null;this.updateTarget();var e=this.props,t=e.className,n=e.cssModule,r=e.innerClassName,o=e.isOpen,s=e.hideArrow,l=e.boundariesElement,u=e.placement,c=e.placementPrefix,d=e.arrowClassName,h=e.popperClassName,f=e.container,m=e.modifiers,p=e.offset,g=e.fade,y=e.flip,v=Object(b.l)(this.props,Object.keys(C)),_=Object(b.k)(h,n),w=Object(b.k)(r,n);return i.a.createElement(j,{className:t,target:this.currentTargetElement||this._targets[0],isOpen:o,hideArrow:s,boundariesElement:l,placement:u,placementPrefix:c,arrowClassName:d,popperClassName:_,container:f,modifiers:m,offset:p,cssModule:n,fade:g,flip:y},i.a.createElement("div",Object(a.a)({},v,{ref:this.getRef,className:w,role:"tooltip",onMouseOver:this.onMouseOverTooltipContent,onMouseLeave:this.onMouseLeaveTooltipContent,onKeyDown:this.onEscKeyDown})))},t}(i.a.Component);M.propTypes=C,M.defaultProps=O;var x=M,L=function(e){var t=l()("popover","show",e.popperClassName),n=l()("popover-inner",e.innerClassName);return i.a.createElement(x,Object(a.a)({},e,{popperClassName:t,innerClassName:n}))};L.propTypes=C,L.defaultProps={placement:"right",placementPrefix:"bs-popover",trigger:"click"};var R=L,A={tag:b.o,className:h.a.string,cssModule:h.a.object},D=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-header"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};D.propTypes=A,D.defaultProps={tag:"h3"};var N=D,P={tag:b.o,className:h.a.string,cssModule:h.a.object},I=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-body"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};I.propTypes=P,I.defaultProps={tag:"div"};var H=I;class Y extends o.Component{constructor(e){super(e),this.body=Object(r.a)((e,t)=>!1===t?null:"function"==typeof e?e():e),this.state={id:"popWrapper_"+Math.random().toString(36).substr(2),isOpen:!1},this.hoverOpen=this.hoverOpen.bind(this),this.hoverClose=this.hoverClose.bind(this),this.handleClick=this.handleClick.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this)}componentWillUnmount(){this.close()}open(){this.setState({isOpen:!0}),document.addEventListener("click",this.close)}close(e){if(e){const{target:t}=e;if(t instanceof Element&&null!==t.closest(".popover__inside"))return}this.setState({isOpen:!1}),document.removeEventListener("click",this.close)}hoverOpen(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.open()}hoverClose(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.close()}handleClick(e){const{trigger:t,onClick:n}=this.props;if(n&&n(e),"click"===t||Array.isArray(t)&&t.includes("click")){const{isOpen:e}=this.state;e?this.close():this.open()}}render(){const{id:e,isOpen:t}=this.state,{title:n,className:r=""}=this.props,i=this.body(this.props.body,t);return o.createElement(o.Fragment,null,o.createElement("div",{onMouseEnter:this.hoverOpen,onMouseLeave:this.hoverClose,onFocus:this.hoverOpen,onBlur:this.hoverClose,onClick:this.handleClick,id:e,className:`popover__outside ${r}`},o.Children.only(this.props.children),o.createElement(R,{target:`#${e}`,isOpen:t,className:`popover__inside ${r}`},o.createElement(N,null,n),o.createElement(H,null,i))))}}},"./src/calc2/components/raTree.scss":function(e,t,n){},"./src/calc2/components/result.scss":function(e,t,n){},"./src/calc2/components/toolbar.scss":function(e,t,n){},"./src/calc2/components/toolbar.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("./src/calc2/components/dropdownList.tsx"),o=n("./src/calc2/components/popover.tsx"),i=n("./src/calc2/i18n.tsx"),a=n("./node_modules/react/index.js");n("./src/calc2/components/toolbar.scss");class s extends a.Component{render(){const{groups:e}=this.props;return a.createElement("div",{className:"toolbar codemirror-toolbar"},e.map((e,t)=>e.items.map((e,t)=>a.createElement(o.a,{key:t,trigger:["hover","focus"],placement:"dropdown"===e.type?"top":"bottom",title:e.tooltipTitle?String(Object(i.d)(e.tooltipTitle)):"",body:a.createElement(i.b,{id:e.tooltip,html:!0}),className:("dropdown"===e.type?"toolbar__popover__dropdown":"toolbar__popover")+" "+(void 0===e.className?"":e.className)},"dropdown"===e.type?a.createElement(r.a,{label:e.label,elements:e.elements,onChange:e.onChange,value:e.value}):a.createElement("span",{onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onClick(e)}},e.label)))))}}},"./src/calc2/data/uibk.txt":function(e,t,n){"use strict";n.r(t),t.default="group: UIBK - R, S, T\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \ncategory@de:Universität Innsbruck\ncategory@en:University of Innsbruck\n\nR = {\na, b, c\n\n1, 'a', 'd'\n3, 'c', 'c'\n4, 'd', 'f'\n5, 'd', 'b'\n6, 'e', 'f'\n}\n\nS = {\nb, d\n\n'a', 100\n'b', 300\n'c', 400\n'd', 200\n'e', 150\n}\n\nT = {\nb, d\n\n'a', 100\n'd', 200\n'f', 400\n'g', 120\n}\n\ngroup: Kemper Datenbanksysteme\ndescription: Source: [Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage](http://www3.in.tum.de/teaching/bookDBMSeinf/), Seite 84, Abbildung 3.8\n\nProfessoren = {\nPersNr:number\tName:string\tRang:string\tRaum:number\n2125\tSokrates\tC4\t226\n2126\tRussel\tC4\t232\n2127\tKopernikus\tC3\t310\n2133\tPopper\tC3\t52\n2134\tAugustinus\tC3\t309\n2136\tCurie\tC4\t36\n2137\tKant\tC4\t7\n}\n\nStudenten = {\nMatrNr:number\tName:string\tSemester:number\n24002\tXenokrates\t18\n25403\tJonas\t12\n26120\tFichte\t10\n26830\tAristoxenos\t8\n27550\tSchopenhauer\t6\n28106\tCarnap\t3\n29120\tTheophrastos\t2\n29555\tFeuerbach\t2\n}\n\n\nVorlesungen = {\nVorlNr:number\tTitel:string\tSWS:number\tgelesenVon:number\n5001\tGrundzuege\t4\t2137\n5041\tEthik\t4\t2125\n5043\tErkenntnistheorie\t3\t2126\n5049\tMaeeutik\t2\t2125\n4052\tLogik\t4\t2125\n5052\tWissenschaftstheorie\t3\t2126\n5216\tBioethik\t2\t2126\n5259\t'Der Wiener Kreis'\t2\t2133\n5022\t'Glaube und wissen'\t2\t2134\n4630\t'Glaube und wissen'\t4\t2137\n}\n\nvoraussetzen = {\nVorgaenger:number\tNachfolger:number\n5001\t5041\n5001\t5043\n5001\t5049\n5041\t5216\n5043\t5052\n5041\t5052\n5052\t5259\n}\n\nhoeren = {\nMatrNr:number\tVorlNr:number\n26120\t5001\n27550\t5001\n27550\t4052\n28106\t5041\n28106\t5052\n28106\t5216\n28106\t5259\n29120\t5001\n29120\t5041\n29120\t5049\n29555\t5022\n25403\t5022\n29555\t5001\n}\n\nAssistenten = {\nPersNr:number\tName:string\tFachgebiet:string\tBoss:number\n3002\tPlaton\tIdeenlehre\t2125\n3003\tAristoteles\tSyllogistik\t2125\n3004\tWittgenstein\tSprachtheorie\t2126\n3005\tRhetikus\tPlanetenbewegung\t2127\n3006\tNewton\t'Keplersche Gesetze'\t2127\n3007\tSpinoza\t'Gott und Natur'\t2134\n}\n\npruefen = {\nMatrNr:number\tVorlNr:number\tPersNr:number\tNote:number\n28106\t5001\t2126\t1\n25403\t5041\t2125\t2\n27550\t4630\t2137\t2\n}\n\n\n\ngroup: UIBK - KursDB\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \n\nKurs = {\nKursNr, Titel\n\nG08, 'Grundlagen I'\nG10, 'Grundlagen II'\nP13, 'C-Programmierung'\nI09, Datenbanken\n}\n\nKursleiter = {\nPersNr, Name, Gehalt\n\n27183, 'Meier, I.', 4300.50\n29594, 'Schulze, H.', 3890.20\n38197, 'Huber, L.', 4200.10\n43325, 'Müller, K.', 3400.80\n}\n\nVorauss = {\nVorNr, KursNr\nG08, P13\nG10, P13\nG08, I09\nG10, I09\nP13, I09\n}\n\nFuehrt_durch = {\nAngNr\tKursNr\tPersNr\n1\tG08\t38197\n2\tG08\t38197\n1\tG10\t43325\n2\tG10\t29594\n1\tP13\t27183\n2\tP13\t27183\n1\tI09\t29594\n2\tI09\t29594\n3\tI09\t29594\n}\n\nTeilnehmer = {\nTnNr, Name, Ort \n143, 'Schmidt, M.', Bremen \n145, 'Huber, Chr.', Augsburg \n146, 'Abele, I.', Senden \n149, 'Kircher, B.', Bochum \n155, 'Meier, W.', Stuttgart \n171, 'Möller, H.', Innsbruck \n173, 'Schulze, B.', Stuttgart \n177, 'Mons, F.', Essen \n185, 'Meier, K.', Heidelberg \n187, 'Karstens, L.', Hamburg \n194, 'Gerstner, M.', Innsbruck \n}\n\nNimmt_teil = {\nAngNr\tKursNr\tTnNr\n2\tG08\t143\n2\tP13\t143\n1\tG08\t145\n1\tP13\t146\n1\tI09\t146\n2\tP13\t149\n1\tI09\t155\n1\tI09\t171\n1\tI09\t173\n2\tP13\t177\n1\tI09\t185\n2\tI09\t187\n1\tP13\t194\n}\n\nAngebot = {\nAngNr\tKursNr\tDatum\tOrt\n1\tG08\t2000-10-13\t'München'\n2\tG08\t2000-11-24\tBremen\n1\tG10\t2000-12-01\t'München'\n2\tG10\t2001-02-15\tHamburg\n1\tP13\t2001-05-28\tInnsbruck\n2\tP13\t2001-07-01\tEssen\n1\tI09\t2001-03-27\tStuttgart\n2\tI09\t2001-04-23\tHamburg\n3\tI09\t2001-05-29\t'München'\n}\n\n\n\ngroup:Database Systems The Complete Book - Exercise 2.4.1\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 52-55 ]]\n\nProduct = {\nmaker\tmodel\ttype\nA\t1001\tpc\nA\t1002\tpc\nA\t1003\tpc\nA\t2004\tlaptop\nA\t2005\tlaptop\nA\t2006\tlaptop\nB\t1004\tpc\nB\t1005\tpc\nB\t1006\tpc\nB\t2007\tpc\nC\t1007\tpc\nD\t1008\tpc\nD\t1009\tpc\nD\t1010\tpc\nD\t3004\tprinter\nD\t3005\tprinter\nE\t1011\tpc\nE\t1012\tpc\nE\t1013\tpc\nE\t2001\tlaptop\nE\t2002\tlaptop\nE\t2003\tlaptop\nE\t3001\tprinter\nE\t3002\tprinter\nE\t3003\tprinter\nF\t2008\tlaptop\nF\t2009\tlaptop\nG\t2010\tlaptop\nH\t3006\tprinter\nH\t3007\tprinter\n}\n\nPC = {\nmodel\tspeed\tram\thd\tprice\n1001\t2.66\t1024\t250\t2114\n1002\t2.1\t512\t250\t995\n1003\t1.42\t512\t80\t478\n1004\t2.8\t1024\t250\t649\n1005\t3.2\t512\t250\t630\n1006\t3.2\t1024\t320\t1049\n1007\t2.2\t1024\t200\t510\n1008\t2.2\t2048\t250\t770\n1009\t2\t1024\t250\t650\n1010\t2.8\t2048\t300\t770\n1011\t1.86\t2048\t160\t959\n1012\t2.8\t1024\t160\t649\n1013\t3.06\t512\t80\t529\n}\n\nLaptop = {\nmodel\tspeed\tram\thd\tscreen\tprice\n2001\t2\t2048\t240\t20.1\t3673\n2002\t1.73\t1024\t80\t17\t949\n2003\t1.8\t512\t60\t15.4\t549\n2004\t2\t512\t60\t13.3\t1150\n2005\t2.16\t1024\t120\t17\t2500\n2006\t2\t2048\t80\t15.4\t1700\n2007\t1.83\t1024\t120\t13.3\t1429\n2008\t1.6\t1024\t100\t15.4\t900\n2009\t1.6\t512\t80\t14.1\t680\n2010\t2\t2048\t160\t15.4\t2300\n}\n\nPrinter = {\nmodel\tcolor\ttype\tprice\n3001\ttrue\tink-jet\t99\n3002\tfalse\tlaser\t239\n3003\ttrue\tlaser\t899\n3004\ttrue\tink-jet\t120\n3005\tfalse\tlaser\t120\n3006\ttrue\tink-jet\t100\n3007\ttrue\tlaser\t200\n}\n\ngroup:Database Systems The Complete Book - Exercise 2.4.3\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 55-57 ]]\n\nClasses = {\nclass\ttype\tcountry\tnumGuns\tbore\tdisplacement\nBismarck\tbb\tGermany\t8\t15\t42000\nIowa\tbb\tUSA\t9\t16\t46000\nKongo\tbc\tJapan\t8\t14\t32000\n'North Carolina'\tbb\tUSA\t9\t16\t37000\nRenown\tbc\t'Gt. Britan'\t6\t15\t23000\nRevenge\tbb\t'Gt. Britan'\t8\t15\t29000\nTennessee\tbb\tUSA\t12\t14\t32000\nYamato\tbb\tJapan\t9\t18\t65000\n}\n\nBattles = {\nname\tdate\n'Denmark Strait'\t1941-05-24\nGuadalcanal\t1942-11-15\n'North Cape'\t1943-12-26\n'Surigao Strait'\t1944-10-25\n}\n\nOutcomes = {\nship\tbattle\tresult\nArizona\t'Pearl Harbor'\tsunk\nBismarck\t'Denmark Strait'\tsunk\nCalifornia\t'Surigao Strait'\tok\n'Duke of York'\t'North Cape'\tok\nFuso\t'Surigao Strait'\tsunk\nHood\t'Denmark Strait'\tsunk\n'King George V'\t'Denmark Strait'\tok\nKirishima\tGuadalcanal\tsunk\n'Prince of Wales'\t'Denmark Strait'\tdamaged\nRodney\t'Denmark Strait'\tok\nScharnhorst\t'North Cape'\tsunk\n'South Dakota'\tGuadalcanal\tdamaged\nTennessee\t'Surigao Strait'\tok\nWashington\tGuadalcanal\tok\n'West Virginia'\t'Surigao Strait'\tok\nYamashiro\t'Surigao Strait'\tsunk\n}\n\nShips = {\nname\tclass\tlaunched\nCalifornia\tTennessee\t1921\nHaruna\tKongo\t1915\nHiei\tKongo\t1914\nIowa\tIowa\t1943\nKirishima\tKongo\t1915\nKongo\tKongo\t1913\nMissouri\tIowa\t1944\nMusashi\tYamato\t1942\n'New Jersey'\tIowa\t1943\n'North Carolina'\t'North Carolina'\t1941\nRamillies\tRevenge\t1917\nRenown\tRenown\t1916\nRepulse\tRenown\t1916\nResolution\tRevenge\t1916\nRevenge\tRevenge\t1916\n'Royal Oak'\tRevenge\t1916\n'Royal Sovereign'\tRevenge\t1916\nTennessee\tTennessee\t1920\nWashington\t'North Carolina'\t1941\nWisconsin\tIowa\t1944\nYamato\tYamato\t1941\n}\n\n\ngroup:Wikipedia - Relational algebra (en)\ndescription[[This are the tables from [Relational algebra - Wikipedia The Free Encyclopedia](http://en.wikipedia.org/wiki/Relational_algebra)\n\nlicense: [CC BY-SA](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)]]\n\nEmployee = {\n\tName:string, EmpId:number, DeptName:string\n\t'Harry' , 3415 , 'Finance' \n\t'Sally' , 2241 , 'Sales' \n\t'George' , 3401 , 'Finance' \n\t'Harriet' , 2202 , 'Sales' \n\t'Tim' , 1123 , 'Executive' \n}\n\nDept = {\n\tDeptName:string, Manager:string\n\t'Sales' , 'Harriet' \n\t'Production' , 'Charles' \n}\n\nCompleted = {\n\tStudent:string, Task:string\n\t'Fred' , 'Database1'\n\t'Fred' , 'Database2'\n\t'Fred' , 'Compiler1'\n\t'Eugene' , 'Database1'\n\t'Eugene' , 'Compiler1'\n\t'Sarah' , 'Database1'\n\t'Sarah' , 'Database2'\n}\n\nDBProject = {\n\tTask:string\n\t'Database1'\n\t'Database2'\n}\n\nCar = {\n\tCarModel:string, CarPrice:number\n\t'CarA' , 20000 \n\t'CarB' , 30000 \n\t'CarC' , 50000 \n}\n\nBoat = {\n\tBoatModel:string, BoatPrice:number\n\t'Boat1' , 10000 \n\t'Boat2' , 40000 \n\t'Boat3' , 60000 \n}"},"./src/calc2/i18n.tsx":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return g}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./node_modules/i18next-browser-languagedetector/index.js"),i=n("./node_modules/react/index.js"),a=n("./src/locales/de.json"),s=n("./src/locales/en.json"),l=n("./src/locales/es.json"),u=n("./src/locales/kr.json"),c=n("./src/locales/pt.json");const d=r.b(o).init({resources:{en:{translations:s},de:{translations:a},es:{translations:l},kr:{translations:u},pt:{translations:c}},fallbackLng:"en",nsSeparator:":",keySeparator:!1,defaultNS:"translations",debug:!0});function h(e,t){return String(d.t(e,t))}const{Provider:f,Consumer:m}=i.createContext(d),p=e=>i.createElement(f,{value:d},e.children),g=({id:e,html:t=!1})=>i.createElement(m,null,n=>t?i.createElement("span",{dangerouslySetInnerHTML:{__html:String(n.t(e,{interpolation:{escapeValue:!1}}))}}):i.createElement("span",null,String(n.t(e))))},"./src/calc2/main.hot.tsx":function(e,t,n){"use strict";(function(e){var r=n("./src/calc2/main.tsx"),o=n("./node_modules/react-hot-loader/index.js");t.a=Object(o.hot)(e)(r.a)}).call(this,n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./src/calc2/main.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return zn}));n("./node_modules/bootstrap/dist/css/bootstrap.css");var r=n("./src/calc2/i18n.tsx"),o=n("./node_modules/react/index.js"),i=n.n(o),a=n("./node_modules/prop-types/index.js"),s=n.n(a),l=i.a.createContext(null);var u=function(e){e()},c={notify:function(){}};function d(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=d())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();var f=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new h(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,s]);var u=n||l;return i.a.createElement(u.Provider,{value:a},r)},m=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),p=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"),g=n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),y=n.n(g),b=n("./node_modules/react-is/index.js"),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,_=[],w=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function j(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function C(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function S(e,t,n,r,o,i,a,s,l,u){if(e){var c=!1,d=null,h=function(){if(!c){var e,n,h=t.getState();try{e=r(h,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=h,n.trySubscribe(),h();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var O=function(){return[null,0]};function k(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,d=void 0===c?void 0:c,f=n.shouldHandleStateChanges,g=void 0===f||f,v=n.storeKey,k=void 0===v?"store":v,T=(n.withRef,n.forwardRef),M=void 0!==T&&T,x=n.context,L=void 0===x?l:x,R=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),A=L;return function(t){var n=t.displayName||t.name||"Component",r=a(n),s=Object(m.a)({},R,{getDisplayName:a,methodName:u,renderCountProp:d,shouldHandleStateChanges:g,storeKey:k,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=R.pure;var c=l?o.useMemo:function(e){return e()};function f(n){var r=Object(o.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],l=r[1],u=r[2],d=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(b.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:A}),[a,A]),f=Object(o.useContext)(d),y=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var v=y?n.store:f.store,k=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,s)}(v)}),[v]),T=Object(o.useMemo)((function(){if(!g)return w;var e=new h(v,y?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[v,y,f]),M=T[0],x=T[1],L=Object(o.useMemo)((function(){return y?f:Object(m.a)({},f,{subscription:M})}),[y,f,M]),R=Object(o.useReducer)(E,_,O),D=R[0][0],N=R[1];if(D&&D.error)throw D.error;var P=Object(o.useRef)(),I=Object(o.useRef)(u),H=Object(o.useRef)(),Y=Object(o.useRef)(!1),F=c((function(){return H.current&&u===I.current?H.current:k(v.getState(),u)}),[v,D,u]);j(C,[I,P,Y,u,F,H,x]),j(S,[g,v,M,k,I,P,Y,H,x,N],[v,M,k]);var W=Object(o.useMemo)((function(){return i.a.createElement(t,Object(m.a)({},F,{ref:l}))}),[l,t,F]);return Object(o.useMemo)((function(){return g?i.a.createElement(d.Provider,{value:L},W):W}),[d,W,L])}var v=l?i.a.memo(f):f;if(v.WrappedComponent=t,v.displayName=r,M){var T=i.a.forwardRef((function(e,t){return i.a.createElement(v,Object(m.a)({},e,{forwardedRef:t}))}));return T.displayName=r,T.WrappedComponent=t,y()(T,t)}return y()(v,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function M(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function B(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,o=t.mapStateToPropsFactories,i=void 0===o?N:o,a=t.mapDispatchToPropsFactories,s=void 0===a?D:a,l=t.mergePropsFactories,u=void 0===l?I:l,c=t.selectorFactory,d=void 0===c?F:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,c=void 0===l||l,h=a.areStatesEqual,f=void 0===h?B:h,g=a.areOwnPropsEqual,y=void 0===g?M:g,b=a.areStatePropsEqual,v=void 0===b?M:b,_=a.areMergedPropsEqual,w=void 0===_?M:_,E=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),j=W(e,i,"mapStateToProps"),C=W(t,s,"mapDispatchToProps"),S=W(n,u,"mergeProps");return r(d,Object(m.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:j,initMapDispatchToProps:C,initMergeProps:S,pure:c,areStatesEqual:f,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var z=U();var V,q=n("./node_modules/react-dom/index.js");V=q.unstable_batchedUpdates,u=V;var G=n("./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");function K(e){return"/"===e.charAt(0)}function X(e,t){for(var n=t,r=n+1,o=e.length;r=0;c--){var d=o[c];"."===d?X(o,c):".."===d?(X(o,c),u++):u&&(X(o,c),u--)}if(!s)for(;u--;u)o.unshift("..");!s||""===o[0]||o[0]&&K(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function J(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Q=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=J(t),o=J(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var Z=function(e,t){if(!e)throw new Error("Invariant failed")};function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e){return"/"===e.charAt(0)?e.substr(1):e}function ne(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function re(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function oe(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function ie(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(m.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=$(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function ae(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=ie(e,t,d(),y.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))}))},go:g,goBack:function(){g(-1)},goForward:function(){g(1)},canGo:function(e){var t=y.index+e;return t>=0&&t=0&&t<=r),active:e===t},o.createElement(ct,{onClick:()=>this.setPage(t)},t+1)));return o.createElement("ul",{className:"pagination"},o.createElement(st,{disabled:0===e},o.createElement(ct,{previous:!0,onClick:()=>this.setPage(e-1)})),i,o.createElement(st,{disabled:e+1>=r},o.createElement(ct,{next:!0,onClick:()=>this.setPage(e+1)})))}}var ht=n("./src/db/exec/ValueExpr.ts");n("./src/calc2/components/pagedTable.scss");class ft extends o.Component{constructor(e){super(e),this.state={page:0}}render(){const{table:e,maxLinesPerPage:t,showPagination:n=!0,className:r=""}=this.props,{page:i}=this.state,a=e.getSchema();return o.createElement("div",{className:"result-table pagedTable"},o.createElement("table",{className:r},o.createElement("thead",null,o.createElement("tr",null,a.getColumns().map((e,t)=>o.createElement("th",{key:t},e.toString())))),o.createElement("tbody",null,e.getRows(i*t,t).map((e,t)=>o.createElement("tr",{key:`row ${t}`},e.map((e,t)=>{const n=a.getType(t);return o.createElement("td",{key:`value ${t}`,className:`${n} ${null===e?"null":""}`},Object(ht.d)(e,n))}))))),n?o.createElement("div",{className:"pagination"},o.createElement(dt,{total:e.getNumRows(),maxLinesPerPage:t,pageChanged:e=>this.setState({page:e}),currentPage:i})):null)}}var mt=n("./src/calc2/components/popover.tsx"),pt=n("./src/db/exec/RANode.ts");n("./src/calc2/components/raTree.scss");class gt extends o.Component{constructor(e){super(e)}render(){const{root:e,numTreeLabelColors:t=0,activeNode:n,setActiveNode:r}=this.props;let i=0;const a=new Map,s=e=>{const l=e instanceof pt.c||e instanceof pt.a?s(e.getChild()):null,u=e instanceof pt.a?s(e.getChild2()):null;let c="";if(e.hasMetaData("fromVariable")){const n=e.getMetaData("fromVariable");!1===a.has(n)&&a.set(n,i++);const r=a.get(n)%t;c=o.createElement("span",null," ",o.createElement("span",{className:`label label-info label-info-${r}`},n," =")," ")}return o.createElement("li",null,o.createElement("div",{className:nt({node:!0,active:e===n}),onClick:()=>r&&r(e)},o.createElement(mt.a,{title:o.createElement("div",null,c,o.createElement("div",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!0,!1)}})),body:()=>{e.check(),e.getResult();const t=e.getSchema(),n=e.getResultNumRows();return o.createElement("div",null,"columns:",o.createElement("ul",null,t.getColumns().map((e,n)=>o.createElement("li",{key:n},e.toString()," ",o.createElement("small",{className:"muted text-muted"},t.getType(n))))),e.hasMetaData("naturalJoinConditions")?o.createElement("div",null,"natural join conditions:",o.createElement("ul",null,e.getMetaData("naturalJoinConditions").map(e=>o.createElement("li",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml()}})))):null,o.createElement("p",null,`${n} row${1===n?"":"s"}`),!0===e.getMetaData("isInlineRelation")&&e.hasMetaData("inlineRelationDefinition")?o.createElement("pre",null,e.getMetaData("inlineRelationDefinition")):null)},placement:"right",trigger:"hover"},o.createElement("a",{className:"formula"},c,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!1,!1)}}),o.createElement("br",null),o.createElement("span",{className:"resultCountLabel"},`${e.getResultNumRows()} row${1===e.getResultNumRows()?"":"s"}`)))),l||u?o.createElement("ul",null,l,u):null)};return o.createElement("div",{className:"ra-tree"},o.createElement("div",{className:"tree"},o.createElement("ul",null,s(e))))}}var yt=n("./node_modules/memoize-one/dist/memoize-one.esm.js");n("./src/calc2/components/result.scss");class bt extends o.Component{constructor(e){super(e),this.result=Object(yt.a)(e=>{try{return e.check(),e.getResult()}catch(e){return console.error(e),null}}),this.state={activeNode:e.root,result:null},this.setActiveNode=this.setActiveNode.bind(this)}setActiveNode(e){this.setState({activeNode:e})}render(){const{root:e,numTreeLabelColors:t}=this.props,{activeNode:n}=this.state,r=this.result(n);return o.createElement("div",{className:"ra-result clearfix"},o.createElement("div",null,o.createElement(gt,{root:e,activeNode:n,numTreeLabelColors:t,setActiveNode:this.setActiveNode})),o.createElement("div",{className:"result"},o.createElement("div",null,o.createElement("h4",{className:"result-formula",dangerouslySetInnerHTML:{__html:n.getFormulaHtml(!0,!1)}}),o.createElement("div",{className:"result-table"},r?o.createElement(ft,{className:"table table-condensed",maxLinesPerPage:10,table:r,showPagination:!0}):null))))}}var vt=n("./src/db/relalg.ts");const _t=["pi","sigma","rho","tau","<-","intersect","union","/","-","\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","full outer join","left semi join","right semi join","anti join","and","or","xor","||"];class wt extends o.Component{constructor(e){super(e),this.editorBase=null,this.state={autoreplaceOperatorsMode:"none"},this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,{autoreplaceOperatorsMode:t}=this.state,n={};return e.tables.forEach(e=>{n[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",execFunction:(e,t,i)=>{const a=Object(vt.b)(t,Object.keys(n));if(Object(vt.j)(a,n),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.h)(a,n);return s.check(),e.historyAddEntry(t),e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(a),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"relalg",linterFunction:(e,o,i)=>{const a=[],s=Object(vt.b)(i,Object.keys(n));Object(vt.j)(s,n);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const l=Object(vt.h)(s,n);if(l.check(),!1===o.getDoc().somethingSelected()){const e=o.getDoc().getCursor(),{query:n,cursor:r}=Object(vt.f)(i,s.operatorPositions,{line:e.line+1,column:e.ch+1},t);n!==i&&(o.setValue(n),o.getDoc().setCursor({line:r.line-1,ch:r.column-1}))}return e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(s),a.concat(Object(tt.b)(l))},getHintsFunction:()=>[..._t,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!0,items:[{label:"π",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.projection",tooltip:"calc.editors.ra.toolbar.projection-content"},{label:"σ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.selection",tooltip:"calc.editors.ra.toolbar.selection-content"},{label:"ρ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename",tooltip:"calc.editors.ra.toolbar.rename-content"},{label:"←",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename-columns-operator",tooltip:"calc.editors.ra.toolbar.rename-columns-operator-content"},{label:"τ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.orderBy",tooltip:"calc.editors.ra.toolbar.orderBy-content"},{label:"γ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.groupBy",tooltip:"calc.editors.ra.toolbar.groupBy-content"}]},{math:!0,items:[{label:"∧",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.and",tooltip:"calc.editors.ra.toolbar.and-content"},{label:"∨",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.or",tooltip:"calc.editors.ra.toolbar.or-content"},{label:"¬",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not",tooltip:"calc.editors.ra.toolbar.not-content"},{label:"=",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.equals",tooltip:"calc.editors.ra.toolbar.equals-content"},{label:"≠",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not-equals",tooltip:"calc.editors.ra.toolbar.not-equals-content"},{label:"≥",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.greater-or-equals",tooltip:"calc.editors.ra.toolbar.greater-or-equals-content"},{label:"≤",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.lesser-or-equals",tooltip:"calc.editors.ra.toolbar.lesser-or-equals-content"}]},{math:!0,items:[{label:"∩",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.intersect",tooltip:"calc.editors.ra.toolbar.intersect-content"},{label:"∪",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.union",tooltip:"calc.editors.ra.toolbar.union-content"},{label:"÷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.division",tooltip:"calc.editors.ra.toolbar.division-content"},{label:"-",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.subtraction",tooltip:"calc.editors.ra.toolbar.subtraction-content"}]},{math:!0,items:[{label:"⨯",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.cross-join",tooltip:"calc.editors.ra.toolbar.cross-join-content"},{label:"⨝",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.natural-join",tooltip:"calc.editors.ra.toolbar.natural-join-content"},{label:"⟕",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-outer-join",tooltip:"calc.editors.ra.toolbar.left-outer-join-content"},{label:"⟖",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-outer-join",tooltip:"calc.editors.ra.toolbar.right-outer-join-content"},{label:"⟗",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.full-outer-join",tooltip:"calc.editors.ra.toolbar.full-outer-join-content"},{label:"⋉",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-semi-join",tooltip:"calc.editors.ra.toolbar.left-semi-join-content"},{label:"⋊",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-semi-join",tooltip:"calc.editors.ra.toolbar.right-semi-join-content"},{label:"▷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.anti-join",tooltip:"calc.editors.ra.toolbar.anti-join-content"}]},{math:!0,items:[{label:"=",onClick:e=>this.replaceText(e,"= "),tooltipTitle:"calc.editors.ra.toolbar.assignment",tooltip:"calc.editors.ra.toolbar.assignment-content"},{label:"--",onClick:e=>this.replaceText(e,"-- "),tooltipTitle:"calc.editors.ra.toolbar.single-line-comment",tooltip:"calc.editors.ra.toolbar.single-line-comment-content"},{label:"/*",onClick:e=>this.replaceText(e,"/* */"),tooltipTitle:"calc.editors.ra.toolbar.multi-line-comment",tooltip:"calc.editors.ra.toolbar.multi-line-comment-content"},{label:"{}",onClick:e=>this.replaceText(e,"{a:string, b:number, X.c:date\n\ta, 1, 1970-01-01\n}"),tooltipTitle:"calc.editors.ra.toolbar.inline-relation",tooltip:"calc.editors.ra.toolbar.inline-relation-content"}]},{items:[{label:o.createElement(et.a,{icon:Ze.q}),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.ra.toolbar.inline-relation-editor",tooltip:"calc.editors.ra.toolbar.inline-relation-editor-content"},{label:o.createElement(et.a,{icon:Ze.d}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.ra.toolbar.insert-date",tooltip:"calc.editors.ra.toolbar.insert-date-content"},{className:"showOnSM",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.m}),onClick:()=>{this.props.relInsertModalToggle()},tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{items:[{className:"dropdownToolbarButton",type:"dropdown",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.l}),tooltipTitle:"calc.editors.ra.toolbar.autoreplace-operators.title",tooltip:"calc.editors.ra.toolbar.autoreplace-operators.header",elements:[{type:"header",label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.header"})},{type:"separator"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.none"}),value:"none"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.plain2math"}),value:"plain2math"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.math2plain"}),value:"math2plain"}],value:t,onChange:e=>{this.setState({autoreplaceOperatorsMode:e},()=>{this.editorBase&&this.editorBase.forceLinterRun()})}}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}var Et=n("./src/calc2/utils/groupUtils.ts"),jt=n("./node_modules/reactstrap/lib/Button.js"),Ct=n.n(jt);class St extends o.Component{constructor(e){super(e),this.editorBase=null,this.autoParsingTimeout=null,this.replaceSelection=this.replaceSelection.bind(this)}static generateInfo(e){return{groupInfo:{source:"local",id:"draft",filename:"draft",index:0,maintainer:"",maintainerGroup:""},sourceInfo:{}}}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",disableHistory:!0,execButtonLabel:"calc.editors.group.button-exec",execFunction:(e,t,n)=>{const i=Object(vt.c)(t),{groupInfo:a,sourceInfo:s}=St.generateInfo(i),l=Object(Et.a)(i,a,s),u=o.createElement(o.Fragment,null,l.map((e,t)=>o.createElement("div",{key:t},o.createElement("h4",null,e.groupName.fallback," ",o.createElement(Ct.a,{color:"link",onClick:()=>{this.props.setDraft(e)}},o.createElement(r.b,{id:"calc.editors.group.button-use"}))),o.createElement("ul",{className:"table-list"},e.tables.map((e,n)=>{const r=l[t].tables[n].relation.getResult().getHtml();return o.createElement("li",{key:n},o.createElement("h5",null,e.tableName),o.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))})))));return i.groups.forEach(t=>{e.addInlineRelationMarkers(t)}),{result:u}},tab:"group",linterFunction:(e,t,n)=>{const r=Object(vt.c)(n);r.groups.forEach(t=>{e.addInlineRelationMarkers(t)});const{groupInfo:o,sourceInfo:i}=St.generateInfo(r);return Object(Et.a)(r,o,i),[]},getHintsFunction:()=>[..._t,"group","group@de","group@en","group@es","description","description@de","description@en","description@es","category","category@de","category@en","category@es",...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:o.createElement("span",null,o.createElement(et.a,{icon:Ze.q})," ",o.createElement(r.b,{id:"calc.editors.group.toolbar.add-new-relation"})),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.group.toolbar.add-new-relation",tooltip:"calc.editors.group.toolbar.add-new-relation-content"}]}]})}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}const Ot=["distinct","select distinct","from","where","order by","asc","desc","inner join","inner","join","natural","union","intersect","outer join","natural join","left join","right join","left outer join","right outer join","full outer join","group by","having","limit","offset","and","or","xor","||"];class kt extends o.Component{constructor(e){super(e),this.editorBase=null,this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"text/x-mysql",execFunction:(e,n,i)=>{const a=Object(vt.e)(n);if(Object(vt.j)(a,t),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),e.historyAddEntry(n),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"sql",linterFunction:(e,n,o)=>{const i=[],a=Object(vt.e)(o);Object(vt.j)(a,t);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),i.concat(Object(tt.b)(s))},getHintsFunction:()=>[...Ot,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:"select",tooltipTitle:"calc.editors.sql.toolbar.select",tooltip:"calc.editors.sql.toolbar.select",onClick:e=>this.replaceText(e,"select distinct")},{label:"from",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.from",tooltip:"calc.editors.sql.toolbar.from"},{label:"where",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.where",tooltip:"calc.editors.sql.toolbar.where"},{label:"group",tooltipTitle:"calc.editors.sql.toolbar.group-by",tooltip:"calc.editors.sql.toolbar.group-by",onClick:e=>this.replaceText(e,"group by")},{label:"having",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.having",tooltip:"calc.editors.sql.toolbar.having"},{label:"order",tooltipTitle:"calc.editors.sql.toolbar.order-by",tooltip:"calc.editors.sql.toolbar.order-by",onClick:e=>this.replaceText(e,"order by")},{label:"limit",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.limit",tooltip:"calc.editors.sql.toolbar.limit"},{label:o.createElement(et.a,{className:"showOnSM",icon:Ze.i}),onClick:e=>this.props.relInsertModalToggle,tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{math:!0,items:[{label:o.createElement("i",{className:"fa fa-calendar"}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.sql.toolbar.insert-date",tooltip:"calc.editors.sql.toolbar.insert-date-content"}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}function Tt(e,t){return e[t]?e[t]:e.fallback}var Mt=n("./node_modules/react-toastify/esm/react-toastify.js"),xt=(n("./node_modules/react-toastify/dist/ReactToastify.css"),{tabs:s.a.bool,pills:s.a.bool,vertical:s.a.oneOfType([s.a.bool,s.a.string]),horizontal:s.a.string,justified:s.a.bool,fill:s.a.bool,navbar:s.a.bool,card:s.a.bool,tag:ot.o,className:s.a.string,cssModule:s.a.object}),Lt=function(e){var t=e.className,n=e.cssModule,r=e.tabs,o=e.pills,a=e.vertical,s=e.horizontal,l=e.justified,u=e.fill,c=e.navbar,d=e.card,h=e.tag,f=Object(p.a)(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),g=Object(ot.k)(rt()(t,c?"navbar-nav":"nav",!!s&&"justify-content-"+s,function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")}(a),{"nav-tabs":r,"card-header-tabs":d&&r,"nav-pills":o,"card-header-pills":d&&o,"nav-justified":l,"nav-fill":u}),n);return i.a.createElement(h,Object(m.a)({},f,{className:g}))};Lt.propTypes=xt,Lt.defaultProps={tag:"ul",vertical:!1};var Rt=Lt,At=n("./node_modules/@babel/runtime/helpers/esm/objectSpread.js"),Dt=n("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),Nt=n("./node_modules/react-popper/lib/esm/Manager.js"),Pt=i.a.createContext({}),It={a11y:s.a.bool,disabled:s.a.bool,direction:s.a.oneOf(["up","down","left","right"]),group:s.a.bool,isOpen:s.a.bool,nav:s.a.bool,active:s.a.bool,addonType:s.a.oneOfType([s.a.bool,s.a.oneOf(["prepend","append"])]),size:s.a.string,tag:ot.o,toggle:s.a.func,children:s.a.node,className:s.a.string,cssModule:s.a.object,inNavbar:s.a.bool,setActiveFromChild:s.a.bool},Ht=[ot.j.space,ot.j.enter,ot.j.up,ot.j.down,ot.j.end,ot.j.home],Yt=function(e){function t(t){var n;return(n=e.call(this,t)||this).addEvents=n.addEvents.bind(Object(Dt.a)(n)),n.handleDocumentClick=n.handleDocumentClick.bind(Object(Dt.a)(n)),n.handleKeyDown=n.handleKeyDown.bind(Object(Dt.a)(n)),n.removeEvents=n.removeEvents.bind(Object(Dt.a)(n)),n.toggle=n.toggle.bind(Object(Dt.a)(n)),n.containerRef=i.a.createRef(),n}Object(G.a)(t,e);var n=t.prototype;return n.getContextValue=function(){return{toggle:this.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar,disabled:this.props.disabled}},n.componentDidMount=function(){this.handleProps()},n.componentDidUpdate=function(e){this.props.isOpen!==e.isOpen&&this.handleProps()},n.componentWillUnmount=function(){this.removeEvents()},n.getContainer=function(){return this.containerRef.current},n.getMenuCtrl=function(){return this._$menuCtrl||(this._$menuCtrl=this.getContainer().querySelector("[aria-expanded]")),this._$menuCtrl},n.getMenuItems=function(){return[].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'))},n.addEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.addEventListener(t,e.handleDocumentClick,!0)}))},n.removeEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)}))},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===ot.j.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==ot.j.tab)&&this.toggle(e)}},n.handleKeyDown=function(e){var t=this;if(!/input|textarea/i.test(e.target.tagName)&&(ot.j.tab!==e.which||"menuitem"===e.target.getAttribute("role")&&this.props.a11y)&&((-1!==Ht.indexOf(e.which)||e.which>=48&&e.which<=90)&&e.preventDefault(),!this.props.disabled&&(this.getMenuCtrl()===e.target&&(!this.props.isOpen&&[ot.j.space,ot.j.enter,ot.j.up,ot.j.down].indexOf(e.which)>-1?(this.toggle(e),setTimeout((function(){return t.getMenuItems()[0].focus()}))):this.props.isOpen&&e.which===ot.j.esc&&this.toggle(e)),this.props.isOpen&&"menuitem"===e.target.getAttribute("role"))))if([ot.j.tab,ot.j.esc].indexOf(e.which)>-1)this.toggle(e),this.getMenuCtrl().focus();else if([ot.j.space,ot.j.enter].indexOf(e.which)>-1)e.target.click(),this.getMenuCtrl().focus();else if([ot.j.down,ot.j.up].indexOf(e.which)>-1||[ot.j.n,ot.j.p].indexOf(e.which)>-1&&e.ctrlKey){var n=this.getMenuItems(),r=n.indexOf(e.target);ot.j.up===e.which||ot.j.p===e.which&&e.ctrlKey?r=0!==r?r-1:n.length-1:(ot.j.down===e.which||ot.j.n===e.which&&e.ctrlKey)&&(r=r===n.length-1?0:r+1),n[r].focus()}else if(ot.j.end===e.which){var o=this.getMenuItems();o[o.length-1].focus()}else if(ot.j.home===e.which){this.getMenuItems()[0].focus()}else if(e.which>=48&&e.which<=90)for(var i=this.getMenuItems(),a=String.fromCharCode(e.which).toLowerCase(),s=0;s-1?"menuitem":void 0,n=Object(ot.l)(this.props,["toggle"]),r=n.className,o=n.cssModule,a=n.divider,s=n.tag,l=n.header,u=n.active,c=Object(p.a)(n,["className","cssModule","divider","tag","header","active"]),d=Object(ot.k)(rt()(r,{disabled:c.disabled,"dropdown-item":!a&&!l,active:u,"dropdown-header":l,"dropdown-divider":a}),o);return"button"===s&&(l?s="h6":a?s="div":c.href&&(s="a")),i.a.createElement(s,Object(m.a)({type:"button"===s&&(c.onClick||this.props.toggle)?"button":void 0},c,{tabIndex:e,role:t,className:d,onClick:this.onClick}))},t}(i.a.Component);tn.propTypes=en,tn.defaultProps={tag:"button",toggle:!0},tn.contextType=Pt;var nn=tn,rn={tag:ot.o,active:s.a.bool,className:s.a.string,cssModule:s.a.object},on=function(e){var t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=Object(p.a)(e,["className","cssModule","active","tag"]),s=Object(ot.k)(rt()(t,"nav-item",!!r&&"active"),n);return i.a.createElement(o,Object(m.a)({},a,{className:s}))};on.propTypes=rn,on.defaultProps={tag:"li"};var an=on,sn={tag:ot.o,innerRef:s.a.oneOfType([s.a.object,s.a.func,s.a.string]),disabled:s.a.bool,active:s.a.bool,className:s.a.string,cssModule:s.a.object,onClick:s.a.func,href:s.a.any},ln=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(Dt.a)(n)),n}Object(G.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():("#"===this.props.href&&e.preventDefault(),this.props.onClick&&this.props.onClick(e))},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=e.innerRef,s=Object(p.a)(e,["className","cssModule","active","tag","innerRef"]),l=Object(ot.k)(rt()(t,"nav-link",{disabled:s.disabled,active:r}),n);return i.a.createElement(o,Object(m.a)({},s,{ref:a,onClick:this.onClick,className:l}))},t}(i.a.Component);ln.propTypes=sn,ln.defaultProps={tag:"a"};var un=ln,cn=n("./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js"),dn=i.a.createContext({}),hn={tag:ot.o,activeTab:s.a.any,className:s.a.string,cssModule:s.a.object},fn=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={activeTab:n.props.activeTab},n}return Object(G.a)(t,e),t.getDerivedStateFromProps=function(e,t){return t.activeTab!==e.activeTab?{activeTab:e.activeTab}:null},t.prototype.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.tag,o=Object(ot.l)(this.props,Object.keys(hn)),a=Object(ot.k)(rt()("tab-content",t),n);return i.a.createElement(dn.Provider,{value:{activeTabId:this.state.activeTab}},i.a.createElement(r,Object(m.a)({},o,{className:a})))},t}(o.Component);Object(cn.polyfill)(fn);var mn=fn;fn.propTypes=hn,fn.defaultProps={tag:"div"};var pn={tag:ot.o,className:s.a.string,cssModule:s.a.object,tabId:s.a.any};function gn(e){var t=e.className,n=e.cssModule,r=e.tabId,o=e.tag,a=Object(p.a)(e,["className","cssModule","tabId","tag"]),s=function(e){return Object(ot.k)(rt()("tab-pane",t,{active:r===e}),n)};return i.a.createElement(dn.Consumer,null,(function(e){var t=e.activeTabId;return i.a.createElement(o,Object(m.a)({},a,{className:s(t)}))}))}gn.propTypes=pn,gn.defaultProps={tag:"div"};var yn=n("./node_modules/reactstrap/es/Modal.js"),bn=n("./node_modules/reactstrap/es/ModalHeader.js"),vn=n("./node_modules/reactstrap/es/ModalBody.js"),_n=n("./node_modules/reactstrap/es/ModalFooter.js");n("./src/calc2/components/groupRelationList.scss");const wn=({tables:e,replace:t,onElementClick:n})=>o.createElement("div",{className:"groupRelationList"},o.createElement("ul",null,e.map(e=>{const{columnNames:r,columnTypes:i,tableName:a}=e;return o.createElement("li",{key:a},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(a),n&&n()}},a),o.createElement("ul",null,e.columnNames.map((e,r)=>o.createElement("li",{key:e},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(e),n&&n()}},e," ",o.createElement("small",{className:"muted text-muted"},i[r]))," "))))})));var En=n("./node_modules/immutable/dist/immutable.es.js");class jn extends o.Component{constructor(e){super(e),this.getGroupsByHeadlineName=Object(yt.a)((e,t)=>{let n=En.b();const o=e=>Tt(e,t);for(const t of e.values()){let e=null;!0===t.isDraft?e=r.c.t("calc.maintainer-groups.temp"):t.category&&(e=o({lang:"",fallback:t.groupInfo.maintainerGroup}));const i=[...n.get(e)||[],t];i.sort((e,t)=>o(e.groupName).localeCompare(o(t.groupName))),n=n.set(e,i)}return n}),this.gistLink=""}render(){const{current:e,locale:t}=this.props,n=this.getGroupsByHeadlineName(this.props.groups,t);return o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-6"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.headline"})),o.createElement("ul",{id:"groups-selector-list"},n.map((n,i)=>o.createElement("li",{key:`${i}`},i||o.createElement(r.b,{id:"calc.maintainer-groups.misc"}),o.createElement("ul",null,n.map((n,r)=>{const{groupName:i,groupInfo:a}=n,s=`/relax/calc/${a.source}/${a.id}/${a.filename}/${a.index}`;return o.createElement("li",{key:s,className:nt({active:e&&e.group.groupInfo===n.groupInfo})},o.createElement(Qe,{to:s,onClick:()=>{this.props.datasetLoaded()}},Tt(i,t)))})))).valueSeq().toArray())),o.createElement("div",{className:"col-md-6 align-text-top align-top"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.load-gist-headline"})),o.createElement("input",{type:"text",className:"form-control gist-load-input",placeholder:"","data-i18n":"[placeholder]calc.menu.load-gist-insert-placeholder",size:32,onChange:e=>{this.gistLink="/relax/calc/gist/"+e.target.value}}),o.createElement("button",{onClick:()=>{document.location.href=this.gistLink,this.props.datasetLoaded()},type:"button",className:"fullWidthBtn btn btn-secondary gist-load-btn"},o.createElement(r.b,{id:"calc.menu.load-gist-button"})),o.createElement("hr",null),o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-headline"})),o.createElement("p",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-text"})," ",o.createElement(Xe,{to:"/help#tutorial-maintainer"},o.createElement(r.b,{id:"calc.menu.create-own-dataset-text-link"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-new-btn",onClick:()=>{this.props.loadGroupTab(!1)}},o.createElement("i",{className:"fa fa-plus-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-new"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-current-btn",onClick:()=>{this.props.loadGroupTab(!0)}},o.createElement("i",{className:"fa fa-pencil-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-modify"}))))))}}const Cn=z(e=>({groups:e.groups.groups,current:e.groups.current,locale:e.session.locale}))(jn);var Sn={light:s.a.bool,dark:s.a.bool,full:s.a.bool,fixed:s.a.string,sticky:s.a.string,color:s.a.string,role:s.a.string,tag:ot.o,className:s.a.string,cssModule:s.a.object,expand:s.a.oneOfType([s.a.bool,s.a.string])},On=function(e){var t,n=e.expand,r=e.className,o=e.cssModule,a=e.light,s=e.dark,l=e.fixed,u=e.sticky,c=e.color,d=e.tag,h=Object(p.a)(e,["expand","className","cssModule","light","dark","fixed","sticky","color","tag"]),f=Object(ot.k)(rt()(r,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)}(n),((t={"navbar-light":a,"navbar-dark":s})["bg-"+c]=c,t["fixed-"+l]=l,t["sticky-"+u]=u,t)),o);return i.a.createElement(d,Object(m.a)({},h,{className:f}))};On.propTypes=Sn,On.defaultProps={tag:"nav",expand:!1};var kn=On,Tn={tag:ot.o,className:s.a.string,cssModule:s.a.object},Mn=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(p.a)(e,["className","cssModule","tag"]),a=Object(ot.k)(rt()(t,"navbar-brand"),n);return i.a.createElement(r,Object(m.a)({},o,{className:a}))};Mn.propTypes=Tn,Mn.defaultProps={tag:"a"};var xn=Mn,Ln=n("./node_modules/reactstrap/lib/NavLink.js"),Rn=n.n(Ln);class An extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"desktopNavbar"},o.createElement(xn,{href:"/"},"RelaX"),o.createElement(Rt,{className:"ml-auto",navbar:!0},o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," Calculator")),o.createElement(Bt,{nav:!0,inNavbar:!0,className:"navItemSpace"},o.createElement(Gt,{nav:!0,caret:!0},o.createElement(et.a,{icon:Ze.j})," ",o.createElement(r.b,{id:"calc.navigation.language"})),o.createElement(Zt,{right:!0},o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"),o.createElement(nn,{onClick:()=>this.changeLocale("pt")},"pt"))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.feedback"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.help"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})))))}}n("./src/calc2/components/calculator.scss");class Dn extends o.Component{constructor(e){super(e),this.refEditorRelalg=o.createRef(),this.refEditorSql=o.createRef(),this.refEditorGroup=o.createRef(),Mt.b.configure(),this.state={activeTab:"relalg",datasetModal:!1,relationModal:!1},this.getCurrentEditor=this.getCurrentEditor.bind(this),this.toggleDatasetModal=this.toggleDatasetModal.bind(this),this.insertRelationToggle=this.insertRelationToggle.bind(this),this.loadGroupEditor=this.loadGroupEditor.bind(this)}toggleDatasetModal(){this.setState({datasetModal:!this.state.datasetModal})}insertRelationToggle(){this.setState({relationModal:!this.state.relationModal})}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}getCurrentEditor(){switch(this.state.activeTab){case"sql":return this.refEditorSql;case"relalg":return this.refEditorRelalg;case"group":return this.refEditorGroup}}loadGroupEditor(e){let t="-- this is an example\ngroup: nameOfTheNewGroup \n\nA = {\na:string, b:number\nexample, 42\n}";!0===e&&(t=this.props.group.definition),this.setState({activeTab:"group"},()=>{const e=this.getCurrentEditor().current;e&&e.editorBase.state.editor.setValue(t),this.toggleDatasetModal()})}render(){const{group:e,locale:t}=this.props,{activeTab:n}=this.state;return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement("div",{className:"calculator"},o.createElement(Mt.a,{enableMultiContainer:!0,position:Mt.b.POSITION.TOP_RIGHT}),o.createElement("div",{className:"row"},o.createElement("div",{className:"d-none d-xs-block d-sm-block d-md-block col-lg-1 col-xl-2"}),o.createElement("div",{className:"groups-container col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"},o.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"dropdownMenu1",onClick:this.toggleDatasetModal,style:{width:"100%",textAlign:"left",textOverflow:"ellipsis",overflow:"hidden"}},o.createElement("span",null,"Select DB (",Tt(e.groupName,t),")"),o.createElement("span",{className:"caret",style:{display:"block",position:"absolute",top:"50%",right:"10px"}})),o.createElement("div",null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:null}))),o.createElement("div",{className:"calculator-container col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-6"},o.createElement(Rt,{tabs:!0},o.createElement(Bt,{nav:!0,inNavbar:!0,className:"showOnSM"},o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{onClick:this.toggleDatasetModal},o.createElement(et.a,{icon:Ze.g})," ",o.createElement(r.b,{id:"calc.menu.datasets"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(an,null,o.createElement(un,{className:nt({active:"relalg"===n}),onClick:()=>{this.setState({activeTab:"relalg"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"sql"===n}),onClick:()=>{this.setState({activeTab:"sql"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"group"===n}),onClick:()=>{this.setState({activeTab:"group"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name-short"}))))),o.createElement(mn,{activeTab:this.state.activeTab,className:"tab-content-border"},o.createElement(gn,{tabId:"relalg"},o.createElement(wt,{group:e,ref:this.refEditorRelalg,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"sql"},o.createElement(kt,{group:e,ref:this.refEditorSql,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"group"},o.createElement(St,{group:e,ref:this.refEditorGroup,setDraft:this.props.setDraft}))))),o.createElement(yn.a,{isOpen:this.state.datasetModal,toggle:this.toggleDatasetModal},o.createElement(bn.a,{toggle:this.toggleDatasetModal},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement("div",null,o.createElement(Cn,{datasetLoaded:()=>{this.setState({datasetModal:!1})},loadGroupTab:e=>{this.loadGroupEditor(e)}}))),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.toggleDatasetModal},Object(r.d)("calc.result.modal.close")))),o.createElement(yn.a,{isOpen:this.state.relationModal,toggle:this.insertRelationToggle},o.createElement(bn.a,{toggle:this.insertRelationToggle},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:this.insertRelationToggle})),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.insertRelationToggle},Object(r.d)("calc.result.modal.close"))))))}}class Nn extends o.Component{constructor(e){super(e),this.init=!1}componentDidUpdate(e){const{params:t}=this.props.match,{params:n}=e.match;!1!==this.init&&t.source===n.source&&t.id===n.id&&t.filename===n.filename&&t.index===n.index||(this.init=!0,this.loadGroup(this.props))}loadGroup(e){const{source:t,id:n,filename:r,index:o}=e.match.params;this.props.loadGroup(t,n,r,Number.parseInt(o,10),"","")}componentWillReceiveProps(e){const{params:t}=this.props.match,{params:n}=e.match;n.source!==t.source||n.id!==t.id||n.filename!==t.filename||(n.index,t.index)}render(){const{locale:e}=this.props,{current:t}=this.props.groups;return null!==t?o.createElement(Dn,{group:t.group,locale:e,setDraft:this.props.setDraft}):o.createElement("div",null,"loading ...")}}const Pn=z(e=>({groups:e.groups,locale:e.session.locale}),e=>({loadGroup:(t,n,r,o,i,a)=>{e({type:"GROUPS_LOAD_REQUEST",source:t,id:n,maintainer:i,maintainerGroup:a,setCurrent:{filename:r,index:o}})},setDraft:t=>{e({type:"GROUP_SET_DRAFT",draft:t})}}))(Nn);var In=n("./node_modules/jquery/dist/jquery.js"),Hn=n("./node_modules/railroad-diagrams/railroad-diagrams.js");n("./node_modules/railroad-diagrams/railroad-diagrams.css");class Yn extends o.Component{componentDidMount(){const e=q.findDOMNode(this);if(!e)throw new Error("could not find node");this.props.diagram.addTo(e)}shouldComponentUpdate(e){return this.props.diagram!==e.diagram}render(){return o.createElement("div",null)}}n("./src/calc2/views/help.css");class Fn extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"mobileNavbar"},o.createElement(Bt,null,o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(xn,{href:"/"},"RelaX"))}}class Wn extends o.Component{componentDidMount(){const e=In("#toc");let t=0,n=null,r=null,o=null;In("h2, h3, h4, h5, h6").each((function(){const i=In(this),a=i.attr("name")||i.attr("id")||"tocId"+t++;i.attr("name",a),i.attr("id",a);const s=''+i.text()+"";if(i.is("h2"))e.append(In(`
${s}
    `)),n=e.find("ul:last");else if(i.is("h3")){if(!n)throw new Error("malformed headings");n.append(In(`
  • ${s}
    • `)),r=n.find("ul:last")}else if(i.is("h4")){if(!r)throw new Error("malformed headings");r.append(In(`
    • ${s}
      • `)),o=r.find("ul:last")}else{if(!o)throw new Error("malformed headings");o.append(`
      • ${s}
      • `)}})),In("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((function(){In(this).append(` `)}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("h1",{id:"help"},"RelaX - Help"),o.createElement("div",{id:"toc"}),o.createElement("h2",{id:"tutorial-user"},"Tutorial - user"),o.createElement("h3",{id:"tutorial-user-coreconcepts"},"The core concepts"),o.createElement("p",null,"The goal of this tutorial is to give a quick introduction how to use the relational algebra calculator and its concepts. It assumes that you already know the relational algebra or are learning it from other sources."),o.createElement("p",null,"There is no real standard for the relational algebra like there is for SQL. So every book or teacher might have its slightly different interpretation and notation.",o.createElement("br",null),'The goal of this progam was to support the most commonly used "mathematical" notation used by ',o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),", ",o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/",lang:"de"},"Datenbanksysteme: Eine Einführung by Alfons Kemper and André Eickler")," and ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Relational_algebra"},"Wikipedia - Relational Algebra")," and others."),o.createElement("h4",{id:"tutorial-user-relations"},"relations"),o.createElement("p",null,"The core element of the calculator is the relation (or table) which consists of a fixed number of attributes (or columns) in a fixed order (this is called the schema of the relation) and a set of tuples or rows containing the specific values."),o.createElement("p",null,"Each attribute has three distinct properties: its type, its position and its name."),o.createElement("p",null,"The type or domain of an attribute is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean"),".",o.createElement("br",null),"The type is used for example to determine if two values can be compared in a boolean expression or if two schemas are union compatible. In most cases the type of the attributes are obvious if you look at the values."),o.createElement("p",null,"The position of each attribute in a schema is fixed and can be used to adress the attributes.",o.createElement("br",null),"An example would be the projection of the first and third attribute or column of an arbitrary relation R: ",o.createElement("code",{className:"example block"},"π [1], [3] ( R )")),o.createElement("p",null,"The full qualified name of the attribute is a unique identifier of the attribute within the schema of its relation. It consists of the name itself and a relation qualifier and are written like in SQL as ",o.createElement("code",null,"R.a"),"where a is the name and R is the relation qualifier.",o.createElement("br",null),"An example would be the projectoin of the attributes a, b from a relation R: ",o.createElement("code",{className:"example block"},"π R.a, R.b ( R )"),o.createElement("br",null),"The default relation qualifier of each attribute is the name of its relation.",o.createElement("br",null),"If the attributes name without the qualifier is unique within the relation's schema, it also can be used to address a specific attribute.",o.createElement("br",null),"The previous example could also be written as ",o.createElement("code",null,"π a, b ( R )"),"."),o.createElement("p",null,"Each relation has a set of tuples (or rows). This means that there are no duplicate tuples within one relation and the duplicate-elimination is implicitly executed after every single step of the calculation.",o.createElement("br",null),"The tuples in the calculator have a defined order and unlike a normal database system all operations are implemented to preserve that order. This should help the users to see what has changed from one step to the next."),o.createElement("p",null,"so far we covered that"),o.createElement("ul",null,o.createElement("li",null,"relations are the core elements,"),o.createElement("li",null,"relations have a schema and a set of tuples,"),o.createElement("li",null,"each attribute in the schema has",o.createElement("ul",null,o.createElement("li",null,"data-type"),o.createElement("li",null,"a position"),o.createElement("li",null,"a fully qualified name (RELATION.attributename)"))),o.createElement("li",null,"and that each attribute can be addressed within an operation using",o.createElement("ul",null,o.createElement("li",null,"its position e.g. ",o.createElement("code",{className:""},"π [1], [2] ( R )"),","),o.createElement("li",null,"the attribute name e.g. ",o.createElement("code",{className:""},"π a, b ( R )")),o.createElement("li",null,"or its full quallified name if the unqualified is not unique e.g. ",o.createElement("code",{className:""},"π R.a, S.a ( R x S )"))))),o.createElement("h3",{id:"tutorial-user-plain-text-notation"},"Alternative plain text notation"),o.createElement("p",null,"Before we introduce how to use the operators this should be a quick introduction of a very handy feature of the relational algebra calculator: the alternative plain text notation"),o.createElement("p",null,'The "classNameic" mathematical notation uses greek letters like π, σ for the unary operations and special symbols like the join symbol ',o.createElement("span",{className:"math"},"⋈")," or the union symbol ",o.createElement("span",{className:"math"},"∪"),"for some binary operations.",o.createElement("br",null),"This symbols can be entered using the toolbar at the top of the editor."),o.createElement("p",null,'This calculator also supports a alternative syntax for all this symbols that follows two very simple rules: Every greek letter can be substituted with its name spelled out ("pi" for π, "gamma" for γ) and every other symbol has an equivalent name that is borrowed from SQL, programming languages like C and ',o.createElement("a",{href:"http://en.wikipedia.org/wiki/Set_theory"},"Set theory"),"."),o.createElement("p",null,"This substitutions should be easy to read and much more important very easy to write because you don't need any toolbar or mouse. The calculator also supports autocomplete: just press [CTRL]+[SPACE] to complete the current keyword.",o.createElement("br",null),"This feature should help you to write your statements more quickly and fluently."),o.createElement("code",{className:"example block"},"π R.a, S.a, S.b σ R.a = S.a ∧ ( R.a > 5 ∨ R.a ","<"," 0 ) ( R ⨯ S )"),"is equivalent to:",o.createElement("code",{className:"example block"},"pi R.a, S.a, S.b sigma R.a = S.a and ( R.a > 5 or R.a ","<"," 0 ) ( R cross join S )"),"In the following table you can see a list of all supported substitutions:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"classNameical notation"),o.createElement("th",null,"alternative notation"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{className:"math"},"π"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("td",{className:"math"},"σ"),o.createElement("td",null,"sigma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"ρ"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("td",{className:"math"},"τ"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("td",{className:"math"},"γ"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∩"),o.createElement("td",null,"intersect")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∪"),o.createElement("td",null,"union")),o.createElement("tr",null,o.createElement("td",{className:"math"},"-"),o.createElement("td",null,"\\")),o.createElement("tr",null,o.createElement("td",{className:"math"},"÷"),o.createElement("td",null,"/")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⨯"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"x"),o.createElement("li",null,"cross join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋈"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"join"),o.createElement("li",null,"inner join"),o.createElement("li",null,"natural join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟕"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"left join"),o.createElement("li",null,"left outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟖"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"right join"),o.createElement("li",null,"right outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟗"),o.createElement("td",null,"full outer join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋉"),o.createElement("td",null,"left semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋊"),o.createElement("td",null,"right semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"▷"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"anti semi join"),o.createElement("li",null,"anti join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"←"),o.createElement("td",null,"<","-",o.createElement("code",{className:"example block"},"pi new_name ","<","- a ( R )"))),o.createElement("tr",null,o.createElement("td",{className:"math"},"→"),o.createElement("td",null,"->",o.createElement("code",{className:"example block"},"pi a -> new_name ( R )")))))),o.createElement("ul",null,o.createElement("li",null,"schema preserving operations - operations where the resulting relation has the same schema as its first argument-relation:",o.createElement("ul",null,o.createElement("li",null,"selection"),o.createElement("li",null,"union"),o.createElement("li",null,"intersection"),o.createElement("li",null,"subtraction"),o.createElement("li",null,"orderby"),o.createElement("li",null,"left outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"anti join")))),o.createElement("h3",{id:"tutorial-user-relalg"},"Relational algebra"),o.createElement("p",null,"For this Part we use the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset')," with 3 relations: ",o.createElement("i",null,"Customers"),", ",o.createElement("i",null,"Accounts")," and ",o.createElement("i",null,"PremiumCustomers"),". By convention relations start with a uppercase letter and attributes with a lower case letter."),o.createElement("h4",null,"Open and inspect dataset"),o.createElement("p",null,"Open the dataset used in this tutorial using the following link to the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset'),"."),o.createElement("p",null,"You find the relations and their attributes listed on the side and if you hover a relations name a preview of the first view tuples is displayed."),o.createElement("h4",{id:"tutorial-user-basic-query"},"The most basic query"),o.createElement("p",null,"After you have found the Dataset you can formulate the very first and most basic query in relational algebra: a relation without any further manipulation."),o.createElement("p",null,"Just enter the name of a relation into the code editor or click on the relation/attribute names to insert them into the code editor.",o.createElement("br",null),"Note that the editor supports auto completing the relation/attribute names of the current dataset and the operators with [CTRL]+[SPACE]"),o.createElement("p",null,"So if you want all tuples of the relation ",o.createElement("i",null,"Customer")," you should have the following statement: ",o.createElement("code",null,"Customer"),". And get all the tuples if you press the execute button or press [CTRL]+[RETURN]."),o.createElement("h4",{id:"tutorial-user-unary-operations"},"Unary operations"),o.createElement("p",null,"All unary operations have the same basic syntax ",o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")")),"."),o.createElement("p",{className:"hint"},"The braces around the ",o.createElement("code",null,"CHILD_EXPRESSION")," can be omitted. In this case the predefined ",o.createElement("a",{href:"#relalg-operator-precedence"},"operator precedence for relational algebra")," applies."),o.createElement("p",null,"A complete list of the supported relalg operations can be found here: ",o.createElement("a",{href:"#relalg-syntax"},"general syntax"),", ",o.createElement("a",{href:"#relalg-unary-operations"},"unary operations")," and ",o.createElement("a",{href:"#relalg-binary-operations"},"binary operations"),"."),o.createElement("p",null,"The projection is one of the basic operations that allow to choose which of the attributes of the parent relations should be included in the new one and in which order they should be."),o.createElement("p",null,"Renaming a relation (ρ) changes the qualifiers of all the relations attributes but does not touch the tuples."),o.createElement("p",null,"Renaming an attribute (ρ) only changes the name of a specific attribute (and leaves his relation-qualifier unchanged)."),o.createElement("p",null,"The statement ",o.createElement("code",null,"pi balance ( Accounts )")," returns a new relation with only the balance attribute."),o.createElement("p",null,"The next statement gets the balance with the account-id after renaming the relation to ",o.createElement("i",null,"A")," and renames one of the attributes."),o.createElement("code",{className:"example block"},"rho account_number ","<","- aid ( pi aid, A.balance ( rho A ( Accounts ) ) )"),o.createElement("p",{className:"hint"},"Like in SQL or most programming languages you can format your statement and use SQL like comments (with ",o.createElement("code",null,"-- ...")," or ",o.createElement("code",null,"/* ... */"),") to increase the readability."),o.createElement("p",null,"The next statement uses a selection to filter the tuples of a relation based on a boolean expression. The calculator supports complex boolean expression with functions and built in operator precedence.",o.createElement("br",null),"The attributes in the boolean expression can be given as name or numeric position like with the projection."),o.createElement("p",null,"The next statement selects all customers-ids of customers who have the same value for their firstname and lastname."),o.createElement("code",{className:"example block"},"-- this should return an relation with no tuples: pi cid ( sigma firstname=lastname ( Customers ) )"),o.createElement("p",null,"The next example uses a more complex expression to get all accounts with a balance over 100 or under -100."),o.createElement("code",{className:"example block"},"sigma balance > 100 or (balance*-1 > 100) ( Accounts ) -- (balance ","<"," -100) would also be correct"),o.createElement("p",null,"As a shorter alternative you can use a ",o.createElement("a",{href:"#relalg-valueexpr"},"function in your expression")," to get the same result:"),o.createElement("code",{className:"example block"},"sigma abs(balance) > 100 ( Accounts )"),o.createElement("h2",{id:"tutorial-maintainer"},"Tutorial - maintainer"),o.createElement("p",null,"Everybody can provide datasets that can be used in the relational algebra calculator and share them with others.",o.createElement("br",null),"We assume the scenario of a teacher wanting to provide a dataset for his/her students for this short tutorial."),o.createElement("p",null,"The datasets are specified in a simple text format and can be shared with others via ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gists")," (a simple and free platform to share snippets).",o.createElement("br",null),"The shared gist gets an unique ID and the relational algebra calculator can load the dataset directly using this ID."),o.createElement("h3",{id:"tutorial-maintainer-create-dataset"},"Creating a dataset"),o.createElement("p",null,"The fist step is the creation of the dataset which is actually only a group of relation definitions with some additional information and is therefore refered as group in the specified format.",o.createElement("br",null),"The relations can then be used by the students to formulate the there statements.",o.createElement("br",null),"Lets assume we want to create a dataset of employees of a company."),"Every group definition starts with a simple header which (at least) contains the name of the group:",o.createElement("code",{className:"example block"},"group: bank example"),"every header field starts with the name of the field and is followed by a colon for single line values. The next (optional) header field we should specify is the description. It should contain information like who is maintaining this dataset or where to find additional information.",o.createElement("br",null),"In the description ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Markdown"},"Markdown")," can be used to format the text or set links to external resources.",o.createElement("p",null,"In our example we add a description that takes more than a single line and therefore we enclose the value in double brackets instead of using the colon."),o.createElement("code",{className:"example block"},"group: bank example description[[ the data for this dataset was generated using ","<","http://www.generatedata.com/> * the relation _Customers_ contains basic information about the customers of the bank. The relation _Accounts_ contains the basic information of a single account. Note that a customer can have any number of accounts. * the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over 1000 ]]"),o.createElement("p",null,"The next step is to actually add the relations the students can use for their queries.",o.createElement("br",null),"The relation definitions are use the relational algebra syntax that can be used in this tool.",o.createElement("br",null),"Every relation is defined by a single variable assignment where the name of the variable is used as the relations name and the result of the expression defines the relation.",o.createElement("br",null),"The relalg expression can use all features that can be used in the tool and can also use other relations defined within the same dataset.",o.createElement("br",null),"Note that the name of the relation is used as the qualifier of each attribute/column."),o.createElement("p",null,"For the relation ",o.createElement("code",null,"Customers")," relation we use the ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation")," syntax as the most basic method to define the relation and can also be edited using the relation editor ",o.createElement("i",{className:"fa fa-table",title:"relation editor"})," which is a simple spread-sheet like editor. ",o.createElement("br",null),"The inline relations in combination with the editor should be very easy to use if you enter the data directly or if you have them as a csv/spread-sheet file."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\t\t\t\t"),o.createElement("p",null,"As we can see the name of the relations are defined by the assignments.",o.createElement("br",null),"The inline-relations are enclosed by curly braces and contain the names of the attributes/columns in the first line and then a tuple/row per line where the values are simply separated by whitespace. You can also other seperators and can define the types explicitly as we can see at the Accounts relation. For further information can be found at ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation description"),"."),o.createElement("p",null,"Note that, unlike the variables used in a query, the definition of a new relation implicitly sets the attribute qualifier to the name of the relation. So the schema of the account relation is ",o.createElement("code",null,"(Accounts.aid, Accounts.cid, Accounts.balance)"),". This allows each attribute to be accessible with this name."),o.createElement("p",null,"The last relation we need to add in this example is the relation containing the banks premium Customers.",o.createElement("br",null),"They are specified by using the other two relations in a simple relational algebra statement that selects all customers with a total balance over 1000."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\n\t\t\t\tPremiumCustomers =\n\t\t\t\t\tpi cid (\n\t\t\t\t\t\tsigma sum > 1000 (\n\t\t\t\t\t\t\tgamma cid; sum(balance)->sum (\n\t\t\t\t\t\t\t\tAccounts\n\t\t\t\t\t\t\t\tjoin Customers\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t"),o.createElement("p",null,"We have now seen how to define a dataset with its header containing the name and the description followed by relational algebra assignments defining the relations of the dataset."),o.createElement("p",null,"We can paste this definition directly in the ",o.createElement("i",null,"Group Editor")," to load and use it.",o.createElement("br",null),"In the next section we want to look at how we can publish this definition so that we give our students a single url or id to directly load the dataset."),o.createElement("h3",{id:"tutorial-maintainer-share-dataset"},"Share a dataset"),o.createElement("p",null,"If we want to share the definition of a dataset with other people we could simply give them the definition and they load it using the ",o.createElement("i",null,"group editor"),", but that would not be that practical for most cases."),o.createElement("p",null,"The simpler solution (for the users) is to publish the definition as a ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gist")," and share the ID of the gist with others."),o.createElement("p",null,"Just create a gist with the definition as its content (the filename does not matter) and publish it. The ID of the Gist can now be found at the top of the page as ",o.createElement("i",null,"gist:xxxxxxxxxxxx")," or in the url after the last slash."),o.createElement("p",null,"This ID can then be shared and loaded in the interface or the calculator can be called directly with a specific ID by using using the parameter ",o.createElement("code",null,"?data=gist:xxxxxxxxxxxxxx"),"."),o.createElement("p",null,"For example the simple bank definition of this tutorial has been published as a ",o.createElement("a",{href:"https://gist.github.com/ragtime/2cfb981fbc5676182d64"},"Gist with the ID 2cfb981fbc5676182d64")," and can therefore be loaded directly by appending ",o.createElement("code",null,"?data=gist:2cfb981fbc5676182d64"),"to the url of the calculator."),o.createElement("h2",{id:"relalg-reference"},"Reference - relational algebra"),o.createElement("h3",{id:"relalg-syntax"},"General syntax"),o.createElement("div",null,o.createElement("h4",{id:"relalg-assignment"},"assignment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"NAME")," ",o.createElement("strong",null,"=")," ",o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"Defines a new local variable with the name ",o.createElement("i",null,"NAME"),"; its content is defined by",o.createElement("i",null,"EXPRESSION")),o.createElement("p",null,"The name of the new relation must be unique."),o.createElement("p",null,"The definition has to be executed with the statement."),o.createElement("div",{className:"example"},o.createElement("code",null,"TestA = π a,b R TestB = σ d > 0 S -- statement using the variable TestA join TestB")),o.createElement("p",null,"An assignment (= definition of a variable) is no valid relational algebra expression on its own. If you miss the acutal query a error is thrown (",o.createElement("i",null,"Error: only assignments found; query is missing"),")."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- this is the definition of the variable Test = π Customer.firstname, surname ( Customer ) -- this is the actual query/statement using the variable Test")),o.createElement("p",null,"The defined variable can be used like the assigned expression could be used because every usage of the variable gets replaced with its definition before the query gets executed.",o.createElement("br",null),"This also means that the variable-name has no influence on the schema of the expression and the names of the attributes/columns are not affected by assignment:",o.createElement("code",{className:"block example"},"X = R X join S"),"The attributes of the relation R are only accessible with its original names (R.a, R.b, ..), and are not affected by the assignment."),o.createElement("p",null,"There is a known problem when the last assignment ends with a natural join and the query consists of a single relation:"),o.createElement("code",null,"A = S join R A -- this is the query"),o.createElement("p",null,"The statement is ambiguous and the parser interprets it as ",o.createElement("code",null,"A = (S join R A)"),"where R is interpreted as a column argument for the theta-join and therefore detects a cyclic usage of the variable A."),o.createElement("p",null,"Solution: To get the expected behaviour you have to set braces around the assigned expression like ",o.createElement("code",null,"A = (S join R) A")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-sl"},"single-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"-- "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"the '--' must be followed by at least one whitespace charater! inserts a comment; its text goes until the end of the line"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,"Test =",o.createElement("b",null,"-- This is the expression that is assigned to Test:"),"π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relation-name"},"pre defined relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"RELATION_NAME"))))))),o.createElement("div",null,o.createElement("p",null,"Uses a pre defined relation with the name ",o.createElement("i",null,"RELATION_NAME")),o.createElement("p",null,"The code completion only works for this relations."),o.createElement("div",{className:"example"},o.createElement("code",null,"( Customers ) cross join ( Accounts )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-ml"},"multi-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"/* "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("strong",null," */"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"inserts a comment that can span multiple lines"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,o.createElement("b",null,"/* This is a very very long comment */"),"Test = π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-inline-relation"},"inline-relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("b",null,"{"),o.createElement("i",null,"COLUMN_NAME_1"),":",o.createElement("i",null,"COLUMN_TYPE_1")," ...",o.createElement("i",null,"ROW_1"),o.createElement("i",null,"ROW_2"),"...",o.createElement("b",null,"}"))))))),o.createElement("div",null,o.createElement("p",null,"The inline-relation is a temporary relation that can be defined directly in the statement. It is only valid in the defining statement"),o.createElement("p",null,"Every inline-relation is a valid expression and thus can be used at any position a",o.createElement("i",null,"EXPRESSION")," is expected."),o.createElement("p",null,"The inline-relation is defined by a header, that specifies the schema of the relation and the rows containing the values and is surrounded by curly braces."),o.createElement("div",null,"The header is defined by a sequence of",o.createElement("code",null,o.createElement("i",null,"QUALIFIER.COLUMN_NAME"),":",o.createElement("i",null,"COLUMN_TYPE"))," ",o.createElement("b",null,"separated by any whitespace, comma or semicolon."),"The ",o.createElement("i",null,"QUALIFIER")," is optional. Also the ",o.createElement("i",null,"COLUMN_TYPE")," can be omitted if the type is well defined by the values of that column. The first non null value of a column defines its type.",o.createElement("br",null),"True and false (case insensitive without quotes) are reserved for a boolean type. They can be used as a simple string but they do not define the type of the column as string.",o.createElement("br",null),"The ",o.createElement("i",null,"COLUMN_TYPE")," can be one of the following",o.createElement("ul",null,o.createElement("li",null,"string"),o.createElement("li",null,"number"),o.createElement("li",null,"date"),o.createElement("li",null,"boolean")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("qualifier"),".")),Object(Hn.NonTerminal)("column-name"),Object(Hn.Optional)(Object(Hn.Sequence)(":",Object(Hn.Choice)(0,"string","number","date","boolean"))))}))),o.createElement("p",null,"The rows of the relation are defined by a list of values per row with the type of the corresponding column. The values are ",o.createElement("b",null,"separated by whitespace comma or semicolon."),o.createElement("br",null),"Simple strings only containing letters, numbers, hyphens, underlines, dots or periods ([0-9a-zA-Z\\-_\\.]+) can be written without single quotes. ",o.createElement("i",null,"NULL")," and ",o.createElement("i",null,"null")," are constant values. If null, true or false should be used as string they have te be quoted.",o.createElement("br",null),"More complex strings must be surrounded by single quotes: ",o.createElement("i",null,"'content'")," or ",o.createElement("i",null,"content"),"but '' or 'long content containing spaces and special characters like !' or 'null'.",o.createElement("br",null),"Dates are written in ISO-format: YYYY-MM-DD without single quotes",o.createElement("br",null),"A null-value can be written as ",o.createElement("i",null,"null")," or ",o.createElement("i",null,"NULL")," (without single quotes).",o.createElement("br",null),"Numbers could be integers in the form (-?[0-9]+) or floats in the form (-?[0-9]+\\.[0-9]+).",o.createElement("br",null),"Numbers in single quotes are recognized as numbers if the column type is defined as number or has been detected to be number from a previous value; otherwise it will be a string value..",o.createElement("br",null),"A boolean value is denoted as either ",o.createElement("i",null,"true")," or ",o.createElement("i",null,"false")," (case insensitive)."),o.createElement("p",null,"The header and rows can be indented if needed."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- type for column b is defined by the first value\n\t\t\t\trho A {\n\t\t\t\t\ta:number, b\n\t\t\t\t\t1, 2\n\t\t\t\t\t3, 4\n\t\t\t\t}\n\t\t\t\tcross join\n\t\t\t\t{\n\t\t\t\t\ta:string X.b:date c:number\n\t\t\t\t\tAlpha 1970-01-01 1\n\t\t\t\t\t'Beta 2' 1970-01-02 3\n\t\t\t\t\t'' 1970-01-03 4\n\t\t\t\t}")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relalgexpr"},"relational algebra expression"),o.createElement("div",null,o.createElement("p",null,"A valid relational algebra expression is built by connecting ",o.createElement("i",null,"relation-name")," or ",o.createElement("i",null,"inline-relation"),"as atoms with the defined unary and binary operators."),"So a relational algebra expression is recursively defined as follows:",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Choice)(0,Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),")"),Object(Hn.NonTerminal)("relation-name","#relalg-relation-name"),Object(Hn.NonTerminal)("inline-relation","#relalg-inline-relation"),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.NonTerminal)("projection","#relalg-operations-projection"),Object(Hn.NonTerminal)("selection","#relalg-operations-selection"),Object(Hn.NonTerminal)("rename relation","#relalg-operations-renamerelation"),Object(Hn.NonTerminal)("rename column","#relalg-operations-renamecolumn"),Object(Hn.NonTerminal)("order by","#relalg-operations-orderby"),Object(Hn.NonTerminal)("group by","#relalg-operations-groupby")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))),Object(Hn.Choice)(1,Object(Hn.Skip)(),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.NonTerminal)("intersection","#relalg-operations-intersection"),Object(Hn.NonTerminal)("union","#relalg-operations-union"),Object(Hn.NonTerminal)("division","#relalg-operations-division"),Object(Hn.NonTerminal)("subtraction","#relalg-operations-subtraction"),Object(Hn.NonTerminal)("cross product","#relalg-operations-crossjoin"),Object(Hn.NonTerminal)("θ-join","#relalg-operations-innerjoin"),Object(Hn.NonTerminal)("natural join","#relalg-operations-naturaljoin"),Object(Hn.NonTerminal)("left outer join","#relalg-operations-leftjoin"),Object(Hn.NonTerminal)("right outer join","#relalg-operations-rightjoin"),Object(Hn.NonTerminal)("full outer join","#relalg-operations-fulljoin"),Object(Hn.NonTerminal)("left semi join","#relalg-operations-leftsemijoin"),Object(Hn.NonTerminal)("right semi join","#relalg-operations-rightsemijoin"),Object(Hn.NonTerminal)("anti semi join","#relalg-operations-antijoin")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))))})))),o.createElement("h3",{id:"relalg-unary-operations"},"Unary operations"),"Each unary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-projection"},"projection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"π")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"pi a, b ( R )")))))),o.createElement("p",null,"The argument is a subset of columns of the schema of the ",o.createElement("i",null,"CHILD_EXPRESSION")," or a ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("div",{className:"example"},o.createElement("code",null,"π Customer.firstname, surname ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, [1] ( ρ c ( Customer ) )")),"Expressions can be used to create more complex statements using one or more columns of a single row.",o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, lower(username)->user, concat(firstname, concat(' ', lastname))->fullname ( ρ c ( Customer ) )")),"The virtual column ",o.createElement("i",null,"ROWNUM")," used in previous versions is not supported any more but the ",o.createElement("code",null,"rownum()")," expression can be used to get the same information. And it can also be used directly in the boolean condition of a selection or join.",o.createElement("div",{className:"example"},"In this example the top 5 customers with the most orders are selected, where countOrders could be the result of a previous aggregation.",o.createElement("code",null,"pi firstname, lastname sigma rownum() ","<","= 5 tau countOrders desc Customer")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"π","pi"),Object(Hn.OneOrMore)(Object(Hn.NonTerminal)("column","#relalg-column"),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-selection"},"selection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"σ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"sigma a > 2 ( R )")))))),o.createElement("p",null,"The argument is a ",o.createElement("a",{href:"#relalg-valueexpr"},"boolean expression")," that each row of ",o.createElement("i",null,"CHILD_EXPRESSION"),"is checked on"),o.createElement("div",{className:"example"},o.createElement("code",null,"σ firstname = 'Bob' or firstname = 'Alice' ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"σ (id > 10 and id ","<"," 100) or id = 42 ( Customer )")),o.createElement("div",{className:"example"},"Selecting all customers with a firstname that has an even length.",o.createElement("code",null,"σ mod(length(firstname),2) = 0 ( Customer )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"σ","sigma"),Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamerelation"},"rename relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"( R ) join R.a = X.b (rho X ( R ))")))))),o.createElement("div",null,"The argument is the new name for the Relation returned by ",o.createElement("i",null,"CHILD_EXPRESSION"),o.createElement("div",{className:"example"},'rename the Relation from "Customer" to "a":',o.createElement("code",null,"π a.id, a.firstname ( ρ a ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"ρ","rho"),Object(Hn.NonTerminal)("new relation name")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamecolumn"},"rename column"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,"the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("code",{className:"relalg block"},"pi x, b rho a->x {a, b\n\t\t\t\t\t\t1, 2\n\t\t\t\t\t\t3, 4\n\t\t\t\t\t}")))))),o.createElement("div",null,"The argument is the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("div",{className:"example"},"rename the columns id and firstname to myId and foobar:",o.createElement("code",null,"ρ myId←id, foobar←firstname (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"ρ","rho"),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("new name"),Object(Hn.Choice)(0,"←","<-"),Object(Hn.NonTerminal)("column","#relalg-column")),Object(Hn.Sequence)(Object(Hn.NonTerminal)("column","#relalg-column"),Object(Hn.Choice)(0,"→","->"),Object(Hn.NonTerminal)("new name"))),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-orderby"},"order by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"τ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"tau a asc, b desc ( R )")))))),o.createElement("div",null,"The argument is a list of columns by which the relation should be ordered (see examples)",o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"τ [1], firstname desc (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"τ","tau"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("column","#relalg-column"),Object(Hn.Choice)(0,Object(Hn.Skip)(),"asc","desc")),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-groupby"},"group by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"γ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"gamma a, count(*)->x ( R )")))))),o.createElement("div",null,"The argument is a list of columns to group by, separated by commas followed by a semicolon",o.createElement("br",null),"and a list of aggregate functions to apply with their new name in form ",o.createElement("span",null,"AGG( COLUMN ) -> NEW_NAME"),o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"γ a, b ; sum(c)->x ( Customer )")),o.createElement("p",null,"If no grouping columns are provided the entire relation is the group."),o.createElement("div",null,"supported aggregate functions by type:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("td",null," "),o.createElement("th",null,"number"),o.createElement("th",null,"string"),o.createElement("th",null,"date"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"COUNT( * )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"COUNT( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MIN( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MAX( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"SUM( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")),o.createElement("tr",null,o.createElement("th",null,"AVG( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")))))),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"γ","gamma"),Object(Hn.Sequence)(Object(Hn.ZeroOrMore)(Object(Hn.NonTerminal)("column","#relalg-column"),","),";",Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"COUNT(*)",Object(Hn.Sequence)(Object(Hn.Choice)(0,"COUNT","MIN","MAX","SUM","AVG"),"(",Object(Hn.NonTerminal)("column","#relalg-column"),")")),Object(Hn.Choice)(0,"→","->"),Object(Hn.NonTerminal)("new name")),","))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-binary-operations"},"Binary operations"),"Each binary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")")," ",o.createElement("strong",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-intersection"},"intersection - ∩"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∩")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"intersect"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∩ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"∩","intersect")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-union"},"union - ∪"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"union"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∪ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"∪","union")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-division"},"division"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"÷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"/"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ÷ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"÷","/")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-subtraction"},"subtraction / set-difference"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"-"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"\\",o.createElement("br",null),"except"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( pi firstname ( Customer ) ) - ( rho test","<","-lastname ( pi lastname ( Customer ) ) )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"-","\\","except")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-crossjoin"},"cross product"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⨯")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"cross join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⨯",Object(Hn.Sequence)("cross","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-innerjoin"},"Theta-join / θ-join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"inner join"))))),o.createElement("div",null,"join condition",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋈",Object(Hn.Sequence)(Object(Hn.Optional)("inner"),"join")),Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))}))),o.createElement("p",null,"Special case:",o.createElement("br",null),"The name of a single boolean column (like ",o.createElement("code",null,"R join a S"),") can not be used directly as a join condition due to ambiguities in the relational algebra syntax.",o.createElement("br",null),"The column must either be specified with its qualifier (",o.createElement("code",null,"R join R.a S"),") or wrapped in parentheses (",o.createElement("code",null,"R join (a) S"),").",o.createElement("br",null),"This is not necessary for more complex boolean expressions. The problem is only that the single column name can not be distinguished from a relation name: the expression ",o.createElement("code",null,"X=R join S X")," could be interpreted as ",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".")),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-naturaljoin"},"natural join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"natural join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",{className:"block"},"ρ a ( Customer )",o.createElement("span",{className:"math"},"⋈")," a.name ","<"," b.name ( ρ b ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋈",Object(Hn.Sequence)("natural","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftjoin"},"left outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟕")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left outer join",o.createElement("br",null),"left join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural left outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟕",Object(Hn.Sequence)("left",Object(Hn.Optional)("outer"),"join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightjoin"},"right outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟖")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right outer join",o.createElement("br",null),"right join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural right outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟖",Object(Hn.Sequence)("right",Object(Hn.Optional)("outer"),"join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-fulljoin"},"full outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟗")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"full outer join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural full outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟗",Object(Hn.Sequence)("full","outer","join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftsemijoin"},"left semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋉")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋉",Object(Hn.Sequence)("left","semi","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightsemijoin"},"right semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋊")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋊",Object(Hn.Sequence)("right","semi","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-antijoin"},"anti semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"▷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"anti semi join",o.createElement("br",null),"anti join"))))),o.createElement("div",null,"no argument",o.createElement("br",null),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"▷",Object(Hn.Sequence)("anti",Object(Hn.Optional)("semi"),"join")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-operator-precedence"},"Operator precedence"),o.createElement("p",null,"The operator precedence allows to obmit most of braces.",o.createElement("br",null),"The used precedence is shown in the table below.",o.createElement("br",null),"All operators are left associative."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operator"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,o.createElement("a",{href:"#relalg-relation-name"},"relation-name"),",",o.createElement("a",{href:"#relalg-inline-relation"},"inline-relation"))),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-projection"},"projection"),",",o.createElement("a",{href:"#relalg-operations-selection"},"selection"),",",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename (columns)"),",",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename (relations)"),",",o.createElement("a",{href:"#relalg-operations-groupby"},"group"),",",o.createElement("a",{href:"#relalg-operations-orderby"},"order by"))),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross product"),",",o.createElement("a",{href:"#relalg-operations-innerjoin"},"theta join"),",",o.createElement("a",{href:"#relalg-operations-naturaljoin"},"natural join"),",",o.createElement("a",{href:"#relalg-operations-leftjoin"},"left outer join"),",",o.createElement("a",{href:"#relalg-operations-rightjoin"},"right outer join"),",",o.createElement("a",{href:"#relalg-operations-fulljoin"},"full outer join"),",",o.createElement("a",{href:"#relalg-operations-leftsemijoin"},"left semi-join"),",",o.createElement("a",{href:"#relalg-operations-rightsemijoin"},"right semi-join"),",",o.createElement("a",{href:"#relalg-operations-antijoin"},"anti semi-join"),",",o.createElement("a",{href:"#relalg-operations-division"},"division"))),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-intersection"},"intersection"))),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-union"},"union"),",",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction")))))),o.createElement("div",{className:"example"},o.createElement("code",null,"A join B x C"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"((A join B) x C)"),o.createElement("br",null),"because the cross product and the natural join are in the same precedence className."),o.createElement("div",{className:"example"},o.createElement("code",null,"sigma true A join sigma true B"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"(sigma true (A)) join (sigma true (B))"),o.createElement("br",null),"because the unary operators have a higher precedence than the binary operators."),o.createElement("h3",{id:"relalg-misc"},"Misc"),o.createElement("h4",{id:"relalg-column"},"Column"),"column is either",o.createElement("ul",null,o.createElement("li",null,'the name of a column: "columnName"'),o.createElement("li",null,'the number of the column (starting with 1): "[column-number]"'),o.createElement("li",null,'a full qualified column: "qualifier.columnName"'),o.createElement("li",null,"a value expression (if allowed for the specific operation)")),"the qualifier is optional if the column is unique in its schema.",o.createElement("h4",{id:"relalg-valueexpr"},"Value expressions"),"With most operators you can use a value-expression which connects one or more columns of a single row to calculate a new value. This is possible for:",o.createElement("ul",null,o.createElement("li",null,"the projection creating a new column (make sure to give the column a name)"),o.createElement("li",null,"the selection any expression evaluating to boolean can be used"),o.createElement("li",null,"for the joins any expression evaluating to boolean can be used; note that the ",o.createElement("code",null,"rownum()")," expression always represents the index of the lefthand relation")),"The expressions always operate on a single row/tuple of a table/relation.",o.createElement("br",null),"If you want to calculate values vertically over all values of a specific column/attribute you need to use group by with an aggregate function. The following table lists all functions and operators that can be used in an expression. They can be combined and nested in any arbitrary order but note that they do evaluate to a single type defined by the outer most expression. The following operators can be used:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("th",null,"returns type"),o.createElement("th",null,"description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a AND b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical and")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a OR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a XOR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical exclusive or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"NOT b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical not")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a = b a != b a ","<"," b a > b a ","<","= b a >= b a != b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"compares two values of the same type")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string LIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"returns true if expression evaluating to a string ",o.createElement("code",null,"a")," matches the pattern given as the second operand.",o.createElement("br",null),"The pattern has to be given as a string literal;",o.createElement("p",null,"An underscore (",o.createElement("code",null,"_"),") in the pattern stands for any single character and any percent sign (",o.createElement("code",null,"%"),") stands for any sequence of zero or more characters."))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string ILIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"same as ",o.createElement("code",null,"LIKE")," but matches case-insensitive.",o.createElement("br",null),"This is not in the SQL standard but is a PostgreSQL extension.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a + b a - b a * b a / b a % b")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, subtraction, multiplication, division, modulo")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rand()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns a random number in the interval [0, 1]")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rownum()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the index of the current row (starting with 0).",o.createElement("br",null),"If the function is used in a binary relational algebra expression (e.g. a join) it always represents the index of the left operand.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"length(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the length of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"date(a:string)")),o.createElement("td",null,"date"),o.createElement("td",null,"parses the given string to a date object. The string must be in the form YYYY-MM-DD")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"adddate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"adds the given number of days to date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"subdate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"subtracts the given number of days from date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"now() transaction_timestamp() statement_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns a timestamp representing the start of the query execution",o.createElement("br",null),"transaction- and statement start are the very same value due to the lack of a transaction concept")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"clock_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns the current timestamp while executing the query")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"year(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the year component of a given date")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"month(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the month component of a given date as a number. (1 = Sunday, 2 = Monday, ..., 7 = Saturday)")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"day(a:date) dayofmonth(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the day component of a given date as a number in the range 1 to 31")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"hour(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the hour component of a given date as a number in the range 0 to 23")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"minute(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the minute component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"second(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the second component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"concat(a:string [, ...])")),o.createElement("td",null,"string"),o.createElement("td",null,"concatenates the given strings")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"upper(a:string) ucase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to upper-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"lower(a:string) lcase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to lower-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"strlen(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"number of characters of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"abs(a:number)")),o.createElement("td",null,"number"),o.createElement("td",null,"the absolute value of the given number")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"add(a, b) sub(a, b) mul(a, b) div(a, b) mod(a, b)")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, ",o.createElement("br",null),"subtraction, ",o.createElement("br",null),"multiplication, ",o.createElement("br",null),"division or ",o.createElement("br",null),"modulo of the given numbers")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"round(a) floor(a) ceil(a)")),o.createElement("td",null,"number"),o.createElement("td",null,"round to nearest integer, ",o.createElement("br",null),"largest integer not greater than the argument or",o.createElement("br",null),"smallest integer not less than the argument")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"coalesce(",o.createElement("strong",null,"value")," [, ...])")),o.createElement("td",null,"type of ",o.createElement("strong",null,"value")),o.createElement("td",null,"returns the first of its arguments that is not null or null if all arguments are null. Note that all arguments must have the same datatype.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"CASE WHEN ",o.createElement("strong",null,"condition")," THEN result [WHEN ...] [ELSE ",o.createElement("strong",null,"result"),"] END")),o.createElement("td",null,"type of ",o.createElement("strong",null,"result")),o.createElement("td",null,"returns the first result where the condition evaluates to true. If all conditions are false the else part is executed or null is returnt if the else part is missing. Note that all results must have the same datatype."))))),"The operator precedence is the same as used in ",o.createElement("a",{href:"https://dev.mysql.com/doc/refman/5.7/en/operator-precedence.html"},"MySQL")," (from strong to weak):",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operators"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,"functions, constants, columns")),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,"! (boolean not)")),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,"- (unary minus)")),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,"*, /, %")),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,"-, +")),o.createElement("tr",null,o.createElement("td",null,"5"),o.createElement("td",null,"= (comparison), >=, >, ","<","=, ","<",", ","<",">, !=, LIKE, ILIKE")),o.createElement("tr",null,o.createElement("td",null,"6"),o.createElement("td",null,"CASE, WHEN, THEN, ELSE")),o.createElement("tr",null,o.createElement("td",null,"7"),o.createElement("td",null,"AND")),o.createElement("tr",null,o.createElement("td",null,"8"),o.createElement("td",null,"XOR")),o.createElement("tr",null,o.createElement("td",null,"9"),o.createElement("td",null,"OR, ||"))))),o.createElement("h2",{id:"sql-reference"},"Reference - SQL"),o.createElement("p",null,"The goal of the SQL mode of the relational algebra calculator is to provide a translation from SQL to relational algebra to show how they are related. It does not support all features a real database system like ",o.createElement("a",{href:"http://www.postgresql.org",target:"_blank"},"PostgreSQL")," or ",o.createElement("a",{href:"https://www.mysql.com/",target:"_blank"},"MySQL"),' does because the goal is to provide a translation into relational algebra. This means that many features like correlated-substatements are not supported because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h3",{id:"sql-syntax"},"General syntax"),o.createElement("p",null,"All keywords are case insensitv."),o.createElement("p",null,"The following Synopsis is a adapted version of ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html",target:"_blank"},"PostgreSQL")," and shows the general syntax of the supported SQL. Brackets indicate optional parts. Braces and vertical lines indicate that one of the alternatives has to be chosen. Dots mean that the preceding element can be repeated."),o.createElement("code",{className:"block sql"},"[ ",o.createElement("a",{href:"#sql-with"},"WITH")," ",o.createElement("strong",null,"with_query")," [, ...] ]",o.createElement("a",{href:"#sql-select"},"SELECT")," [ DISTINCT ] * | ",o.createElement("strong",null,"expression")," [ [ AS ] ",o.createElement("strong",null,"output_name")," ] [, ...]",o.createElement("a",{href:"#sql-from"},"FROM")," ",o.createElement("strong",null,"from_item")," [, ...] [ ",o.createElement("a",{href:"#sql-where"},"WHERE")," ",o.createElement("strong",null,"condition")," ] [ ",o.createElement("a",{href:"#sql-groupby"},"GROUP BY")," ",o.createElement("strong",null,"column")," [, ...] ] [ ",o.createElement("a",{href:"#sql-having"},"HAVING")," ",o.createElement("strong",null,"condition")," ] [ ","{"," ",o.createElement("a",{href:"#sql-setoperators"},"UNION")," | ",o.createElement("a",{href:"#sql-setoperators"},"INTERSECT")," | ",o.createElement("a",{href:"#sql-setoperators"},"EXCEPT")," } [ ALL | DISTINCT ] ",o.createElement("strong",null,"select")," ] [ ",o.createElement("a",{href:"#sql-orderby"},"ORDER BY")," ",o.createElement("strong",null,"column")," [ ASC | DESC ] [, ...] ] [ ",o.createElement("a",{href:"#sql-limit"},"LIMIT")," ","{"," ",o.createElement("strong",null,"count")," | ALL } ] [ ",o.createElement("a",{href:"#sql-limit"},"OFFSET")," ",o.createElement("strong",null,"start")," [ ROW | ROWS ] ] [ ",o.createElement("a",{href:"#sql-limit"},"FETCH")," ","{"," FIRST | NEXT } [ ",o.createElement("strong",null,"count")," ] ","{"," ROW | ROWS } ONLY ] where ",o.createElement("strong",null,"from_item")," can be one of:",o.createElement("strong",null,"table_name")," [ AS ",o.createElement("strong",null,"alias")," ]",o.createElement("strong",null,"with_query_name")," [ AS ",o.createElement("strong",null,"alias")," ] ( ",o.createElement("strong",null,"select")," ) AS ",o.createElement("strong",null,"alias"),o.createElement("strong",null,"from_item")," CROSS JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," NATURAL JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," ON join_condition",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," NATURAL",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," USING ( join_column [, ...] )",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN ON join_condition",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN NATURAL ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN USING ( join_column [, ...] ) ",o.createElement("strong",null,"from_item"),"and ",o.createElement("strong",null,"with_query")," is:",o.createElement("strong",null,"with_query_name")," AS ( ",o.createElement("strong",null,"select")," )"),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("WITH","#sql-with"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("name"),"AS","(",Object(Hn.NonTerminal)("select","#sql-select"),")"),",")),"skip"),Object(Hn.Sequence)(Object(Hn.Terminal)("SELECT","#sql-select"),Object(Hn.Optional)("DISTINCT","skip"),Object(Hn.Choice)(0,"*",Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("column"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("output_name")))),Object(Hn.Sequence)(Object(Hn.NonTerminal)("expression","#sql-valueexpr"),Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("output_name")))),",")),Object(Hn.Terminal)("FROM","#sql-from"),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("table_name"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("select"),")",Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),",")),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Skip)(),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.Sequence)(",",Object(Hn.Comment)("old syntax for cross join")),Object(Hn.Sequence)(Object(Hn.Choice)(0,"CROSS","NATURAL"),"JOIN"),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.Optional)("INNER"),"JOIN"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"LEFT","RIGHT","FULL"),Object(Hn.Optional)("OUTER"),"JOIN")),Object(Hn.Choice)(0,Object(Hn.Sequence)("ON",Object(Hn.NonTerminal)("condition")),Object(Hn.Sequence)("USING","(",Object(Hn.OneOrMore)(Object(Hn.NonTerminal)("join_column"),","),")"),Object(Hn.Sequence)("NATURAL")))),Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("table_name"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("select"),")",Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias"))))))),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("WHERE","#sql-where"),Object(Hn.NonTerminal)("condition")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("GROUP BY","#sql-groupby"),Object(Hn.NonTerminal)("expression","#sql-valueexpr")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("HAVING","#sql-having"),Object(Hn.NonTerminal)("condition")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"UNION","INTERSECT","EXCEPT"),Object(Hn.Choice)(0,Object(Hn.Skip)(),"DISTINCT","ALL"),Object(Hn.NonTerminal)("select")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("ORDER BY","#sql-orderby"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("expression","#sql-valueexpr"),Object(Hn.Choice)(0,"ASC","DESC")),",")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("LIMIT","#sql-limit"),Object(Hn.Choice)(0,Object(Hn.NonTerminal)("count"),"ALL")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("OFFSET","#sql-limit"),Object(Hn.NonTerminal)("start"),Object(Hn.Optional)("ROWS")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("FETCH FIRST","#sql-limit"),Object(Hn.NonTerminal)("count"),Object(Hn.Optional)("ROWS"),"ONLY"),"skip"))))})),o.createElement("h3",{id:"sql-translation"},"Semantic and Translation to relational algebra"),o.createElement("h4",{id:"sql-translation-sequence"},"Sequence of execution"),o.createElement("p",null,'The SQL statement is translated directly into relational algebra. To understand some of the effects of the tool it might be helpful to understand the steps of the translation process. As mentioned before, real database systems might take a different (more complex) aproach but this should help to get an idea of how SQL could be translated into "classNameical" relational algebra.'),o.createElement("p",null,"The following list shows the translation from SQL into relational algebra starting with the inner most relational algebra expression at the top."),o.createElement("ol",null,o.createElement("li",null,"replace all usages of the temporary-tables defined in the WITH-clause with their definitions"),o.createElement("li",null,"FROM-clause is translated left associative with all joins having the same precedence (",o.createElement("code",null,","),"is a cross join)"),o.createElement("li",null,"selection with condition from where-clause is added"),o.createElement("li",null,"group by"),o.createElement("li",null,"selection with condition from having-clause"),o.createElement("li",null,"union/intersect/except"),o.createElement("li",null,"projection is added to choose the requested columns of the SELECT-clause"),o.createElement("li",null,"the columns are renamed to get the requested output-name specified in the SELECT-clause"),o.createElement("li",null,"order by"),o.createElement("li",null,"limit/offset is mapped to a selection")),o.createElement("h4",{id:"sql-select"},"SELECT"),o.createElement("p",null,"The direct translation into relational algebra with implicit duplication elimination requires the ",o.createElement("code",null,"distinct"),"keyword to be equivalent. A warning is shown if you omit it."),o.createElement("p",null,"The select-clause is translated into up to two relalg operators."),o.createElement("ul",null,o.createElement("li",null,"The most basic case is ",o.createElement("code",null,"select ",o.createElement("strong",null,"*")," ...")," where no changes are made to the schema of the result. Therefore no projection is needed. You can use the optional table-alias-prefix if the columns of a single table/relation should be returned only: ",o.createElement("code",{className:"sql"},"select distinct R.* from R inner join S")),o.createElement("li",null,"When a subset of the columns are selected and/or reordered (",o.createElement("code",null," select a, b from ..."),") then a single ",o.createElement("a",{href:"#relalg-operations-projection"},"projection")," is used."),o.createElement("li",null,"Additionally to the previous case a ",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename-column operator")," is added after the projection if new output-names are given with ",o.createElement("code",null,"as foo"),". e.g. ",o.createElement("code",null,"select a ",o.createElement("strong",null,"as foo")," from ..."))),o.createElement("p",null,"The allowed expressions are the same as for the ",o.createElement("a",{href:"#relalg-operations-projection"},"projection"),". So it can be either the name of the column (with optional renaming using ",o.createElement("code",null,"as"),") or a complex",o.createElement("a",{href:"#sql-valueexpr"},"value expression"),". In the latter case a output-name must be given using",o.createElement("code",null,"as")," because the tool requires every column to have a name."),o.createElement("h4",{id:"sql-from"},"FROM"),o.createElement("p",null,"In its simplest form the from-clause holds a single table/relation name that is used directly in the relalg statement. If the optional table-alias is specified with ",o.createElement("code",null,"table as foo")," this is reflected by wrapping the relation in a ",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename-relation operator")," with the given output-name."),o.createElement("code",{className:"example sql"},"select distinct x.a, x.b from R as x"),o.createElement("p",null,"Joins can be expressed using the ANSI join syntax"),o.createElement("code",{className:"example sql"},"select distinct * from A, B inner join C on ... inner join D natural natural join E left outer join F on ... left outer join G natural right outer join H on ... right outer join I natural full outer join J on ... full outer join K natural where ..."),o.createElement("p",null,"The comma is part of the old join syntax and is translated into a ",o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross join"),"."),o.createElement("code",{className:"example sql"},"select distinct * from R, S as s, T where s.a = R.a"),o.createElement("p",null,"Instead of the name of relation a non-correlated substatement can be used. A table alias must be provided with ",o.createElement("code",null,"(...) as foo"),".",o.createElement("br",null),"A non-correlated substatement can be directly translated into relational algebra by just translate the sub-statement into relational algebra and use the resulting operator tree instead of the relation."),o.createElement("p",null,"Non-correlated means that it must not reference/use any columns of tables defined in the outer scope.",o.createElement("br",null),'This limitation is intentionally because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("code",{className:"example sql"},"select distinct * from R, (select * from S where a > 0) as x where x.a = R.a"),o.createElement("h4",{id:"sql-where"},"WHERE"),o.createElement("p",null,"The boolean condition in the where-clause can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The where clause is directly translated to an ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," with the very same condition. This selection is applied after joining relations of the from-clause therefore has to use the original column names."),o.createElement("p",null,"Subquery Expressions like ",o.createElement("code",null,"EXISTS"),", ",o.createElement("code",null,"IN"),", ",o.createElement("code",null,"ANY/SOME")," or ",o.createElement("code",null,"ALL"),"are ",o.createElement("strong",null,"not supported"),' because their translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h4",{id:"sql-groupby"},"GROUP BY"),o.createElement("p",null,"The GROUP-BY-clause takes a list of column names only argument."),o.createElement("p",null,"The GROUP-BY-clause is directly translated to the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," and is executed directly after the selection built from the WHERE-clause and before the projection/renaming build from the SELECT-clause. Therefore the column names that can be used are the ones available after all joining all tables."),o.createElement("p",null,"The aggregations used in the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," are taken from the SELECT-clause and an output-name must be given using ",o.createElement("code",null,"as"),"because the tool requires every column to have a name."),o.createElement("p",null,"If no aggregations are present in the SELECT-clause a projection is used instead of the group-by operation because ",o.createElement("a",{href:"#relalg-operations-groupby"},"sigma")," without aggregation has the very same effect."),o.createElement("p",null,"Every non-aggregation-column in the SELECT-clause must be present in the group by clause because the would not be available after the grouping."),o.createElement("h4",{id:"sql-having"},"HAVING"),o.createElement("p",null,"The HAVING-Clause represents an optional ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection"),". The boolean condition can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The resulting selection is executed directly after the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation"),"."),o.createElement("p",null,"Unlike ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-HAVING",target:"_blank"},"PostgreSQL"),"the HAVING-clause is only allowed when either a aggregation or grouping is present."),o.createElement("h4",{id:"sql-orderby"},"ORDER BY"),o.createElement("p",null,"Order by takes a list of column names or indices of columns (starting with 1) as its argument."),o.createElement("p",null,"It is directly translated to the ",o.createElement("a",{href:"#relalg-operations-orderby"},"extended relational algebra operation order by (tau)"),"."),o.createElement("h4",{id:"sql-limit"},"LIMIT"),o.createElement("p",null,"The LIMIT-clause can be either specified with the LIMIT-OFFSET syntax used by PostgreSQL and MySQL or the FETCH-FIRST syntax introduced in SQL:2008."),o.createElement("p",null,"It is translated into a ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," using the",o.createElement("code",null,"rownum()"),"-function to limit the number of rows returned."),o.createElement("h4",{id:"sql-setoperators"},"UNION / INTERSECT / EXCEPT"),o.createElement("p",null,"The Set-Operators UNION, INTERSECT and EXCEPT directly map to the relational algebra operators ",o.createElement("a",{href:"#relalg-operations-union"},"union"),", ",o.createElement("a",{href:"#relalg-operations-intersection"},"intersection")," and ",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction"),"."),o.createElement("p",null,"The keyword ",o.createElement("code",null,"DISTINCT")," is optional because it represents the default behavior. The keyword",o.createElement("code",null,"ALL")," is ignored and a warning is shown because the targeted relational algebra has a implicit elimination duplicate rows."),o.createElement("p",null,"Parentheses can be used to create more complex statements:",o.createElement("br",null),o.createElement("code",{className:"example sql"},"( select distinct * from S union select distinct * from T ) except select distinct * from T order by 1 limit 1")),o.createElement("h4",{id:"sql-with"},"WITH"),o.createElement("p",null,"The WITH-clause (also known as ",o.createElement("i",null,"common table expressions"),") provides a way to define subqueries for single or multiple use in a statement. This can be thought as defining a temporary table for that query in SQL terminology or ",o.createElement("a",{href:"#relalg-assignment"},"creating variables in relational algebra"),". Recursive evaluation is not supported."),o.createElement("p",null,"Each subquery can be referenced by the name from the WITH-clause. The subquery is automatically renamed to the name used in the WITH-clause."),o.createElement("h4",{id:"sql-valueexpr"},"Value expressions"),o.createElement("p",null,"Value expressions are used for boolean expressions for WHERE- and HAVING-clause, the boolean conditions of joins and calculated values in the SELECT-clause. The type of a expression is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean")," and is determined by the used operations and columns."),o.createElement("p",null,"The supported functions and operations are the same for SQL and relational algebra: ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("h2",{id:"license-help"},"Licence"),o.createElement("p",null,o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},o.createElement("img",{alt:"Creative Commons License",style:{borderWidth:0},src:"https://i.creativecommons.org/l/by-sa/4.0/88x31.png"})),o.createElement("br",null),"This document by Johannes Kessler is licensed under a ",o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},"Creative Commons Attribution-ShareAlike 4.0 International License"),".")))))}}n("./src/calc2/views/landing.css");class Bn extends o.Component{componentDidMount(){In("#exec1").click((function(){In(this).addClass("hidden"),In(this).next().removeClass("hidden")}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-12"},o.createElement("div",{className:"jumbotron",id:"landing-header-bar"},o.createElement("div",{className:"col-md-12 ct",id:"logos"},o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_blue_large.png",alt:"Databases and Information Systems (DBIS)",width:"159",height:"120"})),o.createElement("a",{href:"http://www.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_uni_uni_2017_rgb_transparent.png",alt:"University of Innsbruck",width:"300",height:"120"}))),o.createElement("div",{className:"col-md-12 ct"},o.createElement("h1",{id:"heading"},"RelaX - relational algebra calculator"),o.createElement("p",null,"calculates any relational algebra statement like ",o.createElement("code",null,o.createElement("span",null,"( σ ",o.createElement("sub",null,"a > 42")," ( A ) ) ",o.createElement("span",{className:"math"},"⋈")," ( π ",o.createElement("sub",null,"a,b")," ( B ) )"))," on a set of relations.")),o.createElement("div",{className:"col-md-12 ct"},o.createElement(Xe,{className:"btn btn-primary btn-lg getStartedBtn",role:"button",to:"/relax/calc"},"Get Started"))),o.createElement("h2",null,"What is the relational algebra calculator?"),o.createElement("p",null,"If you want to learn SQL you take a database system and try some queries.",o.createElement("br",null),"But if you want to learn relational algebra what do you use? Pen and paper?"),o.createElement("p",null,"The relational algebra calculator helps you learn relational algebra (RelAlg) by executing it."),o.createElement("div",{className:"example"},"Subjects =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"Maths"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"English"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")))))),"Students =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"stId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"John"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"Mike"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"Julia")))))),"Marks =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"stId"),o.createElement("th",null,"mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"B"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"C")))))),o.createElement("br",null),o.createElement("div",null,o.createElement("span",null,o.createElement("span",{className:"math"}," π "),o.createElement("sub",null," studentName, subjectName, mark "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," studentName←st.name, subjectName←su.name "),"( ",o.createElement("span",null,"( ",o.createElement("span",null,"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," su "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Subjects"))," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," σ "),o.createElement("sub",null,"mark≥'C' "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," m "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Marks"))," )")," )")," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," m.stId=st.stId "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null,"st "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Students"))," )")," )")," )")," )")),"=",o.createElement("button",{type:"button",className:"btn",id:"exec1"},"execute"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline hidden"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"st.studentName"),o.createElement("th",null,"su.subjectName"),o.createElement("th",null,"m.mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Mike")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))))))),o.createElement("h2",null,"Calculator features:"),o.createElement("ul",null,o.createElement("li",null,"supports most common operators",o.createElement("ul",null,o.createElement("li",null,"projection"),o.createElement("li",null,"selection"),o.createElement("li",null,"rename relations"),o.createElement("li",null,"rename columns"),o.createElement("li",null,"group by"),o.createElement("li",null,"intersect"),o.createElement("li",null,"union"),o.createElement("li",null,"set difference"),o.createElement("li",null,"cross join"),o.createElement("li",null,"theta join"),o.createElement("li",null,"natural join"),o.createElement("li",null,"natural left outer join"),o.createElement("li",null,"natural right outer join"),o.createElement("li",null,"natural full outer join"),o.createElement("li",null,"theta left outer join"),o.createElement("li",null,"theta right outer join"),o.createElement("li",null,"theta full outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"right semi join"),o.createElement("li",null,"anti join join"),o.createElement("li",null,"order by"))),o.createElement("li",null,"runs in any modern browser. no plugins needed"),o.createElement("li",null,"text based approach. lets you write RelAlg as easy as SQL"),o.createElement("li",null,"code editor with syntax highlighting and code completion"),o.createElement("li",null,"pre defined sets of relations"),o.createElement("li",null,"visualize statement in a operator tree"),o.createElement("li",null,"plain text alternatives for special symbols like σ or ",o.createElement("span",{className:"math"},"⋈")),o.createElement("li",null,"variables can be used to simplify expressions"),o.createElement("li",null,"new temporal relations can be declared in the statement"),o.createElement("li",null,"sql like comments"),o.createElement("li",null,"arbitrary boolean expressions in conditions"),o.createElement("li",null,"operations keep original order for better traceability"),o.createElement("li",null,"translates simple SQL-statements to RelAlg",o.createElement("ul",null,o.createElement("li",null,"no support for correlated sub-statements")))),o.createElement("h2",null,"Available data"),"You can either use one of the following datasets or create a new one.",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Name"),o.createElement("th",null,"Source"),o.createElement("th",null,"Language"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"Kemper Datenbanksysteme"),o.createElement("td",null,o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/"},"Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage"),", Seite 84, Abbildung 3.8"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - KursDB"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - R, S, T"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.1"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 52-55"),o.createElement("td",null,"en")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.3"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 55-57"),o.createElement("td",null,"en"))))),o.createElement("h2",null,"What it is not:"),o.createElement("p",null,"The tool is not meant to be a full database system. The goal of the implementation was to create a tool to support people to learn RelAlg."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null," "),o.createElement("th",null,"Pen and Paper"),o.createElement("th",null,"relational algebra calculator"),o.createElement("th",null,"MySQL"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"SQL support"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes :-)"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," basic SQL"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"relational algebra"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"use variables for RelAlg"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"large datasets"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"query plan"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"intermediate results"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"iterative working"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"))))),o.createElement("h2",{id:"changelog"},"Changelog"),o.createElement("ul",null,o.createElement("li",null,"0.20",o.createElement("ul",null,o.createElement("li",null,"added option to automatically replace operators in relational algebra: all plaintext-syntax operators get replaced with the equivalent mathematical symbol or vice versa."))),o.createElement("li",null,"0.19",o.createElement("ul",null,o.createElement("li",null,"added datepicker to quickly insert a date literal"))),o.createElement("li",null,"0.18",o.createElement("ul",null,o.createElement("li",null,"added support for the ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"LIKE-operator")," for SQL and relational algebra",o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi 'abc' like 'a%'->x R")),o.createElement("li",null,"added translation support for the calculator using ",o.createElement("a",{href:"http://i18next.com/",target:"_blank"},"i18next"),". This allows easy translation of the main calculator into other languages."),o.createElement("li",null,"calculator is now available in ",o.createElement("a",{href:"calc.htm?lang=de"},"german")),o.createElement("li",null,"ported project to ES2015 (it now gets transpiled to ES5 and packed using ",o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel.js"),"and ",o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify"),")"))),o.createElement("li",null,"0.17",o.createElement("ul",null,o.createElement("li",null,"fixed bug: inline-table-editor not working"),o.createElement("li",null,"fixed bug: formula for !a was not working"))),o.createElement("li",null,"0.16",o.createElement("ul",null,o.createElement("li",null,"disallow relational algebra keywords as column-/relation-names"),o.createElement("li",null,"fixed precedence for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE-WHEN-expressions")),o.createElement("li",null,"added support for the SQL-92 ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},o.createElement("code",null,"||"),"-concat operator")),o.createElement("li",null,"added ",o.createElement("code",null,"except")," as alternative syntax for the ",o.createElement("a",{href:"/relax/help#relalg-operations-subtraction"},"relational algebra set-difference operator")),o.createElement("li",null,"fixed bug where ",o.createElement("code",null,"A=R join S A")," was interpreted as",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".",o.createElement("br",null),"see ",o.createElement("a",{href:"/relax/help#relalg-operations-innerjoin"},"help page")," for more information"))),o.createElement("li",null,"0.15",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"hour(), minute() and second()")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"now()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi hour(now())->x, minute(now())->y, second(now())->z ( R )")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"n-ary concat"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi concat(b, '_', c)->x R")),o.createElement("li",null,"added support for WITH-clauses for SQL"))),o.createElement("li",null,"0.14",o.createElement("ul",null,o.createElement("li",null,"improve error message for theta-joins with conflicting columns"),o.createElement("li",null,"improve error message and added example for assignments without query error"),o.createElement("li",null,"bugfix: calculator-tour did not work correctly for Edge on Windows 10"))),o.createElement("li",null,"0.13",o.createElement("ul",null,o.createElement("li",null,'updated to CodeMirror version 5.1 with "experimental mobile support"'),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"COALESCE()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi coalesce(a, b, 1)->x R"),", ",o.createElement("code",null,"select coalesce(a, b, 1) as x from R")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE WHEN"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"select case when a > 3 then a+1 else a end as x from R")),o.createElement("li",null,"added support for complex union/intersect/except statements for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"(select * from S union ( select * from T except select * from T )) order by 1")))),o.createElement("li",null,"0.12",o.createElement("ul",null,o.createElement("li",null,"added support for more complex FROM-clauses for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct * from R, (S natural join T)")),o.createElement("li",null,"simplify and link the syntax diagrams at the help page"))),o.createElement("li",null,"0.11",o.createElement("ul",null,o.createElement("li",null,"added a tour to explain the main features of the tool to new users (using ",o.createElement("a",{href:"http://bootstraptour.com/",target:"_blank"},"Bootstrap Tour"),")"),o.createElement("li",null,"added ",o.createElement("a",{href:"/relax/help#sql-reference"},"reference for SQL in the help section")),o.createElement("li",null,"added support for USING clause for joins for SQL"),o.createElement("li",null,"added support FETCH FIRST syntax (SQL:2008) for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select * from R offset 2 rows fetch first 10 rows only")),o.createElement("li",null,"allow DISTINCT on set operators for SQL"),o.createElement("li",null,"bugfix: having should be allowed without group by if aggregation is used"))),o.createElement("li",null,"0.10",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"arithmetic expressions and functions")," for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct a+2 as x from R where length(b) > 2")),o.createElement("li",null,"show warnings instead of errors when not using distinct or using all on set operators in SQL"))),o.createElement("li",null,"0.9",o.createElement("ul",null,o.createElement("li",null,"added support for arithmetic operators and functions in ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"(e.g boolean) expressions")," for relational algebra"),o.createElement("li",null,"projection supports ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"expressions")),o.createElement("li",null,"removed magic ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"ROWNUM")," column; ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"ROWNUM()")," is now a function"),o.createElement("li",null,"tutorials for ",o.createElement("a",{href:"/relax/help#tutorial-user"},"users")," and ",o.createElement("a",{href:"/relax/help#tutorial-maintainer"},"maintainers")),o.createElement("li",null,"new braces handling in formula generation (braces are only placed if necessary)"),o.createElement("li",null,"bugfix: rename not existent column was silently ignored"),o.createElement("li",null,"syntax of dates has changed ",o.createElement("code",null,"1970-01-01")," could not be used any more because it is ambiguous (arithmetic operaton or date). The SQL notation (",o.createElement("code",null,"date('1970-01-01')"),") is now used for the relational algebra mode."))),o.createElement("li",null,"0.8",o.createElement("ul",null,o.createElement("li",null,"grid editor for inline relations"),o.createElement("li",null,"sql-dump import (beta)"),o.createElement("li",null,"group editor"),o.createElement("li",null,"changed the basic structure of the editors (internally)"),o.createElement("li",null,"duplicate rows are removed in every step")))),o.createElement("h2",null,"Who?"),o.createElement("p",null,"The relational algebra calculator was created by Johannes Kessler BSc at ",o.createElement("a",{href:"https://dbis-informatik.uibk.ac.at/1-1-Home.html"},"Databases and Information Systems Group")," at the ",o.createElement("a",{href:"http://informatik.uibk.ac.at/"},"Institute of Computer Science")," at the ",o.createElement("a",{href:"http://www.uibk.ac.at/index.html.en"},"University of Innsbruck")," under supervision of Michael Tschuggnall PhD and Prof. Dr. Günther Specht"),o.createElement("h2",null,"External resources"),o.createElement("p",null,"This tool was not written from scratch but many different external resources/frameworks/projects/libs are used."),o.createElement("p",null,"This is a list of resources/frameworks/projects/libs used for this tool (in alphabetical order) to give credit where credit is due and guide anyone interested to them without having to look through the code."),o.createElement("ul",null,o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel JavaScript compiler")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://blanketjs.org/"},"blanket.js")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://botmonster.com/jquery-bootpag/"},"bootpag")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://getbootstrap.com/"},"Bootstrap")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://bootstrap-datepicker.readthedocs.org"},"bootstrap-datepicker")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://bootstraptour.com/"},"Bootstrap Tour")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codemirror.net/"},"CodeMirror")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codepen.io/Pestov/pen/BLpgm"},"CSS3 family tree by Ilya Pestov")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://www.gnu.org/software/freefont/"},"FreeSans by GNU FreeFont")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://gruntjs.com/"},"Grunt")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handlebarsjs.com/"},"handlebars")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handsontable.com/"},"Handsontable")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://i18next.com/"},"i18next")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://jquery.com/"},"jQuery")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/chjj/marked"},"marked - a markdown parser")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://pegjs.org/"},"PEG.js - Parser Generator for JavaScript")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://qunitjs.com/"},"QUnit - js unit testing")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/tabatkins/railroad-diagrams"},"tabatkins/railroad-diagrams"))))))))}}class Un extends o.Component{componentDidMount(){}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-min"},"Databases and Information System",o.createElement("br",null),"Universität Innsbruck",o.createElement("br",null),"ICT - building, second floor",o.createElement("br",null),"Technikerstrasse 21a",o.createElement("br",null),"A-6020 Innsbruck",o.createElement("br",null)))}}n("./src/calc2/style/index.scss");class zn extends o.Component{constructor(e){super(e),this.state={isNavbarOpen:!0}}componentDidMount(){var e;const t=document.getElementById("loadingScreen");null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}render(){const{store:e}=this.props,{isNavbarOpen:t}=this.state;return o.createElement(Ue,null,o.createElement(f,{store:e},o.createElement(r.a,null,o.createElement(Be,null,o.createElement(Re,{exact:!0,from:"/",to:"/relax/landing"}),o.createElement(Re,{exact:!0,from:"/relax",to:"/relax/landing"}),o.createElement(Pe,{path:"/relax/landing",component:Bn}),o.createElement(Pe,{path:"/relax/help",component:Wn}),o.createElement(Pe,{path:"/relax/imprint",component:Un}),o.createElement(Re,{from:"/relax/calc",to:"/relax/calc/local/uibk/local/0",exact:!0,strict:!0}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Pn}),o.createElement(Pe,{path:"/relax/calc/:source/:id",component:Pn}),o.createElement(Pe,{render:e=>o.createElement("div",{className:"view-min"},o.createElement("h1",null,"404"),o.createElement("p",null,"This route doesn't exist"),o.createElement("span",null,JSON.stringify(e)))})))))}}},"./src/calc2/style/index.scss":function(e,t,n){},"./src/calc2/utils/groupUtils.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n("./src/db/relalg.ts"),o=n("./node_modules/jquery/dist/jquery.js");const i=n("./src/calc2/data/uibk.txt"),a={uibk:i.default?i.default:""};function s(e,t,n){return u(Object(r.c)(e),t,n)}function l(e,t,n){if(0===(e=e.filter(({name:e})=>e===t)).length)return{fallback:n};let r=null;const o={};for(let t=0;t{switch(e){case"gist":o.ajax({url:`https://api.github.com/gists/${t}`,dataType:"json",success:function(o){const a=[];for(const u in o.files){if(!o.files.hasOwnProperty(u))continue;const c=null===o.owner?"anonymous":o.owner.login,d=null===o.owner?void 0:o.owner.html_url,h={source:e,id:o.id,filename:u,index:-1,maintainer:n,maintainerGroup:r},f={author:c,authorUrl:d,lastModified:new Date(o.updated_at),url:o.url};try{a.push(...s(o.files[u].content,h,f)),i(a)}catch(e){const n='could not parse given group from gist with id "'+t+'": '+e;console.error(n,t,e,u,o),l(new Error(n))}}},crossDomain:!0,statusCode:{404:function(){l(new Error("gist "+t+" not found"))}},async:!0});break;case"local":try{const o=s(a[t],{source:e,id:t,filename:"local",index:-1,maintainer:n,maintainerGroup:r},{});i(o)}catch(e){let t="cannot parse groups file: "+e.message;t+="
        see log for more information",console.error(t,e),l(new Error(t))}break;case"http":{const e="parsing groups from arbitrary urls is no longer supported; use github gists instead.";window.alert(e),l(new Error(e));break}default:l(new Error("unknown source "+e))}})}},"./src/calc2/views/help.css":function(e,t,n){},"./src/calc2/views/landing.css":function(e,t,n){},"./src/db/exec/Column.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e,t,n="null"){this._type="null",this._name=e,this._relAlias=t,this._type=n}getName(){return this._name}getRelAlias(){return this._relAlias}getType(){return this._type}setRelAlias(e){this._relAlias=e}toString(){return r.printColumn(this._name,this._relAlias)}equals(e){return this._name===e._name&&this._relAlias===e._relAlias}static printColumn(e,t){let n;return n="number"==typeof e?`[${e}]`:e,null===t?n:`${t}.${n}`}}},"./src/db/exec/ExecutionError.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r extends Error{constructor(e,t){super(e),this.codeInfo=t||void 0}}},"./src/db/exec/RANode.ts":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n("./src/db/exec/ExecutionError.ts");class o{constructor(e=""){this._codeInfo=null,this._metaData={},this._resultNumRows=-1,this._wrappedInParentheses=!1,this._warnings=[],this._functionName=e}setCodeInfoObject(e){return this._codeInfo=e,this}addWarning(e,t){const n={message:e,codeInfo:void 0};t&&(n.codeInfo=t),this._warnings||(this._warnings=[]),this._warnings.push(n)}setWrappedInParentheses(e=!0){this._wrappedInParentheses=e}throwExecutionError(e){throw new r.a(e,this._codeInfo)}setMetaData(e,t){this._metaData[e]=t}hasMetaData(e){return void 0!==this._metaData[e]}getMetaData(e){return this._metaData[e]}getResultNumRows(){if(void 0===this._resultNumRows||-1===this._resultNumRows)throw new Error("result num rows not set! call only after getResult");return this._resultNumRows}setResultNumRows(e){this._resultNumRows=e}_returnOrCreateSession(e){return void 0===e?{statement_timestamp:new Date}:e}getArgumentHtml(){return""}static foreachRecursive(e,t){t(e),e instanceof a?t(e.getChild()):e instanceof s&&(t(e.getChild()),t(e.getChild2()))}}class i extends o{getWarnings(e){return this._warnings}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class a extends o{constructor(e,t){super(e),this._child=t}getChild(){return this._child}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class s extends o{constructor(e,t,n){super(e),this._child=t,this._child2=n}getChild(){return this._child}getChild2(){return this._child2}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0),...this.getChild2().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses||!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild2().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}},"./src/db/exec/Relation.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./src/db/exec/RANode.ts"),o=n("./src/db/exec/Table.ts");class i extends r.b{constructor(e,t){super(e),this._schema=null,void 0===t?this._table=new o.a:(t.check(),this._schema=t.getSchema(),this._table=t.getResult())}setSchema(e,t=!1){return this._schema=e.copy(),!0!==t&&this._schema.setRelAlias(this._functionName),this._table.setSchema(this._schema),this}addRow(e){this._table.addRow(e)}addRows(e){this._table.addRows(e)}getResultNumRows(){return this._resultNumRows}getResult(e){this._returnOrCreateSession(e);const t=this._table.copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}getSchema(){return this._table.getSchema()}getName(){return this._functionName}check(){}hasChild(){return!1}copy(){if(null===this._schema)throw new Error("check not called");const e=new i(this._functionName);return e.setSchema(this._schema),e._table=this._table.copy(),e}}},"./src/db/exec/Schema.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./src/db/exec/Column.ts");class i{constructor(){this._names=[],this._relAliases=[],this._types=[],this._size=0,this._colIndexPerName={}}getSize(){return this._size}addColumn(e,t,n){if("string"!==n&&"date"!==n&&"number"!==n&&"boolean"!==n)throw new Error("unknown type! "+n);this._names.push(e),this._relAliases.push(t),this._types.push(n);const o=this._size;if(!1===this.isUnique(o))throw new Error(r.a("db.messages.exec.error-column-not-unique",{column:t+"."+e}));return this._addColToIndex(e,o),this._size++,this}addColumn2(e){return this.addColumn(e.getName(),e.getRelAlias(),e.getType())}_addColToIndex(e,t){void 0===this._colIndexPerName[e]?this._colIndexPerName[e]=[t]:this._colIndexPerName[e].push(t)}_removeColFromIndex(e){const t=this._names[e],n=this._colIndexPerName[t];n.splice(n.indexOf(e,0),1),0===n.length&&delete this._colIndexPerName[t]}removeColumn(e){this._names.splice(e,1),this._relAliases.splice(e,1),this._types.splice(e,1),this._size--;for(let t=e;tthis._size)throw new Error(r.a("db.messages.exec.error-column-index-out-of-range",{column:o.a.printColumn(e,t),schema:this.toString()}));if(null===t)return[n];if(this._relAliases[n]===t)return[n]}return[]}getType(e){return this._types[e]}equals(e){if(!1===this.equalsTypeOnly(e))return!1;for(let t=0;t1}getName(e){return this._names[e]}getFullName(e){return(this._relAliases[e]?this._relAliases[e]+".":"")+this._names[e]}toString(){const e=[];for(let t=0;t'+Object(r.d)(n,o)+"
        "}getRows(e=0,t){if(0===e&&void 0===t)return this._rows;{const n=this._rows.length;let r=n;t&&t>0&&(r=Math.min(n,e+t)),this._rows.slice(e,r);const o=[];for(let t=e;t"+n.getName()+"":""+n.toString()+""}o+="";let i="";const a=this.getNumRows();let s=a;t&&t>0&&(s=Math.min(a,n+t));for(let e=n;e"+this.getValueHtmlAt(e,n)+"";i+=t+""}return""+o+i+"
        "}equals(e){if(e instanceof a==!1)throw new Error("can not compare");if(!1===this._schema.equals(e._schema))return!1;if(this._rows.length!==e._rows.length)return!1;for(let t=0;tn)throw new Error("invalid sort cols");for(let e=0;e=n||r[e]<0)throw new Error("invalid sort cols");const i=r.length;if(i!==o.length)throw new Error("invalid sort cols");const a=r.map(e=>this._schema.getType(e)),s=function(e,t,n,r,o){const i=e[n],a=t[n];if(null===i&&null===a)return 0;if(null===i&&null!==a)return 1*r;if(null!==i&&null===a)return-1*r;switch(o){case"number":case"date":case"boolean":return r*(i-a);case"string":return r*i.localeCompare(a);case"null":return 0}};this._rows.sort((function(e,t){let n=0;for(let l=0;l=e.length?t[this._index-e.length]:e[this._index]}toString(){return o.a.printColumn(this._name,this._relAlias)}getFormulaHtml(){const e=o.a.printColumn(this._name,this._relAlias);return!0===this._wrappedInParentheses?"("+e+")":e}static _getColumnIndex(e,t,n,r){if(!t||null===t)return e.getColumnIndex(n,r,!0);const o=e.getColumnIndex(n,r,!1);return-1===o?t.getColumnIndex(n,r,!0)+e.getSize():(t.getColumnIndex(n,r,!1),o)}static _getType(e,t,n){return n>=e.getSize()?t.getType(n-e.getSize()):e.getType(n)}}class u extends s{constructor(e,t,n){super(),this._func=t,this._dataType=e,this._dataTypeCalculated=null,this._args=n||[]}evaluate(e,t,n,r){switch(this._dataType){case"string":return this._evaluateString(e,t,n,r);case"number":return this._evaluateNumber(e,t,n,r);case"boolean":return this._evaluateBoolean(e,t,n,r);case"date":return this._evaluateDate(e,t,n,r);case"null":return this._evaluateNull(e,t,n,r);default:throw new Error("this should not happen!")}}_parseIsoDate(e){const t=/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$/.exec(e);if(null===t)throw new r.a(i.a("db.messages.exec.error-invalid-date-format",{str:e}),this._codeInfo);const n=parseInt(t[1],10),o=parseInt(t[2],10)-1,a=parseInt(t[3],10),s=new Date(n,o,a);return s.getFullYear()===n&&s.getMonth()===o&&s.getDate()===a||this.throwExecutionError(i.a("db.messages.exec.error-invalid-date-format",{str:e})),s}_evaluateNull(e,t,n,r){switch(this._func){case"constant":return null;case"coalesce":for(let o=0;o1&&this._args[1].evaluate(e,t,n,r),null===o||this._args.length>1&&null===i)return null;switch(this._func){case"date":return this._parseIsoDate(o);case"adddate":return new Date(o.getTime()+864e5*i);case"subdate":return new Date(o.getTime()-864e5*i);default:throw new Error("this should not happen!")}}_checkDate(e,t){switch(this._func){case"transaction_timestamp":case"statement_timestamp":case"clock_timestamp":case"now":return!0;case"date":return this._checkArgsDataType(e,t,["string"]);case"adddate":case"subdate":return this._checkArgsDataType(e,t,["date","number"]);default:throw new Error("this should not happen!")}}_evaluateBoolean(e,t,n,r){let o,i,a;if("constant"===this._func)return this._args[0];switch(o=this._args[0].evaluate(e,t,n,r),i=this._args.length>1&&this._args[1].evaluate(e,t,n,r),this._func){case"not":return"unknown"===o?o:!o;case"and":return!1!==o&&!1!==i&&(!0===o&&!0===i||"unknown");case"or":return!0===o||!0===i||(!1!==o||!1!==i)&&"unknown";case"xor":return"unknown"===o||"unknown"===i?"unknown":o!==i;case"=":case">=":case"<=":case">":case"<":case"!=":return a=this._args[0].getDataType(),u._condition_compare(o,i,a,this._func);case"like":case"ilike":if(!this._regex)throw new Error("regex should have been set by check");return this._regex.test(o);default:throw new Error("this should not happen!")}}static _condition_compare(e,t,n,r){if(null===e||null===t)switch(r){case"=":case">=":case"<=":return e===t||"unknown";case"<":case">":return e!==t&&"unknown";case"!=":return e!==t;default:throw new Error("unknown operator")}switch(n){case"number":case"string":switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}case"date":switch(r){case"=":return e.getTime()===t.getTime();case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e.getTime()!==t.getTime();default:throw new Error("unknown operator")}case"boolean":if("boolean"!=typeof e||"boolean"!=typeof t)throw new Error("operands have different type");switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}default:throw new Error("unknown type "+n)}}_checkBoolean(e,t){let n,r;switch(this._func){case"constant":return!0;case"not":return this._checkArgsDataType(e,t,["boolean"]);case"and":case"or":case"xor":return this._checkArgsDataType(e,t,["boolean","boolean"]);case"=":case">=":case"<=":case">":case"<":case"!=":return this._args[0].check(e,t),this._args[1].check(e,t),n=this._args[0].getDataType(),r=this._args[1].getDataType(),"null"===n||"null"===r?!0:n===r||(this.throwExecutionError(i.a("db.messages.exec.error-could-not-compare-different-types",{typeA:n,typeB:r})),this._checkArgsDataType(e,t,["boolean","boolean"]));case"like":case"ilike":if(this._args[0].check(e,t),"string"!==this._args[1].getDataType()||"constant"!==this._args[1]._func)return!1;const o=this._args[1]._args[0];let a=String(o).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");a=a.replace(/([^\\]?)_/g,"$1."),a=a.replace(/([^\\]?)%/g,"$1.*");const s="ilike"===this._func?"i":"";this._regex=new RegExp("^"+a+"$",s);break;default:throw new Error("this should not happen!")}}_evaluateString(e,t,n,r){switch(this._func){case"constant":return this._args[0];case"lower":case"upper":const o=this._args[0].evaluate(e,t,n,r);return null===o?null:"lower"===this._func?o.toLowerCase():o.toUpperCase();case"concat":let i="";for(let o=0;o0?this._args[0].evaluate(e,t,n,r):void 0,i=this._args.length>1?this._args[1].evaluate(e,t,n,r):void 0;switch(this._func){case"add":return null===o||null===i?null:o+i;case"sub":return null===o||null===i?null:o-i;case"mul":return null===o||null===i?null:o*i;case"div":return null===o||null===i?null:o/i;case"mod":return null===o||null===i?null:o%i;case"abs":return null===o?null:Math.abs(o);case"floor":return null===o?null:Math.floor(o);case"ceil":return null===o?null:Math.ceil(o);case"round":return null===o?null:Math.round(o);case"minus":return null===o?null:-o;case"rand":return Math.random();case"rownum":return n+1;case"strlen":return null===o?null:o.length;case"year":return null===o?null:o.getFullYear();case"month":return null===o?null:o.getMonth()+1;case"dayofmonth":return null===o?null:o.getDate();case"hour":return null===o?null:o.getHours();case"minute":return null===o?null:o.getMinutes();case"second":return null===o?null:o.getSeconds();default:throw new Error("this should not happen!")}}_checkArgsDataType(e,t,n){const r=[];if(this._args.length!==n.length)throw new Error("this should not happen: #args != #types");for(let o=0;o{let t=(e||this._func)+"(";for(let e=0;e{let t="CASE";for(let n=0;n{let t="";return t+=` ${e||this._func} `,t=this._args[0].getFormulaHtml()+t,t+=this._args[1].getFormulaHtml(),`${t}`};function r(){const{_func:r}=this;switch(r){case"constant":return a(this._args[0],this._dataTypeCalculated||this._dataType);case"rand":case"rownum":case"abs":case"ceil":case"floor":case"round":case"year":case"month":case"dayofmonth":case"hour":case"minute":case"second":case"adddate":case"subdate":case"concat":case"upper":case"lower":case"date":case"strlen":return e.call(this,"length");case"minus":return e.call(this,"-");case"not":return e.call(this,"!");case"caseWhen":case"caseWhenElse":return t.call(this,"caseWhenElse"===this._func);case"add":return n.call(this,"+");case"sub":return n.call(this,"-");case"mul":return n.call(this,"*");case"div":return n.call(this,"/");case"mod":return n.call(this,"%");case"and":case"or":case"xor":case"like":case"ilike":case"=":return n.call(this,r);case">=":return n.call(this,"≥");case"<=":return n.call(this,"≤");case">":return n.call(this,">");case"<":return n.call(this,"<");case"!=":return n.call(this,"≠")}return this.toString()}return!0===this._wrappedInParentheses?`(${r.call(this)})`:r.call(this).toString()}}},"./src/db/parser/grammar_ra.pegjs":function(e,t,n){"use strict";function r(e,t,n,o){this.message=e,this.expected=t,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;t",!1),re=(pr("ψ",!1),pr("psi",!0),pr("τ",!1)),oe=function(){return ri("tau")},ie=pr("tau",!0),ae=pr("γ",!1),se=function(){return ri("gamma")},le=pr("gamma",!0),ue=pr("∪",!1),ce=function(){return ri("unionOperator")},de=pr("union",!0),he=pr("∩",!1),fe=function(){return ri("intersectOperator")},me=pr("intersect",!0),pe=pr("÷",!1),ge=pr("/",!1),ye=pr("\\",!1),be=function(){return ri("differenceOperator")},ve=pr("except",!0),_e=pr("⨯",!1),we=pr("x",!1),Ee=function(){return ri("crossJoinOperator")},je=pr("cross",!0),Ce=pr("join",!0),Se=pr("⨝",!1),Oe=pr("⋈",!1),ke=function(){return ri("innerJoinOperator")},Te=pr("inner",!0),Me=function(){return ri("naturalJoinOperator")},xe=pr("natural",!0),Le=pr("⋉",!1),Re=function(){return ri("leftSemiJoinOperator")},Ae=pr("left",!0),De=pr("semi",!0),Ne=pr("⋊",!1),Pe=function(){return ri("rightSemiJoinOperator")},Ie=pr("right",!0),He=pr("▷",!1),Ye=function(){return ri("antiJoinOperator")},Fe=pr("anti",!0),We=pr("⟕",!1),Be=function(){return ri("leftOuterJoinOperator")},Ue=pr("outer",!0),ze=pr("⟖",!1),Ve=function(){return ri("rightOuterJoinOperator")},qe=pr("⟗",!1),Ge=function(){return ri("fullOuterJoinOperator")},Ke=pr("full",!0),Xe=pr(",",!1),$e=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Je=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Qe=pr("asc",!0),Ze=pr("desc",!0),et=pr("sum",!0),tt=pr("count",!0),nt=pr("avg",!0),rt=pr("min",!0),ot=pr("max",!0),it=pr("(",!1),at=pr(")",!1),st=pr("count(*)",!0),lt=function(e){for(var t=[],n=0;n"group"===e.name);if(!r)continue;const o=r.text;t[o]&&mr(ei("db.messages.parser.error-group-non-unique-group-name",{name:o})),t[o]=!0}}(t),{type:"groupRoot",groups:t,codeInfo:ti()}},ut=pr("en",!1),ct=pr("de",!1),dt=pr("es",!1),ht=/^[a-z@]/,ft=gr([["a","z"],"@"],!1,!1),mt=pr(":",!1),pt=/^[a-z]/,gt=gr([["a","z"]],!1,!1),yt=pr("@",!1),bt=pr("[[",!1),vt=pr("\\]]",!1),_t=pr("]]",!1),wt=function(e,t){return function(e,t){var n,r=t[0];r.child=e,r.codeInfo=ni(r.child.codeInfo,r.codeInfo);for(var o=1;o",!1),kt=pr(">=",!1),Tt=pr("≥",!1),Mt=pr(">",!1),xt=pr("<=",!1),Lt=pr("≤",!1),Rt=pr("<",!1),At=yr("logical AND"),Dt=pr("and",!0),Nt=pr("∧",!1),Pt=yr("logical XOR"),It=pr("xor",!0),Ht=pr("⊻",!1),Yt=pr("⊕",!1),Ft=yr("logical OR"),Wt=pr("or",!0),Bt=pr("∨",!1),Ut=yr("logical NOT"),zt=pr("!",!1),Vt=pr("¬",!1),qt=yr("delimiter"),Gt=pr("string",!0),Kt=pr("number",!0),Xt=pr("date",!0),$t=pr("boolean",!0),Jt=pr("null",!1),Qt=pr("NULL",!1),Zt=pr("}",!1),en=/^[\-_a-z0-9.]/i,tn=gr(["-","_",["a","z"],["0","9"],"."],!1,!0),nn=function(e){return{type:"string",value:e,quoted:!0}},rn=pr('"',!1),on=/^[^"\n]/,an=gr(['"',"\n"],!0,!1),sn=pr("{",!1),ln=yr("boolean expression"),un=pr("||",!1),cn=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:ti()}},dn=pr("like",!0),hn=pr("ilike",!0),fn=pr("+",!1),mn=pr("*",!1),pn=pr("%",!1),gn=pr("coalesce",!0),yn=pr("concat",!0),bn=pr("adddate",!0),vn=pr("subdate",!0),_n=pr("mod",!0),wn=pr("add",!0),En=pr("sub",!0),jn=pr("mul",!0),Cn=pr("div",!0),Sn=pr("upper",!0),On=pr("ucase",!0),kn=pr("lower",!0),Tn=pr("lcase",!0),Mn=pr("length",!0),xn=pr("abs",!0),Ln=pr("floor",!0),Rn=pr("ceil",!0),An=pr("round",!0),Dn=pr("year",!0),Nn=pr("month",!0),Pn=pr("day",!0),In=pr("hour",!0),Hn=pr("minute",!0),Yn=pr("second",!0),Fn=pr("dayofmonth",!0),Wn=pr("rand",!0),Bn=pr("rownum",!0),Un=pr("now",!0),zn=pr("current_timestamp",!0),Vn=pr("transaction_timestamp",!0),qn=pr("statement_timestamp",!0),Gn=pr("clock_timestamp",!0),Kn=pr("sysdate",!0),Xn=pr("null",!0),$n=pr("case",!0),Jn=pr("when",!0),Qn=pr("then",!0),Zn=function(e,t){return{w:e,t:t}},er=pr("else",!0),tr=pr("end",!0),nr=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=ti();for(var o=1;olr&&(lr=ir,ur=[]),ur.push(e))}function wr(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function Er(){var e,t,n=135*ir+0,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=function(){var e,t,n,r,i,a,s=135*ir+57,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o&&(r=Br())!==o&&(i=kr())!==o?(ar=e,t=function(e,t){var n=[t];for(var r in e)n.push(e[r][0]);return oi(n),{type:"relalgRoot",assignments:n,child:null,operatorPositions:si,codeInfo:ti()}}(n,r),e=t):(ir=e,e=o)}else ir=e,e=o;if(e===o)if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?((r=eo())===o&&(r=null),r!==o&&(i=kr())!==o?(ar=e,t=function(e,t){for(var n=[],r=0;rir?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(s)),cr--,n===o?t=void 0:(ir=t,t=o),dr[r]={nextPos:ir,result:t},t)}function Cr(){var t,n=135*ir+3,r=dr[n];return r?(ir=r.nextPos,r.result):("\r\n"===e.substr(ir,2)?(t="\r\n",ir+=2):(t=o,0===cr&&_r(l)),t===o&&(10===e.charCodeAt(ir)?(t="\n",ir++):(t=o,0===cr&&_r(u))),dr[n]={nextPos:ir,result:t},t)}function Sr(){var t,n=135*ir+4,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=135*ir+5,g=dr[p];if(g)return ir=g.nextPos,g.result;cr++,t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d));n!==o?(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o?(i=ir,cr++,(a=Cr())===o&&(a=jr()),cr--,a!==o?(ir=i,i=void 0):i=o,i!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o);if(t===o&&(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o?(r=ir,cr++,(i=Cr())===o&&(i=jr()),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o),t===o))if(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o)if(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o){for(i=ir,a=[],l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);l!==o;)a.push(l),l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);(i=a!==o?e.substring(i,ir):a)!==o?(a=ir,cr++,(l=Cr())===o&&(l=jr()),cr--,l!==o?(ir=a,a=void 0):a=o,a!==o?(ar=t,t=n=i):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;cr--,t===o&&(n=o,0===cr&&_r(c));return dr[p]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u,c=135*ir+6,d=dr[c];if(d)return ir=d.nextPos,d.result;t=ir,"/*"===e.substr(ir,2)?(n="/*",ir+=2):(n=o,0===cr&&_r(m));if(n!==o){for(r=ir,i=[],a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);a!==o;)i.push(a),a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);(r=i!==o?e.substring(r,ir):i)!==o?("*/"===e.substr(ir,2)?(i="*/",ir+=2):(i=o,0===cr&&_r(p)),i!==o?(ar=t,t=n=r):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function Or(){var t,n,r,i,a,s,l,u=135*ir+7,c=dr[u];if(c)return ir=c.nextPos,c.result;for(cr++,t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),cr--,(t=n)===o&&(n=o,0===cr&&_r(g)),dr[u]={nextPos:ir,result:t},t}function kr(){var t,n,r=135*ir+8,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));n!==o;)t.push(n),(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));return cr--,t===o&&(n=o,0===cr&&_r(v)),dr[r]={nextPos:ir,result:t},t}function Tr(){var t,n,r=135*ir+10,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));n!==o;)t.push(n),_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));return cr--,t===o&&(n=o,0===cr&&_r(E)),dr[r]={nextPos:ir,result:t},t}function Mr(){var t,n,r,i=135*ir+12,a=dr[i];if(a)return ir=a.nextPos,a.result;for(t=ir,n=[],(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));r!==o;)n.push(r),(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));return n!==o&&(ar=t,n=""),t=n,dr[i]={nextPos:ir,result:t},t}function xr(){var t,n,r,i,a,s,l=135*ir+14,u=dr[l];if(u)return ir=u.nextPos,u.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseInt(n,10)),t=n,dr[l]={nextPos:ir,result:t},t}function Lr(){var t,n,r,i,a,s,l,u,c=135*ir+15,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;if(a!==o)if(46===e.charCodeAt(ir)?(s=".",ir++):(s=o,0===cr&&_r(x)),s!==o){if(l=[],T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o)for(;u!==o;)l.push(u),T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M));else l=o;l!==o?r=i=[i,a,s,l]:(ir=r,r=o)}else ir=r,r=o;else ir=r,r=o}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseFloat(n)),t=n,dr[c]={nextPos:ir,result:t},t}function Rr(){var t,n,r,i,a,s,l,u,c,d=135*ir+17,h=dr[d];return h?(ir=h.nextPos,h.result):(cr++,t=ir,n=ir,r=ir,T.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(M)),i!==o?(T.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(M)),a!==o?(T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?r=i=[i,a,s,l]:(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o),(n=r!==o?e.substring(n,ir):r)!==o?(45===e.charCodeAt(ir)?(r="-",ir++):(r=o,0===cr&&_r(k)),r!==o?(i=ir,a=ir,T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?a=s=[s,l]:(ir=a,a=o)):(ir=a,a=o),(i=a!==o?e.substring(i,ir):a)!==o?(45===e.charCodeAt(ir)?(a="-",ir++):(a=o,0===cr&&_r(k)),a!==o?(s=ir,l=ir,T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o?(T.test(e.charAt(ir))?(c=e.charAt(ir),ir++):(c=o,0===cr&&_r(M)),c!==o?l=u=[u,c]:(ir=l,l=o)):(ir=l,l=o),(s=l!==o?e.substring(s,ir):l)!==o?(ar=t,t=n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||mr(ei("db.messages.parser.error-invalid-date-format",{str:hr()})),r}(n,i,s)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),cr--,t===o&&(n=o,0===cr&&_r(L)),dr[d]={nextPos:ir,result:t},t)}function Ar(){var t,n,r=135*ir+18,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"true"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(R)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"false"===e.substr(ir,5).toLowerCase()?(n=e.substr(ir,5),ir+=5):(n=o,0===cr&&_r(A)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}function Dr(){var t,n,r,i,a,s,l,u,c=135*ir+20,d=dr[c];if(d)return ir=d.nextPos,d.result;if(cr++,t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return cr--,t===o&&(n=o,0===cr&&_r(N)),dr[c]={nextPos:ir,result:t},t}function Nr(){var t,n,r,i,a,s,l,u,c=135*ir+21,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Pr(){var t,n,r,i,a,s,l,u,c=135*ir+22,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o&&(r=Nr())!==o?(ar=t,u=r,null!=(l=n)&&(l=l[0]),t=n={type:"columnName",name:u,relAlias:l}):(ir=t,t=o),t===o)if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o)if(91===e.charCodeAt(ir)?(r="[",ir++):(r=o,0===cr&&_r(F)),r!==o){if(i=ir,a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;(i=a!==o?e.substring(i,ir):a)!==o?(93===e.charCodeAt(ir)?(a="]",ir++):(a=o,0===cr&&_r(W)),a!==o?(ar=t,t=n=function(e,t){return null!=e&&(e=e[0]),{type:"columnName",name:parseInt(t,10),relAlias:e}}(n,i)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Ir(){var t,n,r,i=135*ir+25,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,961===e.charCodeAt(ir)?(r="ρ",ir++):(r=o,0===cr&&_r(K)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"rho"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r($)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Hr(){var t,n,r,i=135*ir+26,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8592===e.charCodeAt(ir)?(r="←",ir++):(r=o,0===cr&&_r(J)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"<-"===e.substr(ir,2)?(r="<-",ir+=2):(r=o,0===cr&&_r(Z)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Yr(){var t,n,r,i=135*ir+27,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8594===e.charCodeAt(ir)?(r="→",ir++):(r=o,0===cr&&_r(ee)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"->"===e.substr(ir,2)?(r="->",ir+=2):(r=o,0===cr&&_r(ne)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Fr(){var t,n,r,i=135*ir+30,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,947===e.charCodeAt(ir)?(r="γ",ir++):(r=o,0===cr&&_r(ae)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"gamma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(le)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Wr(){var t,n,r,i=135*ir+33,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,247===e.charCodeAt(ir)?(r="÷",ir++):(r=o,0===cr&&_r(pe)),r===o&&(47===e.charCodeAt(ir)?(r="/",ir++):(r=o,0===cr&&_r(ge))),r!==o&&(ar=n,r=ri("divisionOperator")),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),dr[i]={nextPos:ir,result:t},t)}function Br(){var t,n,r,i,a=135*ir+44,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=Dr())!==o?(ar=ir,i=n,(void ai.push(i)?o:void 0)!==o&&function(){var t,n,r,i,a=135*ir+19,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=kr())!==o?(61===e.charCodeAt(ir)?(r="=",ir++):(r=o,0===cr&&_r(D)),r!==o&&(i=kr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}()!==o&&(r=eo())!==o?(ar=t,t=n=function(e,t){return t.assignmentName=e,{type:"assignment",name:e,child:t,codeInfo:ti()}}(n,r)):(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}function Ur(){var e,t,n,r=135*ir+45,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Uo())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t={type:"namedColumnExpr",name:n,relAlias:null,child:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Uo())!==o?(ar=e,e=t=function(e,t){return{type:"namedColumnExpr",name:e,relAlias:null,child:t,codeInfo:ti()}}(t,n)):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&(ar=e,t=t),e=t)),dr[r]={nextPos:ir,result:e},e)}function zr(){var e,t,n,r=135*ir+48,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Pr())!==o?(ar=e,e=t={type:"colAssignment",src:n,dst:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t=function(e,t){return{type:"colAssignment",src:e,dst:t,codeInfo:ti()}}(t,n)):(ir=e,e=o)),dr[r]={nextPos:ir,result:e},e)}function Vr(){var t,n,r,i,a,s,l=135*ir+51,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,(n=Pr())!==o?(r=ir,(i=Or())!==o&&(a=function(){var t,n,r=135*ir+50,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"asc"===e.substr(ir,3).toLowerCase()?(n=e.substr(ir,3),ir+=3):(n=o,0===cr&&_r(Qe)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"desc"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(Ze)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}())!==o?r=i=[i,a]:(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(ir=t,t=o)):(ir=t,t=o),dr[l]={nextPos:ir,result:t},t)}function qr(){var t,n,r,i,a,s,l=135*ir+53,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,n=ir,"sum"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(et)),r===o&&("count"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(tt)),r===o&&("avg"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(nt)),r===o&&("min"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(rt)),r===o&&("max"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ot)))))),(n=r!==o?e.substring(n,ir):r)!==o?(40===e.charCodeAt(ir)?(r="(",ir++):(r=o,0===cr&&_r(it)),r!==o&&kr()!==o&&(i=Pr())!==o&&kr()!==o?(41===e.charCodeAt(ir)?(a=")",ir++):(a=o,0===cr&&_r(at)),a!==o?(ar=t,s=i,t=n={aggFunction:n.toUpperCase(),col:s}):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,"count(*)"===e.substr(ir,8).toLowerCase()?(n=e.substr(ir,8),ir+=8):(n=o,0===cr&&_r(st)),n!==o&&(ar=t,n={aggFunction:"COUNT_ALL",col:null}),t=n),dr[l]={nextPos:ir,result:t},t)}function Gr(){var e,t,n,r,i,a=135*ir+54,s=dr[a];return s?(ir=s.nextPos,s.result):(e=ir,(t=qr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,i=n,(r=t).name=i,e=t=r):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=qr())!==o?(ar=e,e=t=function(e,t){return t.name=e,t}(t,n)):(ir=e,e=o)),dr[a]={nextPos:ir,result:e},e)}function Kr(){var t,n,r,i,a,s,l,u,c=135*ir+55,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Gr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Xr(){var e,t,n=135*ir+56,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=So())!==o&&Or()!==o?(ar=ir,(function(e){if("valueExpr"===e.type&&"columnValue"===e.func&&!e.wrappedInParentheses&&null===e.args[1]){for(var t=0;tir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);c!==o;)u.push(c),c=ir,d=ir,cr++,h=Cr(),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);(l=u!==o?e.substring(l,ir):u)!==o?(ar=t,t=n=function(e,t,n){return{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o;if(t===o){if(t=ir,n=ir,cr++,r=ir,i=[],ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft)),a!==o)for(;a!==o;)i.push(a),ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft));else i=o;if(i!==o?("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),cr--,r!==o?(ir=n,n=void 0):n=o,n!==o){if(r=ir,i=[],pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt)),a!==o)for(;a!==o;)i.push(a),pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt));else i=o;if((r=i!==o?e.substring(r,ir):i)!==o)if(i=ir,64===e.charCodeAt(ir)?(a="@",ir++):(a=o,0===cr&&_r(yt)),a!==o&&(l=Jr())!==o?i=a=[a,l]:(ir=i,i=o),i===o&&(i=null),i!==o)if("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o){for(l=ir,u=[],"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));c!==o;)u.push(c),"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));(l=u!==o?e.substring(l,ir):u)!==o?("]]"===e.substr(ir,2)?(u="]]",ir+=2):(u=o,0===cr&&_r(_t)),u!==o?(ar=t,t=n=function(e,t,n){return n=(n=n.replace(/\\]]/g,"]]")).replace(/\\\\]]/g,"\\]]"),{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o}return dr[f]={nextPos:ir,result:t},t}function Zr(){var e,t,n,r,i,a,s=135*ir+62,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,kr()!==o)if((t=function(){var e,t,n,r,i,a,s,l,u=135*ir+59,c=dr[u];if(c)return ir=c.nextPos,c.result;if(e=ir,(t=Qr())!==o){for(n=[],r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,s=n,(l=[]).push(t),s.map((function(e){var t=e[1];l.push(t)})),e=t=l):(ir=e,e=o)}else ir=e,e=o;return dr[u]={nextPos:ir,result:e},e}())!==o){if(n=[],r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o),r!==o)for(;r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o);else n=o;n!==o?(ar=e,e=function(e,t){for(var n=[],r=0;r"group"===e.name);return void 0===o?mr(ei("db.messages.parser.error-group-header-name-missing")+': "group: ..........\\n"'):0===o.text.trim().length&&mr(ei("error-group-header-name-empty")),{type:"tableGroup",headers:e,assignments:n,codeInfo:ti()}}(t,n)):(ir=e,e=o)}else ir=e,e=o;else ir=e,e=o;return dr[s]={nextPos:ir,result:e},e}function eo(){var e,t,n,r,i=135*ir+63,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=to())!==o){if(n=[],(r=io())===o&&(r=ao()),r!==o)for(;r!==o;)n.push(r),(r=io())===o&&(r=ao());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=to()),dr[i]={nextPos:ir,result:e},e}function to(){var e,t,n,r,i=135*ir+64,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=no())!==o){if(n=[],(r=oo())!==o)for(;r!==o;)n.push(r),r=oo();else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=no()),dr[i]={nextPos:ir,result:e},e}function no(){var e,t,n,r,i=135*ir+65,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=ro())!==o){if(n=[],(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo()),r!==o)for(;r!==o;)n.push(r),(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=ro()),dr[i]={nextPos:ir,result:e},e}function ro(){var t,n=135*ir+66,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a=135*ir+86,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+29,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,964===e.charCodeAt(ir)?(r="τ",ir++):(r=o,0===cr&&_r(re)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"tau"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ie)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+52,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Vr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"orderBy",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+85,c=dr[u];if(c)return ir=c.nextPos,c.result;t=ir,(n=Fr())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+47,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Pr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o&&kr()!==o&&(s=Kr())!==o&&Or()!==o&&(l=ro())!==o?(ar=t,d=n,h=r,f=s,m=l,si.push(d),n={type:"groupBy",child:m,group:h,aggregate:f,codeInfo:ti()},t=n):(ir=t,t=o)):(ir=t,t=o);var d,h,f,m;t===o&&(t=ir,(n=Fr())!==o?(r=ir,(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o&&(i=kr())!==o&&(a=Kr())!==o&&Or()!==o&&(s=ro())!==o?(ar=t,n=function(e,t,n){return si.push(e),{type:"groupBy",child:n,group:[],aggregate:t,codeInfo:ti()}}(n,a,s),t=n):(ir=t,t=o)):(ir=t,t=o));return dr[u]={nextPos:ir,result:t},t}())===o&&(t=function(){var e,t,n,r,i=135*ir+84,a=dr[i];if(a)return ir=a.nextPos,a.result;e=ir,(t=Ir())!==o&&(n=Dr())!==o&&Or()!==o&&(r=ro())!==o?(ar=e,s=t,l=n,u=r,si.push(s),t={type:"renameRelation",child:u,newRelAlias:l,codeInfo:ti()},e=t):(ir=e,e=o);var s,l,u;return dr[i]={nextPos:ir,result:e},e}())===o&&(t=function(){var t,n,r,i,a=135*ir+83,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=Ir())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+49,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=zr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"renameColumns",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+82,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+24,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,963===e.charCodeAt(ir)?(r="σ",ir++):(r=o,0===cr&&_r(V)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"sigma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(G)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=So())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"selection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+81,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+23,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,960===e.charCodeAt(ir)?(r="π",ir++):(r=o,0===cr&&_r(B)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"pi"===e.substr(ir,2).toLowerCase()?(r=e.substr(ir,2),ir+=2):(r=o,0===cr&&_r(z)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+46,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Ur())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"projection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+67,s=dr[a];if(s)return ir=s.nextPos,s.result;(t=function(){var t,n,r,i,a,s,l,u,c,d=135*ir+105,h=dr[d];if(h)return ir=h.nextPos,h.result;t=ir,123===e.charCodeAt(ir)?(n="{",ir++):(n=o,0===cr&&_r(sn));if(n!==o)if(kr()!==o)if((r=function(){var e,t,n,r,i,a,s=135*ir+103,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=Eo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,t=function(e,t){for(var n,r=[e],o=0;o="===e.substr(ir,2)?(n=">=",ir+=2):(n=o,0===cr&&_r(kt));n===o&&(8805===e.charCodeAt(ir)?(n="≥",ir++):(n=o,0===cr&&_r(Tt)));n!==o&&(ar=t,n=">=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r=135*ir+94,i=dr[r];if(i)return ir=i.nextPos,i.result;t=ir,"<="===e.substr(ir,2)?(n="<=",ir+=2):(n=o,0===cr&&_r(xt));n===o&&(8804===e.charCodeAt(ir)?(n="≤",ir++):(n=o,0===cr&&_r(Lt)));n!==o&&(ar=t,n="<=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+93,r=dr[n];if(r)return ir=r.nextPos,r.result;62===e.charCodeAt(ir)?(t=">",ir++):(t=o,0===cr&&_r(Mt));return dr[n]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+95,r=dr[n];if(r)return ir=r.nextPos,r.result;60===e.charCodeAt(ir)?(t="<",ir++):(t=o,0===cr&&_r(Rt));return dr[n]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function vo(){var t,n=135*ir+90,r=dr[n];return r?(ir=r.nextPos,r.result):(61===e.charCodeAt(ir)?(t="=",ir++):(t=o,0===cr&&_r(D)),dr[n]={nextPos:ir,result:t},t)}function _o(){var t,n,r=135*ir+91,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"!="===e.substr(ir,2)?(n="!=",ir+=2):(n=o,0===cr&&_r(Ct)),n===o&&(8800===e.charCodeAt(ir)?(n="≠",ir++):(n=o,0===cr&&_r(St)),n===o&&("<>"===e.substr(ir,2)?(n="<>",ir+=2):(n=o,0===cr&&_r(Ot)))),n!==o&&(ar=t,n="!="),t=n,dr[r]={nextPos:ir,result:t},t)}function wo(){var t,n,r,i,a=135*ir+100,s=dr[a];return s?(ir=s.nextPos,s.result):(cr++,t=ir,(n=Mr())!==o?(44===e.charCodeAt(ir)?(r=",",ir++):(r=o,0===cr&&_r(Xe)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,(n=Mr())!==o?(59===e.charCodeAt(ir)?(r=";",ir++):(r=o,0===cr&&_r(jt)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+11,c=dr[u];if(c)return ir=c.nextPos,c.result;for(t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),t=n,dr[u]={nextPos:ir,result:t},t}())),cr--,t===o&&(n=o,0===cr&&_r(qt)),dr[a]={nextPos:ir,result:t},t)}function Eo(){var t,n,r,i,a,s,l,u=135*ir+101,c=dr[u];return c?(ir=c.nextPos,c.result):(t=ir,(n=Pr())!==o?(r=ir,58===e.charCodeAt(ir)?(i=":",ir++):(i=o,0===cr&&_r(mt)),i!==o?("string"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Gt)),a===o&&("number"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Kt)),a===o&&("date"===e.substr(ir,4).toLowerCase()?(a=e.substr(ir,4),ir+=4):(a=o,0===cr&&_r(Xt)),a===o&&("boolean"===e.substr(ir,7).toLowerCase()?(a=e.substr(ir,7),ir+=7):(a=o,0===cr&&_r($t))))),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,l=r,t=n={name:(s=n).name,relAlias:s.relAlias,type:null===l?null:l[1].toLowerCase()}):(ir=t,t=o)):(ir=t,t=o),dr[u]={nextPos:ir,result:t},t)}function jo(){var t,n,r,i,a,s=135*ir+102,l=dr[s];if(l)return ir=l.nextPos,l.result;if(t=ir,(n=Rr())!==o&&(ar=t,n={type:"date",value:n}),(t=n)===o&&(t=ir,"null"===e.substr(ir,4)?(n="null",ir+=4):(n=o,0===cr&&_r(Jt)),n===o&&("NULL"===e.substr(ir,4)?(n="NULL",ir+=4):(n=o,0===cr&&_r(Qt))),n!==o&&(ar=t,n={type:"null",value:null}),(t=n)===o&&(t=ir,(n=Ar())!==o?(r=ir,cr++,(i=wo())===o&&(i=Cr())===o&&(125===e.charCodeAt(ir)?(i="}",ir++):(i=o,0===cr&&_r(Zt))),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n={type:"boolean",value:n,quoted:!1}):(ir=t,t=o)):(ir=t,t=o),t===o))){if(t=ir,n=ir,r=[],en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn)),i!==o)for(;i!==o;)r.push(i),en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn));else r=o;if((n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=function(e){return{type:"string",value:e,quoted:!1}}(n)),(t=n)===o){if(t=ir,39===e.charCodeAt(ir)?(n="'",ir++):(n=o,0===cr&&_r(C)),n!==o){for(r=ir,i=[],S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));a!==o;)i.push(a),S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));(r=i!==o?e.substring(r,ir):i)!==o?(39===e.charCodeAt(ir)?(i="'",ir++):(i=o,0===cr&&_r(C)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;if(t===o)if(t=ir,34===e.charCodeAt(ir)?(n='"',ir++):(n=o,0===cr&&_r(rn)),n!==o){for(r=ir,i=[],on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));a!==o;)i.push(a),on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));(r=i!==o?e.substring(r,ir):i)!==o?(34===e.charCodeAt(ir)?(i='"',ir++):(i=o,0===cr&&_r(rn)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o}}return dr[s]={nextPos:ir,result:t},t}function Co(){var e,t,n,r,i,a,s=135*ir+104,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=jo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,e=t=function(e,t){for(var n=[e],r=0;r0){for(t=1,r=1;t",!1),qe=Qn("!=",!1),Ge=Qn(">=",!1),Ke=Qn(">",!1),Xe=Qn("<=",!1),$e=Qn("<",!1),Je=er("logical AND"),Qe=Qn("and",!0),Ze=er("logical XOR"),et=Qn("xor",!0),tt=er("logical OR"),nt=Qn("or",!0),rt=er("logical NOT"),ot=Qn("!",!1),it=(Qn("not",!1),Qn("exists",!0)),at=Qn("#",!1),st=/^[^\n]/,lt=Zn(["\n"],!0,!1),ut=Qn("`",!1),ct=Qn("drop",!0),dt=Qn("table",!0),ht=Qn("if",!0),ft=Qn("lock",!0),mt=Qn("tables",!0),pt=Qn("unlock",!0),gt=Qn("use",!0),yt=/^[a-zA-Z_0-9\-]/,bt=Zn([["a","z"],["A","Z"],"_",["0","9"],"-"],!1,!1),vt=Qn("decimal",!0),_t=Qn("tinyint",!0),wt=Qn("smallint",!0),Et=Qn("mediumint",!0),jt=Qn("bigint",!0),Ct=Qn("integer",!0),St=Qn("int",!0),Ot=Qn("float",!0),kt=Qn("double",!0),Tt=Qn("varchar",!0),Mt=Qn("char",!0),xt=Qn("text",!0),Lt=Qn("datetime",!0),Rt=/^[a-zA-Z0-9_=]/,At=Zn([["a","z"],["A","Z"],["0","9"],"_","="],!1,!1),Dt=Qn("create",!0),Nt=Qn("exists",!1),Pt=Qn("null",!0),It=Qn("insert",!0),Ht=Qn("into",!0),Yt=Qn("values",!0),Ft=er("boolean expression"),Wt=Qn("||",!1),Bt=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:No()}},Ut=Qn("like",!0),zt=Qn("ilike",!0),Vt=Qn("+",!1),qt=Qn("/",!1),Gt=Qn("%",!1),Kt=Qn("coalesce",!0),Xt=Qn("concat",!0),$t=Qn("adddate",!0),Jt=Qn("subdate",!0),Qt=Qn("mod",!0),Zt=Qn("add",!0),en=Qn("sub",!0),tn=Qn("mul",!0),nn=Qn("div",!0),rn=Qn("upper",!0),on=Qn("ucase",!0),an=Qn("lower",!0),sn=Qn("lcase",!0),ln=Qn("length",!0),un=Qn("abs",!0),cn=Qn("floor",!0),dn=Qn("ceil",!0),hn=Qn("round",!0),fn=Qn("year",!0),mn=Qn("month",!0),pn=Qn("day",!0),gn=Qn("hour",!0),yn=Qn("minute",!0),bn=Qn("second",!0),vn=Qn("dayofmonth",!0),_n=Qn("rand",!0),wn=Qn("rownum",!0),En=Qn("now",!0),jn=Qn("current_timestamp",!0),Cn=Qn("transaction_timestamp",!0),Sn=Qn("statement_timestamp",!0),On=Qn("clock_timestamp",!0),kn=Qn("sysdate",!0),Tn=Qn("case",!0),Mn=Qn("when",!0),xn=Qn("then",!0),Ln=function(e,t){return{w:e,t:t}},Rn=Qn("else",!0),An=Qn("end",!0),Dn=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=No();for(var o=1;oqn&&(qn=Un,Gn=[]),Gn.push(e))}function or(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function ir(){var e,t,n,r=113*Un+0,i=Xn[r];return i?(Un=i.nextPos,i.result):(e=Un,(t=kr())!==o&&(zn=e,t=t),(e=t)===o&&(e=Un,(t=kr())!==o&&(n=ur())!==o?(zn=e,e=t=t):(Un=e,e=o),e===o&&(e=Un,(t=ur())!==o&&(n=kr())!==o?(zn=e,e=t=n):(Un=e,e=o))),Xn[r]={nextPos:Un,result:e},e)}function ar(){var t,n,r=113*Un+2,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,Kn++,e.length>Un?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(s)),Kn--,n===o?t=void 0:(Un=t,t=o),Xn[r]={nextPos:Un,result:t},t)}function sr(){var t,n=113*Un+3,r=Xn[n];return r?(Un=r.nextPos,r.result):("\r\n"===e.substr(Un,2)?(t="\r\n",Un+=2):(t=o,0===Kn&&rr(l)),t===o&&(10===e.charCodeAt(Un)?(t="\n",Un++):(t=o,0===Kn&&rr(u))),Xn[n]={nextPos:Un,result:t},t)}function lr(){var t,n=113*Un+4,r=Xn[n];return r?(Un=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=113*Un+5,g=Xn[p];if(g)return Un=g.nextPos,g.result;Kn++,t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d));n!==o?(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o?(i=Un,Kn++,(a=sr())===o&&(a=ar()),Kn--,a!==o?(Un=i,i=void 0):i=o,i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);if(t===o&&(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o?(r=Un,Kn++,(i=sr())===o&&(i=ar()),Kn--,i!==o?(Un=r,r=void 0):r=o,r!==o?t=n=[n,r]:(Un=t,t=o)):(Un=t,t=o),t===o))if(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o)if(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o){for(i=Un,a=[],l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);l!==o;)a.push(l),l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);(i=a!==o?e.substring(i,Un):a)!==o?(a=Un,Kn++,(l=sr())===o&&(l=ar()),Kn--,l!==o?(Un=a,a=void 0):a=o,a!==o?t=n=[n,r,i,a]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;Kn--,t===o&&(n=o,0===Kn&&rr(c));return Xn[p]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u=113*Un+6,c=Xn[u];if(c)return Un=c.nextPos,c.result;t=Un,"/*"===e.substr(Un,2)?(n="/*",Un+=2):(n=o,0===Kn&&rr(m));if(n!==o){for(r=[],i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);r!==o?("*/"===e.substr(Un,2)?(i="*/",Un+=2):(i=o,0===Kn&&rr(p)),i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Xn[u]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function ur(){var t,n,r,i,a,s,l,u=113*Un+7,c=Xn[u];if(c)return Un=c.nextPos,c.result;for(Kn++,t=Un,n=[],r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o}else n=o;return n!==o&&(zn=t,n=""),Kn--,(t=n)===o&&(n=o,0===Kn&&rr(g)),Xn[u]={nextPos:Un,result:t},t}function cr(){var t,n,r=113*Un+8,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));n!==o;)t.push(n),(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));return Kn--,t===o&&(n=o,0===Kn&&rr(v)),Xn[r]={nextPos:Un,result:t},t}function dr(){var t,n,r=113*Un+9,i=Xn[r];if(i)return Un=i.nextPos,i.result;if(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E)),n!==o)for(;n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));else t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(_)),Xn[r]={nextPos:Un,result:t},t}function hr(){var t,n,r=113*Un+10,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));return Kn--,t===o&&(n=o,0===Kn&&rr(j)),Xn[r]={nextPos:Un,result:t},t}function fr(){var t,n,r,i,a,s=113*Un+11,l=Xn[s];if(l)return Un=l.nextPos,l.result;if(Kn++,t=Un,34===e.charCodeAt(Un)?(n='"',Un++):(n=o,0===Kn&&rr(S)),n!==o){for(r=[],O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));i!==o;)r.push(i),O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));r!==o?(34===e.charCodeAt(Un)?(i='"',Un++):(i=o,0===Kn&&rr(S)),i!==o?(zn=t,t=n=void Jn(i18n.t("db.messages.parser.error-sql-string-use-single-quotes"))):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;if(t===o)if(t=Un,39===e.charCodeAt(Un)?(n="'",Un++):(n=o,0===Kn&&rr(T)),n!==o){for(r=Un,i=[],M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));a!==o;)i.push(a),M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));(r=i!==o?e.substring(r,Un):i)!==o?(39===e.charCodeAt(Un)?(i="'",Un++):(i=o,0===Kn&&rr(T)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(C)),Xn[s]={nextPos:Un,result:t},t}function mr(){var t,n,r,i,a,s,l=113*Un+12,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(L)),i===o&&(i=null),i!==o){if(a=[],R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseInt(n,10)),t=n,Xn[l]={nextPos:Un,result:t},t}function pr(){var t,n,r,i,a,s,l,u,c=113*Un+13,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(L)),i===o&&(i=null),i!==o){if(a=[],R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;if(a!==o)if(46===e.charCodeAt(Un)?(s=".",Un++):(s=o,0===Kn&&rr(D)),s!==o){if(l=[],R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o)for(;u!==o;)l.push(u),R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A));else l=o;l!==o?r=i=[i,a,s,l]:(Un=r,r=o)}else Un=r,r=o;else Un=r,r=o}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseFloat(n)),t=n,Xn[c]={nextPos:Un,result:t},t}function gr(){var e,t=113*Un+14,n=Xn[t];return n?(Un=n.nextPos,n.result):((e=pr())===o&&(e=mr()),Xn[t]={nextPos:Un,result:e},e)}function yr(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+16,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(Kn++,t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-relation-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(I)),Xn[h]={nextPos:Un,result:t},t}function br(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+17,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-column-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Xn[h]={nextPos:Un,result:t},t}function vr(){var t,n,r,i,a,s=113*Un+19,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,"date"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(B)),n!==o?("('"===e.substr(Un,2)?(r="('",Un+=2):(r=o,0===Kn&&rr(U)),r!==o&&(i=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+20,h=Xn[d];if(h)return Un=h.nextPos,h.result;Kn++,t=Un,n=Un,r=Un,R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));i!==o?(R.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(A)),a!==o?(R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(R.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o);n=r!==o?e.substring(n,Un):r;n!==o?(45===e.charCodeAt(Un)?(r="-",Un++):(r=o,0===Kn&&rr(L)),r!==o?(i=Un,a=Un,R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(R.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),(i=a!==o?e.substring(i,Un):a)!==o?(45===e.charCodeAt(Un)?(a="-",Un++):(a=o,0===Kn&&rr(L)),a!==o?(s=Un,l=Un,R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o?(R.test(e.charAt(Un))?(c=e.charAt(Un),Un++):(c=o,0===Kn&&rr(A)),c!==o?l=u=[u,c]:(Un=l,l=o)):(Un=l,l=o),(s=l!==o?e.substring(s,Un):l)!==o?(zn=t,n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||Jn(i18n.t("db.messages.parser.error-invalid-date-format",{str:$n()})),r}(n,i,s),t=n):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);Kn--,t===o&&(n=o,0===Kn&&rr(V));return Xn[d]={nextPos:Un,result:t},t}())!==o?("')"===e.substr(Un,2)?(a="')",Un+=2):(a=o,0===Kn&&rr(z)),a!==o?(zn=t,t=n=i):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function _r(){var t,n,r,i,a,s=113*Un+21,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o&&(r=br())!==o?(zn=t,t=n={type:"column",name:r,relAlias:(a=n)?a[0]:null}):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function wr(){var t,n,r,i,a=113*Un+23,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,n=Un,r=[],R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A)),i!==o)for(;i!==o;)r.push(i),R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));else r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n={type:"column",name:parseInt(n,10),relAlias:null}),t=n,Xn[a]={nextPos:Un,result:t},t}function Er(){var t,n,r,i,a,s,l,u,c=113*Un+24,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,n=Un,"sum"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(G)),r===o&&("count"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(K)),r===o&&("avg"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(X)),r===o&&("min"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr($)),r===o&&("max"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(J)))))),(n=r!==o?e.substring(n,Un):r)!==o?(40===e.charCodeAt(Un)?(r="(",Un++):(r=o,0===Kn&&rr(Q)),r!==o&&cr()!==o?(i=Un,"all"===e.substr(Un,3).toLowerCase()?(a=e.substr(Un,3),Un+=3):(a=o,0===Kn&&rr(Z)),a!==o&&(s=ur())!==o?i=a=[a,s]:(Un=i,i=o),i===o&&(i=null),i!==o&&(a=_r())!==o&&(s=cr())!==o?(41===e.charCodeAt(Un)?(l=")",Un++):(l=o,0===Kn&&rr(ee)),l!==o?(zn=t,u=a,t=n={type:"aggFunction",aggFunction:n.toUpperCase(),col:u}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,"count(*)"===e.substr(Un,8).toLowerCase()?(n=e.substr(Un,8),Un+=8):(n=o,0===Kn&&rr(te)),n!==o&&(zn=t,n={type:"aggFunction",aggFunction:"COUNT_ALL",col:null}),t=n),Xn[c]={nextPos:Un,result:t},t)}function jr(){var t,n,r,i,a,s,l,u,c=113*Un+25,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=Er())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,s=i,(a=n).name=s,t=n=a):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Er())!==o&&cr()!==o?(zn=t,t=n=void Jn("aggregation columns must be named")):(Un=t,t=o),t===o&&(t=Un,(n=function(){var t,n,r,i,a,s=113*Un+22,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o?(42===e.charCodeAt(Un)?(r="*",Un++):(r=o,0===Kn&&rr(q)),r!==o?(zn=t,t=n={type:"column",name:"*",relAlias:(a=n)?a[0]:null}):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}())!==o&&(zn=t,n=re(n)),(t=n)===o&&(t=Un,(n=_r())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,u=i,(l=n).alias=u,t=n=l):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Co())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,t=n=function(e,t){return{type:"namedColumnExpr",name:t,relAlias:null,child:e,codeInfo:No()}}(n,i)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=_r())!==o&&(zn=t,n=re(n)),t=n))))),Xn[c]={nextPos:Un,result:t},t)}function Cr(){var t,n,r,i,a,s,l=113*Un+29,u=Xn[l];return u?(Un=u.nextPos,u.result):(t=Un,(n=_r())===o&&(n=wr()),n!==o?(r=Un,(i=ur())!==o&&(a=function(){var t,n,r=113*Un+28,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,"asc"===e.substr(Un,3).toLowerCase()?(n=e.substr(Un,3),Un+=3):(n=o,0===Kn&&rr(ie)),n!==o&&(zn=t,n=!0),(t=n)===o&&(t=Un,"desc"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ae)),n!==o&&(zn=t,n=!1),t=n),Xn[r]={nextPos:Un,result:t},t)}())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(Un=t,t=o)):(Un=t,t=o),Xn[l]={nextPos:Un,result:t},t)}function Sr(){var t,n,r,i,a,s,l,u,c=113*Un+30,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,(n=Cr())!==o){for(r=[],i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);r!==o?(zn=t,t=n=function(e,t){var n=[e];if(null!=t)for(var r in t)n.push(t[r][3]);return{value:n,codeInfo:No()}}(n,r)):(Un=t,t=o)}else Un=t,t=o;return Xn[c]={nextPos:Un,result:t},t}function Or(){var t,n,r,i,a,s,l,u,c=113*Un+32,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=yr())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&cr()!==o?(40===e.charCodeAt(Un)?(i="(",Un++):(i=o,0===Kn&&rr(Q)),i!==o&&(a=xr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,l=n,(u=a).wrappedInParentheses=!0,t=n={type:"assignment",name:l,child:{type:"relationFromSubstatement",statement:u,relAlias:l,codeInfo:No()},codeInfo:No()}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function kr(){var t,n,r,i,a=113*Un+33,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,(n=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+34,h=Xn[d];if(h)return Un=h.nextPos,h.result;t=Un,"with"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ue));if(n!==o)if(ur()!==o)if((r=Or())!==o){for(i=[],a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);a!==o;)i.push(a),a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);i!==o?(zn=t,n=function(e,t){for(var n=[e],r=0;r0&&i!=e.arg.length&&null===r&&Jn(i18n.t("db.messages.parser.error-sql-group-by-missing")),o&&!r&&0===i&&Jn(i18n.t("db.messages.parser.error-sql-having-without-group-by")),{type:"statement",select:e,from:t,where:n?n[1]:null,groupBy:r?r[5]:null,having:o?o[1]:null,numAggregationColumns:i,wrappedInParentheses:!1,codeInfo:No()}}(n,i,a,s,l)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&cr()!==o&&(r=xr())!==o&&cr()!==o?(41===e.charCodeAt(Un)?(i=")",Un++):(i=o,0===Kn&&rr(ee)),i!==o?(zn=t,t=n=ye(r)):(Un=t,t=o)):(Un=t,t=o)),Xn[m]={nextPos:Un,result:t},t)}function Dr(){var t,n,r,i,a=113*Un+41,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("union"===e.substr(Un,5).toLowerCase()?(n=e.substr(Un,5),Un+=5):(n=o,0===Kn&&rr(be)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"union",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Nr(){var t,n,r,i,a=113*Un+42,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("except"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(_e)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"except",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Pr(){var t,n,r,i,a=113*Un+43,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("intersect"===e.substr(Un,9).toLowerCase()?(n=e.substr(Un,9),Un+=9):(n=o,0===Kn&&rr(we)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"intersect",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Ir(){var e,t,n,r,i=113*Un+44,a=Xn[i];if(a)return Un=a.nextPos,a.result;if(e=Un,(t=Hr())!==o){if(n=[],(r=Yr())===o&&(r=Fr())===o&&(r=Wr()),r!==o)for(;r!==o;)n.push(r),(r=Yr())===o&&(r=Fr())===o&&(r=Wr());else n=o;n!==o?(zn=e,e=t=me(t,n)):(Un=e,e=o)}else Un=e,e=o;return e===o&&(e=Hr()),Xn[i]={nextPos:Un,result:e},e}function Hr(){var t,n,r,i,a,s,l,u,c,d,h,f=113*Un+45,m=Xn[f];return m?(Un=m.nextPos,m.result):(t=Un,(n=yr())!==o?(r=Un,(i=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ne)),a!==o&&(s=ur())!==o&&(l=yr())!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,d=r,h={type:"relation",name:n,relAlias:null,codeInfo:No()},t=n=null!==d?{type:"renameRelation",child:h,newRelAlias:d[3],codeInfo:No()}:h):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=xr())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o&&(l=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(u=e.substr(Un,2),Un+=2):(u=o,0===Kn&&rr(ne)),u!==o&&ur()!==o&&(c=yr())!==o?(zn=t,t=n=function(e,t){return e.wrappedInParentheses=!0,{type:"relationFromSubstatement",statement:e,relAlias:t,codeInfo:No()}}(i,c)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=Ir())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,t=n=ye(i)):(Un=t,t=o)):(Un=t,t=o))),Xn[f]={nextPos:Un,result:t},t)}function Yr(){var t,n,r,i,a,s,l,u=113*Un+46,c=Xn[u];return c?(Un=c.nextPos,c.result):(t=Un,n=Un,(r=ur())!==o?("cross"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Ee)),i!==o&&(a=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(s=e.substr(Un,4),Un+=4):(s=o,0===Kn&&rr(je)),s!==o&&(l=ur())!==o?n=r=[r,i,a,s,l]:(Un=n,n=o)):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,(r=cr())!==o?(44===e.charCodeAt(Un)?(i=",",Un++):(i=o,0===Kn&&rr(oe)),i!==o&&(a=cr())!==o?n=r=[r,i,a]:(Un=n,n=o)):(Un=n,n=o)),n!==o&&(r=Hr())!==o?(zn=t,t=n={type:"crossJoin",child2:r,cond:null}):(Un=t,t=o),Xn[u]={nextPos:Un,result:t},t)}function Fr(){var t,n,r,i,a=113*Un+47,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("natural"===e.substr(Un,7).toLowerCase()?(n=e.substr(Un,7),Un+=7):(n=o,0===Kn&&rr(Ce)),n!==o&&ur()!==o?("join"===e.substr(Un,4).toLowerCase()?(r=e.substr(Un,4),Un+=4):(r=o,0===Kn&&rr(je)),r!==o&&ur()!==o&&(i=Hr())!==o?(zn=t,t={type:"naturalJoin",child2:i,cond:null}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Wr(){var t,n,r,i,a,s,l,u,c,d,h,f,m,p,g,y=113*Un+48,b=Xn[y];if(b)return Un=b.nextPos,b.result;if(t=Un,ur()!==o)if(n=Un,r=Un,"inner"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Se)),i!==o&&(a=ur())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?("join"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(je)),i!==o?(zn=n,n=r="innerJoin"):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,r=Un,"left"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Oe)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="leftOuterJoin"),(n=r)===o&&(n=Un,r=Un,"right"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Te)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="rightOuterJoin"),(n=r)===o&&(n=Un,r=Un,"full"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Me)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="fullOuterJoin"),n=r))),n!==o)if((r=ur())!==o)if((i=Hr())!==o)if((a=ur())!==o){if(s=Un,"on"===e.substr(Un,2).toLowerCase()?(l=e.substr(Un,2),Un+=2):(l=o,0===Kn&&rr(xe)),l!==o&&ur()!==o&&(u=io())!==o?(zn=s,s=l=u):(Un=s,s=o),s===o){if(s=Un,"using"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(Le)),l!==o)if(cr()!==o)if(40===e.charCodeAt(Un)?(u="(",Un++):(u=o,0===Kn&&rr(Q)),u!==o)if(cr()!==o)if((c=br())!==o){for(d=[],h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);h!==o;)d.push(h),h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);d!==o&&(h=cr())!==o?(41===e.charCodeAt(Un)?(f=")",Un++):(f=o,0===Kn&&rr(ee)),f!==o?(zn=s,s=l=function(e,t,n,r){for(var o=[n],i=0;i"===e.substr(Un,2)?(n="<>",Un+=2):(n=o,0===Kn&&rr(Ve));n===o&&("!="===e.substr(Un,2)?(n="!=",Un+=2):(n=o,0===Kn&&rr(qe)));n!==o&&(zn=t,n="!=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+60,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,">="===e.substr(Un,2)?(n=">=",Un+=2):(n=o,0===Kn&&rr(Ge));n!==o&&(zn=t,n=">=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+62,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,"<="===e.substr(Un,2)?(n="<=",Un+=2):(n=o,0===Kn&&rr(Xe));n!==o&&(zn=t,n="<=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+61,r=Xn[n];if(r)return Un=r.nextPos,r.result;62===e.charCodeAt(Un)?(t=">",Un++):(t=o,0===Kn&&rr(Ke));return Xn[n]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+63,r=Xn[n];if(r)return Un=r.nextPos,r.result;60===e.charCodeAt(Un)?(t="<",Un++):(t=o,0===Kn&&rr($e));return Xn[n]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function qr(){var t,n,r,i,a=113*Un+69,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,(n=hr())!==o&&lr()!==o&&(r=hr())!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i===o&&(i=null),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o),t===o)if(t=Un,35===e.charCodeAt(Un)?(n="#",Un++):(n=o,0===Kn&&rr(at)),n!==o)if(hr()!==o){for(r=[],st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));i!==o;)r.push(i),st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));r!==o?(10===e.charCodeAt(Un)?(i="\n",Un++):(i=o,0===Kn&&rr(u)),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;return Xn[a]={nextPos:Un,result:t},t}function Gr(){var t,n,r,i,a=113*Un+70,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,96===e.charCodeAt(Un)?(n="`",Un++):(n=o,0===Kn&&rr(ut)),n!==o&&(r=yr())!==o?(96===e.charCodeAt(Un)?(i="`",Un++):(i=o,0===Kn&&rr(ut)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=yr())!==o&&(zn=t,n=n),t=n),Xn[a]={nextPos:Un,result:t},t)}function Kr(){var t,n,r,i,a,s,l,u,c=113*Un+71,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,"drop"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ct)),n!==o&&dr()!==o?("table"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(dt)),r!==o&&dr()!==o?(i=Un,"if"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ht)),a!==o&&(s=dr())!==o?("exists"===e.substr(Un,6).toLowerCase()?(l=e.substr(Un,6),Un+=6):(l=o,0===Kn&&rr(it)),l!==o&&(u=dr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o),i===o&&(i=null),i!==o&&(a=Gr())!==o&&(s=hr())!==o?(59===e.charCodeAt(Un)?(l=";",Un++):(l=o,0===Kn&&rr(se)),l!==o?(zn=t,t=n={type:"dropTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function Xr(){var t,n,r,i,a,s,l=113*Un+72,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,"lock"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ft)),n!==o)if(dr()!==o)if("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o)if(dr()!==o)if(Gr()!==o)if(dr()!==o){if(i=[],F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W)),a!==o)for(;a!==o;)i.push(a),F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W));else i=o;i!==o&&(a=hr())!==o?(59===e.charCodeAt(Un)?(s=";",Un++):(s=o,0===Kn&&rr(se)),s!==o?(zn=t,t=n={type:"lockTable"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;return Xn[l]={nextPos:Un,result:t},t}function $r(){var t,n,r,i,a=113*Un+73,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,"unlock"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(pt)),n!==o&&dr()!==o?("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o&&hr()!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i!==o?(zn=t,t=n={type:"unlockTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Jr(){var e,t,n,r,i,a=113*Un+74,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(e=Un,hr()!==o){if(t=[],n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o),n!==o)for(;n!==o;)t.push(n),n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o);else t=o;t!==o&&(n=hr())!==o?(zn=e,e=function(e){var t,n,r,o,i,a,s={},l={},u="";for(n=0;n!0===n.evaluate(e,t,r,o),this._checkSchema(e,t)}_getResult(e,t){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator)throw new Error("check not called");const n=new c.a;return n.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),n,this._isRightJoin,this._isAntiJoin,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),!0===t&&n.eliminateDuplicateRows(),this.setResultNumRows(n.getNumRows()),n}static createNullArray(e){return new Array(e).fill(null)}static getCheckedEvaluatorBooleanExpression(e,t,n,r){if(n.check(e,t),"boolean"!==n.getDataType())throw new m.a("db.messages.exec.error-condition-must-be-boolean",r);return function(e,t,r,o){return!0===n.evaluate(e,t,r,o)}}static getCheckedEvaluatorNaturalJoin(e,t,n,r){}static calcNestedLoopJoin(e,t,n,r,o,i,a,s,l){const u=t.getResult(e),c=n.getResult(e),d=u.getNumRows(),h=c.getNumRows(),f=u.getNumCols();c.getNumCols();if(!1===o){let t;null!==l&&(t=p.createNullArray(r.getSchema().getSize()-f));const n={};for(let o=0;o0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}getArgumentHtml(){return""}}class y extends u.c{constructor(e,t){super("π",e),this._checked=null,this._columns=t}getSchema(){if(null===this._columns)return this._child.getSchema();if(null===this._checked)throw new Error("check has not been called");return this._checked._projectedSchema}getResult(e){if(e=this._returnOrCreateSession(e),null===this._checked)throw new Error("check has not been called");const{_indices:t}=this._checked;if(null===this._columns)return this._child.getResult(e);const n=this._child.getResult(e),r=new c.a;r.setSchema(this.getSchema());const o=r.getNumCols(),i=n.getNumRows();let a,s,l,u;for(a=0;a-1&&o.removeColumn(n)}o.getSize()===n&&this.throwExecutionError(i18n.t("db.messages.exec.error-schema-a-not-part-of-schema-b",{schemaA:t,schemaB:e})),this._delegate=new d(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),new y(new d(new g(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),this._child2).setCodeInfoObject(this._codeInfo),this._child).setCodeInfoObject(this._codeInfo),o.getColumns()).setCodeInfoObject(this._codeInfo)),this._delegate.check()}}class v extends u.c{constructor(e,t,n){super("γ",e),this.checked=null,this.groupByCols=t,this.aggregateFunctions=n}getSchema(){if(null===this.checked)throw new Error("check not called");return this.checked.schema}check(){this._child.check();const e=this._child.getSchema(),t=new Array(this.groupByCols.length),n=Array(this.aggregateFunctions.length);for(let n=0;nl.a.printColumn(e.name,e.relAlias)),t=this.aggregateFunctions.map(e=>`${"COUNT_ALL"===e.aggFunction?"COUNT(*)":`${e.aggFunction}(${l.a.printColumn(e.col.name,e.col.relAlias)})`}→${e.name}`);return`${e.join(", ")}; ${t.join(", ")}`}getResult(e){if(e=this._returnOrCreateSession(e),null===this.checked)throw new Error("check not called");const t=this.getChild().getResult(e),n=new c.a;n.setSchema(this.checked.schema);let r,o=0;if(this.groupByCols.length>0){const e={};for(let n=0;nt?e:t};let s,l,u,d;for(let e=0;e0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator||null===this._rowCreatorMatched||null===this._rowCreatorNotMatched)throw new Error("check not called");const t=new c.a;return t.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!1,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!0,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}}class j extends p{constructor(e,t,n){super(e,t,"⨝",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class C extends p{constructor(e,t,n){super(e,t,"⟕",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class S extends p{constructor(e,t,n){super(e,t,"⟖",n,!0)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!1,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class O extends p{constructor(e,t,n){super(e,t,n?"⋉":"⋊",{type:"natural",restrictToColumns:null},!n)}_checkSchema(e,t){this._isRightJoin?(this._schema=t.copy(),this._rowCreatorMatched=function(e,t){return t}):(this._schema=e.copy(),this._rowCreatorMatched=function(e,t){return e}),this._rowCreatorNotMatched=null}getResult(e){return super._getResult(e,!0)}}class k extends u.c{constructor(e,t,n){if(super("τ",e),this._orderCols=t,this._orderAsc=n,this._orderAsc.length!==this._orderCols.length)throw new Error("order cols not correct");this._orderIndices=null}getSchema(){return this._child.getSchema()}getResult(e){if(e=this._returnOrCreateSession(e),null===this._orderIndices)throw new Error("check not called");const t=this.getChild().getResult(e).copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t.sort(this._orderIndices,this._orderAsc),t}check(){this._child.check();const e=this._child.getSchema();this._orderIndices=[];for(let t=0;t0){const n=[],r=e.groupBy||[];for(let e=0;e0)a=new v(a,r,n);else{const e=[];for(let t=0;t",[new f.c("number","rownum",[]),new f.c("number","constant",[o])]);if(-1===n)a=new L(r(t.child),i);else{const e=new f.c("boolean","<=",[new f.c("number","rownum",[]),new f.c("number","constant",[n+o])]);a=new L(r(t.child),new f.c("boolean","and",[i,e]))}break}default:throw new Error(`type ${e.type} not implemented`)}if(!a)throw new Error("should not happen");return!0===e.wrappedInParentheses&&a.setWrappedInParentheses(!0),n(a,e),a}function o(e,t,n){e.check();const r=new L(e,N(t));return r.setCodeInfoObject(n),r}function i(e){return"column"===e.type&&e.alias}return r(e.child)}function N(e){let t;if("null"===e.datatype&&"columnValue"===e.func)t=new f.b(e.args[0],e.args[1]);else switch(e.datatype){case"string":case"number":case"boolean":case"date":case"null":const n=[];for(let t=0;t{"relation"!==e.type||void 0!==t&&!1!==t.has(e.name)||n.push({name:e.name,line:e.codeInfo.location.start.line,column:e.codeInfo.location.start.column})}),n}function B(e,t){const n=Y.a.isMap(t)?t:Y.a().withMutations(e=>{for(const n of Object.keys(t))e.set(n,t[n])}).asImmutable();if(0===e.assignments.length)return;const r=new Map;Y.c().withMutations(t=>{for(let n=0;n{if(!0===i.get(e))return;if(!0===o.get(e))throw new Error(s.a("db.messages.translate.error-variable-cyclic-usage",{name:e}));o.set(e,!0);const t=r.get(e);if(void 0!==t){const{childRelations:e}=t;for(let t=0;t{if("relation"===e.type&&e.name===t.name){return Object.assign(Object.assign({},t.child),{metaData:Object.assign(Object.assign({},t.child.metaData),{fromVariable:t.name})})}return e});e=Object.assign(Object.assign({},e),{child:n})}r.set(e.name,e)}for(const[,t]of r)e.assignments[t.assignmentIndex].child=t.child;if(("relalgRoot"===e.type||"sqlRoot"===e.type)&&null!==e.child&&void 0!==e.child)for(const[t,n]of r)e.child=Object(F.b)(e.child,e=>"relation"===e.type&&e.name===t?Object.assign(Object.assign({},n.child),{metaData:Object.assign(Object.assign({},n.child.metaData),{fromVariable:t})}):e)}var U=n("./src/db/translate/textFromAst.ts");function z(e,t,n,r){if("none"===r)return{query:e,cursor:n};const o={math2plain:{pi:"pi",sigma:"sigma",rho:"rho",arrowLeft:"<-",arrowRight:"->",psi:"psi",tau:"tau",gamma:"gamma",unionOperator:"union",intersectOperator:"intersect",divisionOperator:"/",differenceOperator:"-",crossJoinOperator:"cross join",innerJoinOperator:"inner join",naturalJoinOperator:"natural join",leftSemiJoinOperator:"left semi join",rightSemiJoinOperator:"right semi join",antiJoinOperator:"anti join",leftOuterJoinOperator:"left outer join",rightOuterJoinOperator:"right outer join",fullOuterJoinOperator:"full outer join"},plain2math:{pi:"π",sigma:"σ",rho:"ρ",arrowLeft:"←",arrowRight:"→",psi:"ψ",tau:"τ",gamma:"γ",unionOperator:"∪",intersectOperator:"∩",divisionOperator:"÷",differenceOperator:"-",crossJoinOperator:"⨯",innerJoinOperator:"⨝",naturalJoinOperator:"⨝",leftSemiJoinOperator:"⋉",rightSemiJoinOperator:"⋊",antiJoinOperator:"▷",leftOuterJoinOperator:"⟕",rightOuterJoinOperator:"⟖",fullOuterJoinOperator:"⟗"}};for(let i=t.length-1;i>=0;i--){const a=t[i],s=a.location,l=e.substr(0,s.start.offset),u=e.substring(s.end.offset),c=o[r][a.name];if(e.substring(s.start.offset,s.end.offset)!==c){if(n)if(n.line>=s.start.line&&n.line<=s.end.line){if(n.column>s.start.column&&n.column=s.end.column){n.line-=s.end.line-s.start.line;const e=a.location.end.offset-a.location.start.offset,t=c.length;n.column-=e-t}}else n.lines.end.line&&(n.line-=s.end.line-s.start.line);e=l+c+u}}return{query:e,cursor:n}}const V=n("./src/db/parser/grammar_sql.pegjs");function q(e){return V.parse(e,{startRule:"start",tracer:void 0,i18n:r.c})}function G(e){return V.parse(e,{startRule:"dbDumpStart",tracer:void 0})}function K(e,t={}){t=t||{};const n=i(e,Object.keys(t));B(n,t);const r=I(n,t);return r.check(),r}},"./src/db/translate/textFromAst.ts":function(e,t,n){"use strict";(function(e){function r(e){if("groupRoot"!==e.type)throw new Error("wrong ast!?");let t="";function n(e){let t="";const{headers:n}=e;for(const e of n){const{name:n,lang:r,text:o}=e;t+=n,null!==r&&(t+="@"+r),t+=":",-1!==e.text.indexOf("\n")?t+=`[[${e.text}]]\n`:t+=e.text+"\n"}t+="\n";for(let n=0;n");if(null!==t&&i.addClass(t),null!==n&&i.append(n),null!==r){const t=e("");t.append(r),i.append(" ").append(t)}return null!==o&&i.append(" ( ").append(o).append(" ) "),i.text()}function r(t,n,r,o,i){const a=e("");if(null!==t&&a.addClass(t),a.append("( ").append(o).append(" ) "),a.append(n),null!==r){const t=e("");t.append(r),a.append(t)}return a.append(" ( ").append(i).append(" ) "),a.text()}function o(e,t){return"number"==typeof e&&(e=`[${e}]`),null===t?e:`${t}.${e}`}function i(e,t){if(null===e||"null"===t)return"null";if(e instanceof Date)return function(e){const t=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,n=e.getDate()<10?"0"+e.getDate():e.getDate();return`${e.getFullYear()}-${t}-${n}`}(e);if("string"==typeof e)return`'${e}'`;if("number"==typeof e)return e.toString();throw new Error("unknown type "+t)}return function e(t){switch(t.type){case"relation":return n(t.type,t.name,null,null);case"table":{const e=[];let n=[];for(let e=0;er[n])&&(r[n]=o)}let o="{\n";for(let i=0;i0){for(let e=0;e{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}else if("sqlRoot"===e.type){let n=!1;const o=e.assignments.map(e=>{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}return t(e)}function o(e,t,n=!0){if(t(e),"statement"===e.type?o(e.from,t,n):"relationFromSubstatement"===e.type&&o(e.statement,t,n),void 0!==e.child&&o(e.child,t,n),void 0!==e.child2&&o(e.child2,t,n),void 0!==e.assignments&&!0===n)for(const r of e.assignments)o(r,t,n)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},"./src/locales/de.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"Variablenname wurde mehrfach definiert: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"mehrfacher header {{name}}","db.messages.parser.error-group-unknown-header":"unbekannter header {{name}}","db.messages.parser.error-group-header-name-missing":"der Name des Datensatzes fehlt (group: ....)","db.messages.parser.error-group-header-name-empty":"der Name des Datensatzes ist leer","db.messages.parser.error-group-non-unique-attribute":"nicht eindeutiges Attribut {{name}} in Spalte {{index}}","db.messages.parser.error-group-non-unique-group-name":"Der Name der Gruppe {{name}} ist nicht eindeutig.","db.messages.parser.error-sql-string-use-single-quotes":"verwenden Sie einfache Anführungszeichen für Zeichenketten","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" darf nicht als name einer Relation verwendet werden","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" darf nicht als name einer Spalte verwendet werden","db.messages.parser.error-sql-group-by-missing":"group-by-Klausel fehlt","db.messages.parser.error-sql-having-without-group-by":"having-Klausel gefunden doch \\"group by\\" or Aggregation fehlt","db.messages.parser.error-sql-negative-limit":"das Limit muss größer oder gleich 0 sein","db.messages.parser.error-sqldump-invalid-column-number":"ungültige Spaltenanzahl in Zeile {{line}}","db.messages.parser.error-sqldump-invalid-type":"ungültiger Typ in Zeile {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"Anzahl der Werte != Anzahl der Spalten","db.messages.parser.error-valueexpr-like-operand-no-string":"der rechte Operand von LIKE muss ein Zeichenkettenliteral sein","db.messages.exec.error-column-not-unique":"Spalte \\"{{column}}\\" kann wegen mehrdeutigkeit nicht hinzugefügt werden","db.messages.exec.error-column-not-found-name":"Spalte \\"{{column}} wurde im Schema {{schema}} nicht gefunden","db.messages.exec.error-column-not-found-index":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-column-ambiguous":"Spalte \\"{{column}}\\" ist mehrdeutig im Schema {{schema}}","db.messages.exec.error-column-index-out-of-range":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"Relations alias \\"{{alias}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden","db.messages.exec.error-could-not-rename-ambiguity":"neuer Name \\"{{newName}}\\" für \\"{{oldName}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden im Schema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"Schema {{schemaA}} ist nicht Teil von {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"Schemas sind nicht unifiable: Typen oder Anzahl der Attribute ist unterschiedlich: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"Spalte \\"{{column}}\\" kann nicht in beiden Schemas des Joins gefunden werden","db.messages.exec.error-condition-must-be-boolean":"Bedingung muss ein boolscher Ausdruck sein","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} ist nicht für Datentyp {{colType}} definiert","db.messages.exec.error-join-would-produce-non-unique-columns":" the following columns appear in both relations: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"Keine Spalten gefunden für \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"Datentype für Spalte {{index}} (\\"{{column}}\\") wurde nicht spezifiziert","db.messages.exec.error-invalid-projection-error":"ungültige Projektion \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"Funktion \\"{{func}}\\" erwartet Argumente vom Typ \\"{{expected}}\\" aber \\"{{given}}\\" gefunden","db.messages.exec.error-could-not-compare-different-types":"Werte mit unterschiedlichen Datentypen können nicht verglichen werden: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"Funktion {{func}} erwartet, dass alle Argumente den selben Datentyp haben.","db.messages.exec.error-case-when-condition-must-be-boolean":"Die Bedingung für ein CASE WHEN muss ein boolscher Ausdruck sein","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END erwartet dass alle results vom selben Typ sind","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"Relation \\"{{name}}\\" nicht gefunden","db.messages.translate.warning-distinct-missing":" relational algebra uses implicit duplicate elimination","db.messages.translate.warning-ignored-all-on-set-operators":" relational algebra uses implicit duplicate elimination","db.messages.translate.error-variable-name-conflict":"Namenskonflikt: eine Relation mit Namen \\"{{name}}\\" existiert bereits","db.messages.translate.error-variable-cyclic-usage":"Zyklische Verwendung von Variable \\"{{name}}\\" erkannt","editor.codemirror-placeholder":"Abfrage ...\\nTastatürkürzel\\n\\tAbfrage ausführen: [CTRL]+[RETURN]\\n\\tMarkierten teil der Abfrage ausführen: [CTRL]+[SHIFT]+[RETURN]\\tAutovervollständigung: [CTRL]+[SPACE]","editor.alert-message-headers.success":"Erfolg","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warnung","editor.alert-message-headers.error":"Fehler","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"abbrechen","editor.inline-relation-editor.placeholder-column-name-and-types":"spaltenName:datenTyp","editor.inline-relation-editor.enter-your-data":"bitte Daten eingeben","editor.inline-relation-editor.error-column-name-missing":"Spaltenname fehlt in Spalte {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"Zeichenketten dürfen keine doppelten oder einfache Anführungszeichen enthalten","editor.error-no-query-found":"keine Abfrage gefunden","editor.pegjs-error.or":"oder","editor.pegjs-error.no-input-found":"keine Eingabe gefunden","editor.pegjs-error.end-of-input":"Ende der Eingabe","editor.pegjs-error.expected-found":"Erwarte {{expected}} aber {{found}} gefunden.","editor.error-at-line-x":"in Zeile {{line}}","calc.messages.error-query-missing":"keine Abfrage gefunden","calc.messages.error-query-missing-assignments-found":"nur Zuweisungen gefunden; die eigentliche Abfrage fehlt Help - Assignments (en)","calc.messages.gist-load-success":"gist erfolgreich geladen","calc.menu.headline":"Datensätze","calc.menu.datasets":"Datensätze","calc.menu.load-gist-headline":"Datensatz aus gist laden","calc.menu.load-gist-button":"laden","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Eigenen Datensatz erstellen","calc.menu.create-own-dataset-text":"Sie können Ihren eigenen Datensatz erstellen und ihn mit anderen teilen. Lernen Sie mehr darüber im Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial (en)","calc.menu.create-own-dataset-button-new":"neuen Datensatz erstellen","calc.menu.create-own-dataset-button-modify":"aktuellen Datensatz abändern","calc.navigation.take-a-tour":"Tour starten","calc.navigation.feedback":"Feedback","calc.navigation.help":"Hilfe (en)","calc.navigation.calc":"Rechner","calc.navigation.language":"Sprache","calc.maintainer-groups.misc":"Diverse","calc.maintainer-groups.temp":"Ungespeichert","calc.maintainer-groups.uibk":"Universität Innsbruck","calc.maintainer-groups.saarland":"Universität Saarland","calc.editors.button-history":"Verlauf","calc.editors.insert-relation-title":"Einfügen","calc.editors.insert-relation-tooltip":"Beziehungs- oder Spaltennamen einfügen","calc.editors.group.tab-name":"Datensatz Editor","calc.editors.group.tab-name-short":"DS","calc.editors.group.toolbar.import-sql":"SQL-dump importieren","calc.editors.group.toolbar.import-sql-content":"SQL-dump importieren","calc.editors.group.toolbar.add-new-relation":"neue Relation hinzufügen","calc.editors.group.toolbar.add-new-relation-content":"Relationseditor öffnen","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"Vorschau","calc.editors.group.button-use":"Datensatz im Editor verwenden","calc.editors.group.button-use_plural":"Datensatz im Editor verwenden","calc.editors.group.sql-import-group-name-placeholder":"Name des Datensatzes (importiert)","calc.editors.group.new-group-example-group":"-- dies ist ein Beispiel\\n\\ngroup: nameDesDatensatzes \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tbeispiel, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump importieren","calc.editors.group.modal-sqldump.button-close":"schließen","calc.editors.group.modal-sqldump.button-cancel":"abbrechen","calc.editors.group.modal-sqldump.button-import-sql":"importieren","calc.editors.group.modal-sqldump.description":"Kopieren Sie den SQL-Dump hier her um einen Datensatz daraus zu erstellen.","calc.editors.ra.tab-name":"Relationale Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"Query ausführen","calc.editors.ra.button-execute-selection":"Markierung ausführen","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"Projektion","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"Selektion","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"Umbenennen (Relationen/Spalten)","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.rename-columns-operator":"Umbenennung von Spalten","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"Sortieren","calc.editors.ra.toolbar.orderBy-content":"","calc.editors.ra.toolbar.groupBy":"Gruppieren","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"Und","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"Xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"Oder","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"Verneinung","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )","calc.editors.ra.toolbar.equals":"Gleich","calc.editors.ra.toolbar.equals-content":" a = b ( A )","calc.editors.ra.toolbar.not-equals":"Ungleich","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )","calc.editors.ra.toolbar.greater-or-equals":"Größer-Gleich","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )","calc.editors.ra.toolbar.lesser-or-equals":"Kleiner-Gleich","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )","calc.editors.ra.toolbar.intersect":"Schnittmenge","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"Vereinigung","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"Division (Relationen)","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"Mengendifferenz","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"cross join (Kreuzprodukt)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"Zuweisung","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"Kommentar einzeilig","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"Kommentar mehrzeilig","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-Relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-Relation (Editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"eine neue inline-Relation mit dem Editor erstellen","calc.editors.ra.toolbar.insert-date":"Datum einfügen","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"Operatoren ersetzen","calc.editors.ra.toolbar.autoreplace-operators.header":"Operatoren automatisch ersetzen","calc.editors.ra.toolbar.autoreplace-operators.none":"keine Ersetzung","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Query ausführen","calc.editors.sql.button-execute-selection":"Markierung ausführen","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select-Klausel","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from-Klausel","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where-Klausel","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group-b-Klausel","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having-Klausel","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order-by-Klausel","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit-Klausel","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"Datum einfügen","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Ergebnis","calc.result.modal.close":"Schließen","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"CSV downloaden","calc.editors.ra.inline-editor.button-upload-csv":"CSV uploaden","calc.editors.ra.inline-editor.button-cancel":"Abbrechen","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Typ","calc.editors.ra.inline-editor.input-relation-name":"Relations Name","calc.navigation.imprint":"Impressum"}')},"./src/locales/en.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"duplicate variable name: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"duplicate header {{name}}","db.messages.parser.error-group-unknown-header":"unknown header {{name}}","db.messages.parser.error-group-header-name-missing":"the name of the group is missing (group: ....)","db.messages.parser.error-group-header-name-empty":"the name of the group must not be empty","db.messages.parser.error-group-non-unique-attribute":"non unique attribute {{name{{ in column }}index}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use single quotes for strings","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" must not be used as a relation-name","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" must not be used as a column-name","db.messages.parser.error-sql-group-by-missing":"group by is missing","db.messages.parser.error-sql-having-without-group-by":"having found but missing \\"group by\\" or aggregation","db.messages.parser.error-sql-negative-limit":"the limit given must be >= 0","db.messages.parser.error-sqldump-invalid-column-number":"invalid number of columns in line {{line}}","db.messages.parser.error-sqldump-invalid-type":"invalid type in line {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"number of values != number of columns","db.messages.parser.error-valueexpr-like-operand-no-string":"right operand of LIKE must be a string literal","db.messages.exec.error-column-not-unique":"could not add column \\"{{column}}\\" because of ambiguity","db.messages.exec.error-column-not-found-name":"could not find column \\"{{column}}\\" in schema {{schema}}","db.messages.exec.error-column-not-found-index":"column index \\"{{column}}\\" is out of range in schema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"column \\"{{column}}\\" is ambiguous in {{schema}}","db.messages.exec.error-column-index-out-of-range":"column index \\"{{column}}\\" is out of range in {{schema}}; index starts at 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"could not set relation alias \\"{{alias}}\\" because of ambiguity","db.messages.exec.error-could-not-rename-ambiguity":"could not set new name \\"{{newName}}\\" for \\"{{oldName}}\\" because of ambiguity in {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"schema {{schemaA}} is not part of {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"schemas are not unifiable: types are different or size is different: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"column \\"{{column}}\\" can not be found in both schemas of join","db.messages.exec.error-condition-must-be-boolean":"condition must be a boolean expression","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} not defined for type {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"join would result in non unique column names","db.messages.exec.error-no-columns-match-alias-star":"no columns match \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"datatype for column {{index}} (\\"{{column}}\\") is not specified","db.messages.exec.error-invalid-projection-error":"invalid projection \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"function \\"{{func}}\\" expects arguments of type \\"{{expected}}\\" but \\"{{given}}\\" given","db.messages.exec.error-could-not-compare-different-types":"could not compare value if types are different: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} expects all arguments to be of the same type","db.messages.exec.error-case-when-condition-must-be-boolean":"the condition of a CASE WHEN must be of type boolean","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END expects all results to be of the same type","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"could not find relation \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT is missing","db.messages.translate.warning-ignored-all-on-set-operators":"ignored ALL on set operation","db.messages.translate.error-variable-name-conflict":"name conflict: relation name \\"{{name}}\\" already exists","db.messages.translate.error-variable-cyclic-usage":"cyclic usage of variable \\"{{name}}\\" detected","editor.codemirror-placeholder":"your query goes here ...\\n\\nkeyboard shortcuts:\\n\\texecute statement: [CTRL]+[RETURN]\\n\\texecute selection: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocomplete: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Success","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warning","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancel","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"please enter your data","editor.inline-relation-editor.error-column-name-missing":"column name missing in column {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string must not contain single and double quotes","editor.error-no-query-found":"no query found","editor.pegjs-error.or":"or","editor.pegjs-error.no-input-found":"no input found","editor.pegjs-error.end-of-input":"end of input","editor.pegjs-error.expected-found":"Expected {{expected}} but {{found}} found.","editor.error-at-line-x":"at line {{line}}","calc.messages.error-query-missing":"no query found","calc.messages.error-query-missing-assignments-found":"only assignments found; query is missing Help - Assignments","calc.messages.gist-load-success":"gist loaded successfully","calc.menu.headline":"load a Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Load dataset stored in a gist","calc.menu.load-gist-button":"load","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Create your own Dataset","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"create new Dataset","calc.menu.create-own-dataset-button-modify":"modify current Dataset","calc.navigation.take-a-tour":"Take a Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Help","calc.navigation.calc":"Calculate","calc.navigation.language":"Language","calc.maintainer-groups.misc":"Miscellaneous","calc.maintainer-groups.temp":"Temporary","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"history","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"Group Editor","calc.editors.group.tab-name-short":"GE","calc.editors.group.toolbar.import-sql":"import SQL-dump","calc.editors.group.toolbar.import-sql-content":"import SQL-dump","calc.editors.group.toolbar.add-new-relation":"add new relation","calc.editors.group.toolbar.add-new-relation-content":"open relation editor","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"use Group in editor","calc.editors.group.button-use_plural":"use first Group in editor","calc.editors.group.sql-import-group-name-placeholder":"Name of the group (imported from SQL)","calc.editors.group.new-group-example-group":"-- this is an example\\n\\ngroup: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Import SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Close","calc.editors.group.modal-sqldump.button-cancel":"cancel","calc.editors.group.modal-sqldump.button-import-sql":"import SQL","calc.editors.group.modal-sqldump.description":"Put your SQL-Dump here to create a group.","calc.editors.ra.tab-name":"Relational Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"execute query","calc.editors.ra.button-execute-selection":"execute selection","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"projection","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"selection","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"rename relation / rename columns","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.rename-columns-operator":"rename columns operator","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"order by","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"group by","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"and","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"or","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"not","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"equals","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"not equals","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"greater or equals","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"lesser or equals","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersect","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"union","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"division","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"subtraction","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"cross join","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"assignment","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"single-line comment","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"multi-line comment","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"insert date","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"execute query","calc.editors.sql.button-execute-selection":"execute selection","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select clause","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from clause","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where clause","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by clause","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order by clause","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit clause","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/es.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nombre de variable duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"header duplicado {{name}}","db.messages.parser.error-group-unknown-header":"header desconocido {{name}}","db.messages.parser.error-group-header-name-missing":"el nombre del grupo no se ha encontrado (group: ....)","db.messages.parser.error-group-header-name-empty":"el nombre del grupo debe ser rellenado","db.messages.parser.error-group-non-unique-attribute":"atributo no único {{name}} en columna {{index}}","db.messages.parser.error-group-non-unique-group-name":"El nombre del grupo no es único.","db.messages.parser.error-sql-string-use-single-quotes":"utiliza comillas simples para cadenas de caracteres","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" no debe ser utilizado como nombre de relacion","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" no debe ser utilizado como nombre de columna","db.messages.parser.error-sql-group-by-missing":"group by no se encuentra","db.messages.parser.error-sql-having-without-group-by":"se ha encontrado pero no se encuentra \\"group by\\" ó agregación","db.messages.parser.error-sql-negative-limit":"el límite dado debe ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de columnas en línea {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido en línea {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de columnas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando derecho de LIKE debe ser una cadena literal","db.messages.exec.error-column-not-unique":"no se pude agregar columna \\"{{column}}\\" por ambiguedad","db.messages.exec.error-column-not-found-name":"no se pude encontrar columna \\"{{column}}\\" en esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"columna \\"{{column}}\\" es ambigua en esquema {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; índice comienza en 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"no se pudo establecer relación alias \\"{{alias}}\\" por ambiguedad","db.messages.exec.error-could-not-rename-ambiguity":"no se pudo establecer nuevo nombre \\"{{newName}}\\" para \\"{{oldName}}\\" por ambiguedad en el equema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} no es parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"esquemas no son unificables: los tipos son diferentes ó los tamaño son diferentes: {{schemaA}} y {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"columna \\"{{column}}\\" no se puede encontrar en ambos esquemas del join","db.messages.exec.error-condition-must-be-boolean":"condición debe ser una expresión booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} no está definido para {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"Join würde nicht eindeutige Spaltennamen erzeugen","db.messages.exec.error-no-columns-match-alias-star":"las columnas no coinciden \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dato para columna {{index}} (\\"{{column}}\\") no está especificado","db.messages.exec.error-invalid-projection-error":"proyección inválida \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"función \\"{{func}}\\" espera argumentos de tipo \\"{{expected}}\\" pero \\"{{given}}\\" fue dado","db.messages.exec.error-could-not-compare-different-types":"no se pudo comparar valor si tipos son diferentes: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos los argumentos sean del mismo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"la condición de un CASE WHEN debe ser de tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END espera todos results ser del mismo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válido; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"no se pudo encontrar relación \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT fehlt","db.messages.translate.warning-ignored-all-on-set-operators":"ALL bei Mengenoperatoren wurde ignoriert","db.messages.translate.error-variable-name-conflict":"conflicto de nombre: nombre de relación \\"{{name}}\\" ya existe","db.messages.translate.error-variable-cyclic-usage":"uso de variable cíclico \\"{{name}}\\" detectado","editor.codemirror-placeholder":"tu consulta va aquí ...\\n\\natajos de teclado:\\n\\tejecutar declaración: [CTRL]+[RETURN]\\n\\ttejecutar selección: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Éxito","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Advertencia","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"nombreColumna:tipo","editor.inline-relation-editor.enter-your-data":"por favor ingrese los datos","editor.inline-relation-editor.error-column-name-missing":"nombre de columna ausente en columna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"cadena de caracteres no debe contener comillas simples y dobles","editor.error-no-query-found":"no se encontró la consulta","editor.pegjs-error.or":"ó","editor.pegjs-error.no-input-found":"no se encontró la entrada","editor.pegjs-error.end-of-input":"fin de entrada","editor.pegjs-error.expected-found":"Se esperaba {{expected}} pero se encontró {{found}} .","editor.error-at-line-x":"en la línea {{line}}","calc.messages.error-query-missing":"no se encontró la consulta","calc.messages.error-query-missing-assignments-found":"solo se encontraron asignaciones; a la consulta le falta Help - Assignments","calc.messages.gist-load-success":"gist fue cargado con éxito","calc.menu.headline":"cargar un Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"cargar dataset guardado en un gist","calc.menu.load-gist-button":"cargar","calc.menu.load-gist-insert-placeholder":"ID de gist","calc.menu.create-own-dataset-headline":"Crear tu propio Dataset","calc.menu.create-own-dataset-text":"Puedes crear tu propio dataset y compartirlo con otras personas. \\nAprende más acerca de ésto en Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Tutorial de mantenimiento (en)","calc.menu.create-own-dataset-button-new":"crear nuevo Dataset","calc.menu.create-own-dataset-button-modify":"modificar Dataset actual","calc.navigation.take-a-tour":"Haz un recorrido","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ayuda (en)","calc.navigation.calc":"Calculadora","calc.navigation.language":"Lenguaje","calc.maintainer-groups.misc":"Misceláneo","calc.maintainer-groups.temp":"Temporal","calc.maintainer-groups.uibk":"Universidad de Innsbruck","calc.maintainer-groups.saarland":"Universidad de Saarland","calc.editors.button-history":"historia","calc.editors.insert-relation-title":"Insertar","calc.editors.insert-relation-tooltip":"Insertar nombres de relaciones o columnas","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"agregar nueva relación","calc.editors.group.toolbar.add-new-relation-content":"abrir editor de relaciones","calc.editors.group.button-download":"descargar","calc.editors.group.button-exec":"vista previa","calc.editors.group.button-use":"utilizar Grupo en editor","calc.editors.group.button-use_plural":"utilizar Grupos en editor","calc.editors.group.sql-import-group-name-placeholder":"Nombre del grupo (importado de SQL)","calc.editors.group.new-group-example-group":"-- éste es un ejemplo\\n\\ngroup: nombreDeNuevoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tejemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Cerrar","calc.editors.group.modal-sqldump.button-cancel":"cancelar","calc.editors.group.modal-sqldump.button-import-sql":"importar SQL","calc.editors.group.modal-sqldump.description":"Ponga su SQL-Dump aquí para crear un grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"ÁlgRel","calc.editors.ra.button-execute-query":"executar consulta","calc.editors.ra.button-execute-selection":"executar selección","calc.editors.ra.button-download":"descargar","calc.editors.ra.toolbar.projection":"proyección","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"selección","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renombrar relación / renombrar columnas","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.rename-columns-operator":"renombrar operador de columnas","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"ordenar por","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"agrupar por","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"y","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"ó","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"no","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"no es igual","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"mayor ó igual","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ó igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersecta","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"unión","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"división","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"resta","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\\\ ( B )
        \\n","calc.editors.ra.toolbar.cross-join":"cross join (cruzado)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"asignación","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"comentario de una línea","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"comentario de múltiples líneas","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"crear nuevo inline-relation utilizando editor incorporado","calc.editors.ra.toolbar.insert-date":"insertar fecha","calc.editors.ra.toolbar.insert-date-content":"","calc.editors.ra.toolbar.autoreplace-operators.title":"","calc.editors.ra.toolbar.autoreplace-operators.header":"","calc.editors.ra.toolbar.autoreplace-operators.none":"","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"ejecutar consulta","calc.editors.sql.button-execute-selection":"ejecutar selección","calc.editors.sql.button-download":"descargar","calc.editors.sql.toolbar.select":"seleccionar cláusula","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"cláusula from (desde)","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"cláusula where (donde)","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula agrupar por","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"teniendo cláusula","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula ordenar por","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"cláusula límite","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insertar fecha","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Cerrar","calc.editors.ra.inline-editor.title":"Editor de relaciones","calc.editors.ra.inline-editor.button-download-csv":"Descargar CSV","calc.editors.ra.inline-editor.button-upload-csv":"Subir CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nombre","calc.editors.ra.inline-editor.row-type":"Escriba","calc.editors.ra.inline-editor.input-relation-name":"Nombre de la relación","calc.navigation.imprint":"Imprimir"}')},"./src/locales/kr.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"변수 이름 중복: {{name}}","db.messages.parser.error-invalid-date-format":"\\"__str__\\" 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":" 헤더 중복: {{name}}","db.messages.parser.error-group-unknown-header":"알 수 없는 헤더: {{name}}","db.messages.parser.error-group-header-name-missing":"그룹 이름이 없음(group: ....)","db.messages.parser.error-group-header-name-empty":"그룹 이름은 비어있으면 안됨","db.messages.parser.error-group-non-unique-attribute":"__index__ 열에서 고유하지 않은 속성 {{name}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"문자열에 작은 따음표 사용","db.messages.parser.error-sql-invalid-relation-name":"\\"__str__\\"은 관계 이름으로 사용 할 수 없음","db.messages.parser.error-sql-invalid-column-name":"\\"__str__\\"은 열 이름으로 사용할 수 없음","db.messages.parser.error-sql-group-by-missing":"group by 없음","db.messages.parser.error-sql-having-without-group-by":"\\"group by\\" 또는 집계 없음","db.messages.parser.error-sql-negative-limit":"0 이상이어야 함","db.messages.parser.error-sqldump-invalid-column-number":"__line__ 에서 유효하지 않은 열","db.messages.parser.error-sqldump-invalid-type":"__line__ 에서 유효하지 않은 타입","db.messages.parser.error-sqldump-insert-wrong-number-columns":"값의 숫자 != 열의 숫자","db.messages.parser.error-valueexpr-like-operand-no-string":"LIKE의 오른쪽 피연산자는 문자열 리터럴이어야 함","db.messages.exec.error-column-not-unique":"모호성 때문에 열 \\"__column__\\" 을 추가할 수 없음","db.messages.exec.error-column-not-found-name":"스키마 __schema__ 에서 열 \\"__column__\\" 을 찾을 수 없음","db.messages.exec.error-column-not-found-index":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-column-ambiguous":"열 \\"__column__\\" 는 스키마 __schema__ 에서 모호함","db.messages.exec.error-column-index-out-of-range":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"모호성 때문에 릴레이션 가명 \\"__alias__\\"을 사용할 수 없음 ","db.messages.exec.error-could-not-rename-ambiguity":"스키마 __schema__ 에서의 모호성 때문에 \\"__oldName__\\"을 위한 새로운 이름 \\"__newName__\\" 을 설정 할 수 없음","db.messages.exec.error-schema-a-not-part-of-schema-b":"스키마 __schemaA__ 는 __schemaB__ 의 부분이 아님","db.messages.exec.error-schemas-not-unifiable":"스키마들은 통합될 수 없음: 타입들은 다르거나 사이즈들이 다르다: __schemaA__ 와 __schemaB__","db.messages.exec.error-column-not-in-both-schemas":"열 \\"__column__\\"은 두 스키마의 조인에서 찾을 수 없음","db.messages.exec.error-condition-must-be-boolean":"조건은 불린 대수여야만 함","db.messages.exec.error-func-not-defined-for-column-type":"__func_ _은 타입 __colType__ 을 위해 정의될 수 없음","db.messages.exec.error-join-would-produce-non-unique-columns":" Die folgenden Spalten sind teil beider Relationen: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"\\"__alias__.*\\"와 일치하는 열이 없음","db.messages.exec.error-datatype-not-specified-for-col":"열 __index__의 데이터 타입 (\\"__column__\\")이 구체화되지 않음","db.messages.exec.error-invalid-projection-error":"유효하지 않은 프로젝션 \\"__argument__\\": __error__","db.messages.exec.error-function-expects-type":"함수 \\"__func__\\"는 인자 타입 \\"__expected__\\" 으로 기대하지만 \\"__given__\\" 이 주어짐","db.messages.exec.error-could-not-compare-different-types":"타입이 다르면 비교할 수 없음: __typeA__ != __typeB__","db.messages.exec.error-function-expects-arguments-of-same-type":"__func__ 는 모든 인자가 같은 타입으로 기대함","db.messages.exec.error-case-when-condition-must-be-boolean":"CASE WHEN 조건은 불린 타입이어야 함","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END는 모든 결과가 같은 타입으로 기대함","db.messages.exec.error-invalid-date-format":"\\"__str__\\" 는 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"릴레이션 \\"{{name}}\\"을 찾을 수 없음","db.messages.translate.warning-distinct-missing":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.warning-ignored-all-on-set-operators":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.error-variable-name-conflict":"이름 충돌: 릴레이션 이름 \\"{{name}}\\" 은 이미 존재함","db.messages.translate.error-variable-cyclic-usage":"변수 \\"{{name}}\\"의 순환 사용이 감지됨","editor.codemirror-placeholder":"쿼리는 이곳에 표시된다 ...\\n\\n키보드 단축키:\\n\\tstatement 실행: [CTRL]+[RETURN]\\n\\tselection 실행: [CTRL]+[SHIFT]+[RETURN]\\n\\t자동 완성: [CTRL]+[SPACE]","editor.alert-message-headers.success":"성공","editor.alert-message-headers.info":"정보","editor.alert-message-headers.warning":"경고","editor.alert-message-headers.error":" 에러 ","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"취소","editor.inline-relation-editor.placeholder-column-name-and-types":"열 이름:타입","editor.inline-relation-editor.enter-your-data":"데이터를 입력하라","editor.inline-relation-editor.error-column-name-missing":"열 이름이 열 __index__에 없다","editor.inline-relation-editor.error-wrong-quoted-string":"문자열은 작은따음표와 큰따음표를 포함할 수 없다.","editor.error-no-query-found":"쿼리를 찾을 수 없다","editor.pegjs-error.or":"또는","editor.pegjs-error.no-input-found":"입력을 찾을 수 없음","editor.pegjs-error.end-of-input":"입력의 끝","editor.pegjs-error.expected-found":"예상 된 __expected__이지만 __found__이 발견됨.","editor.error-at-line-x":"__line__ 줄에서","calc.messages.error-query-missing":"쿼리를 찾을 수 없음","calc.messages.error-query-missing-assignments-found":"쿼리를 찾을 수 없음 Help - Assignments","calc.messages.gist-load-success":"gist 불러오기 완료","calc.menu.headline":"데이터셋 불러오기","calc.menu.datasets":"데이터셋 불러오기","calc.menu.load-gist-headline":"gist에 저장된 데이터셋 불러오기","calc.menu.load-gist-button":"불러오기","calc.menu.load-gist-insert-placeholder":"gist 아이디","calc.menu.create-own-dataset-headline":"데이터셋 생성하기","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"새로운 데이터셋 생성","calc.menu.create-own-dataset-button-modify":"현재 데이터셋 수정","calc.navigation.take-a-tour":"둘러보기","calc.navigation.feedback":"피드백","calc.navigation.help":"도움말","calc.navigation.calc":"Calculate","calc.navigation.language":"언어","calc.maintainer-groups.misc":"다른 종류","calc.maintainer-groups.temp":"임시","calc.maintainer-groups.uibk":"Innsbruck 대학교","calc.maintainer-groups.saarland":"Saarland 대학교","calc.editors.button-history":"기록","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"그룹 에디터","calc.editors.group.tab-name-short":"그룹 에디터","calc.editors.group.toolbar.import-sql":"SQL-덤프 가져오기","calc.editors.group.toolbar.import-sql-content":"SQL-컨텐트 가져오기","calc.editors.group.toolbar.add-new-relation":"새로운 릴레이션 추가","calc.editors.group.toolbar.add-new-relation-content":"릴레이션 에디터 열기","calc.editors.group.button-download":"다운로드","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"에디터에서 그룹 사용하기","calc.editors.group.button-use_plural":"에디터에서 여러 그룹 사용하기","calc.editors.group.sql-import-group-name-placeholder":"그룹 이름(SQL로부터 불러옴)","calc.editors.group.new-group-example-group":"-- 예시입니다\\n\\n그룹: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump 가져오기","calc.editors.group.modal-sqldump.button-close":"닫기","calc.editors.group.modal-sqldump.button-cancel":"취소","calc.editors.group.modal-sqldump.button-import-sql":"SQL 가져오기","calc.editors.group.modal-sqldump.description":"그룹을 생성하려면 SQL-Dump 이곳에 가져와라","calc.editors.ra.tab-name":"관계 대수","calc.editors.ra.tab-name-short":"관계 대수","calc.editors.ra.button-execute-query":"쿼리 실행","calc.editors.ra.button-execute-selection":"셀렉션 실행","calc.editors.ra.button-download":"다운로드","calc.editors.ra.toolbar.projection":"프로젝션","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"셀렉션","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"릴레이션 이름 변경 / 열 이름 변경","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.rename-columns-operator":"열 연산자 변경","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"정렬","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"그룹화","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"논리곱","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"배타적 논리","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"논리합","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"논리적 부정","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
        ","calc.editors.ra.toolbar.equals":"등호","calc.editors.ra.toolbar.equals-content":" a = b ( A )
        ","calc.editors.ra.toolbar.not-equals":"부등호","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
        ","calc.editors.ra.toolbar.greater-or-equals":"크거나 같다","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
        ","calc.editors.ra.toolbar.lesser-or-equals":"작거나 같다","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
        ","calc.editors.ra.toolbar.intersect":"교집합","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"합집합","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"디비전","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"차집합","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\\\ ( B )
        \\n","calc.editors.ra.toolbar.cross-join":"카디션 프로덕트","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"자연 조인 / θ-조인","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"왼쪽 외부 조인","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.right-outer-join":"오른쪽 외부 조인","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.full-outer-join":"완전 외부 조인","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"왼쪽 세미 조인","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"오른쪽 세미 조인","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"안티 조인","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"할당","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"한 줄 주석","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"여러 줄 주석","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"인라인-릴레이션","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"인라인-릴레이션 (에디터)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"날짜 삽입","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"쿼리 실행","calc.editors.sql.button-execute-selection":"셀렉션 실행","calc.editors.sql.button-download":"다운로드","calc.editors.sql.toolbar.select":"select 문","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from 문","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where 문","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by 문","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having 문","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order by 문","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit 문","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/pt.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nome de variável duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"cabeçalho duplicado {{name}}","db.messages.parser.error-group-unknown-header":"cabeçalho desconhecido {{name}}","db.messages.parser.error-group-header-name-missing":"o nome do grupo está faltando (group: ....)","db.messages.parser.error-group-header-name-empty":"o nome do grupo não pode ser vazio","db.messages.parser.error-group-non-unique-attribute":"atributo não único {{name}} na coluna {{index}}","db.messages.parser.error-group-non-unique-group-name":"nome de grupo duplicado: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use aspas simples para strings (caracteres/texto)","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" não pode ser usado como nome de relação","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" não pode ser usado como nome de coluna","db.messages.parser.error-sql-group-by-missing":"group by está faltando","db.messages.parser.error-sql-having-without-group-by":"“having” encontrado, mas sem \\"group by\\" ou agregação","db.messages.parser.error-sql-negative-limit":"o limite dado precisa ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de colunas na linha {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido na linha {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de colunas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando direito de LIKE deve ser uma string literal","db.messages.exec.error-column-not-unique":"não foi possível adicionar a coluna \\"{{column}}\\" devido a ambiguidade","db.messages.exec.error-column-not-found-name":"não foi possível encontrar a coluna \\"{{column}}\\" no esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-column-ambiguous":"coluna\\"{{column}}\\" é ambígua em {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"não foi possível definir o ”alias” da relação “{{alias}}” por causa da ambiguidade","db.messages.exec.error-could-not-rename-ambiguity":"não foi possível definir o novo nome \\"{{newName}}\\" para \\"{{oldName}}\\" devido a ambiguidade em {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} não é parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"os esquemas não são unificáveis: os tipos ou o tamanho diferem: {{schemaA}} e {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"coluna \\"{{column}}\\" não pode ser encontrada em ambos os esquemas de junção","db.messages.exec.error-condition-must-be-boolean":"condição deve ser uma expressão booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} não definida para o tipo {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"a junção resultaria em nomes de coluna não únicos","db.messages.exec.error-no-columns-match-alias-star":"nenhuma coluna corresponde a \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dados para a coluna {{index}} (\\"{{column}}\\") não foi especificado","db.messages.exec.error-invalid-projection-error":"projeção inválida \\"{{argument}}\\": {{erro}}","db.messages.exec.error-function-expects-type":"a função \\"{{func}}\\" espera argumentos do tipo \\"{{expected}}\\" mas \\"{{given}}\\" foi dado","db.messages.exec.error-could-not-compare-different-types":"não foi possível comparar o valor se os tipos forem diferentes: {{typeA}}! = {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos os argumentos sejam do mesmo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"a condição de um CASE WHEN deve ser do tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":" CASE WHEN condição THEN resultado END espera que todos os resultados sejam do mesmo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"não foi possível encontrar relação \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT está faltando","db.messages.translate.warning-ignored-all-on-set-operators":"ignorou ALL na operação definida","db.messages.translate.error-variable-name-conflict":"conflito de nomes: o nome da relação \\"{{name}}\\" já existe","db.messages.translate.error-variable-cyclic-usage":"uso cíclico da variável \\"{{name}}\\" detectado","editor.codemirror-placeholder":"Digite sua consulta aqui\\n\\nAtalhos do teclado:\\n\\texecutar declaraçãot: [CTRL]+[RETURN]\\n\\texecutar seleção: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Sucesso","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Perigo","editor.alert-message-headers.error":"Erro","editor.inline-relation-editor.button-ok":"Ok","editor.inline-relation-editor.button-cancel":"Cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"por favor, insira seus dados","editor.inline-relation-editor.error-column-name-missing":"nome da coluna ausente na coluna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string não deve conter aspas simples e duplas","editor.error-no-query-found":"nenhuma consulta encontrada","editor.pegjs-error.or":"ou","editor.pegjs-error.no-input-found":"nenhuma entrada encontrada","editor.pegjs-error.end-of-input":"fim da entrada","editor.pegjs-error.expected-found":"esperado {{expected}}, mas {{found}} encontrado.","editor.error-at-line-x":"na linha {{line}}","calc.messages.error-query-missing":"nenhuma consulta encontrada","calc.messages.error-query-missing-assignments-found":"apenas atribuições encontradas; falta a consulta Ajuda - Tarefas ","calc.messages.gist-load-success":"gist carregado com sucesso","calc.menu.headline":"Carregue um Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Carregar Dataset armazenado em um gist","calc.menu.load-gist-button":"Carregar","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Crie seu próprio Dataset","calc.menu.create-own-dataset-text":"Você pode criar seu próprio conjunto de dados e compartilhá-lo com outras pessoas. Saiba mais sobre isso no ","calc.menu.create-own-dataset-text-link":"Tutorial de manutenção","calc.menu.create-own-dataset-button-new":"Criar novo Dataset","calc.menu.create-own-dataset-button-modify":"Modificar Dataset","calc.navigation.take-a-tour":"Faça um Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ajuda","calc.navigation.calc":"Calcular","calc.navigation.language":"Linguagem","calc.maintainer-groups.misc":"Diversos","calc.maintainer-groups.temp":"Temporário","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"Histórico","calc.editors.insert-relation-title":"Inserir","calc.editors.insert-relation-tooltip":"Inserir relação ou nomes de coluna","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"Importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"Importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"+ nova relação","calc.editors.group.toolbar.add-new-relation-content":"Abrir editor de relações","calc.editors.group.button-download":"Download","calc.editors.group.button-exec":"Visualizar","calc.editors.group.button-use":"Use Grupo no Editor","calc.editors.group.button-use_plural":"Use o primeiro Grupo no Editor","calc.editors.group.sql-import-group-name-placeholder":"Nome do grupo (importado de SQL)","calc.editors.group.new-group-example-group":"– este é um exemplo\\n\\ngroup: nomeDoNovoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-dump","calc.editors.group.modal-sqldump.button-close":"Fechar","calc.editors.group.modal-sqldump.button-cancel":"Cancelar","calc.editors.group.modal-sqldump.button-import-sql":"Importar SQL","calc.editors.group.modal-sqldump.description":"Coloque seu SQL-Dump aqui para criar um grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"AlgRel","calc.editors.ra.button-execute-query":"Executar consulta","calc.editors.ra.button-execute-selection":"Executar seleção","calc.editors.ra.button-download":"Download","calc.editors.ra.toolbar.projection":"Projeção","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"Seleção","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renomear relação / renomear colunas","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.rename-columns-operator":"operador renomear colunas","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"ordenar (order by)","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"agrupar (group by)","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"e","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"ou exclusivo (xor)","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"ou","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"não","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"não igual","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"maior ou igual","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ou igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersecção","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"união","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"divisão","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"subtração","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"junção cruzada (cross join)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"atribuição","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"comentário em linha","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- comentário útil","calc.editors.ra.toolbar.multi-line-comment":"comentário multilinha","calc.editors.ra.toolbar.multi-line-comment-content":"/* este é um comentário longo,
        muito longo*/

        π a, b A","calc.editors.ra.toolbar.inline-relation":"relação aninhada","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"relação aninhada (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"criar uma nova relação aninhada usando o editor","calc.editors.ra.toolbar.insert-date":"inserir data","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"substituição de operador","calc.editors.ra.toolbar.autoreplace-operators.header":"substituir operadores automaticamente","calc.editors.ra.toolbar.autoreplace-operators.none":"sem substituição","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Executar consulta","calc.editors.sql.button-execute-selection":"Executar seleção","calc.editors.sql.button-download":"Download","calc.editors.sql.toolbar.select":"cláusula select","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"cláusula from","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"cláusula where","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula group by","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"cáusula having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula order by","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"cláusula limit","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"inserir data","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Fechar","calc.editors.ra.inline-editor.title":"Editor de Relação","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nome","calc.editors.ra.inline-editor.row-type":"Tipo","calc.editors.ra.inline-editor.input-relation-name":"Nome da Relação","calc.navigation.imprint":"Impressão"}')},0:function(e,t,n){e.exports=n("./src/calc2/calculator.entry.tsx")}}); \ No newline at end of file + */var r,o,i,a,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,c=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(e){throw setTimeout(c,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(c,0))},o=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.performance,f=window.Date,m=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof h&&"function"==typeof h.now)t.unstable_now=function(){return h.now()};else{var y=f.now();t.unstable_now=function(){return f.now()-y}}var b=!1,v=null,_=-1,w=5,E=0;a=function(){return t.unstable_now()>=E},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0T(a,n))void 0!==l&&0>T(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],x=[],L=1,R=null,A=3,D=!1,N=!1,P=!1;function I(e){for(var t=O(x);null!==t;){if(null===t.callback)k(x);else{if(!(t.startTime<=e))break;k(x),t.sortIndex=t.expirationTime,S(M,t)}t=O(x)}}function H(e){if(P=!1,I(e),!N)if(null!==O(M))N=!0,r(Y);else{var t=O(x);null!==t&&o(H,t.startTime-e)}}function Y(e,n){N=!1,P&&(P=!1,i()),D=!0;var r=A;try{for(I(n),R=O(M);null!==R&&(!(R.expirationTime>n)||e&&!a());){var s=R.callback;if(null!==s){R.callback=null,A=R.priorityLevel;var l=s(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?R.callback=l:R===O(M)&&k(M),I(n)}else k(M);R=O(M)}if(null!==R)var u=!0;else{var c=O(x);null!==c&&o(H,c.startTime-n),u=!1}return u}finally{R=null,A=r,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,r(Y))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return O(M)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0s?(e.sortIndex=l,S(x,e),null===O(M)&&e===O(x)&&(P?i():P=!0,o(H,l-s))):(e.sortIndex=a,S(M,e),N||D||(N=!0,r(Y))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();I(e);var n=O(M);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/warning/warning.js":function(e,t,n){"use strict";var r=function(){};e.exports=r},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/harmony-module.js":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/calc2/calculator.entry.tsx":function(e,t,n){"use strict";n.r(t);var r=n("./src/calc2/i18n.tsx"),o=n("./src/calc2/utils/groupUtils.ts"),i=n("./node_modules/immutable/dist/immutable.es.js"),a=function(e){return"@@redux-saga/"+e},s=a("CANCEL_PROMISE"),l=a("CHANNEL_END"),u=a("IO"),c=a("MATCH"),d=a("MULTICAST"),h=a("SAGA_ACTION"),f=a("SELF_CANCELLATION"),m=a("TASK"),p=a("TASK_CANCEL"),g=a("TERMINATE"),y=a("LOCATION"),b=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),v=function(e){return null==e},_=function(e){return null!=e},w=function(e){return"function"==typeof e},E=function(e){return"string"==typeof e},j=Array.isArray,C=function(e){return e&&w(e.then)},S=function(e){return e&&w(e.next)&&w(e.throw)},O=function e(t){return t&&(E(t)||M(t)||w(t)||j(t)&&t.every(e))},k=function(e){return e&&w(e.take)&&w(e.close)},T=function(e){return w(e)&&e.hasOwnProperty("toString")},M=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var x=function(e){return function(){return e}}(!0),L=function(){};var R=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var A=function(e,t){Object(b.a)(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function D(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function N(e){var t=!1;return function(){t||(t=!0,e())}}var P=function(e){throw e},I=function(e){return{value:e,done:!0}};function H(e,t,n){void 0===t&&(t=P),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:I,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Y(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var F=function(e){return Array.apply(null,new Array(e))},W=function(e){return function(t){return e(Object.defineProperty(t,h,{value:!0}))}},B=function(e){return e===g},U=function(e){return e===p},z=function(e){return B(e)||U(e)};function V(e,t){var n=Object.keys(e),r=n.length;var o,i=0,a=j(e)?F(r):{},s={};return n.forEach((function(e){var n=function(n,s){o||(s||z(n)?(t.cancel(),t(n,s)):(a[e]=n,++i===r&&(o=!0,t(a))))};n.cancel=L,s[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return s[e].cancel()})))},s}function q(e){return{name:e.name||"anonymous",location:G(e)}}function G(e){return e[y]}function K(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},s=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},l=function(){for(var e=[];r;)e.push(s());return e};return{isEmpty:function(){return 0==r},put:function(s){var u;if(r1?t-1:0),r=1;r1?t-1:0),r=1;r2?n-2:0),o=2;oe.groupInfo.source===n&&e.groupInfo.id===r&&e.groupInfo.filename===o&&e.groupInfo.index===i);return a?Object.assign(Object.assign({},e),{current:Object.assign(Object.assign({},e.current),{group:a})}):(console.error("could not find group ",a),e)}case"GROUPS_LOAD_SUCCESS":{const{loadedGroups:n}=t;let r=e;for(const e of n)r=Object.assign(Object.assign({},r),{groups:r.groups.set(le(e),e)});return r}case"GROUP_SET_DRAFT":{let{draft:n}=t;n=Object.assign(Object.assign({},n),{isDraft:!0}),e=Object.assign(Object.assign({},e),{groups:e.groups.set(le(n),n),current:Object.assign(Object.assign({},e.current),{group:n})})}default:return e}}function le(e){const{source:t,id:n,filename:r,index:o}=e.groupInfo;return`${t}/${n}/${r}/${o}`}n("./node_modules/custom-event-polyfill/polyfill.js");var ue=n("./node_modules/react/index.js"),ce=n("./node_modules/react-dom/index.js"),de=n("./node_modules/react-hot-loader/index.js"),he=(n.p,n("./src/calc2/main.hot.tsx")),fe=n("./node_modules/redux/es/redux.js"),me=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");function pe(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var ge=pe,ye=[],be=0;function ve(e){try{Ee(),e()}finally{je()}}function _e(e){ye.push(e),be||(Ee(),Ce())}function we(e){try{return Ee(),e()}finally{Ce()}}function Ee(){be++}function je(){be--}function Ce(){var e;for(je();!be&&void 0!==(e=ye.shift());)ve(e)}var Se=function(e){return function(t){return e.some((function(e){return xe(e)(t)}))}},Oe=function(e){return function(t){return e(t)}},ke=function(e){return function(t){return t.type===String(e)}},Te=function(e){return function(t){return t.type===e}},Me=function(){return x};function xe(e){var t="*"===e?Me:E(e)?ke:j(e)?Se:T(e)?ke:w(e)?Oe:M(e)?Te:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var Le={type:l},Re=function(e){return e&&e.type===l};function Ae(e){void 0===e&&(e=X());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(Le):e.isEmpty()?(n.push(r),r.cancel=function(){D(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(Le):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r2?h-2:0),m=2;m2?n-2:0),o=2;o1?t-1:0),r=1;r!(e.groupInfo.source!==t||e.groupInfo.id!==n||!r||"first"!==r&&r.filename!==e.groupInfo.filename||!r||"first"!==r&&r.index!==e.groupInfo.index));if(s){const{source:e,id:t,filename:n,index:r}=s.groupInfo,o={type:"GROUP_SET_CURRENT",source:e,id:t,filename:n,index:r};yield Q(o)}else try{if("local"!==t&&"gist"!==t)throw new Error(`unsupported source-type ${t}`);const e=yield ee(o.b,t,n,i,a),s={type:"GROUPS_LOAD_SUCCESS",loadedGroups:e};if(yield Q(s),void 0!==r&&e.length>0){const{source:t,id:n,filename:r}=e[0].groupInfo,o={type:"GROUP_SET_CURRENT",source:t,id:n,filename:r,index:0};yield Q(o)}}catch(e){console.error("could not fetch group",e),window.alert("Could not fetch group!\nDefault group loaded.\n"+e)}}))})),ce.render(ue.createElement(de.AppContainer,null,ue.createElement(he.a,{store:et})),document.getElementById("root"));{const e={type:"SET_LOCALE",locale:r.c.language};et.dispatch(e)}for(const e of function(){const e=[{maintainerGroup:Object(r.d)("calc.maintainer-groups.misc"),maintainer:"",source:"local",id:"uibk"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'mtschu',source:"gist",id:"2923a30a474fdcb46bee"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Wolfgang Gassler',source:"gist",id:"7d1871f79a8bcb4788de"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"b58108eacc9c5916726b2327789204ab"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"963d8b886fb468d742c71d34ba0dbbed"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"41cf5ce652756d9331eec7562644e074"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"c306ecf21c6e6d175508d3ac6b4355e7"}];let t=!0;return e.map(({source:e,id:n,maintainer:r,maintainerGroup:o})=>{const i={type:"GROUPS_LOAD_REQUEST",source:e,id:n,setCurrent:t?"first":void 0,maintainer:r,maintainerGroup:o};return t=!1,i})}())et.dispatch(e)},"./src/calc2/components/calculator.scss":function(e,t,n){},"./src/calc2/components/dropdownList.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("./node_modules/react/index.js"),o=n("./node_modules/reactstrap/lib/Dropdown.js"),i=n.n(o),a=n("./node_modules/reactstrap/lib/DropdownItem.js"),s=n.n(a),l=n("./node_modules/reactstrap/lib/DropdownMenu.js"),u=n.n(l),c=n("./node_modules/reactstrap/lib/DropdownToggle.js"),d=n.n(c);class h extends r.Component{constructor(e){super(e),this.id=`dropdown-${Math.random().toString(36).substr(2,10)}`,this.state={isOpen:!1},this.toggle=this.toggle.bind(this)}toggle(){this.setState({isOpen:!this.state.isOpen})}render(){const{label:e,elements:t,value:n,onChange:o,disabled:a=!1}=this.props,{isOpen:l}=this.state;return r.createElement(i.a,{isOpen:l,toggle:this.toggle},r.createElement(d.a,{color:"",disabled:a||0===t.length},e),r.createElement(u.a,null,t.map((e,t)=>"separator"===e.type?r.createElement(s.a,{key:t,divider:!0}):"header"===e.type?r.createElement(s.a,{key:t,header:!0},e.label):r.createElement(s.a,{key:t,onClick:t=>{t.preventDefault(),o&&o(e.value)},active:e.active||e.value===n},e.label))))}}},"./src/calc2/components/editorBase.tsx":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return T}));var r=n("./node_modules/@fortawesome/free-solid-svg-icons/index.es.js"),o=n("./node_modules/@fortawesome/react-fontawesome/index.es.js"),i=n("./src/calc2/components/dropdownList.tsx"),a=n("./src/calc2/components/toolbar.tsx"),s=n("./src/calc2/i18n.tsx"),l=n("./node_modules/classnames/index.js"),u=n("./node_modules/codemirror/lib/codemirror.js"),c=(n("./node_modules/codemirror/addon/hint/show-hint.js"),n("./src/db/exec/RANode.ts")),d=n("./src/db/translate/utils.ts"),h=n("./node_modules/react/index.js"),f=n("./node_modules/react-dom/index.js"),m=n("./node_modules/react-toastify/esm/react-toastify.js"),p=n("./node_modules/reactstrap/es/Button.js"),g=n("./node_modules/reactstrap/es/Modal.js"),y=n("./node_modules/reactstrap/es/ModalHeader.js"),b=n("./node_modules/reactstrap/es/ModalBody.js"),v=n("./node_modules/reactstrap/es/ModalFooter.js"),_=n("./node_modules/reactstrap/es/Input.js"),w=n("./node_modules/@handsontable/react/es/react-handsontable.js");n("./node_modules/codemirror/lib/codemirror.css"),n("./node_modules/codemirror/theme/eclipse.css"),n("./node_modules/codemirror/addon/hint/show-hint.css"),n("./node_modules/codemirror/addon/lint/lint.js"),n("./node_modules/codemirror/addon/lint/lint.css"),n("./node_modules/codemirror/addon/display/placeholder.js"),n("./node_modules/codemirror/addon/display/autorefresh.js"),n("./node_modules/codemirror/mode/sql/sql.js"),n("./node_modules/handsontable/dist/handsontable.full.css"),u.defineMode("relalg",(function(){const e=["pi","sigma","rho","tau","<-","->","intersect","union","except","/","-","\\\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","left semi join","right semi join","anti join","anti semi join","and","or","xor"],t=["π","σ","ρ","τ","←","→","∩","∪","÷","-","⨯","⨝","⟕","⟖","⟗","⋉","⋊","▷"],n=["<-","->",">=","<=","=","∧","∨","⊻","⊕","≠","=","¬",">","<","≥","≤"],r=(e,t,n,r="")=>{for(let o=0;o({inBlockComment:!1}),token:(o,i)=>i.inBlockComment?(o.match(/.*?\*\//,!0)?i.inBlockComment=!1:o.match(/.*/,!0),"comment"):o.match(/\/\*.*?\*\//,!0)?"comment":!i.inBlockComment&&o.match(/^\/\*.*/,!0)?(i.inBlockComment=!0,"comment"):i.inInlineRelation?(o.match(/.*?}/,!0)?i.inInlineRelation=!1:o.match(/.*/,!0),"inlineRelation"):o.match(/^{/,!0)?(i.inInlineRelation=!0,"inlineRelation"):o.match(/^--[\t ]/,!0)?(o.skipToEnd(),"comment"):o.match(/^\/\*.*?$/,!0)?"comment":r(o,t,!0)?"keyword math":r(o,e,!0,"([\\(\\)[\\]{\\}, \\.\\t]|$)")?"keyword":r(o,n,!0)?"operator math":o.match(/^\[[0-9]+]/,!0)?"attribute":o.match(/^[0-9]+(\.[0-9]+)?/,!0)?"number":o.match(/\^'[^']*'/i,!0)?"string":o.match(/\^[a-z]+\.[a-z]*/i,!0)?"qualified-column":o.match(/^[\(\)\[]\{},]/i,!0)?"bracket":o.match(/^[a-z][a-z0-9\.]*/i,!0)?"word":(o.next(),"else")}}));const E=e=>{const{editor:t}=e,{type:n,message:r,position:o}=e.alert,i={error:Object(s.d)("editor.alert-message-headers.error"),warning:Object(s.d)("editor.alert-message-headers.warning")}[n];return h.createElement("div",{className:l("alert ",{"alert-danger":"error"===n,"alert-warning":"warning"===n})},o?h.createElement("strong",null,i,": ",h.createElement("a",{onClick:e=>{if(t)return t.focus(),t.getDoc().setCursor(o),t.scrollIntoView(null,42),e.preventDefault(),!1;console.warn("editor not initialized yet")},href:"#"},Object(s.d)("editor.error-at-line-x",{line:o.line+1})),": ",r):h.createElement("strong",null,i,": ",r))};class j{constructor(){this.name="",this.type="",this.data=[]}}class C{constructor(){this.name="",this.attributes=[]}toString(e){let t="";t=!1===e?this.name+" = {\n":"{ ";const n=new Array;for(let e=0;e<1+this.attributes[0].data.length;e++)n.push("");return this.attributes.forEach((e,t)=>{t>0&&(n[0]+=", "),n[0]+=e.name,e.data.forEach((r,o)=>{t>0&&(n[o+1]+=", "),"number"===e.type?n[o+1]+=r:n[o+1]+="'"+r+"'"})}),t+=n.join("\n"),t+="\n}\n",t}fromTableData(e){if(null==e)return;const t=new Array;t.push([]),t.push([]),e.columns.forEach(e=>{t[0].push(e.name),t[1].push(e.type)}),e.rows.forEach(e=>{t.push(e)}),this.fromData(t)}toData(){const e=new Array;if(0===this.attributes.length)return[[]];for(let t=0;t<2+this.attributes[0].data.length;t++)e.push([]);return this.attributes.forEach(t=>{e[0].push(t.name),e[1].push(t.type),t.data.forEach((t,n)=>{e[n+2].push(t)})}),e}fromData(e){for(let t=0;t{const r=new Array,i=e.split(t);-1===o&&(o=i.length),i.length===o&&(i.forEach(e=>{r.push(e)}),n.push(r))}),this.fromData(n)}toCSV(e=";"){let t="";return this.toData().forEach(n=>{t+=n.join(e)+"\n"}),t}}const S="CodeMirror-table-edit-markers";class O extends h.Component{constructor(e){super(e);const t=Object.assign({theme:"eclipse",smartdent:!0,tabSize:2,indentWithTabs:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseBrackets:!0,smartIndent:!0,autofocus:!1,autoRefresh:!0,enableInlineRelationEditor:!0,gutters:["CodeMirror-lint-markers",S],mode:e.mode,viewportMargin:1/0,extraKeys:{"Shift-Tab":"indentLess","Ctrl-Enter":e=>{this.exec(!1)},"Shift-Ctrl-Enter":e=>{const{editor:t}=this.state;t&&t.getDoc().somethingSelected()&&this.exec(!0)},"Ctrl-S":e=>{this.downloadEditorText()},"Ctrl-Space":e=>{u.showHint(e,e=>this.genericHint(e),{closeOnUnfocus:!0})}},placeholder:Object(s.d)("editor.codemirror-placeholder"),textChange:null},e.codeMirrorOptions);this.hotTableSettings={colHeaders:!1,rowHeaders:function(e){return 0===e?Object(s.d)("calc.editors.ra.inline-editor.row-name"):1===e?Object(s.d)("calc.editors.ra.inline-editor.row-type"):e-1},height:function(){return.7*document.body.clientHeight},fixedRowsTop:2,minRows:2,minCols:1,minSpareRows:1,minSpareCols:1,colWidths:"100px",contextMenu:!0,cells:function(e,t){return 1===e?{type:"dropdown",source:["number","string","date"]}:{}}},this.state={editor:null,codeMirrorOptions:t,history:[],isSelectionSelected:!1,execSuccessful:!1,execErrors:[],isExecutionDisabled:!1,execResult:null,modal:!1,inlineRelationModal:!1,relationEditorName:"",replSelStart:null,replSelEnd:null},this.toggle=this.toggle.bind(this),this.inlineRelationEditorOk=this.inlineRelationEditorOk.bind(this),this.toggleInlineRelationEditor=this.toggleInlineRelationEditor.bind(this),this.inlineRelationEditorClose=this.inlineRelationEditorClose.bind(this),this.inlineRelationEditorUpload=this.inlineRelationEditorUpload.bind(this),this.inlineRelationEditorDownload=this.inlineRelationEditorDownload.bind(this),this.hinterCache={hints:[],hintsFromLinter:[],changed:!0},this.linter=this.linter.bind(this),this.exec=this.exec.bind(this),this.applyHistory=this.applyHistory.bind(this),this.downloadEditorText=this.downloadEditorText.bind(this),this.uploadCSVRef=h.createRef()}getInlineRelationData(){return this.hotTableSettings.data}setInlineRelationData(e){this.hotTableSettings.datta=e}inlineRelationEditorOpen(e){const t=new C,{editor:n}=this.state;if(n){let r=n.getDoc().getCursor(),o=n.getDoc().getCursor();e?(t.name=e.assignmentName,t.fromTableData(e.content),r=u.Pos(e.line-1,0),o=u.Pos(e.end.line,e.end.column)):(t.attributes.push(new j),t.attributes.push(new j)),this.setState({inlineRelationModal:!0,relationEditorName:t.name,replSelStart:r,replSelEnd:o},()=>{this.hotTableSettings.data=t.toData()})}}inlineRelationEditorOk(){const e=new C;e.name=this.state.relationEditorName,e.fromData(this.getInlineRelationData());const{editor:t,replSelStart:n,replSelEnd:r}=this.state;t&&t.getDoc().replaceRange(e.toString("relalg"===this.props.tab),n,r),this.inlineRelationEditorClose()}inlineRelationEditorClose(){this.setState({inlineRelationModal:!1})}inlineRelationEditorUpload(e){const t=e.target.files;if(t.length>0){const e=new FileReader;e.onload=e=>{const n=e.target.result,r=new C;r.fromCSV(n),r.name=t[0].name.replace(".csv",""),this.setInlineRelationData(r.toData())},e.readAsText(t[0])}}inlineRelationEditorDownload(){const e=new C;e.fromData(this.getInlineRelationData());const t=e.toCSV(),n=(document.createElement("a"),document.createElement("a"));n.href=window.URL.createObjectURL(new Blob([t],{type:"text/csv"})),n.download=this.state.relationEditorName+".csv",n.click()}componentDidMount(){const e=Object(f.findDOMNode)(this).querySelector("textarea");if(!e)throw new Error("could not fid textarea");const t=u.fromTextArea(e,this.state.codeMirrorOptions);this.setState({editor:t,relationEditorName:""}),null!=this.props.linterFunction&&t.setOption("lint",{getAnnotations:this.linter}),t.on("cursorActivity",e=>{this.setState({isSelectionSelected:e.getDoc().somethingSelected()})}),t.on("change",e=>{this.props.textChange(e)})}render(){const{execErrors:e,isSelectionSelected:t,editor:n,history:u,execSuccessful:c,isExecutionDisabled:d,execResult:f}=this.state,{toolbar:m,disableHistory:j=!1,execButtonLabel:C}=this.props;return h.createElement("div",null,h.createElement("div",{className:"editor-base"},h.createElement(a.a,{groups:m}),h.createElement("textarea",null),h.createElement("div",{className:"exec-errors"},e.map((e,t)=>h.createElement(E,{key:t,alert:e,editor:n}))),h.createElement("div",{className:"input-buttons"},h.createElement("button",{type:"button",disabled:d,className:l("btn btn-primary exec-button selection",{"selection-selected":t,"btn-danger":e.length>0,"btn-success":c,disabled:d}),onClick:()=>{n?this.exec(n.getDoc().somethingSelected()):console.warn("editor not initialized yet")}},C?h.createElement("span",null,h.createElement(o.a,{icon:r.o})," ",h.createElement(s.b,{id:C})):h.createElement(h.Fragment,null,h.createElement("span",{className:"glyphicon glyphicon-play"})," ",h.createElement("span",{className:"query"},h.createElement(o.a,{icon:r.n})," ",h.createElement(s.b,{id:"calc.editors.ra.button-execute-query"})),h.createElement("span",{className:"selection"},h.createElement(s.b,{id:"calc.editors.ra.button-execute-selection"})))),h.createElement("div",{style:{float:"right"}},h.createElement(p.a,{color:"Link",type:"button",className:"hideOnSM",onClick:this.downloadEditorText},h.createElement(o.a,{icon:r.h})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.ra.button-download"}))),j?null:h.createElement("div",{className:"btn-group history-container"},h.createElement(i.a,{label:h.createElement("span",null,h.createElement(o.a,{icon:r.k})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.button-history"}))),elements:u.map(e=>({label:h.createElement(h.Fragment,null,h.createElement("small",{className:"muted text-muted"},e.time.toLocaleTimeString()),h.createElement("div",null,e.code)),value:e})),onChange:this.applyHistory})))),h.createElement("div",{className:"exec-result"},f),h.createElement(g.a,{isOpen:this.state.modal,toggle:this.toggle,className:"showOnSM"},h.createElement(y.a,{toggle:this.toggle},Object(s.d)("calc.result.modal.title")),h.createElement(b.a,null,h.createElement("div",null,f)),h.createElement(v.a,null,h.createElement("span",null),h.createElement(p.a,{color:"secondary",onClick:this.toggle},Object(s.d)("calc.result.modal.close")))),h.createElement(g.a,{isOpen:this.state.inlineRelationModal,toggle:this.toggleInlineRelationEditor},h.createElement(y.a,{toggle:this.toggleInlineRelationEditor},Object(s.d)("calc.editors.ra.inline-editor.title")),h.createElement(b.a,null,h.createElement("div",null,"group"===this.props.tab?h.createElement("div",null,h.createElement(_.a,{placeholder:Object(s.d)("calc.editors.ra.inline-editor.input-relation-name"),value:this.state.relationEditorName,onChange:e=>{this.setState({relationEditorName:e.target.value})}}),h.createElement("br",null)):null,h.createElement(w.a,{settings:this.hotTableSettings,licenseKey:"non-commercial-and-evaluation"}))),h.createElement(v.a,null,h.createElement(p.a,{color:"light",onClick:this.inlineRelationEditorDownload},h.createElement(o.a,{icon:r.h})," ",Object(s.d)("calc.editors.ra.inline-editor.button-download-csv")),h.createElement(p.a,{color:"light",onClick:()=>{var e;null===(e=this.uploadCSVRef.current)||void 0===e||e.click()}},h.createElement(o.a,{icon:r.s})," ",Object(s.d)("calc.editors.ra.inline-editor.button-upload-csv")),h.createElement("input",{className:"hidden",ref:this.uploadCSVRef,onChange:this.inlineRelationEditorUpload,type:"file"}),h.createElement("span",{className:"flexSpan"}),h.createElement(p.a,{color:"primary",onClick:this.inlineRelationEditorOk},h.createElement(o.a,{icon:r.e})," ",Object(s.d)("calc.editors.ra.inline-editor.button-ok")),h.createElement(p.a,{color:"secondary",onClick:this.inlineRelationEditorClose},h.createElement(o.a,{icon:r.r})," ",Object(s.d)("calc.editors.ra.inline-editor.button-cancel"))))))}isMobile(){return window.innerWidth<=992}toggleInlineRelationEditor(){this.setState({inlineRelationModal:!this.state.inlineRelationModal})}toggle(){this.isMobile()&&this.setState({modal:!this.state.modal})}applyHistory(e){this.replaceAll(e.code)}forceLinterRun(){const{editor:e}=this.state;if(!e)return void console.warn("editor not initialized yet");const t=e.getValue();e.setValue(""),e.setValue(t)}historyAddEntry(e){const{historyMaxEntries:t=10,historyMaxLabelLength:n=20}=this.props,r={time:new Date,label:e.length>n?e.substr(0,n-4)+" ...":e,code:e};this.setState({history:[r,...this.state.history].slice(-t)})}clearExecutionAlerts(){this.state.execErrors.splice(0,this.state.execErrors.length),m.b.dismiss()}addExecutionWarning(e,t){this._addExecutionAlert(e,t,"warning"),this.isMobile()&&m.b.warn(e,{className:"fancyToastWarning"})}addExecutionError(e,t){this._addExecutionAlert(e,t,"error"),this.isMobile()&&m.b.error(e,{className:"fancyToastError"})}_addExecutionAlert(e,t,n){this.isMobile();const{editor:r}=this.state,o={type:n,message:e,position:t},i=this.state.execErrors;i.push(o),this.setState({execErrors:i})}setText(e,t){const{editor:n}=this.state;n?("selection"===t?n.getDoc().replaceSelection(e,"end"):n.setValue(e),this.clearExecutionAlerts(),this.setState({execSuccessful:!1})):console.warn("editor not initialized yet")}getText(){const{editor:e}=this.state;if(e)return e.getValue();console.warn("editor not initialized yet")}focus(){const{editor:e}=this.state;e?e.focus():console.warn("editor not initialized yet")}refresh(){const{editor:e}=this.state;e?e.refresh():console.warn("editor not initialized yet")}downloadEditorText(){let e="query";const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");switch(t.getOption("mode")){case"sql":case"text/x-mysql":e+=".sql";break;case"ra":default:e+=".txt"}((e,t)=>{const n=document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"text/plain"})),n.download=e,n.click()})(e,t.getValue())}resetHinter(){this.hinterCache={hints:[],hintsFromLinter:[],changed:!0}}linter(t){const{editor:n}=this.state;if(!n)return console.warn("editor not initialized yet"),[];if(0===t.length||!this.props.linterFunction)return[];try{const e=this.props.linterFunction(this,n,t);return 0===e.length&&0===this.hinterCache.hintsFromLinter.length||(this.hinterCache.hintsFromLinter=e,this.hinterCache.changed=!0),[]}catch(t){const r=[];console.log(t);const o=O._generateErrorFromException(t,0,0),i=e("").append(o.message).text();if(!o.codemirrorPositions)return this.clearExecutionAlerts(),this.addExecutionError(i),[];const a=o.codemirrorPositions.from;let s=o.codemirrorPositions.to;const l=n.getTokenAt({line:a.line,ch:a.ch+1},!0),u=n.getDoc().getRange(a,s);return void 0!==l.string&&l.string.length>u.length&&(s=n.getDoc().posFromIndex(n.getDoc().indexFromPos(a)+l.string.length)),r.push({from:a,to:s,message:i,severity:"error"}),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers(),r}}genericHint(e){const{getHintsFunction:t}=this.props,n=e.getDoc().getCursor(),r=e.getTokenAt(n),o=(e,t="unknown")=>({text:e,displayText:e,className:`hint-${t}`});let i=[];if(!0===this.hinterCache.changed){const e={},n=t?t():[];for(let t=0;t0)for(let e=0;es.length&&0===t.indexOf(s)&&a.push(i[e])}else a=i;return{list:a,from:u.Pos(n.line,r.start),to:u.Pos(n.line,r.end)}}exec(e){const{editor:t}=this.state;if(!t)throw new Error("editor not initialized yet");this.setState({execResult:h.createElement("div",{className:"spinner"},h.createElement("div",{className:"rect1"}),h.createElement("div",{className:"rect2"}),h.createElement("div",{className:"rect3"}),h.createElement("div",{className:"rect4"}),h.createElement("div",{className:"rect5"}))},()=>{this.clearExecutionAlerts();let n="",r={line:0,ch:0};!0!==e?n=t.getValue():(n=t.getDoc().getSelection(),r=t.getDoc().getCursor("from")),0===n.length&&(this.clearExecutionAlerts(),this.addExecutionError(Object(s.d)("editor.error-no-query-found"))),this.clearExecutionAlerts();try{const{result:e}=this.props.execFunction(this,n,r);this.setState({execResult:e});const t=new CustomEvent("editor.execSuccessful",{detail:{editor:this}});return document.dispatchEvent(t),this.toggle(),!0}catch(e){console.error(e,e.stack);const t=O._generateErrorFromException(e,r.line,r.ch);this.addExecutionError(t.message,t.codemirrorPositions?t.codemirrorPositions.from:void 0),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers()}})}static _generateErrorFromException(e,t,n){let r=void 0!==e.message?e.message:e;r=r.replace(/(\\(u|x)[0-9A-F]+)/g,(e,t)=>`${String.fromCharCode(parseInt(t.substr(2),16))}`);let o=null;void 0!==e.codeInfo&&void 0!==e.codeInfo.location?o=e.codeInfo.location:void 0!==e.location&&(o=e.location);let i=null;return null!==o&&(i={from:{line:o.start.line+(t||0)-1,ch:o.start.column+(n||0)-1},to:{line:o.end.line+(t||0)-1,ch:o.end.column+(n||0)-1}}),{message:r,location:o,codemirrorPositions:i}}static buildTranslatedPegJsMessage(e,t){return null!==e&&function(e){let t=1;for(e.sort((e,t)=>e.descriptiont.description?1:0);t1?`${n.slice(0,-1).join(", ")} ${Object(s.d)("editor.pegjs-error.or")} ${n[e.length-1]}`:n[0],o=t?`"${function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)}"`:Object(s.d)("editor.pegjs-error.end-of-input");return Object(s.d)("editor.pegjs-error.expected-found",{expected:r,found:o})}(e,t)}setExecutionDisabled(e){this.setState({isExecutionDisabled:e})}replaceText(e,t){const n="string"==typeof e.label?e.label:"";this.replaceSelection(n,t)}replaceSelection(e,t){this.setText(t||e,"selection"),this.focus()}replaceAll(e,t){this.setText(t||e,"all"),this.focus()}setReadOnly(t){const{editor:n}=this.state;if(!n)throw new Error("editor not initialized yet");const r=e(n.getWrapperElement());!1===t?(n.setOption("readOnly",!1),r.removeClass("readonly")):(n.setOption("readOnly","nocursor"),r.addClass("readonly"))}addInlineRelationMarkers(e){const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");const n=function(e){const t=[];return Object(d.a)(e,e=>{const n=e;if(n&&"table"===n.type){const e={name:n.name,line:n.codeInfo.location.start.line-1,column:n.codeInfo.location.start.column-1,length:n.codeInfo.text.length,assignmentName:n.assignmentName?n.assignmentName:"",content:{columns:n.columns,rows:n.rows},start:n.codeInfo.location.start,end:n.codeInfo.location.end};t.push(e)}}),t}(e);this.clearInlineRelationMarkers();for(let e=0;e{this.inlineRelationEditorOpen(n[e])},f.render(h.createElement(o.a,{icon:r.q}),i,()=>{i.style.marginLeft="-15px",t.setGutterMarker(n[e].line++,S,i)})}}clearInlineRelationMarkers(){const{editor:e}=this.state;e?e.clearGutter(S):console.warn("editor not initialized yet")}}function k(e){const t=[],n=function(e){const r=e.getSchema();for(let e=0;e-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())},n.onMouseLeaveTooltipContent=function(e){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),e.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide")))},n.onEscKeyDown=function(e){"Escape"===e.key&&this.hide(e)},n.getRef=function(e){var t=this.props.innerRef;t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),this._popover=e},n.getDelay=function(e){var t=this.props.delay;return"object"==typeof t?isNaN(t[e])?S[e]:t[e]:t},n.show=function(e){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=e?e.currentTarget||e.target:null,e&&e.composedPath&&"function"==typeof e.composedPath){var t=e.composedPath();this.currentTargetElement=t&&t[0]||this.currentTargetElement}this.toggle(e)}},n.showWithDelay=function(e){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,e),this.getDelay("show"))},n.hide=function(e){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(e))},n.hideWithDelay=function(e){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide"))},n.clearShowTimeout=function(){clearTimeout(this._showTimeout),this._showTimeout=void 0},n.clearHideTimeout=function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0},n.handleDocumentClick=function(e){var t=this.props.trigger.split(" ");t.indexOf("legacy")>-1&&(this.props.isOpen||T(e.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!k(e.target,this._popover)?this.hideWithDelay(e):this.props.isOpen||this.showWithDelay(e)):t.indexOf("click")>-1&&T(e.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(e):this.showWithDelay(e))},n.addEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.addEventListener(e,t,n)}))},n.removeEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.removeEventListener(e,t,n)}))},n.addTargetEvents=function(){if(this.props.trigger){var e=this.props.trigger.split(" ");-1===e.indexOf("manual")&&((e.indexOf("click")>-1||e.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(e.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),e.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}},n.removeTargetEvents=function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)},n.updateTarget=function(){var e=Object(b.i)(this.props.target,!0);e!==this._targets&&(this.removeTargetEvents(),this._targets=e?Array.from(e):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())},n.toggle=function(e){return this.props.disabled||!this._isMounted?e&&e.preventDefault():this.props.toggle(e)},n.render=function(){if(!this.props.isOpen)return null;this.updateTarget();var e=this.props,t=e.className,n=e.cssModule,r=e.innerClassName,o=e.isOpen,s=e.hideArrow,l=e.boundariesElement,u=e.placement,c=e.placementPrefix,d=e.arrowClassName,h=e.popperClassName,f=e.container,m=e.modifiers,p=e.offset,g=e.fade,y=e.flip,v=Object(b.l)(this.props,Object.keys(C)),_=Object(b.k)(h,n),w=Object(b.k)(r,n);return i.a.createElement(j,{className:t,target:this.currentTargetElement||this._targets[0],isOpen:o,hideArrow:s,boundariesElement:l,placement:u,placementPrefix:c,arrowClassName:d,popperClassName:_,container:f,modifiers:m,offset:p,cssModule:n,fade:g,flip:y},i.a.createElement("div",Object(a.a)({},v,{ref:this.getRef,className:w,role:"tooltip",onMouseOver:this.onMouseOverTooltipContent,onMouseLeave:this.onMouseLeaveTooltipContent,onKeyDown:this.onEscKeyDown})))},t}(i.a.Component);M.propTypes=C,M.defaultProps=O;var x=M,L=function(e){var t=l()("popover","show",e.popperClassName),n=l()("popover-inner",e.innerClassName);return i.a.createElement(x,Object(a.a)({},e,{popperClassName:t,innerClassName:n}))};L.propTypes=C,L.defaultProps={placement:"right",placementPrefix:"bs-popover",trigger:"click"};var R=L,A={tag:b.o,className:h.a.string,cssModule:h.a.object},D=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-header"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};D.propTypes=A,D.defaultProps={tag:"h3"};var N=D,P={tag:b.o,className:h.a.string,cssModule:h.a.object},I=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-body"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};I.propTypes=P,I.defaultProps={tag:"div"};var H=I;class Y extends o.Component{constructor(e){super(e),this.body=Object(r.a)((e,t)=>!1===t?null:"function"==typeof e?e():e),this.state={id:"popWrapper_"+Math.random().toString(36).substr(2),isOpen:!1},this.hoverOpen=this.hoverOpen.bind(this),this.hoverClose=this.hoverClose.bind(this),this.handleClick=this.handleClick.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this)}componentWillUnmount(){this.close()}open(){this.setState({isOpen:!0}),document.addEventListener("click",this.close)}close(e){if(e){const{target:t}=e;if(t instanceof Element&&null!==t.closest(".popover__inside"))return}this.setState({isOpen:!1}),document.removeEventListener("click",this.close)}hoverOpen(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.open()}hoverClose(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.close()}handleClick(e){const{trigger:t,onClick:n}=this.props;if(n&&n(e),"click"===t||Array.isArray(t)&&t.includes("click")){const{isOpen:e}=this.state;e?this.close():this.open()}}render(){const{id:e,isOpen:t}=this.state,{title:n,className:r=""}=this.props,i=this.body(this.props.body,t);return o.createElement(o.Fragment,null,o.createElement("div",{onMouseEnter:this.hoverOpen,onMouseLeave:this.hoverClose,onFocus:this.hoverOpen,onBlur:this.hoverClose,onClick:this.handleClick,id:e,className:`popover__outside ${r}`},o.Children.only(this.props.children),o.createElement(R,{target:`#${e}`,isOpen:t,className:`popover__inside ${r}`},o.createElement(N,null,n),o.createElement(H,null,i))))}}},"./src/calc2/components/raTree.scss":function(e,t,n){},"./src/calc2/components/result.scss":function(e,t,n){},"./src/calc2/components/toolbar.scss":function(e,t,n){},"./src/calc2/components/toolbar.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("./src/calc2/components/dropdownList.tsx"),o=n("./src/calc2/components/popover.tsx"),i=n("./src/calc2/i18n.tsx"),a=n("./node_modules/react/index.js");n("./src/calc2/components/toolbar.scss");class s extends a.Component{render(){const{groups:e}=this.props;return a.createElement("div",{className:"toolbar codemirror-toolbar"},e.map((e,t)=>e.items.map((e,t)=>a.createElement(o.a,{key:t,trigger:["hover","focus"],placement:"dropdown"===e.type?"top":"bottom",title:e.tooltipTitle?String(Object(i.d)(e.tooltipTitle)):"",body:a.createElement(i.b,{id:e.tooltip,html:!0}),className:("dropdown"===e.type?"toolbar__popover__dropdown":"toolbar__popover")+" "+(void 0===e.className?"":e.className)},"dropdown"===e.type?a.createElement(r.a,{label:e.label,elements:e.elements,onChange:e.onChange,value:e.value}):a.createElement("span",{onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onClick(e)}},e.label)))))}}},"./src/calc2/data/uibk.txt":function(e,t,n){"use strict";n.r(t),t.default="group: UIBK - R, S, T\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \ncategory@de:Universität Innsbruck\ncategory@en:University of Innsbruck\n\nR = {\na, b, c\n\n1, 'a', 'd'\n3, 'c', 'c'\n4, 'd', 'f'\n5, 'd', 'b'\n6, 'e', 'f'\n}\n\nS = {\nb, d\n\n'a', 100\n'b', 300\n'c', 400\n'd', 200\n'e', 150\n}\n\nT = {\nb, d\n\n'a', 100\n'd', 200\n'f', 400\n'g', 120\n}\n\ngroup: Kemper Datenbanksysteme\ndescription: Source: [Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage](http://www3.in.tum.de/teaching/bookDBMSeinf/), Seite 84, Abbildung 3.8\n\nProfessoren = {\nPersNr:number\tName:string\tRang:string\tRaum:number\n2125\tSokrates\tC4\t226\n2126\tRussel\tC4\t232\n2127\tKopernikus\tC3\t310\n2133\tPopper\tC3\t52\n2134\tAugustinus\tC3\t309\n2136\tCurie\tC4\t36\n2137\tKant\tC4\t7\n}\n\nStudenten = {\nMatrNr:number\tName:string\tSemester:number\n24002\tXenokrates\t18\n25403\tJonas\t12\n26120\tFichte\t10\n26830\tAristoxenos\t8\n27550\tSchopenhauer\t6\n28106\tCarnap\t3\n29120\tTheophrastos\t2\n29555\tFeuerbach\t2\n}\n\n\nVorlesungen = {\nVorlNr:number\tTitel:string\tSWS:number\tgelesenVon:number\n5001\tGrundzuege\t4\t2137\n5041\tEthik\t4\t2125\n5043\tErkenntnistheorie\t3\t2126\n5049\tMaeeutik\t2\t2125\n4052\tLogik\t4\t2125\n5052\tWissenschaftstheorie\t3\t2126\n5216\tBioethik\t2\t2126\n5259\t'Der Wiener Kreis'\t2\t2133\n5022\t'Glaube und wissen'\t2\t2134\n4630\t'Glaube und wissen'\t4\t2137\n}\n\nvoraussetzen = {\nVorgaenger:number\tNachfolger:number\n5001\t5041\n5001\t5043\n5001\t5049\n5041\t5216\n5043\t5052\n5041\t5052\n5052\t5259\n}\n\nhoeren = {\nMatrNr:number\tVorlNr:number\n26120\t5001\n27550\t5001\n27550\t4052\n28106\t5041\n28106\t5052\n28106\t5216\n28106\t5259\n29120\t5001\n29120\t5041\n29120\t5049\n29555\t5022\n25403\t5022\n29555\t5001\n}\n\nAssistenten = {\nPersNr:number\tName:string\tFachgebiet:string\tBoss:number\n3002\tPlaton\tIdeenlehre\t2125\n3003\tAristoteles\tSyllogistik\t2125\n3004\tWittgenstein\tSprachtheorie\t2126\n3005\tRhetikus\tPlanetenbewegung\t2127\n3006\tNewton\t'Keplersche Gesetze'\t2127\n3007\tSpinoza\t'Gott und Natur'\t2134\n}\n\npruefen = {\nMatrNr:number\tVorlNr:number\tPersNr:number\tNote:number\n28106\t5001\t2126\t1\n25403\t5041\t2125\t2\n27550\t4630\t2137\t2\n}\n\n\n\ngroup: UIBK - KursDB\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \n\nKurs = {\nKursNr, Titel\n\nG08, 'Grundlagen I'\nG10, 'Grundlagen II'\nP13, 'C-Programmierung'\nI09, Datenbanken\n}\n\nKursleiter = {\nPersNr, Name, Gehalt\n\n27183, 'Meier, I.', 4300.50\n29594, 'Schulze, H.', 3890.20\n38197, 'Huber, L.', 4200.10\n43325, 'Müller, K.', 3400.80\n}\n\nVorauss = {\nVorNr, KursNr\nG08, P13\nG10, P13\nG08, I09\nG10, I09\nP13, I09\n}\n\nFuehrt_durch = {\nAngNr\tKursNr\tPersNr\n1\tG08\t38197\n2\tG08\t38197\n1\tG10\t43325\n2\tG10\t29594\n1\tP13\t27183\n2\tP13\t27183\n1\tI09\t29594\n2\tI09\t29594\n3\tI09\t29594\n}\n\nTeilnehmer = {\nTnNr, Name, Ort \n143, 'Schmidt, M.', Bremen \n145, 'Huber, Chr.', Augsburg \n146, 'Abele, I.', Senden \n149, 'Kircher, B.', Bochum \n155, 'Meier, W.', Stuttgart \n171, 'Möller, H.', Innsbruck \n173, 'Schulze, B.', Stuttgart \n177, 'Mons, F.', Essen \n185, 'Meier, K.', Heidelberg \n187, 'Karstens, L.', Hamburg \n194, 'Gerstner, M.', Innsbruck \n}\n\nNimmt_teil = {\nAngNr\tKursNr\tTnNr\n2\tG08\t143\n2\tP13\t143\n1\tG08\t145\n1\tP13\t146\n1\tI09\t146\n2\tP13\t149\n1\tI09\t155\n1\tI09\t171\n1\tI09\t173\n2\tP13\t177\n1\tI09\t185\n2\tI09\t187\n1\tP13\t194\n}\n\nAngebot = {\nAngNr\tKursNr\tDatum\tOrt\n1\tG08\t2000-10-13\t'München'\n2\tG08\t2000-11-24\tBremen\n1\tG10\t2000-12-01\t'München'\n2\tG10\t2001-02-15\tHamburg\n1\tP13\t2001-05-28\tInnsbruck\n2\tP13\t2001-07-01\tEssen\n1\tI09\t2001-03-27\tStuttgart\n2\tI09\t2001-04-23\tHamburg\n3\tI09\t2001-05-29\t'München'\n}\n\n\n\ngroup:Database Systems The Complete Book - Exercise 2.4.1\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 52-55 ]]\n\nProduct = {\nmaker\tmodel\ttype\nA\t1001\tpc\nA\t1002\tpc\nA\t1003\tpc\nA\t2004\tlaptop\nA\t2005\tlaptop\nA\t2006\tlaptop\nB\t1004\tpc\nB\t1005\tpc\nB\t1006\tpc\nB\t2007\tpc\nC\t1007\tpc\nD\t1008\tpc\nD\t1009\tpc\nD\t1010\tpc\nD\t3004\tprinter\nD\t3005\tprinter\nE\t1011\tpc\nE\t1012\tpc\nE\t1013\tpc\nE\t2001\tlaptop\nE\t2002\tlaptop\nE\t2003\tlaptop\nE\t3001\tprinter\nE\t3002\tprinter\nE\t3003\tprinter\nF\t2008\tlaptop\nF\t2009\tlaptop\nG\t2010\tlaptop\nH\t3006\tprinter\nH\t3007\tprinter\n}\n\nPC = {\nmodel\tspeed\tram\thd\tprice\n1001\t2.66\t1024\t250\t2114\n1002\t2.1\t512\t250\t995\n1003\t1.42\t512\t80\t478\n1004\t2.8\t1024\t250\t649\n1005\t3.2\t512\t250\t630\n1006\t3.2\t1024\t320\t1049\n1007\t2.2\t1024\t200\t510\n1008\t2.2\t2048\t250\t770\n1009\t2\t1024\t250\t650\n1010\t2.8\t2048\t300\t770\n1011\t1.86\t2048\t160\t959\n1012\t2.8\t1024\t160\t649\n1013\t3.06\t512\t80\t529\n}\n\nLaptop = {\nmodel\tspeed\tram\thd\tscreen\tprice\n2001\t2\t2048\t240\t20.1\t3673\n2002\t1.73\t1024\t80\t17\t949\n2003\t1.8\t512\t60\t15.4\t549\n2004\t2\t512\t60\t13.3\t1150\n2005\t2.16\t1024\t120\t17\t2500\n2006\t2\t2048\t80\t15.4\t1700\n2007\t1.83\t1024\t120\t13.3\t1429\n2008\t1.6\t1024\t100\t15.4\t900\n2009\t1.6\t512\t80\t14.1\t680\n2010\t2\t2048\t160\t15.4\t2300\n}\n\nPrinter = {\nmodel\tcolor\ttype\tprice\n3001\ttrue\tink-jet\t99\n3002\tfalse\tlaser\t239\n3003\ttrue\tlaser\t899\n3004\ttrue\tink-jet\t120\n3005\tfalse\tlaser\t120\n3006\ttrue\tink-jet\t100\n3007\ttrue\tlaser\t200\n}\n\ngroup:Database Systems The Complete Book - Exercise 2.4.3\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 55-57 ]]\n\nClasses = {\nclass\ttype\tcountry\tnumGuns\tbore\tdisplacement\nBismarck\tbb\tGermany\t8\t15\t42000\nIowa\tbb\tUSA\t9\t16\t46000\nKongo\tbc\tJapan\t8\t14\t32000\n'North Carolina'\tbb\tUSA\t9\t16\t37000\nRenown\tbc\t'Gt. Britan'\t6\t15\t23000\nRevenge\tbb\t'Gt. Britan'\t8\t15\t29000\nTennessee\tbb\tUSA\t12\t14\t32000\nYamato\tbb\tJapan\t9\t18\t65000\n}\n\nBattles = {\nname\tdate\n'Denmark Strait'\t1941-05-24\nGuadalcanal\t1942-11-15\n'North Cape'\t1943-12-26\n'Surigao Strait'\t1944-10-25\n}\n\nOutcomes = {\nship\tbattle\tresult\nArizona\t'Pearl Harbor'\tsunk\nBismarck\t'Denmark Strait'\tsunk\nCalifornia\t'Surigao Strait'\tok\n'Duke of York'\t'North Cape'\tok\nFuso\t'Surigao Strait'\tsunk\nHood\t'Denmark Strait'\tsunk\n'King George V'\t'Denmark Strait'\tok\nKirishima\tGuadalcanal\tsunk\n'Prince of Wales'\t'Denmark Strait'\tdamaged\nRodney\t'Denmark Strait'\tok\nScharnhorst\t'North Cape'\tsunk\n'South Dakota'\tGuadalcanal\tdamaged\nTennessee\t'Surigao Strait'\tok\nWashington\tGuadalcanal\tok\n'West Virginia'\t'Surigao Strait'\tok\nYamashiro\t'Surigao Strait'\tsunk\n}\n\nShips = {\nname\tclass\tlaunched\nCalifornia\tTennessee\t1921\nHaruna\tKongo\t1915\nHiei\tKongo\t1914\nIowa\tIowa\t1943\nKirishima\tKongo\t1915\nKongo\tKongo\t1913\nMissouri\tIowa\t1944\nMusashi\tYamato\t1942\n'New Jersey'\tIowa\t1943\n'North Carolina'\t'North Carolina'\t1941\nRamillies\tRevenge\t1917\nRenown\tRenown\t1916\nRepulse\tRenown\t1916\nResolution\tRevenge\t1916\nRevenge\tRevenge\t1916\n'Royal Oak'\tRevenge\t1916\n'Royal Sovereign'\tRevenge\t1916\nTennessee\tTennessee\t1920\nWashington\t'North Carolina'\t1941\nWisconsin\tIowa\t1944\nYamato\tYamato\t1941\n}\n\n\ngroup:Wikipedia - Relational algebra (en)\ndescription[[This are the tables from [Relational algebra - Wikipedia The Free Encyclopedia](http://en.wikipedia.org/wiki/Relational_algebra)\n\nlicense: [CC BY-SA](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)]]\n\nEmployee = {\n\tName:string, EmpId:number, DeptName:string\n\t'Harry' , 3415 , 'Finance' \n\t'Sally' , 2241 , 'Sales' \n\t'George' , 3401 , 'Finance' \n\t'Harriet' , 2202 , 'Sales' \n\t'Tim' , 1123 , 'Executive' \n}\n\nDept = {\n\tDeptName:string, Manager:string\n\t'Sales' , 'Harriet' \n\t'Production' , 'Charles' \n}\n\nCompleted = {\n\tStudent:string, Task:string\n\t'Fred' , 'Database1'\n\t'Fred' , 'Database2'\n\t'Fred' , 'Compiler1'\n\t'Eugene' , 'Database1'\n\t'Eugene' , 'Compiler1'\n\t'Sarah' , 'Database1'\n\t'Sarah' , 'Database2'\n}\n\nDBProject = {\n\tTask:string\n\t'Database1'\n\t'Database2'\n}\n\nCar = {\n\tCarModel:string, CarPrice:number\n\t'CarA' , 20000 \n\t'CarB' , 30000 \n\t'CarC' , 50000 \n}\n\nBoat = {\n\tBoatModel:string, BoatPrice:number\n\t'Boat1' , 10000 \n\t'Boat2' , 40000 \n\t'Boat3' , 60000 \n}"},"./src/calc2/i18n.tsx":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return g}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./node_modules/i18next-browser-languagedetector/index.js"),i=n("./node_modules/react/index.js"),a=n("./src/locales/de.json"),s=n("./src/locales/en.json"),l=n("./src/locales/es.json"),u=n("./src/locales/kr.json"),c=n("./src/locales/pt.json");const d=r.b(o).init({resources:{en:{translations:s},de:{translations:a},es:{translations:l},kr:{translations:u},pt:{translations:c}},fallbackLng:"en",nsSeparator:":",keySeparator:!1,defaultNS:"translations",debug:!0});function h(e,t){return String(d.t(e,t))}const{Provider:f,Consumer:m}=i.createContext(d),p=e=>i.createElement(f,{value:d},e.children),g=({id:e,html:t=!1})=>i.createElement(m,null,n=>t?i.createElement("span",{dangerouslySetInnerHTML:{__html:String(n.t(e,{interpolation:{escapeValue:!1}}))}}):i.createElement("span",null,String(n.t(e))))},"./src/calc2/main.hot.tsx":function(e,t,n){"use strict";(function(e){var r=n("./src/calc2/main.tsx"),o=n("./node_modules/react-hot-loader/index.js");t.a=Object(o.hot)(e)(r.a)}).call(this,n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./src/calc2/main.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return zn}));n("./node_modules/bootstrap/dist/css/bootstrap.css");var r=n("./src/calc2/i18n.tsx"),o=n("./node_modules/react/index.js"),i=n.n(o),a=n("./node_modules/prop-types/index.js"),s=n.n(a),l=i.a.createContext(null);var u=function(e){e()},c={notify:function(){}};function d(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=d())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();var f=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new h(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,s]);var u=n||l;return i.a.createElement(u.Provider,{value:a},r)},m=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),p=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"),g=n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),y=n.n(g),b=n("./node_modules/react-is/index.js"),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,_=[],w=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function j(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function C(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function S(e,t,n,r,o,i,a,s,l,u){if(e){var c=!1,d=null,h=function(){if(!c){var e,n,h=t.getState();try{e=r(h,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=h,n.trySubscribe(),h();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var O=function(){return[null,0]};function k(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,d=void 0===c?void 0:c,f=n.shouldHandleStateChanges,g=void 0===f||f,v=n.storeKey,k=void 0===v?"store":v,T=(n.withRef,n.forwardRef),M=void 0!==T&&T,x=n.context,L=void 0===x?l:x,R=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),A=L;return function(t){var n=t.displayName||t.name||"Component",r=a(n),s=Object(m.a)({},R,{getDisplayName:a,methodName:u,renderCountProp:d,shouldHandleStateChanges:g,storeKey:k,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=R.pure;var c=l?o.useMemo:function(e){return e()};function f(n){var r=Object(o.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],l=r[1],u=r[2],d=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(b.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:A}),[a,A]),f=Object(o.useContext)(d),y=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var v=y?n.store:f.store,k=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,s)}(v)}),[v]),T=Object(o.useMemo)((function(){if(!g)return w;var e=new h(v,y?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[v,y,f]),M=T[0],x=T[1],L=Object(o.useMemo)((function(){return y?f:Object(m.a)({},f,{subscription:M})}),[y,f,M]),R=Object(o.useReducer)(E,_,O),D=R[0][0],N=R[1];if(D&&D.error)throw D.error;var P=Object(o.useRef)(),I=Object(o.useRef)(u),H=Object(o.useRef)(),Y=Object(o.useRef)(!1),F=c((function(){return H.current&&u===I.current?H.current:k(v.getState(),u)}),[v,D,u]);j(C,[I,P,Y,u,F,H,x]),j(S,[g,v,M,k,I,P,Y,H,x,N],[v,M,k]);var W=Object(o.useMemo)((function(){return i.a.createElement(t,Object(m.a)({},F,{ref:l}))}),[l,t,F]);return Object(o.useMemo)((function(){return g?i.a.createElement(d.Provider,{value:L},W):W}),[d,W,L])}var v=l?i.a.memo(f):f;if(v.WrappedComponent=t,v.displayName=r,M){var T=i.a.forwardRef((function(e,t){return i.a.createElement(v,Object(m.a)({},e,{forwardedRef:t}))}));return T.displayName=r,T.WrappedComponent=t,y()(T,t)}return y()(v,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function M(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function B(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,o=t.mapStateToPropsFactories,i=void 0===o?N:o,a=t.mapDispatchToPropsFactories,s=void 0===a?D:a,l=t.mergePropsFactories,u=void 0===l?I:l,c=t.selectorFactory,d=void 0===c?F:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,c=void 0===l||l,h=a.areStatesEqual,f=void 0===h?B:h,g=a.areOwnPropsEqual,y=void 0===g?M:g,b=a.areStatePropsEqual,v=void 0===b?M:b,_=a.areMergedPropsEqual,w=void 0===_?M:_,E=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),j=W(e,i,"mapStateToProps"),C=W(t,s,"mapDispatchToProps"),S=W(n,u,"mergeProps");return r(d,Object(m.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:j,initMapDispatchToProps:C,initMergeProps:S,pure:c,areStatesEqual:f,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var z=U();var V,q=n("./node_modules/react-dom/index.js");V=q.unstable_batchedUpdates,u=V;var G=n("./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");function K(e){return"/"===e.charAt(0)}function X(e,t){for(var n=t,r=n+1,o=e.length;r=0;c--){var d=o[c];"."===d?X(o,c):".."===d?(X(o,c),u++):u&&(X(o,c),u--)}if(!s)for(;u--;u)o.unshift("..");!s||""===o[0]||o[0]&&K(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function J(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Q=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=J(t),o=J(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var Z=function(e,t){if(!e)throw new Error("Invariant failed")};function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e){return"/"===e.charAt(0)?e.substr(1):e}function ne(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function re(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function oe(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function ie(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(m.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=$(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function ae(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=ie(e,t,d(),y.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))}))},go:g,goBack:function(){g(-1)},goForward:function(){g(1)},canGo:function(e){var t=y.index+e;return t>=0&&t=0&&t<=r),active:e===t},o.createElement(ct,{onClick:()=>this.setPage(t)},t+1)));return o.createElement("ul",{className:"pagination"},o.createElement(st,{disabled:0===e},o.createElement(ct,{previous:!0,onClick:()=>this.setPage(e-1)})),i,o.createElement(st,{disabled:e+1>=r},o.createElement(ct,{next:!0,onClick:()=>this.setPage(e+1)})))}}var ht=n("./src/db/exec/ValueExpr.ts");n("./src/calc2/components/pagedTable.scss");class ft extends o.Component{constructor(e){super(e),this.state={page:0}}render(){const{table:e,maxLinesPerPage:t,showPagination:n=!0,className:r=""}=this.props,{page:i}=this.state,a=e.getSchema();return o.createElement("div",{className:"result-table pagedTable"},o.createElement("table",{className:r},o.createElement("thead",null,o.createElement("tr",null,a.getColumns().map((e,t)=>o.createElement("th",{key:t},e.toString())))),o.createElement("tbody",null,e.getRows(i*t,t).map((e,t)=>o.createElement("tr",{key:`row ${t}`},e.map((e,t)=>{const n=a.getType(t);return o.createElement("td",{key:`value ${t}`,className:`${n} ${null===e?"null":""}`},Object(ht.d)(e,n))}))))),n?o.createElement("div",{className:"pagination"},o.createElement(dt,{total:e.getNumRows(),maxLinesPerPage:t,pageChanged:e=>this.setState({page:e}),currentPage:i})):null)}}var mt=n("./src/calc2/components/popover.tsx"),pt=n("./src/db/exec/RANode.ts");n("./src/calc2/components/raTree.scss");class gt extends o.Component{constructor(e){super(e)}render(){const{root:e,numTreeLabelColors:t=0,activeNode:n,setActiveNode:r}=this.props;let i=0;const a=new Map,s=e=>{const l=e instanceof pt.c||e instanceof pt.a?s(e.getChild()):null,u=e instanceof pt.a?s(e.getChild2()):null;let c="";if(e.hasMetaData("fromVariable")){const n=e.getMetaData("fromVariable");!1===a.has(n)&&a.set(n,i++);const r=a.get(n)%t;c=o.createElement("span",null," ",o.createElement("span",{className:`label label-info label-info-${r}`},n," =")," ")}return o.createElement("li",null,o.createElement("div",{className:nt({node:!0,active:e===n}),onClick:()=>r&&r(e)},o.createElement(mt.a,{title:o.createElement("div",null,c,o.createElement("div",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!0,!1)}})),body:()=>{e.check(),e.getResult();const t=e.getSchema(),n=e.getResultNumRows();return o.createElement("div",null,"columns:",o.createElement("ul",null,t.getColumns().map((e,n)=>o.createElement("li",{key:n},e.toString()," ",o.createElement("small",{className:"muted text-muted"},t.getType(n))))),e.hasMetaData("naturalJoinConditions")?o.createElement("div",null,"natural join conditions:",o.createElement("ul",null,e.getMetaData("naturalJoinConditions").map(e=>o.createElement("li",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml()}})))):null,o.createElement("p",null,`${n} row${1===n?"":"s"}`),!0===e.getMetaData("isInlineRelation")&&e.hasMetaData("inlineRelationDefinition")?o.createElement("pre",null,e.getMetaData("inlineRelationDefinition")):null)},placement:"right",trigger:"hover"},o.createElement("a",{className:"formula"},c,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!1,!1)}}),o.createElement("br",null),o.createElement("span",{className:"resultCountLabel"},`${e.getResultNumRows()} row${1===e.getResultNumRows()?"":"s"}`)))),l||u?o.createElement("ul",null,l,u):null)};return o.createElement("div",{className:"ra-tree"},o.createElement("div",{className:"tree"},o.createElement("ul",null,s(e))))}}var yt=n("./node_modules/memoize-one/dist/memoize-one.esm.js");n("./src/calc2/components/result.scss");class bt extends o.Component{constructor(e){super(e),this.result=Object(yt.a)(e=>{try{return e.check(),e.getResult()}catch(e){return console.error(e),null}}),this.state={activeNode:e.root,result:null},this.setActiveNode=this.setActiveNode.bind(this)}setActiveNode(e){this.setState({activeNode:e})}render(){const{root:e,numTreeLabelColors:t}=this.props,{activeNode:n}=this.state,r=this.result(n);return o.createElement("div",{className:"ra-result clearfix"},o.createElement("div",null,o.createElement(gt,{root:e,activeNode:n,numTreeLabelColors:t,setActiveNode:this.setActiveNode})),o.createElement("div",{className:"result"},o.createElement("div",null,o.createElement("h4",{className:"result-formula",dangerouslySetInnerHTML:{__html:n.getFormulaHtml(!0,!1)}}),o.createElement("div",{className:"result-table"},r?o.createElement(ft,{className:"table table-condensed",maxLinesPerPage:10,table:r,showPagination:!0}):null))))}}var vt=n("./src/db/relalg.ts");const _t=["pi","sigma","rho","tau","<-","intersect","union","/","-","\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","full outer join","left semi join","right semi join","anti join","and","or","xor","||"];class wt extends o.Component{constructor(e){super(e),this.editorBase=null,this.state={autoreplaceOperatorsMode:"none"},this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,{autoreplaceOperatorsMode:t}=this.state,n={};return e.tables.forEach(e=>{n[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",execFunction:(e,t,i)=>{const a=Object(vt.b)(t,Object.keys(n));if(Object(vt.j)(a,n),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.h)(a,n);return s.check(),e.historyAddEntry(t),e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(a),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"relalg",linterFunction:(e,o,i)=>{const a=[],s=Object(vt.b)(i,Object.keys(n));Object(vt.j)(s,n);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const l=Object(vt.h)(s,n);if(l.check(),!1===o.getDoc().somethingSelected()){const e=o.getDoc().getCursor(),{query:n,cursor:r}=Object(vt.f)(i,s.operatorPositions,{line:e.line+1,column:e.ch+1},t);n!==i&&(o.setValue(n),o.getDoc().setCursor({line:r.line-1,ch:r.column-1}))}return e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(s),a.concat(Object(tt.b)(l))},getHintsFunction:()=>[..._t,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!0,items:[{label:"π",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.projection",tooltip:"calc.editors.ra.toolbar.projection-content"},{label:"σ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.selection",tooltip:"calc.editors.ra.toolbar.selection-content"},{label:"ρ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename",tooltip:"calc.editors.ra.toolbar.rename-content"},{label:"←",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename-columns-operator",tooltip:"calc.editors.ra.toolbar.rename-columns-operator-content"},{label:"τ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.orderBy",tooltip:"calc.editors.ra.toolbar.orderBy-content"},{label:"γ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.groupBy",tooltip:"calc.editors.ra.toolbar.groupBy-content"}]},{math:!0,items:[{label:"∧",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.and",tooltip:"calc.editors.ra.toolbar.and-content"},{label:"∨",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.or",tooltip:"calc.editors.ra.toolbar.or-content"},{label:"¬",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not",tooltip:"calc.editors.ra.toolbar.not-content"},{label:"=",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.equals",tooltip:"calc.editors.ra.toolbar.equals-content"},{label:"≠",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not-equals",tooltip:"calc.editors.ra.toolbar.not-equals-content"},{label:"≥",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.greater-or-equals",tooltip:"calc.editors.ra.toolbar.greater-or-equals-content"},{label:"≤",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.lesser-or-equals",tooltip:"calc.editors.ra.toolbar.lesser-or-equals-content"}]},{math:!0,items:[{label:"∩",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.intersect",tooltip:"calc.editors.ra.toolbar.intersect-content"},{label:"∪",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.union",tooltip:"calc.editors.ra.toolbar.union-content"},{label:"÷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.division",tooltip:"calc.editors.ra.toolbar.division-content"},{label:"-",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.subtraction",tooltip:"calc.editors.ra.toolbar.subtraction-content"}]},{math:!0,items:[{label:"⨯",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.cross-join",tooltip:"calc.editors.ra.toolbar.cross-join-content"},{label:"⨝",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.natural-join",tooltip:"calc.editors.ra.toolbar.natural-join-content"},{label:"⟕",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-outer-join",tooltip:"calc.editors.ra.toolbar.left-outer-join-content"},{label:"⟖",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-outer-join",tooltip:"calc.editors.ra.toolbar.right-outer-join-content"},{label:"⟗",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.full-outer-join",tooltip:"calc.editors.ra.toolbar.full-outer-join-content"},{label:"⋉",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-semi-join",tooltip:"calc.editors.ra.toolbar.left-semi-join-content"},{label:"⋊",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-semi-join",tooltip:"calc.editors.ra.toolbar.right-semi-join-content"},{label:"▷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.anti-join",tooltip:"calc.editors.ra.toolbar.anti-join-content"}]},{math:!0,items:[{label:"=",onClick:e=>this.replaceText(e,"= "),tooltipTitle:"calc.editors.ra.toolbar.assignment",tooltip:"calc.editors.ra.toolbar.assignment-content"},{label:"--",onClick:e=>this.replaceText(e,"-- "),tooltipTitle:"calc.editors.ra.toolbar.single-line-comment",tooltip:"calc.editors.ra.toolbar.single-line-comment-content"},{label:"/*",onClick:e=>this.replaceText(e,"/* */"),tooltipTitle:"calc.editors.ra.toolbar.multi-line-comment",tooltip:"calc.editors.ra.toolbar.multi-line-comment-content"},{label:"{}",onClick:e=>this.replaceText(e,"{a:string, b:number, X.c:date\n\ta, 1, 1970-01-01\n}"),tooltipTitle:"calc.editors.ra.toolbar.inline-relation",tooltip:"calc.editors.ra.toolbar.inline-relation-content"}]},{items:[{label:o.createElement(et.a,{icon:Ze.q}),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.ra.toolbar.inline-relation-editor",tooltip:"calc.editors.ra.toolbar.inline-relation-editor-content"},{label:o.createElement(et.a,{icon:Ze.d}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.ra.toolbar.insert-date",tooltip:"calc.editors.ra.toolbar.insert-date-content"},{className:"showOnSM",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.m}),onClick:()=>{this.props.relInsertModalToggle()},tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{items:[{className:"dropdownToolbarButton",type:"dropdown",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.l}),tooltipTitle:"calc.editors.ra.toolbar.autoreplace-operators.title",tooltip:"calc.editors.ra.toolbar.autoreplace-operators.header",elements:[{type:"header",label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.header"})},{type:"separator"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.none"}),value:"none"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.plain2math"}),value:"plain2math"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.math2plain"}),value:"math2plain"}],value:t,onChange:e=>{this.setState({autoreplaceOperatorsMode:e},()=>{this.editorBase&&this.editorBase.forceLinterRun()})}}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}var Et=n("./src/calc2/utils/groupUtils.ts"),jt=n("./node_modules/reactstrap/lib/Button.js"),Ct=n.n(jt);class St extends o.Component{constructor(e){super(e),this.editorBase=null,this.autoParsingTimeout=null,this.replaceSelection=this.replaceSelection.bind(this)}static generateInfo(e){return{groupInfo:{source:"local",id:"draft",filename:"draft",index:0,maintainer:"",maintainerGroup:""},sourceInfo:{}}}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",disableHistory:!0,execButtonLabel:"calc.editors.group.button-exec",execFunction:(e,t,n)=>{const i=Object(vt.c)(t),{groupInfo:a,sourceInfo:s}=St.generateInfo(i),l=Object(Et.a)(i,a,s),u=o.createElement(o.Fragment,null,l.map((e,t)=>o.createElement("div",{key:t},o.createElement("h4",null,e.groupName.fallback," ",o.createElement(Ct.a,{color:"link",onClick:()=>{this.props.setDraft(e)}},o.createElement(r.b,{id:"calc.editors.group.button-use"}))),o.createElement("ul",{className:"table-list"},e.tables.map((e,n)=>{const r=l[t].tables[n].relation.getResult().getHtml();return o.createElement("li",{key:n},o.createElement("h5",null,e.tableName),o.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))})))));return i.groups.forEach(t=>{e.addInlineRelationMarkers(t)}),{result:u}},tab:"group",linterFunction:(e,t,n)=>{const r=Object(vt.c)(n);r.groups.forEach(t=>{e.addInlineRelationMarkers(t)});const{groupInfo:o,sourceInfo:i}=St.generateInfo(r);return Object(Et.a)(r,o,i),[]},getHintsFunction:()=>[..._t,"group","group@de","group@en","group@es","description","description@de","description@en","description@es","category","category@de","category@en","category@es",...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:o.createElement("span",null,o.createElement(et.a,{icon:Ze.q})," ",o.createElement(r.b,{id:"calc.editors.group.toolbar.add-new-relation"})),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.group.toolbar.add-new-relation",tooltip:"calc.editors.group.toolbar.add-new-relation-content"}]}]})}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}const Ot=["distinct","select distinct","from","where","order by","asc","desc","inner join","inner","join","natural","union","intersect","outer join","natural join","left join","right join","left outer join","right outer join","full outer join","group by","having","limit","offset","and","or","xor","||"];class kt extends o.Component{constructor(e){super(e),this.editorBase=null,this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"text/x-mysql",execFunction:(e,n,i)=>{const a=Object(vt.e)(n);if(Object(vt.j)(a,t),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),e.historyAddEntry(n),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"sql",linterFunction:(e,n,o)=>{const i=[],a=Object(vt.e)(o);Object(vt.j)(a,t);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),i.concat(Object(tt.b)(s))},getHintsFunction:()=>[...Ot,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:"select",tooltipTitle:"calc.editors.sql.toolbar.select",tooltip:"calc.editors.sql.toolbar.select",onClick:e=>this.replaceText(e,"select distinct")},{label:"from",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.from",tooltip:"calc.editors.sql.toolbar.from"},{label:"where",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.where",tooltip:"calc.editors.sql.toolbar.where"},{label:"group",tooltipTitle:"calc.editors.sql.toolbar.group-by",tooltip:"calc.editors.sql.toolbar.group-by",onClick:e=>this.replaceText(e,"group by")},{label:"having",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.having",tooltip:"calc.editors.sql.toolbar.having"},{label:"order",tooltipTitle:"calc.editors.sql.toolbar.order-by",tooltip:"calc.editors.sql.toolbar.order-by",onClick:e=>this.replaceText(e,"order by")},{label:"limit",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.limit",tooltip:"calc.editors.sql.toolbar.limit"},{label:o.createElement(et.a,{className:"showOnSM",icon:Ze.i}),onClick:e=>this.props.relInsertModalToggle,tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{math:!0,items:[{label:o.createElement("i",{className:"fa fa-calendar"}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.sql.toolbar.insert-date",tooltip:"calc.editors.sql.toolbar.insert-date-content"}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}function Tt(e,t){return e[t]?e[t]:e.fallback}var Mt=n("./node_modules/react-toastify/esm/react-toastify.js"),xt=(n("./node_modules/react-toastify/dist/ReactToastify.css"),{tabs:s.a.bool,pills:s.a.bool,vertical:s.a.oneOfType([s.a.bool,s.a.string]),horizontal:s.a.string,justified:s.a.bool,fill:s.a.bool,navbar:s.a.bool,card:s.a.bool,tag:ot.o,className:s.a.string,cssModule:s.a.object}),Lt=function(e){var t=e.className,n=e.cssModule,r=e.tabs,o=e.pills,a=e.vertical,s=e.horizontal,l=e.justified,u=e.fill,c=e.navbar,d=e.card,h=e.tag,f=Object(p.a)(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),g=Object(ot.k)(rt()(t,c?"navbar-nav":"nav",!!s&&"justify-content-"+s,function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")}(a),{"nav-tabs":r,"card-header-tabs":d&&r,"nav-pills":o,"card-header-pills":d&&o,"nav-justified":l,"nav-fill":u}),n);return i.a.createElement(h,Object(m.a)({},f,{className:g}))};Lt.propTypes=xt,Lt.defaultProps={tag:"ul",vertical:!1};var Rt=Lt,At=n("./node_modules/@babel/runtime/helpers/esm/objectSpread.js"),Dt=n("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),Nt=n("./node_modules/react-popper/lib/esm/Manager.js"),Pt=i.a.createContext({}),It={a11y:s.a.bool,disabled:s.a.bool,direction:s.a.oneOf(["up","down","left","right"]),group:s.a.bool,isOpen:s.a.bool,nav:s.a.bool,active:s.a.bool,addonType:s.a.oneOfType([s.a.bool,s.a.oneOf(["prepend","append"])]),size:s.a.string,tag:ot.o,toggle:s.a.func,children:s.a.node,className:s.a.string,cssModule:s.a.object,inNavbar:s.a.bool,setActiveFromChild:s.a.bool},Ht=[ot.j.space,ot.j.enter,ot.j.up,ot.j.down,ot.j.end,ot.j.home],Yt=function(e){function t(t){var n;return(n=e.call(this,t)||this).addEvents=n.addEvents.bind(Object(Dt.a)(n)),n.handleDocumentClick=n.handleDocumentClick.bind(Object(Dt.a)(n)),n.handleKeyDown=n.handleKeyDown.bind(Object(Dt.a)(n)),n.removeEvents=n.removeEvents.bind(Object(Dt.a)(n)),n.toggle=n.toggle.bind(Object(Dt.a)(n)),n.containerRef=i.a.createRef(),n}Object(G.a)(t,e);var n=t.prototype;return n.getContextValue=function(){return{toggle:this.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar,disabled:this.props.disabled}},n.componentDidMount=function(){this.handleProps()},n.componentDidUpdate=function(e){this.props.isOpen!==e.isOpen&&this.handleProps()},n.componentWillUnmount=function(){this.removeEvents()},n.getContainer=function(){return this.containerRef.current},n.getMenuCtrl=function(){return this._$menuCtrl||(this._$menuCtrl=this.getContainer().querySelector("[aria-expanded]")),this._$menuCtrl},n.getMenuItems=function(){return[].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'))},n.addEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.addEventListener(t,e.handleDocumentClick,!0)}))},n.removeEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)}))},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===ot.j.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==ot.j.tab)&&this.toggle(e)}},n.handleKeyDown=function(e){var t=this;if(!/input|textarea/i.test(e.target.tagName)&&(ot.j.tab!==e.which||"menuitem"===e.target.getAttribute("role")&&this.props.a11y)&&((-1!==Ht.indexOf(e.which)||e.which>=48&&e.which<=90)&&e.preventDefault(),!this.props.disabled&&(this.getMenuCtrl()===e.target&&(!this.props.isOpen&&[ot.j.space,ot.j.enter,ot.j.up,ot.j.down].indexOf(e.which)>-1?(this.toggle(e),setTimeout((function(){return t.getMenuItems()[0].focus()}))):this.props.isOpen&&e.which===ot.j.esc&&this.toggle(e)),this.props.isOpen&&"menuitem"===e.target.getAttribute("role"))))if([ot.j.tab,ot.j.esc].indexOf(e.which)>-1)this.toggle(e),this.getMenuCtrl().focus();else if([ot.j.space,ot.j.enter].indexOf(e.which)>-1)e.target.click(),this.getMenuCtrl().focus();else if([ot.j.down,ot.j.up].indexOf(e.which)>-1||[ot.j.n,ot.j.p].indexOf(e.which)>-1&&e.ctrlKey){var n=this.getMenuItems(),r=n.indexOf(e.target);ot.j.up===e.which||ot.j.p===e.which&&e.ctrlKey?r=0!==r?r-1:n.length-1:(ot.j.down===e.which||ot.j.n===e.which&&e.ctrlKey)&&(r=r===n.length-1?0:r+1),n[r].focus()}else if(ot.j.end===e.which){var o=this.getMenuItems();o[o.length-1].focus()}else if(ot.j.home===e.which){this.getMenuItems()[0].focus()}else if(e.which>=48&&e.which<=90)for(var i=this.getMenuItems(),a=String.fromCharCode(e.which).toLowerCase(),s=0;s-1?"menuitem":void 0,n=Object(ot.l)(this.props,["toggle"]),r=n.className,o=n.cssModule,a=n.divider,s=n.tag,l=n.header,u=n.active,c=Object(p.a)(n,["className","cssModule","divider","tag","header","active"]),d=Object(ot.k)(rt()(r,{disabled:c.disabled,"dropdown-item":!a&&!l,active:u,"dropdown-header":l,"dropdown-divider":a}),o);return"button"===s&&(l?s="h6":a?s="div":c.href&&(s="a")),i.a.createElement(s,Object(m.a)({type:"button"===s&&(c.onClick||this.props.toggle)?"button":void 0},c,{tabIndex:e,role:t,className:d,onClick:this.onClick}))},t}(i.a.Component);tn.propTypes=en,tn.defaultProps={tag:"button",toggle:!0},tn.contextType=Pt;var nn=tn,rn={tag:ot.o,active:s.a.bool,className:s.a.string,cssModule:s.a.object},on=function(e){var t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=Object(p.a)(e,["className","cssModule","active","tag"]),s=Object(ot.k)(rt()(t,"nav-item",!!r&&"active"),n);return i.a.createElement(o,Object(m.a)({},a,{className:s}))};on.propTypes=rn,on.defaultProps={tag:"li"};var an=on,sn={tag:ot.o,innerRef:s.a.oneOfType([s.a.object,s.a.func,s.a.string]),disabled:s.a.bool,active:s.a.bool,className:s.a.string,cssModule:s.a.object,onClick:s.a.func,href:s.a.any},ln=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(Dt.a)(n)),n}Object(G.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():("#"===this.props.href&&e.preventDefault(),this.props.onClick&&this.props.onClick(e))},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=e.innerRef,s=Object(p.a)(e,["className","cssModule","active","tag","innerRef"]),l=Object(ot.k)(rt()(t,"nav-link",{disabled:s.disabled,active:r}),n);return i.a.createElement(o,Object(m.a)({},s,{ref:a,onClick:this.onClick,className:l}))},t}(i.a.Component);ln.propTypes=sn,ln.defaultProps={tag:"a"};var un=ln,cn=n("./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js"),dn=i.a.createContext({}),hn={tag:ot.o,activeTab:s.a.any,className:s.a.string,cssModule:s.a.object},fn=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={activeTab:n.props.activeTab},n}return Object(G.a)(t,e),t.getDerivedStateFromProps=function(e,t){return t.activeTab!==e.activeTab?{activeTab:e.activeTab}:null},t.prototype.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.tag,o=Object(ot.l)(this.props,Object.keys(hn)),a=Object(ot.k)(rt()("tab-content",t),n);return i.a.createElement(dn.Provider,{value:{activeTabId:this.state.activeTab}},i.a.createElement(r,Object(m.a)({},o,{className:a})))},t}(o.Component);Object(cn.polyfill)(fn);var mn=fn;fn.propTypes=hn,fn.defaultProps={tag:"div"};var pn={tag:ot.o,className:s.a.string,cssModule:s.a.object,tabId:s.a.any};function gn(e){var t=e.className,n=e.cssModule,r=e.tabId,o=e.tag,a=Object(p.a)(e,["className","cssModule","tabId","tag"]),s=function(e){return Object(ot.k)(rt()("tab-pane",t,{active:r===e}),n)};return i.a.createElement(dn.Consumer,null,(function(e){var t=e.activeTabId;return i.a.createElement(o,Object(m.a)({},a,{className:s(t)}))}))}gn.propTypes=pn,gn.defaultProps={tag:"div"};var yn=n("./node_modules/reactstrap/es/Modal.js"),bn=n("./node_modules/reactstrap/es/ModalHeader.js"),vn=n("./node_modules/reactstrap/es/ModalBody.js"),_n=n("./node_modules/reactstrap/es/ModalFooter.js");n("./src/calc2/components/groupRelationList.scss");const wn=({tables:e,replace:t,onElementClick:n})=>o.createElement("div",{className:"groupRelationList"},o.createElement("ul",null,e.map(e=>{const{columnNames:r,columnTypes:i,tableName:a}=e;return o.createElement("li",{key:a},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(a),n&&n()}},a),o.createElement("ul",null,e.columnNames.map((e,r)=>o.createElement("li",{key:e},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(e),n&&n()}},e," ",o.createElement("small",{className:"muted text-muted"},i[r]))," "))))})));var En=n("./node_modules/immutable/dist/immutable.es.js");class jn extends o.Component{constructor(e){super(e),this.getGroupsByHeadlineName=Object(yt.a)((e,t)=>{let n=En.b();const o=e=>Tt(e,t);for(const t of e.values()){let e=null;!0===t.isDraft?e=r.c.t("calc.maintainer-groups.temp"):t.category&&(e=o({lang:"",fallback:t.groupInfo.maintainerGroup}));const i=[...n.get(e)||[],t];i.sort((e,t)=>o(e.groupName).localeCompare(o(t.groupName))),n=n.set(e,i)}return n}),this.gistLink=""}render(){const{current:e,locale:t}=this.props,n=this.getGroupsByHeadlineName(this.props.groups,t);return o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-6"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.headline"})),o.createElement("ul",{id:"groups-selector-list"},n.map((n,i)=>o.createElement("li",{key:`${i}`},i||o.createElement(r.b,{id:"calc.maintainer-groups.misc"}),o.createElement("ul",null,n.map((n,r)=>{const{groupName:i,groupInfo:a}=n,s=`/relax/calc/${a.source}/${a.id}/${a.filename}/${a.index}`;return o.createElement("li",{key:s,className:nt({active:e&&e.group.groupInfo===n.groupInfo})},o.createElement(Qe,{to:s,onClick:()=>{this.props.datasetLoaded()}},Tt(i,t)))})))).valueSeq().toArray())),o.createElement("div",{className:"col-md-6 align-text-top align-top"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.load-gist-headline"})),o.createElement("input",{type:"text",className:"form-control gist-load-input",placeholder:"","data-i18n":"[placeholder]calc.menu.load-gist-insert-placeholder",size:32,onChange:e=>{this.gistLink="/relax/calc/gist/"+e.target.value}}),o.createElement("button",{onClick:()=>{document.location.href=this.gistLink,this.props.datasetLoaded()},type:"button",className:"fullWidthBtn btn btn-secondary gist-load-btn"},o.createElement(r.b,{id:"calc.menu.load-gist-button"})),o.createElement("hr",null),o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-headline"})),o.createElement("p",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-text"})," ",o.createElement(Xe,{to:"/help#tutorial-maintainer"},o.createElement(r.b,{id:"calc.menu.create-own-dataset-text-link"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-new-btn",onClick:()=>{this.props.loadGroupTab(!1)}},o.createElement("i",{className:"fa fa-plus-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-new"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-current-btn",onClick:()=>{this.props.loadGroupTab(!0)}},o.createElement("i",{className:"fa fa-pencil-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-modify"}))))))}}const Cn=z(e=>({groups:e.groups.groups,current:e.groups.current,locale:e.session.locale}))(jn);var Sn={light:s.a.bool,dark:s.a.bool,full:s.a.bool,fixed:s.a.string,sticky:s.a.string,color:s.a.string,role:s.a.string,tag:ot.o,className:s.a.string,cssModule:s.a.object,expand:s.a.oneOfType([s.a.bool,s.a.string])},On=function(e){var t,n=e.expand,r=e.className,o=e.cssModule,a=e.light,s=e.dark,l=e.fixed,u=e.sticky,c=e.color,d=e.tag,h=Object(p.a)(e,["expand","className","cssModule","light","dark","fixed","sticky","color","tag"]),f=Object(ot.k)(rt()(r,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)}(n),((t={"navbar-light":a,"navbar-dark":s})["bg-"+c]=c,t["fixed-"+l]=l,t["sticky-"+u]=u,t)),o);return i.a.createElement(d,Object(m.a)({},h,{className:f}))};On.propTypes=Sn,On.defaultProps={tag:"nav",expand:!1};var kn=On,Tn={tag:ot.o,className:s.a.string,cssModule:s.a.object},Mn=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(p.a)(e,["className","cssModule","tag"]),a=Object(ot.k)(rt()(t,"navbar-brand"),n);return i.a.createElement(r,Object(m.a)({},o,{className:a}))};Mn.propTypes=Tn,Mn.defaultProps={tag:"a"};var xn=Mn,Ln=n("./node_modules/reactstrap/lib/NavLink.js"),Rn=n.n(Ln);class An extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"desktopNavbar"},o.createElement(xn,{href:"/"},"RelaX"),o.createElement(Rt,{className:"ml-auto",navbar:!0},o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," Calculator")),o.createElement(Bt,{nav:!0,inNavbar:!0,className:"navItemSpace"},o.createElement(Gt,{nav:!0,caret:!0},o.createElement(et.a,{icon:Ze.j})," ",o.createElement(r.b,{id:"calc.navigation.language"})),o.createElement(Zt,{right:!0},o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"),o.createElement(nn,{onClick:()=>this.changeLocale("pt")},"pt"))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.feedback"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.help"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Rn.a,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})))))}}n("./src/calc2/components/calculator.scss");class Dn extends o.Component{constructor(e){super(e),this.refEditorRelalg=o.createRef(),this.refEditorSql=o.createRef(),this.refEditorGroup=o.createRef(),Mt.b.configure(),this.state={activeTab:"relalg",datasetModal:!1,relationModal:!1},this.getCurrentEditor=this.getCurrentEditor.bind(this),this.toggleDatasetModal=this.toggleDatasetModal.bind(this),this.insertRelationToggle=this.insertRelationToggle.bind(this),this.loadGroupEditor=this.loadGroupEditor.bind(this)}toggleDatasetModal(){this.setState({datasetModal:!this.state.datasetModal})}insertRelationToggle(){this.setState({relationModal:!this.state.relationModal})}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}getCurrentEditor(){switch(this.state.activeTab){case"sql":return this.refEditorSql;case"relalg":return this.refEditorRelalg;case"group":return this.refEditorGroup}}loadGroupEditor(e){let t="-- this is an example\ngroup: nameOfTheNewGroup \n\nA = {\na:string, b:number\nexample, 42\n}";!0===e&&(t=this.props.group.definition),this.setState({activeTab:"group"},()=>{const e=this.getCurrentEditor().current;e&&e.editorBase.state.editor.setValue(t),this.toggleDatasetModal()})}render(){const{group:e,locale:t}=this.props,{activeTab:n}=this.state;return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement("div",{className:"calculator"},o.createElement(Mt.a,{enableMultiContainer:!0,position:Mt.b.POSITION.TOP_RIGHT}),o.createElement("div",{className:"row"},o.createElement("div",{className:"d-none d-xs-block d-sm-block d-md-block col-lg-1 col-xl-2"}),o.createElement("div",{className:"groups-container col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"},o.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"dropdownMenu1",onClick:this.toggleDatasetModal,style:{width:"100%",textAlign:"left",textOverflow:"ellipsis",overflow:"hidden"}},o.createElement("span",null,"Select DB (",Tt(e.groupName,t),")"),o.createElement("span",{className:"caret",style:{display:"block",position:"absolute",top:"50%",right:"10px"}})),o.createElement("div",null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:null}))),o.createElement("div",{className:"calculator-container col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-6"},o.createElement(Rt,{tabs:!0},o.createElement(Bt,{nav:!0,inNavbar:!0,className:"showOnSM"},o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{onClick:this.toggleDatasetModal},o.createElement(et.a,{icon:Ze.g})," ",o.createElement(r.b,{id:"calc.menu.datasets"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(an,null,o.createElement(un,{className:nt({active:"relalg"===n}),onClick:()=>{this.setState({activeTab:"relalg"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"sql"===n}),onClick:()=>{this.setState({activeTab:"sql"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"group"===n}),onClick:()=>{this.setState({activeTab:"group"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name-short"}))))),o.createElement(mn,{activeTab:this.state.activeTab,className:"tab-content-border"},o.createElement(gn,{tabId:"relalg"},o.createElement(wt,{group:e,ref:this.refEditorRelalg,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"sql"},o.createElement(kt,{group:e,ref:this.refEditorSql,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"group"},o.createElement(St,{group:e,ref:this.refEditorGroup,setDraft:this.props.setDraft}))))),o.createElement(yn.a,{isOpen:this.state.datasetModal,toggle:this.toggleDatasetModal},o.createElement(bn.a,{toggle:this.toggleDatasetModal},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement("div",null,o.createElement(Cn,{datasetLoaded:()=>{this.setState({datasetModal:!1})},loadGroupTab:e=>{this.loadGroupEditor(e)}}))),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.toggleDatasetModal},Object(r.d)("calc.result.modal.close")))),o.createElement(yn.a,{isOpen:this.state.relationModal,toggle:this.insertRelationToggle},o.createElement(bn.a,{toggle:this.insertRelationToggle},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:this.insertRelationToggle})),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.insertRelationToggle},Object(r.d)("calc.result.modal.close"))))))}}class Nn extends o.Component{constructor(e){super(e),this.init=!1}componentDidUpdate(e){const{params:t}=this.props.match,{params:n}=e.match;!1!==this.init&&t.source===n.source&&t.id===n.id&&t.filename===n.filename&&t.index===n.index||(this.init=!0,this.loadGroup(this.props))}loadGroup(e){const{source:t,id:n,filename:r,index:o}=e.match.params;this.props.loadGroup(t,n,r,Number.parseInt(o,10),"","")}componentWillReceiveProps(e){const{params:t}=this.props.match,{params:n}=e.match;n.source!==t.source||n.id!==t.id||n.filename!==t.filename||(n.index,t.index)}render(){const{locale:e}=this.props,{current:t}=this.props.groups;return null!==t?o.createElement(Dn,{group:t.group,locale:e,setDraft:this.props.setDraft}):o.createElement("div",null,"loading ...")}}const Pn=z(e=>({groups:e.groups,locale:e.session.locale}),e=>({loadGroup:(t,n,r,o,i,a)=>{e({type:"GROUPS_LOAD_REQUEST",source:t,id:n,maintainer:i,maintainerGroup:a,setCurrent:{filename:r,index:o}})},setDraft:t=>{e({type:"GROUP_SET_DRAFT",draft:t})}}))(Nn);var In=n("./node_modules/jquery/dist/jquery.js"),Hn=n("./node_modules/railroad-diagrams/railroad-diagrams.js");n("./node_modules/railroad-diagrams/railroad-diagrams.css");class Yn extends o.Component{componentDidMount(){const e=q.findDOMNode(this);if(!e)throw new Error("could not find node");this.props.diagram.addTo(e)}shouldComponentUpdate(e){return this.props.diagram!==e.diagram}render(){return o.createElement("div",null)}}n("./src/calc2/views/help.css");class Fn extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"mobileNavbar"},o.createElement(Bt,null,o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(xn,{href:"/"},"RelaX"))}}class Wn extends o.Component{componentDidMount(){const e=In("#toc");let t=0,n=null,r=null,o=null;In("h2, h3, h4, h5, h6").each((function(){const i=In(this),a=i.attr("name")||i.attr("id")||"tocId"+t++;i.attr("name",a),i.attr("id",a);const s=''+i.text()+"";if(i.is("h2"))e.append(In(`
        ${s}
          `)),n=e.find("ul:last");else if(i.is("h3")){if(!n)throw new Error("malformed headings");n.append(In(`
        • ${s}
          • `)),r=n.find("ul:last")}else if(i.is("h4")){if(!r)throw new Error("malformed headings");r.append(In(`
          • ${s}
            • `)),o=r.find("ul:last")}else{if(!o)throw new Error("malformed headings");o.append(`
            • ${s}
            • `)}})),In("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((function(){In(this).append(` `)}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("h1",{id:"help"},"RelaX - Help"),o.createElement("div",{id:"toc"}),o.createElement("h2",{id:"tutorial-user"},"Tutorial - user"),o.createElement("h3",{id:"tutorial-user-coreconcepts"},"The core concepts"),o.createElement("p",null,"The goal of this tutorial is to give a quick introduction how to use the relational algebra calculator and its concepts. It assumes that you already know the relational algebra or are learning it from other sources."),o.createElement("p",null,"There is no real standard for the relational algebra like there is for SQL. So every book or teacher might have its slightly different interpretation and notation.",o.createElement("br",null),'The goal of this progam was to support the most commonly used "mathematical" notation used by ',o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),", ",o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/",lang:"de"},"Datenbanksysteme: Eine Einführung by Alfons Kemper and André Eickler")," and ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Relational_algebra"},"Wikipedia - Relational Algebra")," and others."),o.createElement("h4",{id:"tutorial-user-relations"},"relations"),o.createElement("p",null,"The core element of the calculator is the relation (or table) which consists of a fixed number of attributes (or columns) in a fixed order (this is called the schema of the relation) and a set of tuples or rows containing the specific values."),o.createElement("p",null,"Each attribute has three distinct properties: its type, its position and its name."),o.createElement("p",null,"The type or domain of an attribute is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean"),".",o.createElement("br",null),"The type is used for example to determine if two values can be compared in a boolean expression or if two schemas are union compatible. In most cases the type of the attributes are obvious if you look at the values."),o.createElement("p",null,"The position of each attribute in a schema is fixed and can be used to adress the attributes.",o.createElement("br",null),"An example would be the projection of the first and third attribute or column of an arbitrary relation R: ",o.createElement("code",{className:"example block"},"π [1], [3] ( R )")),o.createElement("p",null,"The full qualified name of the attribute is a unique identifier of the attribute within the schema of its relation. It consists of the name itself and a relation qualifier and are written like in SQL as ",o.createElement("code",null,"R.a"),"where a is the name and R is the relation qualifier.",o.createElement("br",null),"An example would be the projectoin of the attributes a, b from a relation R: ",o.createElement("code",{className:"example block"},"π R.a, R.b ( R )"),o.createElement("br",null),"The default relation qualifier of each attribute is the name of its relation.",o.createElement("br",null),"If the attributes name without the qualifier is unique within the relation's schema, it also can be used to address a specific attribute.",o.createElement("br",null),"The previous example could also be written as ",o.createElement("code",null,"π a, b ( R )"),"."),o.createElement("p",null,"Each relation has a set of tuples (or rows). This means that there are no duplicate tuples within one relation and the duplicate-elimination is implicitly executed after every single step of the calculation.",o.createElement("br",null),"The tuples in the calculator have a defined order and unlike a normal database system all operations are implemented to preserve that order. This should help the users to see what has changed from one step to the next."),o.createElement("p",null,"so far we covered that"),o.createElement("ul",null,o.createElement("li",null,"relations are the core elements,"),o.createElement("li",null,"relations have a schema and a set of tuples,"),o.createElement("li",null,"each attribute in the schema has",o.createElement("ul",null,o.createElement("li",null,"data-type"),o.createElement("li",null,"a position"),o.createElement("li",null,"a fully qualified name (RELATION.attributename)"))),o.createElement("li",null,"and that each attribute can be addressed within an operation using",o.createElement("ul",null,o.createElement("li",null,"its position e.g. ",o.createElement("code",{className:""},"π [1], [2] ( R )"),","),o.createElement("li",null,"the attribute name e.g. ",o.createElement("code",{className:""},"π a, b ( R )")),o.createElement("li",null,"or its full quallified name if the unqualified is not unique e.g. ",o.createElement("code",{className:""},"π R.a, S.a ( R x S )"))))),o.createElement("h3",{id:"tutorial-user-plain-text-notation"},"Alternative plain text notation"),o.createElement("p",null,"Before we introduce how to use the operators this should be a quick introduction of a very handy feature of the relational algebra calculator: the alternative plain text notation"),o.createElement("p",null,'The "classNameic" mathematical notation uses greek letters like π, σ for the unary operations and special symbols like the join symbol ',o.createElement("span",{className:"math"},"⋈")," or the union symbol ",o.createElement("span",{className:"math"},"∪"),"for some binary operations.",o.createElement("br",null),"This symbols can be entered using the toolbar at the top of the editor."),o.createElement("p",null,'This calculator also supports a alternative syntax for all this symbols that follows two very simple rules: Every greek letter can be substituted with its name spelled out ("pi" for π, "gamma" for γ) and every other symbol has an equivalent name that is borrowed from SQL, programming languages like C and ',o.createElement("a",{href:"http://en.wikipedia.org/wiki/Set_theory"},"Set theory"),"."),o.createElement("p",null,"This substitutions should be easy to read and much more important very easy to write because you don't need any toolbar or mouse. The calculator also supports autocomplete: just press [CTRL]+[SPACE] to complete the current keyword.",o.createElement("br",null),"This feature should help you to write your statements more quickly and fluently."),o.createElement("code",{className:"example block"},"π R.a, S.a, S.b σ R.a = S.a ∧ ( R.a > 5 ∨ R.a ","<"," 0 ) ( R ⨯ S )"),"is equivalent to:",o.createElement("code",{className:"example block"},"pi R.a, S.a, S.b sigma R.a = S.a and ( R.a > 5 or R.a ","<"," 0 ) ( R cross join S )"),"In the following table you can see a list of all supported substitutions:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"classNameical notation"),o.createElement("th",null,"alternative notation"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{className:"math"},"π"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("td",{className:"math"},"σ"),o.createElement("td",null,"sigma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"ρ"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("td",{className:"math"},"τ"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("td",{className:"math"},"γ"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∩"),o.createElement("td",null,"intersect")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∪"),o.createElement("td",null,"union")),o.createElement("tr",null,o.createElement("td",{className:"math"},"-"),o.createElement("td",null,"\\")),o.createElement("tr",null,o.createElement("td",{className:"math"},"÷"),o.createElement("td",null,"/")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⨯"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"x"),o.createElement("li",null,"cross join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋈"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"join"),o.createElement("li",null,"inner join"),o.createElement("li",null,"natural join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟕"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"left join"),o.createElement("li",null,"left outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟖"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"right join"),o.createElement("li",null,"right outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟗"),o.createElement("td",null,"full outer join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋉"),o.createElement("td",null,"left semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋊"),o.createElement("td",null,"right semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"▷"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"anti semi join"),o.createElement("li",null,"anti join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"←"),o.createElement("td",null,"<","-",o.createElement("code",{className:"example block"},"pi new_name ","<","- a ( R )"))),o.createElement("tr",null,o.createElement("td",{className:"math"},"→"),o.createElement("td",null,"->",o.createElement("code",{className:"example block"},"pi a -> new_name ( R )")))))),o.createElement("ul",null,o.createElement("li",null,"schema preserving operations - operations where the resulting relation has the same schema as its first argument-relation:",o.createElement("ul",null,o.createElement("li",null,"selection"),o.createElement("li",null,"union"),o.createElement("li",null,"intersection"),o.createElement("li",null,"subtraction"),o.createElement("li",null,"orderby"),o.createElement("li",null,"left outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"anti join")))),o.createElement("h3",{id:"tutorial-user-relalg"},"Relational algebra"),o.createElement("p",null,"For this Part we use the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset')," with 3 relations: ",o.createElement("i",null,"Customers"),", ",o.createElement("i",null,"Accounts")," and ",o.createElement("i",null,"PremiumCustomers"),". By convention relations start with a uppercase letter and attributes with a lower case letter."),o.createElement("h4",null,"Open and inspect dataset"),o.createElement("p",null,"Open the dataset used in this tutorial using the following link to the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset'),"."),o.createElement("p",null,"You find the relations and their attributes listed on the side and if you hover a relations name a preview of the first view tuples is displayed."),o.createElement("h4",{id:"tutorial-user-basic-query"},"The most basic query"),o.createElement("p",null,"After you have found the Dataset you can formulate the very first and most basic query in relational algebra: a relation without any further manipulation."),o.createElement("p",null,"Just enter the name of a relation into the code editor or click on the relation/attribute names to insert them into the code editor.",o.createElement("br",null),"Note that the editor supports auto completing the relation/attribute names of the current dataset and the operators with [CTRL]+[SPACE]"),o.createElement("p",null,"So if you want all tuples of the relation ",o.createElement("i",null,"Customer")," you should have the following statement: ",o.createElement("code",null,"Customer"),". And get all the tuples if you press the execute button or press [CTRL]+[RETURN]."),o.createElement("h4",{id:"tutorial-user-unary-operations"},"Unary operations"),o.createElement("p",null,"All unary operations have the same basic syntax ",o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")")),"."),o.createElement("p",{className:"hint"},"The braces around the ",o.createElement("code",null,"CHILD_EXPRESSION")," can be omitted. In this case the predefined ",o.createElement("a",{href:"#relalg-operator-precedence"},"operator precedence for relational algebra")," applies."),o.createElement("p",null,"A complete list of the supported relalg operations can be found here: ",o.createElement("a",{href:"#relalg-syntax"},"general syntax"),", ",o.createElement("a",{href:"#relalg-unary-operations"},"unary operations")," and ",o.createElement("a",{href:"#relalg-binary-operations"},"binary operations"),"."),o.createElement("p",null,"The projection is one of the basic operations that allow to choose which of the attributes of the parent relations should be included in the new one and in which order they should be."),o.createElement("p",null,"Renaming a relation (ρ) changes the qualifiers of all the relations attributes but does not touch the tuples."),o.createElement("p",null,"Renaming an attribute (ρ) only changes the name of a specific attribute (and leaves his relation-qualifier unchanged)."),o.createElement("p",null,"The statement ",o.createElement("code",null,"pi balance ( Accounts )")," returns a new relation with only the balance attribute."),o.createElement("p",null,"The next statement gets the balance with the account-id after renaming the relation to ",o.createElement("i",null,"A")," and renames one of the attributes."),o.createElement("code",{className:"example block"},"rho account_number ","<","- aid ( pi aid, A.balance ( rho A ( Accounts ) ) )"),o.createElement("p",{className:"hint"},"Like in SQL or most programming languages you can format your statement and use SQL like comments (with ",o.createElement("code",null,"-- ...")," or ",o.createElement("code",null,"/* ... */"),") to increase the readability."),o.createElement("p",null,"The next statement uses a selection to filter the tuples of a relation based on a boolean expression. The calculator supports complex boolean expression with functions and built in operator precedence.",o.createElement("br",null),"The attributes in the boolean expression can be given as name or numeric position like with the projection."),o.createElement("p",null,"The next statement selects all customers-ids of customers who have the same value for their firstname and lastname."),o.createElement("code",{className:"example block"},"-- this should return an relation with no tuples: pi cid ( sigma firstname=lastname ( Customers ) )"),o.createElement("p",null,"The next example uses a more complex expression to get all accounts with a balance over 100 or under -100."),o.createElement("code",{className:"example block"},"sigma balance > 100 or (balance*-1 > 100) ( Accounts ) -- (balance ","<"," -100) would also be correct"),o.createElement("p",null,"As a shorter alternative you can use a ",o.createElement("a",{href:"#relalg-valueexpr"},"function in your expression")," to get the same result:"),o.createElement("code",{className:"example block"},"sigma abs(balance) > 100 ( Accounts )"),o.createElement("h2",{id:"tutorial-maintainer"},"Tutorial - maintainer"),o.createElement("p",null,"Everybody can provide datasets that can be used in the relational algebra calculator and share them with others.",o.createElement("br",null),"We assume the scenario of a teacher wanting to provide a dataset for his/her students for this short tutorial."),o.createElement("p",null,"The datasets are specified in a simple text format and can be shared with others via ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gists")," (a simple and free platform to share snippets).",o.createElement("br",null),"The shared gist gets an unique ID and the relational algebra calculator can load the dataset directly using this ID."),o.createElement("h3",{id:"tutorial-maintainer-create-dataset"},"Creating a dataset"),o.createElement("p",null,"The fist step is the creation of the dataset which is actually only a group of relation definitions with some additional information and is therefore refered as group in the specified format.",o.createElement("br",null),"The relations can then be used by the students to formulate the there statements.",o.createElement("br",null),"Lets assume we want to create a dataset of employees of a company."),"Every group definition starts with a simple header which (at least) contains the name of the group:",o.createElement("code",{className:"example block"},"group: bank example"),"every header field starts with the name of the field and is followed by a colon for single line values. The next (optional) header field we should specify is the description. It should contain information like who is maintaining this dataset or where to find additional information.",o.createElement("br",null),"In the description ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Markdown"},"Markdown")," can be used to format the text or set links to external resources.",o.createElement("p",null,"In our example we add a description that takes more than a single line and therefore we enclose the value in double brackets instead of using the colon."),o.createElement("code",{className:"example block"},"group: bank example description[[ the data for this dataset was generated using ","<","http://www.generatedata.com/> * the relation _Customers_ contains basic information about the customers of the bank. The relation _Accounts_ contains the basic information of a single account. Note that a customer can have any number of accounts. * the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over 1000 ]]"),o.createElement("p",null,"The next step is to actually add the relations the students can use for their queries.",o.createElement("br",null),"The relation definitions are use the relational algebra syntax that can be used in this tool.",o.createElement("br",null),"Every relation is defined by a single variable assignment where the name of the variable is used as the relations name and the result of the expression defines the relation.",o.createElement("br",null),"The relalg expression can use all features that can be used in the tool and can also use other relations defined within the same dataset.",o.createElement("br",null),"Note that the name of the relation is used as the qualifier of each attribute/column."),o.createElement("p",null,"For the relation ",o.createElement("code",null,"Customers")," relation we use the ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation")," syntax as the most basic method to define the relation and can also be edited using the relation editor ",o.createElement("i",{className:"fa fa-table",title:"relation editor"})," which is a simple spread-sheet like editor. ",o.createElement("br",null),"The inline relations in combination with the editor should be very easy to use if you enter the data directly or if you have them as a csv/spread-sheet file."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\t\t\t\t"),o.createElement("p",null,"As we can see the name of the relations are defined by the assignments.",o.createElement("br",null),"The inline-relations are enclosed by curly braces and contain the names of the attributes/columns in the first line and then a tuple/row per line where the values are simply separated by whitespace. You can also other seperators and can define the types explicitly as we can see at the Accounts relation. For further information can be found at ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation description"),"."),o.createElement("p",null,"Note that, unlike the variables used in a query, the definition of a new relation implicitly sets the attribute qualifier to the name of the relation. So the schema of the account relation is ",o.createElement("code",null,"(Accounts.aid, Accounts.cid, Accounts.balance)"),". This allows each attribute to be accessible with this name."),o.createElement("p",null,"The last relation we need to add in this example is the relation containing the banks premium Customers.",o.createElement("br",null),"They are specified by using the other two relations in a simple relational algebra statement that selects all customers with a total balance over 1000."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\n\t\t\t\tPremiumCustomers =\n\t\t\t\t\tpi cid (\n\t\t\t\t\t\tsigma sum > 1000 (\n\t\t\t\t\t\t\tgamma cid; sum(balance)->sum (\n\t\t\t\t\t\t\t\tAccounts\n\t\t\t\t\t\t\t\tjoin Customers\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t"),o.createElement("p",null,"We have now seen how to define a dataset with its header containing the name and the description followed by relational algebra assignments defining the relations of the dataset."),o.createElement("p",null,"We can paste this definition directly in the ",o.createElement("i",null,"Group Editor")," to load and use it.",o.createElement("br",null),"In the next section we want to look at how we can publish this definition so that we give our students a single url or id to directly load the dataset."),o.createElement("h3",{id:"tutorial-maintainer-share-dataset"},"Share a dataset"),o.createElement("p",null,"If we want to share the definition of a dataset with other people we could simply give them the definition and they load it using the ",o.createElement("i",null,"group editor"),", but that would not be that practical for most cases."),o.createElement("p",null,"The simpler solution (for the users) is to publish the definition as a ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gist")," and share the ID of the gist with others."),o.createElement("p",null,"Just create a gist with the definition as its content (the filename does not matter) and publish it. The ID of the Gist can now be found at the top of the page as ",o.createElement("i",null,"gist:xxxxxxxxxxxx")," or in the url after the last slash."),o.createElement("p",null,"This ID can then be shared and loaded in the interface or the calculator can be called directly with a specific ID by using using the parameter ",o.createElement("code",null,"?data=gist:xxxxxxxxxxxxxx"),"."),o.createElement("p",null,"For example the simple bank definition of this tutorial has been published as a ",o.createElement("a",{href:"https://gist.github.com/ragtime/2cfb981fbc5676182d64"},"Gist with the ID 2cfb981fbc5676182d64")," and can therefore be loaded directly with modifying the url by replacing all after ",o.createElement("code",null,"DOMAIN/relax/calc/")," with ",o.createElement("code",null,"/gist/2cfb981fbc5676182d64"),"."),o.createElement("h2",{id:"relalg-reference"},"Reference - relational algebra"),o.createElement("h3",{id:"relalg-syntax"},"General syntax"),o.createElement("div",null,o.createElement("h4",{id:"relalg-assignment"},"assignment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"NAME")," ",o.createElement("strong",null,"=")," ",o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"Defines a new local variable with the name ",o.createElement("i",null,"NAME"),"; its content is defined by",o.createElement("i",null,"EXPRESSION")),o.createElement("p",null,"The name of the new relation must be unique."),o.createElement("p",null,"The definition has to be executed with the statement."),o.createElement("div",{className:"example"},o.createElement("code",null,"TestA = π a,b R TestB = σ d > 0 S -- statement using the variable TestA join TestB")),o.createElement("p",null,"An assignment (= definition of a variable) is no valid relational algebra expression on its own. If you miss the acutal query a error is thrown (",o.createElement("i",null,"Error: only assignments found; query is missing"),")."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- this is the definition of the variable Test = π Customer.firstname, surname ( Customer ) -- this is the actual query/statement using the variable Test")),o.createElement("p",null,"The defined variable can be used like the assigned expression could be used because every usage of the variable gets replaced with its definition before the query gets executed.",o.createElement("br",null),"This also means that the variable-name has no influence on the schema of the expression and the names of the attributes/columns are not affected by assignment:",o.createElement("code",{className:"block example"},"X = R X join S"),"The attributes of the relation R are only accessible with its original names (R.a, R.b, ..), and are not affected by the assignment."),o.createElement("p",null,"There is a known problem when the last assignment ends with a natural join and the query consists of a single relation:"),o.createElement("code",null,"A = S join R A -- this is the query"),o.createElement("p",null,"The statement is ambiguous and the parser interprets it as ",o.createElement("code",null,"A = (S join R A)"),"where R is interpreted as a column argument for the theta-join and therefore detects a cyclic usage of the variable A."),o.createElement("p",null,"Solution: To get the expected behaviour you have to set braces around the assigned expression like ",o.createElement("code",null,"A = (S join R) A")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-sl"},"single-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"-- "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"the '--' must be followed by at least one whitespace charater! inserts a comment; its text goes until the end of the line"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,"Test =",o.createElement("b",null,"-- This is the expression that is assigned to Test:"),"π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relation-name"},"pre defined relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"RELATION_NAME"))))))),o.createElement("div",null,o.createElement("p",null,"Uses a pre defined relation with the name ",o.createElement("i",null,"RELATION_NAME")),o.createElement("p",null,"The code completion only works for this relations."),o.createElement("div",{className:"example"},o.createElement("code",null,"( Customers ) cross join ( Accounts )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-ml"},"multi-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"/* "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("strong",null," */"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"inserts a comment that can span multiple lines"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,o.createElement("b",null,"/* This is a very very long comment */"),"Test = π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-inline-relation"},"inline-relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("b",null,"{"),o.createElement("i",null,"COLUMN_NAME_1"),":",o.createElement("i",null,"COLUMN_TYPE_1")," ...",o.createElement("i",null,"ROW_1"),o.createElement("i",null,"ROW_2"),"...",o.createElement("b",null,"}"))))))),o.createElement("div",null,o.createElement("p",null,"The inline-relation is a temporary relation that can be defined directly in the statement. It is only valid in the defining statement"),o.createElement("p",null,"Every inline-relation is a valid expression and thus can be used at any position a",o.createElement("i",null,"EXPRESSION")," is expected."),o.createElement("p",null,"The inline-relation is defined by a header, that specifies the schema of the relation and the rows containing the values and is surrounded by curly braces."),o.createElement("div",null,"The header is defined by a sequence of",o.createElement("code",null,o.createElement("i",null,"QUALIFIER.COLUMN_NAME"),":",o.createElement("i",null,"COLUMN_TYPE"))," ",o.createElement("b",null,"separated by any whitespace, comma or semicolon."),"The ",o.createElement("i",null,"QUALIFIER")," is optional. Also the ",o.createElement("i",null,"COLUMN_TYPE")," can be omitted if the type is well defined by the values of that column. The first non null value of a column defines its type.",o.createElement("br",null),"True and false (case insensitive without quotes) are reserved for a boolean type. They can be used as a simple string but they do not define the type of the column as string.",o.createElement("br",null),"The ",o.createElement("i",null,"COLUMN_TYPE")," can be one of the following",o.createElement("ul",null,o.createElement("li",null,"string"),o.createElement("li",null,"number"),o.createElement("li",null,"date"),o.createElement("li",null,"boolean")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("qualifier"),".")),Object(Hn.NonTerminal)("column-name"),Object(Hn.Optional)(Object(Hn.Sequence)(":",Object(Hn.Choice)(0,"string","number","date","boolean"))))}))),o.createElement("p",null,"The rows of the relation are defined by a list of values per row with the type of the corresponding column. The values are ",o.createElement("b",null,"separated by whitespace comma or semicolon."),o.createElement("br",null),"Simple strings only containing letters, numbers, hyphens, underlines, dots or periods ([0-9a-zA-Z\\-_\\.]+) can be written without single quotes. ",o.createElement("i",null,"NULL")," and ",o.createElement("i",null,"null")," are constant values. If null, true or false should be used as string they have te be quoted.",o.createElement("br",null),"More complex strings must be surrounded by single quotes: ",o.createElement("i",null,"'content'")," or ",o.createElement("i",null,"content"),"but '' or 'long content containing spaces and special characters like !' or 'null'.",o.createElement("br",null),"Dates are written in ISO-format: YYYY-MM-DD without single quotes",o.createElement("br",null),"A null-value can be written as ",o.createElement("i",null,"null")," or ",o.createElement("i",null,"NULL")," (without single quotes).",o.createElement("br",null),"Numbers could be integers in the form (-?[0-9]+) or floats in the form (-?[0-9]+\\.[0-9]+).",o.createElement("br",null),"Numbers in single quotes are recognized as numbers if the column type is defined as number or has been detected to be number from a previous value; otherwise it will be a string value..",o.createElement("br",null),"A boolean value is denoted as either ",o.createElement("i",null,"true")," or ",o.createElement("i",null,"false")," (case insensitive)."),o.createElement("p",null,"The header and rows can be indented if needed."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- type for column b is defined by the first value\n\t\t\t\trho A {\n\t\t\t\t\ta:number, b\n\t\t\t\t\t1, 2\n\t\t\t\t\t3, 4\n\t\t\t\t}\n\t\t\t\tcross join\n\t\t\t\t{\n\t\t\t\t\ta:string X.b:date c:number\n\t\t\t\t\tAlpha 1970-01-01 1\n\t\t\t\t\t'Beta 2' 1970-01-02 3\n\t\t\t\t\t'' 1970-01-03 4\n\t\t\t\t}")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relalgexpr"},"relational algebra expression"),o.createElement("div",null,o.createElement("p",null,"A valid relational algebra expression is built by connecting ",o.createElement("i",null,"relation-name")," or ",o.createElement("i",null,"inline-relation"),"as atoms with the defined unary and binary operators."),"So a relational algebra expression is recursively defined as follows:",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Choice)(0,Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),")"),Object(Hn.NonTerminal)("relation-name","#relalg-relation-name"),Object(Hn.NonTerminal)("inline-relation","#relalg-inline-relation"),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.NonTerminal)("projection","#relalg-operations-projection"),Object(Hn.NonTerminal)("selection","#relalg-operations-selection"),Object(Hn.NonTerminal)("rename relation","#relalg-operations-renamerelation"),Object(Hn.NonTerminal)("rename column","#relalg-operations-renamecolumn"),Object(Hn.NonTerminal)("order by","#relalg-operations-orderby"),Object(Hn.NonTerminal)("group by","#relalg-operations-groupby")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))),Object(Hn.Choice)(1,Object(Hn.Skip)(),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.NonTerminal)("intersection","#relalg-operations-intersection"),Object(Hn.NonTerminal)("union","#relalg-operations-union"),Object(Hn.NonTerminal)("division","#relalg-operations-division"),Object(Hn.NonTerminal)("subtraction","#relalg-operations-subtraction"),Object(Hn.NonTerminal)("cross product","#relalg-operations-crossjoin"),Object(Hn.NonTerminal)("θ-join","#relalg-operations-innerjoin"),Object(Hn.NonTerminal)("natural join","#relalg-operations-naturaljoin"),Object(Hn.NonTerminal)("left outer join","#relalg-operations-leftjoin"),Object(Hn.NonTerminal)("right outer join","#relalg-operations-rightjoin"),Object(Hn.NonTerminal)("full outer join","#relalg-operations-fulljoin"),Object(Hn.NonTerminal)("left semi join","#relalg-operations-leftsemijoin"),Object(Hn.NonTerminal)("right semi join","#relalg-operations-rightsemijoin"),Object(Hn.NonTerminal)("anti semi join","#relalg-operations-antijoin")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))))})))),o.createElement("h3",{id:"relalg-unary-operations"},"Unary operations"),"Each unary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-projection"},"projection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"π")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"pi a, b ( R )")))))),o.createElement("p",null,"The argument is a subset of columns of the schema of the ",o.createElement("i",null,"CHILD_EXPRESSION")," or a ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("div",{className:"example"},o.createElement("code",null,"π Customer.firstname, surname ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, [1] ( ρ c ( Customer ) )")),"Expressions can be used to create more complex statements using one or more columns of a single row.",o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, lower(username)->user, concat(firstname, concat(' ', lastname))->fullname ( ρ c ( Customer ) )")),"The virtual column ",o.createElement("i",null,"ROWNUM")," used in previous versions is not supported any more but the ",o.createElement("code",null,"rownum()")," expression can be used to get the same information. And it can also be used directly in the boolean condition of a selection or join.",o.createElement("div",{className:"example"},"In this example the top 5 customers with the most orders are selected, where countOrders could be the result of a previous aggregation.",o.createElement("code",null,"pi firstname, lastname sigma rownum() ","<","= 5 tau countOrders desc Customer")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"π","pi"),Object(Hn.OneOrMore)(Object(Hn.NonTerminal)("column","#relalg-column"),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-selection"},"selection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"σ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"sigma a > 2 ( R )")))))),o.createElement("p",null,"The argument is a ",o.createElement("a",{href:"#relalg-valueexpr"},"boolean expression")," that each row of ",o.createElement("i",null,"CHILD_EXPRESSION"),"is checked on"),o.createElement("div",{className:"example"},o.createElement("code",null,"σ firstname = 'Bob' or firstname = 'Alice' ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"σ (id > 10 and id ","<"," 100) or id = 42 ( Customer )")),o.createElement("div",{className:"example"},"Selecting all customers with a firstname that has an even length.",o.createElement("code",null,"σ mod(length(firstname),2) = 0 ( Customer )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"σ","sigma"),Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamerelation"},"rename relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"( R ) join R.a = X.b (rho X ( R ))")))))),o.createElement("div",null,"The argument is the new name for the Relation returned by ",o.createElement("i",null,"CHILD_EXPRESSION"),o.createElement("div",{className:"example"},'rename the Relation from "Customer" to "a":',o.createElement("code",null,"π a.id, a.firstname ( ρ a ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"ρ","rho"),Object(Hn.NonTerminal)("new relation name")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamecolumn"},"rename column"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,"the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("code",{className:"relalg block"},"pi x, b rho a->x {a, b\n\t\t\t\t\t\t1, 2\n\t\t\t\t\t\t3, 4\n\t\t\t\t\t}")))))),o.createElement("div",null,"The argument is the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("div",{className:"example"},"rename the columns id and firstname to myId and foobar:",o.createElement("code",null,"ρ myId←id, foobar←firstname (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"ρ","rho"),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("new name"),Object(Hn.Choice)(0,"←","<-"),Object(Hn.NonTerminal)("column","#relalg-column")),Object(Hn.Sequence)(Object(Hn.NonTerminal)("column","#relalg-column"),Object(Hn.Choice)(0,"→","->"),Object(Hn.NonTerminal)("new name"))),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-orderby"},"order by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"τ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"tau a asc, b desc ( R )")))))),o.createElement("div",null,"The argument is a list of columns by which the relation should be ordered (see examples)",o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"τ [1], firstname desc (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"τ","tau"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("column","#relalg-column"),Object(Hn.Choice)(0,Object(Hn.Skip)(),"asc","desc")),",")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-groupby"},"group by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"γ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"gamma a, count(*)->x ( R )")))))),o.createElement("div",null,"The argument is a list of columns to group by, separated by commas followed by a semicolon",o.createElement("br",null),"and a list of aggregate functions to apply with their new name in form ",o.createElement("span",null,"AGG( COLUMN ) -> NEW_NAME"),o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"γ a, b ; sum(c)->x ( Customer )")),o.createElement("p",null,"If no grouping columns are provided the entire relation is the group."),o.createElement("div",null,"supported aggregate functions by type:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("td",null," "),o.createElement("th",null,"number"),o.createElement("th",null,"string"),o.createElement("th",null,"date"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"COUNT( * )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"COUNT( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MIN( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MAX( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"SUM( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")),o.createElement("tr",null,o.createElement("th",null,"AVG( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")))))),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"γ","gamma"),Object(Hn.Sequence)(Object(Hn.ZeroOrMore)(Object(Hn.NonTerminal)("column","#relalg-column"),","),";",Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"COUNT(*)",Object(Hn.Sequence)(Object(Hn.Choice)(0,"COUNT","MIN","MAX","SUM","AVG"),"(",Object(Hn.NonTerminal)("column","#relalg-column"),")")),Object(Hn.Choice)(0,"→","->"),Object(Hn.NonTerminal)("new name")),","))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-binary-operations"},"Binary operations"),"Each binary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")")," ",o.createElement("strong",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-intersection"},"intersection - ∩"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∩")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"intersect"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∩ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"∩","intersect")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-union"},"union - ∪"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"union"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∪ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"∪","union")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-division"},"division"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"÷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"/"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ÷ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"÷","/")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-subtraction"},"subtraction / set-difference"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"-"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"\\",o.createElement("br",null),"except"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( pi firstname ( Customer ) ) - ( rho test","<","-lastname ( pi lastname ( Customer ) ) )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"-","\\","except")),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-crossjoin"},"cross product"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⨯")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"cross join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⨯",Object(Hn.Sequence)("cross","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-innerjoin"},"Theta-join / θ-join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"inner join"))))),o.createElement("div",null,"join condition",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋈",Object(Hn.Sequence)(Object(Hn.Optional)("inner"),"join")),Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))}))),o.createElement("p",null,"Special case:",o.createElement("br",null),"The name of a single boolean column (like ",o.createElement("code",null,"R join a S"),") can not be used directly as a join condition due to ambiguities in the relational algebra syntax.",o.createElement("br",null),"The column must either be specified with its qualifier (",o.createElement("code",null,"R join R.a S"),") or wrapped in parentheses (",o.createElement("code",null,"R join (a) S"),").",o.createElement("br",null),"This is not necessary for more complex boolean expressions. The problem is only that the single column name can not be distinguished from a relation name: the expression ",o.createElement("code",null,"X=R join S X")," could be interpreted as ",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".")),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-naturaljoin"},"natural join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"natural join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",{className:"block"},"ρ a ( Customer )",o.createElement("span",{className:"math"},"⋈")," a.name ","<"," b.name ( ρ b ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋈",Object(Hn.Sequence)("natural","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftjoin"},"left outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟕")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left outer join",o.createElement("br",null),"left join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural left outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟕",Object(Hn.Sequence)("left",Object(Hn.Optional)("outer"),"join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightjoin"},"right outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟖")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right outer join",o.createElement("br",null),"right join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural right outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟖",Object(Hn.Sequence)("right",Object(Hn.Optional)("outer"),"join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-fulljoin"},"full outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟗")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"full outer join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural full outer join",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⟗",Object(Hn.Sequence)("full","outer","join")),Object(Hn.Optional)(Object(Hn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftsemijoin"},"left semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋉")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋉",Object(Hn.Sequence)("left","semi","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightsemijoin"},"right semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋊")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"⋊",Object(Hn.Sequence)("right","semi","join"))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-antijoin"},"anti semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"▷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"anti semi join",o.createElement("br",null),"anti join"))))),o.createElement("div",null,"no argument",o.createElement("br",null),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"▷",Object(Hn.Sequence)("anti",Object(Hn.Optional)("semi"),"join")))),Object(Hn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-operator-precedence"},"Operator precedence"),o.createElement("p",null,"The operator precedence allows to obmit most of braces.",o.createElement("br",null),"The used precedence is shown in the table below.",o.createElement("br",null),"All operators are left associative."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operator"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,o.createElement("a",{href:"#relalg-relation-name"},"relation-name"),",",o.createElement("a",{href:"#relalg-inline-relation"},"inline-relation"))),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-projection"},"projection"),",",o.createElement("a",{href:"#relalg-operations-selection"},"selection"),",",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename (columns)"),",",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename (relations)"),",",o.createElement("a",{href:"#relalg-operations-groupby"},"group"),",",o.createElement("a",{href:"#relalg-operations-orderby"},"order by"))),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross product"),",",o.createElement("a",{href:"#relalg-operations-innerjoin"},"theta join"),",",o.createElement("a",{href:"#relalg-operations-naturaljoin"},"natural join"),",",o.createElement("a",{href:"#relalg-operations-leftjoin"},"left outer join"),",",o.createElement("a",{href:"#relalg-operations-rightjoin"},"right outer join"),",",o.createElement("a",{href:"#relalg-operations-fulljoin"},"full outer join"),",",o.createElement("a",{href:"#relalg-operations-leftsemijoin"},"left semi-join"),",",o.createElement("a",{href:"#relalg-operations-rightsemijoin"},"right semi-join"),",",o.createElement("a",{href:"#relalg-operations-antijoin"},"anti semi-join"),",",o.createElement("a",{href:"#relalg-operations-division"},"division"))),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-intersection"},"intersection"))),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-union"},"union"),",",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction")))))),o.createElement("div",{className:"example"},o.createElement("code",null,"A join B x C"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"((A join B) x C)"),o.createElement("br",null),"because the cross product and the natural join are in the same precedence className."),o.createElement("div",{className:"example"},o.createElement("code",null,"sigma true A join sigma true B"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"(sigma true (A)) join (sigma true (B))"),o.createElement("br",null),"because the unary operators have a higher precedence than the binary operators."),o.createElement("h3",{id:"relalg-misc"},"Misc"),o.createElement("h4",{id:"relalg-column"},"Column"),"column is either",o.createElement("ul",null,o.createElement("li",null,'the name of a column: "columnName"'),o.createElement("li",null,'the number of the column (starting with 1): "[column-number]"'),o.createElement("li",null,'a full qualified column: "qualifier.columnName"'),o.createElement("li",null,"a value expression (if allowed for the specific operation)")),"the qualifier is optional if the column is unique in its schema.",o.createElement("h4",{id:"relalg-valueexpr"},"Value expressions"),"With most operators you can use a value-expression which connects one or more columns of a single row to calculate a new value. This is possible for:",o.createElement("ul",null,o.createElement("li",null,"the projection creating a new column (make sure to give the column a name)"),o.createElement("li",null,"the selection any expression evaluating to boolean can be used"),o.createElement("li",null,"for the joins any expression evaluating to boolean can be used; note that the ",o.createElement("code",null,"rownum()")," expression always represents the index of the lefthand relation")),"The expressions always operate on a single row/tuple of a table/relation.",o.createElement("br",null),"If you want to calculate values vertically over all values of a specific column/attribute you need to use group by with an aggregate function. The following table lists all functions and operators that can be used in an expression. They can be combined and nested in any arbitrary order but note that they do evaluate to a single type defined by the outer most expression. The following operators can be used:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("th",null,"returns type"),o.createElement("th",null,"description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a AND b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical and")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a OR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a XOR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical exclusive or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"NOT b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical not")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a = b a != b a ","<"," b a > b a ","<","= b a >= b a != b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"compares two values of the same type")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string LIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"returns true if expression evaluating to a string ",o.createElement("code",null,"a")," matches the pattern given as the second operand.",o.createElement("br",null),"The pattern has to be given as a string literal;",o.createElement("p",null,"An underscore (",o.createElement("code",null,"_"),") in the pattern stands for any single character and any percent sign (",o.createElement("code",null,"%"),") stands for any sequence of zero or more characters."))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string ILIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"same as ",o.createElement("code",null,"LIKE")," but matches case-insensitive.",o.createElement("br",null),"This is not in the SQL standard but is a PostgreSQL extension.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a + b a - b a * b a / b a % b")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, subtraction, multiplication, division, modulo")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rand()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns a random number in the interval [0, 1]")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rownum()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the index of the current row (starting with 0).",o.createElement("br",null),"If the function is used in a binary relational algebra expression (e.g. a join) it always represents the index of the left operand.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"length(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the length of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"date(a:string)")),o.createElement("td",null,"date"),o.createElement("td",null,"parses the given string to a date object. The string must be in the form YYYY-MM-DD")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"adddate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"adds the given number of days to date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"subdate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"subtracts the given number of days from date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"now() transaction_timestamp() statement_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns a timestamp representing the start of the query execution",o.createElement("br",null),"transaction- and statement start are the very same value due to the lack of a transaction concept")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"clock_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns the current timestamp while executing the query")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"year(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the year component of a given date")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"month(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the month component of a given date as a number. (1 = Sunday, 2 = Monday, ..., 7 = Saturday)")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"day(a:date) dayofmonth(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the day component of a given date as a number in the range 1 to 31")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"hour(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the hour component of a given date as a number in the range 0 to 23")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"minute(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the minute component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"second(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the second component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"concat(a:string [, ...])")),o.createElement("td",null,"string"),o.createElement("td",null,"concatenates the given strings")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"upper(a:string) ucase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to upper-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"lower(a:string) lcase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to lower-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"strlen(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"number of characters of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"abs(a:number)")),o.createElement("td",null,"number"),o.createElement("td",null,"the absolute value of the given number")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"add(a, b) sub(a, b) mul(a, b) div(a, b) mod(a, b)")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, ",o.createElement("br",null),"subtraction, ",o.createElement("br",null),"multiplication, ",o.createElement("br",null),"division or ",o.createElement("br",null),"modulo of the given numbers")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"round(a) floor(a) ceil(a)")),o.createElement("td",null,"number"),o.createElement("td",null,"round to nearest integer, ",o.createElement("br",null),"largest integer not greater than the argument or",o.createElement("br",null),"smallest integer not less than the argument")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"coalesce(",o.createElement("strong",null,"value")," [, ...])")),o.createElement("td",null,"type of ",o.createElement("strong",null,"value")),o.createElement("td",null,"returns the first of its arguments that is not null or null if all arguments are null. Note that all arguments must have the same datatype.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"CASE WHEN ",o.createElement("strong",null,"condition")," THEN result [WHEN ...] [ELSE ",o.createElement("strong",null,"result"),"] END")),o.createElement("td",null,"type of ",o.createElement("strong",null,"result")),o.createElement("td",null,"returns the first result where the condition evaluates to true. If all conditions are false the else part is executed or null is returnt if the else part is missing. Note that all results must have the same datatype."))))),"The operator precedence is the same as used in ",o.createElement("a",{href:"https://dev.mysql.com/doc/refman/5.7/en/operator-precedence.html"},"MySQL")," (from strong to weak):",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operators"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,"functions, constants, columns")),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,"! (boolean not)")),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,"- (unary minus)")),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,"*, /, %")),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,"-, +")),o.createElement("tr",null,o.createElement("td",null,"5"),o.createElement("td",null,"= (comparison), >=, >, ","<","=, ","<",", ","<",">, !=, LIKE, ILIKE")),o.createElement("tr",null,o.createElement("td",null,"6"),o.createElement("td",null,"CASE, WHEN, THEN, ELSE")),o.createElement("tr",null,o.createElement("td",null,"7"),o.createElement("td",null,"AND")),o.createElement("tr",null,o.createElement("td",null,"8"),o.createElement("td",null,"XOR")),o.createElement("tr",null,o.createElement("td",null,"9"),o.createElement("td",null,"OR, ||"))))),o.createElement("h2",{id:"sql-reference"},"Reference - SQL"),o.createElement("p",null,"The goal of the SQL mode of the relational algebra calculator is to provide a translation from SQL to relational algebra to show how they are related. It does not support all features a real database system like ",o.createElement("a",{href:"http://www.postgresql.org",target:"_blank"},"PostgreSQL")," or ",o.createElement("a",{href:"https://www.mysql.com/",target:"_blank"},"MySQL"),' does because the goal is to provide a translation into relational algebra. This means that many features like correlated-substatements are not supported because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h3",{id:"sql-syntax"},"General syntax"),o.createElement("p",null,"All keywords are case insensitv."),o.createElement("p",null,"The following Synopsis is a adapted version of ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html",target:"_blank"},"PostgreSQL")," and shows the general syntax of the supported SQL. Brackets indicate optional parts. Braces and vertical lines indicate that one of the alternatives has to be chosen. Dots mean that the preceding element can be repeated."),o.createElement("code",{className:"block sql"},"[ ",o.createElement("a",{href:"#sql-with"},"WITH")," ",o.createElement("strong",null,"with_query")," [, ...] ]",o.createElement("a",{href:"#sql-select"},"SELECT")," [ DISTINCT ] * | ",o.createElement("strong",null,"expression")," [ [ AS ] ",o.createElement("strong",null,"output_name")," ] [, ...]",o.createElement("a",{href:"#sql-from"},"FROM")," ",o.createElement("strong",null,"from_item")," [, ...] [ ",o.createElement("a",{href:"#sql-where"},"WHERE")," ",o.createElement("strong",null,"condition")," ] [ ",o.createElement("a",{href:"#sql-groupby"},"GROUP BY")," ",o.createElement("strong",null,"column")," [, ...] ] [ ",o.createElement("a",{href:"#sql-having"},"HAVING")," ",o.createElement("strong",null,"condition")," ] [ ","{"," ",o.createElement("a",{href:"#sql-setoperators"},"UNION")," | ",o.createElement("a",{href:"#sql-setoperators"},"INTERSECT")," | ",o.createElement("a",{href:"#sql-setoperators"},"EXCEPT")," } [ ALL | DISTINCT ] ",o.createElement("strong",null,"select")," ] [ ",o.createElement("a",{href:"#sql-orderby"},"ORDER BY")," ",o.createElement("strong",null,"column")," [ ASC | DESC ] [, ...] ] [ ",o.createElement("a",{href:"#sql-limit"},"LIMIT")," ","{"," ",o.createElement("strong",null,"count")," | ALL } ] [ ",o.createElement("a",{href:"#sql-limit"},"OFFSET")," ",o.createElement("strong",null,"start")," [ ROW | ROWS ] ] [ ",o.createElement("a",{href:"#sql-limit"},"FETCH")," ","{"," FIRST | NEXT } [ ",o.createElement("strong",null,"count")," ] ","{"," ROW | ROWS } ONLY ] where ",o.createElement("strong",null,"from_item")," can be one of:",o.createElement("strong",null,"table_name")," [ AS ",o.createElement("strong",null,"alias")," ]",o.createElement("strong",null,"with_query_name")," [ AS ",o.createElement("strong",null,"alias")," ] ( ",o.createElement("strong",null,"select")," ) AS ",o.createElement("strong",null,"alias"),o.createElement("strong",null,"from_item")," CROSS JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," NATURAL JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," ON join_condition",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," NATURAL",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," USING ( join_column [, ...] )",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN ON join_condition",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN NATURAL ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN USING ( join_column [, ...] ) ",o.createElement("strong",null,"from_item"),"and ",o.createElement("strong",null,"with_query")," is:",o.createElement("strong",null,"with_query_name")," AS ( ",o.createElement("strong",null,"select")," )"),o.createElement("div",{className:"too-wide"},o.createElement(Yn,{diagram:Object(Hn.Diagram)(Object(Hn.Stack)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("WITH","#sql-with"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("name"),"AS","(",Object(Hn.NonTerminal)("select","#sql-select"),")"),",")),"skip"),Object(Hn.Sequence)(Object(Hn.Terminal)("SELECT","#sql-select"),Object(Hn.Optional)("DISTINCT","skip"),Object(Hn.Choice)(0,"*",Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("column"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("output_name")))),Object(Hn.Sequence)(Object(Hn.NonTerminal)("expression","#sql-valueexpr"),Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("output_name")))),",")),Object(Hn.Terminal)("FROM","#sql-from"),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("table_name"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("select"),")",Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),",")),Object(Hn.OneOrMore)(Object(Hn.Choice)(0,Object(Hn.Skip)(),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.Sequence)(",",Object(Hn.Comment)("old syntax for cross join")),Object(Hn.Sequence)(Object(Hn.Choice)(0,"CROSS","NATURAL"),"JOIN"),Object(Hn.Sequence)(Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.Optional)("INNER"),"JOIN"),Object(Hn.Sequence)(Object(Hn.Choice)(0,"LEFT","RIGHT","FULL"),Object(Hn.Optional)("OUTER"),"JOIN")),Object(Hn.Choice)(0,Object(Hn.Sequence)("ON",Object(Hn.NonTerminal)("condition")),Object(Hn.Sequence)("USING","(",Object(Hn.OneOrMore)(Object(Hn.NonTerminal)("join_column"),","),")"),Object(Hn.Sequence)("NATURAL")))),Object(Hn.Choice)(0,Object(Hn.Sequence)(Object(Hn.NonTerminal)("table_name"),Object(Hn.Optional)(Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias")))),Object(Hn.Sequence)("(",Object(Hn.NonTerminal)("select"),")",Object(Hn.Sequence)("AS",Object(Hn.NonTerminal)("alias"))))))),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("WHERE","#sql-where"),Object(Hn.NonTerminal)("condition")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("GROUP BY","#sql-groupby"),Object(Hn.NonTerminal)("expression","#sql-valueexpr")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("HAVING","#sql-having"),Object(Hn.NonTerminal)("condition")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Choice)(0,"UNION","INTERSECT","EXCEPT"),Object(Hn.Choice)(0,Object(Hn.Skip)(),"DISTINCT","ALL"),Object(Hn.NonTerminal)("select")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("ORDER BY","#sql-orderby"),Object(Hn.OneOrMore)(Object(Hn.Sequence)(Object(Hn.NonTerminal)("expression","#sql-valueexpr"),Object(Hn.Choice)(0,"ASC","DESC")),",")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("LIMIT","#sql-limit"),Object(Hn.Choice)(0,Object(Hn.NonTerminal)("count"),"ALL")),"skip"),Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("OFFSET","#sql-limit"),Object(Hn.NonTerminal)("start"),Object(Hn.Optional)("ROWS")),"skip")),Object(Hn.Sequence)(Object(Hn.Optional)(Object(Hn.Sequence)(Object(Hn.Terminal)("FETCH FIRST","#sql-limit"),Object(Hn.NonTerminal)("count"),Object(Hn.Optional)("ROWS"),"ONLY"),"skip"))))})),o.createElement("h3",{id:"sql-translation"},"Semantic and Translation to relational algebra"),o.createElement("h4",{id:"sql-translation-sequence"},"Sequence of execution"),o.createElement("p",null,'The SQL statement is translated directly into relational algebra. To understand some of the effects of the tool it might be helpful to understand the steps of the translation process. As mentioned before, real database systems might take a different (more complex) aproach but this should help to get an idea of how SQL could be translated into "classNameical" relational algebra.'),o.createElement("p",null,"The following list shows the translation from SQL into relational algebra starting with the inner most relational algebra expression at the top."),o.createElement("ol",null,o.createElement("li",null,"replace all usages of the temporary-tables defined in the WITH-clause with their definitions"),o.createElement("li",null,"FROM-clause is translated left associative with all joins having the same precedence (",o.createElement("code",null,","),"is a cross join)"),o.createElement("li",null,"selection with condition from where-clause is added"),o.createElement("li",null,"group by"),o.createElement("li",null,"selection with condition from having-clause"),o.createElement("li",null,"union/intersect/except"),o.createElement("li",null,"projection is added to choose the requested columns of the SELECT-clause"),o.createElement("li",null,"the columns are renamed to get the requested output-name specified in the SELECT-clause"),o.createElement("li",null,"order by"),o.createElement("li",null,"limit/offset is mapped to a selection")),o.createElement("h4",{id:"sql-select"},"SELECT"),o.createElement("p",null,"The direct translation into relational algebra with implicit duplication elimination requires the ",o.createElement("code",null,"distinct"),"keyword to be equivalent. A warning is shown if you omit it."),o.createElement("p",null,"The select-clause is translated into up to two relalg operators."),o.createElement("ul",null,o.createElement("li",null,"The most basic case is ",o.createElement("code",null,"select ",o.createElement("strong",null,"*")," ...")," where no changes are made to the schema of the result. Therefore no projection is needed. You can use the optional table-alias-prefix if the columns of a single table/relation should be returned only: ",o.createElement("code",{className:"sql"},"select distinct R.* from R inner join S")),o.createElement("li",null,"When a subset of the columns are selected and/or reordered (",o.createElement("code",null," select a, b from ..."),") then a single ",o.createElement("a",{href:"#relalg-operations-projection"},"projection")," is used."),o.createElement("li",null,"Additionally to the previous case a ",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename-column operator")," is added after the projection if new output-names are given with ",o.createElement("code",null,"as foo"),". e.g. ",o.createElement("code",null,"select a ",o.createElement("strong",null,"as foo")," from ..."))),o.createElement("p",null,"The allowed expressions are the same as for the ",o.createElement("a",{href:"#relalg-operations-projection"},"projection"),". So it can be either the name of the column (with optional renaming using ",o.createElement("code",null,"as"),") or a complex",o.createElement("a",{href:"#sql-valueexpr"},"value expression"),". In the latter case a output-name must be given using",o.createElement("code",null,"as")," because the tool requires every column to have a name."),o.createElement("h4",{id:"sql-from"},"FROM"),o.createElement("p",null,"In its simplest form the from-clause holds a single table/relation name that is used directly in the relalg statement. If the optional table-alias is specified with ",o.createElement("code",null,"table as foo")," this is reflected by wrapping the relation in a ",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename-relation operator")," with the given output-name."),o.createElement("code",{className:"example sql"},"select distinct x.a, x.b from R as x"),o.createElement("p",null,"Joins can be expressed using the ANSI join syntax"),o.createElement("code",{className:"example sql"},"select distinct * from A, B inner join C on ... inner join D natural natural join E left outer join F on ... left outer join G natural right outer join H on ... right outer join I natural full outer join J on ... full outer join K natural where ..."),o.createElement("p",null,"The comma is part of the old join syntax and is translated into a ",o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross join"),"."),o.createElement("code",{className:"example sql"},"select distinct * from R, S as s, T where s.a = R.a"),o.createElement("p",null,"Instead of the name of relation a non-correlated substatement can be used. A table alias must be provided with ",o.createElement("code",null,"(...) as foo"),".",o.createElement("br",null),"A non-correlated substatement can be directly translated into relational algebra by just translate the sub-statement into relational algebra and use the resulting operator tree instead of the relation."),o.createElement("p",null,"Non-correlated means that it must not reference/use any columns of tables defined in the outer scope.",o.createElement("br",null),'This limitation is intentionally because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("code",{className:"example sql"},"select distinct * from R, (select * from S where a > 0) as x where x.a = R.a"),o.createElement("h4",{id:"sql-where"},"WHERE"),o.createElement("p",null,"The boolean condition in the where-clause can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The where clause is directly translated to an ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," with the very same condition. This selection is applied after joining relations of the from-clause therefore has to use the original column names."),o.createElement("p",null,"Subquery Expressions like ",o.createElement("code",null,"EXISTS"),", ",o.createElement("code",null,"IN"),", ",o.createElement("code",null,"ANY/SOME")," or ",o.createElement("code",null,"ALL"),"are ",o.createElement("strong",null,"not supported"),' because their translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h4",{id:"sql-groupby"},"GROUP BY"),o.createElement("p",null,"The GROUP-BY-clause takes a list of column names only argument."),o.createElement("p",null,"The GROUP-BY-clause is directly translated to the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," and is executed directly after the selection built from the WHERE-clause and before the projection/renaming build from the SELECT-clause. Therefore the column names that can be used are the ones available after all joining all tables."),o.createElement("p",null,"The aggregations used in the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," are taken from the SELECT-clause and an output-name must be given using ",o.createElement("code",null,"as"),"because the tool requires every column to have a name."),o.createElement("p",null,"If no aggregations are present in the SELECT-clause a projection is used instead of the group-by operation because ",o.createElement("a",{href:"#relalg-operations-groupby"},"sigma")," without aggregation has the very same effect."),o.createElement("p",null,"Every non-aggregation-column in the SELECT-clause must be present in the group by clause because the would not be available after the grouping."),o.createElement("h4",{id:"sql-having"},"HAVING"),o.createElement("p",null,"The HAVING-Clause represents an optional ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection"),". The boolean condition can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The resulting selection is executed directly after the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation"),"."),o.createElement("p",null,"Unlike ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-HAVING",target:"_blank"},"PostgreSQL"),"the HAVING-clause is only allowed when either a aggregation or grouping is present."),o.createElement("h4",{id:"sql-orderby"},"ORDER BY"),o.createElement("p",null,"Order by takes a list of column names or indices of columns (starting with 1) as its argument."),o.createElement("p",null,"It is directly translated to the ",o.createElement("a",{href:"#relalg-operations-orderby"},"extended relational algebra operation order by (tau)"),"."),o.createElement("h4",{id:"sql-limit"},"LIMIT"),o.createElement("p",null,"The LIMIT-clause can be either specified with the LIMIT-OFFSET syntax used by PostgreSQL and MySQL or the FETCH-FIRST syntax introduced in SQL:2008."),o.createElement("p",null,"It is translated into a ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," using the",o.createElement("code",null,"rownum()"),"-function to limit the number of rows returned."),o.createElement("h4",{id:"sql-setoperators"},"UNION / INTERSECT / EXCEPT"),o.createElement("p",null,"The Set-Operators UNION, INTERSECT and EXCEPT directly map to the relational algebra operators ",o.createElement("a",{href:"#relalg-operations-union"},"union"),", ",o.createElement("a",{href:"#relalg-operations-intersection"},"intersection")," and ",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction"),"."),o.createElement("p",null,"The keyword ",o.createElement("code",null,"DISTINCT")," is optional because it represents the default behavior. The keyword",o.createElement("code",null,"ALL")," is ignored and a warning is shown because the targeted relational algebra has a implicit elimination duplicate rows."),o.createElement("p",null,"Parentheses can be used to create more complex statements:",o.createElement("br",null),o.createElement("code",{className:"example sql"},"( select distinct * from S union select distinct * from T ) except select distinct * from T order by 1 limit 1")),o.createElement("h4",{id:"sql-with"},"WITH"),o.createElement("p",null,"The WITH-clause (also known as ",o.createElement("i",null,"common table expressions"),") provides a way to define subqueries for single or multiple use in a statement. This can be thought as defining a temporary table for that query in SQL terminology or ",o.createElement("a",{href:"#relalg-assignment"},"creating variables in relational algebra"),". Recursive evaluation is not supported."),o.createElement("p",null,"Each subquery can be referenced by the name from the WITH-clause. The subquery is automatically renamed to the name used in the WITH-clause."),o.createElement("h4",{id:"sql-valueexpr"},"Value expressions"),o.createElement("p",null,"Value expressions are used for boolean expressions for WHERE- and HAVING-clause, the boolean conditions of joins and calculated values in the SELECT-clause. The type of a expression is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean")," and is determined by the used operations and columns."),o.createElement("p",null,"The supported functions and operations are the same for SQL and relational algebra: ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("h2",{id:"license-help"},"Licence"),o.createElement("p",null,o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},o.createElement("img",{alt:"Creative Commons License",style:{borderWidth:0},src:"https://i.creativecommons.org/l/by-sa/4.0/88x31.png"})),o.createElement("br",null),"This document by Johannes Kessler is licensed under a ",o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},"Creative Commons Attribution-ShareAlike 4.0 International License"),".")))))}}n("./src/calc2/views/landing.css");class Bn extends o.Component{componentDidMount(){In("#exec1").click((function(){In(this).addClass("hidden"),In(this).next().removeClass("hidden")}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-12"},o.createElement("div",{className:"jumbotron",id:"landing-header-bar"},o.createElement("div",{className:"col-md-12 ct",id:"logos"},o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_blue_large.png",alt:"Databases and Information Systems (DBIS)",width:"159",height:"120"})),o.createElement("a",{href:"http://www.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_uni_uni_2017_rgb_transparent.png",alt:"University of Innsbruck",width:"300",height:"120"}))),o.createElement("div",{className:"col-md-12 ct"},o.createElement("h1",{id:"heading"},"RelaX - relational algebra calculator"),o.createElement("p",null,"calculates any relational algebra statement like ",o.createElement("code",null,o.createElement("span",null,"( σ ",o.createElement("sub",null,"a > 42")," ( A ) ) ",o.createElement("span",{className:"math"},"⋈")," ( π ",o.createElement("sub",null,"a,b")," ( B ) )"))," on a set of relations.")),o.createElement("div",{className:"col-md-12 ct"},o.createElement(Xe,{className:"btn btn-primary btn-lg getStartedBtn",role:"button",to:"/relax/calc"},"Get Started"))),o.createElement("h2",null,"What is the relational algebra calculator?"),o.createElement("p",null,"If you want to learn SQL you take a database system and try some queries.",o.createElement("br",null),"But if you want to learn relational algebra what do you use? Pen and paper?"),o.createElement("p",null,"The relational algebra calculator helps you learn relational algebra (RelAlg) by executing it."),o.createElement("div",{className:"example"},"Subjects =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"Maths"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"English"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")))))),"Students =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"stId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"John"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"Mike"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"Julia")))))),"Marks =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"stId"),o.createElement("th",null,"mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"B"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"C")))))),o.createElement("br",null),o.createElement("div",null,o.createElement("span",null,o.createElement("span",{className:"math"}," π "),o.createElement("sub",null," studentName, subjectName, mark "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," studentName←st.name, subjectName←su.name "),"( ",o.createElement("span",null,"( ",o.createElement("span",null,"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," su "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Subjects"))," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," σ "),o.createElement("sub",null,"mark≥'C' "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," m "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Marks"))," )")," )")," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," m.stId=st.stId "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null,"st "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Students"))," )")," )")," )")," )")),"=",o.createElement("button",{type:"button",className:"btn",id:"exec1"},"execute"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline hidden"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"st.studentName"),o.createElement("th",null,"su.subjectName"),o.createElement("th",null,"m.mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Mike")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))))))),o.createElement("h2",null,"Calculator features:"),o.createElement("ul",null,o.createElement("li",null,"supports most common operators",o.createElement("ul",null,o.createElement("li",null,"projection"),o.createElement("li",null,"selection"),o.createElement("li",null,"rename relations"),o.createElement("li",null,"rename columns"),o.createElement("li",null,"group by"),o.createElement("li",null,"intersect"),o.createElement("li",null,"union"),o.createElement("li",null,"set difference"),o.createElement("li",null,"cross join"),o.createElement("li",null,"theta join"),o.createElement("li",null,"natural join"),o.createElement("li",null,"natural left outer join"),o.createElement("li",null,"natural right outer join"),o.createElement("li",null,"natural full outer join"),o.createElement("li",null,"theta left outer join"),o.createElement("li",null,"theta right outer join"),o.createElement("li",null,"theta full outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"right semi join"),o.createElement("li",null,"anti join join"),o.createElement("li",null,"order by"))),o.createElement("li",null,"runs in any modern browser. no plugins needed"),o.createElement("li",null,"text based approach. lets you write RelAlg as easy as SQL"),o.createElement("li",null,"code editor with syntax highlighting and code completion"),o.createElement("li",null,"pre defined sets of relations"),o.createElement("li",null,"visualize statement in a operator tree"),o.createElement("li",null,"plain text alternatives for special symbols like σ or ",o.createElement("span",{className:"math"},"⋈")),o.createElement("li",null,"variables can be used to simplify expressions"),o.createElement("li",null,"new temporal relations can be declared in the statement"),o.createElement("li",null,"sql like comments"),o.createElement("li",null,"arbitrary boolean expressions in conditions"),o.createElement("li",null,"operations keep original order for better traceability"),o.createElement("li",null,"translates simple SQL-statements to RelAlg",o.createElement("ul",null,o.createElement("li",null,"no support for correlated sub-statements")))),o.createElement("h2",null,"Available data"),"You can either use one of the following datasets or create a new one.",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Name"),o.createElement("th",null,"Source"),o.createElement("th",null,"Language"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"Kemper Datenbanksysteme"),o.createElement("td",null,o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/"},"Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage"),", Seite 84, Abbildung 3.8"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - KursDB"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - R, S, T"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.1"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 52-55"),o.createElement("td",null,"en")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.3"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 55-57"),o.createElement("td",null,"en"))))),o.createElement("h2",null,"What it is not:"),o.createElement("p",null,"The tool is not meant to be a full database system. The goal of the implementation was to create a tool to support people to learn RelAlg."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null," "),o.createElement("th",null,"Pen and Paper"),o.createElement("th",null,"relational algebra calculator"),o.createElement("th",null,"MySQL"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"SQL support"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes :-)"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," basic SQL"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"relational algebra"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"use variables for RelAlg"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"large datasets"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"query plan"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"intermediate results"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"iterative working"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"))))),o.createElement("h2",{id:"changelog"},"Changelog"),o.createElement("ul",null,o.createElement("li",null,"0.20",o.createElement("ul",null,o.createElement("li",null,"added option to automatically replace operators in relational algebra: all plaintext-syntax operators get replaced with the equivalent mathematical symbol or vice versa."))),o.createElement("li",null,"0.19",o.createElement("ul",null,o.createElement("li",null,"added datepicker to quickly insert a date literal"))),o.createElement("li",null,"0.18",o.createElement("ul",null,o.createElement("li",null,"added support for the ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"LIKE-operator")," for SQL and relational algebra",o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi 'abc' like 'a%'->x R")),o.createElement("li",null,"added translation support for the calculator using ",o.createElement("a",{href:"http://i18next.com/",target:"_blank"},"i18next"),". This allows easy translation of the main calculator into other languages."),o.createElement("li",null,"calculator is now available in ",o.createElement("a",{href:"calc.htm?lang=de"},"german")),o.createElement("li",null,"ported project to ES2015 (it now gets transpiled to ES5 and packed using ",o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel.js"),"and ",o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify"),")"))),o.createElement("li",null,"0.17",o.createElement("ul",null,o.createElement("li",null,"fixed bug: inline-table-editor not working"),o.createElement("li",null,"fixed bug: formula for !a was not working"))),o.createElement("li",null,"0.16",o.createElement("ul",null,o.createElement("li",null,"disallow relational algebra keywords as column-/relation-names"),o.createElement("li",null,"fixed precedence for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE-WHEN-expressions")),o.createElement("li",null,"added support for the SQL-92 ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},o.createElement("code",null,"||"),"-concat operator")),o.createElement("li",null,"added ",o.createElement("code",null,"except")," as alternative syntax for the ",o.createElement("a",{href:"/relax/help#relalg-operations-subtraction"},"relational algebra set-difference operator")),o.createElement("li",null,"fixed bug where ",o.createElement("code",null,"A=R join S A")," was interpreted as",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".",o.createElement("br",null),"see ",o.createElement("a",{href:"/relax/help#relalg-operations-innerjoin"},"help page")," for more information"))),o.createElement("li",null,"0.15",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"hour(), minute() and second()")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"now()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi hour(now())->x, minute(now())->y, second(now())->z ( R )")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"n-ary concat"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi concat(b, '_', c)->x R")),o.createElement("li",null,"added support for WITH-clauses for SQL"))),o.createElement("li",null,"0.14",o.createElement("ul",null,o.createElement("li",null,"improve error message for theta-joins with conflicting columns"),o.createElement("li",null,"improve error message and added example for assignments without query error"),o.createElement("li",null,"bugfix: calculator-tour did not work correctly for Edge on Windows 10"))),o.createElement("li",null,"0.13",o.createElement("ul",null,o.createElement("li",null,'updated to CodeMirror version 5.1 with "experimental mobile support"'),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"COALESCE()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi coalesce(a, b, 1)->x R"),", ",o.createElement("code",null,"select coalesce(a, b, 1) as x from R")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE WHEN"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"select case when a > 3 then a+1 else a end as x from R")),o.createElement("li",null,"added support for complex union/intersect/except statements for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"(select * from S union ( select * from T except select * from T )) order by 1")))),o.createElement("li",null,"0.12",o.createElement("ul",null,o.createElement("li",null,"added support for more complex FROM-clauses for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct * from R, (S natural join T)")),o.createElement("li",null,"simplify and link the syntax diagrams at the help page"))),o.createElement("li",null,"0.11",o.createElement("ul",null,o.createElement("li",null,"added a tour to explain the main features of the tool to new users (using ",o.createElement("a",{href:"http://bootstraptour.com/",target:"_blank"},"Bootstrap Tour"),")"),o.createElement("li",null,"added ",o.createElement("a",{href:"/relax/help#sql-reference"},"reference for SQL in the help section")),o.createElement("li",null,"added support for USING clause for joins for SQL"),o.createElement("li",null,"added support FETCH FIRST syntax (SQL:2008) for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select * from R offset 2 rows fetch first 10 rows only")),o.createElement("li",null,"allow DISTINCT on set operators for SQL"),o.createElement("li",null,"bugfix: having should be allowed without group by if aggregation is used"))),o.createElement("li",null,"0.10",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"arithmetic expressions and functions")," for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct a+2 as x from R where length(b) > 2")),o.createElement("li",null,"show warnings instead of errors when not using distinct or using all on set operators in SQL"))),o.createElement("li",null,"0.9",o.createElement("ul",null,o.createElement("li",null,"added support for arithmetic operators and functions in ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"(e.g boolean) expressions")," for relational algebra"),o.createElement("li",null,"projection supports ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"expressions")),o.createElement("li",null,"removed magic ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"ROWNUM")," column; ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"ROWNUM()")," is now a function"),o.createElement("li",null,"tutorials for ",o.createElement("a",{href:"/relax/help#tutorial-user"},"users")," and ",o.createElement("a",{href:"/relax/help#tutorial-maintainer"},"maintainers")),o.createElement("li",null,"new braces handling in formula generation (braces are only placed if necessary)"),o.createElement("li",null,"bugfix: rename not existent column was silently ignored"),o.createElement("li",null,"syntax of dates has changed ",o.createElement("code",null,"1970-01-01")," could not be used any more because it is ambiguous (arithmetic operaton or date). The SQL notation (",o.createElement("code",null,"date('1970-01-01')"),") is now used for the relational algebra mode."))),o.createElement("li",null,"0.8",o.createElement("ul",null,o.createElement("li",null,"grid editor for inline relations"),o.createElement("li",null,"sql-dump import (beta)"),o.createElement("li",null,"group editor"),o.createElement("li",null,"changed the basic structure of the editors (internally)"),o.createElement("li",null,"duplicate rows are removed in every step")))),o.createElement("h2",null,"Who?"),o.createElement("p",null,"The relational algebra calculator was created by Johannes Kessler BSc at ",o.createElement("a",{href:"https://dbis-informatik.uibk.ac.at/1-1-Home.html"},"Databases and Information Systems Group")," at the ",o.createElement("a",{href:"http://informatik.uibk.ac.at/"},"Institute of Computer Science")," at the ",o.createElement("a",{href:"http://www.uibk.ac.at/index.html.en"},"University of Innsbruck")," under supervision of Michael Tschuggnall PhD and Prof. Dr. Günther Specht"),o.createElement("h2",null,"External resources"),o.createElement("p",null,"This tool was not written from scratch but many different external resources/frameworks/projects/libs are used."),o.createElement("p",null,"This is a list of resources/frameworks/projects/libs used for this tool (in alphabetical order) to give credit where credit is due and guide anyone interested to them without having to look through the code."),o.createElement("ul",null,o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel JavaScript compiler")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://blanketjs.org/"},"blanket.js")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://botmonster.com/jquery-bootpag/"},"bootpag")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://getbootstrap.com/"},"Bootstrap")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://bootstrap-datepicker.readthedocs.org"},"bootstrap-datepicker")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://bootstraptour.com/"},"Bootstrap Tour")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codemirror.net/"},"CodeMirror")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codepen.io/Pestov/pen/BLpgm"},"CSS3 family tree by Ilya Pestov")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://www.gnu.org/software/freefont/"},"FreeSans by GNU FreeFont")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://gruntjs.com/"},"Grunt")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handlebarsjs.com/"},"handlebars")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handsontable.com/"},"Handsontable")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://i18next.com/"},"i18next")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://jquery.com/"},"jQuery")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/chjj/marked"},"marked - a markdown parser")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://pegjs.org/"},"PEG.js - Parser Generator for JavaScript")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://qunitjs.com/"},"QUnit - js unit testing")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/tabatkins/railroad-diagrams"},"tabatkins/railroad-diagrams"))))))))}}class Un extends o.Component{componentDidMount(){}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Fn,null),o.createElement("div",{className:"view-min"},"Databases and Information System",o.createElement("br",null),"Universität Innsbruck",o.createElement("br",null),"ICT - building, second floor",o.createElement("br",null),"Technikerstrasse 21a",o.createElement("br",null),"A-6020 Innsbruck",o.createElement("br",null)))}}n("./src/calc2/style/index.scss");class zn extends o.Component{constructor(e){super(e),this.state={isNavbarOpen:!0}}componentDidMount(){var e;const t=document.getElementById("loadingScreen");null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}render(){const{store:e}=this.props,{isNavbarOpen:t}=this.state;return o.createElement(Ue,null,o.createElement(f,{store:e},o.createElement(r.a,null,o.createElement(Be,null,o.createElement(Re,{exact:!0,from:"/",to:"/relax/landing"}),o.createElement(Re,{exact:!0,from:"/relax",to:"/relax/landing"}),o.createElement(Pe,{path:"/relax/landing",component:Bn}),o.createElement(Pe,{path:"/relax/help",component:Wn}),o.createElement(Pe,{path:"/relax/imprint",component:Un}),o.createElement(Re,{from:"/relax/calc",to:"/relax/calc/local/uibk/local/0",exact:!0,strict:!0}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Pn}),o.createElement(Pe,{path:"/relax/calc/:source/:id",component:Pn}),o.createElement(Pe,{render:e=>o.createElement("div",{className:"view-min"},o.createElement("h1",null,"404"),o.createElement("p",null,"This route doesn't exist"),o.createElement("span",null,JSON.stringify(e)))})))))}}},"./src/calc2/style/index.scss":function(e,t,n){},"./src/calc2/utils/groupUtils.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n("./src/db/relalg.ts"),o=n("./node_modules/jquery/dist/jquery.js");const i=n("./src/calc2/data/uibk.txt"),a={uibk:i.default?i.default:""};function s(e,t,n){return u(Object(r.c)(e),t,n)}function l(e,t,n){if(0===(e=e.filter(({name:e})=>e===t)).length)return{fallback:n};let r=null;const o={};for(let t=0;t{switch(e){case"gist":o.ajax({url:`https://api.github.com/gists/${t}`,dataType:"json",success:function(o){const a=[];for(const u in o.files){if(!o.files.hasOwnProperty(u))continue;const c=null===o.owner?"anonymous":o.owner.login,d=null===o.owner?void 0:o.owner.html_url,h={source:e,id:o.id,filename:u,index:-1,maintainer:n,maintainerGroup:r},f={author:c,authorUrl:d,lastModified:new Date(o.updated_at),url:o.url};try{a.push(...s(o.files[u].content,h,f)),i(a)}catch(e){const n='could not parse given group from gist with id "'+t+'": '+e;console.error(n,t,e,u,o),l(new Error(n))}}},crossDomain:!0,statusCode:{404:function(){l(new Error("gist "+t+" not found"))}},async:!0});break;case"local":try{const o=s(a[t],{source:e,id:t,filename:"local",index:-1,maintainer:n,maintainerGroup:r},{});i(o)}catch(e){let t="cannot parse groups file: "+e.message;t+="
              see log for more information",console.error(t,e),l(new Error(t))}break;case"http":{const e="parsing groups from arbitrary urls is no longer supported; use github gists instead.";window.alert(e),l(new Error(e));break}default:l(new Error("unknown source "+e))}})}},"./src/calc2/views/help.css":function(e,t,n){},"./src/calc2/views/landing.css":function(e,t,n){},"./src/db/exec/Column.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e,t,n="null"){this._type="null",this._name=e,this._relAlias=t,this._type=n}getName(){return this._name}getRelAlias(){return this._relAlias}getType(){return this._type}setRelAlias(e){this._relAlias=e}toString(){return r.printColumn(this._name,this._relAlias)}equals(e){return this._name===e._name&&this._relAlias===e._relAlias}static printColumn(e,t){let n;return n="number"==typeof e?`[${e}]`:e,null===t?n:`${t}.${n}`}}},"./src/db/exec/ExecutionError.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r extends Error{constructor(e,t){super(e),this.codeInfo=t||void 0}}},"./src/db/exec/RANode.ts":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n("./src/db/exec/ExecutionError.ts");class o{constructor(e=""){this._codeInfo=null,this._metaData={},this._resultNumRows=-1,this._wrappedInParentheses=!1,this._warnings=[],this._functionName=e}setCodeInfoObject(e){return this._codeInfo=e,this}addWarning(e,t){const n={message:e,codeInfo:void 0};t&&(n.codeInfo=t),this._warnings||(this._warnings=[]),this._warnings.push(n)}setWrappedInParentheses(e=!0){this._wrappedInParentheses=e}throwExecutionError(e){throw new r.a(e,this._codeInfo)}setMetaData(e,t){this._metaData[e]=t}hasMetaData(e){return void 0!==this._metaData[e]}getMetaData(e){return this._metaData[e]}getResultNumRows(){if(void 0===this._resultNumRows||-1===this._resultNumRows)throw new Error("result num rows not set! call only after getResult");return this._resultNumRows}setResultNumRows(e){this._resultNumRows=e}_returnOrCreateSession(e){return void 0===e?{statement_timestamp:new Date}:e}getArgumentHtml(){return""}static foreachRecursive(e,t){t(e),e instanceof a?t(e.getChild()):e instanceof s&&(t(e.getChild()),t(e.getChild2()))}}class i extends o{getWarnings(e){return this._warnings}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class a extends o{constructor(e,t){super(e),this._child=t}getChild(){return this._child}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class s extends o{constructor(e,t,n){super(e),this._child=t,this._child2=n}getChild(){return this._child}getChild2(){return this._child2}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0),...this.getChild2().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses||!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild2().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}},"./src/db/exec/Relation.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./src/db/exec/RANode.ts"),o=n("./src/db/exec/Table.ts");class i extends r.b{constructor(e,t){super(e),this._schema=null,void 0===t?this._table=new o.a:(t.check(),this._schema=t.getSchema(),this._table=t.getResult())}setSchema(e,t=!1){return this._schema=e.copy(),!0!==t&&this._schema.setRelAlias(this._functionName),this._table.setSchema(this._schema),this}addRow(e){this._table.addRow(e)}addRows(e){this._table.addRows(e)}getResultNumRows(){return this._resultNumRows}getResult(e){this._returnOrCreateSession(e);const t=this._table.copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}getSchema(){return this._table.getSchema()}getName(){return this._functionName}check(){}hasChild(){return!1}copy(){if(null===this._schema)throw new Error("check not called");const e=new i(this._functionName);return e.setSchema(this._schema),e._table=this._table.copy(),e}}},"./src/db/exec/Schema.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./src/db/exec/Column.ts");class i{constructor(){this._names=[],this._relAliases=[],this._types=[],this._size=0,this._colIndexPerName={}}getSize(){return this._size}addColumn(e,t,n){if("string"!==n&&"date"!==n&&"number"!==n&&"boolean"!==n)throw new Error("unknown type! "+n);this._names.push(e),this._relAliases.push(t),this._types.push(n);const o=this._size;if(!1===this.isUnique(o))throw new Error(r.a("db.messages.exec.error-column-not-unique",{column:t+"."+e}));return this._addColToIndex(e,o),this._size++,this}addColumn2(e){return this.addColumn(e.getName(),e.getRelAlias(),e.getType())}_addColToIndex(e,t){void 0===this._colIndexPerName[e]?this._colIndexPerName[e]=[t]:this._colIndexPerName[e].push(t)}_removeColFromIndex(e){const t=this._names[e],n=this._colIndexPerName[t];n.splice(n.indexOf(e,0),1),0===n.length&&delete this._colIndexPerName[t]}removeColumn(e){this._names.splice(e,1),this._relAliases.splice(e,1),this._types.splice(e,1),this._size--;for(let t=e;tthis._size)throw new Error(r.a("db.messages.exec.error-column-index-out-of-range",{column:o.a.printColumn(e,t),schema:this.toString()}));if(null===t)return[n];if(this._relAliases[n]===t)return[n]}return[]}getType(e){return this._types[e]}equals(e){if(!1===this.equalsTypeOnly(e))return!1;for(let t=0;t1}getName(e){return this._names[e]}getFullName(e){return(this._relAliases[e]?this._relAliases[e]+".":"")+this._names[e]}toString(){const e=[];for(let t=0;t'+Object(r.d)(n,o)+"
              "}getRows(e=0,t){if(0===e&&void 0===t)return this._rows;{const n=this._rows.length;let r=n;t&&t>0&&(r=Math.min(n,e+t)),this._rows.slice(e,r);const o=[];for(let t=e;t"+n.getName()+"":""+n.toString()+""}o+="";let i="";const a=this.getNumRows();let s=a;t&&t>0&&(s=Math.min(a,n+t));for(let e=n;e"+this.getValueHtmlAt(e,n)+"";i+=t+""}return""+o+i+"
              "}equals(e){if(e instanceof a==!1)throw new Error("can not compare");if(!1===this._schema.equals(e._schema))return!1;if(this._rows.length!==e._rows.length)return!1;for(let t=0;tn)throw new Error("invalid sort cols");for(let e=0;e=n||r[e]<0)throw new Error("invalid sort cols");const i=r.length;if(i!==o.length)throw new Error("invalid sort cols");const a=r.map(e=>this._schema.getType(e)),s=function(e,t,n,r,o){const i=e[n],a=t[n];if(null===i&&null===a)return 0;if(null===i&&null!==a)return 1*r;if(null!==i&&null===a)return-1*r;switch(o){case"number":case"date":case"boolean":return r*(i-a);case"string":return r*i.localeCompare(a);case"null":return 0}};this._rows.sort((function(e,t){let n=0;for(let l=0;l=e.length?t[this._index-e.length]:e[this._index]}toString(){return o.a.printColumn(this._name,this._relAlias)}getFormulaHtml(){const e=o.a.printColumn(this._name,this._relAlias);return!0===this._wrappedInParentheses?"("+e+")":e}static _getColumnIndex(e,t,n,r){if(!t||null===t)return e.getColumnIndex(n,r,!0);const o=e.getColumnIndex(n,r,!1);return-1===o?t.getColumnIndex(n,r,!0)+e.getSize():(t.getColumnIndex(n,r,!1),o)}static _getType(e,t,n){return n>=e.getSize()?t.getType(n-e.getSize()):e.getType(n)}}class u extends s{constructor(e,t,n){super(),this._func=t,this._dataType=e,this._dataTypeCalculated=null,this._args=n||[]}evaluate(e,t,n,r){switch(this._dataType){case"string":return this._evaluateString(e,t,n,r);case"number":return this._evaluateNumber(e,t,n,r);case"boolean":return this._evaluateBoolean(e,t,n,r);case"date":return this._evaluateDate(e,t,n,r);case"null":return this._evaluateNull(e,t,n,r);default:throw new Error("this should not happen!")}}_parseIsoDate(e){const t=/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$/.exec(e);if(null===t)throw new r.a(i.a("db.messages.exec.error-invalid-date-format",{str:e}),this._codeInfo);const n=parseInt(t[1],10),o=parseInt(t[2],10)-1,a=parseInt(t[3],10),s=new Date(n,o,a);return s.getFullYear()===n&&s.getMonth()===o&&s.getDate()===a||this.throwExecutionError(i.a("db.messages.exec.error-invalid-date-format",{str:e})),s}_evaluateNull(e,t,n,r){switch(this._func){case"constant":return null;case"coalesce":for(let o=0;o1&&this._args[1].evaluate(e,t,n,r),null===o||this._args.length>1&&null===i)return null;switch(this._func){case"date":return this._parseIsoDate(o);case"adddate":return new Date(o.getTime()+864e5*i);case"subdate":return new Date(o.getTime()-864e5*i);default:throw new Error("this should not happen!")}}_checkDate(e,t){switch(this._func){case"transaction_timestamp":case"statement_timestamp":case"clock_timestamp":case"now":return!0;case"date":return this._checkArgsDataType(e,t,["string"]);case"adddate":case"subdate":return this._checkArgsDataType(e,t,["date","number"]);default:throw new Error("this should not happen!")}}_evaluateBoolean(e,t,n,r){let o,i,a;if("constant"===this._func)return this._args[0];switch(o=this._args[0].evaluate(e,t,n,r),i=this._args.length>1&&this._args[1].evaluate(e,t,n,r),this._func){case"not":return"unknown"===o?o:!o;case"and":return!1!==o&&!1!==i&&(!0===o&&!0===i||"unknown");case"or":return!0===o||!0===i||(!1!==o||!1!==i)&&"unknown";case"xor":return"unknown"===o||"unknown"===i?"unknown":o!==i;case"=":case">=":case"<=":case">":case"<":case"!=":return a=this._args[0].getDataType(),u._condition_compare(o,i,a,this._func);case"like":case"ilike":if(!this._regex)throw new Error("regex should have been set by check");return this._regex.test(o);default:throw new Error("this should not happen!")}}static _condition_compare(e,t,n,r){if(null===e||null===t)switch(r){case"=":case">=":case"<=":return e===t||"unknown";case"<":case">":return e!==t&&"unknown";case"!=":return e!==t;default:throw new Error("unknown operator")}switch(n){case"number":case"string":switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}case"date":switch(r){case"=":return e.getTime()===t.getTime();case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e.getTime()!==t.getTime();default:throw new Error("unknown operator")}case"boolean":if("boolean"!=typeof e||"boolean"!=typeof t)throw new Error("operands have different type");switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}default:throw new Error("unknown type "+n)}}_checkBoolean(e,t){let n,r;switch(this._func){case"constant":return!0;case"not":return this._checkArgsDataType(e,t,["boolean"]);case"and":case"or":case"xor":return this._checkArgsDataType(e,t,["boolean","boolean"]);case"=":case">=":case"<=":case">":case"<":case"!=":return this._args[0].check(e,t),this._args[1].check(e,t),n=this._args[0].getDataType(),r=this._args[1].getDataType(),"null"===n||"null"===r?!0:n===r||(this.throwExecutionError(i.a("db.messages.exec.error-could-not-compare-different-types",{typeA:n,typeB:r})),this._checkArgsDataType(e,t,["boolean","boolean"]));case"like":case"ilike":if(this._args[0].check(e,t),"string"!==this._args[1].getDataType()||"constant"!==this._args[1]._func)return!1;const o=this._args[1]._args[0];let a=String(o).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");a=a.replace(/([^\\]?)_/g,"$1."),a=a.replace(/([^\\]?)%/g,"$1.*");const s="ilike"===this._func?"i":"";this._regex=new RegExp("^"+a+"$",s);break;default:throw new Error("this should not happen!")}}_evaluateString(e,t,n,r){switch(this._func){case"constant":return this._args[0];case"lower":case"upper":const o=this._args[0].evaluate(e,t,n,r);return null===o?null:"lower"===this._func?o.toLowerCase():o.toUpperCase();case"concat":let i="";for(let o=0;o0?this._args[0].evaluate(e,t,n,r):void 0,i=this._args.length>1?this._args[1].evaluate(e,t,n,r):void 0;switch(this._func){case"add":return null===o||null===i?null:o+i;case"sub":return null===o||null===i?null:o-i;case"mul":return null===o||null===i?null:o*i;case"div":return null===o||null===i?null:o/i;case"mod":return null===o||null===i?null:o%i;case"abs":return null===o?null:Math.abs(o);case"floor":return null===o?null:Math.floor(o);case"ceil":return null===o?null:Math.ceil(o);case"round":return null===o?null:Math.round(o);case"minus":return null===o?null:-o;case"rand":return Math.random();case"rownum":return n+1;case"strlen":return null===o?null:o.length;case"year":return null===o?null:o.getFullYear();case"month":return null===o?null:o.getMonth()+1;case"dayofmonth":return null===o?null:o.getDate();case"hour":return null===o?null:o.getHours();case"minute":return null===o?null:o.getMinutes();case"second":return null===o?null:o.getSeconds();default:throw new Error("this should not happen!")}}_checkArgsDataType(e,t,n){const r=[];if(this._args.length!==n.length)throw new Error("this should not happen: #args != #types");for(let o=0;o{let t=(e||this._func)+"(";for(let e=0;e{let t="CASE";for(let n=0;n{let t="";return t+=` ${e||this._func} `,t=this._args[0].getFormulaHtml()+t,t+=this._args[1].getFormulaHtml(),`${t}`};function r(){const{_func:r}=this;switch(r){case"constant":return a(this._args[0],this._dataTypeCalculated||this._dataType);case"rand":case"rownum":case"abs":case"ceil":case"floor":case"round":case"year":case"month":case"dayofmonth":case"hour":case"minute":case"second":case"adddate":case"subdate":case"concat":case"upper":case"lower":case"date":case"strlen":return e.call(this,"length");case"minus":return e.call(this,"-");case"not":return e.call(this,"!");case"caseWhen":case"caseWhenElse":return t.call(this,"caseWhenElse"===this._func);case"add":return n.call(this,"+");case"sub":return n.call(this,"-");case"mul":return n.call(this,"*");case"div":return n.call(this,"/");case"mod":return n.call(this,"%");case"and":case"or":case"xor":case"like":case"ilike":case"=":return n.call(this,r);case">=":return n.call(this,"≥");case"<=":return n.call(this,"≤");case">":return n.call(this,">");case"<":return n.call(this,"<");case"!=":return n.call(this,"≠")}return this.toString()}return!0===this._wrappedInParentheses?`(${r.call(this)})`:r.call(this).toString()}}},"./src/db/parser/grammar_ra.pegjs":function(e,t,n){"use strict";function r(e,t,n,o){this.message=e,this.expected=t,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;t",!1),re=(pr("ψ",!1),pr("psi",!0),pr("τ",!1)),oe=function(){return ri("tau")},ie=pr("tau",!0),ae=pr("γ",!1),se=function(){return ri("gamma")},le=pr("gamma",!0),ue=pr("∪",!1),ce=function(){return ri("unionOperator")},de=pr("union",!0),he=pr("∩",!1),fe=function(){return ri("intersectOperator")},me=pr("intersect",!0),pe=pr("÷",!1),ge=pr("/",!1),ye=pr("\\",!1),be=function(){return ri("differenceOperator")},ve=pr("except",!0),_e=pr("⨯",!1),we=pr("x",!1),Ee=function(){return ri("crossJoinOperator")},je=pr("cross",!0),Ce=pr("join",!0),Se=pr("⨝",!1),Oe=pr("⋈",!1),ke=function(){return ri("innerJoinOperator")},Te=pr("inner",!0),Me=function(){return ri("naturalJoinOperator")},xe=pr("natural",!0),Le=pr("⋉",!1),Re=function(){return ri("leftSemiJoinOperator")},Ae=pr("left",!0),De=pr("semi",!0),Ne=pr("⋊",!1),Pe=function(){return ri("rightSemiJoinOperator")},Ie=pr("right",!0),He=pr("▷",!1),Ye=function(){return ri("antiJoinOperator")},Fe=pr("anti",!0),We=pr("⟕",!1),Be=function(){return ri("leftOuterJoinOperator")},Ue=pr("outer",!0),ze=pr("⟖",!1),Ve=function(){return ri("rightOuterJoinOperator")},qe=pr("⟗",!1),Ge=function(){return ri("fullOuterJoinOperator")},Ke=pr("full",!0),Xe=pr(",",!1),$e=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Je=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Qe=pr("asc",!0),Ze=pr("desc",!0),et=pr("sum",!0),tt=pr("count",!0),nt=pr("avg",!0),rt=pr("min",!0),ot=pr("max",!0),it=pr("(",!1),at=pr(")",!1),st=pr("count(*)",!0),lt=function(e){for(var t=[],n=0;n"group"===e.name);if(!r)continue;const o=r.text;t[o]&&mr(ei("db.messages.parser.error-group-non-unique-group-name",{name:o})),t[o]=!0}}(t),{type:"groupRoot",groups:t,codeInfo:ti()}},ut=pr("en",!1),ct=pr("de",!1),dt=pr("es",!1),ht=/^[a-z@]/,ft=gr([["a","z"],"@"],!1,!1),mt=pr(":",!1),pt=/^[a-z]/,gt=gr([["a","z"]],!1,!1),yt=pr("@",!1),bt=pr("[[",!1),vt=pr("\\]]",!1),_t=pr("]]",!1),wt=function(e,t){return function(e,t){var n,r=t[0];r.child=e,r.codeInfo=ni(r.child.codeInfo,r.codeInfo);for(var o=1;o",!1),kt=pr(">=",!1),Tt=pr("≥",!1),Mt=pr(">",!1),xt=pr("<=",!1),Lt=pr("≤",!1),Rt=pr("<",!1),At=yr("logical AND"),Dt=pr("and",!0),Nt=pr("∧",!1),Pt=yr("logical XOR"),It=pr("xor",!0),Ht=pr("⊻",!1),Yt=pr("⊕",!1),Ft=yr("logical OR"),Wt=pr("or",!0),Bt=pr("∨",!1),Ut=yr("logical NOT"),zt=pr("!",!1),Vt=pr("¬",!1),qt=yr("delimiter"),Gt=pr("string",!0),Kt=pr("number",!0),Xt=pr("date",!0),$t=pr("boolean",!0),Jt=pr("null",!1),Qt=pr("NULL",!1),Zt=pr("}",!1),en=/^[\-_a-z0-9.]/i,tn=gr(["-","_",["a","z"],["0","9"],"."],!1,!0),nn=function(e){return{type:"string",value:e,quoted:!0}},rn=pr('"',!1),on=/^[^"\n]/,an=gr(['"',"\n"],!0,!1),sn=pr("{",!1),ln=yr("boolean expression"),un=pr("||",!1),cn=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:ti()}},dn=pr("like",!0),hn=pr("ilike",!0),fn=pr("+",!1),mn=pr("*",!1),pn=pr("%",!1),gn=pr("coalesce",!0),yn=pr("concat",!0),bn=pr("adddate",!0),vn=pr("subdate",!0),_n=pr("mod",!0),wn=pr("add",!0),En=pr("sub",!0),jn=pr("mul",!0),Cn=pr("div",!0),Sn=pr("upper",!0),On=pr("ucase",!0),kn=pr("lower",!0),Tn=pr("lcase",!0),Mn=pr("length",!0),xn=pr("abs",!0),Ln=pr("floor",!0),Rn=pr("ceil",!0),An=pr("round",!0),Dn=pr("year",!0),Nn=pr("month",!0),Pn=pr("day",!0),In=pr("hour",!0),Hn=pr("minute",!0),Yn=pr("second",!0),Fn=pr("dayofmonth",!0),Wn=pr("rand",!0),Bn=pr("rownum",!0),Un=pr("now",!0),zn=pr("current_timestamp",!0),Vn=pr("transaction_timestamp",!0),qn=pr("statement_timestamp",!0),Gn=pr("clock_timestamp",!0),Kn=pr("sysdate",!0),Xn=pr("null",!0),$n=pr("case",!0),Jn=pr("when",!0),Qn=pr("then",!0),Zn=function(e,t){return{w:e,t:t}},er=pr("else",!0),tr=pr("end",!0),nr=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=ti();for(var o=1;olr&&(lr=ir,ur=[]),ur.push(e))}function wr(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function Er(){var e,t,n=135*ir+0,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=function(){var e,t,n,r,i,a,s=135*ir+57,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o&&(r=Br())!==o&&(i=kr())!==o?(ar=e,t=function(e,t){var n=[t];for(var r in e)n.push(e[r][0]);return oi(n),{type:"relalgRoot",assignments:n,child:null,operatorPositions:si,codeInfo:ti()}}(n,r),e=t):(ir=e,e=o)}else ir=e,e=o;if(e===o)if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?((r=eo())===o&&(r=null),r!==o&&(i=kr())!==o?(ar=e,t=function(e,t){for(var n=[],r=0;rir?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(s)),cr--,n===o?t=void 0:(ir=t,t=o),dr[r]={nextPos:ir,result:t},t)}function Cr(){var t,n=135*ir+3,r=dr[n];return r?(ir=r.nextPos,r.result):("\r\n"===e.substr(ir,2)?(t="\r\n",ir+=2):(t=o,0===cr&&_r(l)),t===o&&(10===e.charCodeAt(ir)?(t="\n",ir++):(t=o,0===cr&&_r(u))),dr[n]={nextPos:ir,result:t},t)}function Sr(){var t,n=135*ir+4,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=135*ir+5,g=dr[p];if(g)return ir=g.nextPos,g.result;cr++,t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d));n!==o?(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o?(i=ir,cr++,(a=Cr())===o&&(a=jr()),cr--,a!==o?(ir=i,i=void 0):i=o,i!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o);if(t===o&&(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o?(r=ir,cr++,(i=Cr())===o&&(i=jr()),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o),t===o))if(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o)if(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o){for(i=ir,a=[],l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);l!==o;)a.push(l),l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);(i=a!==o?e.substring(i,ir):a)!==o?(a=ir,cr++,(l=Cr())===o&&(l=jr()),cr--,l!==o?(ir=a,a=void 0):a=o,a!==o?(ar=t,t=n=i):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;cr--,t===o&&(n=o,0===cr&&_r(c));return dr[p]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u,c=135*ir+6,d=dr[c];if(d)return ir=d.nextPos,d.result;t=ir,"/*"===e.substr(ir,2)?(n="/*",ir+=2):(n=o,0===cr&&_r(m));if(n!==o){for(r=ir,i=[],a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);a!==o;)i.push(a),a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);(r=i!==o?e.substring(r,ir):i)!==o?("*/"===e.substr(ir,2)?(i="*/",ir+=2):(i=o,0===cr&&_r(p)),i!==o?(ar=t,t=n=r):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function Or(){var t,n,r,i,a,s,l,u=135*ir+7,c=dr[u];if(c)return ir=c.nextPos,c.result;for(cr++,t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),cr--,(t=n)===o&&(n=o,0===cr&&_r(g)),dr[u]={nextPos:ir,result:t},t}function kr(){var t,n,r=135*ir+8,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));n!==o;)t.push(n),(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));return cr--,t===o&&(n=o,0===cr&&_r(v)),dr[r]={nextPos:ir,result:t},t}function Tr(){var t,n,r=135*ir+10,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));n!==o;)t.push(n),_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));return cr--,t===o&&(n=o,0===cr&&_r(E)),dr[r]={nextPos:ir,result:t},t}function Mr(){var t,n,r,i=135*ir+12,a=dr[i];if(a)return ir=a.nextPos,a.result;for(t=ir,n=[],(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));r!==o;)n.push(r),(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));return n!==o&&(ar=t,n=""),t=n,dr[i]={nextPos:ir,result:t},t}function xr(){var t,n,r,i,a,s,l=135*ir+14,u=dr[l];if(u)return ir=u.nextPos,u.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseInt(n,10)),t=n,dr[l]={nextPos:ir,result:t},t}function Lr(){var t,n,r,i,a,s,l,u,c=135*ir+15,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;if(a!==o)if(46===e.charCodeAt(ir)?(s=".",ir++):(s=o,0===cr&&_r(x)),s!==o){if(l=[],T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o)for(;u!==o;)l.push(u),T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M));else l=o;l!==o?r=i=[i,a,s,l]:(ir=r,r=o)}else ir=r,r=o;else ir=r,r=o}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseFloat(n)),t=n,dr[c]={nextPos:ir,result:t},t}function Rr(){var t,n,r,i,a,s,l,u,c,d=135*ir+17,h=dr[d];return h?(ir=h.nextPos,h.result):(cr++,t=ir,n=ir,r=ir,T.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(M)),i!==o?(T.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(M)),a!==o?(T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?r=i=[i,a,s,l]:(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o),(n=r!==o?e.substring(n,ir):r)!==o?(45===e.charCodeAt(ir)?(r="-",ir++):(r=o,0===cr&&_r(k)),r!==o?(i=ir,a=ir,T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?a=s=[s,l]:(ir=a,a=o)):(ir=a,a=o),(i=a!==o?e.substring(i,ir):a)!==o?(45===e.charCodeAt(ir)?(a="-",ir++):(a=o,0===cr&&_r(k)),a!==o?(s=ir,l=ir,T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o?(T.test(e.charAt(ir))?(c=e.charAt(ir),ir++):(c=o,0===cr&&_r(M)),c!==o?l=u=[u,c]:(ir=l,l=o)):(ir=l,l=o),(s=l!==o?e.substring(s,ir):l)!==o?(ar=t,t=n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||mr(ei("db.messages.parser.error-invalid-date-format",{str:hr()})),r}(n,i,s)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),cr--,t===o&&(n=o,0===cr&&_r(L)),dr[d]={nextPos:ir,result:t},t)}function Ar(){var t,n,r=135*ir+18,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"true"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(R)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"false"===e.substr(ir,5).toLowerCase()?(n=e.substr(ir,5),ir+=5):(n=o,0===cr&&_r(A)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}function Dr(){var t,n,r,i,a,s,l,u,c=135*ir+20,d=dr[c];if(d)return ir=d.nextPos,d.result;if(cr++,t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return cr--,t===o&&(n=o,0===cr&&_r(N)),dr[c]={nextPos:ir,result:t},t}function Nr(){var t,n,r,i,a,s,l,u,c=135*ir+21,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Pr(){var t,n,r,i,a,s,l,u,c=135*ir+22,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o&&(r=Nr())!==o?(ar=t,u=r,null!=(l=n)&&(l=l[0]),t=n={type:"columnName",name:u,relAlias:l}):(ir=t,t=o),t===o)if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o)if(91===e.charCodeAt(ir)?(r="[",ir++):(r=o,0===cr&&_r(F)),r!==o){if(i=ir,a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;(i=a!==o?e.substring(i,ir):a)!==o?(93===e.charCodeAt(ir)?(a="]",ir++):(a=o,0===cr&&_r(W)),a!==o?(ar=t,t=n=function(e,t){return null!=e&&(e=e[0]),{type:"columnName",name:parseInt(t,10),relAlias:e}}(n,i)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Ir(){var t,n,r,i=135*ir+25,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,961===e.charCodeAt(ir)?(r="ρ",ir++):(r=o,0===cr&&_r(K)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"rho"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r($)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Hr(){var t,n,r,i=135*ir+26,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8592===e.charCodeAt(ir)?(r="←",ir++):(r=o,0===cr&&_r(J)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"<-"===e.substr(ir,2)?(r="<-",ir+=2):(r=o,0===cr&&_r(Z)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Yr(){var t,n,r,i=135*ir+27,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8594===e.charCodeAt(ir)?(r="→",ir++):(r=o,0===cr&&_r(ee)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"->"===e.substr(ir,2)?(r="->",ir+=2):(r=o,0===cr&&_r(ne)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Fr(){var t,n,r,i=135*ir+30,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,947===e.charCodeAt(ir)?(r="γ",ir++):(r=o,0===cr&&_r(ae)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"gamma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(le)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Wr(){var t,n,r,i=135*ir+33,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,247===e.charCodeAt(ir)?(r="÷",ir++):(r=o,0===cr&&_r(pe)),r===o&&(47===e.charCodeAt(ir)?(r="/",ir++):(r=o,0===cr&&_r(ge))),r!==o&&(ar=n,r=ri("divisionOperator")),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),dr[i]={nextPos:ir,result:t},t)}function Br(){var t,n,r,i,a=135*ir+44,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=Dr())!==o?(ar=ir,i=n,(void ai.push(i)?o:void 0)!==o&&function(){var t,n,r,i,a=135*ir+19,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=kr())!==o?(61===e.charCodeAt(ir)?(r="=",ir++):(r=o,0===cr&&_r(D)),r!==o&&(i=kr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}()!==o&&(r=eo())!==o?(ar=t,t=n=function(e,t){return t.assignmentName=e,{type:"assignment",name:e,child:t,codeInfo:ti()}}(n,r)):(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}function Ur(){var e,t,n,r=135*ir+45,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Uo())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t={type:"namedColumnExpr",name:n,relAlias:null,child:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Uo())!==o?(ar=e,e=t=function(e,t){return{type:"namedColumnExpr",name:e,relAlias:null,child:t,codeInfo:ti()}}(t,n)):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&(ar=e,t=t),e=t)),dr[r]={nextPos:ir,result:e},e)}function zr(){var e,t,n,r=135*ir+48,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Pr())!==o?(ar=e,e=t={type:"colAssignment",src:n,dst:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t=function(e,t){return{type:"colAssignment",src:e,dst:t,codeInfo:ti()}}(t,n)):(ir=e,e=o)),dr[r]={nextPos:ir,result:e},e)}function Vr(){var t,n,r,i,a,s,l=135*ir+51,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,(n=Pr())!==o?(r=ir,(i=Or())!==o&&(a=function(){var t,n,r=135*ir+50,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"asc"===e.substr(ir,3).toLowerCase()?(n=e.substr(ir,3),ir+=3):(n=o,0===cr&&_r(Qe)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"desc"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(Ze)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}())!==o?r=i=[i,a]:(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(ir=t,t=o)):(ir=t,t=o),dr[l]={nextPos:ir,result:t},t)}function qr(){var t,n,r,i,a,s,l=135*ir+53,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,n=ir,"sum"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(et)),r===o&&("count"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(tt)),r===o&&("avg"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(nt)),r===o&&("min"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(rt)),r===o&&("max"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ot)))))),(n=r!==o?e.substring(n,ir):r)!==o?(40===e.charCodeAt(ir)?(r="(",ir++):(r=o,0===cr&&_r(it)),r!==o&&kr()!==o&&(i=Pr())!==o&&kr()!==o?(41===e.charCodeAt(ir)?(a=")",ir++):(a=o,0===cr&&_r(at)),a!==o?(ar=t,s=i,t=n={aggFunction:n.toUpperCase(),col:s}):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,"count(*)"===e.substr(ir,8).toLowerCase()?(n=e.substr(ir,8),ir+=8):(n=o,0===cr&&_r(st)),n!==o&&(ar=t,n={aggFunction:"COUNT_ALL",col:null}),t=n),dr[l]={nextPos:ir,result:t},t)}function Gr(){var e,t,n,r,i,a=135*ir+54,s=dr[a];return s?(ir=s.nextPos,s.result):(e=ir,(t=qr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,i=n,(r=t).name=i,e=t=r):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=qr())!==o?(ar=e,e=t=function(e,t){return t.name=e,t}(t,n)):(ir=e,e=o)),dr[a]={nextPos:ir,result:e},e)}function Kr(){var t,n,r,i,a,s,l,u,c=135*ir+55,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Gr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Xr(){var e,t,n=135*ir+56,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=So())!==o&&Or()!==o?(ar=ir,(function(e){if("valueExpr"===e.type&&"columnValue"===e.func&&!e.wrappedInParentheses&&null===e.args[1]){for(var t=0;tir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);c!==o;)u.push(c),c=ir,d=ir,cr++,h=Cr(),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);(l=u!==o?e.substring(l,ir):u)!==o?(ar=t,t=n=function(e,t,n){return{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o;if(t===o){if(t=ir,n=ir,cr++,r=ir,i=[],ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft)),a!==o)for(;a!==o;)i.push(a),ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft));else i=o;if(i!==o?("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),cr--,r!==o?(ir=n,n=void 0):n=o,n!==o){if(r=ir,i=[],pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt)),a!==o)for(;a!==o;)i.push(a),pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt));else i=o;if((r=i!==o?e.substring(r,ir):i)!==o)if(i=ir,64===e.charCodeAt(ir)?(a="@",ir++):(a=o,0===cr&&_r(yt)),a!==o&&(l=Jr())!==o?i=a=[a,l]:(ir=i,i=o),i===o&&(i=null),i!==o)if("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o){for(l=ir,u=[],"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));c!==o;)u.push(c),"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));(l=u!==o?e.substring(l,ir):u)!==o?("]]"===e.substr(ir,2)?(u="]]",ir+=2):(u=o,0===cr&&_r(_t)),u!==o?(ar=t,t=n=function(e,t,n){return n=(n=n.replace(/\\]]/g,"]]")).replace(/\\\\]]/g,"\\]]"),{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o}return dr[f]={nextPos:ir,result:t},t}function Zr(){var e,t,n,r,i,a,s=135*ir+62,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,kr()!==o)if((t=function(){var e,t,n,r,i,a,s,l,u=135*ir+59,c=dr[u];if(c)return ir=c.nextPos,c.result;if(e=ir,(t=Qr())!==o){for(n=[],r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,s=n,(l=[]).push(t),s.map((function(e){var t=e[1];l.push(t)})),e=t=l):(ir=e,e=o)}else ir=e,e=o;return dr[u]={nextPos:ir,result:e},e}())!==o){if(n=[],r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o),r!==o)for(;r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o);else n=o;n!==o?(ar=e,e=function(e,t){for(var n=[],r=0;r"group"===e.name);return void 0===o?mr(ei("db.messages.parser.error-group-header-name-missing")+': "group: ..........\\n"'):0===o.text.trim().length&&mr(ei("error-group-header-name-empty")),{type:"tableGroup",headers:e,assignments:n,codeInfo:ti()}}(t,n)):(ir=e,e=o)}else ir=e,e=o;else ir=e,e=o;return dr[s]={nextPos:ir,result:e},e}function eo(){var e,t,n,r,i=135*ir+63,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=to())!==o){if(n=[],(r=io())===o&&(r=ao()),r!==o)for(;r!==o;)n.push(r),(r=io())===o&&(r=ao());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=to()),dr[i]={nextPos:ir,result:e},e}function to(){var e,t,n,r,i=135*ir+64,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=no())!==o){if(n=[],(r=oo())!==o)for(;r!==o;)n.push(r),r=oo();else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=no()),dr[i]={nextPos:ir,result:e},e}function no(){var e,t,n,r,i=135*ir+65,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=ro())!==o){if(n=[],(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo()),r!==o)for(;r!==o;)n.push(r),(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=ro()),dr[i]={nextPos:ir,result:e},e}function ro(){var t,n=135*ir+66,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a=135*ir+86,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+29,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,964===e.charCodeAt(ir)?(r="τ",ir++):(r=o,0===cr&&_r(re)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"tau"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ie)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+52,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Vr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"orderBy",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+85,c=dr[u];if(c)return ir=c.nextPos,c.result;t=ir,(n=Fr())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+47,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Pr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o&&kr()!==o&&(s=Kr())!==o&&Or()!==o&&(l=ro())!==o?(ar=t,d=n,h=r,f=s,m=l,si.push(d),n={type:"groupBy",child:m,group:h,aggregate:f,codeInfo:ti()},t=n):(ir=t,t=o)):(ir=t,t=o);var d,h,f,m;t===o&&(t=ir,(n=Fr())!==o?(r=ir,(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o&&(i=kr())!==o&&(a=Kr())!==o&&Or()!==o&&(s=ro())!==o?(ar=t,n=function(e,t,n){return si.push(e),{type:"groupBy",child:n,group:[],aggregate:t,codeInfo:ti()}}(n,a,s),t=n):(ir=t,t=o)):(ir=t,t=o));return dr[u]={nextPos:ir,result:t},t}())===o&&(t=function(){var e,t,n,r,i=135*ir+84,a=dr[i];if(a)return ir=a.nextPos,a.result;e=ir,(t=Ir())!==o&&(n=Dr())!==o&&Or()!==o&&(r=ro())!==o?(ar=e,s=t,l=n,u=r,si.push(s),t={type:"renameRelation",child:u,newRelAlias:l,codeInfo:ti()},e=t):(ir=e,e=o);var s,l,u;return dr[i]={nextPos:ir,result:e},e}())===o&&(t=function(){var t,n,r,i,a=135*ir+83,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=Ir())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+49,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=zr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"renameColumns",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+82,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+24,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,963===e.charCodeAt(ir)?(r="σ",ir++):(r=o,0===cr&&_r(V)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"sigma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(G)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=So())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"selection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+81,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+23,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,960===e.charCodeAt(ir)?(r="π",ir++):(r=o,0===cr&&_r(B)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"pi"===e.substr(ir,2).toLowerCase()?(r=e.substr(ir,2),ir+=2):(r=o,0===cr&&_r(z)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+46,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Ur())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"projection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+67,s=dr[a];if(s)return ir=s.nextPos,s.result;(t=function(){var t,n,r,i,a,s,l,u,c,d=135*ir+105,h=dr[d];if(h)return ir=h.nextPos,h.result;t=ir,123===e.charCodeAt(ir)?(n="{",ir++):(n=o,0===cr&&_r(sn));if(n!==o)if(kr()!==o)if((r=function(){var e,t,n,r,i,a,s=135*ir+103,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=Eo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,t=function(e,t){for(var n,r=[e],o=0;o="===e.substr(ir,2)?(n=">=",ir+=2):(n=o,0===cr&&_r(kt));n===o&&(8805===e.charCodeAt(ir)?(n="≥",ir++):(n=o,0===cr&&_r(Tt)));n!==o&&(ar=t,n=">=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r=135*ir+94,i=dr[r];if(i)return ir=i.nextPos,i.result;t=ir,"<="===e.substr(ir,2)?(n="<=",ir+=2):(n=o,0===cr&&_r(xt));n===o&&(8804===e.charCodeAt(ir)?(n="≤",ir++):(n=o,0===cr&&_r(Lt)));n!==o&&(ar=t,n="<=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+93,r=dr[n];if(r)return ir=r.nextPos,r.result;62===e.charCodeAt(ir)?(t=">",ir++):(t=o,0===cr&&_r(Mt));return dr[n]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+95,r=dr[n];if(r)return ir=r.nextPos,r.result;60===e.charCodeAt(ir)?(t="<",ir++):(t=o,0===cr&&_r(Rt));return dr[n]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function vo(){var t,n=135*ir+90,r=dr[n];return r?(ir=r.nextPos,r.result):(61===e.charCodeAt(ir)?(t="=",ir++):(t=o,0===cr&&_r(D)),dr[n]={nextPos:ir,result:t},t)}function _o(){var t,n,r=135*ir+91,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"!="===e.substr(ir,2)?(n="!=",ir+=2):(n=o,0===cr&&_r(Ct)),n===o&&(8800===e.charCodeAt(ir)?(n="≠",ir++):(n=o,0===cr&&_r(St)),n===o&&("<>"===e.substr(ir,2)?(n="<>",ir+=2):(n=o,0===cr&&_r(Ot)))),n!==o&&(ar=t,n="!="),t=n,dr[r]={nextPos:ir,result:t},t)}function wo(){var t,n,r,i,a=135*ir+100,s=dr[a];return s?(ir=s.nextPos,s.result):(cr++,t=ir,(n=Mr())!==o?(44===e.charCodeAt(ir)?(r=",",ir++):(r=o,0===cr&&_r(Xe)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,(n=Mr())!==o?(59===e.charCodeAt(ir)?(r=";",ir++):(r=o,0===cr&&_r(jt)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+11,c=dr[u];if(c)return ir=c.nextPos,c.result;for(t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),t=n,dr[u]={nextPos:ir,result:t},t}())),cr--,t===o&&(n=o,0===cr&&_r(qt)),dr[a]={nextPos:ir,result:t},t)}function Eo(){var t,n,r,i,a,s,l,u=135*ir+101,c=dr[u];return c?(ir=c.nextPos,c.result):(t=ir,(n=Pr())!==o?(r=ir,58===e.charCodeAt(ir)?(i=":",ir++):(i=o,0===cr&&_r(mt)),i!==o?("string"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Gt)),a===o&&("number"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Kt)),a===o&&("date"===e.substr(ir,4).toLowerCase()?(a=e.substr(ir,4),ir+=4):(a=o,0===cr&&_r(Xt)),a===o&&("boolean"===e.substr(ir,7).toLowerCase()?(a=e.substr(ir,7),ir+=7):(a=o,0===cr&&_r($t))))),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,l=r,t=n={name:(s=n).name,relAlias:s.relAlias,type:null===l?null:l[1].toLowerCase()}):(ir=t,t=o)):(ir=t,t=o),dr[u]={nextPos:ir,result:t},t)}function jo(){var t,n,r,i,a,s=135*ir+102,l=dr[s];if(l)return ir=l.nextPos,l.result;if(t=ir,(n=Rr())!==o&&(ar=t,n={type:"date",value:n}),(t=n)===o&&(t=ir,"null"===e.substr(ir,4)?(n="null",ir+=4):(n=o,0===cr&&_r(Jt)),n===o&&("NULL"===e.substr(ir,4)?(n="NULL",ir+=4):(n=o,0===cr&&_r(Qt))),n!==o&&(ar=t,n={type:"null",value:null}),(t=n)===o&&(t=ir,(n=Ar())!==o?(r=ir,cr++,(i=wo())===o&&(i=Cr())===o&&(125===e.charCodeAt(ir)?(i="}",ir++):(i=o,0===cr&&_r(Zt))),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n={type:"boolean",value:n,quoted:!1}):(ir=t,t=o)):(ir=t,t=o),t===o))){if(t=ir,n=ir,r=[],en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn)),i!==o)for(;i!==o;)r.push(i),en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn));else r=o;if((n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=function(e){return{type:"string",value:e,quoted:!1}}(n)),(t=n)===o){if(t=ir,39===e.charCodeAt(ir)?(n="'",ir++):(n=o,0===cr&&_r(C)),n!==o){for(r=ir,i=[],S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));a!==o;)i.push(a),S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));(r=i!==o?e.substring(r,ir):i)!==o?(39===e.charCodeAt(ir)?(i="'",ir++):(i=o,0===cr&&_r(C)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;if(t===o)if(t=ir,34===e.charCodeAt(ir)?(n='"',ir++):(n=o,0===cr&&_r(rn)),n!==o){for(r=ir,i=[],on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));a!==o;)i.push(a),on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));(r=i!==o?e.substring(r,ir):i)!==o?(34===e.charCodeAt(ir)?(i='"',ir++):(i=o,0===cr&&_r(rn)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o}}return dr[s]={nextPos:ir,result:t},t}function Co(){var e,t,n,r,i,a,s=135*ir+104,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=jo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,e=t=function(e,t){for(var n=[e],r=0;r0){for(t=1,r=1;t",!1),qe=Qn("!=",!1),Ge=Qn(">=",!1),Ke=Qn(">",!1),Xe=Qn("<=",!1),$e=Qn("<",!1),Je=er("logical AND"),Qe=Qn("and",!0),Ze=er("logical XOR"),et=Qn("xor",!0),tt=er("logical OR"),nt=Qn("or",!0),rt=er("logical NOT"),ot=Qn("!",!1),it=(Qn("not",!1),Qn("exists",!0)),at=Qn("#",!1),st=/^[^\n]/,lt=Zn(["\n"],!0,!1),ut=Qn("`",!1),ct=Qn("drop",!0),dt=Qn("table",!0),ht=Qn("if",!0),ft=Qn("lock",!0),mt=Qn("tables",!0),pt=Qn("unlock",!0),gt=Qn("use",!0),yt=/^[a-zA-Z_0-9\-]/,bt=Zn([["a","z"],["A","Z"],"_",["0","9"],"-"],!1,!1),vt=Qn("decimal",!0),_t=Qn("tinyint",!0),wt=Qn("smallint",!0),Et=Qn("mediumint",!0),jt=Qn("bigint",!0),Ct=Qn("integer",!0),St=Qn("int",!0),Ot=Qn("float",!0),kt=Qn("double",!0),Tt=Qn("varchar",!0),Mt=Qn("char",!0),xt=Qn("text",!0),Lt=Qn("datetime",!0),Rt=/^[a-zA-Z0-9_=]/,At=Zn([["a","z"],["A","Z"],["0","9"],"_","="],!1,!1),Dt=Qn("create",!0),Nt=Qn("exists",!1),Pt=Qn("null",!0),It=Qn("insert",!0),Ht=Qn("into",!0),Yt=Qn("values",!0),Ft=er("boolean expression"),Wt=Qn("||",!1),Bt=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:No()}},Ut=Qn("like",!0),zt=Qn("ilike",!0),Vt=Qn("+",!1),qt=Qn("/",!1),Gt=Qn("%",!1),Kt=Qn("coalesce",!0),Xt=Qn("concat",!0),$t=Qn("adddate",!0),Jt=Qn("subdate",!0),Qt=Qn("mod",!0),Zt=Qn("add",!0),en=Qn("sub",!0),tn=Qn("mul",!0),nn=Qn("div",!0),rn=Qn("upper",!0),on=Qn("ucase",!0),an=Qn("lower",!0),sn=Qn("lcase",!0),ln=Qn("length",!0),un=Qn("abs",!0),cn=Qn("floor",!0),dn=Qn("ceil",!0),hn=Qn("round",!0),fn=Qn("year",!0),mn=Qn("month",!0),pn=Qn("day",!0),gn=Qn("hour",!0),yn=Qn("minute",!0),bn=Qn("second",!0),vn=Qn("dayofmonth",!0),_n=Qn("rand",!0),wn=Qn("rownum",!0),En=Qn("now",!0),jn=Qn("current_timestamp",!0),Cn=Qn("transaction_timestamp",!0),Sn=Qn("statement_timestamp",!0),On=Qn("clock_timestamp",!0),kn=Qn("sysdate",!0),Tn=Qn("case",!0),Mn=Qn("when",!0),xn=Qn("then",!0),Ln=function(e,t){return{w:e,t:t}},Rn=Qn("else",!0),An=Qn("end",!0),Dn=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=No();for(var o=1;oqn&&(qn=Un,Gn=[]),Gn.push(e))}function or(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function ir(){var e,t,n,r=113*Un+0,i=Xn[r];return i?(Un=i.nextPos,i.result):(e=Un,(t=kr())!==o&&(zn=e,t=t),(e=t)===o&&(e=Un,(t=kr())!==o&&(n=ur())!==o?(zn=e,e=t=t):(Un=e,e=o),e===o&&(e=Un,(t=ur())!==o&&(n=kr())!==o?(zn=e,e=t=n):(Un=e,e=o))),Xn[r]={nextPos:Un,result:e},e)}function ar(){var t,n,r=113*Un+2,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,Kn++,e.length>Un?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(s)),Kn--,n===o?t=void 0:(Un=t,t=o),Xn[r]={nextPos:Un,result:t},t)}function sr(){var t,n=113*Un+3,r=Xn[n];return r?(Un=r.nextPos,r.result):("\r\n"===e.substr(Un,2)?(t="\r\n",Un+=2):(t=o,0===Kn&&rr(l)),t===o&&(10===e.charCodeAt(Un)?(t="\n",Un++):(t=o,0===Kn&&rr(u))),Xn[n]={nextPos:Un,result:t},t)}function lr(){var t,n=113*Un+4,r=Xn[n];return r?(Un=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=113*Un+5,g=Xn[p];if(g)return Un=g.nextPos,g.result;Kn++,t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d));n!==o?(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o?(i=Un,Kn++,(a=sr())===o&&(a=ar()),Kn--,a!==o?(Un=i,i=void 0):i=o,i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);if(t===o&&(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o?(r=Un,Kn++,(i=sr())===o&&(i=ar()),Kn--,i!==o?(Un=r,r=void 0):r=o,r!==o?t=n=[n,r]:(Un=t,t=o)):(Un=t,t=o),t===o))if(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o)if(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o){for(i=Un,a=[],l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);l!==o;)a.push(l),l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);(i=a!==o?e.substring(i,Un):a)!==o?(a=Un,Kn++,(l=sr())===o&&(l=ar()),Kn--,l!==o?(Un=a,a=void 0):a=o,a!==o?t=n=[n,r,i,a]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;Kn--,t===o&&(n=o,0===Kn&&rr(c));return Xn[p]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u=113*Un+6,c=Xn[u];if(c)return Un=c.nextPos,c.result;t=Un,"/*"===e.substr(Un,2)?(n="/*",Un+=2):(n=o,0===Kn&&rr(m));if(n!==o){for(r=[],i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);r!==o?("*/"===e.substr(Un,2)?(i="*/",Un+=2):(i=o,0===Kn&&rr(p)),i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Xn[u]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function ur(){var t,n,r,i,a,s,l,u=113*Un+7,c=Xn[u];if(c)return Un=c.nextPos,c.result;for(Kn++,t=Un,n=[],r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o}else n=o;return n!==o&&(zn=t,n=""),Kn--,(t=n)===o&&(n=o,0===Kn&&rr(g)),Xn[u]={nextPos:Un,result:t},t}function cr(){var t,n,r=113*Un+8,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));n!==o;)t.push(n),(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));return Kn--,t===o&&(n=o,0===Kn&&rr(v)),Xn[r]={nextPos:Un,result:t},t}function dr(){var t,n,r=113*Un+9,i=Xn[r];if(i)return Un=i.nextPos,i.result;if(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E)),n!==o)for(;n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));else t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(_)),Xn[r]={nextPos:Un,result:t},t}function hr(){var t,n,r=113*Un+10,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));return Kn--,t===o&&(n=o,0===Kn&&rr(j)),Xn[r]={nextPos:Un,result:t},t}function fr(){var t,n,r,i,a,s=113*Un+11,l=Xn[s];if(l)return Un=l.nextPos,l.result;if(Kn++,t=Un,34===e.charCodeAt(Un)?(n='"',Un++):(n=o,0===Kn&&rr(S)),n!==o){for(r=[],O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));i!==o;)r.push(i),O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));r!==o?(34===e.charCodeAt(Un)?(i='"',Un++):(i=o,0===Kn&&rr(S)),i!==o?(zn=t,t=n=void Jn(i18n.t("db.messages.parser.error-sql-string-use-single-quotes"))):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;if(t===o)if(t=Un,39===e.charCodeAt(Un)?(n="'",Un++):(n=o,0===Kn&&rr(T)),n!==o){for(r=Un,i=[],M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));a!==o;)i.push(a),M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));(r=i!==o?e.substring(r,Un):i)!==o?(39===e.charCodeAt(Un)?(i="'",Un++):(i=o,0===Kn&&rr(T)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(C)),Xn[s]={nextPos:Un,result:t},t}function mr(){var t,n,r,i,a,s,l=113*Un+12,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(L)),i===o&&(i=null),i!==o){if(a=[],R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseInt(n,10)),t=n,Xn[l]={nextPos:Un,result:t},t}function pr(){var t,n,r,i,a,s,l,u,c=113*Un+13,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(L)),i===o&&(i=null),i!==o){if(a=[],R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;if(a!==o)if(46===e.charCodeAt(Un)?(s=".",Un++):(s=o,0===Kn&&rr(D)),s!==o){if(l=[],R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o)for(;u!==o;)l.push(u),R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A));else l=o;l!==o?r=i=[i,a,s,l]:(Un=r,r=o)}else Un=r,r=o;else Un=r,r=o}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseFloat(n)),t=n,Xn[c]={nextPos:Un,result:t},t}function gr(){var e,t=113*Un+14,n=Xn[t];return n?(Un=n.nextPos,n.result):((e=pr())===o&&(e=mr()),Xn[t]={nextPos:Un,result:e},e)}function yr(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+16,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(Kn++,t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-relation-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(I)),Xn[h]={nextPos:Un,result:t},t}function br(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+17,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-column-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Xn[h]={nextPos:Un,result:t},t}function vr(){var t,n,r,i,a,s=113*Un+19,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,"date"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(B)),n!==o?("('"===e.substr(Un,2)?(r="('",Un+=2):(r=o,0===Kn&&rr(U)),r!==o&&(i=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+20,h=Xn[d];if(h)return Un=h.nextPos,h.result;Kn++,t=Un,n=Un,r=Un,R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));i!==o?(R.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(A)),a!==o?(R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(R.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o);n=r!==o?e.substring(n,Un):r;n!==o?(45===e.charCodeAt(Un)?(r="-",Un++):(r=o,0===Kn&&rr(L)),r!==o?(i=Un,a=Un,R.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(R.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),(i=a!==o?e.substring(i,Un):a)!==o?(45===e.charCodeAt(Un)?(a="-",Un++):(a=o,0===Kn&&rr(L)),a!==o?(s=Un,l=Un,R.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o?(R.test(e.charAt(Un))?(c=e.charAt(Un),Un++):(c=o,0===Kn&&rr(A)),c!==o?l=u=[u,c]:(Un=l,l=o)):(Un=l,l=o),(s=l!==o?e.substring(s,Un):l)!==o?(zn=t,n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||Jn(i18n.t("db.messages.parser.error-invalid-date-format",{str:$n()})),r}(n,i,s),t=n):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);Kn--,t===o&&(n=o,0===Kn&&rr(V));return Xn[d]={nextPos:Un,result:t},t}())!==o?("')"===e.substr(Un,2)?(a="')",Un+=2):(a=o,0===Kn&&rr(z)),a!==o?(zn=t,t=n=i):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function _r(){var t,n,r,i,a,s=113*Un+21,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o&&(r=br())!==o?(zn=t,t=n={type:"column",name:r,relAlias:(a=n)?a[0]:null}):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function wr(){var t,n,r,i,a=113*Un+23,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,n=Un,r=[],R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A)),i!==o)for(;i!==o;)r.push(i),R.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));else r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n={type:"column",name:parseInt(n,10),relAlias:null}),t=n,Xn[a]={nextPos:Un,result:t},t}function Er(){var t,n,r,i,a,s,l,u,c=113*Un+24,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,n=Un,"sum"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(G)),r===o&&("count"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(K)),r===o&&("avg"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(X)),r===o&&("min"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr($)),r===o&&("max"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(J)))))),(n=r!==o?e.substring(n,Un):r)!==o?(40===e.charCodeAt(Un)?(r="(",Un++):(r=o,0===Kn&&rr(Q)),r!==o&&cr()!==o?(i=Un,"all"===e.substr(Un,3).toLowerCase()?(a=e.substr(Un,3),Un+=3):(a=o,0===Kn&&rr(Z)),a!==o&&(s=ur())!==o?i=a=[a,s]:(Un=i,i=o),i===o&&(i=null),i!==o&&(a=_r())!==o&&(s=cr())!==o?(41===e.charCodeAt(Un)?(l=")",Un++):(l=o,0===Kn&&rr(ee)),l!==o?(zn=t,u=a,t=n={type:"aggFunction",aggFunction:n.toUpperCase(),col:u}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,"count(*)"===e.substr(Un,8).toLowerCase()?(n=e.substr(Un,8),Un+=8):(n=o,0===Kn&&rr(te)),n!==o&&(zn=t,n={type:"aggFunction",aggFunction:"COUNT_ALL",col:null}),t=n),Xn[c]={nextPos:Un,result:t},t)}function jr(){var t,n,r,i,a,s,l,u,c=113*Un+25,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=Er())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,s=i,(a=n).name=s,t=n=a):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Er())!==o&&cr()!==o?(zn=t,t=n=void Jn("aggregation columns must be named")):(Un=t,t=o),t===o&&(t=Un,(n=function(){var t,n,r,i,a,s=113*Un+22,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o?(42===e.charCodeAt(Un)?(r="*",Un++):(r=o,0===Kn&&rr(q)),r!==o?(zn=t,t=n={type:"column",name:"*",relAlias:(a=n)?a[0]:null}):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}())!==o&&(zn=t,n=re(n)),(t=n)===o&&(t=Un,(n=_r())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,u=i,(l=n).alias=u,t=n=l):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Co())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,t=n=function(e,t){return{type:"namedColumnExpr",name:t,relAlias:null,child:e,codeInfo:No()}}(n,i)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=_r())!==o&&(zn=t,n=re(n)),t=n))))),Xn[c]={nextPos:Un,result:t},t)}function Cr(){var t,n,r,i,a,s,l=113*Un+29,u=Xn[l];return u?(Un=u.nextPos,u.result):(t=Un,(n=_r())===o&&(n=wr()),n!==o?(r=Un,(i=ur())!==o&&(a=function(){var t,n,r=113*Un+28,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,"asc"===e.substr(Un,3).toLowerCase()?(n=e.substr(Un,3),Un+=3):(n=o,0===Kn&&rr(ie)),n!==o&&(zn=t,n=!0),(t=n)===o&&(t=Un,"desc"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ae)),n!==o&&(zn=t,n=!1),t=n),Xn[r]={nextPos:Un,result:t},t)}())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(Un=t,t=o)):(Un=t,t=o),Xn[l]={nextPos:Un,result:t},t)}function Sr(){var t,n,r,i,a,s,l,u,c=113*Un+30,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,(n=Cr())!==o){for(r=[],i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);r!==o?(zn=t,t=n=function(e,t){var n=[e];if(null!=t)for(var r in t)n.push(t[r][3]);return{value:n,codeInfo:No()}}(n,r)):(Un=t,t=o)}else Un=t,t=o;return Xn[c]={nextPos:Un,result:t},t}function Or(){var t,n,r,i,a,s,l,u,c=113*Un+32,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=yr())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&cr()!==o?(40===e.charCodeAt(Un)?(i="(",Un++):(i=o,0===Kn&&rr(Q)),i!==o&&(a=xr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,l=n,(u=a).wrappedInParentheses=!0,t=n={type:"assignment",name:l,child:{type:"relationFromSubstatement",statement:u,relAlias:l,codeInfo:No()},codeInfo:No()}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function kr(){var t,n,r,i,a=113*Un+33,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,(n=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+34,h=Xn[d];if(h)return Un=h.nextPos,h.result;t=Un,"with"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ue));if(n!==o)if(ur()!==o)if((r=Or())!==o){for(i=[],a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);a!==o;)i.push(a),a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);i!==o?(zn=t,n=function(e,t){for(var n=[e],r=0;r0&&i!=e.arg.length&&null===r&&Jn(i18n.t("db.messages.parser.error-sql-group-by-missing")),o&&!r&&0===i&&Jn(i18n.t("db.messages.parser.error-sql-having-without-group-by")),{type:"statement",select:e,from:t,where:n?n[1]:null,groupBy:r?r[5]:null,having:o?o[1]:null,numAggregationColumns:i,wrappedInParentheses:!1,codeInfo:No()}}(n,i,a,s,l)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&cr()!==o&&(r=xr())!==o&&cr()!==o?(41===e.charCodeAt(Un)?(i=")",Un++):(i=o,0===Kn&&rr(ee)),i!==o?(zn=t,t=n=ye(r)):(Un=t,t=o)):(Un=t,t=o)),Xn[m]={nextPos:Un,result:t},t)}function Dr(){var t,n,r,i,a=113*Un+41,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("union"===e.substr(Un,5).toLowerCase()?(n=e.substr(Un,5),Un+=5):(n=o,0===Kn&&rr(be)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"union",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Nr(){var t,n,r,i,a=113*Un+42,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("except"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(_e)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"except",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Pr(){var t,n,r,i,a=113*Un+43,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("intersect"===e.substr(Un,9).toLowerCase()?(n=e.substr(Un,9),Un+=9):(n=o,0===Kn&&rr(we)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Rr())!==o?(zn=t,t={type:"intersect",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Ir(){var e,t,n,r,i=113*Un+44,a=Xn[i];if(a)return Un=a.nextPos,a.result;if(e=Un,(t=Hr())!==o){if(n=[],(r=Yr())===o&&(r=Fr())===o&&(r=Wr()),r!==o)for(;r!==o;)n.push(r),(r=Yr())===o&&(r=Fr())===o&&(r=Wr());else n=o;n!==o?(zn=e,e=t=me(t,n)):(Un=e,e=o)}else Un=e,e=o;return e===o&&(e=Hr()),Xn[i]={nextPos:Un,result:e},e}function Hr(){var t,n,r,i,a,s,l,u,c,d,h,f=113*Un+45,m=Xn[f];return m?(Un=m.nextPos,m.result):(t=Un,(n=yr())!==o?(r=Un,(i=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ne)),a!==o&&(s=ur())!==o&&(l=yr())!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,d=r,h={type:"relation",name:n,relAlias:null,codeInfo:No()},t=n=null!==d?{type:"renameRelation",child:h,newRelAlias:d[3],codeInfo:No()}:h):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=xr())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o&&(l=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(u=e.substr(Un,2),Un+=2):(u=o,0===Kn&&rr(ne)),u!==o&&ur()!==o&&(c=yr())!==o?(zn=t,t=n=function(e,t){return e.wrappedInParentheses=!0,{type:"relationFromSubstatement",statement:e,relAlias:t,codeInfo:No()}}(i,c)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=Ir())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,t=n=ye(i)):(Un=t,t=o)):(Un=t,t=o))),Xn[f]={nextPos:Un,result:t},t)}function Yr(){var t,n,r,i,a,s,l,u=113*Un+46,c=Xn[u];return c?(Un=c.nextPos,c.result):(t=Un,n=Un,(r=ur())!==o?("cross"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Ee)),i!==o&&(a=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(s=e.substr(Un,4),Un+=4):(s=o,0===Kn&&rr(je)),s!==o&&(l=ur())!==o?n=r=[r,i,a,s,l]:(Un=n,n=o)):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,(r=cr())!==o?(44===e.charCodeAt(Un)?(i=",",Un++):(i=o,0===Kn&&rr(oe)),i!==o&&(a=cr())!==o?n=r=[r,i,a]:(Un=n,n=o)):(Un=n,n=o)),n!==o&&(r=Hr())!==o?(zn=t,t=n={type:"crossJoin",child2:r,cond:null}):(Un=t,t=o),Xn[u]={nextPos:Un,result:t},t)}function Fr(){var t,n,r,i,a=113*Un+47,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("natural"===e.substr(Un,7).toLowerCase()?(n=e.substr(Un,7),Un+=7):(n=o,0===Kn&&rr(Ce)),n!==o&&ur()!==o?("join"===e.substr(Un,4).toLowerCase()?(r=e.substr(Un,4),Un+=4):(r=o,0===Kn&&rr(je)),r!==o&&ur()!==o&&(i=Hr())!==o?(zn=t,t={type:"naturalJoin",child2:i,cond:null}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Wr(){var t,n,r,i,a,s,l,u,c,d,h,f,m,p,g,y=113*Un+48,b=Xn[y];if(b)return Un=b.nextPos,b.result;if(t=Un,ur()!==o)if(n=Un,r=Un,"inner"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Se)),i!==o&&(a=ur())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?("join"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(je)),i!==o?(zn=n,n=r="innerJoin"):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,r=Un,"left"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Oe)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="leftOuterJoin"),(n=r)===o&&(n=Un,r=Un,"right"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Te)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="rightOuterJoin"),(n=r)===o&&(n=Un,r=Un,"full"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Me)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="fullOuterJoin"),n=r))),n!==o)if((r=ur())!==o)if((i=Hr())!==o)if((a=ur())!==o){if(s=Un,"on"===e.substr(Un,2).toLowerCase()?(l=e.substr(Un,2),Un+=2):(l=o,0===Kn&&rr(xe)),l!==o&&ur()!==o&&(u=io())!==o?(zn=s,s=l=u):(Un=s,s=o),s===o){if(s=Un,"using"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(Le)),l!==o)if(cr()!==o)if(40===e.charCodeAt(Un)?(u="(",Un++):(u=o,0===Kn&&rr(Q)),u!==o)if(cr()!==o)if((c=br())!==o){for(d=[],h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);h!==o;)d.push(h),h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);d!==o&&(h=cr())!==o?(41===e.charCodeAt(Un)?(f=")",Un++):(f=o,0===Kn&&rr(ee)),f!==o?(zn=s,s=l=function(e,t,n,r){for(var o=[n],i=0;i"===e.substr(Un,2)?(n="<>",Un+=2):(n=o,0===Kn&&rr(Ve));n===o&&("!="===e.substr(Un,2)?(n="!=",Un+=2):(n=o,0===Kn&&rr(qe)));n!==o&&(zn=t,n="!=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+60,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,">="===e.substr(Un,2)?(n=">=",Un+=2):(n=o,0===Kn&&rr(Ge));n!==o&&(zn=t,n=">=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+62,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,"<="===e.substr(Un,2)?(n="<=",Un+=2):(n=o,0===Kn&&rr(Xe));n!==o&&(zn=t,n="<=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+61,r=Xn[n];if(r)return Un=r.nextPos,r.result;62===e.charCodeAt(Un)?(t=">",Un++):(t=o,0===Kn&&rr(Ke));return Xn[n]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+63,r=Xn[n];if(r)return Un=r.nextPos,r.result;60===e.charCodeAt(Un)?(t="<",Un++):(t=o,0===Kn&&rr($e));return Xn[n]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function qr(){var t,n,r,i,a=113*Un+69,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,(n=hr())!==o&&lr()!==o&&(r=hr())!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i===o&&(i=null),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o),t===o)if(t=Un,35===e.charCodeAt(Un)?(n="#",Un++):(n=o,0===Kn&&rr(at)),n!==o)if(hr()!==o){for(r=[],st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));i!==o;)r.push(i),st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));r!==o?(10===e.charCodeAt(Un)?(i="\n",Un++):(i=o,0===Kn&&rr(u)),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;return Xn[a]={nextPos:Un,result:t},t}function Gr(){var t,n,r,i,a=113*Un+70,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,96===e.charCodeAt(Un)?(n="`",Un++):(n=o,0===Kn&&rr(ut)),n!==o&&(r=yr())!==o?(96===e.charCodeAt(Un)?(i="`",Un++):(i=o,0===Kn&&rr(ut)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=yr())!==o&&(zn=t,n=n),t=n),Xn[a]={nextPos:Un,result:t},t)}function Kr(){var t,n,r,i,a,s,l,u,c=113*Un+71,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,"drop"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ct)),n!==o&&dr()!==o?("table"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(dt)),r!==o&&dr()!==o?(i=Un,"if"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ht)),a!==o&&(s=dr())!==o?("exists"===e.substr(Un,6).toLowerCase()?(l=e.substr(Un,6),Un+=6):(l=o,0===Kn&&rr(it)),l!==o&&(u=dr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o),i===o&&(i=null),i!==o&&(a=Gr())!==o&&(s=hr())!==o?(59===e.charCodeAt(Un)?(l=";",Un++):(l=o,0===Kn&&rr(se)),l!==o?(zn=t,t=n={type:"dropTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function Xr(){var t,n,r,i,a,s,l=113*Un+72,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,"lock"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ft)),n!==o)if(dr()!==o)if("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o)if(dr()!==o)if(Gr()!==o)if(dr()!==o){if(i=[],F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W)),a!==o)for(;a!==o;)i.push(a),F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W));else i=o;i!==o&&(a=hr())!==o?(59===e.charCodeAt(Un)?(s=";",Un++):(s=o,0===Kn&&rr(se)),s!==o?(zn=t,t=n={type:"lockTable"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;return Xn[l]={nextPos:Un,result:t},t}function $r(){var t,n,r,i,a=113*Un+73,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,"unlock"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(pt)),n!==o&&dr()!==o?("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o&&hr()!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i!==o?(zn=t,t=n={type:"unlockTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Jr(){var e,t,n,r,i,a=113*Un+74,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(e=Un,hr()!==o){if(t=[],n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o),n!==o)for(;n!==o;)t.push(n),n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o);else t=o;t!==o&&(n=hr())!==o?(zn=e,e=function(e){var t,n,r,o,i,a,s={},l={},u="";for(n=0;n!0===n.evaluate(e,t,r,o),this._checkSchema(e,t)}_getResult(e,t){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator)throw new Error("check not called");const n=new c.a;return n.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),n,this._isRightJoin,this._isAntiJoin,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),!0===t&&n.eliminateDuplicateRows(),this.setResultNumRows(n.getNumRows()),n}static createNullArray(e){return new Array(e).fill(null)}static getCheckedEvaluatorBooleanExpression(e,t,n,r){if(n.check(e,t),"boolean"!==n.getDataType())throw new m.a("db.messages.exec.error-condition-must-be-boolean",r);return function(e,t,r,o){return!0===n.evaluate(e,t,r,o)}}static getCheckedEvaluatorNaturalJoin(e,t,n,r){}static calcNestedLoopJoin(e,t,n,r,o,i,a,s,l){const u=t.getResult(e),c=n.getResult(e),d=u.getNumRows(),h=c.getNumRows(),f=u.getNumCols();c.getNumCols();if(!1===o){let t;null!==l&&(t=p.createNullArray(r.getSchema().getSize()-f));const n={};for(let o=0;o0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}getArgumentHtml(){return""}}class y extends u.c{constructor(e,t){super("π",e),this._checked=null,this._columns=t}getSchema(){if(null===this._columns)return this._child.getSchema();if(null===this._checked)throw new Error("check has not been called");return this._checked._projectedSchema}getResult(e){if(e=this._returnOrCreateSession(e),null===this._checked)throw new Error("check has not been called");const{_indices:t}=this._checked;if(null===this._columns)return this._child.getResult(e);const n=this._child.getResult(e),r=new c.a;r.setSchema(this.getSchema());const o=r.getNumCols(),i=n.getNumRows();let a,s,l,u;for(a=0;a-1&&o.removeColumn(n)}o.getSize()===n&&this.throwExecutionError(i18n.t("db.messages.exec.error-schema-a-not-part-of-schema-b",{schemaA:t,schemaB:e})),this._delegate=new d(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),new y(new d(new g(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),this._child2).setCodeInfoObject(this._codeInfo),this._child).setCodeInfoObject(this._codeInfo),o.getColumns()).setCodeInfoObject(this._codeInfo)),this._delegate.check()}}class v extends u.c{constructor(e,t,n){super("γ",e),this.checked=null,this.groupByCols=t,this.aggregateFunctions=n}getSchema(){if(null===this.checked)throw new Error("check not called");return this.checked.schema}check(){this._child.check();const e=this._child.getSchema(),t=new Array(this.groupByCols.length),n=Array(this.aggregateFunctions.length);for(let n=0;nl.a.printColumn(e.name,e.relAlias)),t=this.aggregateFunctions.map(e=>`${"COUNT_ALL"===e.aggFunction?"COUNT(*)":`${e.aggFunction}(${l.a.printColumn(e.col.name,e.col.relAlias)})`}→${e.name}`);return`${e.join(", ")}; ${t.join(", ")}`}getResult(e){if(e=this._returnOrCreateSession(e),null===this.checked)throw new Error("check not called");const t=this.getChild().getResult(e),n=new c.a;n.setSchema(this.checked.schema);let r,o=0;if(this.groupByCols.length>0){const e={};for(let n=0;nt?e:t};let s,l,u,d;for(let e=0;e0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator||null===this._rowCreatorMatched||null===this._rowCreatorNotMatched)throw new Error("check not called");const t=new c.a;return t.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!1,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!0,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}}class j extends p{constructor(e,t,n){super(e,t,"⨝",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class C extends p{constructor(e,t,n){super(e,t,"⟕",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class S extends p{constructor(e,t,n){super(e,t,"⟖",n,!0)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!1,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class O extends p{constructor(e,t,n){super(e,t,n?"⋉":"⋊",{type:"natural",restrictToColumns:null},!n)}_checkSchema(e,t){this._isRightJoin?(this._schema=t.copy(),this._rowCreatorMatched=function(e,t){return t}):(this._schema=e.copy(),this._rowCreatorMatched=function(e,t){return e}),this._rowCreatorNotMatched=null}getResult(e){return super._getResult(e,!0)}}class k extends u.c{constructor(e,t,n){if(super("τ",e),this._orderCols=t,this._orderAsc=n,this._orderAsc.length!==this._orderCols.length)throw new Error("order cols not correct");this._orderIndices=null}getSchema(){return this._child.getSchema()}getResult(e){if(e=this._returnOrCreateSession(e),null===this._orderIndices)throw new Error("check not called");const t=this.getChild().getResult(e).copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t.sort(this._orderIndices,this._orderAsc),t}check(){this._child.check();const e=this._child.getSchema();this._orderIndices=[];for(let t=0;t0){const n=[],r=e.groupBy||[];for(let e=0;e0)a=new v(a,r,n);else{const e=[];for(let t=0;t",[new f.c("number","rownum",[]),new f.c("number","constant",[o])]);if(-1===n)a=new L(r(t.child),i);else{const e=new f.c("boolean","<=",[new f.c("number","rownum",[]),new f.c("number","constant",[n+o])]);a=new L(r(t.child),new f.c("boolean","and",[i,e]))}break}default:throw new Error(`type ${e.type} not implemented`)}if(!a)throw new Error("should not happen");return!0===e.wrappedInParentheses&&a.setWrappedInParentheses(!0),n(a,e),a}function o(e,t,n){e.check();const r=new L(e,N(t));return r.setCodeInfoObject(n),r}function i(e){return"column"===e.type&&e.alias}return r(e.child)}function N(e){let t;if("null"===e.datatype&&"columnValue"===e.func)t=new f.b(e.args[0],e.args[1]);else switch(e.datatype){case"string":case"number":case"boolean":case"date":case"null":const n=[];for(let t=0;t{"relation"!==e.type||void 0!==t&&!1!==t.has(e.name)||n.push({name:e.name,line:e.codeInfo.location.start.line,column:e.codeInfo.location.start.column})}),n}function B(e,t){const n=Y.a.isMap(t)?t:Y.a().withMutations(e=>{for(const n of Object.keys(t))e.set(n,t[n])}).asImmutable();if(0===e.assignments.length)return;const r=new Map;Y.c().withMutations(t=>{for(let n=0;n{if(!0===i.get(e))return;if(!0===o.get(e))throw new Error(s.a("db.messages.translate.error-variable-cyclic-usage",{name:e}));o.set(e,!0);const t=r.get(e);if(void 0!==t){const{childRelations:e}=t;for(let t=0;t{if("relation"===e.type&&e.name===t.name){return Object.assign(Object.assign({},t.child),{metaData:Object.assign(Object.assign({},t.child.metaData),{fromVariable:t.name})})}return e});e=Object.assign(Object.assign({},e),{child:n})}r.set(e.name,e)}for(const[,t]of r)e.assignments[t.assignmentIndex].child=t.child;if(("relalgRoot"===e.type||"sqlRoot"===e.type)&&null!==e.child&&void 0!==e.child)for(const[t,n]of r)e.child=Object(F.b)(e.child,e=>"relation"===e.type&&e.name===t?Object.assign(Object.assign({},n.child),{metaData:Object.assign(Object.assign({},n.child.metaData),{fromVariable:t})}):e)}var U=n("./src/db/translate/textFromAst.ts");function z(e,t,n,r){if("none"===r)return{query:e,cursor:n};const o={math2plain:{pi:"pi",sigma:"sigma",rho:"rho",arrowLeft:"<-",arrowRight:"->",psi:"psi",tau:"tau",gamma:"gamma",unionOperator:"union",intersectOperator:"intersect",divisionOperator:"/",differenceOperator:"-",crossJoinOperator:"cross join",innerJoinOperator:"inner join",naturalJoinOperator:"natural join",leftSemiJoinOperator:"left semi join",rightSemiJoinOperator:"right semi join",antiJoinOperator:"anti join",leftOuterJoinOperator:"left outer join",rightOuterJoinOperator:"right outer join",fullOuterJoinOperator:"full outer join"},plain2math:{pi:"π",sigma:"σ",rho:"ρ",arrowLeft:"←",arrowRight:"→",psi:"ψ",tau:"τ",gamma:"γ",unionOperator:"∪",intersectOperator:"∩",divisionOperator:"÷",differenceOperator:"-",crossJoinOperator:"⨯",innerJoinOperator:"⨝",naturalJoinOperator:"⨝",leftSemiJoinOperator:"⋉",rightSemiJoinOperator:"⋊",antiJoinOperator:"▷",leftOuterJoinOperator:"⟕",rightOuterJoinOperator:"⟖",fullOuterJoinOperator:"⟗"}};for(let i=t.length-1;i>=0;i--){const a=t[i],s=a.location,l=e.substr(0,s.start.offset),u=e.substring(s.end.offset),c=o[r][a.name];if(e.substring(s.start.offset,s.end.offset)!==c){if(n)if(n.line>=s.start.line&&n.line<=s.end.line){if(n.column>s.start.column&&n.column=s.end.column){n.line-=s.end.line-s.start.line;const e=a.location.end.offset-a.location.start.offset,t=c.length;n.column-=e-t}}else n.lines.end.line&&(n.line-=s.end.line-s.start.line);e=l+c+u}}return{query:e,cursor:n}}const V=n("./src/db/parser/grammar_sql.pegjs");function q(e){return V.parse(e,{startRule:"start",tracer:void 0,i18n:r.c})}function G(e){return V.parse(e,{startRule:"dbDumpStart",tracer:void 0})}function K(e,t={}){t=t||{};const n=i(e,Object.keys(t));B(n,t);const r=I(n,t);return r.check(),r}},"./src/db/translate/textFromAst.ts":function(e,t,n){"use strict";(function(e){function r(e){if("groupRoot"!==e.type)throw new Error("wrong ast!?");let t="";function n(e){let t="";const{headers:n}=e;for(const e of n){const{name:n,lang:r,text:o}=e;t+=n,null!==r&&(t+="@"+r),t+=":",-1!==e.text.indexOf("\n")?t+=`[[${e.text}]]\n`:t+=e.text+"\n"}t+="\n";for(let n=0;n");if(null!==t&&i.addClass(t),null!==n&&i.append(n),null!==r){const t=e("");t.append(r),i.append(" ").append(t)}return null!==o&&i.append(" ( ").append(o).append(" ) "),i.text()}function r(t,n,r,o,i){const a=e("");if(null!==t&&a.addClass(t),a.append("( ").append(o).append(" ) "),a.append(n),null!==r){const t=e("");t.append(r),a.append(t)}return a.append(" ( ").append(i).append(" ) "),a.text()}function o(e,t){return"number"==typeof e&&(e=`[${e}]`),null===t?e:`${t}.${e}`}function i(e,t){if(null===e||"null"===t)return"null";if(e instanceof Date)return function(e){const t=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,n=e.getDate()<10?"0"+e.getDate():e.getDate();return`${e.getFullYear()}-${t}-${n}`}(e);if("string"==typeof e)return`'${e}'`;if("number"==typeof e)return e.toString();throw new Error("unknown type "+t)}return function e(t){switch(t.type){case"relation":return n(t.type,t.name,null,null);case"table":{const e=[];let n=[];for(let e=0;er[n])&&(r[n]=o)}let o="{\n";for(let i=0;i0){for(let e=0;e{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}else if("sqlRoot"===e.type){let n=!1;const o=e.assignments.map(e=>{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}return t(e)}function o(e,t,n=!0){if(t(e),"statement"===e.type?o(e.from,t,n):"relationFromSubstatement"===e.type&&o(e.statement,t,n),void 0!==e.child&&o(e.child,t,n),void 0!==e.child2&&o(e.child2,t,n),void 0!==e.assignments&&!0===n)for(const r of e.assignments)o(r,t,n)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},"./src/locales/de.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"Variablenname wurde mehrfach definiert: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"mehrfacher header {{name}}","db.messages.parser.error-group-unknown-header":"unbekannter header {{name}}","db.messages.parser.error-group-header-name-missing":"der Name des Datensatzes fehlt (group: ....)","db.messages.parser.error-group-header-name-empty":"der Name des Datensatzes ist leer","db.messages.parser.error-group-non-unique-attribute":"nicht eindeutiges Attribut {{name}} in Spalte {{index}}","db.messages.parser.error-group-non-unique-group-name":"Der Name der Gruppe {{name}} ist nicht eindeutig.","db.messages.parser.error-sql-string-use-single-quotes":"verwenden Sie einfache Anführungszeichen für Zeichenketten","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" darf nicht als name einer Relation verwendet werden","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" darf nicht als name einer Spalte verwendet werden","db.messages.parser.error-sql-group-by-missing":"group-by-Klausel fehlt","db.messages.parser.error-sql-having-without-group-by":"having-Klausel gefunden doch \\"group by\\" or Aggregation fehlt","db.messages.parser.error-sql-negative-limit":"das Limit muss größer oder gleich 0 sein","db.messages.parser.error-sqldump-invalid-column-number":"ungültige Spaltenanzahl in Zeile {{line}}","db.messages.parser.error-sqldump-invalid-type":"ungültiger Typ in Zeile {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"Anzahl der Werte != Anzahl der Spalten","db.messages.parser.error-valueexpr-like-operand-no-string":"der rechte Operand von LIKE muss ein Zeichenkettenliteral sein","db.messages.exec.error-column-not-unique":"Spalte \\"{{column}}\\" kann wegen mehrdeutigkeit nicht hinzugefügt werden","db.messages.exec.error-column-not-found-name":"Spalte \\"{{column}} wurde im Schema {{schema}} nicht gefunden","db.messages.exec.error-column-not-found-index":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-column-ambiguous":"Spalte \\"{{column}}\\" ist mehrdeutig im Schema {{schema}}","db.messages.exec.error-column-index-out-of-range":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"Relations alias \\"{{alias}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden","db.messages.exec.error-could-not-rename-ambiguity":"neuer Name \\"{{newName}}\\" für \\"{{oldName}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden im Schema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"Schema {{schemaA}} ist nicht Teil von {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"Schemas sind nicht unifiable: Typen oder Anzahl der Attribute ist unterschiedlich: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"Spalte \\"{{column}}\\" kann nicht in beiden Schemas des Joins gefunden werden","db.messages.exec.error-condition-must-be-boolean":"Bedingung muss ein boolscher Ausdruck sein","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} ist nicht für Datentyp {{colType}} definiert","db.messages.exec.error-join-would-produce-non-unique-columns":" the following columns appear in both relations: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"Keine Spalten gefunden für \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"Datentype für Spalte {{index}} (\\"{{column}}\\") wurde nicht spezifiziert","db.messages.exec.error-invalid-projection-error":"ungültige Projektion \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"Funktion \\"{{func}}\\" erwartet Argumente vom Typ \\"{{expected}}\\" aber \\"{{given}}\\" gefunden","db.messages.exec.error-could-not-compare-different-types":"Werte mit unterschiedlichen Datentypen können nicht verglichen werden: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"Funktion {{func}} erwartet, dass alle Argumente den selben Datentyp haben.","db.messages.exec.error-case-when-condition-must-be-boolean":"Die Bedingung für ein CASE WHEN muss ein boolscher Ausdruck sein","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END erwartet dass alle results vom selben Typ sind","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"Relation \\"{{name}}\\" nicht gefunden","db.messages.translate.warning-distinct-missing":" relational algebra uses implicit duplicate elimination","db.messages.translate.warning-ignored-all-on-set-operators":" relational algebra uses implicit duplicate elimination","db.messages.translate.error-variable-name-conflict":"Namenskonflikt: eine Relation mit Namen \\"{{name}}\\" existiert bereits","db.messages.translate.error-variable-cyclic-usage":"Zyklische Verwendung von Variable \\"{{name}}\\" erkannt","editor.codemirror-placeholder":"Abfrage ...\\nTastatürkürzel\\n\\tAbfrage ausführen: [CTRL]+[RETURN]\\n\\tMarkierten teil der Abfrage ausführen: [CTRL]+[SHIFT]+[RETURN]\\tAutovervollständigung: [CTRL]+[SPACE]","editor.alert-message-headers.success":"Erfolg","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warnung","editor.alert-message-headers.error":"Fehler","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"abbrechen","editor.inline-relation-editor.placeholder-column-name-and-types":"spaltenName:datenTyp","editor.inline-relation-editor.enter-your-data":"bitte Daten eingeben","editor.inline-relation-editor.error-column-name-missing":"Spaltenname fehlt in Spalte {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"Zeichenketten dürfen keine doppelten oder einfache Anführungszeichen enthalten","editor.error-no-query-found":"keine Abfrage gefunden","editor.pegjs-error.or":"oder","editor.pegjs-error.no-input-found":"keine Eingabe gefunden","editor.pegjs-error.end-of-input":"Ende der Eingabe","editor.pegjs-error.expected-found":"Erwarte {{expected}} aber {{found}} gefunden.","editor.error-at-line-x":"in Zeile {{line}}","calc.messages.error-query-missing":"keine Abfrage gefunden","calc.messages.error-query-missing-assignments-found":"nur Zuweisungen gefunden; die eigentliche Abfrage fehlt Help - Assignments (en)","calc.messages.gist-load-success":"gist erfolgreich geladen","calc.menu.headline":"Datensätze","calc.menu.datasets":"Datensätze","calc.menu.load-gist-headline":"Datensatz aus gist laden","calc.menu.load-gist-button":"laden","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Eigenen Datensatz erstellen","calc.menu.create-own-dataset-text":"Sie können Ihren eigenen Datensatz erstellen und ihn mit anderen teilen. Lernen Sie mehr darüber im Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial (en)","calc.menu.create-own-dataset-button-new":"neuen Datensatz erstellen","calc.menu.create-own-dataset-button-modify":"aktuellen Datensatz abändern","calc.navigation.take-a-tour":"Tour starten","calc.navigation.feedback":"Feedback","calc.navigation.help":"Hilfe (en)","calc.navigation.calc":"Rechner","calc.navigation.language":"Sprache","calc.maintainer-groups.misc":"Diverse","calc.maintainer-groups.temp":"Ungespeichert","calc.maintainer-groups.uibk":"Universität Innsbruck","calc.maintainer-groups.saarland":"Universität Saarland","calc.editors.button-history":"Verlauf","calc.editors.insert-relation-title":"Einfügen","calc.editors.insert-relation-tooltip":"Beziehungs- oder Spaltennamen einfügen","calc.editors.group.tab-name":"Datensatz Editor","calc.editors.group.tab-name-short":"DS","calc.editors.group.toolbar.import-sql":"SQL-dump importieren","calc.editors.group.toolbar.import-sql-content":"SQL-dump importieren","calc.editors.group.toolbar.add-new-relation":"neue Relation hinzufügen","calc.editors.group.toolbar.add-new-relation-content":"Relationseditor öffnen","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"Vorschau","calc.editors.group.button-use":"Datensatz im Editor verwenden","calc.editors.group.button-use_plural":"Datensatz im Editor verwenden","calc.editors.group.sql-import-group-name-placeholder":"Name des Datensatzes (importiert)","calc.editors.group.new-group-example-group":"-- dies ist ein Beispiel\\n\\ngroup: nameDesDatensatzes \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tbeispiel, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump importieren","calc.editors.group.modal-sqldump.button-close":"schließen","calc.editors.group.modal-sqldump.button-cancel":"abbrechen","calc.editors.group.modal-sqldump.button-import-sql":"importieren","calc.editors.group.modal-sqldump.description":"Kopieren Sie den SQL-Dump hier her um einen Datensatz daraus zu erstellen.","calc.editors.ra.tab-name":"Relationale Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"Query ausführen","calc.editors.ra.button-execute-selection":"Markierung ausführen","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"Projektion","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"Selektion","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"Umbenennen (Relationen/Spalten)","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.rename-columns-operator":"Umbenennung von Spalten","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"Sortieren","calc.editors.ra.toolbar.orderBy-content":"","calc.editors.ra.toolbar.groupBy":"Gruppieren","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"Und","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"Xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"Oder","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"Verneinung","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
              ","calc.editors.ra.toolbar.equals":"Gleich","calc.editors.ra.toolbar.equals-content":" a = b ( A )
              ","calc.editors.ra.toolbar.not-equals":"Ungleich","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
              ","calc.editors.ra.toolbar.greater-or-equals":"Größer-Gleich","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.lesser-or-equals":"Kleiner-Gleich","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.intersect":"Schnittmenge","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"Vereinigung","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"Division (Relationen)","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"Mengendifferenz","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"cross join (Kreuzprodukt)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"Zuweisung","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"Kommentar einzeilig","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"Kommentar mehrzeilig","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-Relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-Relation (Editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"eine neue inline-Relation mit dem Editor erstellen","calc.editors.ra.toolbar.insert-date":"Datum einfügen","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"Operatoren ersetzen","calc.editors.ra.toolbar.autoreplace-operators.header":"Operatoren automatisch ersetzen","calc.editors.ra.toolbar.autoreplace-operators.none":"keine Ersetzung","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Query ausführen","calc.editors.sql.button-execute-selection":"Markierung ausführen","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select-Klausel","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from-Klausel","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where-Klausel","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group-b-Klausel","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having-Klausel","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order-by-Klausel","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit-Klausel","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"Datum einfügen","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Ergebnis","calc.result.modal.close":"Schließen","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"CSV downloaden","calc.editors.ra.inline-editor.button-upload-csv":"CSV uploaden","calc.editors.ra.inline-editor.button-cancel":"Abbrechen","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Typ","calc.editors.ra.inline-editor.input-relation-name":"Relations Name","calc.navigation.imprint":"Impressum"}')},"./src/locales/en.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"duplicate variable name: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"duplicate header {{name}}","db.messages.parser.error-group-unknown-header":"unknown header {{name}}","db.messages.parser.error-group-header-name-missing":"the name of the group is missing (group: ....)","db.messages.parser.error-group-header-name-empty":"the name of the group must not be empty","db.messages.parser.error-group-non-unique-attribute":"non unique attribute {{name{{ in column }}index}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use single quotes for strings","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" must not be used as a relation-name","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" must not be used as a column-name","db.messages.parser.error-sql-group-by-missing":"group by is missing","db.messages.parser.error-sql-having-without-group-by":"having found but missing \\"group by\\" or aggregation","db.messages.parser.error-sql-negative-limit":"the limit given must be >= 0","db.messages.parser.error-sqldump-invalid-column-number":"invalid number of columns in line {{line}}","db.messages.parser.error-sqldump-invalid-type":"invalid type in line {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"number of values != number of columns","db.messages.parser.error-valueexpr-like-operand-no-string":"right operand of LIKE must be a string literal","db.messages.exec.error-column-not-unique":"could not add column \\"{{column}}\\" because of ambiguity","db.messages.exec.error-column-not-found-name":"could not find column \\"{{column}}\\" in schema {{schema}}","db.messages.exec.error-column-not-found-index":"column index \\"{{column}}\\" is out of range in schema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"column \\"{{column}}\\" is ambiguous in {{schema}}","db.messages.exec.error-column-index-out-of-range":"column index \\"{{column}}\\" is out of range in {{schema}}; index starts at 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"could not set relation alias \\"{{alias}}\\" because of ambiguity","db.messages.exec.error-could-not-rename-ambiguity":"could not set new name \\"{{newName}}\\" for \\"{{oldName}}\\" because of ambiguity in {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"schema {{schemaA}} is not part of {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"schemas are not unifiable: types are different or size is different: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"column \\"{{column}}\\" can not be found in both schemas of join","db.messages.exec.error-condition-must-be-boolean":"condition must be a boolean expression","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} not defined for type {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"join would result in non unique column names","db.messages.exec.error-no-columns-match-alias-star":"no columns match \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"datatype for column {{index}} (\\"{{column}}\\") is not specified","db.messages.exec.error-invalid-projection-error":"invalid projection \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"function \\"{{func}}\\" expects arguments of type \\"{{expected}}\\" but \\"{{given}}\\" given","db.messages.exec.error-could-not-compare-different-types":"could not compare value if types are different: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} expects all arguments to be of the same type","db.messages.exec.error-case-when-condition-must-be-boolean":"the condition of a CASE WHEN must be of type boolean","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END expects all results to be of the same type","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"could not find relation \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT is missing","db.messages.translate.warning-ignored-all-on-set-operators":"ignored ALL on set operation","db.messages.translate.error-variable-name-conflict":"name conflict: relation name \\"{{name}}\\" already exists","db.messages.translate.error-variable-cyclic-usage":"cyclic usage of variable \\"{{name}}\\" detected","editor.codemirror-placeholder":"your query goes here ...\\n\\nkeyboard shortcuts:\\n\\texecute statement: [CTRL]+[RETURN]\\n\\texecute selection: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocomplete: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Success","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warning","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancel","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"please enter your data","editor.inline-relation-editor.error-column-name-missing":"column name missing in column {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string must not contain single and double quotes","editor.error-no-query-found":"no query found","editor.pegjs-error.or":"or","editor.pegjs-error.no-input-found":"no input found","editor.pegjs-error.end-of-input":"end of input","editor.pegjs-error.expected-found":"Expected {{expected}} but {{found}} found.","editor.error-at-line-x":"at line {{line}}","calc.messages.error-query-missing":"no query found","calc.messages.error-query-missing-assignments-found":"only assignments found; query is missing Help - Assignments","calc.messages.gist-load-success":"gist loaded successfully","calc.menu.headline":"load a Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Load dataset stored in a gist","calc.menu.load-gist-button":"load","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Create your own Dataset","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"create new Dataset","calc.menu.create-own-dataset-button-modify":"modify current Dataset","calc.navigation.take-a-tour":"Take a Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Help","calc.navigation.calc":"Calculate","calc.navigation.language":"Language","calc.maintainer-groups.misc":"Miscellaneous","calc.maintainer-groups.temp":"Temporary","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"history","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"Group Editor","calc.editors.group.tab-name-short":"GE","calc.editors.group.toolbar.import-sql":"import SQL-dump","calc.editors.group.toolbar.import-sql-content":"import SQL-dump","calc.editors.group.toolbar.add-new-relation":"add new relation","calc.editors.group.toolbar.add-new-relation-content":"open relation editor","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"use Group in editor","calc.editors.group.button-use_plural":"use first Group in editor","calc.editors.group.sql-import-group-name-placeholder":"Name of the group (imported from SQL)","calc.editors.group.new-group-example-group":"-- this is an example\\n\\ngroup: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Import SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Close","calc.editors.group.modal-sqldump.button-cancel":"cancel","calc.editors.group.modal-sqldump.button-import-sql":"import SQL","calc.editors.group.modal-sqldump.description":"Put your SQL-Dump here to create a group.","calc.editors.ra.tab-name":"Relational Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"execute query","calc.editors.ra.button-execute-selection":"execute selection","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"projection","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"selection","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"rename relation / rename columns","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.rename-columns-operator":"rename columns operator","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"order by","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"group by","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"and","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"or","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"not","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"equals","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"not equals","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"greater or equals","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"lesser or equals","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersect","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"union","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"division","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"subtraction","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"cross join","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"assignment","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"single-line comment","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"multi-line comment","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"insert date","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"execute query","calc.editors.sql.button-execute-selection":"execute selection","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select clause","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from clause","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where clause","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by clause","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order by clause","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit clause","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/es.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nombre de variable duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"header duplicado {{name}}","db.messages.parser.error-group-unknown-header":"header desconocido {{name}}","db.messages.parser.error-group-header-name-missing":"el nombre del grupo no se ha encontrado (group: ....)","db.messages.parser.error-group-header-name-empty":"el nombre del grupo debe ser rellenado","db.messages.parser.error-group-non-unique-attribute":"atributo no único {{name}} en columna {{index}}","db.messages.parser.error-group-non-unique-group-name":"El nombre del grupo no es único.","db.messages.parser.error-sql-string-use-single-quotes":"utiliza comillas simples para cadenas de caracteres","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" no debe ser utilizado como nombre de relacion","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" no debe ser utilizado como nombre de columna","db.messages.parser.error-sql-group-by-missing":"group by no se encuentra","db.messages.parser.error-sql-having-without-group-by":"se ha encontrado pero no se encuentra \\"group by\\" ó agregación","db.messages.parser.error-sql-negative-limit":"el límite dado debe ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de columnas en línea {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido en línea {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de columnas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando derecho de LIKE debe ser una cadena literal","db.messages.exec.error-column-not-unique":"no se pude agregar columna \\"{{column}}\\" por ambiguedad","db.messages.exec.error-column-not-found-name":"no se pude encontrar columna \\"{{column}}\\" en esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"columna \\"{{column}}\\" es ambigua en esquema {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; índice comienza en 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"no se pudo establecer relación alias \\"{{alias}}\\" por ambiguedad","db.messages.exec.error-could-not-rename-ambiguity":"no se pudo establecer nuevo nombre \\"{{newName}}\\" para \\"{{oldName}}\\" por ambiguedad en el equema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} no es parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"esquemas no son unificables: los tipos son diferentes ó los tamaño son diferentes: {{schemaA}} y {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"columna \\"{{column}}\\" no se puede encontrar en ambos esquemas del join","db.messages.exec.error-condition-must-be-boolean":"condición debe ser una expresión booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} no está definido para {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"Join würde nicht eindeutige Spaltennamen erzeugen","db.messages.exec.error-no-columns-match-alias-star":"las columnas no coinciden \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dato para columna {{index}} (\\"{{column}}\\") no está especificado","db.messages.exec.error-invalid-projection-error":"proyección inválida \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"función \\"{{func}}\\" espera argumentos de tipo \\"{{expected}}\\" pero \\"{{given}}\\" fue dado","db.messages.exec.error-could-not-compare-different-types":"no se pudo comparar valor si tipos son diferentes: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos los argumentos sean del mismo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"la condición de un CASE WHEN debe ser de tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END espera todos results ser del mismo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válido; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"no se pudo encontrar relación \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT fehlt","db.messages.translate.warning-ignored-all-on-set-operators":"ALL bei Mengenoperatoren wurde ignoriert","db.messages.translate.error-variable-name-conflict":"conflicto de nombre: nombre de relación \\"{{name}}\\" ya existe","db.messages.translate.error-variable-cyclic-usage":"uso de variable cíclico \\"{{name}}\\" detectado","editor.codemirror-placeholder":"tu consulta va aquí ...\\n\\natajos de teclado:\\n\\tejecutar declaración: [CTRL]+[RETURN]\\n\\ttejecutar selección: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Éxito","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Advertencia","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"nombreColumna:tipo","editor.inline-relation-editor.enter-your-data":"por favor ingrese los datos","editor.inline-relation-editor.error-column-name-missing":"nombre de columna ausente en columna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"cadena de caracteres no debe contener comillas simples y dobles","editor.error-no-query-found":"no se encontró la consulta","editor.pegjs-error.or":"ó","editor.pegjs-error.no-input-found":"no se encontró la entrada","editor.pegjs-error.end-of-input":"fin de entrada","editor.pegjs-error.expected-found":"Se esperaba {{expected}} pero se encontró {{found}} .","editor.error-at-line-x":"en la línea {{line}}","calc.messages.error-query-missing":"no se encontró la consulta","calc.messages.error-query-missing-assignments-found":"solo se encontraron asignaciones; a la consulta le falta Help - Assignments","calc.messages.gist-load-success":"gist fue cargado con éxito","calc.menu.headline":"cargar un Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"cargar dataset guardado en un gist","calc.menu.load-gist-button":"cargar","calc.menu.load-gist-insert-placeholder":"ID de gist","calc.menu.create-own-dataset-headline":"Crear tu propio Dataset","calc.menu.create-own-dataset-text":"Puedes crear tu propio dataset y compartirlo con otras personas. \\nAprende más acerca de ésto en Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Tutorial de mantenimiento (en)","calc.menu.create-own-dataset-button-new":"crear nuevo Dataset","calc.menu.create-own-dataset-button-modify":"modificar Dataset actual","calc.navigation.take-a-tour":"Haz un recorrido","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ayuda (en)","calc.navigation.calc":"Calculadora","calc.navigation.language":"Lenguaje","calc.maintainer-groups.misc":"Misceláneo","calc.maintainer-groups.temp":"Temporal","calc.maintainer-groups.uibk":"Universidad de Innsbruck","calc.maintainer-groups.saarland":"Universidad de Saarland","calc.editors.button-history":"historia","calc.editors.insert-relation-title":"Insertar","calc.editors.insert-relation-tooltip":"Insertar nombres de relaciones o columnas","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"agregar nueva relación","calc.editors.group.toolbar.add-new-relation-content":"abrir editor de relaciones","calc.editors.group.button-download":"descargar","calc.editors.group.button-exec":"vista previa","calc.editors.group.button-use":"utilizar Grupo en editor","calc.editors.group.button-use_plural":"utilizar Grupos en editor","calc.editors.group.sql-import-group-name-placeholder":"Nombre del grupo (importado de SQL)","calc.editors.group.new-group-example-group":"-- éste es un ejemplo\\n\\ngroup: nombreDeNuevoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tejemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Cerrar","calc.editors.group.modal-sqldump.button-cancel":"cancelar","calc.editors.group.modal-sqldump.button-import-sql":"importar SQL","calc.editors.group.modal-sqldump.description":"Ponga su SQL-Dump aquí para crear un grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"ÁlgRel","calc.editors.ra.button-execute-query":"executar consulta","calc.editors.ra.button-execute-selection":"executar selección","calc.editors.ra.button-download":"descargar","calc.editors.ra.toolbar.projection":"proyección","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"selección","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renombrar relación / renombrar columnas","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.rename-columns-operator":"renombrar operador de columnas","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"ordenar por","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"agrupar por","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"y","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"ó","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"no","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"no es igual","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"mayor ó igual","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ó igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersecta","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"unión","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"división","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"resta","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\\\ ( B )
              \\n","calc.editors.ra.toolbar.cross-join":"cross join (cruzado)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"asignación","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"comentario de una línea","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"comentario de múltiples líneas","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"crear nuevo inline-relation utilizando editor incorporado","calc.editors.ra.toolbar.insert-date":"insertar fecha","calc.editors.ra.toolbar.insert-date-content":"","calc.editors.ra.toolbar.autoreplace-operators.title":"","calc.editors.ra.toolbar.autoreplace-operators.header":"","calc.editors.ra.toolbar.autoreplace-operators.none":"","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"ejecutar consulta","calc.editors.sql.button-execute-selection":"ejecutar selección","calc.editors.sql.button-download":"descargar","calc.editors.sql.toolbar.select":"seleccionar cláusula","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"cláusula from (desde)","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"cláusula where (donde)","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula agrupar por","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"teniendo cláusula","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula ordenar por","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"cláusula límite","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insertar fecha","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Cerrar","calc.editors.ra.inline-editor.title":"Editor de relaciones","calc.editors.ra.inline-editor.button-download-csv":"Descargar CSV","calc.editors.ra.inline-editor.button-upload-csv":"Subir CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nombre","calc.editors.ra.inline-editor.row-type":"Escriba","calc.editors.ra.inline-editor.input-relation-name":"Nombre de la relación","calc.navigation.imprint":"Imprimir"}')},"./src/locales/kr.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"변수 이름 중복: {{name}}","db.messages.parser.error-invalid-date-format":"\\"__str__\\" 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":" 헤더 중복: {{name}}","db.messages.parser.error-group-unknown-header":"알 수 없는 헤더: {{name}}","db.messages.parser.error-group-header-name-missing":"그룹 이름이 없음(group: ....)","db.messages.parser.error-group-header-name-empty":"그룹 이름은 비어있으면 안됨","db.messages.parser.error-group-non-unique-attribute":"__index__ 열에서 고유하지 않은 속성 {{name}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"문자열에 작은 따음표 사용","db.messages.parser.error-sql-invalid-relation-name":"\\"__str__\\"은 관계 이름으로 사용 할 수 없음","db.messages.parser.error-sql-invalid-column-name":"\\"__str__\\"은 열 이름으로 사용할 수 없음","db.messages.parser.error-sql-group-by-missing":"group by 없음","db.messages.parser.error-sql-having-without-group-by":"\\"group by\\" 또는 집계 없음","db.messages.parser.error-sql-negative-limit":"0 이상이어야 함","db.messages.parser.error-sqldump-invalid-column-number":"__line__ 에서 유효하지 않은 열","db.messages.parser.error-sqldump-invalid-type":"__line__ 에서 유효하지 않은 타입","db.messages.parser.error-sqldump-insert-wrong-number-columns":"값의 숫자 != 열의 숫자","db.messages.parser.error-valueexpr-like-operand-no-string":"LIKE의 오른쪽 피연산자는 문자열 리터럴이어야 함","db.messages.exec.error-column-not-unique":"모호성 때문에 열 \\"__column__\\" 을 추가할 수 없음","db.messages.exec.error-column-not-found-name":"스키마 __schema__ 에서 열 \\"__column__\\" 을 찾을 수 없음","db.messages.exec.error-column-not-found-index":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-column-ambiguous":"열 \\"__column__\\" 는 스키마 __schema__ 에서 모호함","db.messages.exec.error-column-index-out-of-range":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"모호성 때문에 릴레이션 가명 \\"__alias__\\"을 사용할 수 없음 ","db.messages.exec.error-could-not-rename-ambiguity":"스키마 __schema__ 에서의 모호성 때문에 \\"__oldName__\\"을 위한 새로운 이름 \\"__newName__\\" 을 설정 할 수 없음","db.messages.exec.error-schema-a-not-part-of-schema-b":"스키마 __schemaA__ 는 __schemaB__ 의 부분이 아님","db.messages.exec.error-schemas-not-unifiable":"스키마들은 통합될 수 없음: 타입들은 다르거나 사이즈들이 다르다: __schemaA__ 와 __schemaB__","db.messages.exec.error-column-not-in-both-schemas":"열 \\"__column__\\"은 두 스키마의 조인에서 찾을 수 없음","db.messages.exec.error-condition-must-be-boolean":"조건은 불린 대수여야만 함","db.messages.exec.error-func-not-defined-for-column-type":"__func_ _은 타입 __colType__ 을 위해 정의될 수 없음","db.messages.exec.error-join-would-produce-non-unique-columns":" Die folgenden Spalten sind teil beider Relationen: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"\\"__alias__.*\\"와 일치하는 열이 없음","db.messages.exec.error-datatype-not-specified-for-col":"열 __index__의 데이터 타입 (\\"__column__\\")이 구체화되지 않음","db.messages.exec.error-invalid-projection-error":"유효하지 않은 프로젝션 \\"__argument__\\": __error__","db.messages.exec.error-function-expects-type":"함수 \\"__func__\\"는 인자 타입 \\"__expected__\\" 으로 기대하지만 \\"__given__\\" 이 주어짐","db.messages.exec.error-could-not-compare-different-types":"타입이 다르면 비교할 수 없음: __typeA__ != __typeB__","db.messages.exec.error-function-expects-arguments-of-same-type":"__func__ 는 모든 인자가 같은 타입으로 기대함","db.messages.exec.error-case-when-condition-must-be-boolean":"CASE WHEN 조건은 불린 타입이어야 함","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END는 모든 결과가 같은 타입으로 기대함","db.messages.exec.error-invalid-date-format":"\\"__str__\\" 는 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"릴레이션 \\"{{name}}\\"을 찾을 수 없음","db.messages.translate.warning-distinct-missing":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.warning-ignored-all-on-set-operators":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.error-variable-name-conflict":"이름 충돌: 릴레이션 이름 \\"{{name}}\\" 은 이미 존재함","db.messages.translate.error-variable-cyclic-usage":"변수 \\"{{name}}\\"의 순환 사용이 감지됨","editor.codemirror-placeholder":"쿼리는 이곳에 표시된다 ...\\n\\n키보드 단축키:\\n\\tstatement 실행: [CTRL]+[RETURN]\\n\\tselection 실행: [CTRL]+[SHIFT]+[RETURN]\\n\\t자동 완성: [CTRL]+[SPACE]","editor.alert-message-headers.success":"성공","editor.alert-message-headers.info":"정보","editor.alert-message-headers.warning":"경고","editor.alert-message-headers.error":" 에러 ","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"취소","editor.inline-relation-editor.placeholder-column-name-and-types":"열 이름:타입","editor.inline-relation-editor.enter-your-data":"데이터를 입력하라","editor.inline-relation-editor.error-column-name-missing":"열 이름이 열 __index__에 없다","editor.inline-relation-editor.error-wrong-quoted-string":"문자열은 작은따음표와 큰따음표를 포함할 수 없다.","editor.error-no-query-found":"쿼리를 찾을 수 없다","editor.pegjs-error.or":"또는","editor.pegjs-error.no-input-found":"입력을 찾을 수 없음","editor.pegjs-error.end-of-input":"입력의 끝","editor.pegjs-error.expected-found":"예상 된 __expected__이지만 __found__이 발견됨.","editor.error-at-line-x":"__line__ 줄에서","calc.messages.error-query-missing":"쿼리를 찾을 수 없음","calc.messages.error-query-missing-assignments-found":"쿼리를 찾을 수 없음 Help - Assignments","calc.messages.gist-load-success":"gist 불러오기 완료","calc.menu.headline":"데이터셋 불러오기","calc.menu.datasets":"데이터셋 불러오기","calc.menu.load-gist-headline":"gist에 저장된 데이터셋 불러오기","calc.menu.load-gist-button":"불러오기","calc.menu.load-gist-insert-placeholder":"gist 아이디","calc.menu.create-own-dataset-headline":"데이터셋 생성하기","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"새로운 데이터셋 생성","calc.menu.create-own-dataset-button-modify":"현재 데이터셋 수정","calc.navigation.take-a-tour":"둘러보기","calc.navigation.feedback":"피드백","calc.navigation.help":"도움말","calc.navigation.calc":"Calculate","calc.navigation.language":"언어","calc.maintainer-groups.misc":"다른 종류","calc.maintainer-groups.temp":"임시","calc.maintainer-groups.uibk":"Innsbruck 대학교","calc.maintainer-groups.saarland":"Saarland 대학교","calc.editors.button-history":"기록","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"그룹 에디터","calc.editors.group.tab-name-short":"그룹 에디터","calc.editors.group.toolbar.import-sql":"SQL-덤프 가져오기","calc.editors.group.toolbar.import-sql-content":"SQL-컨텐트 가져오기","calc.editors.group.toolbar.add-new-relation":"새로운 릴레이션 추가","calc.editors.group.toolbar.add-new-relation-content":"릴레이션 에디터 열기","calc.editors.group.button-download":"다운로드","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"에디터에서 그룹 사용하기","calc.editors.group.button-use_plural":"에디터에서 여러 그룹 사용하기","calc.editors.group.sql-import-group-name-placeholder":"그룹 이름(SQL로부터 불러옴)","calc.editors.group.new-group-example-group":"-- 예시입니다\\n\\n그룹: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump 가져오기","calc.editors.group.modal-sqldump.button-close":"닫기","calc.editors.group.modal-sqldump.button-cancel":"취소","calc.editors.group.modal-sqldump.button-import-sql":"SQL 가져오기","calc.editors.group.modal-sqldump.description":"그룹을 생성하려면 SQL-Dump 이곳에 가져와라","calc.editors.ra.tab-name":"관계 대수","calc.editors.ra.tab-name-short":"관계 대수","calc.editors.ra.button-execute-query":"쿼리 실행","calc.editors.ra.button-execute-selection":"셀렉션 실행","calc.editors.ra.button-download":"다운로드","calc.editors.ra.toolbar.projection":"프로젝션","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"셀렉션","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"릴레이션 이름 변경 / 열 이름 변경","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.rename-columns-operator":"열 연산자 변경","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"정렬","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"그룹화","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"논리곱","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"배타적 논리","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"논리합","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"논리적 부정","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
              ","calc.editors.ra.toolbar.equals":"등호","calc.editors.ra.toolbar.equals-content":" a = b ( A )
              ","calc.editors.ra.toolbar.not-equals":"부등호","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
              ","calc.editors.ra.toolbar.greater-or-equals":"크거나 같다","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.lesser-or-equals":"작거나 같다","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.intersect":"교집합","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"합집합","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"디비전","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"차집합","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\\\ ( B )
              \\n","calc.editors.ra.toolbar.cross-join":"카디션 프로덕트","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"자연 조인 / θ-조인","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"왼쪽 외부 조인","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.right-outer-join":"오른쪽 외부 조인","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.full-outer-join":"완전 외부 조인","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"왼쪽 세미 조인","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"오른쪽 세미 조인","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"안티 조인","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"할당","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"한 줄 주석","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"여러 줄 주석","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"인라인-릴레이션","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"인라인-릴레이션 (에디터)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"날짜 삽입","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"쿼리 실행","calc.editors.sql.button-execute-selection":"셀렉션 실행","calc.editors.sql.button-download":"다운로드","calc.editors.sql.toolbar.select":"select 문","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from 문","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where 문","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by 문","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having 문","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order by 문","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit 문","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/pt.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nome de variável duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"cabeçalho duplicado {{name}}","db.messages.parser.error-group-unknown-header":"cabeçalho desconhecido {{name}}","db.messages.parser.error-group-header-name-missing":"o nome do grupo está faltando (group: ....)","db.messages.parser.error-group-header-name-empty":"o nome do grupo não pode ser vazio","db.messages.parser.error-group-non-unique-attribute":"atributo não único {{name}} na coluna {{index}}","db.messages.parser.error-group-non-unique-group-name":"nome de grupo duplicado: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use aspas simples para strings (caracteres/texto)","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" não pode ser usado como nome de relação","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" não pode ser usado como nome de coluna","db.messages.parser.error-sql-group-by-missing":"group by está faltando","db.messages.parser.error-sql-having-without-group-by":"“having” encontrado, mas sem \\"group by\\" ou agregação","db.messages.parser.error-sql-negative-limit":"o limite dado precisa ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de colunas na linha {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido na linha {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de colunas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando direito de LIKE deve ser uma string literal","db.messages.exec.error-column-not-unique":"não foi possível adicionar a coluna \\"{{column}}\\" devido a ambiguidade","db.messages.exec.error-column-not-found-name":"não foi possível encontrar a coluna \\"{{column}}\\" no esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-column-ambiguous":"coluna\\"{{column}}\\" é ambígua em {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"não foi possível definir o ”alias” da relação “{{alias}}” por causa da ambiguidade","db.messages.exec.error-could-not-rename-ambiguity":"não foi possível definir o novo nome \\"{{newName}}\\" para \\"{{oldName}}\\" devido a ambiguidade em {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} não é parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"os esquemas não são unificáveis: os tipos ou o tamanho diferem: {{schemaA}} e {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"coluna \\"{{column}}\\" não pode ser encontrada em ambos os esquemas de junção","db.messages.exec.error-condition-must-be-boolean":"condição deve ser uma expressão booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} não definida para o tipo {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"a junção resultaria em nomes de coluna não únicos","db.messages.exec.error-no-columns-match-alias-star":"nenhuma coluna corresponde a \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dados para a coluna {{index}} (\\"{{column}}\\") não foi especificado","db.messages.exec.error-invalid-projection-error":"projeção inválida \\"{{argument}}\\": {{erro}}","db.messages.exec.error-function-expects-type":"a função \\"{{func}}\\" espera argumentos do tipo \\"{{expected}}\\" mas \\"{{given}}\\" foi dado","db.messages.exec.error-could-not-compare-different-types":"não foi possível comparar o valor se os tipos forem diferentes: {{typeA}}! = {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos os argumentos sejam do mesmo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"a condição de um CASE WHEN deve ser do tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":" CASE WHEN condição THEN resultado END espera que todos os resultados sejam do mesmo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"não foi possível encontrar relação \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT está faltando","db.messages.translate.warning-ignored-all-on-set-operators":"ignorou ALL na operação definida","db.messages.translate.error-variable-name-conflict":"conflito de nomes: o nome da relação \\"{{name}}\\" já existe","db.messages.translate.error-variable-cyclic-usage":"uso cíclico da variável \\"{{name}}\\" detectado","editor.codemirror-placeholder":"Digite sua consulta aqui\\n\\nAtalhos do teclado:\\n\\texecutar declaraçãot: [CTRL]+[RETURN]\\n\\texecutar seleção: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Sucesso","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Perigo","editor.alert-message-headers.error":"Erro","editor.inline-relation-editor.button-ok":"Ok","editor.inline-relation-editor.button-cancel":"Cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"por favor, insira seus dados","editor.inline-relation-editor.error-column-name-missing":"nome da coluna ausente na coluna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string não deve conter aspas simples e duplas","editor.error-no-query-found":"nenhuma consulta encontrada","editor.pegjs-error.or":"ou","editor.pegjs-error.no-input-found":"nenhuma entrada encontrada","editor.pegjs-error.end-of-input":"fim da entrada","editor.pegjs-error.expected-found":"esperado {{expected}}, mas {{found}} encontrado.","editor.error-at-line-x":"na linha {{line}}","calc.messages.error-query-missing":"nenhuma consulta encontrada","calc.messages.error-query-missing-assignments-found":"apenas atribuições encontradas; falta a consulta Ajuda - Tarefas ","calc.messages.gist-load-success":"gist carregado com sucesso","calc.menu.headline":"Carregue um Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Carregar Dataset armazenado em um gist","calc.menu.load-gist-button":"Carregar","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Crie seu próprio Dataset","calc.menu.create-own-dataset-text":"Você pode criar seu próprio conjunto de dados e compartilhá-lo com outras pessoas. Saiba mais sobre isso no ","calc.menu.create-own-dataset-text-link":"Tutorial de manutenção","calc.menu.create-own-dataset-button-new":"Criar novo Dataset","calc.menu.create-own-dataset-button-modify":"Modificar Dataset","calc.navigation.take-a-tour":"Faça um Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ajuda","calc.navigation.calc":"Calcular","calc.navigation.language":"Linguagem","calc.maintainer-groups.misc":"Diversos","calc.maintainer-groups.temp":"Temporário","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"Histórico","calc.editors.insert-relation-title":"Inserir","calc.editors.insert-relation-tooltip":"Inserir relação ou nomes de coluna","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"Importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"Importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"+ nova relação","calc.editors.group.toolbar.add-new-relation-content":"Abrir editor de relações","calc.editors.group.button-download":"Download","calc.editors.group.button-exec":"Visualizar","calc.editors.group.button-use":"Use Grupo no Editor","calc.editors.group.button-use_plural":"Use o primeiro Grupo no Editor","calc.editors.group.sql-import-group-name-placeholder":"Nome do grupo (importado de SQL)","calc.editors.group.new-group-example-group":"– este é um exemplo\\n\\ngroup: nomeDoNovoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-dump","calc.editors.group.modal-sqldump.button-close":"Fechar","calc.editors.group.modal-sqldump.button-cancel":"Cancelar","calc.editors.group.modal-sqldump.button-import-sql":"Importar SQL","calc.editors.group.modal-sqldump.description":"Coloque seu SQL-Dump aqui para criar um grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"AlgRel","calc.editors.ra.button-execute-query":"Executar consulta","calc.editors.ra.button-execute-selection":"Executar seleção","calc.editors.ra.button-download":"Download","calc.editors.ra.toolbar.projection":"Projeção","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"Seleção","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renomear relação / renomear colunas","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.rename-columns-operator":"operador renomear colunas","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"ordenar (order by)","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"agrupar (group by)","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"e","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"ou exclusivo (xor)","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"ou","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"não","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"não igual","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"maior ou igual","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ou igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersecção","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"união","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"divisão","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"subtração","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"junção cruzada (cross join)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"atribuição","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"comentário em linha","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- comentário útil","calc.editors.ra.toolbar.multi-line-comment":"comentário multilinha","calc.editors.ra.toolbar.multi-line-comment-content":"/* este é um comentário longo,
              muito longo*/

              π a, b A","calc.editors.ra.toolbar.inline-relation":"relação aninhada","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"relação aninhada (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"criar uma nova relação aninhada usando o editor","calc.editors.ra.toolbar.insert-date":"inserir data","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"substituição de operador","calc.editors.ra.toolbar.autoreplace-operators.header":"substituir operadores automaticamente","calc.editors.ra.toolbar.autoreplace-operators.none":"sem substituição","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Executar consulta","calc.editors.sql.button-execute-selection":"Executar seleção","calc.editors.sql.button-download":"Download","calc.editors.sql.toolbar.select":"cláusula select","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"cláusula from","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"cláusula where","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula group by","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"cáusula having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula order by","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"cláusula limit","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"inserir data","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Fechar","calc.editors.ra.inline-editor.title":"Editor de Relação","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nome","calc.editors.ra.inline-editor.row-type":"Tipo","calc.editors.ra.inline-editor.input-relation-name":"Nome da Relação","calc.navigation.imprint":"Impressão"}')},0:function(e,t,n){e.exports=n("./src/calc2/calculator.entry.tsx")}}); \ No newline at end of file diff --git a/js/calc.b61e25e429566c9e70cd.bundle.js.gz b/js/calc.75808e4b525444cf6e03.bundle.js.gz similarity index 88% rename from js/calc.b61e25e429566c9e70cd.bundle.js.gz rename to js/calc.75808e4b525444cf6e03.bundle.js.gz index 30ae90674..16f2128db 100644 Binary files a/js/calc.b61e25e429566c9e70cd.bundle.js.gz and b/js/calc.75808e4b525444cf6e03.bundle.js.gz differ diff --git a/js/tests.b61e25e429566c9e70cd.bundle.js b/js/tests.75808e4b525444cf6e03.bundle.js similarity index 100% rename from js/tests.b61e25e429566c9e70cd.bundle.js rename to js/tests.75808e4b525444cf6e03.bundle.js diff --git a/js/tests.b61e25e429566c9e70cd.bundle.js.gz b/js/tests.75808e4b525444cf6e03.bundle.js.gz similarity index 100% rename from js/tests.b61e25e429566c9e70cd.bundle.js.gz rename to js/tests.75808e4b525444cf6e03.bundle.js.gz diff --git a/test.html b/test.html index a6a672534..e1de4aad9 100644 --- a/test.html +++ b/test.html @@ -11,9 +11,9 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - +
              - + diff --git a/test.html.gz b/test.html.gz index 23f80adc3..b008496fc 100644 Binary files a/test.html.gz and b/test.html.gz differ diff --git a/tests.b61e25e429566c9e70cd.css b/tests.75808e4b525444cf6e03.css similarity index 100% rename from tests.b61e25e429566c9e70cd.css rename to tests.75808e4b525444cf6e03.css diff --git a/tests.b61e25e429566c9e70cd.css.gz b/tests.75808e4b525444cf6e03.css.gz similarity index 100% rename from tests.b61e25e429566c9e70cd.css.gz rename to tests.75808e4b525444cf6e03.css.gz