From cd04be23cd4fe98bcef1ad13450d683b19bc2989 Mon Sep 17 00:00:00 2001 From: "masaki.shinke" Date: Sun, 14 Oct 2018 01:41:25 +0900 Subject: [PATCH] use let --- cat.js | 61 + cat.ts | 77 +- chat.web.js | 27054 ++++++++++++++++++++++++++++++++++++++++++++++++++ greeter.ts | 3 +- sample.ts | 16 +- test.css | 0 test.html | 41 + 7 files changed, 27228 insertions(+), 24 deletions(-) create mode 100644 cat.js create mode 100644 chat.web.js create mode 100644 test.css create mode 100644 test.html diff --git a/cat.js b/cat.js new file mode 100644 index 0000000..0533097 --- /dev/null +++ b/cat.js @@ -0,0 +1,61 @@ +var Hello = (function () { + function Hello(name) { + this.name = name; + } + Object.defineProperty(Hello.prototype, "age", { + get: function () { + return this._age; + }, + set: function (value) { + this._age = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Hello.prototype, "test", { + get: function () { + return this._test; + }, + set: function (value) { + this._test = value; + }, + enumerable: true, + configurable: true + }); + Hello.prototype.getHelloString = function () { + return "Hello, " + name + "!"; + }; + Hello.prototype.say = function () { + return this.getHelloString(); + }; + return Hello; +}()); +var helloKei1 = new Hello("計"); +helloKei1.age = 17; +var words = helloKei1.say(); +var age = helloKei1.age; +var List = (function () { + function List() { + this.data = []; + } + List.prototype.add = function (item) { + this.data.push(item); + }; + List.prototype.get = function (index) { + return this.data[index]; + }; + return List; +}()); +var dateList = new List(); +dateList.add(new Date()); +var d = dateList.get(0); +var nameList = new List(); +nameList.add("kei"); +var n = nameList.get(0); +var str = window.prompt('入力してください'); +showStr(str); +function showStr(str) { + alert(str); +} +function test() { +} diff --git a/cat.ts b/cat.ts index ef9fd93..f113c36 100644 --- a/cat.ts +++ b/cat.ts @@ -1,20 +1,61 @@ -interface IAnimal { - name: string; - makeSound(): string; +let Hello = (function () { + function Hello(name) { + this.name = name; + } + Object.defineProperty(Hello.prototype, "age", { + get: function () { + return this._age; + }, + set: function (value) { + this._age = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Hello.prototype, "test", { + get: function () { + return this._test; + }, + set: function (value) { + this._test = value; + }, + enumerable: true, + configurable: true + }); + Hello.prototype.getHelloString = function () { + return "Hello, " + name + "!"; + }; + Hello.prototype.say = function () { + return this.getHelloString(); + }; + return Hello; +}()); +let helloKei1 = new Hello("計"); +helloKei1.age = 17; +let words = helloKei1.say(); +let age = helloKei1.age; +let List = (function () { + function List() { + this.data = []; + } + List.prototype.add = function (item) { + this.data.push(item); + }; + List.prototype.get = function (index) { + return this.data[index]; + }; + return List; +}()); +let dateList = new List(); +dateList.add(new Date()); +let d = dateList.get(0); +let nameList = new List(); +nameList.add("kei"); +let n = nameList.get(0); +let str = window.prompt('入力してください'); +showStr(str); +function showStr(str) { + alert(str); } - -class Cat implements IAnimal { - public name: string; - constructor(name: string) { - this.name = name; - } - public makeSound(): string { - return "nyaaaa"; - }; +function test() { } - - -var myCat : IAnimal; -myCat = new Cat("kotetu"); - -var sound = myCat.makeSound(); diff --git a/chat.web.js b/chat.web.js new file mode 100644 index 0000000..5f4452c --- /dev/null +++ b/chat.web.js @@ -0,0 +1,27054 @@ +/*! +* GREE Chat +* (c) GREE, Inc. +* +* @author Toru Furuya @toru_furuya +* */ +/** + * UUID.js: The RFC-compliant UUID generator for JavaScript. + * + * @fileOverview + * @author LiosK + * @version v3.3.0 + * @license The MIT License: Copyright (c) 2010-2016 LiosK. + */ + +/** @constructor */ +var UUID; + +UUID = (function(overwrittenUUID) { +"use strict"; + +// Core Component {{{ + +/** @lends UUID */ +function UUID() {} + +/** + * The simplest function to get an UUID string. + * @returns {string} A version 4 UUID string. + */ +UUID.generate = function() { + var rand = UUID._getRandomInt, hex = UUID._hexAligner; + return hex(rand(32), 8) // time_low + + "-" + + hex(rand(16), 4) // time_mid + + "-" + + hex(0x4000 | rand(12), 4) // time_hi_and_version + + "-" + + hex(0x8000 | rand(14), 4) // clock_seq_hi_and_reserved clock_seq_low + + "-" + + hex(rand(48), 12); // node +}; + +/** + * Returns an unsigned x-bit random integer. + * @param {int} x A positive integer ranging from 0 to 53, inclusive. + * @returns {int} An unsigned x-bit random integer (0 <= f(x) < 2^x). + */ +UUID._getRandomInt = function(x) { + if (x < 0) return NaN; + if (x <= 30) return (0 | Math.random() * (1 << x)); + if (x <= 53) return (0 | Math.random() * (1 << 30)) + + (0 | Math.random() * (1 << x - 30)) * (1 << 30); + return NaN; +}; + +/** + * Returns a function that converts an integer to a zero-filled string. + * @param {int} radix + * @returns {function(num, length)} + */ +UUID._getIntAligner = function(radix) { + return function(num, length) { + var str = num.toString(radix), i = length - str.length, z = "0"; + for (; i > 0; i >>>= 1, z += z) { if (i & 1) { str = z + str; } } + return str; + }; +}; + +UUID._hexAligner = UUID._getIntAligner(16); + +// }}} + +// UUID Object Component {{{ + +/** + * Names of each UUID field. + * @type string[] + * @constant + * @since 3.0 + */ +UUID.FIELD_NAMES = ["timeLow", "timeMid", "timeHiAndVersion", + "clockSeqHiAndReserved", "clockSeqLow", "node"]; + +/** + * Sizes of each UUID field. + * @type int[] + * @constant + * @since 3.0 + */ +UUID.FIELD_SIZES = [32, 16, 16, 8, 8, 48]; + +/** + * Generates a version 4 {@link UUID}. + * @returns {UUID} A version 4 {@link UUID} object. + * @since 3.0 + */ +UUID.genV4 = function() { + var rand = UUID._getRandomInt; + return new UUID()._init(rand(32), rand(16), // time_low time_mid + 0x4000 | rand(12), // time_hi_and_version + 0x80 | rand(6), // clock_seq_hi_and_reserved + rand(8), rand(48)); // clock_seq_low node +}; + +/** + * Converts hexadecimal UUID string to an {@link UUID} object. + * @param {string} strId UUID hexadecimal string representation ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"). + * @returns {UUID} {@link UUID} object or null. + * @since 3.0 + */ +UUID.parse = function(strId) { + var r, p = /^\s*(urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(\})?\s*$/i; + if (r = p.exec(strId)) { + var l = r[1] || "", t = r[8] || ""; + if (((l + t) === "") || + (l === "{" && t === "}") || + (l.toLowerCase() === "urn:uuid:" && t === "")) { + return new UUID()._init(parseInt(r[2], 16), parseInt(r[3], 16), + parseInt(r[4], 16), parseInt(r[5], 16), + parseInt(r[6], 16), parseInt(r[7], 16)); + } + } + return null; +}; + +/** + * Initializes {@link UUID} object. + * @param {uint32} [timeLow=0] time_low field (octet 0-3). + * @param {uint16} [timeMid=0] time_mid field (octet 4-5). + * @param {uint16} [timeHiAndVersion=0] time_hi_and_version field (octet 6-7). + * @param {uint8} [clockSeqHiAndReserved=0] clock_seq_hi_and_reserved field (octet 8). + * @param {uint8} [clockSeqLow=0] clock_seq_low field (octet 9). + * @param {uint48} [node=0] node field (octet 10-15). + * @returns {UUID} this. + */ +UUID.prototype._init = function() { + var names = UUID.FIELD_NAMES, sizes = UUID.FIELD_SIZES; + var bin = UUID._binAligner, hex = UUID._hexAligner; + + /** + * List of UUID field values (as integer values). + * @type int[] + */ + this.intFields = new Array(6); + + /** + * List of UUID field values (as binary bit string values). + * @type string[] + */ + this.bitFields = new Array(6); + + /** + * List of UUID field values (as hexadecimal string values). + * @type string[] + */ + this.hexFields = new Array(6); + + for (var i = 0; i < 6; i++) { + var intValue = parseInt(arguments[i] || 0); + this.intFields[i] = this.intFields[names[i]] = intValue; + this.bitFields[i] = this.bitFields[names[i]] = bin(intValue, sizes[i]); + this.hexFields[i] = this.hexFields[names[i]] = hex(intValue, sizes[i] / 4); + } + + /** + * UUID version number defined in RFC 4122. + * @type int + */ + this.version = (this.intFields.timeHiAndVersion >> 12) & 0xF; + + /** + * 128-bit binary bit string representation. + * @type string + */ + this.bitString = this.bitFields.join(""); + + /** + * Non-delimited hexadecimal string representation ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"). + * @type string + * @since v3.3.0 + */ + this.hexNoDelim = this.hexFields.join(""); + + /** + * UUID hexadecimal string representation ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"). + * @type string + */ + this.hexString = this.hexFields[0] + "-" + this.hexFields[1] + "-" + this.hexFields[2] + + "-" + this.hexFields[3] + this.hexFields[4] + "-" + this.hexFields[5]; + + /** + * UUID string representation as a URN ("urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"). + * @type string + */ + this.urn = "urn:uuid:" + this.hexString; + + return this; +}; + +UUID._binAligner = UUID._getIntAligner(2); + +/** + * Returns UUID string representation. + * @returns {string} {@link UUID#hexString}. + */ +UUID.prototype.toString = function() { return this.hexString; }; + +/** + * Tests if two {@link UUID} objects are equal. + * @param {UUID} uuid + * @returns {bool} True if two {@link UUID} objects are equal. + */ +UUID.prototype.equals = function(uuid) { + if (!(uuid instanceof UUID)) { return false; } + for (var i = 0; i < 6; i++) { + if (this.intFields[i] !== uuid.intFields[i]) { return false; } + } + return true; +}; + +// }}} + +// UUID Version 1 Component {{{ + +/** + * Generates a version 1 {@link UUID}. + * @returns {UUID} A version 1 {@link UUID} object. + * @since 3.0 + */ +UUID.genV1 = function() { + var now = new Date().getTime(), st = UUID._state; + if (now != st.timestamp) { + if (now < st.timestamp) { st.sequence++; } + st.timestamp = now; + st.tick = UUID._getRandomInt(4); + } else if (Math.random() < UUID._tsRatio && st.tick < 9984) { + // advance the timestamp fraction at a probability + // to compensate for the low timestamp resolution + st.tick += 1 + UUID._getRandomInt(4); + } else { + st.sequence++; + } + + // format time fields + var tf = UUID._getTimeFieldValues(st.timestamp); + var tl = tf.low + st.tick; + var thav = (tf.hi & 0xFFF) | 0x1000; // set version '0001' + + // format clock sequence + st.sequence &= 0x3FFF; + var cshar = (st.sequence >>> 8) | 0x80; // set variant '10' + var csl = st.sequence & 0xFF; + + return new UUID()._init(tl, tf.mid, thav, cshar, csl, st.node); +}; + +/** + * Re-initializes version 1 UUID state. + * @since 3.0 + */ +UUID.resetState = function() { + UUID._state = new UUID._state.constructor(); +}; + +/** + * Probability to advance the timestamp fraction: the ratio of tick movements to sequence increments. + * @type float + */ +UUID._tsRatio = 1 / 4; + +/** + * Persistent state for UUID version 1. + * @type UUIDState + */ +UUID._state = new function UUIDState() { + var rand = UUID._getRandomInt; + this.timestamp = 0; + this.sequence = rand(14); + this.node = (rand(8) | 1) * 0x10000000000 + rand(40); // set multicast bit '1' + this.tick = rand(4); // timestamp fraction smaller than a millisecond +}; + +/** + * @param {Date|int} time ECMAScript Date Object or milliseconds from 1970-01-01. + * @returns {object} + */ +UUID._getTimeFieldValues = function(time) { + var ts = time - Date.UTC(1582, 9, 15); + var hm = ((ts / 0x100000000) * 10000) & 0xFFFFFFF; + return { low: ((ts & 0xFFFFFFF) * 10000) % 0x100000000, + mid: hm & 0xFFFF, hi: hm >>> 16, timestamp: ts }; +}; + +// }}} + +// Misc. Component {{{ + +/** + * Reinstalls {@link UUID.generate} method to emulate the interface of UUID.js version 2.x. + * @since 3.1 + * @deprecated Version 2.x. compatible interface is not recommended. + */ +UUID.makeBackwardCompatible = function() { + var f = UUID.generate; + UUID.generate = function(o) { + return (o && o.version == 1) ? UUID.genV1().hexString : f.call(UUID); + }; + UUID.makeBackwardCompatible = function() {}; +}; + +/** + * Preserves the value of 'UUID' global variable set before the load of UUID.js. + * @since 3.2 + * @type object + */ +UUID.overwrittenUUID = overwrittenUUID; + +// }}} + +return UUID; + +})(UUID); + +// vim: et ts=2 sw=2 fdm=marker fmr& + +/*! + * EventEmitter v4.2.11 - git.io/ee + * Unlicense - http://unlicense.org/ + * Oliver Caldwell - http://oli.me.uk/ + * @preserve + */ + +;(function () { + 'use strict'; + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + function EventEmitter() {} + + // Shortcuts to improve speed and size + var proto = EventEmitter.prototype; + var exports = this; + var originalGlobalValue = exports.EventEmitter; + + /** + * Finds the index of the listener for the event in its storage array. + * + * @param {Function[]} listeners Array of listeners to search through. + * @param {Function} listener Method to look for. + * @return {Number} Index of the specified listener, -1 if not found + * @api private + */ + function indexOfListener(listeners, listener) { + var i = listeners.length; + while (i--) { + if (listeners[i].listener === listener) { + return i; + } + } + + return -1; + } + + /** + * Alias a method while keeping the context correct, to allow for overwriting of target method. + * + * @param {String} name The name of the target method. + * @return {Function} The aliased method + * @api private + */ + function alias(name) { + return function aliasClosure() { + return this[name].apply(this, arguments); + }; + } + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + proto.getListeners = function getListeners(evt) { + var events = this._getEvents(); + var response; + var key; + + // Return a concatenated array of all matching events if + // the selector is a regular expression. + if (evt instanceof RegExp) { + response = {}; + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + response[key] = events[key]; + } + } + } + else { + response = events[evt] || (events[evt] = []); + } + + return response; + }; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + proto.flattenListeners = function flattenListeners(listeners) { + var flatListeners = []; + var i; + + for (i = 0; i < listeners.length; i += 1) { + flatListeners.push(listeners[i].listener); + } + + return flatListeners; + }; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in an object. + */ + proto.getListenersAsObject = function getListenersAsObject(evt) { + var listeners = this.getListeners(evt); + var response; + + if (listeners instanceof Array) { + response = {}; + response[evt] = listeners; + } + + return response || listeners; + }; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListener = function addListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var listenerIsWrapped = typeof listener === 'object'; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { + listeners[key].push(listenerIsWrapped ? listener : { + listener: listener, + once: false + }); + } + } + + return this; + }; + + /** + * Alias of addListener + */ + proto.on = alias('addListener'); + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after its first execution. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addOnceListener = function addOnceListener(evt, listener) { + return this.addListener(evt, { + listener: listener, + once: true + }); + }; + + /** + * Alias of addOnceListener. + */ + proto.once = alias('addOnceListener'); + + /** + * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {String} evt Name of the event to create. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvent = function defineEvent(evt) { + this.getListeners(evt); + return this; + }; + + /** + * Uses defineEvent to define multiple events. + * + * @param {String[]} evts An array of event names to define. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvents = function defineEvents(evts) { + for (var i = 0; i < evts.length; i += 1) { + this.defineEvent(evts[i]); + } + return this; + }; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} evt Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListener = function removeListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var index; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + index = indexOfListener(listeners[key], listener); + + if (index !== -1) { + listeners[key].splice(index, 1); + } + } + } + + return this; + }; + + /** + * Alias of removeListener + */ + proto.off = alias('removeListener'); + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListeners = function addListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(false, evt, listeners); + }; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListeners = function removeListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(true, evt, listeners); + }; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { + var i; + var value; + var single = remove ? this.removeListener : this.addListener; + var multiple = remove ? this.removeListeners : this.addListeners; + + // If evt is an object then pass each of its properties to this method + if (typeof evt === 'object' && !(evt instanceof RegExp)) { + for (i in evt) { + if (evt.hasOwnProperty(i) && (value = evt[i])) { + // Pass the single listener straight through to the singular method + if (typeof value === 'function') { + single.call(this, i, value); + } + else { + // Otherwise pass back to the multiple function + multiple.call(this, i, value); + } + } + } + } + else { + // So evt must be a string + // And listeners must be an array of listeners + // Loop over it and pass each one to the multiple method + i = listeners.length; + while (i--) { + single.call(this, evt, listeners[i]); + } + } + + return this; + }; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeEvent = function removeEvent(evt) { + var type = typeof evt; + var events = this._getEvents(); + var key; + + // Remove different things depending on the state of evt + if (type === 'string') { + // Remove all listeners for the specified event + delete events[evt]; + } + else if (evt instanceof RegExp) { + // Remove all events matching the regex. + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + delete events[key]; + } + } + } + else { + // Remove all listeners in all events + delete this._events; + } + + return this; + }; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + proto.removeAllListeners = alias('removeEvent'); + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emitEvent = function emitEvent(evt, args) { + var listenersMap = this.getListenersAsObject(evt); + var listeners; + var listener; + var i; + var key; + var response; + + for (key in listenersMap) { + if (listenersMap.hasOwnProperty(key)) { + listeners = listenersMap[key].slice(0); + i = listeners.length; + + while (i--) { + // If the listener returns true then it shall be removed from the event + // The function is executed either with a basic call or an apply if there is an args array + listener = listeners[i]; + + if (listener.once === true) { + this.removeListener(evt, listener.listener); + } + + response = listener.listener.apply(this, args || []); + + if (response === this._getOnceReturnValue()) { + this.removeListener(evt, listener.listener); + } + } + } + } + + return this; + }; + + /** + * Alias of emitEvent + */ + proto.trigger = alias('emitEvent'); + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {...*} Optional additional arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emit = function emit(evt) { + var args = Array.prototype.slice.call(arguments, 1); + return this.emitEvent(evt, args); + }; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {*} value The new value to check for when executing listeners. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.setOnceReturnValue = function setOnceReturnValue(value) { + this._onceReturnValue = value; + return this; + }; + + /** + * Fetches the current value to check against when executing listeners. If + * the listeners return value matches this one then it should be removed + * automatically. It will return true by default. + * + * @return {*|Boolean} The current value to check for or the default, true. + * @api private + */ + proto._getOnceReturnValue = function _getOnceReturnValue() { + if (this.hasOwnProperty('_onceReturnValue')) { + return this._onceReturnValue; + } + else { + return true; + } + }; + + /** + * Fetches the events object and creates one if required. + * + * @return {Object} The events storage object. + * @api private + */ + proto._getEvents = function _getEvents() { + return this._events || (this._events = {}); + }; + + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * + * @return {Function} Non conflicting EventEmitter class. + */ + EventEmitter.noConflict = function noConflict() { + exports.EventEmitter = originalGlobalValue; + return EventEmitter; + }; + + // Expose the class either via AMD, CommonJS or the global object + if (typeof define === 'function' && define.amd) { + define(function () { + return EventEmitter; + }); + } + else if (typeof module === 'object' && module.exports){ + module.exports = EventEmitter; + } + else { + exports.EventEmitter = EventEmitter; + } +}.call(this)); + +(function (global) { + "use strict"; + var klass = function () { + this._succ = this._fail = this._next = this._id = null; + this._tail = this; + }; + + var prop = klass.prototype; + + function DeferredStop (message) { + this.message = message; + } + + prop.next = function (func) { + var q = new Deferred(); + q._succ = func; + return this._add(q); + }; + prop.error = function (func) { + var q = new Deferred(); + q._fail = func; + return this._add(q); + }; + prop._add = function (queue) { + this._tail._next = queue; + this._tail = queue; + return this; + }; + prop.call = function (arg) { + var received; + var queue = this; + while (queue && !queue._succ) { + queue = queue._next; + } + if (!(queue instanceof Deferred)) { + return; + } + received = queue._succ(arg); + if (queue._fail_flag) { + return; + } else if (received instanceof DeferredStop) { + return queue.fail(received); + } else if (received instanceof Deferred) { + if (!received._fail_flag) { + Deferred._insert(queue, received); + } else { + while (queue && !queue._fail) { + queue = queue._next; + } + return queue.fail(received._fail_arg); + } + } else if (queue._next instanceof Deferred) { + queue._next.call(received); + } + }; + prop.fail = function (arg) { + var result, err, + queue = this; + while (queue && !queue._fail) { + queue = queue._next; + } + this._fail_flag = true; + this._fail_arg = arg; + if (queue instanceof Deferred) { + result = queue._fail(arg); + queue.call(result); + } else if (arg instanceof Error) { + throw arg; + } + }; + klass._insert = function(queue, ins) { + if (queue._next instanceof Deferred) { + ins._next = queue._next; + } + queue._next = ins; + }; + klass.stop = function (message) { + return new DeferredStop(message); + }; + klass.next = function(func) { + var q = new Deferred().next(func); + q._id = setTimeout(function() { q.call(); }, 0); + return q; + }; + klass.parallel = function(arg) { + var p = new Deferred(); + if (!arg) { + Deferred.next(function () { p.call(); }); + return p; + } + var ret = (arg instanceof Array) ? [] : {}; + var progress = 0; + for (var prop in arg) { + if (arg.hasOwnProperty(prop)) { + /*jshint loopfunc:true */ + (function(queue, name) { + if (typeof queue === 'function') { + queue = Deferred.next(queue); + } + queue.next(function(arg) { + progress--; + ret[name] = arg; + if (progress === 0) { + p.call(ret); + } + }) + .error(function(err) { p.fail(err); }); + if (typeof queue._id === 'number') { + clearTimeout(queue._id); + } + queue._id = setTimeout(function() { + queue.call(); + }, 0); + progress++; + }(arg[prop], prop)); + } + } + if (!progress) { + Deferred.next(function () { p.call(); }); + } + return p; + }; + + global['Deferred'] = klass; + global['DeferredStop'] = DeferredStop; +})(this); + +/** + * eventsource.js + * Available under MIT License (MIT) + * https://github.com/Yaffle/EventSource/ + */ + +/*jslint indent: 2, vars: true, plusplus: true */ +/*global setTimeout, clearTimeout */ + +(function (global) { + "use strict"; + + function Map() { + this.data = {}; + } + + Map.prototype = { + get: function (key) { + return this.data[key + "~"]; + }, + set: function (key, value) { + this.data[key + "~"] = value; + }, + "delete": function (key) { + delete this.data[key + "~"]; + } + }; + + function EventTarget() { + this.listeners = new Map(); + } + + function throwError(e) { + setTimeout(function () { + throw e; + }, 0); + } + + EventTarget.prototype = { + dispatchEvent: function (event) { + event.target = this; + var type = String(event.type); + var listeners = this.listeners; + var typeListeners = listeners.get(type); + if (!typeListeners) { + return; + } + var length = typeListeners.length; + var i = -1; + var listener = null; + while (++i < length) { + listener = typeListeners[i]; + try { + listener.call(this, event); + } catch (e) { + throwError(e); + } + } + }, + addEventListener: function (type, callback) { + type = String(type); + var listeners = this.listeners; + var typeListeners = listeners.get(type); + if (!typeListeners) { + typeListeners = []; + listeners.set(type, typeListeners); + } + var i = typeListeners.length; + while (--i >= 0) { + if (typeListeners[i] === callback) { + return; + } + } + typeListeners.push(callback); + }, + removeEventListener: function (type, callback) { + type = String(type); + var listeners = this.listeners; + var typeListeners = listeners.get(type); + if (!typeListeners) { + return; + } + var length = typeListeners.length; + var filtered = []; + var i = -1; + while (++i < length) { + if (typeListeners[i] !== callback) { + filtered.push(typeListeners[i]); + } + } + if (filtered.length === 0) { + listeners["delete"](type); + } else { + listeners.set(type, filtered); + } + } + }; + + function Event(type) { + this.type = type; + this.target = null; + } + + function MessageEvent(type, options) { + Event.call(this, type); + this.data = options.data; + this.lastEventId = options.lastEventId; + } + + MessageEvent.prototype = Event.prototype; + + var XHR = global.XMLHttpRequest; + var XDR = global.XDomainRequest; + var isCORSSupported = Boolean(XHR && ((new XHR()).withCredentials !== undefined)); + var isXHR = isCORSSupported; + var Transport = isCORSSupported ? XHR : XDR; + var WAITING = -1; + var CONNECTING = 0; + var OPEN = 1; + var CLOSED = 2; + var AFTER_CR = 3; + var FIELD_START = 4; + var FIELD = 5; + var VALUE_START = 6; + var VALUE = 7; + var contentTypeRegExp = /^text\/event\-stream;?(\s*charset\=utf\-8)?$/i; + + var MINIMUM_DURATION = 1000; + var MAXIMUM_DURATION = 18000000; + + function getDuration(value, def) { + var n = Number(value) || def; + return (n < MINIMUM_DURATION ? MINIMUM_DURATION : (n > MAXIMUM_DURATION ? MAXIMUM_DURATION : n)); + } + + function fire(that, f, event) { + try { + if (typeof f === "function") { + f.call(that, event); + } + } catch (e) { + throwError(e); + } + } + + function EventSource(url, options) { + url = String(url); + + var withCredentials = Boolean(isCORSSupported && options && options.withCredentials); + var initialRetry = getDuration(options ? options.retry : NaN, 1000); + var heartbeatTimeout = getDuration(options ? options.heartbeatTimeout : NaN, 45000); + var lastEventId = (options && options.lastEventId && String(options.lastEventId)) || ""; + var that = this; + var retry = initialRetry; + var wasActivity = false; + var xhr = new Transport(); + // FIXME: temporary code for Cobit authentication + var header = options ? options.header ? options.header : {} : {}; + var timeout = 0; + var timeout0 = 0; + var charOffset = 0; + var currentState = WAITING; + var dataBuffer = []; + var lastEventIdBuffer = ""; + var eventTypeBuffer = ""; + var onTimeout = null; + + var state = FIELD_START; + var field = ""; + var value = ""; + + options = null; + + function close() { + currentState = CLOSED; + if (xhr !== null) { + xhr.abort(); + xhr = null; + } + if (timeout !== 0) { + clearTimeout(timeout); + timeout = 0; + } + if (timeout0 !== 0) { + clearTimeout(timeout0); + timeout0 = 0; + } + that.readyState = CLOSED; + } + + function onProgress(isLoadEnd) { + var responseText = currentState === OPEN || currentState === CONNECTING ? xhr.responseText || "" : ""; + var event = null; + var isWrongStatusCodeOrContentType = false; + + if (currentState === CONNECTING) { + var status = 0; + var statusText = ""; + var contentType = ""; + if (isXHR) { + try { + status = Number(xhr.status || 0); + statusText = String(xhr.statusText || ""); + contentType = String(xhr.getResponseHeader("Content-Type") || ""); + } catch (error) { + // https://bugs.webkit.org/show_bug.cgi?id=29121 + status = 0; + // FF < 14, WebKit + // https://bugs.webkit.org/show_bug.cgi?id=29658 + // https://bugs.webkit.org/show_bug.cgi?id=77854 + } + } else { + status = 200; + contentType = xhr.contentType; + } + if (status === 200 && contentTypeRegExp.test(contentType)) { + currentState = OPEN; + wasActivity = true; + retry = initialRetry; + that.readyState = OPEN; + event = new Event("open"); + that.dispatchEvent(event); + fire(that, that.onopen, event); + if (currentState === CLOSED) { + return; + } + } else { + if (status !== 0) { + var message = "EventSource's response has a status " + status + " " + statusText.replace(/\s+/g, "") + ". Reconnecting."; + //http://www.w3.org/TR/eventsource/#processing-model + if ([305, 401, 407, 302, 303, 307, 500, 502, 503, 504].indexOf(xhr.status) === -1) { + if (status !== 200) { + message = "EventSource's response has a status " + status + " " + statusText.replace(/\s+/g, " ") + " that is not 200. Aborting the connection."; + } else { + message = "EventSource's response has a Content-Type specifying an unsupported type: " + contentType.replace(/\s+/g, " ") + ". Aborting the connection."; + } + isWrongStatusCodeOrContentType = true; + } + setTimeout(function () { + throw new Error(message); + }); + } + } + } + + if (currentState === OPEN) { + if (responseText.length > charOffset) { + wasActivity = true; + } + var i = charOffset - 1; + var length = responseText.length; + var c = "\n"; + while (++i < length) { + c = responseText[i]; + if (state === AFTER_CR && c === "\n") { + state = FIELD_START; + } else { + if (state === AFTER_CR) { + state = FIELD_START; + } + if (c === "\r" || c === "\n") { + if (field === "data") { + dataBuffer.push(value); + } else if (field === "id") { + lastEventIdBuffer = value; + } else if (field === "event") { + eventTypeBuffer = value; + } else if (field === "retry") { + initialRetry = getDuration(value, initialRetry); + retry = initialRetry; + } else if (field === "heartbeatTimeout") {//! + heartbeatTimeout = getDuration(value, heartbeatTimeout); + if (timeout !== 0) { + clearTimeout(timeout); + timeout = setTimeout(onTimeout, heartbeatTimeout); + } + } + value = ""; + field = ""; + if (state === FIELD_START) { + if (dataBuffer.length !== 0) { + lastEventId = lastEventIdBuffer; + if (eventTypeBuffer === "") { + eventTypeBuffer = "message"; + } + event = new MessageEvent(eventTypeBuffer, { + data: dataBuffer.join("\n"), + lastEventId: lastEventIdBuffer + }); + that.dispatchEvent(event); + if (eventTypeBuffer === "message") { + fire(that, that.onmessage, event); + } + if (currentState === CLOSED) { + return; + } + } + dataBuffer.length = 0; + eventTypeBuffer = ""; + } + state = c === "\r" ? AFTER_CR : FIELD_START; + } else { + if (state === FIELD_START) { + state = FIELD; + } + if (state === FIELD) { + if (c === ":") { + state = VALUE_START; + } else { + field += c; + } + } else if (state === VALUE_START) { + if (c !== " ") { + value += c; + } + state = VALUE; + } else if (state === VALUE) { + value += c; + } + } + } + } + charOffset = length; + } + + if ((currentState === OPEN || currentState === CONNECTING) && + (isLoadEnd || isWrongStatusCodeOrContentType || (charOffset > 1024 * 1024) || (timeout === 0 && !wasActivity))) { + currentState = WAITING; + xhr.abort(); + if (timeout !== 0) { + clearTimeout(timeout); + timeout = 0; + } + if (retry > initialRetry * 16) { + retry = initialRetry * 16; + } + if (retry > MAXIMUM_DURATION) { + retry = MAXIMUM_DURATION; + } + if (isWrongStatusCodeOrContentType) { + close(); + } else { + timeout = setTimeout(onTimeout, retry); + } + retry = retry * 2 + 1; + + that.readyState = CONNECTING; + event = new Event("error"); + that.dispatchEvent(event); + fire(that, that.onerror, event); + } else { + if (timeout === 0) { + wasActivity = false; + timeout = setTimeout(onTimeout, heartbeatTimeout); + } + } + } + + function onProgress2() { + onProgress(false); + } + + function onLoadEnd() { + onProgress(true); + } + + if (isXHR) { + // workaround for Opera issue with "progress" events + timeout0 = setTimeout(function f() { + if (xhr.readyState === 3) { + onProgress2(); + } + timeout0 = setTimeout(f, 500); + }, 0); + } + + onTimeout = function () { + timeout = 0; + if (currentState !== WAITING) { + onProgress(false); + return; + } + // loading indicator in Safari, Chrome < 14, Firefox + // https://bugzilla.mozilla.org/show_bug.cgi?id=736723 + if (isXHR && (xhr.sendAsBinary !== undefined || xhr.onloadend === undefined) && global.document && global.document.readyState && global.document.readyState !== "complete") { + timeout = setTimeout(onTimeout, 4); + return; + } + // XDomainRequest#abort removes onprogress, onerror, onload + + xhr.onload = xhr.onerror = onLoadEnd; + + if (isXHR) { + // improper fix to match Firefox behaviour, but it is better than just ignore abort + // see https://bugzilla.mozilla.org/show_bug.cgi?id=768596 + // https://bugzilla.mozilla.org/show_bug.cgi?id=880200 + // https://code.google.com/p/chromium/issues/detail?id=153570 + xhr.onabort = onLoadEnd; + + // Firefox 3.5 - 3.6 - ? < 9.0 + // onprogress is not fired sometimes or delayed + xhr.onreadystatechange = onProgress2; + } + + xhr.onprogress = onProgress2; + + wasActivity = false; + timeout = setTimeout(onTimeout, heartbeatTimeout); + + charOffset = 0; + currentState = CONNECTING; + dataBuffer.length = 0; + eventTypeBuffer = ""; + lastEventIdBuffer = lastEventId; + value = ""; + field = ""; + state = FIELD_START; + + var s = url.slice(0, 5); + if (s !== "data:" && s !== "blob:") { + s = url + ((url.indexOf("?", 0) === -1 ? "?" : "&") + "lastEventId=" + encodeURIComponent(lastEventId) + "&r=" + String(Math.random() + 1).slice(2)); + } else { + s = url; + } + xhr.open("GET", s, true); + + if (isXHR) { + // withCredentials should be set after "open" for Safari and Chrome (< 19 ?) + xhr.withCredentials = withCredentials; + + xhr.responseType = "text"; + + // Request header field Cache-Control is not allowed by Access-Control-Allow-Headers. + // "Cache-control: no-cache" are not honored in Chrome and Firefox + // https://bugzilla.mozilla.org/show_bug.cgi?id=428916 + //xhr.setRequestHeader("Cache-Control", "no-cache"); + xhr.setRequestHeader("Accept", "text/event-stream"); + // Request header field Last-Event-ID is not allowed by Access-Control-Allow-Headers. + //xhr.setRequestHeader("Last-Event-ID", lastEventId); + + // FIXME: temporary code for Cobit authentication + Object.keys(header).forEach(function (key) { + xhr.setRequestHeader(key, header[key]); + }); + } + + xhr.send(null); + }; + + EventTarget.call(this); + this.close = close; + this.url = url; + this.readyState = CONNECTING; + this.withCredentials = withCredentials; + + this.onopen = null; + this.onmessage = null; + this.onerror = null; + + onTimeout(); + } + + function F() { + this.CONNECTING = CONNECTING; + this.OPEN = OPEN; + this.CLOSED = CLOSED; + } + F.prototype = EventTarget.prototype; + + EventSource.prototype = new F(); + F.call(EventSource); + + if (Transport) { + // Why replace a native EventSource ? + // https://bugzilla.mozilla.org/show_bug.cgi?id=444328 + // https://bugzilla.mozilla.org/show_bug.cgi?id=831392 + // https://code.google.com/p/chromium/issues/detail?id=260144 + // https://code.google.com/p/chromium/issues/detail?id=225654 + // ... + global.NativeEventSource = global.EventSource; + global.EventSource = EventSource; + } + +}(this)); + +/** + * https://github.com/cho45/micro-location.js + * (c) cho45 http://cho45.github.com/mit-license + */ +// immutable object, should not assign a value to properties +function Location () { this.init.apply(this, arguments) } +Location.prototype = { + init : function (protocol, host, hostname, port, pathname, search, hash) { + this.protocol = protocol; + this.host = host; + this.hostname = hostname; + this.port = port || ""; + this.pathname = pathname || ""; + this.search = search || ""; + this.hash = hash || ""; + if (protocol) { + with (this) this.href = protocol + '//' + host + pathname + search + hash; + } else + if (host) { + with (this) this.href = '//' + host + pathname + search + hash; + } else { + with (this) this.href = pathname + search + hash; + } + }, + + params : function (name) { + if (!this._params) { + var params = {}; + + var pairs = this.search.substring(1).split(/[;&]/); + for (var i = 0, len = pairs.length; i < len; i++) { + if (!pairs[i]) continue; + var pair = pairs[i].split(/=/); + var key = decodeURIComponent(pair[0].replace(/\+/g, '%20')); + var val = decodeURIComponent(pair[1].replace(/\+/g, '%20')); + + if (!params[key]) params[key] = []; + params[key].push(val); + } + + this._params = params; + } + + switch (typeof name) { + case "undefined": return this._params; + case "object" : return this.build(name); + } + return this._params[name] ? this._params[name][0] : null; + }, + + build : function (params) { + if (!params) params = this._params; + + var ret = new Location(); + var _search = this.search; + if (params) { + var search = []; + for (var key in params) if (params.hasOwnProperty(key)) { + var val = params[key]; + switch (typeof val) { + case "object": + for (var i = 0, len = val.length; i < len; i++) { + search.push(encodeURIComponent(key) + '=' + encodeURIComponent(val[i])); + } + break; + default: + search.push(encodeURIComponent(key) + '=' + encodeURIComponent(val)); + } + } + _search = '?' + search.join('&'); + } + + with (this) ret.init.apply(ret, [ + protocol, + host, + hostname, + port, + pathname, + _search, + hash + ]); + return ret; + } +}; +Location.regexp = new RegExp('^(?:(https?:)//(([^:/]+)(:[^/]+)?))?([^#?]*)(\\?[^#]*)?(#.*)?$'); +Location.parse = function (string) { + var matched = String(string).match(this.regexp); + var ret = new Location(); + ret.init.apply(ret, matched.slice(1)); + return ret; +}; + +this.Location = Location; + +var Blix = (function() { + + var self = {}; + + /** + * initialize property + */ + self.initialize = function () { + self.requestTable = {}; + self.requestCount = 0; + self.loadingStartTimeout && clearTimeout(self.loadingStartTimeout); + self.loadingStopTimeout && clearTimeout(self.loadingStopTimeout); + self.loadingStartTimeout = undefined; + self.loadingStopTimeout = undefined; + self.eventEmitter = new EventEmitter(); + }; + self.initialize(); + + /** + * main function + */ + self.ajax = function (options) { + // check network connection + if (!self.isOnline()) { + self.eventEmitter.emitEvent('offline'); + return; + } + + if (typeof options['crossDomain'] === 'undefined') { + options['crossDomain'] = /^([\w-]+:)?\/\/([^\/]+)/.test(options.url) && RegExp.$2 != window.location.host; + } + + var timeout = options['timeout']; + options['timeout'] = function () { + if (timeout) { + timeout.apply(this, arguments); + } + self.eventEmitter.emitEvent('timeout'); + }; + + var currentCount = ++self.requestCount; + var success = options['success']; + options['success'] = function () { + delete self.requestTable[currentCount]; + self.loadingStop(); + if (success) { + success.apply(this, arguments); + } + }; + + var accessObject = self.isWorkerSupport() + ? new self.WorkerAccess(options) + : new self.XHRAccess(options) + ; + + self.loadingStart(); + + accessObject['requestCount'] = currentCount; + self.requestTable[currentCount] = accessObject; + }; + + /** + * stop all request + */ + self.stop = function () { + Object.keys(self.requestTable).forEach(function (key) { + self.requestTable[key].abort(self.requestTable[key]); + }); + }; + + /** + * send all request + */ + self.retry = function () { + // 二重送信はサーバ側管理する + Object.keys(self.requestTable).forEach(function (key) { + self.requestTable[key].send(self.requestTable[key]); + }); + }; + + /** + * clear request table + */ + self.abort = function () { + self.requestTable = {}; + self.requestCount = 0; + }; + + /** + * trigger loadingStart / loadingStop event + */ + self.loadingStart = function () { + if (Object.keys(self.requestTable).length !== 0) { + return; + } + if (self.loadingStartTimeout) { + return; + } + self.loadingStartTimeout = setTimeout(function () { + self.eventEmitter.emitEvent('loadingStart'); + }, 300); + }; + self.loadingStop = function () { + self.loadingStopTimeout && clearTimeout(self.loadingStopTimeout); + self.loadingStopTimeout = setTimeout(function () { + self.eventEmitter.emitEvent('loadingStop'); + self.loadingStopTimeout = undefined; + }, 300); + }; + + /** + * check whether connection is online or offline + */ + (function () { + var isAndroid2 = navigator.userAgent.match(/Android\s+2/i); + var isPhantomJS = navigator.userAgent.match(/PhantomJS/i); + if (!isAndroid2 && !isPhantomJS) { + self.isOnline = function () { + return navigator.onLine; + }; + return; + } + + var onLine = true; + var timeout = 0; + self.isOnline = function () { + if (timeout) { + return onLine; + } + var xhr = new XMLHttpRequest(); + xhr.open('HEAD', location.href, false); + try { + xhr.send(); + onLine = true; + } catch (e) { + onLine = false; + } + timeout = setTimeout(function () { + timeout = 0; + }, 5000); + return onLine; + }; + })(); + + /** + * event listener + */ + self.addListener = function (name, handler) { + self.eventEmitter.addListener(name, handler); + }; + self.removeListener = function (name, handler) { + self.eventEmitter.removeListener(name, handler); + }; + + self.isWorkerSupport = function () { + return false; //ajaxのsuccess時に結果とxhrオブジェクトを共に返したいがworkerだと難しいので + //return !!(window.Worker && typeof(Blob) === typeof(Function)); + }; + + return self; +})(); + +/** + * ajax-like function + */ +Blix.XHRAccess = function (options) { + this.options = options; + this.xhr = this.send(); +}; +Blix.XHRAccess.prototype.send = function () { + return Blix.ajaxStart(this.options); +}; +Blix.XHRAccess.prototype.abort = function () { + this.xhr.abort(); +}; + +/** + * ajax-like function with WebWorker + */ +Blix.WorkerAccess = function (options) { + this.worker = new Worker(Blix.WorkerAccess.getBlobURL()); + this.options = options; + this.send(); +}; + +Blix.WorkerAccess.blobURL = undefined; +Blix.WorkerAccess.getBlobURL = function () { + if (this.blobURL) { + return this.blobURL; + } + var blob = new Blob( + ['onmessage = ' + Blix.WorkerAccess.inWorker.toString() + ';var ajaxStart = ' + Blix.ajaxStart.toString() + ';var Blix = {};Blix.param = ' + Blix.param.toString()], + {type:"text/javascript"} + ); + var myUrl = window.webkitURL || window.URL; + this.blobURL = myUrl.createObjectURL(blob); + return this.blobURL; +}; + +Blix.WorkerAccess.prototype.send = function () { + var options = this.options; + this.worker.onmessage = function (evn) { + if (!options[evn.data.type]) { + return; + } + options[evn.data.type](evn.data.response); + }; + + var message = this.filterObject(options, function (key) { + return 'function' !== typeof options[key]; + }); + if (!/^https?:\/\//.test(message.url)) { + message.url = location.origin + message.url; + } + this.worker.postMessage(message); +}; +Blix.WorkerAccess.prototype.filterObject = function (options, filter) { + var result = {}; + Object.keys(options).filter(filter).forEach(function (key) { + result[key] = options[key]; + }); + return result; +}; +Blix.WorkerAccess.prototype.abort = function () { + this.worker.terminate(); +}; +/** + * WebWorker internal functions + */ +Blix.WorkerAccess.inWorker = function (evn) { + var options = evn.data; + ['success', 'timeout'].forEach(function (name) { + options[name] = function (res) { + postMessage({ + 'response' : res, + 'type' : name + }); + }; + }); + ajaxStart(options); +}; + +/** + * XHR connect function + */ +Blix.ajaxStart = function (options) { + var + xhr = new XMLHttpRequest(), + url = options["url"], + success = options.success || function() {}, + timeout = options.timeout || function() {}, + error = options.error || function() {}, + type = options.type || 'GET', + withCredentials = options.withCredentials || false, + header = options.header || {}, + ctype = options.ctype || (( type === 'POST' ) ? 'application/x-www-form-urlencoded' : ''), + crossDomain = options.crossDomain || false, + data = options.data || '', + // default timeout setting(ignore zero) + timeoutLimit = ('timeout_limit' in options ? options.timeout_limit : 3000) || 1, + timerId + ; + + // Convert data if not already a string + if (type.toLowerCase() === "get" && data && typeof data !== 'string' && data !== '') { + data = Blix.param(data); + + if (url.indexOf("?") === -1) { + url += "?" + data; + } else { + url += "&" + data; + } + } + data = JSON.stringify(data); + + xhr.onreadystatechange = function () { + if (xhr.readyState !== 4) { + return; + } + timerId && clearTimeout(timerId); + var response; + if ( xhr.status >= 200 && xhr.status < 300 ) { + response = xhr.responseText; + if (xhr.getResponseHeader('Content-Type') === 'application/json') { + try { + response = JSON.parse(response); + } catch (e) {} + } + success(response, xhr); + } else { + error(xhr); + } + }; + + xhr.open(type, url); + + if ('timeout' in xhr) { + xhr.timeout = timeoutLimit; + xhr.ontimeout = function() { + //clear context(for worker) + timeout(xhr); + }; + } else { + timerId = setTimeout(function () { + xhr.abort(); + delete xhr.onreadystatechange; + timeout(xhr); + }, timeoutLimit); + } + if (ctype) { + xhr.setRequestHeader('Content-Type', ctype); + } + if (withCredentials) { + xhr.withCredentials = true; + } + Object.keys(header).forEach(function (key) { + xhr.setRequestHeader(key, header[key]); + }); + if (!crossDomain) { + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + } + xhr.send(data); + + return xhr; +}; + +/** + * Serialize a set of key/values into a query string + */ +Blix.param = function (data) { + data = Object.keys(data).map(function (key, value) { + value = data[key] == null ? '' : data[key]; + return [encodeURIComponent(key), encodeURIComponent(value)].join('='); + }).join("&"); + return data; +}; + +/* + * @param {Object} options server options + * @param {String} options.proxyUrl CORS proxy iframe url(require) + * @param {String} options.apiUrl SSE(server sent event) server url + * @param {Function} callback initialize done + * */ +var Jinn = function (options, callback) { + // Cross Domain Request support? + var isXDomainSupport = Jinn.isXDomainSupport; + if (Jinn.debug) { + isXDomainSupport = false; + } + if (isXDomainSupport) { + // withCredentials is not supported(iframe version) + options['withCredentials'] = false; + var blix = Jinn.XHRSender(); + // not support webworker + if (!window.Worker || typeof(Blob) !== typeof(Function)) { + // native or polyfill EventSource + var es; + var isSafe = Jinn.checkSafeUA(navigator.userAgent); + es = isSafe ? new NativeEventSource(options.apiUrl, options) : new EventSource(options.apiUrl, options); + callback(es, blix); + return; + } + var ee = Jinn.makeWorkerEmitter(options); + callback(ee, blix); + return; + } + Jinn.makeIframeConnection(options, function (receiver, sender) { + callback(receiver, sender); + }); +}; + +Jinn.checkSafeUA = function (ua) { + if (!window.NativeEventSource) { + return false; + } + var chrome = ua.match(/Chrome\/(\d+)/); + if (chrome) { + var version = chrome.pop()|0; + if (version >= 36) { + return true; + } + } else { + var iOS = ua.match(/i(Phone|Pad|Pod);.+?OS ([\d_]+)/); + if (iOS) { + if ((iOS.pop() || '').match(/^([789]|\d\d+)_/)) { + return true; + } + } + } + return false; +}; + +Jinn.requestCount = 0; + +Jinn.isXDomainSupport = 'withCredentials' in new XMLHttpRequest(); +Jinn.isXDomainSupport = Jinn.isXDomainSupport || 'undefined' !== typeof XDomainRequest; +// Android 2系はXHRをStreamingで受け取るときに4KBのPaddingを付加する必要があるため、iframe経由での通信を強制する +// (security上の理由からX-Padding-Lengthはiframe経由でしか受け取らないため) +if (navigator.userAgent.match(/Android\s+2\.\d/)) { + Jinn.isXDomainSupport = false; +} + +Jinn.makeWorkerEmitter = function (options) { + function inWorker(evn) { + var options = evn.data; + var es = new EventSource(options.apiUrl, options); + ['open', 'message', 'error'].forEach(function (name) { + es.addEventListener(name, function (evn) { + postMessage({ + 'type' : name, + 'value' : evn.data + }); + }); + }); + } + // support webworker + var part = 'onmessage = ' + inWorker.toString() + ';(function(f){function N(){this.data={}}function U(){this.listeners=new N}function V(b){setTimeout(function(){throw b;},0)}function J(b){this.type=b;this.target=null}function W(b,a){J.call(this,b);this.data=a.data;this.lastEventId=a.lastEventId}function K(b,a){var e=Number(b)||a;return eL?L:e}function O(b,a,e){try{"function"===typeof a&&a.call(b,e)}catch(c){V(c)}}function p(b,a){function e(){m=C;null!==d&&(d.abort(),d=null);0!==h&&(clearTimeout(h),h=0);0!==D&&(clearTimeout(D),D=0);n.readyState=C}function c(b){var a=m===z||m===v?d.responseText||"":"",g=null,c=!1;if(m===v){var g=0,f="",l="";if(E)try{g=Number(d.status||0),f=String(d.statusText||""),l=String(d.getResponseHeader("Content-Type")||"")}catch(R){g=0}else g=200,l=d.contentType;if(200===g&&ca.test(l)){if(m=z,F=!0,s=A,n.readyState=z,g=new J("open"),n.dispatchEvent(g),O(n,n.onopen,g),m===C)return}else if(0!==g){var u="EventSource\'s response has a status "+g+" "+f.replace(/\\s+/g,"")+". Reconnecting.";-1===[305,401,407,302,303,307,500,502,503,504].indexOf(d.status)&&(u=200!==g?"EventSource\'s response has a status "+g+" "+f.replace(/\\s+/g," ")+" that is not 200. Aborting the connection.":"EventSource\'s response has a Content-Type specifying an unsupported type: "+l.replace(/\\s+/g," ")+". Aborting the connection.",c=!0);setTimeout(function(){throw Error(u);})}}if(m===z){a.length>G&&(F=!0);for(var f=G-1,l=a.length,r="\\n";++f16*A&&(s=16*A),s>L&&(s=L),c?e():h=setTimeout(y,s),s=2*s+1,n.readyState=v,g=new J("error"),n.dispatchEvent(g),O(n,n.onerror,g))}function l(){c(!1)}function R(){c(!0)}b=String(b);var u=Boolean(S&&a&&a.withCredentials),A=K(a?a.retry:NaN,1E3),I=K(a?a.heartbeatTimeout:NaN,45E3),p=a&&a.lastEventId&&String(a.lastEventId)||"",n=this,s=A,F=!1,d=new aa,B=a?a.header?a.header:{}:{},h=0,D=0,G=0,m=Q,H=[],M="",x="",y=null,k=w,t="",q="";a=null;E&&(D=setTimeout(function ba(){3===d.readyState&&l();D=setTimeout(ba,500)},0));y=function(){h=0;if(m!==Q)c(!1);else if(E&&(void 0!==d.sendAsBinary||void 0===d.onloadend)&&f.document&&f.document.readyState&&"complete"!==f.document.readyState)h=setTimeout(y,4);else{d.onload=d.onerror=R;E&&(d.onabort=R,d.onreadystatechange=l);d.onprogress=l;F=!1;h=setTimeout(y,I);G=0;m=v;H.length=0;x="";M=p;t=q="";k=w;var a=b.slice(0,5),a="data:"!==a&&"blob:"!==a?b+((-1===b.indexOf("?",0)?"?":"&")+"lastEventId="+encodeURIComponent(p)+"&r="+String(Math.random()+1).slice(2)):b;d.open("GET",a,!0);E&&(d.withCredentials=u,d.responseType="text",d.setRequestHeader("Accept","text/event-stream"),Object.keys(B).forEach(function(a){d.setRequestHeader(a,B[a])}));d.send(null)}};this.listeners=new N;this.close=e;this.url=b;this.readyState=v;this.withCredentials=u;this.onerror=this.onmessage=this.onopen=null;y()}function B(){this.CONNECTING=v;this.OPEN=z;this.CLOSED=C}N.prototype={get:function(b){return this.data[b+"~"]},set:function(b,a){this.data[b+"~"]=a},"delete":function(b){delete this.data[b+"~"]}};U.prototype={dispatchEvent:function(b){b.target=this;var a=this.listeners.get(String(b.type));if(a)for(var e=a.length,c=-1,l=null;++c + */ +var CobitSDK = (function () { + "use strict"; + var self = {}; + // for multiline stream + self.firedCallbacks = {}; + self.callbacks = {}; + self.sse_timeout = 10000; + self.sse_timer = {}; + self.ee = new EventEmitter(); + self.defaultParameter = { + 'version' : 'v1', + 'access_token' : '' + }; + self.reconnect_interval = 3000; + // Android standard browsers which you want to stop loading + self.reconnect_target = [ + 'Mozilla/5.0 (Linux; U; Android 4.0.3; ja-jp; ISW13F Build/V53R39C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30' + ]; + + /** + * Authentication and get AccessToken by using IDToken + * @param {Object} option Server options and parameter of authentication + */ + self.login = function (option) { + self._initServer(option); + JinnSender({ + 'apiUrl': self['serverAPIAddress'], + 'proxyUrl': self['serverAPIProxyAddress'] + }, function (sender) { + // Authentication + sender.ajax({ + 'url': CobitSDK.getAPI('/:version/sync/authentication/login', {}), + 'data': { + 'id_token': option['data']['idToken'], + 'client_type_id': option['data']['clientTypeId'] + }, + 'success': function () { + sender.destroy(); + option['success'].apply(this, arguments); + }, + 'error': option['error'], + 'timeout': option['timeout'] + }); + }); + }; + + /** + * Connect stream and Initialize Cobit API + * @param {Object} option Server options and parameter which needs to connect stream + */ + self.connect = function (option) { + self._initServer(option); + var data = CobitSDK.param(self['option']['data']); + self.defaultParameter['access_token'] = self['option']['data']['access_token']; + var initialConnect = true; + Jinn({ + 'apiUrl': self['serverSSEAddress'] + (data ? '?' + data : ''), + 'sseProxyUrl': self['serverSSEProxyAddress'], + 'apiProxyUrl': self['serverAPIProxyAddress'], + 'webworkerHelperUri': option['webworkerHelperUri'] + }, function (receiver, sender) { + // reconnect stream to stop loading in Android standard browsers + if (self.reconnect_target.indexOf(navigator.userAgent) > -1) { + self._forceReconnect(sender); + } + var event = new EventEmitter(); + // for Android 4.1.2 HTL22 Build/JZO54K + var connect = false; + var timeout = setTimeout(function () { + connect = true; + var cobit = new CobitSDK['apiBase'](event, sender, self['option']); + option['success'](cobit); + }, 1000); + receiver.addEventListener('message', function (evn) { + if (!evn.data) { + return; + } + var result = JSON.parse(evn.data); + if (initialConnect && result.content && result.content.content_type === 'control/connected') { + clearTimeout(timeout); + if (connect) { + return; + } + initialConnect = false; + var cobit = new CobitSDK['apiBase'](event, sender, self['option']); + option['success'](cobit); + return; + } + self._handleEvent(result); + }); + }); + }; + + self._forceReconnect = function (sender) { + var interval = setInterval(function () { + // Reconnect if there are not any running ajax requests + // and callbacks for stream response. + if (Object.keys(sender.requestTable).length === 0 && + Object.keys(self.callbacks).length === 0) { + clearInterval(interval); + window.stop(); + } + }, self.reconnect_interval); + }; + + // private method (for tests) + self._handleEvent = function (result) { + var co_key = result.correlation_key; + var content_type = result.content.content_type; + if (self._isIgnoreListenSSEType(content_type)) { + return; + } + if (self.firedCallbacks[co_key]) { + return; + } + if (!self.callbacks[co_key]) { + CobitSDK.ee.emit('ServerSentEvent', result); + return; + } + CobitSDK.ee.emit('AsyncAPIResponse', result); + self.callbacks[co_key](result); + self.clearSSETimer(co_key); + delete self.callbacks[co_key]; + self.firedCallbacks[co_key] = true; + }; + + // private method (for tests) + self._initServer = function (option) { + self['option'] = CobitSDK.extend({ + 'serverSSEAddress' : 'http://localhost:8081', + 'serverSSEProxyAddress' : 'http://localhost:8081', + 'serverAPIAddress' : 'http://localhost:8081', + 'serverAPIProxyAddress' : 'http://localhost:8081', + 'ignoreListenSSEType' : ['control/connected', 'control/keepAlive'], + 'data' : {} + }, option); + self['serverSSEAddress'] = self['option']['serverSSEAddress']; + self['serverSSEProxyAddress'] = self['option']['serverSSEProxyAddress']; + self['serverAPIAddress'] = self['option']['serverAPIAddress']; + self['serverAPIProxyAddress'] = self['option']['serverAPIProxyAddress']; + self['ignoreListenSSEType'] = self['option']['ignoreListenSSEType']; + }; + + // private method (for tests) + self._isIgnoreListenSSEType = function (targetType) { + return self['ignoreListenSSEType'].indexOf(targetType) != -1; + }; + + return self; +})(); + +CobitSDK.setSSETimer = function (correlation_key, callback) { + CobitSDK.sse_timer[correlation_key] = setTimeout(function () { + callback && callback(); + if (CobitSDK.callbacks[correlation_key]) { + delete CobitSDK.callbacks[correlation_key]; + } + }, CobitSDK.sse_timeout); +}; + +CobitSDK.clearSSETimer = function (correlation_key) { + var timer_id = CobitSDK.sse_timer[correlation_key]; + if (timer_id) { + clearTimeout(timer_id); + delete CobitSDK.sse_timer[correlation_key]; + } +}; + +CobitSDK.clearAllSSETimer = function () { + Object.keys(CobitSDK.sse_timer).forEach(function (correlation_key) { + CobitSDK.clearSSETimer(correlation_key); + }); +}; + +CobitSDK.addListener = function (evn, func) { + CobitSDK.ee.addListener(evn, func); +}; + +CobitSDK.removeListener = function (evn, func) { + CobitSDK.ee.removeListener(evn, func); +}; + +// remove all listener +CobitSDK.removeEvent = function (evn) { + CobitSDK.ee.removeEvent(evn); +}; + +CobitSDK.extend = function () { + var result = {}; + [].slice.apply(arguments).forEach(function (val) { + Object.keys(val).forEach(function (key) { + result[key] = val[key]; + }) + }); + return result; +}; + +/** + * Return URL of Restlike API after format + * @param {String} urlFormat Format of Restlike API URL + * @param {Object} param Parameter to replace URL + * @return {String} Formatted Restlike API URL + */ +CobitSDK.getAPI = function (urlFormat, param) { + param = CobitSDK.extend(CobitSDK.defaultParameter, param); + // encode for ['+/='] + param['access_token'] = encodeURIComponent(param['access_token']); + urlFormat += (urlFormat.match(/\?/) ? '&' : '?') + 'authentication_method=query_string&access_token=:access_token'; + var url = urlFormat.replace(/:(\w+)/g, function(all, key) { + return param[key] || ''; + }); + return CobitSDK['serverAPIAddress'] + url; +}; + +CobitSDK.param = function (param) { + var keys = Object.keys(param); + var results = []; + for (var i = 0, l = keys.length; i < l; i++) { + results.push(keys[i] + '=' + encodeURIComponent(param[keys[i]])); + } + return results.join('&'); +}; + +CobitSDK['login'] = CobitSDK.login; +CobitSDK['connect'] = CobitSDK.connect; +CobitSDK['setSSETimer'] = CobitSDK.setSSETimer; +CobitSDK['clearSSETimer'] = CobitSDK.clearSSETimer; +CobitSDK['addListener'] = CobitSDK.addListener; +CobitSDK['removeListener'] = CobitSDK.removeListener; +CobitSDK['removeEvent'] = CobitSDK.removeEvent; +CobitSDK['extend'] = CobitSDK.extend; +CobitSDK['getAPI'] = CobitSDK.getAPI; +CobitSDK['param'] = CobitSDK.param; +window['CobitSDK'] = CobitSDK; + +/** + * Cobit.apiBase + * @constructor + */ +(function () { + var klass = function (event, sender, option) { + this.event = event; + this.sender = sender; + this.option = option; + + this.sender.addListener('offline', function () { + CobitSDK.ee.emit('offline'); + }); + }; + var klassName = 'apiBase'; + var proto = klass.prototype; + proto.sendAjax = function (option) { + var success = option['success']; + var error = option['error']; + var stimeout = option['stimeout']; + var correlation_key = option['data'] ? option['data']['correlation_key'] : undefined; + + // for debug + CobitSDK.ee.emit('CobitAPIRequest', option); + option['success'] = function (res, xhr) { + if (res.result !== 'OK' && res.result !== 'ACCEPTED') { + CobitSDK.ee.emit('error'); + error && error(xhr); + return; + } + // for debug + CobitSDK.ee.emit('CobitAcceptResponse', res); + if (stimeout) CobitSDK.setSSETimer(correlation_key, stimeout); + success && success(res); + }; + option['error'] = function (xhr) { + CobitSDK.ee.emit('error'); + error && error(xhr); + }; + option['timeout'] = function (xhr) { + CobitSDK.ee.emit('timeout'); + error && error(xhr); + if (correlation_key && CobitSDK.callbacks[correlation_key]) { + delete CobitSDK.callbacks[correlation_key]; + } + }; + this.sender.ajax(option); + }; + + proto.wrapAsyncParams = function(args, option) { + return $.extend({ + 'success': option['response'], + 'error': option['error'], + 'stimeout': option['stimeout'] + }, args); + }; + + proto.generateCorrelationKey = function() { + return UUID.generate(); + }; + + proto.getOrGenerateCorrelationKey = function(option) { + return option['correlation_key'] || this.generateCorrelationKey(); + }; + + proto.loadConversations = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/participating', {}), + 'data': { + 'offset': option['offset'] || 0, + 'limit': option['limit'] || 10 + }, + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.loadUpdatedConversations = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/updated/participating', {}), + 'data': { + 'offset': option['offset'] || 0, + 'limit': option['limit'] || 10 + }, + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getConversation = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI( + '/:version/sync/conversation/:id', + {'id': option.conversation_id} + ), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getConversationByRefKey = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/refkey', {}), + 'data': { + 'ref_key': option['ref_key'] + }, + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getParticipants = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI( + '/:version/sync/conversation/:id/participants', + {'id': option.conversation_id} + ), + 'data': { + 'offset': option['offset'] || 0, + 'limit': option['limit'] || 10 + }, + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.unreadCount = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/message/unread_count', {}), + 'type': 'POST', + 'data': { + 'conversation_ids': option['conversation_ids'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.createConversation = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/conversation/create', {}), + 'type': 'POST', + 'data': { + 'client_custom_field': option['client_custom_field'], + 'ref_key': option['ref_key'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.createAndAdd = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/conversation/create_and_add', {}), + 'type': 'POST', + 'data': { + 'client_custom_field': option['client_custom_field'], + 'ref_key': option['ref_key'], + 'target_user_ref_keys': option['target_user_ref_keys'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.addUserByRefKey = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/add', + {'id': option['conversation_id']} + ), + 'type': 'POST', + 'data': { + 'target_user_ref_keys': option['target_user_ref_keys'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.joinConversation = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/join', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'correlation_key': correlation_key, + 'user_id': option['user_id'] + } + }, option)); + }; + + proto.joinConversationByRefKey = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/conversation/join_by_refkey', {}), + 'type': 'POST', + 'data': { + 'application_id': option['application_id'], + 'ref_key': option['ref_key'], + 'user_id': option['user_id'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.leaveConversation = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/leave', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.updateConversation = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/update', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'name': option['name'], + 'client_custom_field': option['client_custom_field'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.updateConversationName = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/update/name', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'name': option['name'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.sendMessage = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:to_conversation_id/send_text_message', + {'to_conversation_id': option['conversation_id']} + ), + 'type': 'POST', + 'data': { + 'ref_key': option['ref_key'], + 'text': option['text'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.latestMessage = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/message/latest_message', {}), + 'data': { + 'conversation_ids': option['conversation_ids'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.history = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + var data = { + 'correlation_key': correlation_key, + 'limit': option['limit'] || 10 + }; + if (option['offset_event_id']) { + data['offset_event_id'] = option['offset_event_id']; + } + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/history', + {'id': option['conversation_id']} + ), + 'data': data + }, option)); + }; + + proto.sendUserEvent = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:to_conversation_id/send_custom_event', + {'to_conversation_id': option['to_conversation_id']} + ), + 'type': 'POST', + 'data': { + 'event_sub_type': option['event_sub_type'], + 'text': option['text'], + 'correlation_key': correlation_key, + 'from_user_id': option['from_user_id'] + } + }, option)); + }; + + proto.readPastMessages = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/read_past_messages', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'base_message_id': option['message_id'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.readPastAllMessages = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:id/read_all_messages', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.addListener = function (type, callback) { + this.event.addListener(type, callback); + return this; + }; + + proto.removeListener = function (type, callback) { + this.event.removeListener(type, callback); + return this; + }; + + proto.getConversationNotificationSetting = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/notification/settings/conversation/:id/get', + {'id': option.conversation_id} + ), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getConversationNotificationSettingList = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI('/:version/async/notification/settings/conversations/get', {}), + 'data': { + 'conversation_ids': option['conversation_ids'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.updateConversationNotificationSetting = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/notification/settings/conversation/:id/update', + {'id': option['conversation_id']} + ), + 'type': 'POST', + 'data': { + 'enabled': option['notification_enabled'], + 'correlation_key': correlation_key + } + }, option)); + }; + + proto.updateConversationDisplaySetting = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/:id/personalsetting/update', + {'id': option.conversation_id} + ), + 'type': 'POST', + 'data': { + 'displayed': option['displays'] + }, + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getConversationPersonalSetting = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/:id/personalsetting/get', + {'id': option.conversation_id} + ), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getHiddenConversationsUnreadCount = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI('/:version/sync/conversation/nondisplayed_unread/participating', {}), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getMyStamps = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI( + '/:version/sync/stamps/my/get?displayed_filter=:displayed_filter', + {'displayed_filter': option['displayed_filter']} + ), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.getStampPackage = function (option) { + this.sendAjax({ + 'url': CobitSDK.getAPI( + '/:version/sync/stamp/:stamp_id/package', + {'stamp_id': option['stamp_id']} + ), + 'success': option['success'], + 'error': option['error'] + }); + }; + + proto.sendStampUnit = function (option) { + var correlation_key = this.getOrGenerateCorrelationKey(option); + CobitSDK.callbacks[correlation_key] = option['success']; + + this.sendAjax(this.wrapAsyncParams({ + 'url': CobitSDK.getAPI( + '/:version/async/conversation/:to_conversation_id/send_stamp_message', + {'to_conversation_id': option['to_conversation_id']} + ), + 'type': 'POST', + 'data': { + 'ref_key': option['ref_key'], + 'stamp_unit_id': option['stamp_unit_id'], + 'correlation_key': correlation_key + } + }, option)); + }; + + CobitSDK[klassName] = klass; +})(); + +var proto = CobitSDK['apiBase'].prototype; +CobitSDK['apiBase']['prototype'] = { + 'sendAjax': proto.sendAjax, + 'wrapAsyncParams': proto.wrapAsyncParams, + 'generateCorrelationKey': proto.generateCorrelationKey, + 'getOrGenerateCorrelationKey': proto.getOrGenerateCorrelationKey, + 'loadConversations': proto.loadConversations, + 'loadUpdatedConversations': proto.loadUpdatedConversations, + 'getConversation': proto.getConversation, + 'getConversationByRefKey': proto.getConversationByRefKey, + 'getParticipants': proto.getParticipants, + 'getConversationWithParticipants': proto.getConversationWithParticipants, + 'unreadCount': proto.unreadCount, + 'createConversation': proto.createConversation, + 'createAndAdd': proto.createAndAdd, + 'addUserByRefKey': proto.addUserByRefKey, + 'joinConversation': proto.joinConversation, + 'joinConversationByRefKey': proto.joinConversationByRefKey, + 'leaveConversation': proto.leaveConversation, + 'updateConversation': proto.updateConversation, + 'updateConversationName': proto.updateConversationName, + 'sendMessage': proto.sendMessage, + 'latestMessage': proto.latestMessage, + 'history': proto.history, + 'readPastMessages': proto.readPastMessages, + 'readPastAllMessages': proto.readPastAllMessages, + 'sendUserEvent': proto.sendUserEvent, + 'addListener': proto.addListener, + 'getConversationNotificationSetting': proto.getConversationNotificationSetting, + 'getConversationNotificationSettingList': proto.getConversationNotificationSettingList, + 'updateConversationNotificationSetting': proto.updateConversationNotificationSetting, + 'updateConversationDisplaySetting': proto.updateConversationDisplaySetting, + 'getConversationPersonalSetting': proto.getConversationPersonalSetting, + 'getHiddenConversationsUnreadCount': proto.getHiddenConversationsUnreadCount, + 'getMyStamps': proto.getMyStamps, + 'getStampPackage': proto.getStampPackage, + 'sendStampUnit': proto.sendStampUnit +}; +window['CobitSDK']['apiBase'] = CobitSDK['apiBase']; + +var monapt; +(function (monapt) { + monapt.Tuple1 = function (a) { + return { + _1: a + }; + }; + + monapt.Tuple2 = function (a, b) { + return { + _1: a, + _2: b + }; + }; +})(monapt || (monapt = {})); +var monapt; +(function (monapt) { + var asInstanceOf = function (v) { + return v; + }; + + var Some = (function () { + function Some(value) { + this.value = value; + this.isEmpty = false; + } + Some.prototype.get = function () { + return this.value; + }; + + Some.prototype.getOrElse = function (defaultValue) { + return this.value; + }; + + Some.prototype.orElse = function (alternative) { + return this; + }; + + Some.prototype.match = function (matcher) { + if (matcher.Some) { + matcher.Some(this.value); + } + }; + + Some.prototype.map = function (f) { + return new Some(f(this.get())); + }; + + Some.prototype.flatMap = function (f) { + return f(this.get()); + }; + + Some.prototype.filter = function (predicate) { + if (predicate(this.value)) { + return this; + } else { + return new None(); + } + }; + + Some.prototype.reject = function (predicate) { + return this.filter(function (v) { + return !predicate(v); + }); + }; + + Some.prototype.foreach = function (f) { + f(this.value); + }; + return Some; + })(); + monapt.Some = Some; + + var None = (function () { + function None() { + this.isEmpty = true; + } + None.prototype.get = function () { + throw new Error('No such element.'); + }; + + None.prototype.getOrElse = function (defaultValue) { + return defaultValue(); + }; + + None.prototype.orElse = function (alternative) { + return alternative(); + }; + + None.prototype.match = function (matcher) { + if (matcher.None) { + matcher.None(); + } + }; + + None.prototype.map = function (f) { + return asInstanceOf(this); + }; + + None.prototype.flatMap = function (f) { + return asInstanceOf(this); + }; + + None.prototype.filter = function (predicate) { + return this; + }; + + None.prototype.reject = function (predicate) { + return this; + }; + + None.prototype.foreach = function (f) { + return; + }; + return None; + })(); + monapt.None = None; +})(monapt || (monapt = {})); +var monapt; +(function (monapt) { + var asInstanceOf = function (v) { + return v; + }; + + var Success = (function () { + function Success(value) { + this.value = value; + this.isSuccess = true; + this.isFailure = false; + } + Success.prototype.get = function () { + return this.value; + }; + + Success.prototype.getOrElse = function (defaultValue) { + return this.get(); + }; + + Success.prototype.orElse = function (alternative) { + return this; + }; + + Success.prototype.match = function (matcher) { + if (matcher.Success) + matcher.Success(this.get()); + }; + + Success.prototype.map = function (f) { + var _this = this; + return monapt.Try(function () { + return f(_this.value); + }); + }; + + Success.prototype.flatMap = function (f) { + try { + return f(this.value); + } catch (e) { + return new Failure(e); + } + }; + + Success.prototype.filter = function (predicate) { + try { + if (predicate(this.value)) { + return this; + } else { + return new Failure(new Error('Predicate does not hold for ' + this.value)); + } + } catch (e) { + return new Failure(e); + } + }; + + Success.prototype.reject = function (predicate) { + return this.filter(function (v) { + return !predicate(v); + }); + }; + + Success.prototype.foreach = function (f) { + f(this.value); + }; + + Success.prototype.recover = function (fn) { + return this; + }; + + Success.prototype.recoverWith = function (fn) { + return this; + }; + return Success; + })(); + monapt.Success = Success; + + var Failure = (function () { + function Failure(error) { + this.error = error; + this.isSuccess = false; + this.isFailure = true; + } + Failure.prototype.get = function () { + throw this.error; + }; + + Failure.prototype.getOrElse = function (defaultValue) { + return defaultValue(); + }; + + Failure.prototype.orElse = function (alternative) { + return alternative(); + }; + + Failure.prototype.match = function (matcher) { + if (matcher.Failure) + matcher.Failure(this.error); + }; + + Failure.prototype.map = function (f) { + return asInstanceOf(this); + }; + + Failure.prototype.flatMap = function (f) { + return asInstanceOf(this); + }; + + Failure.prototype.filter = function (predicate) { + return this; + }; + + Failure.prototype.reject = function (predicate) { + return this; + }; + + Failure.prototype.foreach = function (f) { + return; + }; + + Failure.prototype.recover = function (fn) { + try { + return new Success(fn(this.error)); + } catch (e) { + return new Failure(e); + } + }; + + Failure.prototype.recoverWith = function (fn) { + try { + return fn(this.error); + } catch (e) { + return new Failure(this.error); + } + }; + return Failure; + })(); + monapt.Failure = Failure; + + monapt.Try = function (f) { + try { + return new Success(f()); + } catch (e) { + return new Failure(e); + } + }; +})(monapt || (monapt = {})); +var monapt; +(function (monapt) { + var Cracker = (function () { + function Cracker() { + this.fired = false; + this.callbacks = new Array(); + } + Cracker.prototype.fire = function (producer) { + this.producer = producer; + if (this.fired) { + throw new Error('Dose fired twice, Can call only once.'); + } else { + this.fireAll(); + } + }; + + Cracker.prototype.fireAll = function () { + var _this = this; + this.fired = true; + this.callbacks.forEach(function (fn) { + return _this.producer(fn); + }); + }; + + Cracker.prototype.add = function (fn) { + if (this.fired) { + this.producer(fn); + } else { + this.callbacks.push(fn); + } + }; + return Cracker; + })(); + monapt.Cracker = Cracker; +})(monapt || (monapt = {})); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var monapt; +(function (monapt) { + var asInstanceOf = function (v) { + return v; + }; + + function F(target) { + var f = function (v) { + if (v instanceof Error) + target.failure(v); +else + target.success(v); + }; + f['success'] = function (v) { + return target.success(v); + }; + f['failure'] = function (e) { + return target.failure(e); + }; + return f; + } + + var Future = (function () { + function Future(future) { + this.cracker = new monapt.Cracker(); + future(F(this)); + } + Future.succeed = function (value) { + return new Future(function (p) { + return p.success(value); + }); + }; + + Future.failed = function (error) { + return new Future(function (p) { + return p.failure(error); + }); + }; + + Future.prototype.success = function (value) { + this.cracker.fire(function (fn) { + return fn(new monapt.Success(value)); + }); + }; + + Future.prototype.failure = function (error) { + this.cracker.fire(function (fn) { + return fn(new monapt.Failure(error)); + }); + }; + + Future.prototype.onComplete = function (callback) { + this.cracker.add(callback); + }; + + Future.prototype.onSuccess = function (callback) { + this.onComplete(function (r) { + r.match({ + Success: function (v) { + return callback(v); + } + }); + }); + }; + + Future.prototype.onFailure = function (callback) { + this.onComplete(function (r) { + r.match({ + Failure: function (error) { + return callback(error); + } + }); + }); + }; + + Future.prototype.map = function (f) { + var promise = new Promise(); + this.onComplete(function (r) { + r.match({ + Failure: function (e) { + return promise.failure(e); + }, + Success: function (v) { + return f(v, F(promise)); + } + }); + }); + return promise.future(); + }; + + Future.prototype.flatMap = function (f) { + var promise = new Promise(); + this.onComplete(function (r) { + r.match({ + Failure: function (e) { + return promise.failure(e); + }, + Success: function (v) { + f(v).onComplete(function (fr) { + fr.match({ + Success: function (v) { + return promise.success(v); + }, + Failure: function (e) { + return promise.failure(e); + } + }); + }); + } + }); + }); + return promise.future(); + }; + + Future.prototype.filter = function (predicate) { + var promise = new Promise(); + this.onComplete(function (r) { + r.match({ + Failure: function (e) { + promise.failure(e); + }, + Success: function (v) { + try { + if (predicate(v)) { + promise.success(v); + } else { + promise.failure(new Error('No such element.')); + } + } catch (e) { + promise.failure(e); + } + } + }); + }); + return promise.future(); + }; + + Future.prototype.reject = function (predicate) { + return this.filter(function (v) { + return !predicate(v); + }); + }; + + Future.prototype.recover = function (fn) { + var promise = new Promise(); + this.onComplete(function (r) { + r.match({ + Failure: function (error) { + try { + fn(error, F(promise)); + } catch (e) { + promise.failure(e); + } + }, + Success: function (v) { + return promise.success(v); + } + }); + }); + return promise.future(); + }; + + Future.prototype.recoverWith = function (fn) { + var promise = new Promise(); + this.onComplete(function (r) { + return r.match({ + Failure: function (e) { + fn(e).onComplete(function (fr) { + return fr.match({ + Success: function (v) { + return promise.success(v); + }, + Failure: function (e) { + return promise.failure(e); + } + }); + }); + }, + Success: function (v) { + return promise.success(v); + } + }); + }); + return promise.future(); + }; + return Future; + })(); + monapt.Future = Future; + + var Promise = (function (_super) { + __extends(Promise, _super); + function Promise() { + _super.call(this, function (p) { + }); + this.isComplete = false; + } + Promise.prototype.success = function (value) { + this.isComplete = true; + _super.prototype.success.call(this, value); + }; + + Promise.prototype.failure = function (error) { + this.isComplete = true; + _super.prototype.failure.call(this, error); + }; + + Promise.prototype.future = function () { + return this; + }; + return Promise; + })(Future); + monapt.Promise = Promise; + + monapt.future = function (f) { + var p = new Promise(); + + try { + f(F(p)); + } catch (e) { + p.failure(e); + } + return p.future(); + }; +})(monapt || (monapt = {})); +var monapt; +(function (monapt) { + var Selector; + (function (Selector) { + var StringSelector = (function () { + function StringSelector() { + this.table = {}; + } + StringSelector.prototype.register = function (k, index) { + this.table[k] = index; + }; + + StringSelector.prototype.index = function (k) { + if (this.table[k]) { + return new monapt.Some(this.table[k]); + } else { + return new monapt.None(); + } + }; + return StringSelector; + })(); + Selector.StringSelector = StringSelector; + + var HashableSelector = (function () { + function HashableSelector() { + this.table = {}; + } + HashableSelector.prototype.register = function (k, index) { + this.table[k.hash()] = index; + }; + + HashableSelector.prototype.index = function (k) { + var hash = k.hash(); + if (this.table[hash]) { + return new monapt.Some(this.table[hash]); + } else { + return new monapt.None(); + } + }; + return HashableSelector; + })(); + Selector.HashableSelector = HashableSelector; + + var ObjectSelector = (function () { + function ObjectSelector() { + } + ObjectSelector.prototype.register = function (k, index) { + }; + + ObjectSelector.prototype.index = function (k) { + return new monapt.None(); + }; + return ObjectSelector; + })(); + Selector.ObjectSelector = ObjectSelector; + })(Selector || (Selector = {})); + + var Map = (function () { + function Map(key, value) { + var keysAndValues = []; + for (var _i = 0; _i < (arguments.length - 2); _i++) { + keysAndValues[_i] = arguments[_i + 2]; + } + this.real = []; + if (value) { + if (keysAndValues.length != 0 && keysAndValues.length % 2 != 0) { + throw new Error(keysAndValues[keysAndValues.length - 1] + ' has not value.'); + } else { + this.ensureSelector(key); + this.add(key, value); + for (var i = 0, l = keysAndValues.length; i < l; i += 2) { + this.add(keysAndValues[i], keysAndValues[i + 1]); + } + } + } else if (key) { + var obj = key; + for (var k in obj) { + this.ensureSelector(k); + this.add(k, obj[k]); + } + } + + this.ensureSelector(); + } + Map.prototype.ensureSelector = function (hint) { + if (typeof hint === "undefined") { hint = null; } + if (this.selector) { + return; + } + + if (!hint) { + this.selector = new Selector.ObjectSelector(); + } else if (typeof hint == 'string') { + this.selector = new Selector.StringSelector(); + } else if (hint.hash) { + this.selector = new Selector.HashableSelector(); + } else { + this.selector = new Selector.ObjectSelector(); + } + }; + + Map.prototype.add = function (key, value) { + this.real.push(monapt.Tuple2(key, value)); + this.selector.register(key, this.real.length - 1); + }; + + Map.prototype.foreach = function (f) { + this.real.forEach(function (value, index, array) { + return f(value._1, value._2); + }); + }; + + Map.prototype.map = function (f) { + var result = new Map(); + this.foreach(function (k, v) { + var t = f(k, v); + result.add(t._1, t._2); + }); + return result; + }; + + Map.prototype.flatMap = function (f) { + var result = new Map(); + this.foreach(function (k, v) { + var r = f(k, v); + r.foreach(function (k, v) { + return result.add(k, v); + }); + }); + return result; + }; + + Map.prototype.mapValues = function (f) { + var result = new Map(); + this.foreach(function (k, v) { + result.add(k, f(v)); + }); + return result; + }; + + Map.prototype.filter = function (predicate) { + var result = new Map(); + this.foreach(function (k, v) { + if (predicate(k, v)) + result.add(k, v); + }); + return result; + }; + + Map.prototype.reject = function (predicate) { + return this.filter(function (k, v) { + return !predicate(k, v); + }); + }; + + Map.prototype.find = function (f) { + return this.filter(f).head(); + }; + + Map.prototype.get = function (key) { + var _this = this; + return this.selector.index(key).map(function (index) { + return _this.real[index]._2; + }).orElse(function () { + return _this.find(function (k, v) { + return k == key; + }).map(function (tuple) { + return tuple._2; + }).orElse(function () { + return new monapt.None(); + }); + }); + }; + + Map.prototype.getOrElse = function (key, defaultValue) { + return this.get(key).getOrElse(defaultValue); + }; + + Map.prototype.head = function () { + if (this.real.length > 0) { + return new monapt.Some(this.real[0]); + } else { + return new monapt.None(); + } + }; + return Map; + })(); + monapt.Map = Map; +})(monapt || (monapt = {})); + +var __slice = [].slice; + +window.namespace = function(target, name, block) { + var item, top, _i, _len, _ref, _ref1; + if (arguments.length < 3) { + _ref = [(typeof exports !== "undefined" && exports !== null ? exports : window)].concat(__slice.call(arguments)), target = _ref[0], name = _ref[1], block = _ref[2]; + } + top = target; + _ref1 = name.split('.'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + item = _ref1[_i]; + target = target[item] || (target[item] = {}); + } + return block(target, top); +}; + +window.use = function(ns) { + return namespace(ns, function(exports) { + return exports; + }); +}; + +namespace('gluon', function(exports) { + var COMMON_PREFIX_, localStorageEnabled_, objectStorage; + COMMON_PREFIX_ = 'gluon'; + exports.Storage = (function() { + var prefix_, storage_; + + storage_ = null; + + prefix_ = null; + + function _Class(namespace) { + if (namespace == null) { + namespace = null; + } + if (window.localStorage == null) { + return; + } + if (localStorageEnabled_) { + storage_ = window.localStorage; + } else { + storage_ = objectStorage; + } + prefix_ = COMMON_PREFIX_; + if (namespace != null) { + prefix_ = "" + prefix_ + "." + namespace; + } + } + + _Class.prototype.get = function(key) { + return storage_ != null ? storage_.getItem("" + prefix_ + "." + key) : void 0; + }; + + _Class.prototype.set = function(key, value) { + if (storage_ != null) { + storage_.setItem("" + prefix_ + "." + key, value); + } + }; + + _Class.prototype.remove = function(key) { + if (storage_ != null) { + storage_.removeItem("" + prefix_ + "." + key); + } + }; + + return _Class; + + })(); + objectStorage = { + data: {}, + getItem: function(key) { + return this.data[key]; + }, + setItem: function(key, value) { + this.data[key] = value; + }, + removeItem: function(key) { + delete this.data[key]; + } + }; + return localStorageEnabled_ = (function() { + var e; + try { + localStorage.setItem('test', 'dummy'); + } catch (_error) { + e = _error; + return false; + } + return true; + })(); +}); + +namespace('gluon.oauth2', function(exports) { + var configuration_, gluon; + configuration_ = { + endpoint: { + tokeninfo: null, + fallback: null + } + }; + gluon = use('gluon'); + exports.storage = { + namespace: 'oauth2', + key: { + accessToken: 'accessToken', + lastState: 'lastState', + backTo: 'backTo' + } + }; + exports.iframeName = 'gluon.oauth2'; + exports.cmd = { + setStorageItem: 'setStorageItem', + getStorageItem: 'getStorageItem', + removeStorageItem: 'removeStorageItem', + authorize: 'authorize', + reauthorize: 'reauthorize' + }; + exports.initialize = function(configuration) { + configuration_ = configuration; + }; + exports.isRequired = function() { + var _ref; + return (configuration_.appId != null) && (((_ref = configuration_.endpoint) != null ? _ref.authorize : void 0) != null) && (configuration_.endpoint.tokeninfo != null) && (configuration_.endpoint.authCallback != null); + }; + exports.redirectFallbackUrl = function() { + if (configuration_.endpoint.fallback != null) { + window.top.location.href = configuration_.endpoint.fallback; + } + }; + return exports.verifyAccessToken = function(accessToken) { + return $.ajax({ + url: "" + configuration_.endpoint.tokeninfo + "&access_token=" + accessToken + "&callback=?", + dataType: 'jsonp' + }); + }; +}); + +namespace('gluon.iframe', function(exports) { + exports.event = { + ready: 'ready' + }; + return exports.getUrlOrigin = function(url) { + if (/^([\w-]+:)?\/\/([^\/:]+)/.test(url)) { + return RegExp.$2; + } else { + return null; + } + }; +}); + +namespace('gluon.iframe', function(exports) { + return exports.Client = (function() { + var deferredQueue_, eventHandlers_, iframe_, messageQueue_, name_, onMessage_, onReady_, postAllMessages_, postMessage_, serverOrigin_, serverUrl_, setServerUrl_, window_; + + name_ = null; + + serverUrl_ = null; + + serverOrigin_ = null; + + iframe_ = null; + + window_ = null; + + deferredQueue_ = []; + + messageQueue_ = []; + + eventHandlers_ = []; + + function _Class(name, serverUrl) { + var doc, style; + if (!((window.postMessage != null) && (name != null) && (serverUrl != null))) { + return; + } + name_ = name; + setServerUrl_(serverUrl); + doc = window.document; + iframe_ = doc.createElement('iframe'); + style = iframe_.style; + style.position = 'absolute'; + style.left = style.top = '-999px'; + this.bind(exports.event.ready, onReady_); + window.addEventListener('message', onMessage_, false); + doc.body.appendChild(iframe_); + } + + _Class.prototype.isEnabled = function() { + return iframe_ != null; + }; + + _Class.prototype.bind = function(event, handler) { + if (eventHandlers_[event] == null) { + eventHandlers_[event] = []; + } + eventHandlers_[event].push(handler); + }; + + _Class.prototype.connect = function(serverUrl) { + if (serverUrl == null) { + serverUrl = null; + } + if (serverUrl != null) { + setServerUrl_(serverUrl); + } + iframe_.src = serverUrl_; + }; + + _Class.prototype.sendRequest = function(message) { + var deferred; + message.target = name_; + message.id = deferredQueue_.length; + deferred = $.Deferred(); + deferredQueue_.push(deferred); + if (window_ != null) { + postMessage_(message); + } else { + messageQueue_.push(message); + } + return deferred.promise(); + }; + + setServerUrl_ = function(serverUrl) { + serverUrl_ = serverUrl; + serverOrigin_ = exports.getUrlOrigin(serverUrl); + }; + + onMessage_ = function(event) { + var eventHandler, message, _i, _len, _ref, _ref1; + if (exports.getUrlOrigin(event.origin) !== serverOrigin_) { + return; + } + message = JSON.parse(event.data); + if ((message != null ? message.target : void 0) !== name_) { + return; + } + if ((message.event != null) && (eventHandlers_[message.event] != null)) { + _ref = eventHandlers_[message.event]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + eventHandler = _ref[_i]; + if (eventHandler != null) { + eventHandler(message.params); + } + } + return; + } + if (!((message.cmd != null) && (message.id != null))) { + return; + } + if ((_ref1 = deferredQueue_[message.id]) != null) { + _ref1.resolve(message); + } + deferredQueue_[message.id] = null; + }; + + onReady_ = function(params) { + window_ = iframe_.contentWindow; + setTimeout(postAllMessages_, 0); + }; + + postMessage_ = function(message) { + if (window_ != null) { + window_.postMessage(JSON.stringify(message), serverUrl_); + } + }; + + postAllMessages_ = function() { + var message, _i, _len; + for (_i = 0, _len = messageQueue_.length; _i < _len; _i++) { + message = messageQueue_[_i]; + postMessage_(message); + } + messageQueue_.length = 0; + }; + + return _Class; + + })(); +}); + +namespace('gluon.oauth2.client', function(exports) { + var authorizeDeferred_, client_, getStorageItem_, iframe, makeStorageFunc_, oauth2, processStorageItem_, removeStorageItem_, setStorageItem_, storage_; + client_ = null; + storage_ = null; + authorizeDeferred_ = null; + iframe = use('gluon.iframe'); + oauth2 = use('gluon.oauth2'); + exports.initialize = function(configuration) { + makeStorageFunc_(); + oauth2.initialize(configuration); + if (configuration.endpoint.authServer != null) { + client_ = new iframe.Client(oauth2.iframeName, configuration.endpoint.authServer); + client_.bind(iframe.event.ready, function(params) { + if (authorizeDeferred_ != null) { + authorizeDeferred_.resolve(); + } + }); + exports.authorize(); + } else { + storage_ = new gluon.Storage(oauth2.storage.namespace); + } + }; + exports.authorize = function() { + if (!(client_ != null ? client_.isEnabled() : void 0)) { + return $.Deferred(function(d) { + return d.reject(); + }); + } else if (authorizeDeferred_ != null) { + return authorizeDeferred_.promise(); + } + authorizeDeferred_ = $.Deferred(); + client_.connect(); + client_.sendRequest({ + cmd: oauth2.cmd.authorize + }); + return authorizeDeferred_.promise(); + }; + exports.reauthorize = function() { + if (!(client_ != null ? client_.isEnabled() : void 0)) { + $.Deferred(function(d) { + return d.reject(); + }); + } else if ((authorizeDeferred_ != null ? authorizeDeferred_.state() : void 0) === 'pending') { + authorizeDeferred_.promise(); + } + authorizeDeferred_ = $.Deferred(); + client_.sendRequest({ + cmd: oauth2.cmd.reauthorize + }); + return authorizeDeferred_.promise(); + }; + makeStorageFunc_ = function() { + var capitalized, key, value, _ref; + _ref = oauth2.storage.key; + for (key in _ref) { + value = _ref[key]; + capitalized = value.charAt(0).toUpperCase() + value.substring(1); + exports["get" + capitalized] = (function(k) { + return function() { + return getStorageItem_(k); + }; + })(value); + exports["set" + capitalized] = (function(k) { + return function(v) { + return setStorageItem_(k, v); + }; + })(value); + exports["remove" + capitalized] = (function(k) { + return function() { + return removeStorageItem_(k); + }; + })(value); + } + }; + getStorageItem_ = function(key) { + return processStorageItem_(key, null, function(k, v) { + return client_.sendRequest({ + cmd: oauth2.cmd.getStorageItem, + params: { + key: k + } + }).pipe(function(message) { + return $.Deferred(function(d) { + return d.resolve(message.params.value); + }); + }); + }, function(k, v) { + return $.Deferred(function(d) { + return d.resolve(storage_.get(k)); + }); + }); + }; + setStorageItem_ = function(key, value) { + return processStorageItem_(key, value, function(k, v) { + return client_.sendRequest({ + cmd: oauth2.cmd.setStorageItem, + params: { + key: k, + value: v + } + }); + }, function(k, v) { + return $.Deferred(function(d) { + storage_.set(k, v); + return d.resolve(); + }); + }); + }; + removeStorageItem_ = function(key) { + return processStorageItem_(key, null, function(k, v) { + return client_.sendRequest({ + cmd: oauth2.cmd.removeStorageItem, + params: { + key: k + } + }); + }, function(k, v) { + return $.Deferred(function(d) { + storage_.remove(k); + return d.resolve(); + }); + }); + }; + return processStorageItem_ = function(key, value, iframeFunc, storageFunc) { + if (client_ != null ? client_.isEnabled() : void 0) { + return iframeFunc(key, value); + } else if (storage_ != null) { + return storageFunc(key, value); + } else { + return $.Deferred(function(d) { + return d.reject(); + }); + } + }; +}); + +namespace('gluon.jsonRpc', function(exports) { + var VERSION_STRING_, configuration_, makeDeferredRequest_, makeParams_, oauth2, sendAjaxRequest_, sendOauth2Request_, sendRetryRequest_; + VERSION_STRING_ = '2.0'; + configuration_ = { + endpoint: { + api: null + }, + requestCallback: null + }; + oauth2 = use('gluon.oauth2'); + exports.initialize = function(configuration) { + configuration_ = configuration; + }; + exports.makeObject = function(method, id, params, requiredParams, optionalParams, renderer, isLoggingSkipped) { + var obj; + obj = { + jsonrpc: VERSION_STRING_, + method: method, + id: id, + params: makeParams_(params, requiredParams, optionalParams), + renderer: renderer, + isLoggingSkipped: isLoggingSkipped + }; + if (configuration_.token != null) { + obj.token = configuration_.token; + } + return obj; + }; + exports.sendRequest = function(obj, onSuccess, onError) { + if (_.isArray(obj) && obj.length === 1) { + obj = obj.shift(); + } + return makeDeferredRequest_(obj).pipe(function(data, status, xhr) { + var e; + try { + return onSuccess != null ? onSuccess.apply(this, arguments) : void 0; + } catch (_error) { + e = _error; + return $.Deferred(function(d) { + return d.reject(xhr, status, e); + }); + } + }).fail(onError); + }; + makeDeferredRequest_ = function(obj) { + if (configuration_.requestCallback != null) { + return $.Deferred(function(d) { + return configuration_.requestCallback(d, obj); + }); + } else if (oauth2.isRequired()) { + return sendOauth2Request_(obj, false); + } else { + return sendAjaxRequest_(obj); + } + }; + sendOauth2Request_ = function(obj, isRetry) { + return oauth2.client.authorize().pipe(function() { + return oauth2.client.getAccessToken().pipe(function(accessToken) { + if (accessToken != null) { + return sendAjaxRequest_(obj, accessToken).pipe(null, function(xhr, status, e) { + var errorObj, _ref; + try { + errorObj = JSON.parse(xhr.responseText); + if ((errorObj != null ? (_ref = errorObj.error) != null ? _ref.code : void 0 : void 0) === gluon.error.AUTHORIZATION_REQUIRED) { + return sendRetryRequest_(obj, isRetry); + } + } catch (_error) { + e = _error; + } + return $.Deferred(function(d) { + return d.reject(xhr, status, e); + }); + }); + } else { + return sendRetryRequest_(obj, isRetry); + } + }); + }); + }; + sendRetryRequest_ = function(obj, isRetryFailed) { + if (isRetryFailed) { + return oauth2.redirectFallbackUrl(); + } else { + return oauth2.client.reauthorize().pipe(function() { + return sendOauth2Request_(obj, true); + }); + } + }; + sendAjaxRequest_ = function(obj, accessToken) { + var options; + if (accessToken == null) { + accessToken = null; + } + options = { + type: 'POST', + url: configuration_.endpoint.api, + data: JSON.stringify(obj), + dataType: 'json', + xhrFields: { + withCredentials: true + } + }; + if (accessToken != null) { + options.headers = { + Authorization: "Bearer " + accessToken + }; + } + return $.ajax(options); + }; + return makeParams_ = function(params, requiredParams, optionalParams) { + var key, missingKeys, name, names, result, _i, _j, _len, _len1, _ref; + if (params == null) { + if (requiredParams != null) { + throw new Error('params not found.'); + } else { + return null; + } + } + if (requiredParams != null) { + missingKeys = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = requiredParams.length; _i < _len; _i++) { + key = requiredParams[_i]; + if (params[key] == null) { + _results.push(key); + } + } + return _results; + })(); + if (missingKeys.length > 0) { + throw new Error("params " + (missingKeys.join()) + " not found."); + } + } else if (optionalParams == null) { + return params; + } + result = {}; + _ref = [requiredParams, optionalParams]; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + names = _ref[_i]; + if (names != null) { + for (_j = 0, _len1 = names.length; _j < _len1; _j++) { + name = names[_j]; + if (params[name] != null) { + result[name] = params[name]; + } + } + } + } + return result; + }; +}); + +namespace('gluon.error', function(exports) { + exports.RESOURCE_NOT_FOUND = -32001; + exports.AUTHORIZATION_REQUIRED = -32002; + exports.ACCESS_DENIED = -32003; + exports.PARAMETER_MISSING = -32004; + exports.INVALID_PARAMETER = -32005; + exports.UNKNOWN_API = -32006; + exports.UNKNOWN_PARAMETER = -32007; + exports.UNIMPLEMENTED_API = -32008; + exports.FRIEND_IGNORE_LIST_LIMIT_EXCEEDED = -33001; + exports.FRIEND_ADD_TO_IGNORE_LIST_FAILED = -33002; +}); + +var __hasProp = {}.hasOwnProperty; + +namespace('gluon.cache', function(exports) { + var cacheStorage; + cacheStorage = use('gluon.cacheStorage'); + exports.ONE_MINUTE = 60 * 1000; + exports.TEN_MINUTES = 10 * 60 * 1000; + exports.ONE_HOUR = 60 * 60 * 1000; + exports.TWO_HOURS = 2 * 60 * 60 * 1000; + exports.TWELVE_HOURS = 12 * 60 * 60 * 1000; + exports.ONE_DAY = 24 * 60 * 60 * 1000; + exports.batchCacheRequest = function() { + var cache, cacheParams, cached, gluonBatch, i, len_, req, reqIndex, reqs, _i, _len; + reqIndex = {}; + reqs = []; + cacheParams = []; + cached = {}; + len_ = arguments.length; + for (i = _i = 0, _len = arguments.length; _i < _len; i = ++_i) { + req = arguments[i]; + if (req.isCacheRequest && !req.forceRequest) { + cache = cacheStorage.get(req.key); + if (cache != null) { + cached[i] = cache; + continue; + } + } + reqIndex[i] = reqs.length; + if (req.isCacheRequest) { + reqs.push(req.gluonReq); + cacheParams.push({ + key: req.key, + expire: req.expire + }); + } else { + reqs.push(req); + cacheParams.push(null); + } + } + if (reqs.length === 0) { + return { + send: function(onSuccess, onError) { + if (cached.length === 1) { + cached = cached.shift(); + } + return $.Deferred(function(d) { + onSuccess(cached); + return d.resolve(); + }); + } + }; + } else { + gluonBatch = gluon._batch.apply(null, reqs); + return { + send: function(onSuccess, onError) { + return gluonBatch.send(function(results) { + var params, res, result, _j, _len1; + if (!(results instanceof Array)) { + results = [results]; + } + for (i = _j = 0, _len1 = results.length; _j < _len1; i = ++_j) { + result = results[i]; + params = cacheParams[i]; + if (params != null) { + cacheStorage.set(params.key, result, params.expire, result.serial); + } + } + res = (function() { + var _k, _ref, _ref1, _results; + _results = []; + for (i = _k = 0, _ref = len_ - 1; 0 <= _ref ? _k <= _ref : _k >= _ref; i = 0 <= _ref ? ++_k : --_k) { + _results.push((_ref1 = cached[i]) != null ? _ref1 : results[reqIndex[i]]); + } + return _results; + })(); + if (res.length === 1) { + res = res.shift(); + } + return onSuccess(res); + }, onError); + } + }; + } + }; + exports.cacheRequest = function(gluonReq, expire, force) { + if (force == null) { + force = false; + } + if (expire > 0) { + this.prepareForCache(gluonReq); + return { + isCacheRequest: true, + expire: expire, + gluonReq: gluonReq, + key: gluonReq.key, + forceRequest: force, + send: function(onSuccess, onError) { + var cache, key; + key = this.key; + expire = this.expire; + cache = cacheStorage.get(key); + if (!this.forceRequest && (cache != null)) { + return $.Deferred(function(d) { + onSuccess(cache); + return d.resolve(); + }); + } else { + return gluonReq.send(function(result) { + cacheStorage.set(key, result, expire, result.serial); + return onSuccess(result); + }, onError); + } + } + }; + } else { + return gluonReq; + } + }; + exports._makeKey = function(gluonReq) { + var k, keys, p, v, _i, _len; + keys = ((function() { + var _ref, _results; + _ref = gluonReq.p_; + _results = []; + for (k in _ref) { + v = _ref[k]; + _results.push(k); + } + return _results; + })()).sort(); + p = {}; + for (_i = 0, _len = keys.length; _i < _len; _i++) { + k = keys[_i]; + p[k] = gluonReq.p_[k]; + } + return gluonReq.m_ + (JSON.stringify(p)); + }; + exports.prepareForCache = function(gluonReq) { + return gluonReq.key = this._makeKey(gluonReq); + }; + exports.clearAll = function() { + return cacheStorage.clearAll(); + }; + exports.clearByApiPrefix = function(name) { + return cacheStorage.clearByApiPrefix(name); + }; + return exports.clearExpiredAndOutdated = function() { + return cacheStorage.clearExpiredAndOutdated(); + }; +}); + +namespace('gluon.cacheStorage', function(exports) { + var localStorage, localStorageEnabled_, modulePrefix, reModulePrefix; + localStorageEnabled_ = (function() { + var e; + try { + window.localStorage.setItem('test', 'dummy'); + } catch (_error) { + e = _error; + return false; + } + return true; + })(); + localStorage = localStorageEnabled_ ? window.localStorage : {}; + modulePrefix = 'gluon-cacheStorage-'; + reModulePrefix = new RegExp('^' + modulePrefix); + exports.set = function(key, value, expire, serial) { + if (serial == null) { + serial = 0; + } + return localStorage[modulePrefix + key] = JSON.stringify({ + data: value, + expire: (new Date).getTime() + expire, + serial: serial + }); + }; + exports.get = function(key, defaultValue) { + var e, json, now; + try { + json = JSON.parse(localStorage[modulePrefix + key]); + } catch (_error) { + e = _error; + return defaultValue; + } + now = (new Date).getTime(); + if (json.expire < now) { + this.remove(key); + return defaultValue; + } + return json.data; + }; + exports.clearExpiredAndOutdated = function(currentSerial) { + var key, now, _results; + if (currentSerial == null) { + currentSerial = 0; + } + now = (new Date).getTime(); + _results = []; + for (key in localStorage) { + if (!__hasProp.call(localStorage, key)) continue; + if (key.indexOf(modulePrefix) === 0) { + key = key.replace(reModulePrefix, ''); + _results.push(this._checkExpireAndSerial(key, now, currentSerial)); + } else { + _results.push(void 0); + } + } + return _results; + }; + exports.clearAll = function() { + var key, _results; + _results = []; + for (key in localStorage) { + if (!__hasProp.call(localStorage, key)) continue; + if (key.indexOf(modulePrefix) === 0) { + _results.push(this._rawRemove(key)); + } else { + _results.push(void 0); + } + } + return _results; + }; + exports.clearByApiPrefix = function(name) { + var key, _results; + if (typeof name !== 'string' || name.length === 0) { + return; + } + _results = []; + for (key in localStorage) { + if (!__hasProp.call(localStorage, key)) continue; + if (key.indexOf(modulePrefix + name) === 0) { + _results.push(this._rawRemove(key)); + } else { + _results.push(void 0); + } + } + return _results; + }; + exports.remove = function(key) { + return this._rawRemove(modulePrefix + key); + }; + exports._rawRemove = function(rawKey) { + return delete localStorage[rawKey]; + }; + exports._checkExpireAndSerial = function(key, now, currentSerial) { + var json; + json = this._getRawJson(key); + if (json == null) { + this.remove(key); + return; + } + if (json.expire < now) { + this.remove(key); + return; + } + if (json.serial < currentSerial) { + this.remove(key); + } + }; + exports._getRawJson = function(key) { + var e, json; + json = localStorage[modulePrefix + key]; + if (json == null) { + return null; + } + try { + json = JSON.parse(json); + } catch (_error) { + e = _error; + return null; + } + return json; + }; + return exports.calcHash = function(str) { + var c, hash, i, len_, _i, _ref; + hash = 0; + len_ = str.length; + if (len_ === 0) { + return hash; + } + for (i = _i = 0, _ref = len_ - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { + c = str.charCodeAt(i); + hash = (hash << 5) - hash + c; + hash &= hash; + } + return hash; + }; +}); + +namespace('gluon', function(exports) { + var cache, configuration_, jsonRpc, oauth2; + jsonRpc = use('gluon.jsonRpc'); + oauth2 = use('gluon.oauth2'); + cache = use('gluon.cache'); + configuration_ = { + appId: null, + endpoint: { + api: null, + authorize: null, + tokeninfo: null, + authCallback: null, + authServer: null, + fallback: null + }, + requestCallback: null + }; + exports.initialize = function(url, requestCallback) { + var configuration; + if (requestCallback == null) { + requestCallback = null; + } + if (typeof url === 'object') { + configuration = url; + } else { + configuration = { + endpoint: { + api: url + }, + requestCallback: requestCallback + }; + } + configuration_ = configuration; + jsonRpc.initialize(configuration); + oauth2.client.initialize(configuration); + }; + exports.request = function(method, params, requiredParams, optionalParams, renderer, isLoggingSkipped) { + if (renderer == null) { + renderer = 'proton'; + } + if (isLoggingSkipped == null) { + isLoggingSkipped = false; + } + if (typeof method === 'object') { + params = method.params; + requiredParams = method.requiredParams; + optionalParams = method.optionalParams; + renderer = method.renderer; + isLoggingSkipped = method.isLoggingSkipped; + method = method.method; + } + return { + m_: method, + p_: params, + rp_: requiredParams, + op_: optionalParams, + r_: renderer, + ils_: isLoggingSkipped, + send: function(onSuccess, onError) { + return jsonRpc.sendRequest(jsonRpc.makeObject(this.m_, 1, this.p_, this.rp_, this.op_, this.r_, this.ils_), onSuccess, onError); + }, + setCacheInfo: function(info) { + return gluon.cache.cacheRequest(this, info.expire, info.force); + } + }; + }; + exports._batch = function(arg) { + var req, reqs; + reqs = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = arguments.length; _i < _len; _i++) { + req = arguments[_i]; + delete req.send; + _results.push(req); + } + return _results; + }).apply(this, arguments); + return { + params: function(p) { + var key, value, _i, _len; + for (_i = 0, _len = reqs.length; _i < _len; _i++) { + req = reqs[_i]; + if (req.p_ == null) { + req.p_ = {}; + } + for (key in p) { + value = p[key]; + if (req.p_[key] == null) { + req.p_[key] = value; + } + } + } + return this; + }, + send: function(onSuccess, onError) { + var i; + return jsonRpc.sendRequest((function() { + var _i, _len, _results; + _results = []; + for (i = _i = 0, _len = reqs.length; _i < _len; i = ++_i) { + req = reqs[i]; + _results.push(jsonRpc.makeObject(req.m_, i + 1, req.p_, req.rp_, req.op_, req.r_, req.ils_)); + } + return _results; + })(), onSuccess, onError); + } + }; + }; + return exports.batch = function() { + return cache.batchCacheRequest.apply(null, arguments); + }; +}); + +/*! fivefold v0.1.1 | MIT Licence | https://github.com/yaakaito/fivefold | (c) 2013 yaakaito.org */ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var fivefold; +(function (fivefold) { + function isFunction(obj) { + return typeof obj === "function" && !(obj instanceof RegExp); + } + function isJQueryObject(obj) { + if (typeof obj != 'object') + return false; + + return (typeof obj.on == 'function' && typeof obj.off == 'function'); + } + + function proxy(fn, context) { + if (!isFunction(fn)) { + return undefined; + } + + return function () { + return fn.apply(context || this, Array.prototype.slice.call(arguments)); + }; + } + fivefold.silent = false; + + var errorLog = function (error) { + if (!fivefold.silent) + console.log(error.message); + }; + var realizerPathSplitter = /\./; + + var Realizer = (function () { + function Realizer() { + this.prefix = ''; + this.suffix = ''; + } + Realizer.prototype.realizeTry = function (pathOrName) { + var _this = this; + return monapt.Try(function () { + return _this.realize(pathOrName); + }); + }; + + Realizer.prototype.realize = function (pathOrName) { + var clazz = this.getClass(this.parsePathOrName(pathOrName)); + return new clazz(); + }; + + Realizer.prototype.parsePathOrName = function (pathOrName) { + return pathOrName.split(realizerPathSplitter); + }; + + Realizer.prototype.getClass = function (pathComponents) { + var current = window; + for (var i = 0, l = pathComponents.length, component; i < l; i++) { + component = pathComponents[i]; + + current = current[i == l - 1 ? this.prefix + component + this.suffix : component]; + } + return current; + }; + return Realizer; + })(); + fivefold.Realizer = Realizer; + var uniqId = 0; + function viewUniqId() { + return 'view' + uniqId++; + } + + function ensureElement(view, selector, context) { + if (view.$el) { + return; + } + + var $el = null; + if (selector) { + $el = $(selector, context); + } else { + $el = $('<' + view.tagName + '>'); + } + + var attributes = {}; + for (var key in view.attributes) { + attributes[key] = view.attributes[key]; + } + + if (view.id) { + attributes['id'] = view.id; + } + + if (view.className) { + attributes['class'] = view.className; + } + + view.$el = $el.attr(attributes); + } + + var eventSplitter = /^(\S+)\s*(.*)$/; + + var View = (function () { + function View(options) { + if (typeof options === "undefined") { options = {}; } + this.cid = viewUniqId(); + this.$el = null; + this.tagName = 'div'; + this.id = ''; + this.className = ''; + this.attributes = {}; + this.autoRender = true; + var delegate = options.delegate == null ? true : options.delegate; + var selector = options.selector; + var context = options.context; + + this.$el = isJQueryObject(options.$el) ? options.$el : null; + this.tagName = options.tagName || 'div'; + this.id = options.id || ''; + this.className = options.className || ''; + this.attributes = (typeof options.attributes == 'object') ? options.attributes : {}; + ensureElement(this, selector, context); + + if (delegate) { + this.delegateEvents(); + } + } + View.prototype.events = function () { + return null; + }; + + View.prototype.delegateEvents = function (events) { + var _this = this; + if (!(events || (events = this.events()))) { + return this; + } + this.undelegateAll(); + var evmap = new monapt.Map(events); + evmap.mapValues(function (fn) { + if (isFunction(fn)) { + return fn; + } else { + return _this[fn]; + } + }).filter(function (key, fn) { + return isFunction(fn); + }).map(function (event, fn) { + var match = event.match(eventSplitter); + return monapt.Tuple2(match[1], monapt.Tuple2(match[2], proxy(fn, _this))); + }).foreach(function (e, t) { + return _this.delegate(e, t._1, t._2); + }); + return this; + }; + + View.prototype.delegate = function (event, fnOrSelector, fn) { + var evt = event + '.ff' + this.cid; + this.$el.on.call(this.$el, evt, fnOrSelector, fn); + }; + + View.prototype.undelegateAll = function () { + this.$el.off('.ff' + this.cid); + }; + + View.prototype.render = function () { + return this; + }; + return View; + })(); + fivefold.View = View; + + var Layout = (function (_super) { + __extends(Layout, _super); + function Layout() { + _super.apply(this, arguments); + this.$el = $(document.body); + this.$content = $(document.body); + } + Layout.prototype.beforeDisplayContent = function () { + ; + }; + + Layout.prototype.display = function (elem) { + this.$content.html(elem); + }; + return Layout; + })(View); + fivefold.Layout = Layout; + + var defaultLayout = new Layout(); + + var Controller = (function () { + function Controller() { + this.layout = defaultLayout; + } + Controller.prototype.dispatch = function (method, optionsOrError) { + var _this = this; + this.layout.render(); + var promise = new monapt.Promise(); + + var action = this[method](optionsOrError); + action.onComplete(function (r) { + return r.match({ + Success: function (view) { + try { + if (view.autoRender) + view.render(); + _this.layout.beforeDisplayContent(); + _this.layout.display(view.$el); + promise.success(view); + } catch (e) { + errorLog(e); + promise.failure(e); + } + }, + Failure: function (e) { + promise.failure(e); + errorLog(e); + } + }); + }); + + return promise.future(); + }; + return Controller; + })(); + fivefold.Controller = Controller; + + var ControllerRepository = (function () { + function ControllerRepository() { + } + ControllerRepository.prototype.controllerForRouteTry = function (route) { + var realizer = new ControllerRealizer(); + return realizer.realizeTry(route.controller).filter(function (controller) { + return controller instanceof Controller; + }); + }; + return ControllerRepository; + })(); + + var controllerRepository = new ControllerRepository(); + + var ControllerRealizer = (function (_super) { + __extends(ControllerRealizer, _super); + function ControllerRealizer() { + _super.apply(this, arguments); + this.suffix = 'Controller'; + } + return ControllerRealizer; + })(Realizer); + fivefold.ControllerRealizer = ControllerRealizer; + var ActionFuture = (function (_super) { + __extends(ActionFuture, _super); + function ActionFuture() { + _super.apply(this, arguments); + } + return ActionFuture; + })(monapt.Future); + fivefold.ActionFuture = ActionFuture; + + fivefold.actionFuture = function (f) { + return monapt.future(function (p) { + return f(p); + }); + }; + + var ActionError = (function () { + function ActionError(name, message) { + this.name = name; + this.message = message; + } + return ActionError; + })(); + fivefold.ActionError = ActionError; + var Route = (function () { + function Route(pattern, controller, method) { + this.pattern = pattern; + this.controller = controller; + this.method = method; + } + return Route; + })(); + fivefold.Route = Route; + + var RouteRepository = (function () { + function RouteRepository() { + this.routes = {}; + } + RouteRepository.prototype.routesMap = function () { + return new monapt.Map(this.routes); + }; + + RouteRepository.prototype.registerRoute = function (route) { + this.routes[route.pattern] = route; + }; + return RouteRepository; + })(); + + var routeRepository = new RouteRepository(); + + var ErrorRouteRepository = (function (_super) { + __extends(ErrorRouteRepository, _super); + function ErrorRouteRepository() { + _super.apply(this, arguments); + } + ErrorRouteRepository.prototype.routeForError = function (error) { + return _super.prototype.routesMap.call(this).get(error.name); + }; + return ErrorRouteRepository; + })(RouteRepository); + + var errorRouteRepository = new ErrorRouteRepository(); + + var routeSplitter = /::/; + + function routeRegisterFn(pattern, controllerOrRedirect) { + var repository = routeRepository; + if (typeof controllerOrRedirect == "string") { + var comp = controllerOrRedirect.split(routeSplitter); + repository.registerRoute(new Route(pattern, comp[0], comp[1])); + } else { + } + } + + function errorRouteRegisterFn(code, controllerAndMethod) { + var repository = errorRouteRepository; + var comp = controllerAndMethod.split(routeSplitter); + var route = null; + if (typeof code == 'number') + route = new Route('' + code, comp[0], comp[1]); else + route = new Route(code, comp[0], comp[1]); + repository.registerRoute(route); + } + (function (RouteError) { + RouteError[RouteError["NotFound"] = -1] = "NotFound"; + + RouteError[RouteError["DispatchFailure"] = -2] = "DispatchFailure"; + })(fivefold.RouteError || (fivefold.RouteError = {})); + var RouteError = fivefold.RouteError; + + var NotFound = function () { + return new ActionError('-1', ''); + }; + var DispatchFailure = function () { + return new ActionError('-2', ''); + }; + + var histories = []; + + fivefold.history = { + previous: function (n) { + if (typeof n === "undefined") { n = 1; } + if (histories.length <= 1) + return []; else + return histories.slice(0, histories.length - 2).slice(-n).reverse(); + }, + current: function () { + return histories[histories.length - 1]; + } + }; + + var routeListeners = []; + + var Router = (function () { + function Router(resolver) { + this.resolver = resolver; + this.dispatcher = new Dispatcher(); + this.start(); + } + Router.prototype.start = function () { + var _this = this; + window.onhashchange = function (event) { + _this.onHashChange(); + }; + setTimeout(function () { + return _this.onHashChange(); + }, 0); + }; + + Router.prototype.onHashChange = function () { + var _this = this; + var relativeURL = location.hash; + var resolve = this.resolver.resolve(relativeURL, routeRepository.routesMap()); + resolve.onComplete(function (r) { + return r.match({ + Success: function (routeAndOptions) { + return _this.dispatcher.dispatch(routeAndOptions.route, routeAndOptions.options); + }, + Failure: function (error) { + return _this.dispatcher.dispatchError(NotFound()); + } + }); + }); + }; + + Router.prototype.reload = function () { + this.onHashChange(); + }; + + Router.prototype.routes = function (routes) { + routes(routeRegisterFn); + }; + + Router.prototype.errorRoutes = function (routes) { + routes(errorRouteRegisterFn); + }; + + Router.prototype.listen = function (listener) { + routeListeners.push(listener); + }; + return Router; + })(); + fivefold.Router = Router; + + var Dispatcher = (function () { + function Dispatcher() { + } + Dispatcher.prototype.dispatch = function (route, optionsOrError) { + var _this = this; + controllerRepository.controllerForRouteTry(route).match({ + Success: function (controller) { + controller.dispatch(route.method, optionsOrError).onFailure(function (error) { + _this.dispatchError(error); + }); + + histories.push(route); + for (var i = 0, l = routeListeners.length; i < l; i++) { + routeListeners[i](route, optionsOrError); + } + }, + Failure: function (e) { + return _this.dispatchError(e); + } + }); + }; + + Dispatcher.prototype.dispatchError = function (error) { + var _this = this; + errorRouteRepository.routeForError(error).match({ + Some: function (route) { + _this.dispatch(route, error); + }, + None: function () { + errorLog(new Error('Route not found: ' + error.message)); + } + }); + }; + return Dispatcher; + })(); +})(fivefold || (fivefold = {})); + +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DDD; +(function (DDD) { + var Identity = (function () { + function Identity(value) { + this.value = value; + } + Identity.prototype.getValue = function () { + return this.value; + }; + + Identity.prototype.equals = function (that) { + if (that == null) { + return false; + } + if (this == that) { + return true; + } + + return this.value === that.getValue(); + }; + return Identity; + })(); + DDD.Identity = Identity; + + var NumberIdentity = (function (_super) { + __extends(NumberIdentity, _super); + function NumberIdentity(value) { + _super.call(this, value); + } + return NumberIdentity; + })(Identity); + DDD.NumberIdentity = NumberIdentity; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var Entity = (function () { + function Entity(identity) { + this.identity = identity; + } + Entity.prototype.getIdentity = function () { + return this.identity; + }; + + Entity.prototype.equals = function (that) { + if (that == null) { + return false; + } + if (this == that) { + return true; + } + return this.identity.equals(that.getIdentity()); + }; + return Entity; + })(); + DDD.Entity = Entity; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var AsyncRepository = (function () { + function AsyncRepository(core) { + this.core = core; + } + AsyncRepository.prototype.resolve = function (identity) { + var _this = this; + return monapt.future(function (p) { + p.success(_this.core.resolveOption(identity).get()); + }); + }; + + AsyncRepository.prototype.store = function (entity) { + var _this = this; + return monapt.future(function (p) { + p.success(_this.core.store(entity)); + }); + }; + + AsyncRepository.prototype.storeList = function (entityList) { + var _this = this; + return monapt.future(function (p) { + p.success(_this.core.storeList(entityList)); + }); + }; + + AsyncRepository.prototype.deleteByEntity = function (entity) { + var _this = this; + return monapt.future(function (p) { + _this.core.deleteByEntity(entity); + p.success(_this); + }); + }; + + AsyncRepository.prototype.deleteByIdentity = function (identity) { + var _this = this; + return monapt.future(function (p) { + _this.core.deleteByIdentity(identity); + p.success(_this); + }); + }; + return AsyncRepository; + })(); + DDD.AsyncRepository = AsyncRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var OnLocalStorageRepository = (function () { + function OnLocalStorageRepository(mapper) { + this.parse = mapper.parse; + this.stringify = mapper.stringify; + } + OnLocalStorageRepository.prototype.resolveOption = function (identity) { + var entity = this.resolve(identity); + if (entity != null) { + return new monapt.Some(entity); + } else { + return new monapt.None(); + } + }; + + OnLocalStorageRepository.prototype.resolve = function (identity) { + var json = JSON.parse(localStorage.getItem(identity.getValue())); + if (json) { + return this.parse(json); + } + return null; + }; + + OnLocalStorageRepository.prototype.store = function (entity) { + localStorage.setItem(entity.getIdentity().getValue(), this.stringify(entity)); + return entity; + }; + + OnLocalStorageRepository.prototype.storeList = function (entityList) { + for (var i in entityList) { + this.store(entityList[i]); + } + return entityList; + }; + + OnLocalStorageRepository.prototype.deleteByEntity = function (entity) { + this.deleteByIdentity(entity.getIdentity()); + return this; + }; + + OnLocalStorageRepository.prototype.deleteByIdentity = function (identity) { + localStorage.removeItem(identity.getValue()); + return this; + }; + return OnLocalStorageRepository; + })(); + DDD.OnLocalStorageRepository = OnLocalStorageRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var AsyncOnLocalStorageRepository = (function (_super) { + __extends(AsyncOnLocalStorageRepository, _super); + function AsyncOnLocalStorageRepository(mapper) { + _super.call(this, new DDD.OnLocalStorageRepository(mapper)); + } + return AsyncOnLocalStorageRepository; + })(DDD.AsyncRepository); + DDD.AsyncOnLocalStorageRepository = AsyncOnLocalStorageRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var OnMemoryRepository = (function () { + function OnMemoryRepository() { + this.entities = {}; + } + OnMemoryRepository.prototype.resolveOption = function (identity) { + var entity = this.resolve(identity); + if (entity != null) { + return new monapt.Some(entity); + } else { + return new monapt.None(); + } + }; + + OnMemoryRepository.prototype.resolve = function (identity) { + return this.entities[identity.getValue()]; + }; + + OnMemoryRepository.prototype.store = function (entity) { + this.entities[entity.getIdentity().getValue()] = entity; + return entity; + }; + + OnMemoryRepository.prototype.storeList = function (entityList) { + for (var i in entityList) { + this.store(entityList[i]); + } + return entityList; + }; + + OnMemoryRepository.prototype.deleteByEntity = function (entity) { + this.deleteByIdentity(entity.getIdentity()); + return this; + }; + + OnMemoryRepository.prototype.deleteByIdentity = function (identity) { + delete this.entities[identity.getValue()]; + return this; + }; + return OnMemoryRepository; + })(); + DDD.OnMemoryRepository = OnMemoryRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var AsyncOnMemoryRepository = (function (_super) { + __extends(AsyncOnMemoryRepository, _super); + function AsyncOnMemoryRepository() { + _super.call(this, new DDD.OnMemoryRepository()); + } + return AsyncOnMemoryRepository; + })(DDD.AsyncRepository); + DDD.AsyncOnMemoryRepository = AsyncOnMemoryRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var OnSessionStorageRepository = (function () { + function OnSessionStorageRepository(mapper) { + this.parse = mapper.parse; + this.stringify = mapper.stringify; + } + OnSessionStorageRepository.prototype.resolveOption = function (identity) { + var entity = this.resolve(identity); + if (entity != null) { + return new monapt.Some(entity); + } else { + return new monapt.None(); + } + }; + + OnSessionStorageRepository.prototype.resolve = function (identity) { + var item = sessionStorage.getItem(identity.getValue()); + var json = item ? JSON.parse(item) : null; + return json ? this.parse(json) : null; + }; + + OnSessionStorageRepository.prototype.store = function (entity) { + sessionStorage.setItem(entity.getIdentity().getValue(), this.stringify(entity)); + return entity; + }; + + OnSessionStorageRepository.prototype.storeList = function (entityList) { + for (var i in entityList) { + this.store(entityList[i]); + } + return entityList; + }; + + OnSessionStorageRepository.prototype.deleteByEntity = function (entity) { + this.deleteByIdentity(entity.getIdentity()); + return this; + }; + + OnSessionStorageRepository.prototype.deleteByIdentity = function (identity) { + sessionStorage.removeItem(identity.getValue()); + return this; + }; + return OnSessionStorageRepository; + })(); + DDD.OnSessionStorageRepository = OnSessionStorageRepository; +})(DDD || (DDD = {})); +var DDD; +(function (DDD) { + var AsyncOnSessionStorageRepository = (function (_super) { + __extends(AsyncOnSessionStorageRepository, _super); + function AsyncOnSessionStorageRepository(mapper) { + _super.call(this, new DDD.OnSessionStorageRepository(mapper)); + } + return AsyncOnSessionStorageRepository; + })(DDD.AsyncRepository); + DDD.AsyncOnSessionStorageRepository = AsyncOnSessionStorageRepository; +})(DDD || (DDD = {})); + +/* + * Date Format 1.2.3 + * (c) 2007-2009 Steven Levithan + * MIT license + * + * Includes enhancements by Scott Trenda + * and Kris Kowal + * + * Accepts a date, a mask, or a date and a mask. + * Returns a formatted version of the given date. + * The date defaults to the current date/time. + * The mask defaults to dateFormat.masks.default. + */ + +;var dateFormat = function () { + var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMs])\1?|TT|tt|[LloSZ]|"[^"]*"|'[^']*'/g, + timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, + timezoneClip = /[^-+\dA-Z]/g, + pad = function (val, len) { + val = String(val); + len = len || 2; + while (val.length < len) val = "0" + val; + return val; + }; + + // Regexes and supporting functions are cached through closure + return function (date, mask, utc) { + + var dF = dateFormat; + + // You can't provide utc if you skip other args (use the "UTC:" mask prefix) + if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { + mask = date; + date = undefined; + } + + date = date || new Date; + + if(!(date instanceof Date)) { + date = new Date(date); + } + + if (isNaN(date)) { + throw TypeError("Invalid date"); + } + + mask = String(dF.masks[mask] || mask || dF.masks["default"]); + + // Allow setting the utc argument via the mask + if (mask.slice(0, 4) == "UTC:") { + mask = mask.slice(4); + utc = true; + } + + if (!dF.i18n.initialized) { + dF.initLocale(); + } + + var _ = utc ? "getUTC" : "get", + d = date[_ + "Date"](), + D = date[_ + "Day"](), + m = date[_ + "Month"](), + y = date[_ + "FullYear"](), + H = date[_ + "Hours"](), + M = date[_ + "Minutes"](), + s = date[_ + "Seconds"](), + L = date[_ + "Milliseconds"](), + o = utc ? 0 : date.getTimezoneOffset(), + flags = { + d: d, + dd: pad(d), + ddd: dF.i18n.dayNames[D], + dddd: dF.i18n.dayNames[D + 7], + m: m + 1, + mm: pad(m + 1), + mmm: dF.i18n.monthNames[m], + mmmm: dF.i18n.monthNames[m + 12], + yy: String(y).slice(2), + yyyy: y, + h: H % 12 || 12, + hh: pad(H % 12 || 12), + H: H, + HH: pad(H), + M: M, + MM: pad(M), + s: s, + ss: pad(s), + l: pad(L, 3), + L: pad(L > 99 ? Math.round(L / 10) : L), + //t: H < 12 ? dF.i18n.amPmNames.am : dF.i18n.amPmNames.pm, + tt: H < 12 ? dF.i18n.amPmNames.am : dF.i18n.amPmNames.pm, + //T: H < 12 ? dF.i18n.amPmNames.am : dF.i18n.amPmNames.pm, + TT: H < 12 ? dF.i18n.amPmNames.am : dF.i18n.amPmNames.pm, + Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), + o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), + S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] + }; + + return mask.replace(token, function ($0) { + return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); + }); + }; +}(); + +// Some common format strings +dateFormat.masks = { + "default": "ddd mmm dd yyyy HH:MM:ss", + shortDate: "m/d/yy", + mediumDate: "mmm d, yyyy", + longDate: "mmmm d, yyyy", + fullDate: "dddd, mmmm d, yyyy", + shortTime: "h:MM TT", + mediumTime: "h:MM:ss TT", + longTime: "h:MM:ss TT Z", + isoDate: "yyyy-mm-dd", + isoTime: "HH:MM:ss", + isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", + isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" +}; + +; +(function jqdeferred(jQuery) { + var extend = function (obj, base) { + for (var k in obj) { + base[k] = obj[k] + } + } + + // String to Object flags format cache + var flagsCache = {}, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + + // Convert String-formatted flags into Object-formatted ones and store in cache + function createFlags( flags ) { + var object = flagsCache[ flags ] = {}, + i, length; + flags = flags.split( /\s+/ ); + for ( i = 0, length = flags.length; i < length; i++ ) { + object[ flags[i] ] = true; + } + return object; + } + + + + // Populate the class2type map + jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + }); + + + var // Static reference to slice + sliceDeferred = [].slice; + extend({ + Deferred: function( func ) { + var doneList = jQuery.Callbacks( "once memory" ), + failList = jQuery.Callbacks( "once memory" ), + progressList = jQuery.Callbacks( "memory" ), + state = "pending", + lists = { + resolve: doneList, + reject: failList, + notify: progressList + }, + promise = { + done: doneList.add, + fail: failList.add, + progress: progressList.add, + + state: function() { + return state; + }, + + // Deprecated + isResolved: doneList.fired, + isRejected: failList.fired, + + then: function( doneCallbacks, failCallbacks, progressCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); + return this; + }, + always: function() { + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; + }, + pipe: function( fnDone, fnFail, fnProgress ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ], + progress: [ fnProgress, "notify" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + obj = promise; + } else { + for ( var key in promise ) { + obj[ key ] = promise[ key ]; + } + } + return obj; + } + }, + deferred = promise.promise({}), + key; + + for ( key in lists ) { + deferred[ key ] = lists[ key ].fire; + deferred[ key + "With" ] = lists[ key ].fireWith; + } + + // Handle state + deferred.done( function() { + state = "resolved"; + }, failList.disable, progressList.lock ).fail( function() { + state = "rejected"; + }, doneList.disable, progressList.lock ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = sliceDeferred.call( arguments, 0 ), + i = 0, + length = args.length, + pValues = new Array( length ), + count = length, + pCount = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(), + promise = deferred.promise(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( deferred, args ); + } + }; + } + function progressFunc( i ) { + return function( value ) { + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + deferred.notifyWith( promise, pValues ); + }; + } + if ( length > 1 ) { + for ( ; i < length; i++ ) { + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return promise; + }, + /* + * Create a callback list using the following parameters: + * + * flags: an optional list of space-separated flags that will change how + * the callback list behaves + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible flags: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ + Callbacks: function( flags ) { + + // Convert flags from String-formatted to Object-formatted + // (we check in cache first) + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + + var // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = [], + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Add one or several callbacks to the list + add = function( args ) { + var i, + length, + elem, + type, + actual; + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + // Inspect recursively + add( elem ); + } else if ( type === "function" ) { + // Add if not in unique mode and callback is not in + if ( !flags.unique || !self.has( elem ) ) { + list.push( elem ); + } + } + } + }, + // Fire callbacks + fire = function( context, args ) { + args = args || []; + memory = !flags.memory || [ context, args ]; + firing = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { + memory = true; // Mark as halted + break; + } + } + firing = false; + if ( list ) { + if ( !flags.once ) { + if ( stack && stack.length ) { + memory = stack.shift(); + self.fireWith( memory[ 0 ], memory[ 1 ] ); + } + } else if ( memory === true ) { + self.disable(); + } else { + list = []; + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + var length = list.length; + add( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away, unless previous + // firing was halted (stopOnFalse) + } else if ( memory && memory !== true ) { + firingStart = length; + fire( memory[ 0 ], memory[ 1 ] ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + var args = arguments, + argIndex = 0, + argLength = args.length; + for ( ; argIndex < argLength ; argIndex++ ) { + for ( var i = 0; i < list.length; i++ ) { + if ( args[ argIndex ] === list[ i ] ) { + // Handle firingIndex and firingLength + if ( firing ) { + if ( i <= firingLength ) { + firingLength--; + if ( i <= firingIndex ) { + firingIndex--; + } + } + } + // Remove the element + list.splice( i--, 1 ); + // If we have some unicity property then + // we only need to do this once + if ( flags.unique ) { + break; + } + } + } + } + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + if ( list ) { + var i = 0, + length = list.length; + for ( ; i < length; i++ ) { + if ( fn === list[ i ] ) { + return true; + } + } + } + return false; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory || memory === true ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( stack ) { + if ( firing ) { + if ( !flags.once ) { + stack.push( [ context, args ] ); + } + } else if ( !( flags.once && memory ) ) { + fire( context, args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!memory; + } + }; + + return self; + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + // Convert dashed to camelCase; used by the css and data modules + camelCase: function( string ) { + return string.replace( rdashAlpha, fcamelCase ); + } + }, jQuery); + + // replace $.ajax with deferred one + var __ajax = jQuery.ajax; + + jQuery.ajax = function (opts) { + return jQuery.Deferred(function (d) { + var xhr = null; + var settings = { + success: function (success, statusText, jqXHR) { + if (opts.success && opts.success instanceof Function) { + opts.success.apply(xhr, [success, statusText, jqXHR]); + } + d.resolve(success, statusText, jqXHR); + }, + error: function (jqXHR, statusText, error) { + if (opts.error && opts.error instanceof Function) { + opts.error.apply(xhr, [jqXHR, statusText, error]); + } + d.reject(jqXHR, statusText, error); + } + }; + for (var k in opts) { + if (!(k in settings)) { + settings[k] = opts[k] + } + } + + $.ajaxSettings.beforeSend = function (xhr) { + if (opts.xhrFields) { + for (name in opts.xhrFields) { + xhr[name] = opts.xhrFields[name]; + } + } + } + xhr = __ajax.call(jQuery, settings); + }) + } + +})(Zepto); + + +// Zepto complements +if (!$.fn.fadeToggle) { + $.fn.fadeToggle = $.fn.toggle +} + + +// Generated by CoffeeScript 1.6.2 +(function() { + (function(exports) { + var FULLSIZE_CHAR_OF_NUMBER, LOCALE, TIMEZONE_OFFSET, dateformat, format, resource_; + + LOCALE = 'en-Latn-US'; + TIMEZONE_OFFSET = 0; + exports.initialize = function(options) { + if (options == null) { + options = {}; + } + if (options.defaultLocale != null) { + LOCALE = options.defaultLocale; + } + if (options.defaultTimezoneOffset != null) { + return TIMEZONE_OFFSET = options.defaultTimezoneOffset; + } + }; + dateformat = function() { + var me; + + me = arguments.callee; + if (!me.dateformat) { + me.dateformat = dateFormat; + } + return me.dateformat; + }; + resource_ = {}; + exports.locale = function(value) { + var _ref; + + if (value == null) { + return (_ref = this.locale_) != null ? _ref : LOCALE; + } + this.locale_ = value; + return this; + }; + exports.timezoneOffset = function(value) { + var _ref; + + if (value == null) { + return (_ref = this.timezoneOffset_) != null ? _ref : TIMEZONE_OFFSET; + } + this.timezoneOffset_ = value; + return this; + }; + exports.getDateInCurrentTimezone = function(ts) { + var currentTimezoneOffset, localTimezoneOffset, mills; + + localTimezoneOffset = new Date().getTimezoneOffset() * 60 * 1000; + currentTimezoneOffset = exports.timezoneOffset() * 60 * 1000; + mills = (ts * 1000) + localTimezoneOffset - currentTimezoneOffset; + return new Date(mills); + }; + exports.addResource = function(res, ns, isDefault) { + if (res == null) { + res = {}; + } + if (ns == null) { + ns = 'default'; + } + if (isDefault == null) { + isDefault = false; + } + if (resource_ == null) { + resource_ = {}; + } + if ((resource_['default'] == null) || isDefault) { + resource_['default'] = res; + } + return resource_[ns] = res; + }; + exports.getResource = function(key, ns, plural) { + var k, pk, pluralType; + + if (key == null) { + key = void 0; + } + if (ns == null) { + ns = 'default'; + } + if (plural == null) { + plural = void 0; + } + if (resource_[ns] == null) { + return ''; + } + if (key == null) { + return resource_[ns]; + } + k = key; + if (plural != null) { + pluralType = exports.getPluralType(plural); + pk = pluralType === '' ? key : [key, pluralType].join('_'); + if (resource_[ns][pk] != null) { + k = pk; + } + } + if (resource_[ns][k] == null) { + return ''; + } + return resource_[ns][k]; + }; + exports.getPluralType = function(num) { + var locale, mod10, mod100, suffix; + + locale = exports.locale(); + num = parseInt(num); + mod100 = num % 100; + mod10 = num % 10; + suffix = ''; + if (num === 0) { + suffix = 'zero'; + } + switch (locale) { + case 'ar-Arab-SA': + if (num === 1) { + suffix = 'one'; + } else if (num === 2) { + suffix = 'two'; + } else if (mod100 >= 3 && mod100 <= 10) { + suffix = 'few'; + } else if (mod100 >= 11 && mod100 <= 99) { + suffix = 'many'; + } else { + suffix = 'other'; + } + break; + case 'de-Latn-DE': + case 'en-Latn-US': + case 'en-Latn-ES': + case 'it-Latn-IT': + case 'pt-Latn-BR': + if (num === 1) { + suffix = 'one'; + } else { + suffix = 'other'; + } + break; + case 'fr-Latn-FR': + if (num < 2) { + suffix = 'one'; + } else { + suffix = 'other'; + } + break; + case 'ru-Cyrl-RU': + if (mod10 === 1 && mod100 !== 11) { + suffix = 'one'; + } else if (mod10 >= 2 && mod10 <= 4 && mod100 !== 12 && mod100 !== 14 && mod100 !== 13) { + suffix = 'few'; + } else if (mod10 === 0 || (mod10 <= 9 && mod10 >= 5) || (mod100 <= 14 && mod100 >= 11)) { + suffix = 'many'; + } else { + suffix = 'other'; + } + break; + case 'th-Thai-TH': + case 'tr-Latn-TR': + case 'zh-Hans-CN': + case 'zh-Hant-TW': + case 'ja-Jpan-JP': + case 'id-Latn-ID': + case 'ko-Hang-KR': + if (num > 1) { + suffix = 'one'; + } else { + suffix = 'other'; + } + } + return suffix; + }; + FULLSIZE_CHAR_OF_NUMBER = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + exports.text = function(key, args, plural, ns) { + var i, k, message, v; + + if (args == null) { + args = []; + } + if (plural == null) { + plural = void 0; + } + if (ns == null) { + ns = 'default'; + } + if (plural === void 0) { + i = 0; + for (k in args) { + v = args[k]; + if (!(v != null)) { + continue; + } + if (((typeof v) === 'number' || (v instanceof Number)) || (typeof v.match === "function" ? v.match(/^\d+$/) : void 0)) { + plural = v; + break; + } + } + } + message = exports.getResource(key, ns, plural); + if ((args != null ? args.length : void 0) > 0) { + message = format(message, args); + } + return message; + }; + exports.language = function(languageCode) { + if (languageCode == null) { + languageCode = void 0; + } + return exports.getResource(languageCode, 'language'); + }; + exports.region = function(regionCode) { + return exports.getResource(regionCode, 'region'); + }; + exports.subregion = function(regionCode, subregionCode) { + var subregions; + + if (subregionCode == null) { + subregionCode = void 0; + } + subregions = exports.getResource(regionCode, 'subregion'); + if (subregionCode == null) { + return subregions; + } + if (subregions[subregionCode] == null) { + return ''; + } + return subregions[subregionCode]; + }; + exports.timezone = function(timezoneCode, format) { + var name, offset, offset_h, offset_m, sign, timezone; + + if (format == null) { + format = true; + } + timezone = exports.getResource(timezoneCode, 'timezone'); + if (timezone === '') { + return '-'; + } + if (!format) { + return timezone; + } + name = timezone.name; + offset = timezone.offset; + offset_h = (offset / 60) >> 0; + offset_m = (offset % 60) >> 0; + if (offset_m < 0) { + offset_m = offset_m * -1; + } + offset_m = offset_m < 10 ? '0' + offset_m : offset_m; + sign = offset < 0 ? '' : '+'; + return '(UTC ' + sign + offset_h + ':' + offset_m + ') ' + name; + }; + exports.datetime = function(ts, format) { + var local, localOffset, mills, targetOffset; + + if (format == null) { + format = exports.text('common.dateformat'); + } + local = new Date(ts * 1000); + localOffset = local.getTimezoneOffset() * 60 * 1000; + targetOffset = exports.timezoneOffset() * 60 * 1000; + mills = (ts * 1000) + localOffset - targetOffset; + return dateformat()(new Date(mills), format); + }; + return format = function(f, args) { + return f.replace(/\{(\d)\}/g, function(m, c) { + if (args[parseInt(c)] != null) { + return args[parseInt(c)]; + } else { + return ''; + } + }); + }; + })(window.i18n || (window.i18n = {})); + + dateFormat.i18n = { + initialized: false + }; + + dateFormat.initLocale = function() { + var i18nTexts, p18n; + + p18n = window.i18n; + i18nTexts = function(prefix, list) { + return _.map(list, function(v) { + return p18n.text(prefix + v); + }); + }; + this.i18n.dayNames = i18nTexts('common.day_', ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']); + this.i18n.monthNames = i18nTexts('common.month_', ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']); + this.i18n.amPmNames = { + "am": p18n.text('common.am'), + "pm": p18n.text('common.pm') + }; + return this.i18n.initialized = true; + }; + +}).call(this); + +// Generated by CoffeeScript 1.10.0 +(function() { + var slice = [].slice; + + (function(exports) { + var getAnchorTag, getImgTag, parseURL; + parseURL = function(url) { + var parser; + parser = document.createElement('a'); + parser.href = url; + return parser; + }; + exports.anchorize = function() { + var a_tag, app_info, args, contents, converted_contents, href_pos, i, img_tag, len, m, params, src_pos, start_pos, unescaped_url, url, url_pos; + contents = arguments[0], params = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; + app_info = typeof args[0] !== 'undefined' ? args[0] : false; + m = contents.match(/(https?:\/\/[a-zA-Z0-9\._\/~%\-\+&\#\?!=\(\)@;]+)/g); + if (m == null) { + return contents; + } + start_pos = 0; + converted_contents = ''; + for (i = 0, len = m.length; i < len; i++) { + url = m[i]; + unescaped_url = $('').html(url).text(); + url_pos = contents.indexOf(url, start_pos); + href_pos = contents.lastIndexOf('href=', url_pos); + src_pos = contents.lastIndexOf('src=', url_pos); + a_tag = getAnchorTag(contents, start_pos); + img_tag = getImgTag(contents, start_pos); + if (href_pos > 0 && start_pos < href_pos && a_tag !== null) { + converted_contents += contents.substr(start_pos, a_tag.open.pos - start_pos); + converted_contents += "" + a_tag.contents + ""; + + /* + if url.indexOf(proton.bootstrap.config().domains.sns) is 0 + params = {} + parsed = parseURL unescaped_url + params = proton.history.hash.toObject parsed.hash if parsed.hash? + params.view = proton.controller.defaultView().name_ unless params.view? + converted_contents += touch.create touch.TOUCHAREA, a_tag.contents, params + else + converted_contents += touch.create touch.LINK, a_tag.contents, { url:unescaped_url, class:"link", app_info:app_info } + */ + start_pos = a_tag.close.end_pos + 1; + } else if (src_pos > 0 && start_pos < src_pos && img_tag !== null) { + if (start_pos <= img_tag.pos && url_pos < img_tag.end_pos) { + converted_contents += contents.substr(start_pos, img_tag.end_pos - start_pos + 1); + start_pos = img_tag.end_pos + 1; + } else { + converted_contents += contents.substr(start_pos, url.length); + start_pos = url_pos + url.length; + } + } else if (start_pos <= url_pos) { + converted_contents += contents.substr(start_pos, url_pos - start_pos); + converted_contents += "" + url + ""; + start_pos = url_pos + url.length; + } + } + converted_contents += contents.substr(start_pos, contents.length - start_pos); + return converted_contents; + }; + getAnchorTag = function(contents, start_pos) { + var tag; + tag = {}; + tag.open = {}; + tag.open.pos = contents.indexOf('', tag.open.pos); + if (tag.open.pos === -1 || tag.open.end_pos === -1) { + return null; + } + tag.close = {}; + tag.close.pos = contents.indexOf('', tag.close.pos); + if (tag.close.pos === -1 || tag.close.end_pos === -1) { + return null; + } + tag.contents = contents.substr(tag.open.end_pos + 1, tag.close.pos - tag.open.end_pos - 1); + return tag; + }; + return getImgTag = function(contents, start_pos) { + var tag; + tag = {}; + tag.pos = contents.indexOf('', tag.pos); + if (tag.pos === -1 || tag.end_pos === -1) { + return null; + } + return tag; + }; + })(window.sns || (window.sns = {})); + +}).call(this); + +// Generated by CoffeeScript 1.7.1 +(function() { + var __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + (function(exports) { + var buildUrl, filterParams, serialize; + exports.Beacon = (function() { + Beacon.beacons = {}; + + Beacon.create = function(params, id) { + var b; + if (!id) { + id = _.uniqueId(); + } + b = this.find(id); + if (!b) { + b = new this(id); + } + if (params != null) { + b.addParams(params); + } + this.beacons[id] = b; + return b; + }; + + Beacon.find = function(id) { + return this.beacons[id]; + }; + + Beacon.destory = function(id) { + delete this.beacons[id]; + }; + + Beacon.update = function(beacon) { + this.beacons[beacon.id] = beacon; + }; + + Beacon.prototype.flushed = false; + + function Beacon(id) { + if (!id) { + throw new Error("id is wrong: " + id); + } + this.id = id; + this.params = {}; + this.setHost(SNS.Config.getBeaconDomain()); + } + + Beacon.prototype.setHost = function(hostName) { + this.host = hostName; + this.constructor.update(this); + return this; + }; + + Beacon.prototype.setGif = function(gif) { + this.gif = gif; + this.constructor.update(this); + return this; + }; + + Beacon.prototype.setEventTimestamp = function() { + return this.addParams({ + t: Math.floor((new Date).getTime() / 1000) + }); + }; + + Beacon.prototype.addParams = function(params) { + if (!_.isObject(params)) { + throw new Error('params is not a object'); + } + params = filterParams(params); + this.params = _.defaults(params, this.params); + this.constructor.update(this); + return this; + }; + + Beacon.prototype.flush = function() { + if (!this.host) { + throw new Error("host name is invalid: " + this.host); + } + if (!this.gif) { + throw new Error("gif name is invalid: " + this.gif); + } + this.url = buildUrl("" + this.host + this.gif, this.params); + this.img = new Image; + this.img.src = this.url; + this.flushed = true; + this.constructor.destory(this.id); + return this; + }; + + Beacon.prototype.onComplete = function(callback) { + this.img.onload = callback; + this.img.onerror = callback; + return this; + }; + + return Beacon; + + })(); + filterParams = function(params) { + var keys; + keys = _.filter(_.keys(params), function(key) { + return _.isString(params[key]) || _.isBoolean(params[key]) || _.isNumber(params[key]); + }); + return _.pick(params, keys); + }; + buildUrl = function(url, params) { + return "" + url + "?" + (serialize(params)); + }; + serialize = function(params) { + return _.map(params, function(value, key) { + return "" + key + "=" + (encodeURIComponent(value)); + }).join('&'); + }; + exports.PFBeacon = (function(_super) { + __extends(PFBeacon, _super); + + function PFBeacon(id) { + PFBeacon.__super__.constructor.call(this, id); + this.setHost(SNS.Config.getPfBeaconDomain()); + this.setEventTimestamp(); + } + + PFBeacon.prototype.setEventTimestamp = function() { + var d, timestamp; + d = new Date(); + timestamp = Math.floor(d.getTime() / 1000); + timestamp = timestamp + d.getTimezoneOffset() * 60; + return this.addParams({ + t: timestamp + }); + }; + + return PFBeacon; + + })(exports.Beacon); + exports.AnalyticsBeacon = (function(_super) { + var ANALYTICS_BEACON_SERVICE_ID; + + __extends(AnalyticsBeacon, _super); + + ANALYTICS_BEACON_SERVICE_ID = 'ggpsns'; + + function AnalyticsBeacon(id) { + AnalyticsBeacon.__super__.constructor.call(this, id); + this.setGif('a/trk.gif'); + this.addParams({ + s: ANALYTICS_BEACON_SERVICE_ID + }); + this.serviceParams = {}; + } + + AnalyticsBeacon.prototype.addServiceParams = function(params) { + params = filterParams(params); + this.serviceParams = _.defaults(params, this.serviceParams); + this.addParams({ + q: serialize(this.serviceParams) + }); + return this; + }; + + return AnalyticsBeacon; + + })(exports.PFBeacon); + return exports.AnnounceImpBeacon = (function(_super) { + __extends(AnnounceImpBeacon, _super); + + function AnnounceImpBeacon(id) { + AnnounceImpBeacon.__super__.constructor.call(this, id); + this.setGif('i/trk.gif'); + } + + return AnnounceImpBeacon; + + })(exports.PFBeacon); + })(window.analytics || (window.analytics = {})); + +}).call(this); + +/*! + * imagesLoaded PACKAGED v3.1.8 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); +var Gryfon; +(function (Gryfon) { + Gryfon.ConfigAccessor = null; +})(Gryfon || (Gryfon = {})); +var Blitz; +(function (Blitz) { + (function (Language) { + Language.getMessage = function (key, options, escape) { + return _getMessage(getResource(key), options, escape); + }; + + function _setResource(testResource) { + resource = testResource; + throw new Error("Don't call this(for unit test)"); + } + Language._setResource = _setResource; + + function _getMessage(resource, options, escape) { + var result = (options == undefined) ? resource : format(resource, options, escape); + + return (result != undefined) ? result : ''; + } + + function getResource(key) { + var res = _getResource(key); + if (res !== undefined) { + return res; + } + + return ''; + } + + function _getResource(key) { + if (resource[key]) { + return resource[key]; + } + if (i18n.getResource(key)) { + return i18n.getResource(key); + } + return undefined; + } + + function format(message, options, escape) { + if (!_.isArray(options) && !_.isObject(options)) { + return message; + } + return message.replace(/\{(\w+)\}/g, function (all, idx) { + if (_.isNumber(options[idx])) { + return options[idx]; + } + if (_.isUndefined(escape) || escape === true) { + return Util.String.escapeSpecialChars(options[idx]); + } + return options[idx]; + }); + } + + var resource = { + "chat.back": "戻る", + "chat.ok": "OK", + "chat.complete": "完了", + "chat.confirm": "確認", + "chat.detail": "詳細", + "chat.yes": "はい", + "chat.no": "いいえ", + "chat.save": "保存する", + "chat.save_succeed": "保存されました。", + "chat.save_failed": "保存に失敗しました。もう一度実行するか、時間をおいて再度お試しください。", + "chat.settings": "設定", + "chat.chat_list_name": "チャットリスト", + "chat.chat_hidden_list_name": "非表示チャット", + "chat.tab_conversation_list": "チャット", + "chat.tab_contact_list": "友だち", + "chat.tab_gree_chat": "GREEチャット", + "chat.tab_game_chat": "ゲームチャット", + "chat.create_conversation": "新しいチャットを始める", + "chat.filter_by_name": "名前で絞り込む", + "chat.contact_list_label_new_contacts": "新しい友だち", + "chat.contact_list_label_contacts": "友だち", + "chat.member_select_title": "メンバーを選ぶ", + "chat.dialog_content_member_select_max_member_num": "最大参加人数を超えています。グループチャットは最大{0}人まで参加できます。", + "chat.dialog_content_member_select_penalty": "利用規約で禁止している行為が確認できましたため、一部サービスのご利用を制限させていただきました。", + "chat.conversation_send": "送信", + "chat.conversation_send_with_consent": "同意して送信", + "chat.conversation_load_history": "以前のメッセージを読む", + "chat.conversation_event_leave_member": "{0} さんが退室しました", + "chat.send_moderation_consent": "同意事項に同意した上で送信してください。GREEはメッセージの内容を確認する場合があります。", + "chat.send_moderation_consent_short": "送信にあたり、同意事項に同意の上送信してください。", + "chat.send_moderation_consent_long": "健全性維持のためGREEにてメッセージの内容を確認する場合があります。送信にあたり、同意事項に同意の上送信してください。", + "chat.error_send_filtered": "不適切な文言が含まれる可能性があるため送信できません。", + "chat.error_send_penalty": "規約違反が確認されたため、お客さまのご利用を制限しております。詳細はこちらをご確認ください。", + "chat.error_send_max_char_num": "メッセージの最大文字数を超えているため送信できません。{0} 字以内で入力してください。", + "chat.error_send_common": "送信に失敗しました。もう一度送信を行うか、時間をおいて再度お試しください。", + "chat.error_blocked_user": "このユーザーにはメッセージを送信することができません", + "chat.conversation_notify_new_message": "他のチャットに新着メッセージがあります。", + "chat.conversation_notify_not_friend": "友だちではないチャットメンバーがいます。", + "chat.dialog_content_report": "このメッセージを通報します。よろしいですか?", + "chat.dialog_title_leave_conversation": "チャットからの退室", + "chat.dialog_content_leave_conversation": "チャットから退室すると今までの内容を確認することができなくなります。退室してよろしいですか?", + "chat.dialog_content_move_to_profile": "プロフィールページに遷移しますか?", + "chat.conversation_option_add_members": "メンバー追加", + "chat.conversation_option_notify_off": "通知OFFにする", + "chat.conversation_option_notify_on": "通知ONにする", + "chat.conversation_option_group_settings": "グループ設定", + "chat.conversation_option_leave": "退室", + "chat.group_settings_title": "グループ設定", + "chat.group_settings_conversation_change_title": "グループ名変更", + "chat.group_settings_members_title": "このチャットのメンバー", + "chat.group_settings_save": "保存", + "chat.group_settings_add_members": "メンバーを追加する", + "chat.conversation_event_change_title_with_subject": "{0} さんがグループ名を変更しました", + "chat.conversation_event_change_title_with_subject_by_system": "GREE管理人がグループ名を変更しました", + "chat.conversation_event_change_title_to": "グループ名が 【{0}】に変更されました", + "chat.conversation_event_change_title_to_with_subject": "{0} さんがグループ名を 【{1}】に変更しました", + "chat.conversation_event_add_members_1": "{0} さん が追加されました", + "chat.conversation_event_add_members_2": "{0} さん、{1} さん が追加されました", + "chat.conversation_event_add_members_2_over": "{0} さん、{1} さん 達 {2}人 が追加されました", + "chat.conversation_event_add_members_with_subject_1": "{0} さんが {1} さん を追加しました", + "chat.conversation_event_add_members_with_subject_2": "{0} さんが {1} さん、{2} さん を追加しました", + "chat.conversation_event_add_members_with_subject_2_over": "{0} さんが {1} さん、{2} さん 達 {3}人 を追加しました", + "chat.see_more": "もっと見る", + "chat.cancel": "キャンセル", + "chat.dateformat": "{yyyy}-{m}-{d}", + "chat.dateformat_yesterday_at": "昨日 {H}:{MM}", + "chat.dateformat_time_at": "{H}:{MM}", + "chat.dateformat_date_at": "{m}月{d}日", + "chat.dateformat_weekday_at": "{m}月{d}日 {H}:{MM}", + "chat.dateformat_monthly_at": "{m}月{d}日 {H}:{MM}", + "chat.dateformat_different_year": "{yyyy}年{m}月{d}日 {H}:{MM}", + "chat.dateformat_m/d_H:MM": "{m}/{d} {H}:{MM}", + "chat.yesterday": "昨日", + "chat.just_now": "数秒前", + "chat.within_one_minute": "約1分前", + "chat.x_minutes_ago": "{0}分前", + "chat.x_minutes_ago_other": "{0}分前", + "chat.x_hours_ago": "{0}時間前", + "chat.x_hours_ago_other": "{0}時間前", + "chat.x_days_ago": "{0}日前", + "chat.x_days_ago_more": "{0}日以上前", + "chat.year": "年", + "chat.month": "月", + "chat.day": "日", + "chat.x_person": "{0} 人", + "chat.see_more_loading": "読み込み中…", + "chat.new": "NEW", + "chat.online": "ONLINE", + "chat.mychat": "マイチャット", + "chat.dateformat_b": "{yyyy}年{m}月{d}日", + "chat.dateformat_c": "{yyyy}/{m}/{d}({w})", + "chat.dateformat_d": "{yyyy}年{m}月{d}日({w}) {H}:{MM}", + "chat.dateformat_e": "{m}月{d}日({w}) {H}:{MM}", + "chat.maintenance_format_a": "開始 : {from}
終了 : {to}", + "chat.maintenance_format_b": "{from} ~ {to}", + "chat.day_0": "日", + "chat.day_1": "月", + "chat.day_2": "火", + "chat.day_3": "水", + "chat.day_4": "木", + "chat.day_5": "金", + "chat.day_6": "土", + "chat.dialog_content_upgrade": "この機能をご利用いただくにはご登録情報の追加が必要となります。", + "chat.dialog_title_penalty": "投稿一時停止", + "chat.member_select_add": "追加({num})", + "chat.member_select_create": "開始({num})", + "chat.dialog_title_member_select_max_member_num": "最大参加人数の超過", + "chat.dialog_title_member_select_age_limit": "年齢による制限", + "chat.chat_event_create_chat": "{0}さんがチャットを作りました", + "chat.chat_event_welcome_1on1": "チャットを開始しました。
メッセージを送りましょう!", + "chat.error_send_empty": "メッセージの内容がないため送信できません。", + "chat.error_send_offline": "インターネット接続がオフラインのようです。もう一度送信するか時間をおいて再度お試しください。", + "chat.dialog_title_member_select_min_member_num": "未選択", + "chat.dialog_content_member_select_min_member_num": "友だちを1人以上選択してください。", + "chat.dialog_content_not_permitted": "権限がありません", + "chat.dialog_content_zoning_error": "追加できないユーザが含まれています", + "chat.dialog_content_already_update_error": "既に更新されています", + "chat.dialog_friend_request": "友だちになる", + "chat.dialog_friend_request_outgoing": "友だち申請中", + "chat.dialog_friend_request_incoming": "友だち承認", + "chat.dialog_jump_to_chat": "チャットする", + "chat.dialog_jump_to_profile": "プロフを見る", + "chat.dialog_jump_to_report": "通報する", + "chat.reload": "再読み込み", + "chat.error_failed": "処理に失敗しました。もう一度実行するか、時間をおいて再度お試しください。", + "chat.error_timeout": "タイムアウトしました。もう一度実行するか、時間をおいて再度お試しください。", + "chat.error_offline": "インターネット接続がオフラインのようです。もう一度実行するか、時間をおいて再度お試しください。", + "chat.error_reload": "接続が無効となりましたため、再度ページを読み込みます。", + "chat.error_privacy_level_1": "このユーザとは友だちのみ会話を始めることができます", + "chat.error_privacy_level_2": "このユーザとは友だち、もしくは友だちの友だちのみ会話を始めることができます", + "chat.error_freeze_chat": "利用規約で禁止している行為が確認されましたため、こちらのチャットを凍結させていただきました。", + "chat.error_conversation_not_found": "チャットが見つかりません。", + "chat.contact_list_tutorial": "友だちを見つけよう", + "chat.find_friends": "友だちを探す", + "chat.member_select_tutorial": "友だちを見つけよう", + "chat.dialog_content_member_select_age_limit": "年齢の制限により指定したユーザとチャットを始めることができません", + "chat.dialog_content_member_select_already_exists": "指定したユーザは既に会話に追加されています", + "chat.message_censored": "このメッセージはGREE管理人により削除されました。", + "chat.link_intro_with_maintenance": "メンテナンスのお知らせ ({m}月{d}日)", + "chat.link_intro_with_under_maintenance": "現在GREEチャットはメンテナンス中です", + "chat.balloon_content_beta": "新コミュニケーションサービス 『GREEチャット』 β公開中!", + "chat.intro_title_ga": "GREEチャット 公開のお知らせ", + "chat.intro_content_ga": "スマートフォン版GREEに新たなコミュニケーションサービス『GREEチャット』が登場しました。", + "chat.intro_title_group": "みんなでチャットしよう♪", + "chat.intro_title_1on1": "1対1チャットも♪", + "chat.intro_note_ga": "β期間中の投稿データは削除されている場合がございます。また、現在Androidについては 4.0以上のみのサポートとなります。なお、携帯版GREEでは本機能は未対応となりますので、友だちが携帯版GREEをご利用の場合メッセージは届きません。予めご了承ください。", + "chat.intro_link": "チャットトップへ", + "chat.intro_will_maintenance_head": "システムメンテナンスのお知らせ", + "chat.intro_under_maintenance_head": "GREEチャットはメンテナンス中です", + "chat.intro_maintenance_announce": "

◯メンテナンス時間(予定)

" + "

{span}



" + "

◯メンテナンス中の利用について

" + "

メンテナンス中は1対1チャット、グループチャット、マイチャットをご利用いただくことができません。(これらのチャットはチャット一覧から非表示になります。)


" + "

GREEからのお知らせ(GREEトクトク事務局、アバター\"ココ\"、GREE事務局、GREEパトロール、GREEカスタマーサービス、GREEとみんなの6つの約束、GREEコイン事務局など)につきましては、メンテナンス中もご確認いただくことが可能です。



" + "

◯その他、メンテナンス中に利用できない機能

" + "
    " + "
  • よせがき返信(お礼)機能
  • " + "
  • コミュニティの招待
  • " + "
" + "
" + "

お客さまにはご不便をおかけいたしますが、ご理解とご了承をいただきますようお願い申し上げます。

", + "chat.deprecated_pc_browser": "ご利用のブラウザはサポート対象外です。
GREEチャットを快適に使うために、お好きなブラウザのアイコンをクリックして最新版をダウンロードしてください。", + "chat.not_supported_device": "サポート対象外の端末です
GREEチャットのサポート対象はこちら", + "chat.switch_title": "公開まであと少し・・・", + "chat.switch_content": "新コミュニケーションサービス 『GREEチャット』 が始まります!", + "chat.switch_note": "本日までの先行公開期間中に作成されたチャットルームまた投稿されたメッセージは、本公開後に見ることができなくなります。ご留意ください。", + "chat.switch_link": "戻る", + "chat.dialog_content_move_out": "他のページを開きます。よろしいですか?", + "chat.intro_title_release_plan": "今後の機能追加予定", + "chat.intro_note_release_plan": "お客さまからたくさんのご要望をいただき、現在以下機能の追加を予定しております。

新機能の公開を楽しみにお待ち頂ければ幸いです。", + "chat.theme_setting_title": "GREEチャットのデザイン設定", + "chat.theme_setting_item_desc": "{themeName}のデザインにする", + "chat.theme_setting_valid_term_desc": "※ {term} のみ有効な設定です", + "chat.notification_setting_title": "GREEチャットの通知設定", + "chat.notification_setting_push": "プッシュ通知で受信通知を受け取る", + "chat.notification_setting_mail": "Eメールで受信通知を受け取る", + "chat.notification_setting_on": "オン", + "chat.notification_setting_off": "オフ", + "chat.notification_setting_mail_interval_0": "毎回受け取る", + "chat.notification_setting_mail_interval_15": "15分毎に受け取る", + "chat.notification_setting_mail_interval_30": "30分毎に受け取る", + "chat.notification_setting_mail_interval_60": "1時間毎に受け取る", + "chat.notification_setting_mail_interval_1440": "24時間毎に受け取る", + "chat.app_download_message": "プッシュ通知を受け取る場合はGREEアプリのご利用が必要です", + "chat.back_to_top": "チャットトップへ", + "chat.go_to_top": "チャットトップへ移動する", + "chat.alert_send_delivery_user": "このユーザーにメッセージを送信することはできません。", + "chat.alert_send_delivery_community": "このチャットではメッセージを送信できません。", + "chat.header_option_suspend_reception": "受信停止", + "chat.header_option_notify_to_on": "通知ONにする", + "chat.header_option_notify_to_off": "通知OFFにする", + "chat.link_sender_profile_community": "さんからのコミュニティに関するメッセージです。", + "chat.dialog_suspend_reception_notification": "受信停止をすると、今後このユーザーからのチャットが受信できません。", + "chat.dialog_suspend_reception_notification_community": "受信停止をするためにはコミュニティから退会する必要があります。", + "chat.dialog_suspend_reception_description": "受信停止をするには、プロフページから禁止リストへ追加してください。", + "chat.dialog_suspend_reception_description_pc": "受信停止をするには、通知とプライバシーページ内の「禁止リスト」に、このユーザーのIDを入力してください。", + "chat.dialog_suspend_reception_description_user_id_pc": "ユーザーID", + "chat.dialog_suspend_reception_description_community": "本ページを確認いただいただけでは受信停止にはなりません。

※コミュニティから退会すると、今後このコミュニティからのチャットを受信することはできません。

", + "chat.dialog_suspend_reception_annotation": "※チャットリストからも削除されます", + "chat.dialog_suspend_reception_button": "プロフページへ", + "chat.dialog_suspend_reception_button_community": "コミュニティへ", + "chat.dialog_suspend_reception_button_setting_pc": "通知とプライバシーページへ", + "chat.dialog_not_allow_suspend_reception_title": "受信停止不可", + "chat.dialog_not_allow_suspend_reception_description": "このユーザは受信停止できません。", + "chat.sorry_age_under_13": "申し訳ありません。利用条件を満たしていないため、一部の機能はご利用になれません。", + "chat.sorry_disabled_gree_chat": "申し訳ありません。利用条件を満たしていないため、GREEチャットをご利用になれません。", + "chat.disabled_official_title_1": "CELEBアカウントでは", + "chat.disabled_official_title_2": "GREEチャットをご利用いただけません", + "chat.disabled_official_notice_title": "CELEBアカウントの方へ", + "chat.disabled_official_notice_discription_1": "閲覧できないGREEチャットのお知らせが表示される不具合が発生しております。", + "chat.disabled_official_notice_discription_2": "ご迷惑をおかけいたしますが、改修完了まで今しばらくお待ちください。", + "chat.disabled_official_schedule_title": "不具合修正日", + "chat.disabled_official_schedule_discription": "2015年10月 (予定)", + "chat.empty_collection": "チャットルームがありません。", + "chat.manual_link": "GREEチャットの使い方とよくある質問", + "chat.optout_title": "GREE���ャットの受信設定", + "chat.optout_message": "{official_user_name}のチャットを受け取る", + "chat.optout_caution": "■ご注意
" + "上記のチェックボックスを外すと、該当ユーザーを禁止リストに追加します。

" + "禁止リストに追加すると、該当ユーザーは以下の機能が制限されます。" + "
    " + "
  • お客さまのプロフィールや日記の閲覧
  • " + "
  • お客さまとの1対1チャット(配信を含む)
  • " + "
  • お客さまへのリクエスト送信
  • " + "
  • お客さまへのアプリ招待
  • " + "
", + "chat.optout_setting_save_succeed": "保存されました。", + "chat.link_blocking_list": "禁止リスト一覧へ", + "chat.link_blocking_help": "禁止リストとは", + "chat.link_faq": "よくある質問", + "chat.link_chat_setting": "チャット設定", + "chat.start_chat": "今すぐ利用する", + "chat.edit_conversation_display_setting_button_complete": "完了", + "chat.hide_conversation_button": "非表示", + "chat.redisplay_conversation_button": "再表示", + "chat.hide_conversation_help_dialog_title": "このチャットを非表示にしますか?", + "chat.hide_conversation_help_dialog_body": "
    " + "
  • チャットを非表示にすると「チャットリスト」から「非表示チャット」に移動します。
  • " + "
  • チャットを非表示にしても、メッセージは削除されません。
  • " + "
  • チャットを非表示にしても、メッセージは受信します。
  • " + "
", + "chat.hide_conversation_help_dialog_prim": "非表示にする", + "chat.disable_hide_conversation_dialog_title": "非表示にできないチャットです", + "chat.disable_hide_conversation_dialog_body": "このユーザはGREEからの大切なお知らせを配信します。そのため、このチャットを非表示にすることはできません。", + "chat.upgrade_message": "GREEチャットをご利用いただくには、会員情報を登録してアップグレードする必要があります", + "chat.to_upgrade": "アップグレード", + "chat.emoji": "絵文字", + "chat.sending_message": "送信中...", + "chat.stamp": "スタンプ", + "chat.sent_stamp": "スタンプを送信しました", + "chat.received_stamp": "スタンプが送信されました" + }; + })(Blitz.Language || (Blitz.Language = {})); + var Language = Blitz.Language; +})(Blitz || (Blitz = {})); +var Util; +(function (Util) { + var Text = (function () { + function Text(text) { + this.text = text; + } + Text.prototype.nl2br = function () { + this.text = this.text.replace(/\r?\n/g, '
'); + return this; + }; + + Text.prototype.escape = function () { + this.text = String.escapeSpecialChars(this.text).replace(/<\/?(\w+)(.*?)>/g, function (all, match, attr) { + if ('br' === match) { + return '
'; + } + if ('emoji' === match) { + var id = attr.match(/id\s*="(\w+)"/); + if (!id || !id.length) { + return ''; + } + return ''; + } + if (all === '</a>') { + return ''; + } + if (match === 'a') { + var href = attr.replace(/\s/g, ' ').match(/href="(https?:\/\/.+?)"/); + if (!href || !href.length) { + return ''; + } + return ''; + } + return all; + }); + return this; + }; + + Text.prototype.convertEmoji = function () { + this.text = Util.String.convertEmojiTag(this.text); + return this; + }; + + Text.prototype.disableATag = function () { + this.text = this.text.replace(/<\/?a.*?>/g, '').replace(/<\/?br\s*>/g, ''); + return this; + }; + return Text; + })(); + Util.Text = Text; + + var UA = (function () { + function UA() { + } + UA.isIOS = function () { + return /\((iPhone( Simulator)?|iPod( touch)?|iPad);/.test(navigator.userAgent); + }; + + UA.isAndroid = function (v) { + var ua = navigator.userAgent.toLowerCase(); + if (!v) { + return (ua.indexOf('android') > -1); + } + return (ua.indexOf('android ' + v) > -1); + }; + + UA.isTouch = function () { + return !!('ontouchstart' in window) && (navigator.userAgent.indexOf('PhantomJS') < 0); + }; + return UA; + })(); + Util.UA = UA; + + var String = (function () { + function String() { + } + String.convertSpecialChar = function (string) { + return string.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'"); + }; + + String.escapeSpecialChars = function (string) { + return string.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + }; + + String.convertEmojiTag = function (string) { + return string.replace(//g, function (all, $1) { + var className = 'emoji e' + $1; + return '
'; + }); + }; + return String; + })(); + Util.String = String; + + Util.createConversationRefKey = function (myUserId, targetUserId) { + if (myUserId == targetUserId) { + return 'm_' + myUserId; + } + if (myUserId < targetUserId) { + return 'o_' + targetUserId + "_" + myUserId; + } else { + return 'o_' + myUserId + "_" + targetUserId; + } + }; + + Util.getFormattedDateString = function (format, d) { + return Blitz.Language.getMessage(format, { + yyyy: d.getFullYear(), + m: d.getMonth() + 1, + d: d.getDate(), + w: Blitz.Language.getMessage('chat.day_' + d.getDay()), + H: d.getHours(), + MM: ("0" + d.getMinutes()).slice(-2) + }); + }; + + Util.getMaintenanceSpanString = function (from, to, now) { + if (typeof now === "undefined") { now = new Date(); } + var d1 = new Date(from.replace(/-/g, '/')); + var d2 = new Date(to.replace(/-/g, '/')); + var fromString; + var toString; + if (now.getFullYear() !== d1.getFullYear() || d1.getFullYear() !== d2.getFullYear()) { + fromString = Util.getFormattedDateString('chat.dateformat_d', d1); + toString = Util.getFormattedDateString('chat.dateformat_d', d2); + return Blitz.Language.getMessage('chat.maintenance_format_a', { + from: fromString, + to: toString + }); + } else { + fromString = Util.getFormattedDateString('chat.dateformat_e', d1); + toString = Util.getFormattedDateString('chat.dateformat_e', d2); + if (d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate()) { + toString = Util.getFormattedDateString('chat.dateformat_time_at', d2); + } + return Blitz.Language.getMessage('chat.maintenance_format_b', { + from: fromString, + to: toString + }); + } + }; + + Util.uid = function () { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); + } + + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); + }; +})(Util || (Util = {})); +var SNS; +(function (SNS) { + var Config = (function () { + function Config() { + } + Config.init = function (config) { + this.config = config; + }; + + Config.getDefaultUrl = function () { + return 'chat/list'; + }; + + Config.getClientTypeId = function () { + return this.config['client_type_id']; + }; + + Config.getMyself = function () { + return this.config['myself']; + }; + + Config.getTheme = function () { + return this.config['theme']; + }; + + Config.getDomains = function () { + return this.config['config']['domains']; + }; + + Config.getBeaconDomain = function () { + return this.config['config']['domains']['beacon']; + }; + + Config.getPfBeaconDomain = function () { + return this.config['config']['domains']['pfb']; + }; + + Config.getGreeJpDomain = function () { + return this.config['config']['domains']['greejp']; + }; + + Config.getJaHelpDomain = function () { + return this.config['config']['domains']['ja-help']; + }; + + Config.getIdDomain = function () { + return this.config['config']['domains']['id']; + }; + + Config.getGreeJpPatrolFormURL = function () { + return this.getGreeJpDomain() + '?mode=support&act=patrol_form'; + }; + + Config.getSNSDomain = function () { + return this.config['config']['domains']['sns']; + }; + + Config.getGameChatURL = function () { + return this.config['config']['domains']['apps'] + '?action=app_chat_view#view=game_list'; + }; + + Config.getGreeJpConfigPrivacyURL = function () { + return this.getGreeJpDomain() + '?mode=home&act=config_privacy_form'; + }; + + Config.getGreeJpUserProfileURL = function (userId) { + return this.getGreeJpDomain() + userId; + }; + + Config.getGreeJpCommunityURL = function (userId) { + return this.getGreeJpDomain() + 'community/' + userId; + }; + + Config.getDeprecatedPCBrowserImgRootURL = function () { + return this.config['config']['url_root_img_deprecated_pc_browser']; + }; + + Config.isDeprecatedPCBrowser = function () { + return this.config['config']['is_deprecated_pc_browser']; + }; + + Config.isNotSupportedDevice = function () { + return this.config['config']['is_not_supported_device']; + }; + + Config.getCobitToken = function () { + return this.config['cobit_token']; + }; + + Config.getAppId = function () { + return this.config['config']['app']['id']; + }; + + Config.isSDK = function () { + return this.config['config']['is_sdk']; + }; + + Config.getChatOpenLevelOfPrivacySettings = function () { + return this.config['privacy_settings']['use_setting_mail']; + }; + + Config.getNewContactList = function () { + return this.config['new_contact_list']['items']; + }; + + Config.getNewContactNum = function () { + return Object.keys(this.getNewContactList()).length; + }; + + Config.getModerationConfirmUrl = function () { + return this.getDomains()['sns'] + '#class=link&view=moderation_consent-items-message'; + }; + + Config.getPenaltyHelpUrl = function () { + return this.getDomains()['sns'] + '#view=help_penalty'; + }; + + Config.getSnsUserProfileUrl = function (userId) { + return this.getSNSDomain() + '#view=profile_info' + '&user_id=' + userId; + }; + + Config.getSnsCommunityUrl = function (communityId) { + return this.getSNSDomain() + '#view=community_view' + '&community_id=' + communityId; + }; + + Config.getSnsBlockingListUrl = function () { + return this.getSNSDomain() + '#view=settings_blocklist'; + }; + + Config.getJaHelpBlocking = function () { + return this.getJaHelpDomain() + 'faq.asp?faqid=3134'; + }; + + Config.getTopPageHash = function () { + return '#view=chat_list'; + }; + + Config.isChatEnabled = function () { + var chatStatus = this.config['chat_status']; + return chatStatus['enabled'] == true; + }; + + Config.isChatDisabled = function () { + return !this.isChatEnabled(); + }; + + Config.getChatDisabledMsg = function () { + var chatStatus = this.config['chat_status']; + return chatStatus['disabled_msg']; + }; + + Config.isMaintenance = function () { + return this.config['maintenance']['is_maintenance']; + }; + + Config.isChatRunning = function () { + return !this.isMaintenance(); + }; + + Config.willMaintenance = function () { + if (this.isMaintenance()) { + return false; + } + var maintenance = this.config['maintenance']; + if (maintenance['server_status'] === 'false') { + if (!_.isNull(maintenance['maintenance_from']) && !_.isNull(maintenance['maintenance_to'])) { + return true; + } + } + return false; + }; + + Config.getMaintenanceSpan = function () { + return Util.getMaintenanceSpanString(this.config['maintenance']['maintenance_from'], this.config['maintenance']['maintenance_to']); + }; + + Config.getMaintenanceStartingDate = function () { + var from = this.config['maintenance']['maintenance_from']; + return new Date(from.replace(/-/g, '/')); + }; + + Config.needsUpgrade = function () { + return this.config['config']['needs_upgrade']; + }; + + Config.isEnabledEmojiPalette = function () { + return this.config['config']['palette']['is_enabled_emoji']; + }; + + Config.isEnabledStampPalette = function () { + return this.config['config']['palette']['is_enabled_stamp']; + }; + + Config.isApp = function () { + return this.config['config']['is_app']; + }; + + Config.isIOS = function () { + return this.config['config']['is_ios']; + }; + + Config.isIOSApp = function () { + return this.isApp() && this.isIOS(); + }; + + Config.isAndroid = function () { + return this.config['config']['is_android']; + }; + + Config.isPC = function () { + return this.config['config']['is_pc']; + }; + + Config.isSP = function () { + return this.config['config']['is_sp']; + }; + + Config.isIEUnder11 = function () { + return this.config['config']['is_ie_under11']; + }; + + Config.isAgeUnder13 = function () { + return this.config['config']['is_age_under13']; + }; + + Config.isAge13OrOlder = function () { + return !this.isAgeUnder13(); + }; + + Config.getWebworkerHelperUri = function () { + return this.config['config']['uri_webworker_helper']; + }; + + Config.getDeviceIsAndroid2x = function () { + return this.config['config']['is_android_2']; + }; + + Config.emojiPalette = function () { + return false; + }; + + Config.getAppsDomain = function () { + return this.config['config']['domains']['apps']; + }; + + Config.getAdDomain = function () { + return this.config['config']['domains']['ad']; + }; + + Config.getAdsDomain = function () { + return this.config['config']['domains']['ads']; + }; + + Config.isAdsAppendHost = function () { + return this.config['config']['ad']['appendHost']; + }; + + Config.getAnnounces = function () { + return this.config['announce_list']; + }; + return Config; + })(); + SNS.Config = Config; +})(SNS || (SNS = {})); + +var Gryfon; +(function (Gryfon) { + (function (Analytics) { + Analytics.appId = null; + Analytics.locale = ''; + + var BEACON_ACTION_SPLITTER = '_'; + + function recordAnalyticsIfNativeApp(args) { + if (Gryfon.isSnsNativeApp()) { + Gryfon.recordAnalyticsData(args); + } + } + + function sendBeacon(action, from, args) { + var p = _.clone(args); + var pr = p['pr']; + if (pr != null) { + p = _.defaults(p, pr); + } + p = _.omit(p, 'tm', 'pr'); + return analytics.AnalyticsBeacon.create({ a: action }).addServiceParams(p).flush(); + } + + function sendEventBeacon(args) { + var fr = args['fr'] || 'unknown'; + var a = [fr, args['nm']].join(BEACON_ACTION_SPLITTER); + return sendBeacon(a, fr, args); + } + + function sendPageBeacon(args, externalURL) { + var fr = args['fr'] || 'unknown'; + var a = args['nm']; + if (externalURL) { + sendBeacon(a, fr, _.chain(args).extend({ 'url': externalURL }).omit('pr').value()); + } else { + sendBeacon(a, fr, args); + } + } + + function event(name, from, params) { + if (typeof from === "undefined") { from = ''; } + if (typeof params === "undefined") { params = {}; } + if (from == '') { + if (!_.isEmpty(fivefold.history.current())) { + from = fivefold.history.current().pattern; + } + } + + var prev = getMergedPreviousViewName(); + if (prev) { + params['ex_from'] = prev; + } + + var args = { + tp: 'evt', + nm: name, + fr: from, + ap: Gryfon.ConfigAccessor.getAppId(), + pr: params + }; + recordAnalyticsIfNativeApp(args); + + return sendEventBeacon(args); + } + Analytics.event = event; + + function page(to, from, params, externalURL) { + if (typeof from === "undefined") { from = ''; } + if (typeof params === "undefined") { params = {}; } + if (typeof externalURL === "undefined") { externalURL = null; } + var args = { + tp: 'pg', + nm: to, + fr: from, + ap: Gryfon.ConfigAccessor.getAppId(), + pr: params + }; + recordAnalyticsIfNativeApp(args); + + sendPageBeacon(args, externalURL); + } + Analytics.page = page; + + function getMergedPreviousViewName() { + var prev = fivefold.history.previous(2)[1]; + if (prev != null) { + return prev.pattern; + } + + return 'chat_list'; + } + Analytics.getMergedPreviousViewName = getMergedPreviousViewName; + + function autoSendPageBeacon(to, params, externalURL) { + if (typeof params === "undefined") { params = {}; } + if (typeof externalURL === "undefined") { externalURL = null; } + sendPageBeaconAndUpdatePreviousView(to, params, externalURL); + } + Analytics.autoSendPageBeacon = autoSendPageBeacon; + + function sendPageBeaconAndUpdatePreviousView(to, params, externalURL) { + if (typeof params === "undefined") { params = {}; } + if (typeof externalURL === "undefined") { externalURL = null; } + page(to, Analytics.getMergedPreviousViewName(), params, externalURL); + ga('send', 'pageview', { + page: '/' + to + '?' + _.map(params, function (v, k) { + return k + '=' + v; + }).join('&') + }); + } + Analytics.sendPageBeaconAndUpdatePreviousView = sendPageBeaconAndUpdatePreviousView; + })(Gryfon.Analytics || (Gryfon.Analytics = {})); + var Analytics = Gryfon.Analytics; +})(Gryfon || (Gryfon = {})); +var Gryfon; +(function (Gryfon) { + function showAlertView(message) { + window.alert(message); + } + Gryfon.showAlertView = showAlertView; + function initWithDependencies(configAccessor) { + Gryfon.ConfigAccessor = configAccessor; + init(); + } + Gryfon.initWithDependencies = initWithDependencies; + function init() { + } + Gryfon.init = init; + function recordAnalyticsData(args) { + } + Gryfon.recordAnalyticsData = recordAnalyticsData; + function ready() { + } + Gryfon.ready = ready; + function startLoading() { + } + Gryfon.startLoading = startLoading; + function contentsReady() { + } + Gryfon.contentsReady = contentsReady; + function needUpgrade(upgradeURL) { + location.href = upgradeURL; + } + Gryfon.needUpgrade = needUpgrade; + + function isSnsNativeApp() { + return false; + } + Gryfon.isSnsNativeApp = isSnsNativeApp; + function prepareGluon(config) { + if (typeof config === "undefined") { config = {}; } + var requestCallback = null; + if (config['token']) { + gluon.initialize({ + appId: parseInt(config['config']['app']['id'], 10), + token: config['token'], + endpoint: { + api: config['config']['domains']['snsapi'] + } + }, requestCallback); + } else { + gluon.initialize({ + appId: parseInt(config['config']['app']['id'], 10), + endpoint: { + appId: config['config']['domains']['snsapi'], + authorize: config['config']['domains']['open'] + config['config']['oauth2']['authorize'], + tokeninfo: config['config']['domains']['open'] + config['config']['oauth2']['tokeninfo'], + authCallback: config['config']['domains']['ssns'] + config['config']['oauth2']['callback'], + authServer: config['config']['domains']['ssns'] + config['config']['oauth2']['server'], + fallback: config['config']['domains']['id'] + '?action=logout_commit' + } + }, requestCallback); + } + } + Gryfon.prepareGluon = prepareGluon; + function updateBadge(type, force_update) { + } + Gryfon.updateBadge = updateBadge; +})(Gryfon || (Gryfon = {})); +var Gryfon; +(function (Gryfon) { + function back() { + if (window.history.length === 1) { + Gryfon.linkTo(Gryfon.ConfigAccessor.getTopPageHash()); + } else { + window.history.back(); + } + } + Gryfon.back = back; +})(Gryfon || (Gryfon = {})); +var Gryfon; +(function (Gryfon) { + function linkTo(urlOrHash, beaconOptions) { + if (typeof beaconOptions === "undefined") { beaconOptions = {}; } + var match = urlOrHash.match(/^https?:\/\/[^\/]+/); + var domain = match ? match[0] : 'null'; + var params = _.extend(beaconOptions, { to: urlOrHash, to_domain: domain }); + Gryfon.Analytics.event('click_link', '', params).onComplete(function () { + if (urlOrHash.indexOf('#') == 0 && location.search && location.search != '?a') { + location.href = '/' + urlOrHash; + } else { + location.href = urlOrHash; + } + }); + } + Gryfon.linkTo = linkTo; +})(Gryfon || (Gryfon = {})); +var Gryfon; +(function (Gryfon) { + function listenOnce(flagName, expire) { + if (typeof expire === "undefined") { expire = 3600; } + var promise = new monapt.Promise(); + return promise.future(); + } + Gryfon.listenOnce = listenOnce; + function notify(flagName, params) { + if (typeof params === "undefined") { params = {}; } + } + Gryfon.notify = notify; + function addPersistentListener(listenerName, listener) { + } + Gryfon.addPersistentListener = addPersistentListener; + function removePersistentListener(listenerName) { + } + Gryfon.removePersistentListener = removePersistentListener; +})(Gryfon || (Gryfon = {})); +var Gryfon; +(function (Gryfon) { + function setPullToRefreshEnabled(enabled) { + } + Gryfon.setPullToRefreshEnabled = setPullToRefreshEnabled; +})(Gryfon || (Gryfon = {})); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Gryfon; +(function (Gryfon) { + var AsyncAppTmpStorageRepository = (function (_super) { + __extends(AsyncAppTmpStorageRepository, _super); + function AsyncAppTmpStorageRepository() { + _super.apply(this, arguments); + } + return AsyncAppTmpStorageRepository; + })(DDD.AsyncOnLocalStorageRepository); + Gryfon.AsyncAppTmpStorageRepository = AsyncAppTmpStorageRepository; + + (function (TmpStorage) { + var _storage = window.sessionStorage; + function sweep() { + } + TmpStorage.sweep = sweep; + function getItem(key) { + return _storage.getItem(key); + } + TmpStorage.getItem = getItem; + function setItem(key, val) { + return _storage.setItem(key, val); + } + TmpStorage.setItem = setItem; + function removeItem(key) { + return _storage.removeItem(key); + } + TmpStorage.removeItem = removeItem; + })(Gryfon.TmpStorage || (Gryfon.TmpStorage = {})); + var TmpStorage = Gryfon.TmpStorage; +})(Gryfon || (Gryfon = {})); + +this["HBS"] = this["HBS"] || {}; + +this["HBS"]["tpl/chat/chat-prepare.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
\n
\n
\n
\n

\n \n

\n

\n チャットの準備をしています。
もうすぐ始まります!\n

\n
\n
\n
\n
\n"; + }); + +this["HBS"]["tpl/chat/deprecated-pc-browser.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
"; + return buffer; + }); + +this["HBS"]["tpl/chat/disabled-cobit.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
\n
\n
\n
\n Sorry...\n
\n
\n
\n\n
\n
"; + if (stack1 = helpers.disabled_message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.disabled_message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "
\n \n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/disabled.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, functionType="function", self=this, blockHelperMissing=helpers.blockHelperMissing; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + if (stack1 = helpers.disabled_message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.disabled_message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } + + buffer += "
\n
\n
\n
\n Sorry...\n
\n
\n
\n\n
\n
\n "; + options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}; + if (stack1 = helpers.anchorize) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.anchorize; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.anchorize) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/disabled_official.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
\n
\n
\n Sorry...\n
\n
\n
\n\n
\n
\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_title_1", options) : helperMissing.call(depth0, "t", "chat.disabled_official_title_1", options))) + + "
\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_title_2", options) : helperMissing.call(depth0, "t", "chat.disabled_official_title_2", options))) + + "\n
\n
\n\n
\n

"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_notice_title", options) : helperMissing.call(depth0, "t", "chat.disabled_official_notice_title", options))) + + "

\n
\n
\n

\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_notice_discription_1", options) : helperMissing.call(depth0, "t", "chat.disabled_official_notice_discription_1", options))) + + "
\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_notice_discription_2", options) : helperMissing.call(depth0, "t", "chat.disabled_official_notice_discription_2", options))) + + "\n

\n
\n
\n

"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_schedule_title", options) : helperMissing.call(depth0, "t", "chat.disabled_official_schedule_title", options))) + + "

\n
\n
\n

\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.disabled_official_schedule_discription", options) : helperMissing.call(depth0, "t", "chat.disabled_official_schedule_discription", options))) + + "\n

\n
\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/group-settings/chat-profile.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, functionType="function", self=this, escapeExpression=this.escapeExpression; + +function program1(depth0,data) { + + + return "\n
\n
\n
\n "; + } + + buffer += "
\n
\n "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers.conversationIcon || depth0.conversationIcon),stack1 ? stack1.call(depth0, depth0.participants, options) : helperMissing.call(depth0, "conversationIcon", depth0.participants, options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
\n
"; + if (stack2 = helpers.name) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.name; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "
\n
\n "; + stack2 = helpers.unless.call(depth0, depth0.isAndroid2, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
\n \n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/group-settings/edit-name-modal.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
\n
\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n /\n
\n
\n
\n
\n
\n\n
\n"; + }); + +this["HBS"]["tpl/chat/group-settings/label.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function"; + + + buffer += "

"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.group_settings_members_title", options) : helperMissing.call(depth0, "t", "chat.group_settings_members_title", options))) + + "("; + if (stack2 = helpers.count) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.count; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + ")

\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/group-settings/participant-item.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += " style=\"background-image:url("; + if (stack1 = helpers.profileImageUrl) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.profileImageUrl; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + ")\""; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, stack2, options; + buffer += "\n \n "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.online", options) : helperMissing.call(depth0, "t", "chat.online", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n \n "; + return buffer; + } + + buffer += "
\n
\n
\n
\n
\n
\n

