{"version":3,"sources":["https://lively-kernel.org/lively4/swt21-debugging/src/client/lang/lang.js"],"names":["extend","_","self","that","extendFromLodash","obj","propNames","genFunc","name","args","toString","split","replace","shift","argsString","join","Function","definitionParts","map","propName","definition","Object","assign","pairComparator","pair1","pair2","first","second","pairsDiff","obj1","obj2","pairs1","toPairs","pairs2","onlyLeft","differenceWith","both","intersectionWith","onlyRight","prototype","deepProperty","paths","Array","isArray","at","get","pickProps","pick","computeDiff","other","arr","fromPairs","migrateTo","NewClass","constructor","__proto__","delay","wait","noop","identity","value","generatorPrototype","toArray","result","item","push","asyncGeneratorPrototype","HTMLElement","getJSONAttribute","str","getAttribute","JSON","parse","setJSONAttribute","json","setAttribute","stringify","Date","dayInWeek","offset","day","getDay","d","getDate","resultDay","setDate","mondayInWeek","tuesdayInWeek","wednesdayInWeek","thursdayInWeek","fridayInWeek","saturdayInWeek","sundayInWeek","toFormattedString","format","toStringWithTrailingZero","number","yyyy","getFullYear","yy","substr","MM","getMonth","dd","hh","getHours","mm","getMinutes","ss","getSeconds","Set","arrs","from","mapExtensions","getOrCreate","key","createCallback","has","set","Map","WeakMap","average","length","NaN","sum","third","last","intersect","arrays","intersection","otherArray","difference","removeAll","predicate","remove","zip","yieldAll","joinElements","builder","lastItem","index","count","filter","weightedSample","weightMapper","rest","weights","totalWeight","random","Math","i","undefined","getItem","partition","iteratee","groups","groupBy","pluck","property","NodeList","Number","to","end","step","range","remap","domainStart","domainEnd","rangeStart","rangeEnd","clip","Error","input","inRange","domainLower","domainUpper","clamp","percent","String","fetchText","options","fetch","then","r","text","fetchJSON","fetchStats","method","lines","Promise","through","func","val","URL","livelyInspect","contentNode","inspector","innerHTML","entries","lively","allKeys","node","display","appendChild","Animation","whenFinished","callback","resolve","onFinished","playState","addEventListener","findParent","condition","deep","allParents","find","g","c","call","originalGetComputedStyle","window","getComputedStyle","element"],"mappings":";;;;;;;AAASA,Y,YAAAA,M;;AACGC,O;;;;AAEZ;AACAC,WAAKC,IAAL,GAA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a,EAA1B,EAA8B;AACrC,eAAO,IAAI9I,QAAJ,CAAa,KAAb,EAAqB,cAAa8I,QAAS,EAA3C,CAAP;AACD,OAFD;;AAIA;;;;;;;;;;AAUA5J,WAAKuN,CAAL,GAAS,SAASC,IAAT,CAAc,CAAC5D,QAAD,IAAa,EAA3B,EAA+B;AACtC,eAAO,IAAI9I,QAAJ,CAAa,KAAb,EAAqB,cAAa8I,QAAS,IAA3C,CAAP;AACD,OAFD;;AAIA;AACA,UAAI5J,KAAKyN,wBAAT,EAAmC;;AAEjC;AACA,YAAI,CAACC,OAAOD,wBAAZ,EAAsC;AACpCC,iBAAOD,wBAAP,GAAkCC,OAAOC,gBAAzC;AACD;;AAED;AACA;AACAD,eAAOC,gBAAP,GAA0B,UAAS,GAAGpN,IAAZ,EAAkB;AAC1C,cAAIqN,UAAUrN,KAAK,CAAL,CAAd;AACA,cAAIqN,WAAW,EAAEA,mBAAmB3J,WAArB,CAAf,EAAkD;AAChD;;AAEA;AACA,mBAAOoF,SAAP;AACD;AACD,iBAAOqE,OAAOD,wBAAP,CAAgC,GAAGlN,IAAnC,CAAP;AACD,SATD;AAUD","file":"lang.js","sourcesContent":["import { extend } from './utils.js';\nimport * as _ from 'src/external/lodash/lodash.js';\n\n// ensure global variable 'that'\nself.that = self.that;\n\nfunction extendFromLodash(obj, propNames) {\n  function genFunc(name) {\n    const args = _[name].toString().split(/\\r?\\n/)[0].replace(/.*\\((.*)\\).*/,\"$1\").split(/, /)\n    args.shift();\n    const argsString = args.join(', ');\n    \n    return new Function('_', `return {\n  ${name}(${argsString}) {\n    return _.${name}(this, ${argsString});\n  }\n};`)(_);\n  }\n\n  const definitionParts = propNames.map(propName => genFunc(propName));\n  const definition = Object.assign({}, ...definitionParts);\n\n  return extend(obj, definition);\n}\n\n\nfunction pairComparator(pair1, pair2) {\n  return pair1.first === pair2.first && pair1.second === pair2.second;\n}\n\n/**\n * utility function used to compute turn Objects and\n */\nfunction pairsDiff(obj1, obj2) {\n  const pairs1 = obj1.toPairs();\n  const pairs2 = obj2.toPairs();\n\n  const onlyLeft = _.differenceWith(pairs1, pairs2, pairComparator);\n  const both = _.intersectionWith(pairs1, pairs2, pairComparator);\n  const onlyRight = _.differenceWith(pairs2, pairs1, pairComparator);\n\n  return [onlyLeft, both, onlyRight];\n}\n\n/*MD\n## OBJECT\nMD*/\nextendFromLodash(Object.prototype, [\n  'clone',\n  'cloneDeep',\n  'omit',\n  'toPairs'\n]);\n\nextend(Object.prototype, {\n  deepProperty(paths) {\n    if (Array.isArray(paths)) {\n      return _.at(this, paths);\n    } else {\n      return _.get(this, paths);\n    }\n  },\n\n  // `pick` clashes with the code mirror event \"pick\"\n  pickProps(paths) {\n    return _.pick(this, paths);\n  },\n\n  /**\n   * Computes a more fine-grained difference with a second Object (@link(other)).\n   * @param other (Object/Map) the Object to be compared to.\n   * @returns {Array} [onlyLeft, both, onlyRight] the three Objects corresponding to the respective side of comparison.\n   */\n  computeDiff(other) {\n    return pairsDiff(this, other).map(arr => _.fromPairs(arr));\n  },\n\n  /**\n   * Migrate the instance to the given class by adapting its prototype chain.\n   * @param newClass (Object) the class to migrate to.\n   */\n  migrateTo(NewClass) {\n    this.constructor === NewClass;\n    this.__proto__ = NewClass.prototype;\n  },\n\n});\n\n/*MD\n## FUNCTION\nMD*/\nextendFromLodash(Function.prototype, [\n  'debounce',\n  'defer',\n  /**\n   * @example <caption>Simple Memoization.</caption>\n   * // only consider second argument as key for memoization\n   * var sum = ((x, y) => x + y).memoize((x, y) => y);\n   * sum(1, 2);\n   * // => 3\n   * sum(2, 2);\n   * // => 3, same second argument\n   * sum(1, 3);\n   * // => 4, different second argument\n   */\n  'memoize',\n  'once',\n  'throttle'\n]);\n\nextend(Function.prototype, {\n\n  delay(wait, ...args) {\n    return _.delay(this, wait, args);\n  }\n\n});\n\nextend(Function, {\n\n  noop() { return void 0; },\n  identity(value) { return value; }\n\n});\n\n\n/*MD\n## GENERATOR\nMD*/\n\nconst generatorPrototype = (function*() {}).prototype.constructor;\n\nextend(generatorPrototype, {\n\n  toArray(...args) {\n    const result = [];\n\n    for (let item of this(...args)) {\n      result.push(item)\n    }\n\n    return result;\n  }\n\n});\n\n\n// #TODO: only written in this weird manner due to tooling not supporting async generators (parse error) #Tooling #Tools\nconst asyncGeneratorPrototype = (new Function(`return async function*() {};`))().prototype.constructor;\n\nextend(asyncGeneratorPrototype, new Function(`return {\n\n  async toArray(...args) {\n    const result = [];\n\n    for await (let item of this(...args)) {\n      result.push(item)\n    }\n\n    return result;\n  }\n\n};`)());\n\n/*MD\n## HTMLElement\nMD*/\nif (self.HTMLElement) {\n  extend(HTMLElement.prototype, {\n    getJSONAttribute(name) {\n      let str = this.getAttribute(name);\n      if(str) { return JSON.parse(str); }\n      return null;\n    },\n\n    setJSONAttribute(name, json) {\n      this.setAttribute(name, JSON.stringify(json));\n      return json;\n    }\n  })  \n}\n\n/*MD\n## DATE\nMD*/\nextend(Date.prototype, {\n  \n  dayInWeek(offset) {\n    let day = this.getDay()\n    if (day === 0) { day = 7; } // sunday is the end of the week\n    \n    const d = this.getDate();\n\n    const resultDay = new Date(this);\n    resultDay.setDate(d-day + offset);\n\n    return resultDay;\n  },\n\n  mondayInWeek(){ return this.dayInWeek(1); },\n  tuesdayInWeek(){ return this.dayInWeek(2); },\n  wednesdayInWeek(){ return this.dayInWeek(3); },\n  thursdayInWeek(){ return this.dayInWeek(4); },\n  fridayInWeek(){ return this.dayInWeek(5); },\n  saturdayInWeek(){ return this.dayInWeek(6); },\n  sundayInWeek(){ return this.dayInWeek(7); },\n\n  toFormattedString(format){\n    function toStringWithTrailingZero(number) {\n      return (number < 10 ? \"0\" : \"\") + number;\n    }\n\n    const yyyy = this.getFullYear();\n    const yy = yyyy.toString().substr(-2);\n    const MM = toStringWithTrailingZero(this.getMonth() + 1);\n    const dd = toStringWithTrailingZero(this.getDate());\n    const hh = toStringWithTrailingZero(this.getHours());\n    const mm = toStringWithTrailingZero(this.getMinutes());\n    const ss = toStringWithTrailingZero(this.getSeconds());\n    \n    return format\n      .replace(/yyyy/g, yyyy)\n      .replace(/yy/g, yy)\n      .replace(/MM/g, MM)\n      .replace(/dd/g, dd)\n      .replace(/hh/g, hh)\n      .replace(/mm/g, mm)\n      .replace(/ss/g, ss);\n  }\n  \n});\n\n\n/*MD\n# SET\nMD*/\nextend(Set.prototype, {\n\n  /**\n   * Computes a more fine-grained difference with a second Set (@link(other)).\n   * @param other (Set) the Set to be compared to.\n   * @returns {Array} [onlyLeft, both, onlyRight] the three Sets corresponding to the respective side of comparison.\n   */\n  computeDiff(other) {\n    const arrs = Array.from(this).computeDiff(other);\n    return arrs.map(arr => new Set(arr));\n  },\n\n});\n\n\n/*MD\n## MAP/WEAKMAP\nMD*/\nconst mapExtensions = {\n  \n  /**\n   * Tries to get the value stored for the @link(key).\n   * If this fails, generate a new value using the povided callback.\n   *\n   * @public\n   * @param key (*) the key to get the value\n   * @param createCallback (Function) if no value for @link(key) is available, gets the @link(key) to create a value\n   * @returns {*} the value stored for the key\n   */\n  getOrCreate(key, createCallback) {\n    if (!this.has(key)) {\n      this.set(key, createCallback(key));\n    }\n\n    return this.get(key);\n  }\n  \n};\n\nextend(Map.prototype, mapExtensions);\nextend(WeakMap.prototype, mapExtensions);\n\nextend(Map.prototype, {\n\n  /**\n   * Computes a more fine-grained difference with a second Map (@link(other)).\n   * @param other (Object/Map) the Set to be compared to.\n   * @returns {Array} [onlyLeft, both, onlyRight] the three Maps corresponding to the respective side of comparison.\n   */\n  computeDiff(other) {\n    return pairsDiff(this, other).map(arr => new Map(arr));\n  },\n\n});\n\n\n/*MD\n## ARRAY\nMD*/\nextendFromLodash(Array.prototype, [\n  'compact',\n  'sortBy',\n  'difference',\n  'groupBy',\n  'countBy',\n  'isEmpty',\n  'max',\n  'min',\n  'maxBy',\n  'minBy',\n  'sample',\n  'sampleSize',\n  'shuffle',\n  'sum',\n  'sumBy',\n  'uniq',\n  'uniqBy',\n  'uniqWith',\n]);\n\nextend(Array.prototype, {\n\n  average() {\n    if (this.length === 0) {\n      return NaN;\n    } else {\n      return this.sum() / this.length;\n    }\n  },\n\n  get first() { return this[0]; },\n  set first(value) { return this[0] = value; },\n\n  get second() { return this[1]; },\n  set second(value) { return this[1] = value; },\n\n  get third() { return this[2]; },\n  set third(value) { return this[2] = value; },\n\n  get last() { return this[this.length - 1]; },\n  set last(value) { return this[this.length - 1] = value; },\n\n  intersect(...arrays) {\n    return _.intersection(this, ...arrays);\n  },\n\n  /**\n   * Computes a more fine-grained difference with a second Array.\n   * @param other (Array/Set) the Array to be compared to.\n   * @returns {Array} [onlyLeft, both, onlyRight].\n   */\n  computeDiff(other) {\n    const otherArray = Array.from(other);\n    \n    const onlyLeft = _.difference(this, otherArray);\n    const both = _.intersection(this, otherArray);\n    const onlyRight = _.difference(otherArray, this);\n\n    return [onlyLeft, both, onlyRight];\n  },\n\n  /**\n   * Removes all elements from array (mutates!) that predicate returns truthy for and returns an array of the removed elements.\n   * @param predicate (Function<value, index, array -> Boolean>) return true to remove given element.\n   * @returns {Array} The removed elements.\n   */\n  removeAll(predicate) {\n    return _.remove(this, predicate);\n  },\n\n  zip(...arrays) {\n    return _.zip(this, ...arrays);\n  },\n  \n  /**\n   * A generator yielding all items in this array. For propagating.\n   * @example <caption>Propagating yield* statements to items.</caption>\n   * function* example(arr) {\n   *   yield* arr.yieldAll();\n   * }\n   *\n   * for (let item of example([1,2,3])) {\n   *   lively.notify(item);\n   * }\n   */\n  *yieldAll() {\n    for (let item of this) {\n      yield item;\n    }\n  },\n\n  /**\n   *\n   */\n  joinElements(builder) {\n    const result = [];\n    let lastItem;\n    let index = 0;\n    for (let item of this) {\n      // not the first item\n      if (result.length > 0) {\n        result.push(builder(lastItem, item, index++, this));\n      }\n      result.push(item);\n      lastItem = item;\n    }\n    return result;\n  },\n\n  /**\n   * Counts the number of items that satisfy the given condition.\n   * @param predicate (Function<value, index, array -> Boolean>) return true count the element.\n   * @returns {Number} Counted number of elements.\n   */\n  count(predicate) {\n    return this.filter(predicate).length;\n  },\n  \n  /**\n   * Randomly selects an item, considering the given weight function.\n   * @param weightMapper (Function<value, index, array -> Number>) standard mapping callback to calculate the weight of each item.\n   * @returns {any} The selected item from the Array.\n   */\n  weightedSample(weightMapper = () => 1, ...rest) {\n    const weights = this.map(weightMapper, ...rest);\n    \n    let totalWeight = weights.sum();\n    let random = Math.random() * totalWeight;\n\n    for (let i = 0; i < weights.length; i++) {\n      if (random < weights[i]) {\n        return this[i];\n      }\n\n      random -= weights[i];\n    }\n\n    return undefined;\n  },\n  \n  getItem(index) {\n    const length = this.length;\n    const i = ((index % length) + length) % length;\n    return this[i];\n  },\n\n  /**\n   * Splits the array into two arrays, first contains all items that evaluated the predicate to `true`, the second all that evaluated to false.\n   * @param predicate (Function<value, index, array -> Boolean>) standard mapping callback to calculate the weight of each item.\n   * @returns {<Array, Array>} The two Arrays as Array.\n   */\n  partition(predicate=_.identity) {\n    predicate = _.iteratee(predicate);\n    const groups = this.groupBy((...args) => !!predicate(...args));\n    return [groups[true] || [], groups[false] || []];\n  },\n\n  /**\n   * Map all items to the specified @property.\n   * @param property (String) the property to be applied.\n   * @returns {Array<any>} The extracted properties.\n   */\n  pluck(property=_.identity) {\n    return this.map(_.iteratee(property))\n  }\n});\n\n/*MD # Array-like MD*/\nif (self.NodeList) {\n  extendFromLodash(NodeList.prototype, [\n    'map',\n    'filter',\n    'reduce',\n    'find'\n  ]);\n}\n/*MD\n## NUMBER\nMD*/\nextendFromLodash(Number.prototype, [\n  'ceil',\n  'clamp',\n  'floor',\n  'inRange',\n  'round',\n  'times'\n]);\n\nextend(Number.prototype, {\n  \n  to(end, step) {\n    return _.range(this, end, step);\n  },\n  \n  remap([domainStart, domainEnd] = [], [rangeStart, rangeEnd] = [], clip = false) {\n    if (domainStart === domainEnd) { throw new Error('domain start and end are equal'); }\n    \n    let input = this;\n    if (clip && !this.inRange(domainStart, domainEnd)) {\n      const domainLower = domainStart < domainEnd ? domainStart : domainEnd;\n      const domainUpper = domainEnd > domainStart ? domainEnd : domainStart;\n      input = this.clamp(domainLower, domainUpper);\n    }\n\n    const percent = (input - domainStart) / (domainEnd - domainStart);\n    let result = percent * (rangeEnd - rangeStart) + rangeStart;\n    return result;\n  }\n\n});\n\n\n/*MD\n## STRING\nMD*/\nextendFromLodash(String.prototype, [\n  'camelCase',\n  'capitalize',\n  'kebabCase',\n  'lowerCase',\n  'lowerFirst',\n  'snakeCase',\n  'startCase',\n  'toLower',\n  'toUpper',\n  'upperCase',\n  'upperFirst',\n  'words',\n]);\n\nextend(String.prototype, {\n\n  /**\n   * \n   * @public\n   * @param options (*) the optional options object containing any custom settings that you want to apply to the request\n   * @returns {Promise<String>} the remote resource as String\n   * \n   * @example <caption>Get lively start.html.</caption>\n   * (lively4url + \"/start.html\").fetchText();\n   */\n  fetchText(options) {\n    return fetch(this, options).then(r => r.text());\n  },\n\n  /**\n   * \n   * @public\n   * @param options (*) the optional options object containing any custom settings that you want to apply to the request\n   * @returns {Promise<JSON>} the remote resource as JSON\n   * \n   * @example <caption>Get d3 flare.json.</caption>\n   * (lively4url + \"/src/components/demo/flare.json\").fetchJSON();\n   */\n  fetchJSON(options) {\n    return fetch(this, options).then(r => r.json());\n  },\n  \n  /**\n   * Get file info for a remote file or directory.\n   * @public\n   * @example <caption>Get file info of start.html.</caption>\n   * const startHTML = lively4url + '/start.html';\n   * startHTML.fetchStats();\n   */\n  fetchStats(options) {\n    return this.fetchJSON(Object.assign({ method: 'OPTIONS' }, options));\n  },\n  \n  /**\n   * Split the String by line breaks.\n   * @public\n   * @returns {Array<String>} the resulting lines of the String\n   * @example <caption>Split Hello World.</caption>\n   * const str = `Hello\\nWorld\n   * !`;\n   * str.lines(); // -> ['Hello', 'World', '!']\n   */\n  lines() {\n    return this.split(/\\n/ig);\n  }\n\n});\n\n\n/*MD\n## PROMISE\nMD*/\nextend(Promise.prototype, {\n\n  /**\n   * Awaits the promise, and return a promise after calling func.\n   * @example <caption>Example usage on Promises.</caption>\n   * fetch(\"https://lively-kernel.org/lively4/lively4-core/start.html\")\n   *   .through(lively.notify) // prints the response object\n   *   .then(t=>t.text())\n   *   .through(lively.notify); // prints the content\n   */\n  through(func, ...args) {\n    return this.then(val => (func(val, ...args), val));\n  }\n\n});\n\n\n/*MD\n## URL\nMD*/\nextend(URL.prototype, {\n\n  // hook for rendering the internals of an object in the inspector\n  livelyInspect(contentNode, inspector) {\n    contentNode.innerHTML = \"\"\n    var entries = lively.allKeys(this);\n    for(let key of entries) {\n      const node = inspector.display(this[key], true, key)\n      if (node) contentNode.appendChild(node);   \n    }\n  }\n\n});\n\n/*MD\n## Animation\nMD*/\n\nif(self.Animation) {\n  extend(Animation.prototype, {\n\n    /**\n     * React to the finish of the animation using a Promise.\n     * @param callback (Function) a callback invoked at the end of the animation.\n     * @returns {Promise} a Promise resolving when the animation finishes.\n     */\n    whenFinished(callback = () => {}) {\n      return new Promise(resolve => {\n        const onFinished = () => {\n          callback();\n          resolve();\n        }\n\n        if (this.playState === \"finished\") {\n          onFinished();\n        } else {\n          this.addEventListener('finish', onFinished);\n        }\n      });\n    },\n\n  });  \n}\n\n/*MD ## HTMLElement MD*/\nextend(HTMLElement.prototype, {\n\n  findParent(condition, deep = true) {\n    return lively.allParents(this, undefined, deep).find(condition)\n  }\n\n});\n/*MD ## Strings as Selectors MD*/\n\n/**\n * When using in a tagged template string, create an accessor function\n * for given string\n * @param property (Array<String>) the property to create a function for.\n * @returns {Function<any> -> <any>} an iteratee to access given property.\n * @example <caption>Get All Children of All Top-level Divs.</caption>\n * const topLevelDivs = [...document.querySelectorAll('body > div')]\n * topLevelDivs.flatMap(g`children`)\n * // instead of topLevelDivs.flatMap(div => div.children)\n */\nself.g = function get([property] = []) {\n  return new Function('obj', `return obj.${property}`);\n}\n\n/**\n * When using in a tagged template string, create an accessor function\n * the calls and returns the method for given string\n * @param property (Array<String>) the property to create a function for.\n * @returns {Function<any> -> <any>} an iteratee to access given property.\n * @example <caption>Remove All Top-level Divs.</caption>\n * const topLevelDivs = [...document.querySelectorAll('body > div')]\n * topLevelDivs.forEach(c`remove`)\n * // instead of topLevelDivs.forEach(div => div.remove())\n */\nself.c = function call([property] = []) {\n  return new Function('obj', `return obj.${property}()`);\n}\n\n/*MD ## Hacks MD*/\nif (self.originalGetComputedStyle) {\n\n  // #TODO poor man's COP: #ContextJS is not suited to layer functions #TODO\n  if (!window.originalGetComputedStyle) {\n    window.originalGetComputedStyle = window.getComputedStyle  \n  }\n\n  // #Hack #drawio \n  // drawio tries to get the style of the shadow root... which fails\n  window.getComputedStyle = function(...args) {\n    var element = args[0]\n    if (element && !(element instanceof HTMLElement)) {\n      // console.log(\"ERROR on getComputedStyle ON \", element)\n\n      // silent fail...\n      return undefined\n    }\n    return window.originalGetComputedStyle(...args)\n  }  \n}\n"]}