"; + if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = helpers['if'].call(depth0, depth0.online, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/intro.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing; + + + buffer += "
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.intro_title_ga", options) : helperMissing.call(depth0, "t", "chat.intro_title_ga", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.intro_content_ga", options) : helperMissing.call(depth0, "t", "chat.intro_content_ga", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.intro_title_group", options) : helperMissing.call(depth0, "t", "chat.intro_title_group", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n
\n \"\"\n
\n
\n
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.intro_title_1on1", options) : helperMissing.call(depth0, "t", "chat.intro_title_1on1", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n
\n \"\"\n
\n
\n
\n
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.intro_note_ga", options) : helperMissing.call(depth0, "t", "chat.intro_note_ga", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n
\n
\n
\n
\n
\n \n
"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/announce-mail-close.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
\n
\n
\n
\n

"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "mail.announce_close", options) : helperMissing.call(depth0, "t", "mail.announce_close", options))) + + "

\n
\n
\n \n
\n
\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/collection-header.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
\n
"; + if (stack1 = helpers.headerName) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.headerName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/conversation-content.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n \n  "; + if (stack1 = helpers.participantNum) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.participantNum; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n "; + return buffer; + } + +function program3(depth0,data) { + + + return "\n \n "; + } + + buffer += "\n
\n
\n "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers.conversationIcon || depth0.conversationIcon),stack1 ? stack1.call(depth0, depth0.filteredParticipants, options) : helperMissing.call(depth0, "conversationIcon", depth0.filteredParticipants, options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
\n
"; + if (stack2 = helpers.name) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.name; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "
\n
\n "; + if (stack2 = helpers.escapedMessage) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.escapedMessage; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
\n

\n "; + if (stack2 = helpers.messageCreatedTime) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.messageCreatedTime; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "\n "; + stack2 = helpers['if'].call(depth0, depth0.isGroup, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n "; + stack2 = helpers.unless.call(depth0, depth0.isNotified, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n

\n
\n
\n
\n \n
\n
\n "; + if (stack2 = helpers.arrow) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.arrow; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/conversation-delivery-content.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", self=this, escapeExpression=this.escapeExpression; + +function program1(depth0,data) { + + + return "\n \n "; + } + + buffer += "\n
\n
\n
\n "; + if (stack1 = helpers.icon) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.icon; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
\n
\n
\n "; + if (stack1 = helpers.mark) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.mark; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
\n

\n

\n " + + "\n "; + stack1 = helpers.unless.call(depth0, depth0.isNotified, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

\n
\n
\n
\n \n
\n
\n "; + if (stack1 = helpers.arrow) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.arrow; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/create-conversation-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
\n \n
\n"; + }); + +this["HBS"]["tpl/chat/list/edit-conversation-collection-mode-button/complete.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.edit_conversation_display_setting_button_complete", options) : helperMissing.call(depth0, "t", "chat.edit_conversation_display_setting_button_complete", options))) + + "\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/edit-conversation-collection-mode-button/normal.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
\n \n
\n"; + }); + +this["HBS"]["tpl/chat/list/empty-collection.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
\n
\n \n
\n

"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.empty_collection", options) : helperMissing.call(depth0, "t", "chat.empty_collection", options))) + + "

\n
\n
"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/hidden-chat-list-link.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
\n
\n
\n
\n
\n

"; + if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

\n
\n
\n
\n \n
\n
\n "; + if (stack1 = helpers.arrow) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.arrow; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n
\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/not-supported-device.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing; + + + buffer += "
\n
\n
\n
\n
\n

"; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.not_supported_device", options) : helperMissing.call(depth0, "t", "chat.not_supported_device", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

\n
\n
\n \n
\n
\n
\n
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/toggle-display-button/hide-conversation-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.hide_conversation_button", options) : helperMissing.call(depth0, "t", "chat.hide_conversation_button", options))) + + "
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/toggle-display-button/hide-conversation-loading-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "\n"; + }); + +this["HBS"]["tpl/chat/list/toggle-display-button/hide-must-read-conversation-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.hide_conversation_button", options) : helperMissing.call(depth0, "t", "chat.hide_conversation_button", options))) + + "
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/toggle-display-button/redisplay-conversation-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n
"; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.redisplay_conversation_button", options) : helperMissing.call(depth0, "t", "chat.redisplay_conversation_button", options))) + + "
\n
\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/list/toggle-display-button/redisplay-conversation-loading-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "\n"; + }); + +this["HBS"]["tpl/chat/maintenance-announce.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing; + + + buffer += "
\n
\n

"; + if (stack1 = helpers.head) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.head; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

\n
\n
\n "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
\n
\n
\n
\n
\n \n
"; + return buffer; + }); + +this["HBS"]["tpl/chat/no-support.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
\n
\n
\n
\n Sorry...\n
\n
\n
\n\n
\n
\n
申し訳ありません。本機能ではお客様の端末をサポートしておりません。
\n \n
\n
\n
\n"; + }); + +this["HBS"]["tpl/chat/setting/back-to-top-link.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
\n \n
"; + return buffer; + }); + +this["HBS"]["tpl/chat/setting/download-link.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + + return "\n
  • \n \n \n \n
  • \n "; + } + +function program3(depth0,data) { + + + return "\n
  • \n \n \n \n
  • \n "; + } + + buffer += "
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n

    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.app_download_message", options) : helperMissing.call(depth0, "t", "chat.app_download_message", options))) + + "

    \n
    \n
    \n
      \n "; + stack2 = helpers['if'].call(depth0, depth0.isIOS, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n "; + stack2 = helpers['if'].call(depth0, depth0.isAndroid, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
    \n
    \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/chat/setting/notification.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + + return "checked"; + } + +function program3(depth0,data,depth1) { + + var buffer = "", stack1, stack2, options; + buffer += "\n "; + if (stack2 = helpers.message) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.message; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "\n "; + return buffer; + } + + buffer += "
    \n
    \n

    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.notification_setting_title", options) : helperMissing.call(depth0, "t", "chat.notification_setting_title", options))) + + "

    \n\n
    \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/chat/setting/theme.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this, functionType="function"; + +function program1(depth0,data) { + + + return "checked"; + } + + buffer += "
    \n
    \n

    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.theme_setting_title", options) : helperMissing.call(depth0, "t", "chat.theme_setting_title", options))) + + "

    \n\n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/1on1-welcome-event.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing; + + + buffer += "
    \n
    \n
    \n

    "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.chat_event_welcome_1on1", options) : helperMissing.call(depth0, "t", "chat.chat_event_welcome_1on1", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/agreement-message.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function"; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/dummy-palette-space.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
    \n"; + }); + +this["HBS"]["tpl/chat/view/error-message.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return ""; + }); + +this["HBS"]["tpl/chat/view/event.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function"; + + + buffer += "

    "; + if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/message-separator.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function"; + + + buffer += "
    \n

    "; + if (stack1 = helpers.dateSeparator) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.dateSeparator; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/message-stamp-other.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    \n "; + if (stack1 = helpers.userIcon) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.userIcon; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n

    "; + if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n \n
    \n
    \n

    "; + if (stack1 = helpers.createTime) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.createTime; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/message-stamp-self.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    \n
    \n

    "; + if (stack1 = helpers.createTime) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.createTime; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/message-text-other.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; + +function program1(depth0,data) { + + var stack1; + if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { return stack1; } + else { return ''; } + } + + buffer += "
    \n "; + if (stack1 = helpers.userIcon) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.userIcon; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n

    "; + if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n
    \n
    \n "; + options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}; + if (stack1 = helpers.anchorize) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.anchorize; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.anchorize) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n
    \n

    "; + if (stack1 = helpers.createTime) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.createTime; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/message-text-self.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; + +function program1(depth0,data) { + + var stack1; + if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { return stack1; } + else { return ''; } + } + + buffer += "
    \n
    \n
    \n

    "; + if (stack1 = helpers.createTime) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.createTime; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n
    \n
    \n "; + options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}; + if (stack1 = helpers.anchorize) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.anchorize; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.anchorize) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/new-message-notification-footer.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function"; + + + buffer += "
    \n
    \n
    \n

    "; + if (stack1 = helpers.senderName) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.senderName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n
    "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "
    \n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/new-message-notification-header.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing; + + + buffer += "
    \n
    \n
    \n

    "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.conversation_notify_new_message", options) : helperMissing.call(depth0, "t", "chat.conversation_notify_new_message", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

    \n
    \n
    \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/chat/view/option-1on1.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/option.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/chat/view/penalty-message.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function"; + + + buffer += ""; + return buffer; + }); + +this["HBS"]["tpl/chat/view/textarea.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
    \n
    \n
    \n
    \n
    \n \n \n
    \n NEW\n
    \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n"; + }); + +this["HBS"]["tpl/collection.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    "; + return buffer; + }); + +this["HBS"]["tpl/contact/find-friend.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing; + + + buffer += "
    \n
    \n \n
    \n

    "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.contact_list_tutorial", options) : helperMissing.call(depth0, "t", "chat.contact_list_tutorial", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "

    \n \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/contact/list-label.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "

    "; + if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "("; + if (stack1 = helpers.count) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.count; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + ")

    "; + return buffer; + }); + +this["HBS"]["tpl/contact/search-box.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
    \n
    \n
    \n \n
    \n
    \n
    \n"; + }); + +this["HBS"]["tpl/contact/user-info.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += " style=\"background-image:url("; + if (stack1 = helpers.profileImageUrl) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.profileImageUrl; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + ")\""; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, stack2, options; + buffer += "\n \n "; + options = {hash:{},data:data}; + stack2 = ((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.online", options) : helperMissing.call(depth0, "t", "chat.online", options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n \n "; + return buffer; + } + + buffer += "\n
    \n
    \n
    \n
    \n

    "; + if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + stack1 = helpers['if'].call(depth0, depth0.isOnline, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/optout/main.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this, functionType="function"; + +function program1(depth0,data) { + + + return "checked"; + } + + buffer += "
    \n
    \n

    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.optout_title", options) : helperMissing.call(depth0, "t", "chat.optout_title", options))) + + "

    \n\n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/alert-message.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    \n

    \n "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n

    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/message.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this, blockHelperMissing=helpers.blockHelperMissing; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = helpers['if'].call(depth0, depth0.isCommunity, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + if (stack1 = helpers.body) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.body; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = helpers.unless.call(depth0, depth0.isModerationNg, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program3(depth0,data) { + + var buffer = "", stack1, options; + buffer += "\n

    \n \n "; + if (stack1 = helpers.senderName) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.senderName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n \n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.link_sender_profile_community", options) : helperMissing.call(depth0, "t", "chat.link_sender_profile_community", options))) + + "\n

    \n "; + return buffer; + } + + buffer += "
    \n "; + if (stack1 = helpers.userIcon) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.userIcon; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n

    \n "; + if (stack1 = helpers.mark) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.mark; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

    \n\n
    \n
    \n "; + options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}; + if (stack1 = helpers.anchorize) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.anchorize; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.anchorize) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n
    \n

    "; + if (stack1 = helpers.createTime) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.createTime; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/official-user-profile-dialog.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, options; + buffer += "\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.dialog_suspend_reception_button_community", options) : helperMissing.call(depth0, "t", "chat.dialog_suspend_reception_button_community", options))) + + "\n "; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, options; + buffer += "\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.dialog_suspend_reception_button", options) : helperMissing.call(depth0, "t", "chat.dialog_suspend_reception_button", options))) + + "\n "; + return buffer; + } + + buffer += "
    \n
    \n
    \n
    \n "; + stack2 = ((stack1 = ((stack1 = depth0.user),stack1 == null || stack1 === false ? stack1 : stack1.nickname)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
    \n
    \n
    \n
    \n
    \n\n \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/option-community.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/option.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/delivery/view/suspend_reception_dialog.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType="function", self=this; + +function program1(depth0,data) { + + var buffer = "", stack1, stack2, options; + buffer += "\n

    \n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.dialog_suspend_reception_description_user_id_pc", options) : helperMissing.call(depth0, "t", "chat.dialog_suspend_reception_description_user_id_pc", options))) + + ": "; + if (stack2 = helpers.publisherId) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.publisherId; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "\n

    \n "; + return buffer; + } + + buffer += "
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n

    \n "; + if (stack1 = helpers.notice) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.notice; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n

    \n
    \n
    \n
    \n
    \n

    \n "; + if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

    \n

    \n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.dialog_suspend_reception_annotation", options) : helperMissing.call(depth0, "t", "chat.dialog_suspend_reception_annotation", options))) + + "\n

    \n "; + stack2 = helpers['if'].call(depth0, depth0.publisherId, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
    \n "; + if (stack2 = helpers.buttonLabel) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.buttonLabel; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "\n
    \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/dialog.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n \n
    \n "; + return buffer; + } + + buffer += "
    \n
    \n

    "; + if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n

    "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n
    \n "; + stack1 = helpers['if'].call(depth0, depth0.secondary, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n \n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/dialog/release-announce-dialog.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n \n
    \n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers['if'].call(depth0, depth0.imagePath, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n

    "; + if (stack1 = helpers.body) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.body; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n \n
    \n
    "; + return buffer; + }); + +this["HBS"]["tpl/error.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, stack2, options, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + if (stack1 = helpers.errorCode) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.errorCode; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n "; + if (stack1 = helpers.errorCodeMessage) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.errorCodeMessage; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } + +function program3(depth0,data) { + + + return "\n Sorry...\n "; + } + + buffer += "
    \n
    \n
    \n "; + options = {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data}; + stack2 = ((stack1 = helpers.ifx || depth0.ifx),stack1 ? stack1.call(depth0, depth0.errorCode, "&&", depth0.errorCodeMessage, options) : helperMissing.call(depth0, "ifx", depth0.errorCode, "&&", depth0.errorCodeMessage, options)); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n
    \n
    \n
    \n\n
    \n
    "; + if (stack2 = helpers.message) { stack2 = stack2.call(depth0, {hash:{},data:data}); } + else { stack2 = depth0.message; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } + buffer += escapeExpression(stack2) + + "
    \n \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/friend-request-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += ""; + return buffer; + }); + +this["HBS"]["tpl/friend-request-incoming-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/friend-request-outgoing-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.dialog_friend_request_outgoing", options) : helperMissing.call(depth0, "t", "chat.dialog_friend_request_outgoing", options))) + + "
    "; + return buffer; + }); + +this["HBS"]["tpl/intro-link.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    \n
    \n
    \n
    \n
    \n

    "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/jump-to-chat-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += ""; + return buffer; + }); + +this["HBS"]["tpl/jump-to-profile-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += ""; + return buffer; + }); + +this["HBS"]["tpl/jump-to-report-button.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += ""; + return buffer; + }); + +this["HBS"]["tpl/list-item-link.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; + + + buffer += "
    \n
    \n
    \n
    \n
    \n

    "; + if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "

    \n
    \n "; + if (stack1 = helpers.arrow) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.arrow; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "\n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/load-more.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "\n
    \n

    "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.see_more", options) : helperMissing.call(depth0, "t", "chat.see_more", options))) + + "\n \n

    \n
    \n
    \n
    \n

    \n \n

    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/loading.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "\n"; + }); + +this["HBS"]["tpl/loadmore-collection.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n"; + return buffer; + } + + buffer += "
    \n"; + stack1 = helpers.unless.call(depth0, depth0.allLoaded, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n"; + return buffer; + }); + +this["HBS"]["tpl/loadmore-history-collection.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n"; + return buffer; + } + + stack1 = helpers.unless.call(depth0, depth0.allLoaded, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/modal-header.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + + + + return "
    \n
    \n
    \n
    \n
    \n"; + }); + +this["HBS"]["tpl/note.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n

    "; + if (stack1 = helpers.head) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.head; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + "

    \n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers['if'].call(depth0, depth0.head, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n "; + if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/emoji-palette-category.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
  • \n
    \n
  • \n "; + return buffer; + } + + buffer += "
    \n
      \n "; + stack1 = helpers.each.call(depth0, depth0.categories, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    • \n
      \n
    • \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/emoji-palette-partial.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
  • \n
    \n
    \n
    \n
  • \n "; + return buffer; + } + + buffer += "
    \n
    \n
      \n "; + stack1 = helpers.each.call(depth0, depth0, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/emoji-palette-pc.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.partials, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n "; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.categories, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/emoji-palette.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.partials, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n
    \n "; + return buffer; + } +function program2(depth0,data) { + + var buffer = "", stack1; + buffer += "\n "; + stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.categories, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/stamp-palette-category.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
  • \n
    \n \n
    \n
  • \n "; + return buffer; + } + + buffer += "
    \n
    \n
      \n \n \n \n \n \n "; + stack1 = helpers.each.call(depth0, depth0.stampSets, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/stamp-palette-partial.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
  • \n
    \n \n
    \n
  • \n "; + return buffer; + } + + buffer += "
    \n
      \n "; + stack1 = helpers.each.call(depth0, depth0.stampUnits, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/stamp-palette-pc.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n
    \n
    \n
    \n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.stampSets, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/stamp-palette.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += "\n
    \n
    \n
    \n
    \n
    \n "; + return buffer; + } + + buffer += "
    \n
    \n "; + stack1 = helpers.each.call(depth0, depth0.stampSets, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/tab-using-emoji.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
    \n
      \n
    • \n
      "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.stamp", options) : helperMissing.call(depth0, "t", "chat.stamp", options))) + + "
      \n
    • \n
    • \n
      "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.emoji", options) : helperMissing.call(depth0, "t", "chat.emoji", options))) + + "
      \n
    • \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/palette/tab-using-stamp.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; + + + buffer += "
    \n
      \n
    • \n
      "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.stamp", options) : helperMissing.call(depth0, "t", "chat.stamp", options))) + + "
      \n
    • \n
    • \n
      "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.emoji", options) : helperMissing.call(depth0, "t", "chat.emoji", options))) + + "
      \n
    • \n
    \n
    \n"; + return buffer; + }); + +this["HBS"]["tpl/selectable-member-info.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { + this.compilerInfo = [4,'>= 1.0.0']; +helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; + var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this; + +function program1(depth0,data) { + + var buffer = "", stack1; + buffer += " style=\"background-image:url("; + if (stack1 = helpers.profileImageUrl) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.profileImageUrl; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + buffer += escapeExpression(stack1) + + ")\""; + return buffer; + } + +function program3(depth0,data) { + + var buffer = "", stack1, options; + buffer += "\n "; + options = {hash:{},data:data}; + buffer += escapeExpression(((stack1 = helpers['t'] || depth0['t']),stack1 ? stack1.call(depth0, "chat.online", options) : helperMissing.call(depth0, "t", "chat.online", options))) + + "\n "; + return buffer; + } + + buffer += "