code stringlengths 2 1.05M |
|---|
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { InjectionToken } from '@angular/core';
/**
* @record
*/
export function Angulartics2Token() { }
if (false) {
/** @type {?} */
Angulartics2Token.prototype.settings;
}
/** @type {?} */
export const ANGULARTICS2_TOKEN = new InjectionToken('ANGULARTICS2');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhcnRpY3MyLXRva2VuLmpzIiwic291cmNlUm9vdCI6Im5nOi8vYW5ndWxhcnRpY3MyLyIsInNvdXJjZXMiOlsiYW5ndWxhcnRpY3MyLXRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7O0FBSS9DLHVDQUVDOzs7SUFEQyxxQ0FBd0M7OztBQUcxQyxNQUFNLE9BQU8sa0JBQWtCLEdBQUcsSUFBSSxjQUFjLENBQW9CLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGlvblRva2VuIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB7IEFuZ3VsYXJ0aWNzMlNldHRpbmdzIH0gZnJvbSAnLi9hbmd1bGFydGljczItY29uZmlnJztcblxuZXhwb3J0IGludGVyZmFjZSBBbmd1bGFydGljczJUb2tlbiB7XG4gIHNldHRpbmdzOiBQYXJ0aWFsPEFuZ3VsYXJ0aWNzMlNldHRpbmdzPjtcbn1cblxuZXhwb3J0IGNvbnN0IEFOR1VMQVJUSUNTMl9UT0tFTiA9IG5ldyBJbmplY3Rpb25Ub2tlbjxBbmd1bGFydGljczJUb2tlbj4oJ0FOR1VMQVJUSUNTMicpO1xuIl19 |
function simEmpDilemma2() {
//SIM WRAPPER CONFIG =====================
//Wrapper constants----------------
const scaleFactor = 2; //To compensate for retina screens
const width = 400;
const height = 520;
const bigWidth = width * scaleFactor;
const bigHeight = height * scaleFactor;
const groupCount = 1; //Must match number of defined groups
//Wrapper setup----------------
var container = document.getElementById('TuckmanSim');
console.log("got container:"+container.id;
const canvas0 = document.createElement("canvas");
canvas0.setAttribute("id", "canvasIDEmpDilemma2.0");
container.appendChild(canvas0);
canvas0.width = bigWidth;
canvas0.height = bigHeight;
canvas0.style.width = "" + width + "px";
canvas0.style.height = "" + height + "px";
canvas0.addEventListener('click', updateState, false);
const context0 = canvas0.getContext('2d');
context0.scale(scaleFactor, scaleFactor);
let plotCanvases = [];
let plotContexts = [];
for (let i = 0; i < groupCount; i++) {
let plotCanvas = document.createElement("canvas");
let canvasIndex = i + 1;
plotCanvas.setAttribute("id", "canvasIDEmpDilemma2." + canvasIndex);
document.body.appendChild(plotCanvas);
plotCanvas.width = bigWidth;
plotCanvas.height = bigHeight;
plotCanvas.style.width = "" + (width) + "px";
plotCanvas.style.height = "" + (height) + "px";
plotCanvas.addEventListener('click', updateState, false);
let plotContext = plotCanvas.getContext('2d');
plotContext.scale(scaleFactor, scaleFactor);
plotCanvases.push(plotCanvas);
plotContexts.push(plotContext);
}
// let defCanvas = document.createElement("canvas");
// let canvasIndex = groupCount+1;
// defCanvas.setAttribute("id","canvasIDEmpDilemma2."+canvasIndex);
// document.body.appendChild(defCanvas);
// defCanvas.width = bigWidth;
// defCanvas.height = bigHeight;
// defCanvas.style.width = ""+(width)+"px";
// defCanvas.style.height = ""+(height)+"px";
// defCanvas.addEventListener('click', updateState, false);
// let defContext = defCanvas.getContext('2d');
// defContext.scale(scaleFactor,scaleFactor);
let state = 0;
let timer;
//Wrapper functions----------------
function updateState() {
state = (state + 1) % 3;
if (state == 0) {
//Reset sim
init();
}
else if (state == 1) {
//Run sim
timer = setInterval(update, 33);
}
else {
//Stop sim
clearInterval(timer);
}
}
//=====================
//SIM CODE =====================
//Constants----------------
const agentCount = 256;
const behaviors = 4;
const interactionsPerUpdate = 10000;
const moodHistSize = 10;
const agentRadius = 10;
const border = 2;
const remember = 0.9; //0.865;//0.85;
const labelX = 10;
const labelY = 20;
const agentsY = 30;
const cowerProb = 0.6; //One is dysfunctional
const forgetProb = 0.6; //One is dysfunctional
// const angerMult:number = 0;//Zero is no irrationality
//Variables----------------
let agentList = [];
let groupList = [];
//Classes----------------
class Agent {
}
class Group {
}
class Counter {
clear() {
this.events = 0;
this.chances = 0;
}
fraction() {
return this.events / this.chances;
}
}
//Sim functions----------------
//Set up sim
function init() {
//Initialize datastructures
agentList = [];
groupList = [];
console.log("Creating agents");
//Create agents
for (let i = 0; i < agentCount; i++) {
let agent = new Agent();
agent.index = i;
//TODO: Could tweak this to generate differentiated agents.
agent.likes = new Array(behaviors).fill(1);
agent.moodHist = new Array(moodHistSize).fill(0);
agent.currentSlot = 0;
agent.memory = new Array(agentCount).fill(-1);
agent.angry = false;
agentList.push(agent);
}
//Create groups
//(This is the simple case)
console.log("Creating groups");
//Single group scenario
buildGroup(0, "Everyone", 0, agentCount, 0, 0, width, height);
//Leader/worker scenario
// buildGroup(0, "Leaders", 0, 1*agentCount/8, 0, 0, width, 1*height/8 + 45);
// buildGroup(1, "Workers", 1, 7*agentCount/8, 0, 1*height/8 + 45, width, 7*height/8 - 45);
//Oppressed minority scenario
// buildGroup(0, "Majority", 0, 7*agentCount/8, 0, 0, width, 7*height/8-45);
// buildGroup(1, "Minority", 1, 1*agentCount/8, 0, 7*height/8-45, width, 1*height/8 + 45);
//Three tier scenario
// buildGroup(0, "Execs", 0, 1*agentCount/16, 0, 0, width, 1*height/16 + 32);
// buildGroup(1, "Managers", 1, 3*agentCount/16, 0, 1*height/16 + 32, width, 3*height/16 + 20);
// buildGroup(2, "Workers", 2, 3*agentCount/4, 0, 1*height/4+52, width, 3*height/4 - 52);
//Siloed teams scenario
// buildGroup(0, "Leaders", 0, 2*agentCount/16, 0, 0, width, 1*height/8 + 45);
// buildGroup(1, "Team A", 1, 7*agentCount/16, 0, 1*height/8 + 45, width/2, 7*height/8 - 45);
// buildGroup(2, "Team B", 1, 7*agentCount/16, width/2, 1*height/8 + 45, width/2, 7*height/8 - 45);
//Assign agents to groups
let currentAgent = 0;
for (let i = 0; i < groupCount; i++) {
let group = groupList[i];
let interval = ((agentRadius + border) * 2);
let row = Math.floor(group.width / interval);
let offset = Math.floor((group.width - (row * interval)) / 2) + agentRadius;
for (let j = 0; j < group.size; j++) {
let agent = agentList[currentAgent];
agent.x = group.x + (j % row) * interval + offset;
agent.y = group.y + agentsY + Math.floor(j / row) * interval + offset;
agent.group = i;
agent.rank = group.rank;
group.agents.push(agent);
currentAgent++;
}
}
/* Determine partners for agents
Trivial case for testing
*/
// for (let i = 0; i < groupCount; i++) {
// for (let j = 0; j < groupList[i].agents.length; j++) {
// let agent = groupList[i].agents[j];
// agent.partnerBias = [].concat(groupList[i].agents);
// }
// }
/* Determine partners for agents
Universal case for basic tiered org dysfunction (everyone talks to everyone)
*/
for (let i = 0; i < groupCount; i++) {
for (let j = 0; j < groupList[i].agents.length; j++) {
let agent = groupList[i].agents[j];
agent.partnerBias = [].concat(agentList);
}
}
/* Determine partners for agents
Tribal case for basic tiered org dysfunction
(People are more likely to talk to their own group)
*/
// for (let i = 0; i < groupCount; i++) {
// for (let j = 0; j < groupList[i].agents.length; j++) {
// let agent = groupList[i].agents[j];
// agent.partnerBias = [].concat(agentList);
// }
// }
/* Determine partners for agents
Partitioned case for siloed teams
*/
// let teamALeaders:Agent[] = groupList[0].agents.slice(0,groupList[0].agents.length/2);
// let teamBLeaders:Agent[] = groupList[0].agents.slice(groupList[0].agents.length/2);
//
// for (let i = 0; i < groupCount; i++) {
// for (let j = 0; j < groupList[i].agents.length; j++) {
//
// let agent = groupList[i].agents[j];
// agent.partnerBias = [].concat(groupList[i].agents);
//
// if (i == 0) {
// //Leaders are twice as likely to want to talk to other leaders.
// agent.partnerBias = agent.partnerBias.concat(groupList[0].agents);
//
// if (j < groupList[0].agents.length/2) {
// agent.partnerBias = agent.partnerBias.concat(groupList[1].agents);
// } else {
// agent.partnerBias = agent.partnerBias.concat(groupList[2].agents);
// }
//
// } else if (i == 1) {
// agent.partnerBias = agent.partnerBias.concat(teamALeaders);
//
// //Workers are twice as likely to want to talk to their bosses.
// agent.partnerBias = agent.partnerBias.concat(teamALeaders);
//
// } else if (i == 2) {
// agent.partnerBias = agent.partnerBias.concat(teamBLeaders);
//
// //Workers are twice as likely to want to talk to their bosses.
// agent.partnerBias = agent.partnerBias.concat(teamBLeaders);
// }
// }
// }
paint();
}
function buildGroup(index, name, rank, size, x, y, width, height) {
let group = new Group();
group.label = name;
group.rank = rank;
group.size = size;
group.x = x;
group.y = y;
group.width = width;
group.height = height;
let hue = (index * 360) / groupCount;
group.color = "hsl(" + hue + ", 100%, 20%)";
group.agents = [];
group.actionList = new Array(behaviors);
group.interactions = 0;
group.defectList = new Array(groupCount).fill(0).map(() => new Counter());
group.happyRecord = [];
// group.actionRecord = new Array(behaviors);
// for (let i = 0; i < behaviors; i++) {
// group.actionRecord[i] = [];
// }
group.actionRecord = new Array(behaviors).fill(0).map(() => []);
group.eventRecord = [];
group.eventState = -1;
group.maxDefect = 0;
group.defectRecord = new Array(groupCount).fill(0).map(() => []);
groupList.push(group);
}
//Update sim by one round
function update() {
//Zero data collection variables for each group
for (let i = 0; i < groupCount; i++) {
let group = groupList[i];
group.totalHappy = 0;
group.interactions = 0;
group.actionList.fill(0);
group.defectList.forEach((counter) => { counter.clear(); });
}
//Perform interactions
for (let i = 0; i < interactionsPerUpdate; i++) {
let indexA = Math.floor(Math.random() * agentCount);
let agentA = agentList[indexA];
let indexB = Math.floor(Math.random() * agentA.partnerBias.length);
let agentB = agentA.partnerBias[indexB];
let actionA = pickAction(agentA, agentB);
let actionB = pickAction(agentB, agentA);
let groupA = groupList[agentA.group];
let groupB = groupList[agentB.group];
groupA.actionList[actionA]++;
groupB.actionList[actionB]++;
groupA.interactions++;
groupB.interactions++;
if (actionA == 0)
groupA.defectList[agentB.group].events++;
groupA.defectList[agentB.group].chances++;
if (actionB == 0)
groupB.defectList[agentA.group].events++;
groupB.defectList[agentA.group].chances++;
applyAction(agentA, actionA, agentB, actionB);
applyAction(agentB, actionB, agentA, actionA);
}
//Capture state at end of round
for (let i = 0; i < agentCount; i++) {
let agent = agentList[i];
for (let j = 0; j < moodHistSize; j++) {
if (agent.moodHist[j] > 0) {
groupList[agent.group].totalHappy++;
}
}
}
//Transfer data for each group to record
for (let i = 0; i < groupCount; i++) {
let group = groupList[i];
group.happyRecord.push(group.totalHappy);
for (let j = 0; j < behaviors; j++) {
group.actionRecord[j].push(group.actionList[j] / group.interactions);
}
for (let j = 0; j < groupCount; j++) {
group.defectRecord[j].push(group.defectList[j].fraction());
}
group.maxDefect = Math.max(group.actionList[0], group.maxDefect);
let cooperateList = group.actionList.slice(1);
cooperateList.sort();
let loCooperate = cooperateList[0];
let hiCooperate = cooperateList[behaviors - 2];
if (group.eventState === -1 && group.happyRecord.length > 0) {
group.eventState = 0;
}
else if (group.eventState === 0 && group.actionList[0] < group.maxDefect * 0.95) {
group.eventState = 1;
}
else if (group.eventState === 1 && hiCooperate > group.actionList[0]) {
group.eventState = 2;
}
else if (group.eventState === 2 && loCooperate < hiCooperate * 0.01) {
group.eventState = 3;
}
group.eventRecord.push(group.eventState);
}
paint();
}
function pickAction(agent, other) {
let result = 0;
if (agent.angry && Math.random() < (1 - remember)) {
agent.angry = false;
}
//With some probability, an angry agent forgets their grievances
if (agent.memory[other.index] >= 0 && (Math.random() < (1 - remember))) {
agent.memory[other.index] = -1;
}
// if (irrational(agent, other)) {
// result = 0;
if (agent.angry && agent.rank <= other.rank) {
result = 0;
agent.angry = false;
// } else if (agent.memory[other.index] >= 0 && (Math.random() < remember)) {
}
else if (agent.memory[other.index] >= 0) {
result = agent.memory[other.index];
}
else {
let totalLikes = 0;
//Find the size of the roulette wheel
for (let i = 0; i < behaviors; i++) {
totalLikes += agent.likes[i];
}
//Make a selection
let selection = Math.floor(Math.random() * totalLikes);
//Figure out which action was selected
totalLikes = 0;
for (let i = 0; i < behaviors; i++) {
totalLikes += agent.likes[i];
if (selection < totalLikes) {
result = i;
break;
}
}
}
return result;
}
// function irrational(agent:Agent, other:Agent):boolean {
// /*
// If an agent is feeling bad, they behave badly with some probability.
// That probability is a reflection of their most recent happiness score.
// I apply the happiness ranged from zero to one, multiplied by some factor.
// */
// let result = false;
//
// let mood:number = 0;
// for (let i = 0; i < moodHistSize; i++) {
// mood += agent.moodHist[i];
// }
// let happy = mood/moodHistSize;
// let angry = 1 - happy;
// let angryThresh = angry * angerMult;
//
// if (Math.random() < angryThresh && agent.rank <= other.rank) {
// result = true;
// }
//
// return result;
// }
function applyAction(agent, ownChoice, other, otherChoice) {
if (ownChoice == 0) {
//Agent defected
if (otherChoice == 0) {
//Partner defected
agent.likes[0]--;
agent.moodHist[agent.currentSlot] = 0;
agent.memory[other.index] = -1;
}
else {
agent.likes[0]++;
agent.moodHist[agent.currentSlot] = 1;
agent.memory[other.index] = -1; //TODO: Could tweak this
}
}
else {
//Agent attempted cooperation
if (otherChoice == 0) {
//Partner defected
agent.likes[ownChoice]--;
agent.moodHist[agent.currentSlot] = 0;
// if (other.rank >= agent.rank)//WON'T SPEAK UP
//If I am a 1 and he is a 1 or a 2, I remember to retaliate
if (retaliate(agent, other)) {
agent.memory[other.index] = 0;
}
else {
agent.angry = true;
}
}
else if (ownChoice == otherChoice) {
//Partner matched
agent.likes[ownChoice]++;
agent.moodHist[agent.currentSlot] = 1;
// if (other.rank <= agent.rank)//DON'T REMEMBER
//If I am a 2 and he is a 1 or a 2, I remember to match
if (recall(agent, other)) {
agent.memory[other.index] = ownChoice;
}
//TODO: Is there a reciprocal state to anger in this sim?
//What happens when someone can't remember how to be nice?
}
else {
//Partner differed
agent.likes[ownChoice]--;
agent.moodHist[agent.currentSlot] = 0;
agent.memory[other.index] = -1;
}
}
agent.likes[ownChoice] = Math.max(agent.likes[ownChoice], 1);
agent.currentSlot = (agent.currentSlot + 1) % moodHistSize;
}
function retaliate(agent, other) {
let result = true;
/*
If an agent feels a status conflict, they retaliate conditionally.
If they're higher or equal ranking than their partner, they'll always retaliate.
If they're lower ranking, then they'll retaliate based on culture.
So we check the rank.
If we're in the rank bounds where suppression counts, we act with some proability.
*/
if (agent.rank > other.rank) {
if (Math.random() < cowerProb) {
result = false; //Then with probability p, fail to retaliate
}
}
return result;
}
function recall(agent, other) {
let result = true;
if (agent.rank < other.rank) {
if (Math.random() < forgetProb) {
result = false; //Then with probability p, fail to recall specifics
}
}
return result;
}
function paint() {
// console.log("Painting");
paintAgents();
for (let i = 0; i < groupCount; i++) {
paintPlot(i);
}
// paintDefection();
}
function paintAgents() {
//Paint background
context0.clearRect(0, 0, width, height);
for (let i = 0; i < agentCount; i++) {
let agent = agentList[i];
//Determine the total number of opinions this agent has
let totalLikes = 0;
for (let j = 0; j < behaviors; j++) {
totalLikes += agent.likes[j];
}
//Draw the circle segments
let likesSoFar = 0;
let angleSoFar = 0;
for (let j = 0; j < behaviors; j++) {
let newLikes = likesSoFar + agent.likes[j];
let newAngle = (newLikes * Math.PI * 2) / totalLikes;
let color = "black";
if (j > 0) {
let hue = ((j - 1) * 360 / (behaviors - 1));
color = "hsl(" + hue + ", 100%, 50%)";
}
context0.beginPath();
context0.fillStyle = color;
// context.moveTo(agent.x, agent.y);
context0.arc(agent.x, agent.y, agentRadius, angleSoFar, newAngle);
context0.lineTo(agent.x, agent.y);
context0.fill();
likesSoFar = newLikes;
angleSoFar = newAngle;
}
}
for (let i = 0; i < groupCount; i++) {
let group = groupList[i];
context0.strokeStyle = group.color;
context0.lineWidth = 4;
context0.fillStyle = group.color;
context0.font = '16px Arial';
context0.strokeRect(group.x, group.y, group.width - 1, group.height - 1);
context0.fillText(group.label, group.x + labelX, group.y + labelY);
}
}
function paintPlot(index) {
let context = plotContexts[index];
let group = groupList[index];
//Paint background
context.clearRect(0, 0, width, height);
//Determine graph X scaling
let start = Math.max(0, group.happyRecord.length - width);
let end = group.happyRecord.length;
let cols = end - start;
let maxHappy = group.size * moodHistSize;
// let maxActions = interactionsPerUpdate * 2;
let maxActions = 1;
for (let i = 1; i < cols; i++) {
let xStep = width / cols;
let c = i + start;
let p = c - 1;
let px = (p - start) * xStep;
let cx = (c - start) * xStep;
if (group.eventRecord[p] === 0) {
context.fillStyle = "#FFBBBB";
}
else if (group.eventRecord[p] === 1) {
context.fillStyle = "#FFFFBB";
}
else if (group.eventRecord[p] === 2) {
context.fillStyle = "#BBFFBB";
}
else if (group.eventRecord[p] === 3) {
context.fillStyle = "#BBFFFF";
}
context.fillRect(px, 0, Math.ceil(xStep), height);
}
//Draw lines
for (let i = 1; i < cols; i++) {
drawSegment(context, group.happyRecord, i + start, 'Gold', start, cols, maxHappy);
for (let j = 0; j < behaviors; j++) {
let color = "black";
if (j > 0) {
let hue = ((j - 1) * 360 / (behaviors - 1));
color = "hsl(" + hue + ", 100%, 50%)";
}
drawSegment(context, group.actionRecord[j], i + start, color, start, cols, maxActions);
}
}
context.strokeStyle = 'Black';
context.strokeStyle = group.color;
context.lineWidth = 4;
context.fillStyle = group.color;
context.font = '16px Arial';
context.strokeRect(0, 0, width - 1, height - 1);
context.fillText(group.label, labelX, labelY);
for (let i = 1; i < cols; i++) {
let xStep = width / cols;
let c = i + start;
let p = c - 1;
let px = (p - start) * xStep;
if (group.eventRecord[c] === 0) {
context.fillStyle = "#DD0000";
}
else if (group.eventRecord[c] === 1) {
context.fillStyle = "#AAAA00";
}
else if (group.eventRecord[c] === 2) {
context.fillStyle = "#00DD00";
}
else if (group.eventRecord[c] === 3) {
context.fillStyle = "#00AAAA";
}
let phaseLabel = "";
if (group.eventRecord[p] != group.eventRecord[c]) {
phaseLabel = "" + c;
}
context.fillText(phaseLabel, px, labelY * (group.eventRecord[p] + 2));
}
}
// function paintDefection():void {
//
// //Paint background
// defContext.clearRect(0, 0, width, height);
//
// let group0 = groupList[0];
//
// //Determine graph X scaling
// let start = Math.max(0, group0.happyRecord.length - width);
// let end = group0.happyRecord.length;
// let cols = end - start;
//
// //Draw lines
// for (let i = 1; i < cols; i++) {
//
// for (let j = 0; j < groupCount; j++) {
// let fromGroup:Group = groupList[j];
// for (let k = 0; k < groupCount; k++) {
// let toGroup:Group = groupList[k];
//
// let lineColor = fromGroup.color;
// let beadColor = toGroup.color;
//
// drawDefSegment(defContext, fromGroup.defectRecord[k], i+start, lineColor, beadColor, start, cols);
// }
// }
// }
//
// defContext.strokeStyle = 'Black';
// defContext.lineWidth = 4;
// defContext.font = '16px Arial';
// defContext.strokeRect(0, 0, width-1, height-1);
// defContext.fillStyle = 'Black';
// defContext.fillText("Defection Rates", labelX, labelY);
// }
function drawSegment(context, record, c, color, start, cols, max) {
let xStep = width / cols;
let yStep = height / max;
let p = c - 1;
let px = (p - start) * xStep;
let cx = (c - start) * xStep;
let py = height - (record[p] * yStep);
let cy = height - (record[c] * yStep);
context.beginPath();
context.strokeStyle = color;
context.moveTo(px, py);
context.lineTo(cx, cy);
context.lineWidth = 2;
context.stroke();
}
function drawDefSegment(context, record, c, lineColor, beadColor, start, cols) {
let xStep = width / cols;
let yStep = height;
let p = c - 1;
let h = 0;
if (p >= 0)
h = p - 1;
let px = (p - start) * xStep;
let cx = (c - start) * xStep;
let py = height - ((record[p] + record[h]) / 2 * yStep);
let cy = height - ((record[c] + record[p]) / 2 * yStep);
context.beginPath();
context.strokeStyle = lineColor;
context.moveTo(px, py);
context.lineTo(cx, cy);
context.lineWidth = 2;
context.stroke();
let step = 1;
if (cols < width / 4) {
step = 5;
}
else if (cols < width / 2) {
step = 10;
}
else if (cols < 3 * width / 4) {
step = 15;
}
else {
step = 20;
}
if (c % step == 0) {
context.fillStyle = beadColor;
context.beginPath();
context.arc(cx, cy, 4, 0, 2 * Math.PI);
context.fill();
}
}
init();
//=====================
}
simEmpDilemma2();
|
#!/usr/local/bin/node
/**
* Build a release for the gh-pages docs site.
*/
var fs = require('fs');
var execSync = require('child_process').execSync;
var usage = '\nbuild <vn.n.n[-pre[.n]]> | <HEAD> [-p]\n';
var versionsFile = './src/www/versions.json';
// Read the command-line args
var args = process.argv;
if (args.length < 3) {
exit(usage);
}
var version = args[2];
// The regex isn't a perfect filter (it allows any component parts of a pre-release in the right order)
if (!version.match(/v\d{1,2}.\d{1,2}.\d{1,2}-?\w*\.?\d{0,2}/) && version !== 'HEAD') {
exit(usage);
}
// Exit with a message
function exit(message) {
console.log(message,'\n');
process.exit();
}
// Exec with echo
function execho(command) {
console.log(command);
try {
execSync(command, {stdio: 'inherit'});
} catch (error) {
console.error(error.output[1]);
process.exit(error.status);
}
}
// Exec with return value or error
function execReturn(command) {
console.log(command);
try {
return execSync(command, {encoding: 'utf8'});
} catch (error) {
console.error(error.output[1]);
process.exit(error.status);
}
}
function preRelease(version) {
return /-/.test(version) || version === 'HEAD';
}
function lastCommitIsHead() {
// All the versions
var log = execReturn('git log');
// Get the version number of the current commit (line 5, strip leading whitespace and trailing text)
var version = (log.split('\n')[4]+' ').replace(/\s*(\S*).*/, '$1');
return version === 'HEAD';
}
/**
* Add new version number to versions.js, commit it, and tag the release
* The checks for HEAD can be removed once HEAD builds are automated, as the first entry will always be HEAD.
*/
function addMenuVersion(version) {
var versions = JSON.parse(fs.readFileSync(versionsFile, 'utf8'));
var position = 0;
// If the first version in the array is HEAD, set the insert position to 1
if (versions[0] === 'HEAD') {
position = 1;
}
// If not a new HEAD version, splice it in, otherwise only add it if HEAD is not already present
if (version !== 'HEAD' || (version === 'HEAD' && !position)) {
versions.splice(position, 0, version);
// Write the file
fs.writeFileSync(versionsFile, JSON.stringify(versions, null, 2));
// Commit it (on master branch & tag the release)
execho('git add ' + versionsFile);
execho('git commit -m ' + '\'[Docs] Add ' + version + ' to versions.json\'');
execho('git tag ' + version);
}
}
/**
* Build the docs site on a detached branch, commit it on gh-pages branch.
*/
function buildDocs() {
// Ensure we're starting in the docs dir
process.chdir(__dirname);
// Checkout the `gh-pages` branch and update from upstream
execho('git checkout gh-pages && git pull docs-site gh-pages');
// Delete last HEAD commit to keep the history clean, unless we're committing a new HEAD version
if (lastCommitIsHead() && version !== 'HEAD') {
execho('git reset --hard HEAD~1');
}
// Checkout the tag `version` or master for HEAD
if (version === 'HEAD') {
execho('git checkout --detach master');
} else {
execho('git checkout tags/' + version);
}
// Build the docs site
execho('npm install && npm run browser:build');
// Version it
execho('mv build ../' + version);
// Move to the gh-pages branch
execho('git checkout gh-pages');
// Symbolic link `release` to latest version
if (!preRelease(version)) {
execho('ln -sfh ./' + version + ' ../release');
}
// Symbolic link `versions.json` to latest version
execho('ln -sfh ./' + version + '/versions.json ../versions.json');
// Commit the new version
if (version === 'HEAD') {
execho('git commit --amend --no-edit');
} else {
execho('git add .. && git commit -m \'' + version + '\'');
}
if (args[3] === '-p') {
execho('git push -f');
}
}
addMenuVersion(version);
buildDocs(version);
|
//>>built
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},bs:!0,mk:!0,sr:!0,zh:!0,"zh-tw":!0,vi:!0,uk:!0,tr:!0,th:!0,sv:!0,sl:!0,sk:!0,ru:!0,ro:!0,pt:!0,"pt-pt":!0,pl:!0,nl:!0,nb:!0,lv:!0,lt:!0,ko:!0,kk:!0,ja:!0,it:!0,id:!0,hu:!0,hr:!0,he:!0,fr:!0,fi:!0,eu:!0,et:!0,es:!0,el:!0,de:!0,da:!0,cs:!0,ca:!0,bg:!0,az:!0,ar:!0}); |
/**
* Story maker module.
* @return {[type]} [description]
*/
import postal from 'postal';
import asyncWaterfall from 'async/waterfall';
import FileSaver from 'file-saver';
import _ from 'lodash';
import swal from 'sweetalert2';
import StoryPlayer from 'apispots-lib-stories/lib/stories/story-player';
import StoryVisualizer from './story-visualizer';
import StoryManager from '../../lib/stories/story-manager';
import CredentialsManager from '../../lib/openapi/browser-credentials-manager';
export default (function() {
/*
* Private
*/
/**
* Called when a story needs to be
* played. Displays a modal.
* @param {[type]} data [description]
* @return {[type]} [description]
*/
const _onPlayStory = function(data) {
asyncWaterfall([
(cb) => {
// get the story instance
StoryManager.getStory(data.api.specUrl, data.storyId)
.then(story => {
// set the story instance
// _story = story;
cb(null, story);
})
.catch(e => {
cb(e);
});
},
(story, cb) => {
// set the credentials manager instance
StoryPlayer.setCredentialsManager(CredentialsManager);
// play the story and return a promise
StoryPlayer.play(story)
.then(() => {
cb(null, story);
})
.catch(cb);
}
], (e, story) => {
if (e) {
console.error(e);
}
// publish the event
postal.publish({
channel: 'stories',
topic: 'story completed',
data: {
story
}
});
// process the story output
_processStoryOutput(story);
});
};
/**
* Processes the story ouput.
* @param {[type]} story [description]
* @return {[type]} [description]
*/
const _processStoryOutput = (story) => {
try {
const {output} = story;
if ((output.data instanceof Blob) &&
(output.data.size > 0)) {
// output type is Blob,
// so download now
const blob = output.data;
swal({
title: 'Enter a filename',
input: 'text',
showCancelButton: true,
confirmButtonText: 'Save',
allowOutsideClick: false
}).then((filename) => {
FileSaver.saveAs(blob, filename);
})
.catch(() => {
// silent
FileSaver.saveAs(blob);
});
} else if ((typeof output.data !== 'undefined')
|| (!_.isEmpty(output.text))
|| (!_.isEmpty(output.data))) {
// visualize the output data
StoryVisualizer.visualize(story);
} else {
// do nothing
}
} catch (e) {
// silent
}
};
// event bindings
postal.subscribe({
channel: 'stories',
topic: 'play story',
callback: _onPlayStory
});
return {
/*
* Public
*/
};
}());
|
import React, {PropTypes, cloneElement} from 'react';
import { findDOMNode } from 'react-dom';
import cx from 'classnames';
import jss from 'js-stylesheet';
import uuid from '../helpers/uuid';
import childrenPropType from '../helpers/childrenPropType';
// Determine if a tab node is disabled
function isTabDisabled(node) {
return node.getAttribute('aria-disabled') === 'true';
}
let useDefaultStyles = true;
module.exports = React.createClass({
displayName: 'Tabs',
propTypes: {
className: PropTypes.string,
selectedIndex: PropTypes.number,
onSelect: PropTypes.func,
focus: PropTypes.bool,
children: childrenPropType,
forceRenderTabPanel: PropTypes.bool
},
childContextTypes: {
forceRenderTabPanel: PropTypes.bool
},
statics: {
setUseDefaultStyles(use) {
useDefaultStyles = use;
}
},
getDefaultProps() {
return {
selectedIndex: -1,
focus: false,
forceRenderTabPanel: false
};
},
getInitialState() {
return this.copyPropsToState(this.props);
},
getChildContext() {
return {
forceRenderTabPanel: this.props.forceRenderTabPanel
};
},
componentDidMount() {
if (useDefaultStyles) {
jss(require('../helpers/styles.js'));
}
},
componentWillReceiveProps(newProps) {
this.setState(this.copyPropsToState(newProps));
},
handleClick(e) {
let node = e.target;
do {
if (this.isTabNode(node)) {
if (isTabDisabled(node)) {
return;
}
const index = [].slice.call(node.parentNode.children).indexOf(node);
this.setSelected(index);
return;
}
} while ((node = node.parentNode) !== null);
},
handleKeyDown(e) {
if (this.isTabNode(e.target)) {
let index = this.state.selectedIndex;
let preventDefault = false;
// Select next tab to the left
if (e.keyCode === 37 || e.keyCode === 38) {
index = this.getPrevTab(index);
preventDefault = true;
}
// Select next tab to the right
/* eslint brace-style:0 */
else if (e.keyCode === 39 || e.keyCode === 40) {
index = this.getNextTab(index);
preventDefault = true;
}
// This prevents scrollbars from moving around
if (preventDefault) {
e.preventDefault();
}
this.setSelected(index, true);
}
},
setSelected(index, focus) {
// Don't do anything if nothing has changed
if (index === this.state.selectedIndex) return;
// Check index boundary
if (index < 0 || index >= this.getTabsCount()) return;
// Keep reference to last index for event handler
const last = this.state.selectedIndex;
// Update selected index
this.setState({ selectedIndex: index, focus: focus === true });
// Call change event handler
if (typeof this.props.onSelect === 'function') {
this.props.onSelect(index, last);
}
},
getNextTab(index) {
const count = this.getTabsCount();
// Look for non-disabled tab from index to the last tab on the right
for (let i = index + 1; i < count; i++) {
const tab = this.getTab(i);
if (!isTabDisabled(findDOMNode(tab))) {
return i;
}
}
// If no tab found, continue searching from first on left to index
for (let i = 0; i < index; i++) {
const tab = this.getTab(i);
if (!isTabDisabled(findDOMNode(tab))) {
return i;
}
}
// No tabs are disabled, return index
return index;
},
getPrevTab(index) {
let i = index;
// Look for non-disabled tab from index to first tab on the left
while (i--) {
const tab = this.getTab(i);
if (!isTabDisabled(findDOMNode(tab))) {
return i;
}
}
// If no tab found, continue searching from last tab on right to index
i = this.getTabsCount();
while (i-- > index) {
const tab = this.getTab(i);
if (!isTabDisabled(findDOMNode(tab))) {
return i;
}
}
// No tabs are disabled, return index
return index;
},
getTabsCount() {
return this.props.children && this.props.children[0] ?
React.Children.count(this.props.children[0].props.children) :
0;
},
getPanelsCount() {
return React.Children.count(this.props.children.slice(1));
},
getTabList() {
return this.refs.tablist;
},
getTab(index) {
return this.refs['tabs-' + index];
},
getPanel(index) {
return this.refs['panels-' + index];
},
getChildren() {
let index = 0;
let count = 0;
const children = this.props.children;
const state = this.state;
const tabIds = this.tabIds = this.tabIds || [];
const panelIds = this.panelIds = this.panelIds || [];
let diff = this.tabIds.length - this.getTabsCount();
// Add ids if new tabs have been added
// Don't bother removing ids, just keep them in case they are added again
// This is more efficient, and keeps the uuid counter under control
while (diff++ < 0) {
tabIds.push(uuid());
panelIds.push(uuid());
}
// Map children to dynamically setup refs
return React.Children.map(children, (child) => {
// null happens when conditionally rendering TabPanel/Tab
// see https://github.com/rackt/react-tabs/issues/37
if (child === null) {
return null;
}
let result = null;
// Clone TabList and Tab components to have refs
if (count++ === 0) {
// TODO try setting the uuid in the "constructor" for `Tab`/`TabPanel`
result = cloneElement(child, {
ref: 'tablist',
children: React.Children.map(child.props.children, (tab) => {
// null happens when conditionally rendering TabPanel/Tab
// see https://github.com/rackt/react-tabs/issues/37
if (tab === null) {
return null;
}
const ref = 'tabs-' + index;
const id = tabIds[index];
const panelId = panelIds[index];
const selected = state.selectedIndex === index;
const focus = selected && state.focus;
index++;
return cloneElement(tab, {
ref,
id,
panelId,
selected,
focus
});
})
});
// Reset index for panels
index = 0;
}
// Clone TabPanel components to have refs
else {
const ref = 'panels-' + index;
const id = panelIds[index];
const tabId = tabIds[index];
const selected = state.selectedIndex === index;
index++;
result = cloneElement(child, {
ref,
id,
tabId,
selected
});
}
return result;
});
},
render() {
// This fixes an issue with focus management.
//
// Ultimately, when focus is true, and an input has focus,
// and any change on that input causes a state change/re-render,
// focus gets sent back to the active tab, and input loses focus.
//
// Since the focus state only needs to be remembered
// for the current render, we can reset it once the
// render has happened.
//
// Don't use setState, because we don't want to re-render.
//
// See https://github.com/rackt/react-tabs/pull/7
if (this.state.focus) {
setTimeout(() => {
this.state.focus = false;
}, 0);
}
return (
<div
className={cx(
'ReactTabs',
'react-tabs',
this.props.className
)}
onClick={this.handleClick}
onKeyDown={this.handleKeyDown}
>
{this.getChildren()}
</div>
);
},
// Determine if a node from event.target is a Tab element
isTabNode(node) {
return node.nodeName === 'LI' && node.getAttribute('role') === 'tab' && node.parentElement.parentElement === findDOMNode(this);
},
// This is an anti-pattern, so sue me
copyPropsToState(props) {
let selectedIndex = props.selectedIndex;
// If no selectedIndex prop was supplied, then try
// preserving the existing selectedIndex from state.
// If the state has not selectedIndex, default
// to the first tab in the TabList.
//
// TODO: Need automation testing around this
// Manual testing can be done using examples/focus
// See 'should preserve selectedIndex when typing' in specs/Tabs.spec.js
if (selectedIndex === -1) {
if (this.state && this.state.selectedIndex) {
selectedIndex = this.state.selectedIndex;
} else {
selectedIndex = 0;
}
}
return {
selectedIndex: selectedIndex,
focus: props.focus
};
}
});
|
/* @flow */
import type { ConfigState } from '../types';
const initialState = {
appName: '',
appVersion: '',
firebase: null,
sentryUrl: '',
};
const reducer = (
state: ConfigState = initialState,
): ConfigState => state;
export default reducer;
|
'use strict';
module.exports = {
USER: {
refresh_token: 'refresh_token',
user_id: 1
},
TOKEN_RESPONSE: {
'access_token': 'eyJraWQiOiJibG...9txBQDpu4wau5FECUsw',
'token_type': 'bearer',
'expires_in': 1800,
'refresh_token': 'IjG05bcBnnbuXV2b32Xz7-0WK-VNtnr2Bnch8P8BqyI',
'user_id': 'urn:blinkbox:zuul:user:814',
'user_uri': 'https://auth.blinkboxbooks.com/users/814',
'user_username': 'john.doe@example.org',
'user_first_name': 'John',
'user_last_name': 'Doe',
'client_id': 'urn:blinkbox:zuul:client:19384',
'client_uri': 'https://auth.blinkboxbooks.com/clients/19384',
'client_name': 'Bob\'s iPad',
'client_model': 'Apple iPad Mini'
}
}; |
'use strict';
var RSVP = require('rsvp');
var logger = require('../logger');
var api = require('../api');
var chalk = require('chalk');
var _ = require('lodash');
var getProjectId = require('../getProjectId');
var utils = require('../utils');
var FirebaseError = require('../error');
var track = require('../track');
var TARGETS = {
hosting: require('./hosting'),
database: require('./database'),
functions: require('./functions'),
storage: require('./storage')
};
var _chain = function(fns, context, options, payload) {
var latest = (fns.shift() || RSVP.resolve)(context, options, payload);
if (fns.length) {
return latest.then(function() {
return _chain(fns, context, options, payload);
});
}
return latest;
};
/**
* The `deploy()` function runs through a three step deploy process for a listed
* number of deploy targets. This allows deploys to be done all together or
* for individual deployable elements to be deployed as such.
*/
var deploy = function(targetNames, options) {
var projectId = getProjectId(options);
var payload = {};
// a shared context object for deploy targets to decorate as needed
var context = {projectId: projectId};
var prepares = [];
var deploys = [];
var releases = [];
for (var i = 0; i < targetNames.length; i++) {
var targetName = targetNames[i];
var target = TARGETS[targetName];
if (!target) {
return RSVP.reject(new FirebaseError(chalk.bold(targetName) + ' is not a valid deploy target', {exit: 1}));
}
if (target.prepare) {
prepares.push(target.prepare);
}
if (target.deploy) {
deploys.push(target.deploy);
}
if (target.release) {
releases.push(target.release);
}
}
logger.info();
logger.info(chalk.bold(chalk.gray('===') + ' Deploying to \'' + projectId + '\'...'));
logger.info();
var activeTargets = targetNames.filter(function(t) {
return options.config.has(t);
});
utils.logBullet('deploying ' + chalk.bold(activeTargets.join(', ')));
return _chain(prepares, context, options, payload).then(function() {
return _chain(deploys, context, options, payload);
}).then(function() {
utils.logBullet('starting release process (may take several minutes)...');
return _chain(releases, context, options, payload);
}).then(function() {
return api.request('POST', '/v1/projects/' + encodeURIComponent(projectId) + '/releases', {
data: payload,
auth: true,
origin: api.deployOrigin
});
}).then(function(res) {
if (_.has(options, 'config.notes.databaseRules')) {
track('Rules Deploy', options.config.notes.databaseRules);
}
logger.info();
utils.logSuccess(chalk.underline.bold('Deploy complete!'));
logger.info();
var deployedHosting = _.includes(targetNames, 'hosting');
logger.info(chalk.bold('Project Console:'), utils.consoleUrl(options.project, '/overview'));
if (deployedHosting) {
logger.info(chalk.bold('Hosting URL:'), utils.addSubdomain(api.hostingOrigin, options.instance));
}
_.forEach(context.functionUrls, function(elem) {
logger.info(chalk.bold('Function URL'), '(' + elem.funcName + '):', elem.url);
});
return res.body;
});
};
deploy.TARGETS = TARGETS;
module.exports = deploy;
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import capitalize from '../utils/capitalize';
export var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
margin: 0
},
/* Styles applied to the root element if `variant="body2"`. */
body2: theme.typography.body2,
/* Styles applied to the root element if `variant="body1"`. */
body1: theme.typography.body1,
/* Styles applied to the root element if `variant="caption"`. */
caption: theme.typography.caption,
/* Styles applied to the root element if `variant="button"`. */
button: theme.typography.button,
/* Styles applied to the root element if `variant="h1"`. */
h1: theme.typography.h1,
/* Styles applied to the root element if `variant="h2"`. */
h2: theme.typography.h2,
/* Styles applied to the root element if `variant="h3"`. */
h3: theme.typography.h3,
/* Styles applied to the root element if `variant="h4"`. */
h4: theme.typography.h4,
/* Styles applied to the root element if `variant="h5"`. */
h5: theme.typography.h5,
/* Styles applied to the root element if `variant="h6"`. */
h6: theme.typography.h6,
/* Styles applied to the root element if `variant="subtitle1"`. */
subtitle1: theme.typography.subtitle1,
/* Styles applied to the root element if `variant="subtitle2"`. */
subtitle2: theme.typography.subtitle2,
/* Styles applied to the root element if `variant="overline"`. */
overline: theme.typography.overline,
/* Styles applied to the root element if `align="left"`. */
alignLeft: {
textAlign: 'left'
},
/* Styles applied to the root element if `align="center"`. */
alignCenter: {
textAlign: 'center'
},
/* Styles applied to the root element if `align="right"`. */
alignRight: {
textAlign: 'right'
},
/* Styles applied to the root element if `align="justify"`. */
alignJustify: {
textAlign: 'justify'
},
/* Styles applied to the root element if `nowrap={true}`. */
noWrap: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
},
/* Styles applied to the root element if `gutterBottom={true}`. */
gutterBottom: {
marginBottom: '0.35em'
},
/* Styles applied to the root element if `paragraph={true}`. */
paragraph: {
marginBottom: 16
},
/* Styles applied to the root element if `color="inherit"`. */
colorInherit: {
color: 'inherit'
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
color: theme.palette.secondary.main
},
/* Styles applied to the root element if `color="textPrimary"`. */
colorTextPrimary: {
color: theme.palette.text.primary
},
/* Styles applied to the root element if `color="textSecondary"`. */
colorTextSecondary: {
color: theme.palette.text.secondary
},
/* Styles applied to the root element if `color="error"`. */
colorError: {
color: theme.palette.error.main
},
/* Styles applied to the root element if `display="inline"`. */
displayInline: {
display: 'inline'
},
/* Styles applied to the root element if `display="block"`. */
displayBlock: {
display: 'block'
}
};
};
var defaultVariantMapping = {
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
h6: 'h6',
subtitle1: 'h6',
subtitle2: 'h6',
body1: 'p',
body2: 'p'
};
var Typography = /*#__PURE__*/React.forwardRef(function Typography(props, ref) {
var _props$align = props.align,
align = _props$align === void 0 ? 'inherit' : _props$align,
classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'initial' : _props$color,
component = props.component,
_props$display = props.display,
display = _props$display === void 0 ? 'initial' : _props$display,
_props$gutterBottom = props.gutterBottom,
gutterBottom = _props$gutterBottom === void 0 ? false : _props$gutterBottom,
_props$noWrap = props.noWrap,
noWrap = _props$noWrap === void 0 ? false : _props$noWrap,
_props$paragraph = props.paragraph,
paragraph = _props$paragraph === void 0 ? false : _props$paragraph,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'body1' : _props$variant,
_props$variantMapping = props.variantMapping,
variantMapping = _props$variantMapping === void 0 ? defaultVariantMapping : _props$variantMapping,
other = _objectWithoutProperties(props, ["align", "classes", "className", "color", "component", "display", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"]);
var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
return /*#__PURE__*/React.createElement(Component, _extends({
className: clsx(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes["color".concat(capitalize(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes["align".concat(capitalize(align))], display !== 'initial' && classes["display".concat(capitalize(display))]),
ref: ref
}, other));
});
process.env.NODE_ENV !== "production" ? Typography.propTypes = {
/**
* Set the text-align on the component.
*/
align: PropTypes.oneOf(['inherit', 'left', 'center', 'right', 'justify']),
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The color of the component. It supports those theme colors that make sense for this component.
*/
color: PropTypes.oneOf(['initial', 'inherit', 'primary', 'secondary', 'textPrimary', 'textSecondary', 'error']),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
* Overrides the behavior of the `variantMapping` prop.
*/
component: PropTypes
/* @typescript-to-proptypes-ignore */
.elementType,
/**
* Controls the display type
*/
display: PropTypes.oneOf(['initial', 'block', 'inline']),
/**
* If `true`, the text will have a bottom margin.
*/
gutterBottom: PropTypes.bool,
/**
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
*
* Note that text overflow can only happen with block or inline-block level elements
* (the element needs to have a width in order to overflow).
*/
noWrap: PropTypes.bool,
/**
* If `true`, the text will have a bottom margin.
*/
paragraph: PropTypes.bool,
/**
* Applies the theme typography styles.
*/
variant: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline', 'inherit']),
/**
* The component maps the variant prop to a range of different HTML element types.
* For instance, subtitle1 to `<h6>`.
* If you wish to change that mapping, you can provide your own.
* Alternatively, you can use the `component` prop.
*/
variantMapping: PropTypes.object
} : void 0;
export default withStyles(styles, {
name: 'MuiTypography'
})(Typography); |
export default {
scriptUrl: '//s3.amazonaws.com/totango-cdn/totango3.js',
disabled: false
}; |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.generateRowGap = generateRowGap;
exports.generateColumnGap = generateColumnGap;
exports.default = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _system = require("@material-ui/system");
var _unstyled = require("@material-ui/unstyled");
var _requirePropFactory = _interopRequireDefault(require("../utils/requirePropFactory"));
var _styled = _interopRequireDefault(require("../styles/styled"));
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
var _GridContext = _interopRequireDefault(require("./GridContext"));
var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "lg", "md", "rowSpacing", "sm", "spacing", "wrap", "xl", "xs", "zeroMinWidth"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function getOffset(val) {
const parse = parseFloat(val);
return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
} // Duplicated with Stack.js
function resolveBreakpointValues({
values,
base
}) {
const keys = Object.keys(base);
if (keys.length === 0) {
return values;
}
let previous;
return keys.reduce((acc, breakpoint) => {
if (typeof values === 'object') {
acc[breakpoint] = values[breakpoint] != null ? values[breakpoint] : values[previous];
} else {
acc[breakpoint] = values;
}
previous = breakpoint;
return acc;
}, {});
}
function generateGrid(globalStyles, theme, breakpoint, styleProps) {
const size = styleProps[breakpoint];
if (!size) return;
let styles = {};
if (size === true) {
// For the auto layouting
styles = {
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%'
};
} else if (size === 'auto') {
styles = {
flexBasis: 'auto',
flexGrow: 0,
maxWidth: 'none'
};
} else {
const columnsBreakpointValues = resolveBreakpointValues({
values: styleProps.columns,
base: theme.breakpoints.values
}); // Keep 7 significant numbers.
const width = `${Math.round(size / columnsBreakpointValues[breakpoint] * 10e7) / 10e5}%`;
let more = {};
if (styleProps.container && styleProps.item && styleProps.columnSpacing !== 0) {
const themeSpacing = theme.spacing(styleProps.columnSpacing);
if (themeSpacing !== '0px') {
const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
more = {
flexBasis: fullWidth,
maxWidth: fullWidth
};
}
} // Close to the bootstrap implementation:
// https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
styles = (0, _extends2.default)({
flexBasis: width,
flexGrow: 0,
maxWidth: width
}, more);
} // No need for a media query for the first size.
if (theme.breakpoints.values[breakpoint] === 0) {
Object.assign(globalStyles, styles);
} else {
globalStyles[theme.breakpoints.up(breakpoint)] = styles;
}
}
function generateDirection({
theme,
styleProps
}) {
return (0, _system.handleBreakpoints)({
theme
}, styleProps.direction, propValue => {
const output = {
flexDirection: propValue
};
if (propValue.indexOf('column') === 0) {
output[`& > .${_gridClasses.default.item}`] = {
maxWidth: 'none'
};
}
return output;
});
}
function generateRowGap({
theme,
styleProps
}) {
const {
container,
rowSpacing
} = styleProps;
let styles = {};
if (container && rowSpacing !== 0) {
styles = (0, _system.handleBreakpoints)({
theme
}, rowSpacing, propValue => {
const themeSpacing = theme.spacing(propValue);
if (themeSpacing !== '0px') {
return {
marginTop: `-${getOffset(themeSpacing)}`,
[`& > .${_gridClasses.default.item}`]: {
paddingTop: getOffset(themeSpacing)
}
};
}
return {};
});
}
return styles;
}
function generateColumnGap({
theme,
styleProps
}) {
const {
container,
columnSpacing
} = styleProps;
let styles = {};
if (container && columnSpacing !== 0) {
styles = (0, _system.handleBreakpoints)({
theme
}, columnSpacing, propValue => {
const themeSpacing = theme.spacing(propValue);
if (themeSpacing !== '0px') {
return {
width: `calc(100% + ${getOffset(themeSpacing)})`,
marginLeft: `-${getOffset(themeSpacing)}`,
[`& > .${_gridClasses.default.item}`]: {
paddingLeft: getOffset(themeSpacing)
}
};
}
return {};
});
}
return styles;
} // Default CSS values
// flex: '0 1 auto',
// flexDirection: 'row',
// alignItems: 'flex-start',
// flexWrap: 'nowrap',
// justifyContent: 'flex-start',
const GridRoot = (0, _styled.default)('div', {
name: 'MuiGrid',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
container,
direction,
item,
lg,
md,
sm,
spacing,
wrap,
xl,
xs,
zeroMinWidth
} = props.styleProps;
return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, container && spacing !== 0 && styles[`spacing-xs-${String(spacing)}`], direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], xs !== false && styles[`grid-xs-${String(xs)}`], sm !== false && styles[`grid-sm-${String(sm)}`], md !== false && styles[`grid-md-${String(md)}`], lg !== false && styles[`grid-lg-${String(lg)}`], xl !== false && styles[`grid-xl-${String(xl)}`]];
}
})(({
styleProps
}) => (0, _extends2.default)({
boxSizing: 'border-box'
}, styleProps.container && {
display: 'flex',
flexWrap: 'wrap',
width: '100%'
}, styleProps.item && {
margin: 0 // For instance, it's useful when used with a `figure` element.
}, styleProps.zeroMinWidth && {
minWidth: 0
}, styleProps.wrap === 'nowrap' && {
flexWrap: 'nowrap'
}, styleProps.wrap === 'reverse' && {
flexWrap: 'wrap-reverse'
}), generateDirection, generateRowGap, generateColumnGap, ({
theme,
styleProps
}) => theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
// Use side effect over immutability for better performance.
generateGrid(globalStyles, theme, breakpoint, styleProps);
return globalStyles;
}, {}));
const useUtilityClasses = styleProps => {
const {
classes,
container,
direction,
item,
lg,
md,
sm,
spacing,
wrap,
xl,
xs,
zeroMinWidth
} = styleProps;
const slots = {
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', container && spacing !== 0 && `spacing-xs-${String(spacing)}`, direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, xs !== false && `grid-xs-${String(xs)}`, sm !== false && `grid-sm-${String(sm)}`, md !== false && `grid-md-${String(md)}`, lg !== false && `grid-lg-${String(lg)}`, xl !== false && `grid-xl-${String(xl)}`]
};
return (0, _unstyled.unstable_composeClasses)(slots, _gridClasses.getGridUtilityClass, classes);
};
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
const themeProps = (0, _useThemeProps.default)({
props: inProps,
name: 'MuiGrid'
});
const props = (0, _system.unstable_extendSxProp)(themeProps);
const {
className,
columns: columnsProp = 12,
columnSpacing: columnSpacingProp,
component = 'div',
container = false,
direction = 'row',
item = false,
lg = false,
md = false,
rowSpacing: rowSpacingProp,
sm = false,
spacing = 0,
wrap = 'wrap',
xl = false,
xs = false,
zeroMinWidth = false
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const rowSpacing = rowSpacingProp || spacing;
const columnSpacing = columnSpacingProp || spacing;
const columns = React.useContext(_GridContext.default) || columnsProp;
const styleProps = (0, _extends2.default)({}, props, {
columns,
container,
direction,
item,
lg,
md,
sm,
rowSpacing,
columnSpacing,
wrap,
xl,
xs,
zeroMinWidth
});
const classes = useUtilityClasses(styleProps);
const wrapChild = element => columns !== 12 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridContext.default.Provider, {
value: columns,
children: element
}) : element;
return wrapChild( /*#__PURE__*/(0, _jsxRuntime.jsx)(GridRoot, (0, _extends2.default)({
styleProps: styleProps,
className: (0, _clsx.default)(classes.root, className),
as: component,
ref: ref
}, other)));
});
process.env.NODE_ENV !== "production" ? Grid.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The content of the component.
*/
children: _propTypes.default.node,
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* The number of columns.
* @default 12
*/
columns: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
/**
* Defines the horizontal space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
columnSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: _propTypes.default.elementType,
/**
* If `true`, the component will have the flex *container* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
container: _propTypes.default.bool,
/**
* Defines the `flex-direction` style property.
* It is applied for all screen sizes.
* @default 'row'
*/
direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
/**
* If `true`, the component will have the flex *item* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
item: _propTypes.default.bool,
/**
* Defines the number of grids the component is going to use.
* It's applied for the `lg` breakpoint and wider screens if not overridden.
* @default false
*/
lg: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), _propTypes.default.bool]),
/**
* Defines the number of grids the component is going to use.
* It's applied for the `md` breakpoint and wider screens if not overridden.
* @default false
*/
md: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), _propTypes.default.bool]),
/**
* Defines the vertical space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
rowSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* Defines the number of grids the component is going to use.
* It's applied for the `sm` breakpoint and wider screens if not overridden.
* @default false
*/
sm: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), _propTypes.default.bool]),
/**
* Defines the space between the type `item` components.
* It can only be used on a type `container` component.
* @default 0
*/
spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.object,
/**
* Defines the `flex-wrap` style property.
* It's applied for all screen sizes.
* @default 'wrap'
*/
wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
/**
* Defines the number of grids the component is going to use.
* It's applied for the `xl` breakpoint and wider screens.
* @default false
*/
xl: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), _propTypes.default.bool]),
/**
* Defines the number of grids the component is going to use.
* It's applied for all the screen sizes with the lowest priority.
* @default false
*/
xs: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), _propTypes.default.bool]),
/**
* If `true`, it sets `min-width: 0` on the item.
* Refer to the limitations section of the documentation to better understand the use case.
* @default false
*/
zeroMinWidth: _propTypes.default.bool
} : void 0;
if (process.env.NODE_ENV !== 'production') {
const requireProp = (0, _requirePropFactory.default)('Grid', Grid); // eslint-disable-next-line no-useless-concat
Grid['propTypes' + ''] = (0, _extends2.default)({}, Grid.propTypes, {
direction: requireProp('container'),
lg: requireProp('item'),
md: requireProp('item'),
sm: requireProp('item'),
spacing: requireProp('container'),
wrap: requireProp('container'),
xs: requireProp('item'),
zeroMinWidth: requireProp('item')
});
}
var _default = Grid;
exports.default = _default; |
module.exports={title:'Vagrant',slug:'vagrant',svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Vagrant icon</title><path d="M5.672 6.774V4.917l3.164-1.822L3.56.005.397 1.852v2.263L7.52 21.41 12 23.995v-6.496l2.107-1.224-.024-.015 4.245-9.486V4.917l5.275-3.065L20.439.005l-5.272 3.087h-.003V5.202L12 12.584v2.467l-2.11 1.224zm3.164-3.66L8.814 3.1 5.672 4.917v1.857l4.218 9.501L12 15.234v-2.65L8.836 5.202zm9.492 1.803v1.857l-4.22 9.101L12 17.332v6.663l4.521-2.607L23.603 4.05V1.852z"/></svg>',get path(){return this.svg.match(/<path\s+d="([^"]*)/)[1];},source:'https://www.hashicorp.com/brand#vagrant',hex:'1563FF'}; |
// Generated by CoffeeScript 1.6.2
/*
jQuery Waypoints - v2.0.4
Copyright (c) 2011-2014 Caleb Troughton
Dual licensed under the MIT license and GPL license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
*/
(function() {
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__slice = [].slice;
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
return define('waypoints', ['jquery'], function($) {
return factory($, root);
});
} else {
return factory(root.jQuery, root);
}
})(this, function($, window) {
var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps;
$w = $(window);
isTouch = __indexOf.call(window, 'ontouchstart') >= 0;
allWaypoints = {
horizontal: {},
vertical: {}
};
contextCounter = 1;
contexts = {};
contextKey = 'waypoints-context-id';
resizeEvent = 'resize.waypoints';
scrollEvent = 'scroll.waypoints';
waypointCounter = 1;
waypointKey = 'waypoints-waypoint-ids';
wp = 'waypoint';
wps = 'waypoints';
Context = (function() {
function Context($element) {
var _this = this;
this.$element = $element;
this.element = $element[0];
this.didResize = false;
this.didScroll = false;
this.id = 'context' + contextCounter++;
this.oldScroll = {
x: $element.scrollLeft(),
y: $element.scrollTop()
};
this.waypoints = {
horizontal: {},
vertical: {}
};
this.element[contextKey] = this.id;
contexts[this.id] = this;
$element.bind(scrollEvent, function() {
var scrollHandler;
if (!(_this.didScroll || isTouch)) {
_this.didScroll = true;
scrollHandler = function() {
_this.doScroll();
return _this.didScroll = false;
};
return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle);
}
});
$element.bind(resizeEvent, function() {
var resizeHandler;
if (!_this.didResize) {
_this.didResize = true;
resizeHandler = function() {
$[wps]('refresh');
return _this.didResize = false;
};
return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle);
}
});
}
Context.prototype.doScroll = function() {
var axes,
_this = this;
axes = {
horizontal: {
newScroll: this.$element.scrollLeft(),
oldScroll: this.oldScroll.x,
forward: 'right',
backward: 'left'
},
vertical: {
newScroll: this.$element.scrollTop(),
oldScroll: this.oldScroll.y,
forward: 'down',
backward: 'up'
}
};
if (isTouch && (!axes.vertical.oldScroll || !axes.vertical.newScroll)) {
$[wps]('refresh');
}
$.each(axes, function(aKey, axis) {
var direction, isForward, triggered;
triggered = [];
isForward = axis.newScroll > axis.oldScroll;
direction = isForward ? axis.forward : axis.backward;
$.each(_this.waypoints[aKey], function(wKey, waypoint) {
var _ref, _ref1;
if ((axis.oldScroll < (_ref = waypoint.offset) && _ref <= axis.newScroll)) {
return triggered.push(waypoint);
} else if ((axis.newScroll < (_ref1 = waypoint.offset) && _ref1 <= axis.oldScroll)) {
return triggered.push(waypoint);
}
});
triggered.sort(function(a, b) {
return a.offset - b.offset;
});
if (!isForward) {
triggered.reverse();
}
return $.each(triggered, function(i, waypoint) {
if (waypoint.options.continuous || i === triggered.length - 1) {
return waypoint.trigger([direction]);
}
});
});
return this.oldScroll = {
x: axes.horizontal.newScroll,
y: axes.vertical.newScroll
};
};
Context.prototype.refresh = function() {
var axes, cOffset, isWin,
_this = this;
isWin = $.isWindow(this.element);
cOffset = this.$element.offset();
this.doScroll();
axes = {
horizontal: {
contextOffset: isWin ? 0 : cOffset.left,
contextScroll: isWin ? 0 : this.oldScroll.x,
contextDimension: this.$element.width(),
oldScroll: this.oldScroll.x,
forward: 'right',
backward: 'left',
offsetProp: 'left'
},
vertical: {
contextOffset: isWin ? 0 : cOffset.top,
contextScroll: isWin ? 0 : this.oldScroll.y,
contextDimension: isWin ? $[wps]('viewportHeight') : this.$element.height(),
oldScroll: this.oldScroll.y,
forward: 'down',
backward: 'up',
offsetProp: 'top'
}
};
return $.each(axes, function(aKey, axis) {
return $.each(_this.waypoints[aKey], function(i, waypoint) {
var adjustment, elementOffset, oldOffset, _ref, _ref1;
adjustment = waypoint.options.offset;
oldOffset = waypoint.offset;
elementOffset = $.isWindow(waypoint.element) ? 0 : waypoint.$element.offset()[axis.offsetProp];
if ($.isFunction(adjustment)) {
adjustment = adjustment.apply(waypoint.element);
} else if (typeof adjustment === 'string') {
adjustment = parseFloat(adjustment);
if (waypoint.options.offset.indexOf('%') > -1) {
adjustment = Math.ceil(axis.contextDimension * adjustment / 100);
}
}
waypoint.offset = elementOffset - axis.contextOffset + axis.contextScroll - adjustment;
if ((waypoint.options.onlyOnScroll && (oldOffset != null)) || !waypoint.enabled) {
return;
}
if (oldOffset !== null && (oldOffset < (_ref = axis.oldScroll) && _ref <= waypoint.offset)) {
return waypoint.trigger([axis.backward]);
} else if (oldOffset !== null && (oldOffset > (_ref1 = axis.oldScroll) && _ref1 >= waypoint.offset)) {
return waypoint.trigger([axis.forward]);
} else if (oldOffset === null && axis.oldScroll >= waypoint.offset) {
return waypoint.trigger([axis.forward]);
}
});
});
};
Context.prototype.checkEmpty = function() {
if ($.isEmptyObject(this.waypoints.horizontal) && $.isEmptyObject(this.waypoints.vertical)) {
this.$element.unbind([resizeEvent, scrollEvent].join(' '));
return delete contexts[this.id];
}
};
return Context;
})();
Waypoint = (function() {
function Waypoint($element, context, options) {
var idList, _ref;
options = $.extend({}, $.fn[wp].defaults, options);
if (options.offset === 'bottom-in-view') {
options.offset = function() {
var contextHeight;
contextHeight = $[wps]('viewportHeight');
if (!$.isWindow(context.element)) {
contextHeight = context.$element.height();
}
return contextHeight - $(this).outerHeight();
};
}
this.$element = $element;
this.element = $element[0];
this.axis = options.horizontal ? 'horizontal' : 'vertical';
this.callback = options.handler;
this.context = context;
this.enabled = options.enabled;
this.id = 'waypoints' + waypointCounter++;
this.offset = null;
this.options = options;
context.waypoints[this.axis][this.id] = this;
allWaypoints[this.axis][this.id] = this;
idList = (_ref = this.element[waypointKey]) != null ? _ref : [];
idList.push(this.id);
this.element[waypointKey] = idList;
}
Waypoint.prototype.trigger = function(args) {
if (!this.enabled) {
return;
}
if (this.callback != null) {
this.callback.apply(this.element, args);
}
if (this.options.triggerOnce) {
return this.destroy();
}
};
Waypoint.prototype.disable = function() {
return this.enabled = false;
};
Waypoint.prototype.enable = function() {
this.context.refresh();
return this.enabled = true;
};
Waypoint.prototype.destroy = function() {
delete allWaypoints[this.axis][this.id];
delete this.context.waypoints[this.axis][this.id];
return this.context.checkEmpty();
};
Waypoint.getWaypointsByElement = function(element) {
var all, ids;
ids = element[waypointKey];
if (!ids) {
return [];
}
all = $.extend({}, allWaypoints.horizontal, allWaypoints.vertical);
return $.map(ids, function(id) {
return all[id];
});
};
return Waypoint;
})();
methods = {
init: function(f, options) {
var _ref;
if (options == null) {
options = {};
}
if ((_ref = options.handler) == null) {
options.handler = f;
}
this.each(function() {
var $this, context, contextElement, _ref1;
$this = $(this);
contextElement = (_ref1 = options.context) != null ? _ref1 : $.fn[wp].defaults.context;
if (!$.isWindow(contextElement)) {
contextElement = $this.closest(contextElement);
}
contextElement = $(contextElement);
context = contexts[contextElement[0][contextKey]];
if (!context) {
context = new Context(contextElement);
}
return new Waypoint($this, context, options);
});
$[wps]('refresh');
return this;
},
disable: function() {
return methods._invoke.call(this, 'disable');
},
enable: function() {
return methods._invoke.call(this, 'enable');
},
destroy: function() {
return methods._invoke.call(this, 'destroy');
},
prev: function(axis, selector) {
return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
if (index > 0) {
return stack.push(waypoints[index - 1]);
}
});
},
next: function(axis, selector) {
return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
if (index < waypoints.length - 1) {
return stack.push(waypoints[index + 1]);
}
});
},
_traverse: function(axis, selector, push) {
var stack, waypoints;
if (axis == null) {
axis = 'vertical';
}
if (selector == null) {
selector = window;
}
waypoints = jQMethods.aggregate(selector);
stack = [];
this.each(function() {
var index;
index = $.inArray(this, waypoints[axis]);
return push(stack, index, waypoints[axis]);
});
return this.pushStack(stack);
},
_invoke: function(method) {
this.each(function() {
var waypoints;
waypoints = Waypoint.getWaypointsByElement(this);
return $.each(waypoints, function(i, waypoint) {
waypoint[method]();
return true;
});
});
return this;
}
};
$.fn[wp] = function() {
var args, method;
method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (methods[method]) {
return methods[method].apply(this, args);
} else if ($.isFunction(method)) {
return methods.init.apply(this, arguments);
} else if ($.isPlainObject(method)) {
return methods.init.apply(this, [null, method]);
} else if (!method) {
return $.error("jQuery Waypoints needs a callback function or handler option.");
} else {
return $.error("The " + method + " method does not exist in jQuery Waypoints.");
}
};
$.fn[wp].defaults = {
context: window,
continuous: true,
enabled: true,
horizontal: false,
offset: 0,
triggerOnce: false
};
jQMethods = {
refresh: function() {
return $.each(contexts, function(i, context) {
return context.refresh();
});
},
viewportHeight: function() {
var _ref;
return (_ref = window.innerHeight) != null ? _ref : $w.height();
},
aggregate: function(contextSelector) {
var collection, waypoints, _ref;
collection = allWaypoints;
if (contextSelector) {
collection = (_ref = contexts[$(contextSelector)[0][contextKey]]) != null ? _ref.waypoints : void 0;
}
if (!collection) {
return [];
}
waypoints = {
horizontal: [],
vertical: []
};
$.each(waypoints, function(axis, arr) {
$.each(collection[axis], function(key, waypoint) {
return arr.push(waypoint);
});
arr.sort(function(a, b) {
return a.offset - b.offset;
});
waypoints[axis] = $.map(arr, function(waypoint) {
return waypoint.element;
});
return waypoints[axis] = $.unique(waypoints[axis]);
});
return waypoints;
},
above: function(contextSelector) {
if (contextSelector == null) {
contextSelector = window;
}
return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
return waypoint.offset <= context.oldScroll.y;
});
},
below: function(contextSelector) {
if (contextSelector == null) {
contextSelector = window;
}
return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
return waypoint.offset > context.oldScroll.y;
});
},
left: function(contextSelector) {
if (contextSelector == null) {
contextSelector = window;
}
return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
return waypoint.offset <= context.oldScroll.x;
});
},
right: function(contextSelector) {
if (contextSelector == null) {
contextSelector = window;
}
return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
return waypoint.offset > context.oldScroll.x;
});
},
enable: function() {
return jQMethods._invoke('enable');
},
disable: function() {
return jQMethods._invoke('disable');
},
destroy: function() {
return jQMethods._invoke('destroy');
},
extendFn: function(methodName, f) {
return methods[methodName] = f;
},
_invoke: function(method) {
var waypoints;
waypoints = $.extend({}, allWaypoints.vertical, allWaypoints.horizontal);
return $.each(waypoints, function(key, waypoint) {
waypoint[method]();
return true;
});
},
_filter: function(selector, axis, test) {
var context, waypoints;
context = contexts[$(selector)[0][contextKey]];
if (!context) {
return [];
}
waypoints = [];
$.each(context.waypoints[axis], function(i, waypoint) {
if (test(context, waypoint)) {
return waypoints.push(waypoint);
}
});
waypoints.sort(function(a, b) {
return a.offset - b.offset;
});
return $.map(waypoints, function(waypoint) {
return waypoint.element;
});
}
};
$[wps] = function() {
var args, method;
method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (jQMethods[method]) {
return jQMethods[method].apply(null, args);
} else {
return jQMethods.aggregate.call(null, method);
}
};
$[wps].settings = {
resizeThrottle: 100,
scrollThrottle: 30
};
return $w.load(function() {
return $[wps]('refresh');
});
});
}).call(this);
|
var WebDriver = require('selenium-webdriver').WebDriver;
var By = require('selenium-webdriver').By;
var Setup = require('./setup');
var Chrome = require('selenium-webdriver/chrome');
var Firefox = require('selenium-webdriver/firefox');
var Executors = require('selenium-webdriver/executors');
var SeleniumError = require('selenium-webdriver').error;
var Remote = require('selenium-webdriver/remote');
var Testing = require('selenium-webdriver/testing');
var WEBDRIVER = {
staticFunctions: ['attachToSession', 'createSession'],
instanceFunctions: ['actions', 'wait', 'sleep', 'getCurrentUrl', 'getTitle',
'takeScreenshot', 'getSession', 'getCapabilities', 'quit', 'touchActions',
'executeAsyncScript', 'call', 'wait', 'getWindowHandle',
'getAllWindowHandles', 'getPageSource', 'close', 'get', 'findElement',
'isElementPresent', 'findElements', 'manage', 'navigate', 'switchTo']
};
var WEBELEMENT = {
instanceFunctions: ['getDriver', 'getId', 'getRawId',
'findElement', 'click', 'sendKeys', 'getTagName', 'getCssValue',
'getAttribute', 'getText', 'getSize', 'getLocation', 'isEnabled',
'isSelected', 'submit', 'clear', 'isDisplayed', 'takeScreenshot']
};
var BY = {
staticFunctions: ['className', 'css', 'id', 'linkText', 'js', 'name',
'partialLinkText', 'tagName', 'xpath']
};
var SESSION = {
instanceFunctions: ['getId', 'getCapabilities']
};
var CHROME = {
staticFunctions: ['Driver', 'ServiceBuilder']
};
var FIREFOX = {
staticFunction: 'Driver'
};
var EXECUTORS = {
staticFunction: 'createExecutor'
};
var TESTING = {
staticFunctions: ['after', 'afterEach', 'before', 'beforeEach',
'describe', 'it', 'iit']
};
describe('selenium-webdriver dependency', function() {
describe('require("selenium-webdriver").WebDriver', function() {
for (var pos1 in WEBDRIVER.staticFunctions) {
var staticFunc = WEBDRIVER.staticFunctions[pos1];
it('should have a ' + staticFunc + ' function', function() {
expect(typeof WebDriver[staticFunc] == 'function').toBe(true);
});
}
var webdriver = Setup.getWebDriver();
for (var pos2 in WEBDRIVER.instanceFunctions) {
var instanceFunc = WEBDRIVER.instanceFunctions[pos2];
it('should have a ' + instanceFunc + ' function', function() {
expect(typeof webdriver[instanceFunc] == 'function').toBe(true);
});
}
});
describe('require("selenium-webdriver").WebElement', function() {
var webElement = Setup.getWebElement();
for (var pos in WEBELEMENT.instanceFunctions) {
var func = WEBELEMENT.instanceFunctions[pos];
it('should have a ' + func + ' function', function() {
expect(typeof webElement[func] == 'function').toBe(true);
});
}
});
describe('require("selenium-webdriver").By', function() {
for (var pos in BY.staticFunctions) {
var func = BY.staticFunctions[pos];
it('should have a ' + func + ' function', function() {
expect(typeof By[func] == 'function').toBe(true);
});
}
});
describe('require("selenium-webdriver").Session', function() {
var session = Setup.getSession();
for (var pos in SESSION.instanceFunctions) {
var func = SESSION.instanceFunctions[pos];
it('should have a ' + func + ' function', function() {
expect(typeof session[func] == 'function').toBe(true);
});
}
});
describe('require("selenium-webdriver/chrome")', function() {
for (var pos in CHROME.staticFunctions) {
var func = CHROME.staticFunctions[pos];
it('should have a ' + func + ' function', function() {
expect(typeof Chrome[func] == 'function').toBe(true);
});
}
});
describe('require("selenium-webdriver/firefox")', function() {
it('should have a ' + FIREFOX.staticFunction + ' function', function() {
expect(typeof Firefox[FIREFOX.staticFunction] == 'function').toBe(true);
});
});
describe('require("selenium-webdriver/executors")', function() {
it('should have a ' + EXECUTORS.staticFunction + ' function', function() {
expect(typeof Executors[EXECUTORS.staticFunction] == 'function').toBe(true);
});
});
describe('require("selenium-webdriver").error', function() {
it('should have a NoSuchElementError function', function() {
expect(typeof SeleniumError.NoSuchElementError == 'function').toBe(true);
});
it('should have error codes', function() {
expect(typeof SeleniumError.ErrorCode == 'object').toBe(true);
});
it('should have an error code of NO_SUCH_ALERT', function() {
expect(typeof SeleniumError.ErrorCode.NO_SUCH_ALERT == 'number').toBe(true);
});
});
describe('require("selenium-webdriver/remote")', function() {
it('should have a SeleniumServer function', function() {
expect(typeof Remote['SeleniumServer'] == 'function').toBe(true);
});
});
describe('require("selenium-webdriver/testing")', function() {
for (var pos in TESTING.staticFunctions) {
var func = TESTING.staticFunctions[pos];
it('should have a ' + func + ' function', function() {
expect(typeof Testing[func] == 'function').toBe(true);
});
}
});
});
|
/* eslint-env jest */
import cheerio from 'cheerio'
import { readdir, readFile, unlink } from 'fs-extra'
import {
nextBuild,
killApp,
nextStart,
findPort,
renderViaHTTP,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'
const appDir = join(__dirname, '../')
let chunks
let stats
let appPort
let app
const existsChunkNamed = (name) => {
return chunks.some((chunk) => new RegExp(name).test(chunk))
}
describe('Chunking', () => {
beforeAll(async () => {
try {
// If a previous build has left chunks behind, delete them
const oldChunks = await readdir(join(appDir, '.next', 'static', 'chunks'))
await Promise.all(
oldChunks.map((chunk) => {
return unlink(join(appDir, '.next', 'static', 'chunks', chunk))
})
)
} catch (e) {
// Error here means old chunks don't exist, so we don't need to do anything
}
await nextBuild(appDir, [])
stats = (await readFile(join(appDir, '.next', 'stats.json'), 'utf8'))
// fixes backslashes in keyNames not being escaped on windows
.replace(/"static\\(.*?":?)/g, (match) => match.replace(/\\/g, '\\\\'))
stats = JSON.parse(stats)
appPort = await findPort()
app = await nextStart(appDir, appPort)
chunks = await readdir(join(appDir, '.next', 'static', 'chunks'))
})
afterAll(() => killApp(app))
it('should use all url friendly names', () => {
expect(chunks).toEqual(chunks.map((name) => encodeURIComponent(name)))
})
it('should create a framework chunk', () => {
expect(existsChunkNamed('framework')).toBe(true)
})
it('should not create a commons chunk', () => {
// This app has no dependency that is required by ALL pages, and should
// therefore not have a commons chunk
expect(existsChunkNamed('commons')).toBe(false)
})
it('should not create a lib chunk for react or react-dom', () => {
// These large dependencies would become lib chunks, except that they
// are preemptively moved into the framework chunk.
expect(existsChunkNamed('react|react-dom')).toBe(false)
})
it('should not preload the build manifest', async () => {
const html = await renderViaHTTP(appPort, '/')
const $ = cheerio.load(html)
expect(
[].slice
.call($('link[rel="preload"][as="script"]'))
.map((e) => e.attribs.href)
.some((entry) => entry.includes('_buildManifest'))
).toBe(false)
})
it('should execute the build manifest', async () => {
const html = await renderViaHTTP(appPort, '/')
const $ = cheerio.load(html)
expect(
Array.from($('script'))
.map((e) => e.attribs.src)
.some((entry) => entry && entry.includes('_buildManifest'))
).toBe(true)
})
it('should not include more than one instance of react-dom', async () => {
const misplacedReactDom = stats.chunks.some((chunk) => {
if (chunk.names.includes('framework')) {
// disregard react-dom in framework--it's supposed to be there
return false
}
return chunk.modules.some((module) => {
return /react-dom/.test(module.name)
})
})
expect(misplacedReactDom).toBe(false)
})
describe('Serving', () => {
it('should hydrate with aggressive chunking', async () => {
const browser = await webdriver(appPort, '/page2')
const text = await browser.elementByCss('#padded-str').text()
expect(text).toBe('__rad__')
await browser.close()
})
it('should load chunks when navigating', async () => {
const browser = await webdriver(appPort, '/page3')
const text = await browser
.elementByCss('#page2-link')
.click()
.waitForElementByCss('#padded-str')
.elementByCss('#padded-str')
.text()
expect(text).toBe('__rad__')
await browser.close()
})
})
})
|
beforeEach(function() {
module('compiledTemplates');
}); |
$(document).ready(function(){
//Set opacity on each span to 0%
$(".rollover").css({'opacity':'0'});
$(".rollover-zoom").css({'opacity':'0'});
$(".rollover-list").css({'opacity':'0'});
$('ul a').hover(
function() {
$(this).find('.rollover').stop().fadeTo(500, 1);
$(this).find('.rollover-zoom').stop().fadeTo(500, 1);
$(this).find('.rollover-list').stop().fadeTo(500, 1);
},
function() {
$(this).find('.rollover').stop().fadeTo(500, 0);
$(this).find('.rollover-zoom').stop().fadeTo(500, 0);
$(this).find('.rollover-list').stop().fadeTo(500, 0);
}
)
});
|
/* COMPONENT */
// See the properties declaration for details of constructor arguments.
//
Monocle.Component = function (book, id, index, chapters, source) {
var API = { constructor: Monocle.Component }
var k = API.constants = API.constructor;
var p = API.properties = {
// a back-reference to the public API of the book that owns this component
book: book,
// the string that represents this component in the book's component array
id: id,
// the position in the book's components array of this component
index: index,
// The chapters argument is an array of objects that list the chapters that
// can be found in this component. A chapter object is defined as:
//
// {
// title: str,
// fragment: str, // optional anchor id
// percent: n // how far into the component the chapter begins
// }
//
// NOTE: the percent property is calculated by the component - you only need
// to pass in the title and the optional id string.
//
chapters: chapters,
// the frame provided by dataSource.getComponent() for this component
source: source
}
// Makes this component the active component for the pageDiv. There are
// several strategies for this (see loadFrame).
//
// When the component has been loaded into the pageDiv's frame, the callback
// will be invoked with the pageDiv and this component as arguments.
//
function applyTo(pageDiv, callback) {
var evtData = { 'page': pageDiv, 'source': p.source };
pageDiv.m.reader.dispatchEvent('monocle:componentchanging', evtData);
var onLoaded = function () {
setupFrame(
pageDiv,
pageDiv.m.activeFrame,
function () { callback(pageDiv, API) }
);
}
Monocle.defer(function () { loadFrame(pageDiv, onLoaded); });
}
// Loads this component into the given frame, using one of the following
// strategies:
//
// * HTML - a HTML string
// * URL - a URL string
// * Nodes - an array of DOM body nodes (NB: no way to populate head)
// * Document - a DOM DocumentElement object
//
function loadFrame(pageDiv, callback) {
var frame = pageDiv.m.activeFrame;
// We own this frame now.
frame.m.component = API;
// Hide the frame while we're changing it.
frame.style.visibility = "hidden";
// Prevent about:blank overriding imported nodes in Firefox.
// Disabled again because it seems to result in blank pages in Saf.
//frame.contentWindow.stop();
if (p.source.html || (typeof p.source == "string")) { // HTML
return loadFrameFromHTML(p.source.html || p.source, frame, callback);
} else if (p.source.javascript) { // JAVASCRIPT
//console.log("Loading as javascript: "+p.source.javascript);
return loadFrameFromJavaScript(p.source.javascript, frame, callback);
} else if (p.source.url) { // URL
return loadFrameFromURL(p.source.url, frame, callback);
} else if (p.source.nodes) { // NODES
return loadFrameFromNodes(p.source.nodes, frame, callback);
} else if (p.source.doc) { // DOCUMENT
return loadFrameFromDocument(p.source.doc, frame, callback);
}
}
// LOAD STRATEGY: HTML
// Loads a HTML string into the given frame, invokes the callback once loaded.
//
// Cleans the string so it can be used in a JavaScript statement. This is
// slow, so if the string is already clean, skip this and use
// loadFrameFromJavaScript directly.
//
function loadFrameFromHTML(src, frame, callback) {
// Compress whitespace.
src = src.replace(/\n/g, '\\n').replace(/\r/, '\\r');
// Escape single-quotes.
src = src.replace(/\'/g, '\\\'');
// Remove scripts. (DISABLED -- Monocle should leave this to implementers.)
//var scriptFragment = "<script[^>]*>([\\S\\s]*?)<\/script>";
//src = src.replace(new RegExp(scriptFragment, 'img'), '');
// BROWSERHACK: Gecko chokes on the DOCTYPE declaration.
if (Monocle.Browser.is.Gecko) {
var doctypeFragment = "<!DOCTYPE[^>]*>";
src = src.replace(new RegExp(doctypeFragment, 'm'), '');
}
loadFrameFromJavaScript(src, frame, callback);
}
// LOAD STRATEGY: JAVASCRIPT
// Like the HTML strategy, but assumes that the src string is already clean.
//
function loadFrameFromJavaScript(src, frame, callback) {
src = "javascript:'"+src+"';";
frame.onload = function () {
frame.onload = null;
Monocle.defer(callback);
}
frame.src = src;
}
// LOAD STRATEGY: URL
// Loads the URL into the given frame, invokes callback once loaded.
//
function loadFrameFromURL(url, frame, callback) {
// If it's a relative path, we need to make it absolute, using the
// reader's location (not the active component's location).
if (!url.match(/^\//)) {
var link = document.createElement('a');
link.setAttribute('href', url);
url = link.href;
delete(link);
}
frame.onload = function () {
frame.onload = null;
Monocle.defer(callback);
}
frame.contentWindow.location.replace(url);
}
// LOAD STRATEGY: NODES
// Loads the array of DOM nodes into the body of the frame (replacing all
// existing nodes), then invokes the callback.
//
function loadFrameFromNodes(nodes, frame, callback) {
var destDoc = frame.contentDocument;
destDoc.documentElement.innerHTML = "";
var destHd = destDoc.createElement("head");
var destBdy = destDoc.createElement("body");
for (var i = 0; i < nodes.length; ++i) {
var node = destDoc.importNode(nodes[i], true);
destBdy.appendChild(node);
}
var oldHead = destDoc.getElementsByTagName('head')[0];
if (oldHead) {
destDoc.documentElement.replaceChild(destHd, oldHead);
} else {
destDoc.documentElement.appendChild(destHd);
}
if (destDoc.body) {
destDoc.documentElement.replaceChild(destBdy, destDoc.body);
} else {
destDoc.documentElement.appendChild(destBdy);
}
if (callback) { callback(); }
}
// LOAD STRATEGY: DOCUMENT
// Replaces the DocumentElement of the given frame with the given srcDoc.
// Invokes the callback when loaded.
//
function loadFrameFromDocument(srcDoc, frame, callback) {
var destDoc = frame.contentDocument;
var srcBases = srcDoc.getElementsByTagName('base');
if (srcBases[0]) {
var head = destDoc.getElementsByTagName('head')[0];
if (!head) {
try {
head = destDoc.createElement('head');
if (destDoc.body) {
destDoc.insertBefore(head, destDoc.body);
} else {
destDoc.appendChild(head);
}
} catch (e) {
head = destDoc.body;
}
}
var bases = destDoc.getElementsByTagName('base');
var base = bases[0] ? bases[0] : destDoc.createElement('base');
base.setAttribute('href', srcBases[0].getAttribute('href'));
head.appendChild(base);
}
destDoc.replaceChild(
destDoc.importNode(srcDoc.documentElement, true),
destDoc.documentElement
);
// DISABLED: immediate readiness - webkit has some difficulty with this.
// if (callback) { callback(); }
Monocle.defer(callback);
}
// Once a frame is loaded with this component, call this method to style
// and measure its contents.
//
function setupFrame(pageDiv, frame, callback) {
// iOS touch events on iframes are busted. See comments in
// events.js for an explanation of this hack.
//
Monocle.Events.listenOnIframe(frame);
var doc = frame.contentDocument;
var evtData = { 'page': pageDiv, 'document': doc, 'component': API };
// Announce that the component is loaded.
pageDiv.m.reader.dispatchEvent('monocle:componentmodify', evtData);
updateDimensions(pageDiv, function () {
frame.style.visibility = "visible";
// Find the place of any chapters in the component.
locateChapters(pageDiv);
// Announce that the component has changed.
pageDiv.m.reader.dispatchEvent('monocle:componentchange', evtData);
callback();
});
}
// Checks whether the pageDiv dimensions have changed. If they have,
// remeasures dimensions and returns true. Otherwise returns false.
//
function updateDimensions(pageDiv, callback) {
pageDiv.m.dimensions.update(function (pageLength) {
p.pageLength = pageLength;
if (typeof callback == "function") { callback() };
});
}
// Iterates over all the chapters that are within this component
// (according to the array we were provided on initialization) and finds
// their location (in percentage terms) within the text.
//
// Stores this percentage with the chapter object in the chapters array.
//
function locateChapters(pageDiv) {
if (p.chapters[0] && typeof p.chapters[0].percent == "number") {
return;
}
var doc = pageDiv.m.activeFrame.contentDocument;
for (var i = 0; i < p.chapters.length; ++i) {
var chp = p.chapters[i];
chp.percent = 0;
if (chp.fragment) {
var node = doc.getElementById(chp.fragment);
chp.percent = pageDiv.m.dimensions.percentageThroughOfNode(node);
}
}
return p.chapters;
}
// For a given page number within the component, return the chapter that
// starts on or most-recently-before this page.
//
// Useful, for example, in displaying the current chapter title as a
// running head on the page.
//
function chapterForPage(pageN) {
var cand = null;
var percent = (pageN - 1) / p.pageLength;
for (var i = 0; i < p.chapters.length; ++i) {
if (percent >= p.chapters[i].percent) {
cand = p.chapters[i];
} else {
return cand;
}
}
return cand;
}
// For a given chapter fragment (the bit after the hash
// in eg, "index.html#foo"), return the page number on which
// the chapter starts. If the fragment is null or blank, will
// return the first page of the component.
//
function pageForChapter(fragment, pageDiv) {
if (!fragment) {
return 1;
}
for (var i = 0; i < p.chapters.length; ++i) {
if (p.chapters[i].fragment == fragment) {
return percentToPageNumber(p.chapters[i].percent);
}
}
var doc = pageDiv.m.activeFrame.contentDocument;
var node = doc.getElementById(fragment);
var percent = pageDiv.m.dimensions.percentageThroughOfNode(node);
return percentToPageNumber(percent);
}
function pageForXPath(xpath, pageDiv) {
var doc = pageDiv.m.activeFrame.contentDocument;
var percent = 0;
if (Monocle.Browser.env.supportsXPath) {
var node = doc.evaluate(xpath, doc, null, 9, null).singleNodeValue;
if (node) {
percent = pageDiv.m.dimensions.percentageThroughOfNode(node);
}
} else {
console.warn("XPath not supported in this client.");
}
return percentToPageNumber(percent);
}
function pageForSelector(selector, pageDiv) {
var doc = pageDiv.m.activeFrame.contentDocument;
var percent = 0;
if (Monocle.Browser.env.supportsQuerySelector) {
var node = doc.querySelector(selector);
if (node) {
percent = pageDiv.m.dimensions.percentageThroughOfNode(node);
}
} else {
console.warn("querySelector not supported in this client.");
}
return percentToPageNumber(percent);
}
function percentToPageNumber(pc) {
return Math.floor(pc * p.pageLength) + 1;
}
// A public getter for p.pageLength.
//
function lastPageNumber() {
return p.pageLength;
}
API.applyTo = applyTo;
API.updateDimensions = updateDimensions;
API.chapterForPage = chapterForPage;
API.pageForChapter = pageForChapter;
API.pageForXPath = pageForXPath;
API.pageForSelector = pageForSelector;
API.lastPageNumber = lastPageNumber;
return API;
}
Monocle.pieceLoaded('core/component');
|
/**
* Resolves the authentication status of a given token.
*
* @memberOf Jymfony.Component.Security.Authentication
*/
class AuthenticationTrustResolverInterface {
/**
* Resolves whether the passed token implementation is authenticated
* anonymously.
*
* If null is passed, the method must return false.
*
* @param {Jymfony.Component.Security.Authentication.Token.TokenInterface} [token = null]
*
* @returns {boolean}
*/
isAnonymous(token = null) { }
/**
* Resolves whether the passed token implementation is authenticated
* using remember-me capabilities.
*
* @param {Jymfony.Component.Security.Authentication.Token.TokenInterface} [token = null]
*
* @returns {boolean}
*/
isRememberMe(token = null) { }
/**
* Resolves whether the passed token implementation is fully authenticated.
*
* @param {Jymfony.Component.Security.Authentication.Token.TokenInterface} [token = null]
*
* @returns {boolean}
*/
isFullFledged(token = null) { }
}
export default getInterface(AuthenticationTrustResolverInterface);
|
/* eslint-env jest */
import {
check,
File,
findPort,
hasRedbox,
killApp,
launchApp,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'
const appDir = join(__dirname, '../')
describe('no duplicate compile error output', () => {
it('should not show compile error on page refresh', async () => {
let stderr = ''
const appPort = await findPort()
const app = await launchApp(appDir, appPort, {
env: { __NEXT_TEST_WITH_DEVTOOL: true },
onStderr(msg) {
stderr += msg || ''
},
})
const browser = await webdriver(appPort, '/')
await browser.waitForElementByCss('#a')
const f = new File(join(appDir, 'pages', 'index.js'))
f.replace('<div id="a">hello</div>', '<div id="a"!>hello</div>')
try {
// Wait for compile error:
expect(await hasRedbox(browser, true)).toBe(true)
await browser.refresh()
// Wait for compile error to re-appear:
expect(await hasRedbox(browser, true)).toBe(true)
} finally {
f.restore()
}
// Wait for compile error to disappear:
await check(
() => hasRedbox(browser, false).then((r) => (r ? 'yes' : 'no')),
/no/
)
await browser.waitForElementByCss('#a')
function getRegexCount(str, regex) {
return (str.match(regex) || []).length
}
const correctMessagesRegex =
/error - [^\r\n]+\r?\n[^\r\n]+Unexpected token/g
const totalMessagesRegex = /Unexpected token/g
const correctMessages = getRegexCount(stderr, correctMessagesRegex)
const totalMessages = getRegexCount(stderr, totalMessagesRegex)
expect(correctMessages).toBeGreaterThanOrEqual(1)
expect(correctMessages).toBe(totalMessages)
await killApp(app)
})
})
|
// Karma configuration
// Generated on Sat Oct 05 2013 22:00:14 GMT+0700 (ICT)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../../',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'packages/lib/angular/angular.js',
'packages/lib/angular-mocks/angular-mocks.js',
'packages/lib/angular-cookies/angular-cookies.js',
'packages/lib/angular-resource/angular-resource.js',
'packages/lib/angular-route/angular-route.js',
'packages/lib/angular-bootstrap/ui-bootstrap-tpls.js',
'packages/lib/angular-bootstrap/ui-bootstrap.js',
'packages/lib/angular-ui-utils/modules/route/route.js',
'packages/js/app.js',
'packages/js/config.js',
'packages/js/directives.js',
'packages/js/filters.js',
'packages/js/services/global.js',
'packages/js/services/articles.js',
'packages/js/controllers/articles.js',
'packages/js/controllers/index.js',
'packages/js/controllers/header.js',
'packages/js/init.js',
'test/karma/unit/**/*.js'
],
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
//reporters: ['progress'],
reporters: ['progress', 'coverage'],
// coverage
preprocessors: {
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'packages/js/controllers/*.js': ['coverage'],
'packages/js/services/*.js': ['coverage']
},
coverageReporter: {
type: 'html',
dir: 'test/coverage/'
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true
});
}; |
'use strict';
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const path = require('path');
const gcsBucketId = `${process.env.GCLOUD_PROJECT}.appspot.com`;
const BROWSER_CACHE_DURATION = 60 * 10;
const CDN_CACHE_DURATION = 60 * 60 * 12;
function sendStoredFile(request, response) {
const requestPath = request.path || '/';
let filePathSegments = requestPath.split('/').filter((segment) => {
// Remove empty leading or trailing path parts
return segment !== '';
});
const version = filePathSegments[0];
const isDocsPath = filePathSegments[1] === 'docs';
const lastSegment = filePathSegments[filePathSegments.length - 1];
const bucket = gcs.bucket(gcsBucketId);
let downloadSource;
let fileName;
if (isDocsPath && filePathSegments.length === 2) {
fileName = 'index.html';
filePathSegments = [version, 'docs', fileName];
} else {
fileName = lastSegment;
}
if (!fileName) {
// Root
return getDirectoryListing('/').catch(sendErrorResponse);
}
downloadSource = path.join.apply(null, filePathSegments);
downloadAndSend(downloadSource).catch(error => {
if (isDocsPath && error.code === 404) {
fileName = 'index.html';
filePathSegments = [version, 'docs', fileName];
downloadSource = path.join.apply(null, filePathSegments);
return downloadAndSend(downloadSource);
}
return Promise.reject(error);
}).catch(error => {
// If file not found, try the path as a directory
return error.code === 404 ? getDirectoryListing(request.path.slice(1)) : Promise.reject(error);
}).catch(sendErrorResponse);
function downloadAndSend(downloadSource) {
const file = bucket.file(downloadSource);
return file.getMetadata().then(data => {
return new Promise((resolve, reject) => {
const readStream = file.createReadStream()
.on('error', reject)
.on('finish', resolve);
response
.status(200)
.set({
'Content-Type': data[0].contentType,
'Cache-Control': `public, max-age=${BROWSER_CACHE_DURATION}, s-maxage=${CDN_CACHE_DURATION}`
});
readStream.pipe(response);
});
});
}
function sendErrorResponse(error) {
if (response.headersSent) {
return response;
}
let code = 500;
let message = `General error. Please try again later.
If the error persists, please create an issue in the
<a href="https://github.com/angular/angular.js/issues">AngularJS Github repository</a>`;
if (error.code === 404) {
message = 'File or directory not found';
code = 404;
}
return response.status(code).send(message);
}
function getDirectoryListing(path) {
if (!path.endsWith('/')) path += '/';
const getFilesOptions = {
delimiter: '/',
autoPaginate: false
};
if (path !== '/') getFilesOptions.prefix = path;
let fileList = [];
let directoryList = [];
return getContent(getFilesOptions).then(() => {
let contentList = '';
if (path === '/') {
// Let the latest versions appear first
directoryList.reverse();
}
directoryList.forEach(directoryPath => {
const dirName = directoryPath.split('/').reverse()[1];
contentList += `<a href="${dirName}/">${dirName}/</a><br>`;
});
fileList.forEach(file => {
const fileName = file.metadata.name.split('/').pop();
contentList += `<a href="${fileName}">${fileName}</a><br>`;
});
// A trailing slash in the base creates correct relative links when the url is accessed
// without trailing slash
const base = request.originalUrl.endsWith('/') ? request.originalUrl : request.originalUrl + '/';
const directoryListing = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="${base}">
</head>
<body>
<h1>Index of ${path}</h1>
<hr>
<pre>${contentList}</pre>
</body>
</html>`;
return response
.status(200)
.set({
'Cache-Control': `public, max-age=${BROWSER_CACHE_DURATION}, s-maxage=${CDN_CACHE_DURATION}`
})
.send(directoryListing);
});
function getContent(options) {
return bucket.getFiles(options).then(data => {
const files = data[0];
const nextQuery = data[1];
const apiResponse = data[2];
if (
// we got no files or directories from previous query pages
!fileList.length && !directoryList.length &&
// this query page has no file or directories
!files.length && (!apiResponse || !apiResponse.prefixes)) {
return Promise.reject({
code: 404
});
}
fileList = fileList.concat(files);
if (apiResponse && apiResponse.prefixes) {
directoryList = directoryList.concat(apiResponse.prefixes);
}
if (nextQuery) {
// If the results are paged, get the next page
return getContent(nextQuery);
}
return true;
});
}
}
}
const snapshotRegex = /^snapshot(-stable)?\//;
/**
* The build folder contains a zip file that is unique per build.
* When a new zip file is uploaded into snapshot or snapshot-stable,
* delete the previous zip file.
*/
function deleteOldSnapshotZip(object, context) {
const bucketId = object.bucket;
const filePath = object.name;
const contentType = object.contentType;
const bucket = gcs.bucket(bucketId);
const snapshotFolderMatch = filePath.match(snapshotRegex);
if (!snapshotFolderMatch || contentType !== 'application/zip') {
return;
}
bucket.getFiles({
prefix: snapshotFolderMatch[0],
delimiter: '/',
autoPaginate: false
}).then(function(data) {
const files = data[0];
const oldZipFiles = files.filter(file => {
return file.metadata.name !== filePath && file.metadata.contentType === 'application/zip';
});
console.info(`found ${oldZipFiles.length} old zip files to delete`);
oldZipFiles.forEach(function(file) {
file.delete();
});
});
}
exports.sendStoredFile = functions.https.onRequest(sendStoredFile);
exports.deleteOldSnapshotZip = functions.storage.object().onFinalize(deleteOldSnapshotZip);
|
var OAuth2 = require("./oauth2")
, util = require("util")
, url = require("url")
function Foursquare(options) {
this.code = {
protocol: "https",
host: "foursquare.com",
pathname: "/oauth2/authenticate",
query: {
client_id: options.id,
response_type: "code",
scope: options.scope || []
}
}
this.token = {
host: "foursquare.com",
path: "/oauth2/access_token",
query: {
client_id: options.id,
client_secret: options.secret,
grant_type: "authorization_code"
}
}
this.user = {
host: "api.foursquare.com",
path: "/v2/users/self",
tokenKey: "oauth_token",
query: {
v: "20111116"
}
}
this.on("request", this.onRequest.bind(this))
OAuth2.call(this, options)
}
util.inherits(Foursquare, OAuth2)
Foursquare.prototype.getId = function(data) {
return data.response.user.id
}
module.exports = Foursquare
|
YUI.add("gallery-datasource-async-function",function(e,t){"use strict";function n(){n.superclass.constructor.apply(this,arguments)}n.NAME="asyncFunctionDataSource",n.ATTRS={source:{validator:e.Lang.isFunction}},e.extend(n,e.DataSource.Local,{_defRequestFn:function(t){function i(e,t){e?r.error=e:t.data&&t.meta?(r.data=t.data,r.meta=t.meta):r.data=t,this.fire("data",r)}var n=this.get("source"),r=t.details[0];if(n)try{n.call(this,e.bind(i,this),t.request,this,t)}catch(s){r.error=s,this.fire("data",r)}else r.error=new Error("Function was not configured for AsyncFunctionDataSource"),this.fire("data",r);return t.tId}}),e.DataSource.AsyncFunction=n},"gallery-2013.10.24-18-05",{requires:["datasource-local"]});
|
/*global window, $, jQuery*/
/**
* Note: This script is a modified version of
* apps/navigation/js/tree-drag-drop/tree-drag-drop.js
*/
if (typeof String.prototype.trim !== 'function') {
String.prototype.trim = function () {
"use strict";
return this.replace(/^\s+|\s+$/g, '');
};
}
(function ($, undef) {
"use strict";
$.treeDragDrop = {
defaults: {
selectedClass: "tdd-selected",
collapsedClass: "tdd-collapsed",
expandedClass: "tdd-expanded",
beforeClass: "tdd-before",
afterClass: "tdd-after",
cursorGrabbingUrl: null,
inFolderThreshhold: 100,
cursorAt: {left: 10, top: -40},
dragContainer: $('<div class="tdd-dragContainer" />'),
marker: $('<div />'),
attributes: ["id", "class"],
getUrl: null,
updateUrl: null
}
};
// helpers
function debug(txt) {
if (window.console && window.console.log) {
window.console.log(txt);
}
}
function getContext(el) {
return $('.treeDragDrop').first ();
}
function getOptions(el) {
return $('.treeDragDrop').first ().data ("options");
}
function serializeTree(el) {
var tool, tools, obj, data = [];
el.find('.section').each(function (index, node) {
obj = {};
tools = [];
obj.name = node.getAttribute('data-section');
$(node).find('.tool').each(function (index, subnode) {
tool = {};
tool.name = subnode.getAttribute('data-name');
tool.handler = subnode.getAttribute('data-handler');
tools.push(tool);
});
obj.tools = tools;
data.push(obj);
});
return data;
}
function sendTree(data, updateUrl) {
if (updateUrl !== null) {
$.post(updateUrl, {
data: serializeTree(data),
autofill: data.find('.special').length
}, function (res) {
//debug (res);
//TODO: error handling
return true;
});
}
}
// handlers
$.treeDragDrop.handlers = {
handleDraggableStart: function (e, o) {
var options = getOptions($(e.target));
$(e.target).addClass(getOptions($(e.target)).selectedClass);
document.onmousemove = function () {
return false;
};
$("body").css("cursor", "url(" + options.cursorGrabbingUrl + ") , move").addClass("cursorGrabbing");
},
handleDraggableDrag: function (e, o) {
},
handleDraggableStop: function (e, o) {
var ctx = getContext($(e.target)),
options = getOptions($(e.target)),
tree = $(".tdd-tree", ctx);
// remove the mousemove Listener
$("li, .tdd-tree", ctx).unbind("mousemove");
// remove sections from trashbin
$(".tdd-trashbin .section:not(.special)").remove();
// build the array and post the ajax
sendTree(tree, options.updateUrl);
$("body").removeClass("cursorGrabbing").css("cursor", "auto");
},
handleDroppableOut: function (e, o) {
$(e.target).unbind("mousemove");
},
handleDroppableOver: function (e, o) {
var options = getOptions($(e.target)),
selectedClass = options.selectedClass,
beforeClass = options.beforeClass,
afterClass = options.afterClass,
draggable = $(o.draggable),
dropable = $(e.target),
marker = options.marker;
marker.show ();
if (dropable.is('li')) {
// bind MouseMove to the item to check if the draggable should be appended or placed before or after the item
dropable.bind('mousemove', function (mme) {
var target = $(mme.target),
x = mme.pageX - $(mme.target).offset().left,
y = mme.pageY - $(mme.target).offset().top,
threshhold = options.inFolderThreshhold;
// threshhold for apending or placing before/ater
// will grow according to the deepness of nesting
if (target.find('ul').length !== 0) {
threshhold = Math.min(options.inFolderThreshhold * (target.find('ul').length + 1), target.width() * 0.75);
}
marker.removeClass(beforeClass, afterClass);
if (target.parents('.tdd-trashbin').length !== 0) {
target.parents('.tdd-trashbin').append(marker);
} else if (target.hasClass('section') && draggable.hasClass('tool')) {
marker.addClass(afterClass);
if (target.children('.tools').length === 0) {
target.append('<ul class="tools"></ul>');
}
target.children('.tools').prepend(marker);
} else if (draggable.hasClass('special')) {
marker.addClass(beforeClass);
target.parents('.tdd-tree').append(marker);
} else if (draggable.hasClass('section') && target.hasClass('special')) {
marker.addClass(beforeClass);
target.before(marker);
} else {
if (target.parent().hasClass('tools') && !draggable.hasClass('tool')) return;
if (target.parent().hasClass('tdd-tree') && draggable.hasClass('tool')) return;
// append to item
if (y < target.height() / 2) {
marker.addClass(beforeClass);
target.before(marker);
// place after item
} else {
marker.addClass(afterClass);
target.after(marker);
}
}
});
// if tree is empty items may be put in the ul
} else if (dropable.hasClass("tdd-tree") && draggable.hasClass('section')) {
marker.removeClass(beforeClass, afterClass);
marker.addClass(beforeClass);
dropable.append(marker);
if (dropable.children('.special').length !== 0) dropable.append(dropable.children('.special'));
} else if (dropable.hasClass("tdd-trashbin")) {
dropable.append(marker);
}
},
handleDroppableDrop: function (e, o) {
var draggable = $(o.draggable),
dropable = $(e.target),
marker = $.treeDragDrop.defaults.marker,
ctx = draggable.data("tddCtx");
if (!ctx) return;
var options = ctx.data("options");
// remove selection
draggable.removeClass(options.selectedClass);
// if its the trashbin put them all next to each other (no nesting)
if (dropable.parents(".tdd-trashbin").length !== 0 || dropable.hasClass("tdd-trashbin")) {
$(".tdd-trashbin").append(draggable);
$("li", draggable).each(function (index, value) {
$(".tdd-trashbin").append(value);
});
} else if (draggable.hasClass('tool') && dropable.hasClass('tdd-tree')) {
return;
// put the item directly in the tree ul if it contains no other element
} else if (dropable.hasClass("tdd-tree") && $(".tdd-tree").children().length === 0) {
$(".tdd-tree").append(draggable);
// otherwise put it before the marker, which will be detached asap
} else {
marker.before(draggable);
}
marker.hide();
//clean up empty uls if its not the tree or trashbin
$("ul", ctx).not(".tdd-trashbin, .tdd-tree").each(function () {
if ($(this).children().length === 0) {
$(this).remove();
}
});
},
handleOpenModal: function() {
var title = '', html = '<form id="treeModal" \
onsubmit="if($.treeDragDrop.handlers.handleAddCategory()) { $.close_dialog (); } return false;">\
<span class="caption error"></span>\
<label for="add-category">Category Name<br><input type="text" id="add-category" style="width: 95%" /></label><br><br>\
<input type="submit" value="Add" style="float:right" />\
</form>';
$.open_dialog('New Catagory',html,{width:250,height:200});
$('#treeModal #add-category')[0].focus();
},
handleAddCategory: function () {
var modal = $('#treeModal'), name = modal.find('input#add-category');
if (name.val() == '') {
modal.find('.error').text('Category name must be specified.');
return false;
}
var id = 'cat_'+ name.val().toLowerCase().replace(/ /g,'_');
if ($('.treeDragDrop #'+ id).length) {
modal.find('.error').text('Category name already in use.');
return false;
}
modal.find('.error').text('');
var node = document.createElement("LI");
node.id = id;
node.setAttribute('data-section', name.val());
node.setAttribute('class', 'section');
node.innerHTML = '<b>'+ name.val() +'</b><ul class="tools"></ul>';
$(".tree .tdd-tree").append(node);
if (node.previousElementSibling && /special/.test(node.previousElementSibling.className)) {
$(node.previousElementSibling).before(node);
}
$(node).data('tddCtx',$(node).closest('.treeDragDrop'));
name.val("");
$('.treeDragDrop').treeDragDrop({ // rebind drag/drop for new node.
updateUrl: "/admin/api/toolbar",
cursorGrabbingUrl: (window.is_msie) ? "/apps/admin/js/tree-drag-drop/css/closedhand.cur" : "/apps/admin/js/tree-drag-drop/css/cursorGrabbing.png"
}, '#'+ id);
return true
}
};
// the Prototype
$.fn.treeDragDrop = function (options, node) {
//extend the global default with the options for the element
options = $.extend({}, $.treeDragDrop.defaults, options);
return this.each(function () {
var ctx = $(this),
data = ctx.data('treeDragDrop');
node = (node)?node:"li";
// init the element(s)
if (!data || node !== "li") {
$(node, ctx).draggable({
addClasses: false,
cursorAt: $.treeDragDrop.defaults.cursorAt,
helper: "clone",
appendTo: "body",
opacity: 0.2,
delay: 10,
start: $.treeDragDrop.handlers.handleDraggableStart,
stop: $.treeDragDrop.handlers.handleDraggableStop
}).droppable({
addClasses: false,
greedy: false,
tolerance: "pointer",
drop: $.treeDragDrop.handlers.handleDroppableDrop,
over: $.treeDragDrop.handlers.handleDroppableOver,
out: $.treeDragDrop.handlers.handleDroppableOut
}).bind("onselectstart", function () {
return false;
}).attr("unselectable", "on").data("tddCtx", ctx);
}
// init the tree(s)
if (!data) {
$(".tdd-tree, .tdd-trashbin", ctx).droppable({
addClasses: false,
tolerance: "pointer",
drop: $.treeDragDrop.handlers.handleDroppableDrop,
over: $.treeDragDrop.handlers.handleDroppableOver,
out: $.treeDragDrop.handlers.handleDroppableOut
}).bind("onselectstart", function () {return false; }).attr("unselectable", "on");
$.treeDragDrop.defaults.marker.bind("mousemove", function () { return false; });
$.treeDragDrop.defaults.marker.bind("mouseover", function () { return false; });
ctx.data('options', options);
ctx.data('treeDragDrop', {inited: true});
}
});
};
}(jQuery));
// Cheap test for MSIE
window.is_msie = (window.navigator.userAgent.indexOf ('MSIE ') > -1);
$('.treeDragDrop').treeDragDrop({
updateUrl: "/admin/api/toolbar",
cursorGrabbingUrl: (window.is_msie) ? "/apps/admin/js/tree-drag-drop/css/closedhand.cur" : "/apps/admin/js/tree-drag-drop/css/cursorGrabbing.png"
});
|
/**
* Module dependencies.
*/
var utils = require('./utils')
, merge = utils.merge
, Promise = require('./promise')
, Document = require('./document')
, Types = require('./schema/index')
, inGroupsOf = utils.inGroupsOf
, tick = utils.tick
, QueryStream = require('./querystream')
/**
* Query constructor
*
* @api private
*/
function Query (criteria, options) {
options = this.options = options || {};
this.safe = options.safe
// normalize population options
var pop = this.options.populate;
this.options.populate = {};
if (pop && Array.isArray(pop)) {
for (var i = 0, l = pop.length; i < l; i++) {
this.options.populate[pop[i]] = {};
}
}
this._conditions = {};
if (criteria) this.find(criteria);
}
/**
* Binds this query to a model.
* @param {Function} param
* @return {Query}
* @api public
*/
Query.prototype.bind = function bind (model, op, updateArg) {
this.model = model;
this.op = op;
if (op === 'update') this._updateArg = updateArg;
return this;
};
/**
* Executes the query returning a promise.
*
* Examples:
* query.run();
* query.run(callback);
* query.run('update');
* query.run('find', callback);
*
* @param {String|Function} op (optional)
* @param {Function} callback (optional)
* @return {Promise}
* @api public
*/
Query.prototype.exec = function (op, callback) {
var promise = new Promise();
switch (typeof op) {
case 'function':
callback = op;
op = null;
break;
case 'string':
this.op = op;
break;
}
if (callback) promise.addBack(callback);
if (!this.op) {
promise.complete();
return promise;
}
if ('update' == this.op) {
this.update(this._updateArg, promise.resolve.bind(promise));
return promise;
}
if ('distinct' == this.op) {
this.distinct(this._distinctArg, promise.resolve.bind(promise));
return promise;
}
this[this.op](promise.resolve.bind(promise));
return promise;
};
/**
* Finds documents.
*
* @param {Object} criteria
* @param {Function} callback
* @api public
*/
Query.prototype.find = function (criteria, callback) {
this.op = 'find';
if ('function' === typeof criteria) {
callback = criteria;
criteria = {};
} else if (criteria instanceof Query) {
// TODO Merge options, too
merge(this._conditions, criteria._conditions);
} else if (criteria instanceof Document) {
merge(this._conditions, criteria.toObject());
} else if (criteria && 'Object' === criteria.constructor.name) {
merge(this._conditions, criteria);
}
if (!callback) return this;
return this.execFind(callback);
};
/**
* Casts obj, or if obj is not present, then this._conditions,
* based on the model's schema.
*
* @param {Function} model
* @param {Object} obj (optional)
* @api public
*/
Query.prototype.cast = function (model, obj) {
obj || (obj= this._conditions);
var schema = model.schema
, paths = Object.keys(obj)
, i = paths.length
, any$conditionals
, schematype
, nested
, path
, type
, val;
while (i--) {
path = paths[i];
val = obj[path];
if ('$or' === path || '$nor' === path) {
var k = val.length
, orComponentQuery;
while (k--) {
orComponentQuery = new Query(val[k]);
orComponentQuery.cast(model);
val[k] = orComponentQuery._conditions;
}
} else if (path === '$where') {
type = typeof val;
if ('string' !== type && 'function' !== type) {
throw new Error("Must have a string or function for $where");
}
if ('function' === type) {
obj[path] = val.toString();
}
continue;
} else {
if (!schema) {
// no casting for Mixed types
continue;
}
schematype = schema.path(path);
if (!schematype) {
// Handle potential embedded array queries
var split = path.split('.')
, j = split.length
, pathFirstHalf
, pathLastHalf
, remainingConds
, castingQuery;
// Find the part of the var path that is a path of the Schema
while (j--) {
pathFirstHalf = split.slice(0, j).join('.');
schematype = schema.path(pathFirstHalf);
if (schematype) break;
}
// If a substring of the input path resolves to an actual real path...
if (schematype) {
// Apply the casting; similar code for $elemMatch in schema/array.js
if (schematype.caster && schematype.caster.schema) {
remainingConds = {};
pathLastHalf = split.slice(j).join('.');
remainingConds[pathLastHalf] = val;
castingQuery = new Query(remainingConds);
castingQuery.cast(schematype.caster);
obj[path] = castingQuery._conditions[pathLastHalf];
} else {
obj[path] = val;
}
}
} else if (val === null || val === undefined) {
continue;
} else if ('Object' === val.constructor.name) {
any$conditionals = Object.keys(val).some(function (k) {
return k.charAt(0) === '$' && k !== '$id' && k !== '$ref';
});
if (!any$conditionals) {
obj[path] = schematype.castForQuery(val);
} else {
var ks = Object.keys(val)
, k = ks.length
, $cond;
while (k--) {
$cond = ks[k];
nested = val[$cond];
if ('$exists' === $cond) {
if ('boolean' !== typeof nested) {
throw new Error("$exists parameter must be Boolean");
}
continue;
}
if ('$type' === $cond) {
if ('number' !== typeof nested) {
throw new Error("$type parameter must be Number");
}
continue;
}
if ('$not' === $cond) {
this.cast(model, nested);
} else {
val[$cond] = schematype.castForQuery($cond, nested);
}
}
}
} else {
obj[path] = schematype.castForQuery(val);
}
}
}
};
/**
* Returns default options.
* @api private
*/
Query.prototype._optionsForExec = function (model) {
var options = utils.clone(this.options, { retainKeyOrder: true });
delete options.populate;
if (! ('safe' in options)) options.safe = model.options.safe;
return options;
};
/**
* Applies schematype selected options to this query.
* @api private
*/
Query.prototype._applyPaths = function applyPaths () {
// determine if query is selecting or excluding fields
var fields = this._fields
, exclude
, keys
, ki
if (fields) {
keys = Object.keys(fields);
ki = keys.length;
while (ki--) {
exclude = 0 === fields[keys[ki]];
break;
}
}
// if selecting, apply default schematype select:true fields
// if excluding, apply schematype select:false fields
// if not specified, apply both
var selected = []
, excluded = []
this.model.schema.eachPath(function (path, type) {
if ('boolean' != typeof type.selected) return;
;(type.selected ? selected : excluded).push(path);
});
switch (exclude) {
case true:
this.exclude(excluded);
break;
case false:
this.select(selected);
break;
case undefined:
excluded.length && this.exclude(excluded);
selected.length && this.select(selected);
break;
}
}
/**
* Sometimes you need to query for things in mongodb using a JavaScript
* expression. You can do so via find({$where: javascript}), or you can
* use the mongoose shortcut method $where via a Query chain or from
* your mongoose Model.
*
* @param {String|Function} js is a javascript string or anonymous function
* @return {Query}
* @api public
*/
Query.prototype.$where = function (js) {
this._conditions['$where'] = js;
return this;
};
/**
* `where` enables a very nice sugary api for doing your queries.
* For example, instead of writing:
*
* User.find({age: {$gte: 21, $lte: 65}}, callback);
*
* we can instead write more readably:
*
* User.where('age').gte(21).lte(65);
*
* Moreover, you can also chain a bunch of these together like:
*
* User
* .where('age').gte(21).lte(65)
* .where('name', /^b/i) // All names that begin where b or B
* .where('friends').slice(10);
*
* @param {String} path
* @param {Object} val (optional)
* @return {Query}
* @api public
*/
Query.prototype.where = function (path, val) {
if (2 === arguments.length) {
this._conditions[path] = val;
}
this._currPath = path;
return this;
};
/**
* `equals` sugar.
*
* User.where('age').equals(49);
*
* Same as
*
* User.where('age', 49);
*
* @param {object} val
* @return {Query}
* @api public
*/
Query.prototype.equals = function equals (val) {
var path = this._currPath;
if (!path) throw new Error('equals() must be used after where()');
this._conditions[path] = val;
return this;
}
/**
* or
*/
Query.prototype.or = function or (array) {
var or = this._conditions.$or || (this._conditions.$or = []);
if (!Array.isArray(array)) array = [array];
or.push.apply(or, array);
return this;
}
/**
* nor
*/
Query.prototype.nor = function nor (array) {
var nor = this._conditions.$nor || (this._conditions.$nor = []);
if (!Array.isArray(array)) array = [array];
nor.push.apply(nor, array);
return this;
}
/**
* gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
*
* Can be used on Numbers or Dates.
*
* Thing.where('type').nin(array)
*/
'gt gte lt lte ne in nin all regex size maxDistance'.split(' ').forEach(function ($conditional) {
Query.prototype[$conditional] = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$' + $conditional] = val;
return this;
};
// deprecationed
Query.prototype['$' + $conditional] = utils.dep('Query#$'+ $conditional, 'Query#' + $conditional, Query.prototype[$conditional]);
});
/**
* mod, near
*/
;['mod', 'near'].forEach( function ($conditional) {
Query.prototype[$conditional] = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath
} else if (arguments.length === 2 && !Array.isArray(val)) {
val = utils.args(arguments);
path = this._currPath;
} else if (arguments.length === 3) {
val = utils.args(arguments, 1);
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$' + $conditional] = val;
return this;
};
});
/**
* exists
*/
Query.prototype.exists = function (path, val) {
if (arguments.length === 0) {
path = this._currPath
val = true;
} else if (arguments.length === 1) {
if ('boolean' === typeof path) {
val = path;
path = this._currPath;
} else {
val = true;
}
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$exists'] = val;
return this;
};
/**
* elemMatch
*/
Query.prototype.elemMatch = function (path, criteria) {
var block;
if ('Object' === path.constructor.name) {
criteria = path;
path = this._currPath;
} else if ('function' === typeof path) {
block = path;
path = this._currPath;
} else if ('Object' === criteria.constructor.name) {
} else if ('function' === typeof criteria) {
block = criteria;
} else {
throw new Error("Argument error");
}
var conds = this._conditions[path] || (this._conditions[path] = {});
if (block) {
criteria = new Query();
block(criteria);
conds['$elemMatch'] = criteria._conditions;
} else {
conds['$elemMatch'] = criteria;
}
return this;
};
/**
* Spatial queries
*/
Object.defineProperty(Query.prototype, 'within', {
get: function () { return this }
});
Query.prototype.box = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath;
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$within'] = { '$box': [val.ll, val.ur] };
return this;
};
Query.prototype.center = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath;
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$within'] = { '$center': [val.center, val.radius] };
return this;
};
Query.prototype.centerSphere = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath;
}
var conds = this._conditions[path] || (this._conditions[path] = {});
conds['$within'] = { '$centerSphere': [val.center, val.radius] };
return this;
};
/**
* select
*
* Chainable method for specifying which fields
* to include or exclude from the document that is
* returned from MongoDB.
*
* Examples:
* query.fields({a: 1, b: 1, c: 1, _id: 0});
* query.fields('a b c');
*
* @param {Object}
*/
Query.prototype.select = function () {
var arg0 = arguments[0];
if (!arg0) return this;
if ('Object' === arg0.constructor.name || Array.isArray(arg0)) {
this._applyFields(arg0);
} else if (arguments.length === 1 && typeof arg0 === 'string') {
this._applyFields({only: arg0});
} else {
this._applyFields({only: this._parseOnlyExcludeFields.apply(this, arguments)});
}
return this;
};
/**
* slice()
*/
Query.prototype.slice = function (path, val) {
if (arguments.length === 1) {
val = path;
path = this._currPath
} else if (arguments.length === 2) {
if ('number' === typeof path) {
val = [path, val];
path = this._currPath;
}
} else if (arguments.length === 3) {
val = utils.args(arguments, 1);
}
var myFields = this._fields || (this._fields = {});
myFields[path] = { '$slice': val };
return this;
};
/**
* Private method for interpreting the different ways
* you can pass in fields to both Query.prototype.only
* and Query.prototype.exclude.
*
* @param {String|Array|Object} fields
* @api private
*/
Query.prototype._parseOnlyExcludeFields = function (fields) {
if (1 === arguments.length && 'string' === typeof fields) {
fields = fields.split(' ');
} else if (Array.isArray(fields)) {
// do nothing
} else {
fields = utils.args(arguments);
}
return fields;
};
/**
* Private method for interpreting and applying the different
* ways you can specify which fields you want to include
* or exclude.
*
* Example 1: Include fields 'a', 'b', and 'c' via an Array
* query.fields('a', 'b', 'c');
* query.fields(['a', 'b', 'c']);
*
* Example 2: Include fields via 'only' shortcut
* query.only('a b c');
*
* Example 3: Exclude fields via 'exclude' shortcut
* query.exclude('a b c');
*
* Example 4: Include fields via MongoDB's native format
* query.fields({a: 1, b: 1, c: 1})
*
* Example 5: Exclude fields via MongoDB's native format
* query.fields({a: 0, b: 0, c: 0});
*
* @param {Object|Array} the formatted collection of fields to
* include and/or exclude
* @api private
*/
Query.prototype._applyFields = function (fields) {
var $fields
, pathList;
if (Array.isArray(fields)) {
$fields = fields.reduce(function ($fields, field) {
$fields[field] = 1;
return $fields;
}, {});
} else if (pathList = fields.only || fields.exclude) {
$fields =
this._parseOnlyExcludeFields(pathList)
.reduce(function ($fields, field) {
$fields[field] = fields.only ? 1: 0;
return $fields;
}, {});
} else if ('Object' === fields.constructor.name) {
$fields = fields;
} else {
throw new Error("fields is invalid");
}
var myFields = this._fields || (this._fields = {});
for (var k in $fields) myFields[k] = $fields[k];
};
/**
* sort
*
* Sets the sort
*
* Examples:
* query.sort('test', 1)
* query.sort('field', -1)
* query.sort('field', -1, 'test', 1)
*
* @api public
*/
Query.prototype.sort = function () {
var sort = this.options.sort || (this.options.sort = []);
inGroupsOf(2, arguments, function (field, value) {
sort.push([field, value]);
});
return this;
};
;['limit', 'skip', 'maxscan', 'snapshot', 'batchSize', 'comment'].forEach( function (method) {
Query.prototype[method] = function (v) {
this.options[method] = v;
return this;
};
});
/**
* hint
*
* Sets query hints.
*
* Examples:
* new Query().hint({ indexA: 1, indexB: -1})
* new Query().hint("indexA", 1, "indexB", -1)
*
* @param {Object|String} v
* @param {Int} [multi]
* @return {Query}
* @api public
*/
Query.prototype.hint = function (v, multi) {
var hint = this.options.hint || (this.options.hint = {})
, k
if (multi) {
inGroupsOf(2, arguments, function (field, val) {
hint[field] = val;
});
} else if ('Object' === v.constructor.name) {
// must keep object keys in order so don't use Object.keys()
for (k in v) {
hint[k] = v[k];
}
}
return this;
};
/**
* slaveOk
*
* Sets slaveOk option.
*
* new Query().slaveOk() <== true
* new Query().slaveOk(true)
* new Query().slaveOk(false)
*
* @param {Boolean} v (defaults to true)
* @api public
*/
Query.prototype.slaveOk = function (v) {
this.options.slaveOk = arguments.length ? !!v : true;
return this;
};
/**
* tailable
*
* Sets tailable option.
*
* new Query().tailable() <== true
* new Query().tailable(true)
* new Query().tailable(false)
*
* @param {Boolean} v (defaults to true)
* @api public
*/
Query.prototype.tailable = function (v) {
this.options.tailable = arguments.length ? !!v : true;
return this;
};
/**
* execFind
*
* @api private
*/
Query.prototype.execFind = function (callback) {
var model = this.model
, promise = new Promise(callback);
try {
this.cast(model);
} catch (err) {
return promise.error(err);
}
// apply default schematype path selections
this._applyPaths();
var self = this
, castQuery = this._conditions
, options = this._optionsForExec(model)
var fields = utils.clone(options.fields = this._fields);
model.collection.find(castQuery, options, function (err, cursor) {
if (err) return promise.error(err);
cursor.toArray(tick(cb));
});
function cb (err, docs) {
if (err) return promise.error(err);
var arr = []
, count = docs.length;
if (!count) return promise.complete([]);
for (var i = 0, l = docs.length; i < l; i++) {
arr[i] = new model(undefined, fields);
// skip _id for pre-init hooks
delete arr[i]._doc._id;
arr[i].init(docs[i], self, function (err) {
if (err) return promise.error(err);
--count || promise.complete(arr);
});
}
}
return this;
};
/**
* findOne
*
* Casts the query, sends the findOne command to mongodb.
* Upon receiving the document, we initialize a mongoose
* document based on the returned document from mongodb,
* and then we invoke a callback on our mongoose document.
*
* @param {Function} callback function (err, found)
* @api public
*/
Query.prototype.findOne = function (callback) {
this.op = 'findOne';
if (!callback) return this;
var model = this.model;
var promise = new Promise(callback);
try {
this.cast(model);
} catch (err) {
promise.error(err);
return this;
}
// apply default schematype path selections
this._applyPaths();
var self = this
, castQuery = this._conditions
, options = this._optionsForExec(model)
var fields = utils.clone(options.fields = this._fields);
model.collection.findOne(castQuery, options, tick(function (err, doc) {
if (err) return promise.error(err);
if (!doc) return promise.complete(null);
var casted = new model(undefined, fields);
// skip _id for pre-init hooks
delete casted._doc._id;
casted.init(doc, self, function (err) {
if (err) return promise.error(err);
promise.complete(casted);
});
}));
return this;
};
/**
* count
*
* Casts this._conditions and sends a count
* command to mongodb. Invokes a callback upon
* receiving results
*
* @param {Function} callback fn(err, cardinality)
* @api public
*/
Query.prototype.count = function (callback) {
this.op = 'count';
var model = this.model;
try {
this.cast(model);
} catch (err) {
return callback(err);
}
var castQuery = this._conditions;
model.collection.count(castQuery, tick(callback));
return this;
};
/**
* distinct
*
* Casts this._conditions and sends a distinct
* command to mongodb. Invokes a callback upon
* receiving results
*
* @param {Function} callback fn(err, cardinality)
* @api public
*/
Query.prototype.distinct = function (field, callback) {
this.op = 'distinct';
var model = this.model;
try {
this.cast(model);
} catch (err) {
return callback(err);
}
var castQuery = this._conditions;
model.collection.distinct(field, castQuery, tick(callback));
return this;
};
/**
* These operators require casting docs
* to real Documents for Update operations.
* @private
*/
var castOps = {
$push: 1
, $pushAll: 1
, $addToSet: 1
, $set: 1
};
/**
* These operators should be cast to numbers instead
* of their path schema type.
* @private
*/
var numberOps = {
$pop: 1
, $unset: 1
, $inc: 1
}
/**
* update
*
* Casts the `doc` according to the model Schema and
* sends an update command to MongoDB.
*
* _All paths passed that are not $atomic operations
* will become $set ops so we retain backwards compatibility._
*
* Example:
* `Model.update({..}, { title: 'remove words' }, ...)`
*
* becomes
*
* `Model.update({..}, { $set: { title: 'remove words' }}, ...)`
*
*
* _Passing an empty object `{}` as the doc will result
* in a no-op. The update operation will be ignored and the
* callback executed without sending the command to MongoDB so as
* to prevent accidently overwritting the collection._
*
* @param {Object} doc - the update
* @param {Function} callback - fn(err)
* @api public
*/
Query.prototype.update = function update (doc, callback) {
this.op = 'update';
this._updateArg = doc;
var model = this.model
, options = this._optionsForExec(model)
, fn = 'function' == typeof callback
, castQuery
, castDoc
try {
this.cast(model);
castQuery = this._conditions;
} catch (err) {
if (fn) return callback(err);
throw err;
}
try {
castDoc = this._castUpdate(doc);
} catch (err) {
if (fn) return callback(err);
throw err;
}
if (!fn) {
delete options.safe;
}
if (castDoc) {
model.collection.update(castQuery, castDoc, options, tick(callback));
} else {
process.nextTick(function () {
callback(null, 0);
});
}
return this;
};
/**
* Casts obj for an update command.
*
* @param {Object} obj
* @return {Object} obj after casting its values
* @api private
*/
Query.prototype._castUpdate = function _castUpdate (obj) {
var ops = Object.keys(obj)
, i = ops.length
, ret = {}
, hasKeys
, val
while (i--) {
var op = ops[i];
if ('$' !== op[0]) {
// fix up $set sugar
if (!ret.$set) {
if (obj.$set) {
ret.$set = obj.$set;
} else {
ret.$set = {};
}
}
ret.$set[op] = obj[op];
ops.splice(i, 1);
if (!~ops.indexOf('$set')) ops.push('$set');
} else if ('$set' === op) {
if (!ret.$set) {
ret[op] = obj[op];
}
} else {
ret[op] = obj[op];
}
}
// cast each value
i = ops.length;
while (i--) {
op = ops[i];
val = ret[op];
if ('Object' === val.constructor.name) {
hasKeys |= this._walkUpdatePath(val, op);
} else {
var msg = 'Invalid atomic update value for ' + op + '. '
+ 'Expected an object, received ' + typeof val;
throw new Error(msg);
}
}
return hasKeys && ret;
}
/**
* Walk each path of obj and cast its values
* according to its schema.
*
* @param {Object} obj - part of a query
* @param {String} op - the atomic operator ($pull, $set, etc)
* @param {String} pref - path prefix (internal only)
* @return {Bool} true if this path has keys to update
* @private
*/
Query.prototype._walkUpdatePath = function _walkUpdatePath (obj, op, pref) {
var strict = this.model.schema.options.strict
, prefix = pref ? pref + '.' : ''
, keys = Object.keys(obj)
, i = keys.length
, hasKeys = false
, schema
, key
, val
while (i--) {
key = keys[i];
val = obj[key];
if (val && 'Object' === val.constructor.name) {
// watch for embedded doc schemas
schema = this._getSchema(prefix + key);
if (schema && schema.caster && op in castOps) {
// embedded doc schema
if (strict && !schema) {
// path is not in our strict schema. do not include
delete obj[key];
} else {
hasKeys = true;
if ('$each' in val) {
obj[key] = {
$each: this._castUpdateVal(schema, val.$each, op)
}
} else {
obj[key] = this._castUpdateVal(schema, val, op);
}
}
} else {
hasKeys |= this._walkUpdatePath(val, op, prefix + key);
}
} else {
schema = '$each' === key
? this._getSchema(pref)
: this._getSchema(prefix + key);
var skip = strict &&
!schema &&
!/real|nested/.test(this.model.schema.pathType(prefix + key));
if (skip) {
delete obj[key];
} else {
hasKeys = true;
obj[key] = this._castUpdateVal(schema, val, op, key);
}
}
}
return hasKeys;
}
/**
* Casts `val` according to `schema` and atomic `op`.
*
* @param {Schema} schema
* @param {Object} val
* @param {String} op - the atomic operator ($pull, $set, etc)
* @param {String} [$conditional]
* @private
*/
Query.prototype._castUpdateVal = function _castUpdateVal (schema, val, op, $conditional) {
if (!schema) {
// non-existing schema path
return op in numberOps
? Number(val)
: val
}
if (schema.caster && op in castOps &&
('Object' === val.constructor.name || Array.isArray(val))) {
// Cast values for ops that add data to MongoDB.
// Ensures embedded documents get ObjectIds etc.
var tmp = schema.cast(val);
if (Array.isArray(val)) {
val = tmp;
} else {
val = tmp[0];
}
}
if (op in numberOps) return Number(val);
if (/^\$/.test($conditional)) return schema.castForQuery($conditional, val);
return schema.castForQuery(val)
}
/**
* Finds the schema for `path`. This is different than
* calling `schema.path` as it also resolves paths with
* positional selectors (something.$.another.$.path).
*
* @param {String} path
* @private
*/
Query.prototype._getSchema = function _getSchema (path) {
var schema = this.model.schema
, pathschema = schema.path(path);
if (pathschema)
return pathschema;
// look for arrays
return (function search (parts, schema) {
var p = parts.length + 1
, foundschema
, trypath
while (p--) {
trypath = parts.slice(0, p).join('.');
foundschema = schema.path(trypath);
if (foundschema) {
if (foundschema.caster) {
// array of Mixed?
if (foundschema.caster instanceof Types.Mixed) {
return foundschema.caster;
}
// Now that we found the array, we need to check if there
// are remaining document paths to look up for casting.
// Also we need to handle array.$.path since schema.path
// doesn't work for that.
if (p !== parts.length) {
if ('$' === parts[p]) {
// comments.$.comments.$.title
return search(parts.slice(p+1), foundschema.schema);
} else {
// this is the last path of the selector
return search(parts.slice(p), foundschema.schema);
}
}
}
return foundschema;
}
}
})(path.split('.'), schema)
}
/**
* remove
*
* Casts the query, sends the remove command to
* mongodb where the query contents, and then
* invokes a callback upon receiving the command
* result.
*
* @param {Function} callback
* @api public
*/
Query.prototype.remove = function (callback) {
this.op = 'remove';
var model = this.model
, options = this._optionsForExec(model)
, cb = 'function' == typeof callback
try {
this.cast(model);
} catch (err) {
if (cb) return callback(err);
throw err;
}
if (!cb) {
delete options.safe;
}
var castQuery = this._conditions;
model.collection.remove(castQuery, options, tick(callback));
return this;
};
/**
* populate
*
* Sets population options.
* @api public
*/
Query.prototype.populate = function (path, fields, conditions, options) {
// The order of fields/conditions args is opposite Model.find but
// necessary to keep backward compatibility (fields could be
// an array, string, or object literal).
this.options.populate[path] =
new PopulateOptions(fields, conditions, options);
return this;
};
/**
* Populate options constructor
* @private
*/
function PopulateOptions (fields, conditions, options) {
this.conditions = conditions;
this.fields = fields;
this.options = options;
}
// make it compatible with utils.clone
PopulateOptions.prototype.constructor = Object;
/**
* stream
*
* Returns a stream interface
*
* Example:
* Thing.find({ name: /^hello/ }).stream().pipe(res)
*
* @api public
*/
Query.prototype.stream = function stream () {
return new QueryStream(this);
}
/**
* @private
* @TODO
*/
Query.prototype.explain = function () {
throw new Error("Unimplemented");
};
/**
* Deprecated methods.
*/
Query.prototype.$or = utils.dep('Query#$or', 'Query#or', Query.prototype.or);
Query.prototype.$nor =utils.dep('Query#$nor', 'Query#nor', Query.prototype.nor);
Query.prototype.run = utils.dep('Query#run', 'Query#exec', Query.prototype.exec);
Query.prototype.$mod = utils.dep('Query#$mod', 'Query#mod', Query.prototype.mod);
Query.prototype.$box = utils.dep('Query#$box', 'Query#box', Query.prototype.box);
Query.prototype.$near = utils.dep('Query#$near', 'Query#near', Query.prototype.near);
Query.prototype.$slice = utils.dep('Query#$slice', 'Query#slice', Query.prototype.slice);
Query.prototype.notEqualTo = utils.dep('Query#notEqualTo', 'Query#ne', Query.prototype.ne);
Query.prototype.fields = utils.dep('Query#fields', 'Query#select', Query.prototype.select);
Query.prototype.$exists =utils.dep('Query#$exists', 'Query#exists', Query.prototype.exists);
Query.prototype.$center = utils.dep('Query#$center', 'Query#center', Query.prototype.center);
Query.prototype.$elemMatch =utils.dep('Query#$elemMatch', 'Query#elemMatch', Query.prototype.elemMatch);
Query.prototype.$centerSphere = utils.dep('Query#$centerSphere', 'Query#centerSphere', Query.prototype.centerSphere);
/**
* asc
*
* Sorts ascending.
*
* query.asc('name', 'age');
*
* @deprecated
*/
function asc () {
var sort = this.options.sort || (this.options.sort = []);
for (var i = 0, l = arguments.length; i < l; i++) {
sort.push([arguments[i], 1]);
}
return this;
};
Query.prototype.asc = utils.dep('Query#asc', 'Query#sort', asc);
/**
* desc
*
* Sorts descending.
*
* query.desc('name', 'age');
*
* @deprecated
*/
function desc () {
var sort = this.options.sort || (this.options.sort = []);
for (var i = 0, l = arguments.length; i < l; i++) {
sort.push([arguments[i], -1]);
}
return this;
};
Query.prototype.desc = utils.dep('Query#desc', 'Query#sort', desc);
/**
* limit, skip, maxscan, snapshot, batchSize, comment
*
* Sets these associated options.
*
* query.comment('feed query');
*
* @deprecated
*/
'$within wherein $wherein'.split(' ').forEach(function (getter) {
var withinDep = utils.dep('Query#' + getter, 'Query#within')
Object.defineProperty(Query.prototype, getter, {
get: function () {
withinDep();
return this;
}
});
});
/**
* only
*
* Chainable method for adding the specified fields to the
* object of fields to only include.
*
* Examples:
* query.only('a b c');
* query.only('a', 'b', 'c');
* query.only(['a', 'b', 'c']);
*
* @param {String|Array} space separated list of fields OR
* an array of field names
* We can also take arguments as the "array" of field names
*
* @api public
* @deprecated
*/
function only (fields) {
fields = this._parseOnlyExcludeFields.apply(this, arguments);
this._applyFields({ only: fields });
return this;
};
Query.prototype.only = utils.dep('Query#only', 'Query#select', only);
/**
* exclude
*
* Chainable method for adding the specified fields to the
* object of fields to exclude.
*
* Examples:
* query.exclude('a b c');
* query.exclude('a', 'b', 'c');
* query.exclude(['a', 'b', 'c']);
*
* @param {String|Array} space separated list of fields OR
* an array of field names
* We can also take arguments as the "array" of field names
*
* @api public
* @deprecated
*/
function exclude (fields) {
fields = this._parseOnlyExcludeFields.apply(this, arguments);
this._applyFields({ exclude: fields });
return this;
};
Query.prototype.exclude = utils.dep('Query#exclude', 'Query#select', exclude);
/**
* each()
*
* Streaming cursors.
*
* The `callback` is called repeatedly for each document
* found in the collection as it's streamed. If an error
* occurs streaming stops.
*
* Example:
* query.each(function (err, user) {
* if (err) return res.end("aww, received an error. all done.");
* if (user) {
* res.write(user.name + '\n')
* } else {
* res.end("reached end of cursor. all done.");
* }
* });
*
* A third parameter may also be used in the callback which
* allows you to iterate the cursor manually.
*
* Example:
* query.each(function (err, user, next) {
* if (err) return res.end("aww, received an error. all done.");
* if (user) {
* res.write(user.name + '\n')
* doSomethingAsync(next);
* } else {
* res.end("reached end of cursor. all done.");
* }
* });
*
* @param {Function} callback
* @return {Query}
* @deprecated
* @api public
*/
function each (callback) {
var model = this.model
, options = this._optionsForExec(model)
, manual = 3 == callback.length
, self = this
try {
this.cast(model);
} catch (err) {
return callback(err);
}
var fields = utils.clone(options.fields = this._fields);
function complete (err, val) {
if (complete.ran) return;
complete.ran = true;
callback(err, val);
}
model.collection.find(this._conditions, options, function (err, cursor) {
if (err) return complete(err);
var ticks = 0;
next();
function next () {
// nextTick is necessary to avoid stack overflows when
// dealing with large result sets. yield occasionally.
if (!(++ticks % 20)) {
process.nextTick(function () {
cursor.nextObject(onNextObject);
});
} else {
cursor.nextObject(onNextObject);
}
}
function onNextObject (err, doc) {
if (err) return complete(err);
// when doc is null we hit the end of the cursor
if (!doc) return complete(null, null);
var instance = new model(undefined, fields);
// skip _id for pre-init hooks
delete instance._doc._id;
instance.init(doc, self, function (err) {
if (err) return complete(err);
if (manual) {
callback(null, instance, next);
} else {
callback(null, instance);
next();
}
});
}
});
return this;
}
Query.prototype.each = utils.dep('Query#each', 'Query#stream', each);
/**
* Exports.
*/
module.exports = Query;
module.exports.QueryStream = QueryStream;
|
'use strict';
const inspection = require('inspection');
module.exports.handler = function(event, context, cb) {
const inspect = inspection();
cb(null, inspect);
};
|
/**
* @author fernandojsg / http://fernandojsg.com
* @author Don McCurdy / https://www.donmccurdy.com
* @author Takahiro / https://github.com/takahirox
*/
import {
BufferAttribute,
BufferGeometry,
ClampToEdgeWrapping,
DoubleSide,
InterpolateDiscrete,
InterpolateLinear,
LinearFilter,
LinearMipmapLinearFilter,
LinearMipmapNearestFilter,
MathUtils,
MirroredRepeatWrapping,
NearestFilter,
NearestMipmapLinearFilter,
NearestMipmapNearestFilter,
PropertyBinding,
RGBAFormat,
RepeatWrapping,
Scene,
Vector3
} from "../../../build/three.module.js";
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
var WEBGL_CONSTANTS = {
POINTS: 0x0000,
LINES: 0x0001,
LINE_LOOP: 0x0002,
LINE_STRIP: 0x0003,
TRIANGLES: 0x0004,
TRIANGLE_STRIP: 0x0005,
TRIANGLE_FAN: 0x0006,
UNSIGNED_BYTE: 0x1401,
UNSIGNED_SHORT: 0x1403,
FLOAT: 0x1406,
UNSIGNED_INT: 0x1405,
ARRAY_BUFFER: 0x8892,
ELEMENT_ARRAY_BUFFER: 0x8893,
NEAREST: 0x2600,
LINEAR: 0x2601,
NEAREST_MIPMAP_NEAREST: 0x2700,
LINEAR_MIPMAP_NEAREST: 0x2701,
NEAREST_MIPMAP_LINEAR: 0x2702,
LINEAR_MIPMAP_LINEAR: 0x2703,
CLAMP_TO_EDGE: 33071,
MIRRORED_REPEAT: 33648,
REPEAT: 10497
};
var THREE_TO_WEBGL = {};
THREE_TO_WEBGL[ NearestFilter ] = WEBGL_CONSTANTS.NEAREST;
THREE_TO_WEBGL[ NearestMipmapNearestFilter ] = WEBGL_CONSTANTS.NEAREST_MIPMAP_NEAREST;
THREE_TO_WEBGL[ NearestMipmapLinearFilter ] = WEBGL_CONSTANTS.NEAREST_MIPMAP_LINEAR;
THREE_TO_WEBGL[ LinearFilter ] = WEBGL_CONSTANTS.LINEAR;
THREE_TO_WEBGL[ LinearMipmapNearestFilter ] = WEBGL_CONSTANTS.LINEAR_MIPMAP_NEAREST;
THREE_TO_WEBGL[ LinearMipmapLinearFilter ] = WEBGL_CONSTANTS.LINEAR_MIPMAP_LINEAR;
THREE_TO_WEBGL[ ClampToEdgeWrapping ] = WEBGL_CONSTANTS.CLAMP_TO_EDGE;
THREE_TO_WEBGL[ RepeatWrapping ] = WEBGL_CONSTANTS.REPEAT;
THREE_TO_WEBGL[ MirroredRepeatWrapping ] = WEBGL_CONSTANTS.MIRRORED_REPEAT;
var PATH_PROPERTIES = {
scale: 'scale',
position: 'translation',
quaternion: 'rotation',
morphTargetInfluences: 'weights'
};
//------------------------------------------------------------------------------
// GLTF Exporter
//------------------------------------------------------------------------------
var GLTFExporter = function () {};
GLTFExporter.prototype = {
constructor: GLTFExporter,
/**
* Parse scenes and generate GLTF output
* @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes
* @param {Function} onDone Callback on completed
* @param {Object} options options
*/
parse: function ( input, onDone, options ) {
var DEFAULT_OPTIONS = {
binary: false,
trs: false,
onlyVisible: true,
truncateDrawRange: true,
embedImages: true,
maxTextureSize: Infinity,
animations: [],
forceIndices: false,
forcePowerOfTwoTextures: false,
includeCustomExtensions: false
};
options = Object.assign( {}, DEFAULT_OPTIONS, options );
if ( options.animations.length > 0 ) {
// Only TRS properties, and not matrices, may be targeted by animation.
options.trs = true;
}
var outputJSON = {
asset: {
version: "2.0",
generator: "GLTFExporter"
}
};
var byteOffset = 0;
var buffers = [];
var pending = [];
var nodeMap = new Map();
var skins = [];
var extensionsUsed = {};
var cachedData = {
meshes: new Map(),
attributes: new Map(),
attributesNormalized: new Map(),
materials: new Map(),
textures: new Map(),
images: new Map()
};
var cachedCanvas;
var uids = new Map();
var uid = 0;
/**
* Assign and return a temporal unique id for an object
* especially which doesn't have .uuid
* @param {Object} object
* @return {Integer}
*/
function getUID( object ) {
if ( ! uids.has( object ) ) uids.set( object, uid ++ );
return uids.get( object );
}
/**
* Compare two arrays
* @param {Array} array1 Array 1 to compare
* @param {Array} array2 Array 2 to compare
* @return {Boolean} Returns true if both arrays are equal
*/
function equalArray( array1, array2 ) {
return ( array1.length === array2.length ) && array1.every( function ( element, index ) {
return element === array2[ index ];
} );
}
/**
* Converts a string to an ArrayBuffer.
* @param {string} text
* @return {ArrayBuffer}
*/
function stringToArrayBuffer( text ) {
if ( window.TextEncoder !== undefined ) {
return new TextEncoder().encode( text ).buffer;
}
var array = new Uint8Array( new ArrayBuffer( text.length ) );
for ( var i = 0, il = text.length; i < il; i ++ ) {
var value = text.charCodeAt( i );
// Replacing multi-byte character with space(0x20).
array[ i ] = value > 0xFF ? 0x20 : value;
}
return array.buffer;
}
/**
* Get the min and max vectors from the given attribute
* @param {BufferAttribute} attribute Attribute to find the min/max in range from start to start + count
* @param {Integer} start
* @param {Integer} count
* @return {Object} Object containing the `min` and `max` values (As an array of attribute.itemSize components)
*/
function getMinMax( attribute, start, count ) {
var output = {
min: new Array( attribute.itemSize ).fill( Number.POSITIVE_INFINITY ),
max: new Array( attribute.itemSize ).fill( Number.NEGATIVE_INFINITY )
};
for ( var i = start; i < start + count; i ++ ) {
for ( var a = 0; a < attribute.itemSize; a ++ ) {
var value = attribute.array[ i * attribute.itemSize + a ];
output.min[ a ] = Math.min( output.min[ a ], value );
output.max[ a ] = Math.max( output.max[ a ], value );
}
}
return output;
}
/**
* Checks if image size is POT.
*
* @param {Image} image The image to be checked.
* @returns {Boolean} Returns true if image size is POT.
*
*/
function isPowerOfTwo( image ) {
return MathUtils.isPowerOfTwo( image.width ) && MathUtils.isPowerOfTwo( image.height );
}
/**
* Checks if normal attribute values are normalized.
*
* @param {BufferAttribute} normal
* @returns {Boolean}
*
*/
function isNormalizedNormalAttribute( normal ) {
if ( cachedData.attributesNormalized.has( normal ) ) {
return false;
}
var v = new Vector3();
for ( var i = 0, il = normal.count; i < il; i ++ ) {
// 0.0005 is from glTF-validator
if ( Math.abs( v.fromArray( normal.array, i * 3 ).length() - 1.0 ) > 0.0005 ) return false;
}
return true;
}
/**
* Creates normalized normal buffer attribute.
*
* @param {BufferAttribute} normal
* @returns {BufferAttribute}
*
*/
function createNormalizedNormalAttribute( normal ) {
if ( cachedData.attributesNormalized.has( normal ) ) {
return cachedData.attributesNormalized.get( normal );
}
var attribute = normal.clone();
var v = new Vector3();
for ( var i = 0, il = attribute.count; i < il; i ++ ) {
v.fromArray( attribute.array, i * 3 );
if ( v.x === 0 && v.y === 0 && v.z === 0 ) {
// if values can't be normalized set (1, 0, 0)
v.setX( 1.0 );
} else {
v.normalize();
}
v.toArray( attribute.array, i * 3 );
}
cachedData.attributesNormalized.set( normal, attribute );
return attribute;
}
/**
* Get the required size + padding for a buffer, rounded to the next 4-byte boundary.
* https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#data-alignment
*
* @param {Integer} bufferSize The size the original buffer.
* @returns {Integer} new buffer size with required padding.
*
*/
function getPaddedBufferSize( bufferSize ) {
return Math.ceil( bufferSize / 4 ) * 4;
}
/**
* Returns a buffer aligned to 4-byte boundary.
*
* @param {ArrayBuffer} arrayBuffer Buffer to pad
* @param {Integer} paddingByte (Optional)
* @returns {ArrayBuffer} The same buffer if it's already aligned to 4-byte boundary or a new buffer
*/
function getPaddedArrayBuffer( arrayBuffer, paddingByte ) {
paddingByte = paddingByte || 0;
var paddedLength = getPaddedBufferSize( arrayBuffer.byteLength );
if ( paddedLength !== arrayBuffer.byteLength ) {
var array = new Uint8Array( paddedLength );
array.set( new Uint8Array( arrayBuffer ) );
if ( paddingByte !== 0 ) {
for ( var i = arrayBuffer.byteLength; i < paddedLength; i ++ ) {
array[ i ] = paddingByte;
}
}
return array.buffer;
}
return arrayBuffer;
}
/**
* Serializes a userData.
*
* @param {THREE.Object3D|THREE.Material} object
* @param {Object} gltfProperty
*/
function serializeUserData( object, gltfProperty ) {
if ( Object.keys( object.userData ).length === 0 ) {
return;
}
try {
var json = JSON.parse( JSON.stringify( object.userData ) );
if ( options.includeCustomExtensions && json.gltfExtensions ) {
if ( gltfProperty.extensions === undefined ) {
gltfProperty.extensions = {};
}
for ( var extensionName in json.gltfExtensions ) {
gltfProperty.extensions[ extensionName ] = json.gltfExtensions[ extensionName ];
extensionsUsed[ extensionName ] = true;
}
delete json.gltfExtensions;
}
if ( Object.keys( json ).length > 0 ) {
gltfProperty.extras = json;
}
} catch ( error ) {
console.warn( 'THREE.GLTFExporter: userData of \'' + object.name + '\' ' +
'won\'t be serialized because of JSON.stringify error - ' + error.message );
}
}
/**
* Applies a texture transform, if present, to the map definition. Requires
* the KHR_texture_transform extension.
*/
function applyTextureTransform( mapDef, texture ) {
var didTransform = false;
var transformDef = {};
if ( texture.offset.x !== 0 || texture.offset.y !== 0 ) {
transformDef.offset = texture.offset.toArray();
didTransform = true;
}
if ( texture.rotation !== 0 ) {
transformDef.rotation = texture.rotation;
didTransform = true;
}
if ( texture.repeat.x !== 1 || texture.repeat.y !== 1 ) {
transformDef.scale = texture.repeat.toArray();
didTransform = true;
}
if ( didTransform ) {
mapDef.extensions = mapDef.extensions || {};
mapDef.extensions[ 'KHR_texture_transform' ] = transformDef;
extensionsUsed[ 'KHR_texture_transform' ] = true;
}
}
/**
* Process a buffer to append to the default one.
* @param {ArrayBuffer} buffer
* @return {Integer}
*/
function processBuffer( buffer ) {
if ( ! outputJSON.buffers ) {
outputJSON.buffers = [ { byteLength: 0 } ];
}
// All buffers are merged before export.
buffers.push( buffer );
return 0;
}
/**
* Process and generate a BufferView
* @param {BufferAttribute} attribute
* @param {number} componentType
* @param {number} start
* @param {number} count
* @param {number} target (Optional) Target usage of the BufferView
* @return {Object}
*/
function processBufferView( attribute, componentType, start, count, target ) {
if ( ! outputJSON.bufferViews ) {
outputJSON.bufferViews = [];
}
// Create a new dataview and dump the attribute's array into it
var componentSize;
if ( componentType === WEBGL_CONSTANTS.UNSIGNED_BYTE ) {
componentSize = 1;
} else if ( componentType === WEBGL_CONSTANTS.UNSIGNED_SHORT ) {
componentSize = 2;
} else {
componentSize = 4;
}
var byteLength = getPaddedBufferSize( count * attribute.itemSize * componentSize );
var dataView = new DataView( new ArrayBuffer( byteLength ) );
var offset = 0;
for ( var i = start; i < start + count; i ++ ) {
for ( var a = 0; a < attribute.itemSize; a ++ ) {
// @TODO Fails on InterleavedBufferAttribute, and could probably be
// optimized for normal BufferAttribute.
var value = attribute.array[ i * attribute.itemSize + a ];
if ( componentType === WEBGL_CONSTANTS.FLOAT ) {
dataView.setFloat32( offset, value, true );
} else if ( componentType === WEBGL_CONSTANTS.UNSIGNED_INT ) {
dataView.setUint32( offset, value, true );
} else if ( componentType === WEBGL_CONSTANTS.UNSIGNED_SHORT ) {
dataView.setUint16( offset, value, true );
} else if ( componentType === WEBGL_CONSTANTS.UNSIGNED_BYTE ) {
dataView.setUint8( offset, value );
}
offset += componentSize;
}
}
var gltfBufferView = {
buffer: processBuffer( dataView.buffer ),
byteOffset: byteOffset,
byteLength: byteLength
};
if ( target !== undefined ) gltfBufferView.target = target;
if ( target === WEBGL_CONSTANTS.ARRAY_BUFFER ) {
// Only define byteStride for vertex attributes.
gltfBufferView.byteStride = attribute.itemSize * componentSize;
}
byteOffset += byteLength;
outputJSON.bufferViews.push( gltfBufferView );
// @TODO Merge bufferViews where possible.
var output = {
id: outputJSON.bufferViews.length - 1,
byteLength: 0
};
return output;
}
/**
* Process and generate a BufferView from an image Blob.
* @param {Blob} blob
* @return {Promise<Integer>}
*/
function processBufferViewImage( blob ) {
if ( ! outputJSON.bufferViews ) {
outputJSON.bufferViews = [];
}
return new Promise( function ( resolve ) {
var reader = new window.FileReader();
reader.readAsArrayBuffer( blob );
reader.onloadend = function () {
var buffer = getPaddedArrayBuffer( reader.result );
var bufferView = {
buffer: processBuffer( buffer ),
byteOffset: byteOffset,
byteLength: buffer.byteLength
};
byteOffset += buffer.byteLength;
outputJSON.bufferViews.push( bufferView );
resolve( outputJSON.bufferViews.length - 1 );
};
} );
}
/**
* Process attribute to generate an accessor
* @param {BufferAttribute} attribute Attribute to process
* @param {BufferGeometry} geometry (Optional) Geometry used for truncated draw range
* @param {Integer} start (Optional)
* @param {Integer} count (Optional)
* @return {Integer} Index of the processed accessor on the "accessors" array
*/
function processAccessor( attribute, geometry, start, count ) {
var types = {
1: 'SCALAR',
2: 'VEC2',
3: 'VEC3',
4: 'VEC4',
16: 'MAT4'
};
var componentType;
// Detect the component type of the attribute array (float, uint or ushort)
if ( attribute.array.constructor === Float32Array ) {
componentType = WEBGL_CONSTANTS.FLOAT;
} else if ( attribute.array.constructor === Uint32Array ) {
componentType = WEBGL_CONSTANTS.UNSIGNED_INT;
} else if ( attribute.array.constructor === Uint16Array ) {
componentType = WEBGL_CONSTANTS.UNSIGNED_SHORT;
} else if ( attribute.array.constructor === Uint8Array ) {
componentType = WEBGL_CONSTANTS.UNSIGNED_BYTE;
} else {
throw new Error( 'THREE.GLTFExporter: Unsupported bufferAttribute component type.' );
}
if ( start === undefined ) start = 0;
if ( count === undefined ) count = attribute.count;
// @TODO Indexed buffer geometry with drawRange not supported yet
if ( options.truncateDrawRange && geometry !== undefined && geometry.index === null ) {
var end = start + count;
var end2 = geometry.drawRange.count === Infinity
? attribute.count
: geometry.drawRange.start + geometry.drawRange.count;
start = Math.max( start, geometry.drawRange.start );
count = Math.min( end, end2 ) - start;
if ( count < 0 ) count = 0;
}
// Skip creating an accessor if the attribute doesn't have data to export
if ( count === 0 ) {
return null;
}
var minMax = getMinMax( attribute, start, count );
var bufferViewTarget;
// If geometry isn't provided, don't infer the target usage of the bufferView. For
// animation samplers, target must not be set.
if ( geometry !== undefined ) {
bufferViewTarget = attribute === geometry.index ? WEBGL_CONSTANTS.ELEMENT_ARRAY_BUFFER : WEBGL_CONSTANTS.ARRAY_BUFFER;
}
var bufferView = processBufferView( attribute, componentType, start, count, bufferViewTarget );
var gltfAccessor = {
bufferView: bufferView.id,
byteOffset: bufferView.byteOffset,
componentType: componentType,
count: count,
max: minMax.max,
min: minMax.min,
type: types[ attribute.itemSize ]
};
if ( ! outputJSON.accessors ) {
outputJSON.accessors = [];
}
outputJSON.accessors.push( gltfAccessor );
return outputJSON.accessors.length - 1;
}
/**
* Process image
* @param {Image} image to process
* @param {Integer} format of the image (e.g. THREE.RGBFormat, RGBAFormat etc)
* @param {Boolean} flipY before writing out the image
* @return {Integer} Index of the processed texture in the "images" array
*/
function processImage( image, format, flipY ) {
if ( ! cachedData.images.has( image ) ) {
cachedData.images.set( image, {} );
}
var cachedImages = cachedData.images.get( image );
var mimeType = format === RGBAFormat ? 'image/png' : 'image/jpeg';
var key = mimeType + ":flipY/" + flipY.toString();
if ( cachedImages[ key ] !== undefined ) {
return cachedImages[ key ];
}
if ( ! outputJSON.images ) {
outputJSON.images = [];
}
var gltfImage = { mimeType: mimeType };
if ( options.embedImages ) {
var canvas = cachedCanvas = cachedCanvas || document.createElement( 'canvas' );
canvas.width = Math.min( image.width, options.maxTextureSize );
canvas.height = Math.min( image.height, options.maxTextureSize );
if ( options.forcePowerOfTwoTextures && ! isPowerOfTwo( canvas ) ) {
console.warn( 'GLTFExporter: Resized non-power-of-two image.', image );
canvas.width = MathUtils.floorPowerOfTwo( canvas.width );
canvas.height = MathUtils.floorPowerOfTwo( canvas.height );
}
var ctx = canvas.getContext( '2d' );
if ( flipY === true ) {
ctx.translate( 0, canvas.height );
ctx.scale( 1, - 1 );
}
ctx.drawImage( image, 0, 0, canvas.width, canvas.height );
if ( options.binary === true ) {
pending.push( new Promise( function ( resolve ) {
canvas.toBlob( function ( blob ) {
processBufferViewImage( blob ).then( function ( bufferViewIndex ) {
gltfImage.bufferView = bufferViewIndex;
resolve();
} );
}, mimeType );
} ) );
} else {
gltfImage.uri = canvas.toDataURL( mimeType );
}
} else {
gltfImage.uri = image.src;
}
outputJSON.images.push( gltfImage );
var index = outputJSON.images.length - 1;
cachedImages[ key ] = index;
return index;
}
/**
* Process sampler
* @param {Texture} map Texture to process
* @return {Integer} Index of the processed texture in the "samplers" array
*/
function processSampler( map ) {
if ( ! outputJSON.samplers ) {
outputJSON.samplers = [];
}
var gltfSampler = {
magFilter: THREE_TO_WEBGL[ map.magFilter ],
minFilter: THREE_TO_WEBGL[ map.minFilter ],
wrapS: THREE_TO_WEBGL[ map.wrapS ],
wrapT: THREE_TO_WEBGL[ map.wrapT ]
};
outputJSON.samplers.push( gltfSampler );
return outputJSON.samplers.length - 1;
}
/**
* Process texture
* @param {Texture} map Map to process
* @return {Integer} Index of the processed texture in the "textures" array
*/
function processTexture( map ) {
if ( cachedData.textures.has( map ) ) {
return cachedData.textures.get( map );
}
if ( ! outputJSON.textures ) {
outputJSON.textures = [];
}
var gltfTexture = {
sampler: processSampler( map ),
source: processImage( map.image, map.format, map.flipY )
};
if ( map.name ) {
gltfTexture.name = map.name;
}
outputJSON.textures.push( gltfTexture );
var index = outputJSON.textures.length - 1;
cachedData.textures.set( map, index );
return index;
}
/**
* Process material
* @param {THREE.Material} material Material to process
* @return {Integer} Index of the processed material in the "materials" array
*/
function processMaterial( material ) {
if ( cachedData.materials.has( material ) ) {
return cachedData.materials.get( material );
}
if ( material.isShaderMaterial ) {
console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
return null;
}
if ( ! outputJSON.materials ) {
outputJSON.materials = [];
}
// @QUESTION Should we avoid including any attribute that has the default value?
var gltfMaterial = {
pbrMetallicRoughness: {}
};
if ( material.isMeshBasicMaterial ) {
gltfMaterial.extensions = { KHR_materials_unlit: {} };
extensionsUsed[ 'KHR_materials_unlit' ] = true;
} else if ( material.isGLTFSpecularGlossinessMaterial ) {
gltfMaterial.extensions = { KHR_materials_pbrSpecularGlossiness: {} };
extensionsUsed[ 'KHR_materials_pbrSpecularGlossiness' ] = true;
} else if ( ! material.isMeshStandardMaterial ) {
console.warn( 'GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.' );
}
// pbrMetallicRoughness.baseColorFactor
var color = material.color.toArray().concat( [ material.opacity ] );
if ( ! equalArray( color, [ 1, 1, 1, 1 ] ) ) {
gltfMaterial.pbrMetallicRoughness.baseColorFactor = color;
}
if ( material.isMeshStandardMaterial ) {
gltfMaterial.pbrMetallicRoughness.metallicFactor = material.metalness;
gltfMaterial.pbrMetallicRoughness.roughnessFactor = material.roughness;
} else if ( material.isMeshBasicMaterial ) {
gltfMaterial.pbrMetallicRoughness.metallicFactor = 0.0;
gltfMaterial.pbrMetallicRoughness.roughnessFactor = 0.9;
} else {
gltfMaterial.pbrMetallicRoughness.metallicFactor = 0.5;
gltfMaterial.pbrMetallicRoughness.roughnessFactor = 0.5;
}
// pbrSpecularGlossiness diffuse, specular and glossiness factor
if ( material.isGLTFSpecularGlossinessMaterial ) {
if ( gltfMaterial.pbrMetallicRoughness.baseColorFactor ) {
gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness.diffuseFactor = gltfMaterial.pbrMetallicRoughness.baseColorFactor;
}
var specularFactor = [ 1, 1, 1 ];
material.specular.toArray( specularFactor, 0 );
gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness.specularFactor = specularFactor;
gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness.glossinessFactor = material.glossiness;
}
// pbrMetallicRoughness.metallicRoughnessTexture
if ( material.metalnessMap || material.roughnessMap ) {
if ( material.metalnessMap === material.roughnessMap ) {
var metalRoughMapDef = { index: processTexture( material.metalnessMap ) };
applyTextureTransform( metalRoughMapDef, material.metalnessMap );
gltfMaterial.pbrMetallicRoughness.metallicRoughnessTexture = metalRoughMapDef;
} else {
console.warn( 'THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.' );
}
}
// pbrMetallicRoughness.baseColorTexture or pbrSpecularGlossiness diffuseTexture
if ( material.map ) {
var baseColorMapDef = { index: processTexture( material.map ) };
applyTextureTransform( baseColorMapDef, material.map );
if ( material.isGLTFSpecularGlossinessMaterial ) {
gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness.diffuseTexture = baseColorMapDef;
}
gltfMaterial.pbrMetallicRoughness.baseColorTexture = baseColorMapDef;
}
// pbrSpecularGlossiness specular map
if ( material.isGLTFSpecularGlossinessMaterial && material.specularMap ) {
var specularMapDef = { index: processTexture( material.specularMap ) };
applyTextureTransform( specularMapDef, material.specularMap );
gltfMaterial.extensions.KHR_materials_pbrSpecularGlossiness.specularGlossinessTexture = specularMapDef;
}
if ( material.emissive ) {
// emissiveFactor
var emissive = material.emissive.clone().multiplyScalar( material.emissiveIntensity ).toArray();
if ( ! equalArray( emissive, [ 0, 0, 0 ] ) ) {
gltfMaterial.emissiveFactor = emissive;
}
// emissiveTexture
if ( material.emissiveMap ) {
var emissiveMapDef = { index: processTexture( material.emissiveMap ) };
applyTextureTransform( emissiveMapDef, material.emissiveMap );
gltfMaterial.emissiveTexture = emissiveMapDef;
}
}
// normalTexture
if ( material.normalMap ) {
var normalMapDef = { index: processTexture( material.normalMap ) };
if ( material.normalScale && material.normalScale.x !== - 1 ) {
if ( material.normalScale.x !== material.normalScale.y ) {
console.warn( 'THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X.' );
}
normalMapDef.scale = material.normalScale.x;
}
applyTextureTransform( normalMapDef, material.normalMap );
gltfMaterial.normalTexture = normalMapDef;
}
// occlusionTexture
if ( material.aoMap ) {
var occlusionMapDef = {
index: processTexture( material.aoMap ),
texCoord: 1
};
if ( material.aoMapIntensity !== 1.0 ) {
occlusionMapDef.strength = material.aoMapIntensity;
}
applyTextureTransform( occlusionMapDef, material.aoMap );
gltfMaterial.occlusionTexture = occlusionMapDef;
}
// alphaMode
if ( material.transparent ) {
gltfMaterial.alphaMode = 'BLEND';
} else {
if ( material.alphaTest > 0.0 ) {
gltfMaterial.alphaMode = 'MASK';
gltfMaterial.alphaCutoff = material.alphaTest;
}
}
// doubleSided
if ( material.side === DoubleSide ) {
gltfMaterial.doubleSided = true;
}
if ( material.name !== '' ) {
gltfMaterial.name = material.name;
}
serializeUserData( material, gltfMaterial );
outputJSON.materials.push( gltfMaterial );
var index = outputJSON.materials.length - 1;
cachedData.materials.set( material, index );
return index;
}
/**
* Process mesh
* @param {THREE.Mesh} mesh Mesh to process
* @return {Integer} Index of the processed mesh in the "meshes" array
*/
function processMesh( mesh ) {
var meshCacheKeyParts = [ mesh.geometry.uuid ];
if ( Array.isArray( mesh.material ) ) {
for ( var i = 0, l = mesh.material.length; i < l; i ++ ) {
meshCacheKeyParts.push( mesh.material[ i ].uuid );
}
} else {
meshCacheKeyParts.push( mesh.material.uuid );
}
var meshCacheKey = meshCacheKeyParts.join( ':' );
if ( cachedData.meshes.has( meshCacheKey ) ) {
return cachedData.meshes.get( meshCacheKey );
}
var geometry = mesh.geometry;
var mode;
// Use the correct mode
if ( mesh.isLineSegments ) {
mode = WEBGL_CONSTANTS.LINES;
} else if ( mesh.isLineLoop ) {
mode = WEBGL_CONSTANTS.LINE_LOOP;
} else if ( mesh.isLine ) {
mode = WEBGL_CONSTANTS.LINE_STRIP;
} else if ( mesh.isPoints ) {
mode = WEBGL_CONSTANTS.POINTS;
} else {
mode = mesh.material.wireframe ? WEBGL_CONSTANTS.LINES : WEBGL_CONSTANTS.TRIANGLES;
}
if ( ! geometry.isBufferGeometry ) {
console.warn( 'GLTFExporter: Exporting THREE.Geometry will increase file size. Use BufferGeometry instead.' );
geometry = new BufferGeometry().setFromObject( mesh );
}
var gltfMesh = {};
var attributes = {};
var primitives = [];
var targets = [];
// Conversion between attributes names in threejs and gltf spec
var nameConversion = {
uv: 'TEXCOORD_0',
uv2: 'TEXCOORD_1',
color: 'COLOR_0',
skinWeight: 'WEIGHTS_0',
skinIndex: 'JOINTS_0'
};
var originalNormal = geometry.getAttribute( 'normal' );
if ( originalNormal !== undefined && ! isNormalizedNormalAttribute( originalNormal ) ) {
console.warn( 'THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one.' );
geometry.setAttribute( 'normal', createNormalizedNormalAttribute( originalNormal ) );
}
// @QUESTION Detect if .vertexColors = true?
// For every attribute create an accessor
var modifiedAttribute = null;
for ( var attributeName in geometry.attributes ) {
// Ignore morph target attributes, which are exported later.
if ( attributeName.substr( 0, 5 ) === 'morph' ) continue;
var attribute = geometry.attributes[ attributeName ];
attributeName = nameConversion[ attributeName ] || attributeName.toUpperCase();
// Prefix all geometry attributes except the ones specifically
// listed in the spec; non-spec attributes are considered custom.
var validVertexAttributes =
/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;
if ( ! validVertexAttributes.test( attributeName ) ) {
attributeName = '_' + attributeName;
}
if ( cachedData.attributes.has( getUID( attribute ) ) ) {
attributes[ attributeName ] = cachedData.attributes.get( getUID( attribute ) );
continue;
}
// JOINTS_0 must be UNSIGNED_BYTE or UNSIGNED_SHORT.
modifiedAttribute = null;
var array = attribute.array;
if ( attributeName === 'JOINTS_0' &&
! ( array instanceof Uint16Array ) &&
! ( array instanceof Uint8Array ) ) {
console.warn( 'GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.' );
modifiedAttribute = new BufferAttribute( new Uint16Array( array ), attribute.itemSize, attribute.normalized );
}
var accessor = processAccessor( modifiedAttribute || attribute, geometry );
if ( accessor !== null ) {
attributes[ attributeName ] = accessor;
cachedData.attributes.set( getUID( attribute ), accessor );
}
}
if ( originalNormal !== undefined ) geometry.setAttribute( 'normal', originalNormal );
// Skip if no exportable attributes found
if ( Object.keys( attributes ).length === 0 ) {
return null;
}
// Morph targets
if ( mesh.morphTargetInfluences !== undefined && mesh.morphTargetInfluences.length > 0 ) {
var weights = [];
var targetNames = [];
var reverseDictionary = {};
if ( mesh.morphTargetDictionary !== undefined ) {
for ( var key in mesh.morphTargetDictionary ) {
reverseDictionary[ mesh.morphTargetDictionary[ key ] ] = key;
}
}
for ( var i = 0; i < mesh.morphTargetInfluences.length; ++ i ) {
var target = {};
var warned = false;
for ( var attributeName in geometry.morphAttributes ) {
// glTF 2.0 morph supports only POSITION/NORMAL/TANGENT.
// Three.js doesn't support TANGENT yet.
if ( attributeName !== 'position' && attributeName !== 'normal' ) {
if ( ! warned ) {
console.warn( 'GLTFExporter: Only POSITION and NORMAL morph are supported.' );
warned = true;
}
continue;
}
var attribute = geometry.morphAttributes[ attributeName ][ i ];
var gltfAttributeName = attributeName.toUpperCase();
// Three.js morph attribute has absolute values while the one of glTF has relative values.
//
// glTF 2.0 Specification:
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#morph-targets
var baseAttribute = geometry.attributes[ attributeName ];
if ( cachedData.attributes.has( getUID( attribute ) ) ) {
target[ gltfAttributeName ] = cachedData.attributes.get( getUID( attribute ) );
continue;
}
// Clones attribute not to override
var relativeAttribute = attribute.clone();
if ( ! geometry.morphTargetsRelative ) {
for ( var j = 0, jl = attribute.count; j < jl; j ++ ) {
relativeAttribute.setXYZ(
j,
attribute.getX( j ) - baseAttribute.getX( j ),
attribute.getY( j ) - baseAttribute.getY( j ),
attribute.getZ( j ) - baseAttribute.getZ( j )
);
}
}
target[ gltfAttributeName ] = processAccessor( relativeAttribute, geometry );
cachedData.attributes.set( getUID( baseAttribute ), target[ gltfAttributeName ] );
}
targets.push( target );
weights.push( mesh.morphTargetInfluences[ i ] );
if ( mesh.morphTargetDictionary !== undefined ) targetNames.push( reverseDictionary[ i ] );
}
gltfMesh.weights = weights;
if ( targetNames.length > 0 ) {
gltfMesh.extras = {};
gltfMesh.extras.targetNames = targetNames;
}
}
var forceIndices = options.forceIndices;
var isMultiMaterial = Array.isArray( mesh.material );
if ( isMultiMaterial && geometry.groups.length === 0 ) return null;
if ( ! forceIndices && geometry.index === null && isMultiMaterial ) {
// temporal workaround.
console.warn( 'THREE.GLTFExporter: Creating index for non-indexed multi-material mesh.' );
forceIndices = true;
}
var didForceIndices = false;
if ( geometry.index === null && forceIndices ) {
var indices = [];
for ( var i = 0, il = geometry.attributes.position.count; i < il; i ++ ) {
indices[ i ] = i;
}
geometry.setIndex( indices );
didForceIndices = true;
}
var materials = isMultiMaterial ? mesh.material : [ mesh.material ];
var groups = isMultiMaterial ? geometry.groups : [ { materialIndex: 0, start: undefined, count: undefined } ];
for ( var i = 0, il = groups.length; i < il; i ++ ) {
var primitive = {
mode: mode,
attributes: attributes,
};
serializeUserData( geometry, primitive );
if ( targets.length > 0 ) primitive.targets = targets;
if ( geometry.index !== null ) {
var cacheKey = getUID( geometry.index );
if ( groups[ i ].start !== undefined || groups[ i ].count !== undefined ) {
cacheKey += ':' + groups[ i ].start + ':' + groups[ i ].count;
}
if ( cachedData.attributes.has( cacheKey ) ) {
primitive.indices = cachedData.attributes.get( cacheKey );
} else {
primitive.indices = processAccessor( geometry.index, geometry, groups[ i ].start, groups[ i ].count );
cachedData.attributes.set( cacheKey, primitive.indices );
}
if ( primitive.indices === null ) delete primitive.indices;
}
var material = processMaterial( materials[ groups[ i ].materialIndex ] );
if ( material !== null ) {
primitive.material = material;
}
primitives.push( primitive );
}
if ( didForceIndices ) {
geometry.setIndex( null );
}
gltfMesh.primitives = primitives;
if ( ! outputJSON.meshes ) {
outputJSON.meshes = [];
}
outputJSON.meshes.push( gltfMesh );
var index = outputJSON.meshes.length - 1;
cachedData.meshes.set( meshCacheKey, index );
return index;
}
/**
* Process camera
* @param {THREE.Camera} camera Camera to process
* @return {Integer} Index of the processed mesh in the "camera" array
*/
function processCamera( camera ) {
if ( ! outputJSON.cameras ) {
outputJSON.cameras = [];
}
var isOrtho = camera.isOrthographicCamera;
var gltfCamera = {
type: isOrtho ? 'orthographic' : 'perspective'
};
if ( isOrtho ) {
gltfCamera.orthographic = {
xmag: camera.right * 2,
ymag: camera.top * 2,
zfar: camera.far <= 0 ? 0.001 : camera.far,
znear: camera.near < 0 ? 0 : camera.near
};
} else {
gltfCamera.perspective = {
aspectRatio: camera.aspect,
yfov: MathUtils.degToRad( camera.fov ),
zfar: camera.far <= 0 ? 0.001 : camera.far,
znear: camera.near < 0 ? 0 : camera.near
};
}
if ( camera.name !== '' ) {
gltfCamera.name = camera.type;
}
outputJSON.cameras.push( gltfCamera );
return outputJSON.cameras.length - 1;
}
/**
* Creates glTF animation entry from AnimationClip object.
*
* Status:
* - Only properties listed in PATH_PROPERTIES may be animated.
*
* @param {THREE.AnimationClip} clip
* @param {THREE.Object3D} root
* @return {number}
*/
function processAnimation( clip, root ) {
if ( ! outputJSON.animations ) {
outputJSON.animations = [];
}
clip = GLTFExporter.Utils.mergeMorphTargetTracks( clip.clone(), root );
var tracks = clip.tracks;
var channels = [];
var samplers = [];
for ( var i = 0; i < tracks.length; ++ i ) {
var track = tracks[ i ];
var trackBinding = PropertyBinding.parseTrackName( track.name );
var trackNode = PropertyBinding.findNode( root, trackBinding.nodeName );
var trackProperty = PATH_PROPERTIES[ trackBinding.propertyName ];
if ( trackBinding.objectName === 'bones' ) {
if ( trackNode.isSkinnedMesh === true ) {
trackNode = trackNode.skeleton.getBoneByName( trackBinding.objectIndex );
} else {
trackNode = undefined;
}
}
if ( ! trackNode || ! trackProperty ) {
console.warn( 'THREE.GLTFExporter: Could not export animation track "%s".', track.name );
return null;
}
var inputItemSize = 1;
var outputItemSize = track.values.length / track.times.length;
if ( trackProperty === PATH_PROPERTIES.morphTargetInfluences ) {
outputItemSize /= trackNode.morphTargetInfluences.length;
}
var interpolation;
// @TODO export CubicInterpolant(InterpolateSmooth) as CUBICSPLINE
// Detecting glTF cubic spline interpolant by checking factory method's special property
// GLTFCubicSplineInterpolant is a custom interpolant and track doesn't return
// valid value from .getInterpolation().
if ( track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === true ) {
interpolation = 'CUBICSPLINE';
// itemSize of CUBICSPLINE keyframe is 9
// (VEC3 * 3: inTangent, splineVertex, and outTangent)
// but needs to be stored as VEC3 so dividing by 3 here.
outputItemSize /= 3;
} else if ( track.getInterpolation() === InterpolateDiscrete ) {
interpolation = 'STEP';
} else {
interpolation = 'LINEAR';
}
samplers.push( {
input: processAccessor( new BufferAttribute( track.times, inputItemSize ) ),
output: processAccessor( new BufferAttribute( track.values, outputItemSize ) ),
interpolation: interpolation
} );
channels.push( {
sampler: samplers.length - 1,
target: {
node: nodeMap.get( trackNode ),
path: trackProperty
}
} );
}
outputJSON.animations.push( {
name: clip.name || 'clip_' + outputJSON.animations.length,
samplers: samplers,
channels: channels
} );
return outputJSON.animations.length - 1;
}
function processSkin( object ) {
var node = outputJSON.nodes[ nodeMap.get( object ) ];
var skeleton = object.skeleton;
if ( skeleton === undefined ) return null;
var rootJoint = object.skeleton.bones[ 0 ];
if ( rootJoint === undefined ) return null;
var joints = [];
var inverseBindMatrices = new Float32Array( skeleton.bones.length * 16 );
for ( var i = 0; i < skeleton.bones.length; ++ i ) {
joints.push( nodeMap.get( skeleton.bones[ i ] ) );
skeleton.boneInverses[ i ].toArray( inverseBindMatrices, i * 16 );
}
if ( outputJSON.skins === undefined ) {
outputJSON.skins = [];
}
outputJSON.skins.push( {
inverseBindMatrices: processAccessor( new BufferAttribute( inverseBindMatrices, 16 ) ),
joints: joints,
skeleton: nodeMap.get( rootJoint )
} );
var skinIndex = node.skin = outputJSON.skins.length - 1;
return skinIndex;
}
function processLight( light ) {
var lightDef = {};
if ( light.name ) lightDef.name = light.name;
lightDef.color = light.color.toArray();
lightDef.intensity = light.intensity;
if ( light.isDirectionalLight ) {
lightDef.type = 'directional';
} else if ( light.isPointLight ) {
lightDef.type = 'point';
if ( light.distance > 0 ) lightDef.range = light.distance;
} else if ( light.isSpotLight ) {
lightDef.type = 'spot';
if ( light.distance > 0 ) lightDef.range = light.distance;
lightDef.spot = {};
lightDef.spot.innerConeAngle = ( light.penumbra - 1.0 ) * light.angle * - 1.0;
lightDef.spot.outerConeAngle = light.angle;
}
if ( light.decay !== undefined && light.decay !== 2 ) {
console.warn( 'THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, '
+ 'and expects light.decay=2.' );
}
if ( light.target
&& ( light.target.parent !== light
|| light.target.position.x !== 0
|| light.target.position.y !== 0
|| light.target.position.z !== - 1 ) ) {
console.warn( 'THREE.GLTFExporter: Light direction may be lost. For best results, '
+ 'make light.target a child of the light with position 0,0,-1.' );
}
var lights = outputJSON.extensions[ 'KHR_lights_punctual' ].lights;
lights.push( lightDef );
return lights.length - 1;
}
/**
* Process Object3D node
* @param {THREE.Object3D} node Object3D to processNode
* @return {Integer} Index of the node in the nodes list
*/
function processNode( object ) {
if ( ! outputJSON.nodes ) {
outputJSON.nodes = [];
}
var gltfNode = {};
if ( options.trs ) {
var rotation = object.quaternion.toArray();
var position = object.position.toArray();
var scale = object.scale.toArray();
if ( ! equalArray( rotation, [ 0, 0, 0, 1 ] ) ) {
gltfNode.rotation = rotation;
}
if ( ! equalArray( position, [ 0, 0, 0 ] ) ) {
gltfNode.translation = position;
}
if ( ! equalArray( scale, [ 1, 1, 1 ] ) ) {
gltfNode.scale = scale;
}
} else {
if ( object.matrixAutoUpdate ) {
object.updateMatrix();
}
if ( ! equalArray( object.matrix.elements, [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ] ) ) {
gltfNode.matrix = object.matrix.elements;
}
}
// We don't export empty strings name because it represents no-name in Three.js.
if ( object.name !== '' ) {
gltfNode.name = String( object.name );
}
serializeUserData( object, gltfNode );
if ( object.isMesh || object.isLine || object.isPoints ) {
var mesh = processMesh( object );
if ( mesh !== null ) {
gltfNode.mesh = mesh;
}
} else if ( object.isCamera ) {
gltfNode.camera = processCamera( object );
} else if ( object.isDirectionalLight || object.isPointLight || object.isSpotLight ) {
if ( ! extensionsUsed[ 'KHR_lights_punctual' ] ) {
outputJSON.extensions = outputJSON.extensions || {};
outputJSON.extensions[ 'KHR_lights_punctual' ] = { lights: [] };
extensionsUsed[ 'KHR_lights_punctual' ] = true;
}
gltfNode.extensions = gltfNode.extensions || {};
gltfNode.extensions[ 'KHR_lights_punctual' ] = { light: processLight( object ) };
} else if ( object.isLight ) {
console.warn( 'THREE.GLTFExporter: Only directional, point, and spot lights are supported.', object );
return null;
}
if ( object.isSkinnedMesh ) {
skins.push( object );
}
if ( object.children.length > 0 ) {
var children = [];
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
var child = object.children[ i ];
if ( child.visible || options.onlyVisible === false ) {
var node = processNode( child );
if ( node !== null ) {
children.push( node );
}
}
}
if ( children.length > 0 ) {
gltfNode.children = children;
}
}
outputJSON.nodes.push( gltfNode );
var nodeIndex = outputJSON.nodes.length - 1;
nodeMap.set( object, nodeIndex );
return nodeIndex;
}
/**
* Process Scene
* @param {Scene} node Scene to process
*/
function processScene( scene ) {
if ( ! outputJSON.scenes ) {
outputJSON.scenes = [];
outputJSON.scene = 0;
}
var gltfScene = {};
if ( scene.name !== '' ) {
gltfScene.name = scene.name;
}
outputJSON.scenes.push( gltfScene );
var nodes = [];
for ( var i = 0, l = scene.children.length; i < l; i ++ ) {
var child = scene.children[ i ];
if ( child.visible || options.onlyVisible === false ) {
var node = processNode( child );
if ( node !== null ) {
nodes.push( node );
}
}
}
if ( nodes.length > 0 ) {
gltfScene.nodes = nodes;
}
serializeUserData( scene, gltfScene );
}
/**
* Creates a Scene to hold a list of objects and parse it
* @param {Array} objects List of objects to process
*/
function processObjects( objects ) {
var scene = new Scene();
scene.name = 'AuxScene';
for ( var i = 0; i < objects.length; i ++ ) {
// We push directly to children instead of calling `add` to prevent
// modify the .parent and break its original scene and hierarchy
scene.children.push( objects[ i ] );
}
processScene( scene );
}
function processInput( input ) {
input = input instanceof Array ? input : [ input ];
var objectsWithoutScene = [];
for ( var i = 0; i < input.length; i ++ ) {
if ( input[ i ] instanceof Scene ) {
processScene( input[ i ] );
} else {
objectsWithoutScene.push( input[ i ] );
}
}
if ( objectsWithoutScene.length > 0 ) {
processObjects( objectsWithoutScene );
}
for ( var i = 0; i < skins.length; ++ i ) {
processSkin( skins[ i ] );
}
for ( var i = 0; i < options.animations.length; ++ i ) {
processAnimation( options.animations[ i ], input[ 0 ] );
}
}
processInput( input );
Promise.all( pending ).then( function () {
// Merge buffers.
var blob = new Blob( buffers, { type: 'application/octet-stream' } );
// Declare extensions.
var extensionsUsedList = Object.keys( extensionsUsed );
if ( extensionsUsedList.length > 0 ) outputJSON.extensionsUsed = extensionsUsedList;
// Update bytelength of the single buffer.
if ( outputJSON.buffers && outputJSON.buffers.length > 0 ) outputJSON.buffers[ 0 ].byteLength = blob.size;
if ( options.binary === true ) {
// https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#glb-file-format-specification
var GLB_HEADER_BYTES = 12;
var GLB_HEADER_MAGIC = 0x46546C67;
var GLB_VERSION = 2;
var GLB_CHUNK_PREFIX_BYTES = 8;
var GLB_CHUNK_TYPE_JSON = 0x4E4F534A;
var GLB_CHUNK_TYPE_BIN = 0x004E4942;
var reader = new window.FileReader();
reader.readAsArrayBuffer( blob );
reader.onloadend = function () {
// Binary chunk.
var binaryChunk = getPaddedArrayBuffer( reader.result );
var binaryChunkPrefix = new DataView( new ArrayBuffer( GLB_CHUNK_PREFIX_BYTES ) );
binaryChunkPrefix.setUint32( 0, binaryChunk.byteLength, true );
binaryChunkPrefix.setUint32( 4, GLB_CHUNK_TYPE_BIN, true );
// JSON chunk.
var jsonChunk = getPaddedArrayBuffer( stringToArrayBuffer( JSON.stringify( outputJSON ) ), 0x20 );
var jsonChunkPrefix = new DataView( new ArrayBuffer( GLB_CHUNK_PREFIX_BYTES ) );
jsonChunkPrefix.setUint32( 0, jsonChunk.byteLength, true );
jsonChunkPrefix.setUint32( 4, GLB_CHUNK_TYPE_JSON, true );
// GLB header.
var header = new ArrayBuffer( GLB_HEADER_BYTES );
var headerView = new DataView( header );
headerView.setUint32( 0, GLB_HEADER_MAGIC, true );
headerView.setUint32( 4, GLB_VERSION, true );
var totalByteLength = GLB_HEADER_BYTES
+ jsonChunkPrefix.byteLength + jsonChunk.byteLength
+ binaryChunkPrefix.byteLength + binaryChunk.byteLength;
headerView.setUint32( 8, totalByteLength, true );
var glbBlob = new Blob( [
header,
jsonChunkPrefix,
jsonChunk,
binaryChunkPrefix,
binaryChunk
], { type: 'application/octet-stream' } );
var glbReader = new window.FileReader();
glbReader.readAsArrayBuffer( glbBlob );
glbReader.onloadend = function () {
onDone( glbReader.result );
};
};
} else {
if ( outputJSON.buffers && outputJSON.buffers.length > 0 ) {
var reader = new window.FileReader();
reader.readAsDataURL( blob );
reader.onloadend = function () {
var base64data = reader.result;
outputJSON.buffers[ 0 ].uri = base64data;
onDone( outputJSON );
};
} else {
onDone( outputJSON );
}
}
} );
}
};
GLTFExporter.Utils = {
insertKeyframe: function ( track, time ) {
var tolerance = 0.001; // 1ms
var valueSize = track.getValueSize();
var times = new track.TimeBufferType( track.times.length + 1 );
var values = new track.ValueBufferType( track.values.length + valueSize );
var interpolant = track.createInterpolant( new track.ValueBufferType( valueSize ) );
var index;
if ( track.times.length === 0 ) {
times[ 0 ] = time;
for ( var i = 0; i < valueSize; i ++ ) {
values[ i ] = 0;
}
index = 0;
} else if ( time < track.times[ 0 ] ) {
if ( Math.abs( track.times[ 0 ] - time ) < tolerance ) return 0;
times[ 0 ] = time;
times.set( track.times, 1 );
values.set( interpolant.evaluate( time ), 0 );
values.set( track.values, valueSize );
index = 0;
} else if ( time > track.times[ track.times.length - 1 ] ) {
if ( Math.abs( track.times[ track.times.length - 1 ] - time ) < tolerance ) {
return track.times.length - 1;
}
times[ times.length - 1 ] = time;
times.set( track.times, 0 );
values.set( track.values, 0 );
values.set( interpolant.evaluate( time ), track.values.length );
index = times.length - 1;
} else {
for ( var i = 0; i < track.times.length; i ++ ) {
if ( Math.abs( track.times[ i ] - time ) < tolerance ) return i;
if ( track.times[ i ] < time && track.times[ i + 1 ] > time ) {
times.set( track.times.slice( 0, i + 1 ), 0 );
times[ i + 1 ] = time;
times.set( track.times.slice( i + 1 ), i + 2 );
values.set( track.values.slice( 0, ( i + 1 ) * valueSize ), 0 );
values.set( interpolant.evaluate( time ), ( i + 1 ) * valueSize );
values.set( track.values.slice( ( i + 1 ) * valueSize ), ( i + 2 ) * valueSize );
index = i + 1;
break;
}
}
}
track.times = times;
track.values = values;
return index;
},
mergeMorphTargetTracks: function ( clip, root ) {
var tracks = [];
var mergedTracks = {};
var sourceTracks = clip.tracks;
for ( var i = 0; i < sourceTracks.length; ++ i ) {
var sourceTrack = sourceTracks[ i ];
var sourceTrackBinding = PropertyBinding.parseTrackName( sourceTrack.name );
var sourceTrackNode = PropertyBinding.findNode( root, sourceTrackBinding.nodeName );
if ( sourceTrackBinding.propertyName !== 'morphTargetInfluences' || sourceTrackBinding.propertyIndex === undefined ) {
// Tracks that don't affect morph targets, or that affect all morph targets together, can be left as-is.
tracks.push( sourceTrack );
continue;
}
if ( sourceTrack.createInterpolant !== sourceTrack.InterpolantFactoryMethodDiscrete
&& sourceTrack.createInterpolant !== sourceTrack.InterpolantFactoryMethodLinear ) {
if ( sourceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {
// This should never happen, because glTF morph target animations
// affect all targets already.
throw new Error( 'THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.' );
}
console.warn( 'THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead.' );
sourceTrack = sourceTrack.clone();
sourceTrack.setInterpolation( InterpolateLinear );
}
var targetCount = sourceTrackNode.morphTargetInfluences.length;
var targetIndex = sourceTrackNode.morphTargetDictionary[ sourceTrackBinding.propertyIndex ];
if ( targetIndex === undefined ) {
throw new Error( 'THREE.GLTFExporter: Morph target name not found: ' + sourceTrackBinding.propertyIndex );
}
var mergedTrack;
// If this is the first time we've seen this object, create a new
// track to store merged keyframe data for each morph target.
if ( mergedTracks[ sourceTrackNode.uuid ] === undefined ) {
mergedTrack = sourceTrack.clone();
var values = new mergedTrack.ValueBufferType( targetCount * mergedTrack.times.length );
for ( var j = 0; j < mergedTrack.times.length; j ++ ) {
values[ j * targetCount + targetIndex ] = mergedTrack.values[ j ];
}
mergedTrack.name = '.morphTargetInfluences';
mergedTrack.values = values;
mergedTracks[ sourceTrackNode.uuid ] = mergedTrack;
tracks.push( mergedTrack );
continue;
}
var sourceInterpolant = sourceTrack.createInterpolant( new sourceTrack.ValueBufferType( 1 ) );
mergedTrack = mergedTracks[ sourceTrackNode.uuid ];
// For every existing keyframe of the merged track, write a (possibly
// interpolated) value from the source track.
for ( var j = 0; j < mergedTrack.times.length; j ++ ) {
mergedTrack.values[ j * targetCount + targetIndex ] = sourceInterpolant.evaluate( mergedTrack.times[ j ] );
}
// For every existing keyframe of the source track, write a (possibly
// new) keyframe to the merged track. Values from the previous loop may
// be written again, but keyframes are de-duplicated.
for ( var j = 0; j < sourceTrack.times.length; j ++ ) {
var keyframeIndex = this.insertKeyframe( mergedTrack, sourceTrack.times[ j ] );
mergedTrack.values[ keyframeIndex * targetCount + targetIndex ] = sourceTrack.values[ j ];
}
}
clip.tracks = tracks;
return clip;
}
};
export { GLTFExporter };
|
import { NumberInput, Element } from '../../libs/flow.module.js';
import { BaseNode } from '../core/BaseNode.js';
import { FloatNode } from 'three-nodes/Nodes.js';
export class FloatEditor extends BaseNode {
constructor() {
const node = new FloatNode();
super( 'Float', 1, node, 150 );
const field = new NumberInput().setTagColor( 'red' ).onChange( () => {
node.value = field.getValue();
} );
this.add( new Element().add( field ) );
}
}
|
/* globals Slingshot */
import filesize from 'filesize';
const slingShotConfig = {
authorize: function(file/*, metaContext*/) {
//Deny uploads if user is not logged in.
if (!this.userId) {
throw new Meteor.Error('login-required', 'Please login before posting files');
}
if (!RocketChat.fileUploadIsValidContentType(file.type)) {
throw new Meteor.Error(TAPi18n.__('error-invalid-file-type'));
}
const maxFileSize = RocketChat.settings.get('FileUpload_MaxFileSize');
if (maxFileSize && maxFileSize < file.size) {
throw new Meteor.Error(TAPi18n.__('File_exceeds_allowed_size_of_bytes', { size: filesize(maxFileSize) }));
}
return true;
},
maxSize: 0,
allowedFileTypes: null
};
Slingshot.fileRestrictions('rocketchat-uploads', slingShotConfig);
Slingshot.fileRestrictions('rocketchat-uploads-gs', slingShotConfig);
|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['jquery.sap.global','./DateRange','./library'],function(q,D,l){"use strict";var a=D.extend("sap.ui.unified.DateTypeRange",{metadata:{library:"sap.ui.unified",properties:{type:{type:"sap.ui.unified.CalendarDayType",group:"Appearance",defaultValue:sap.ui.unified.CalendarDayType.Type01}}}});return a;},true);
|
define(function (require) {
var welcome = function () {
this.displayName = 'Welcome to the Durandal Starter Project!';
this.description = 'Durandal is a cross-device, cross-platform client framework written in JavaScript and designed to make Single Page Applications (SPAs) easy to create and maintain.';
this.features = [
'Clean MV* Architecture',
'JS & HTML Modularity',
'Simple App Lifecycle',
'Eventing, Modals, Message Boxes, etc.',
'Navigation & Screen State Management',
'Consistent Async Programming w/ Promises',
'App Bundling and Optimization',
'Use any Backend Technology',
'Built on top of jQuery, Knockout & RequireJS',
'Integrates with other libraries such as SammyJS & Bootstrap',
'Make jQuery & Bootstrap widgets templatable and bindable (or build your own widgets).'
];
};
welcome.prototype.viewAttached = function (view) {
//you can get the view after it's bound and connected to it's parent dom node if you want
};
return welcome;
}); |
"use strict";
var Cylon = require("cylon");
Cylon.robot({
connections: {
arduino: { adaptor: "firmata", port: "/dev/ttyACM0" }
},
devices: {
relay: { driver: "relay", pin: 2, type: "closed" }
},
work: function(my) {
every((1).second(), function() {
my.relay.toggle();
});
}
}).start();
|
var fs = require('fs');
module.exports = {
rawinclude: function(path) {
return fs.readFileSync(path);
}
}; |
export { default } from './ModalUnstyled';
export { default as ModalManager } from './ModalManager';
export { default as modalUnstyledClasses, getModalUtilityClass } from './modalUnstyledClasses';
|
require('../modules/es.error.to-string');
require('../modules/es.object.to-string');
require('../modules/web.btoa');
require('../modules/web.dom-exception.constructor');
require('../modules/web.dom-exception.stack');
require('../modules/web.dom-exception.to-string-tag');
var path = require('../internals/path');
module.exports = path.btoa;
|
/****************************************************************************
Copyright (c) 2010-2012 Michael Berkovich, Ian McDaniel, tr8n.net
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
****************************************************************************/
Tr8n.SDK.Request = {
callbacks : {},
evalResults: function(str) {
return eval("[" + str + "]")[0];
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Standard AJAX request
//
// Tr8n.SDK.Request.ajax(url[, options])
//
///////////////////////////////////////////////////////////////////////////////////////////////
ajax: function(url, options) {
options = options || {};
options.parameters = options.parameters || {};
var meta = Tr8n.Utils.getMetaAttributes();
if (meta['csrf-param'] && meta['csrf-token']) {
options.parameters[meta['csrf-param']] = meta['csrf-token'];
}
options.parameters = Tr8n.Utils.toQueryParams(options.parameters);
options.method = options.method || 'get';
var self=this;
if (options.method == 'get' && options.parameters != '') {
url = url + (url.indexOf('?') == -1 ? '?' : '&') + options.parameters;
}
var request = Tr8n.Utils.getRequest();
request.onreadystatechange = function() {
if(request.readyState == 4) {
if (request.status == 200) {
if (options.onSuccess) options.onSuccess(self.evalResults(request.responseText));
if (options.onComplete) options.onComplete(self.evalResults(request.responseText));
if (options.evalScripts) Tr8n.Utils.evalScripts(request.responseText);
} else {
if (options.onFailure) options.onFailure(request)
if (options.onComplete) options.onComplete(request)
}
}
}
request.open(options.method, url, true);
request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
request.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
request.send(options.parameters);
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Standard JSONP request
//
// Tr8n.SDK.Request.jsonp(url[, paramerters, callback])
//
///////////////////////////////////////////////////////////////////////////////////////////////
jsonp: function(url, params, cb) {
var
self = this,
script = document.createElement('script'),
uuid = Tr8n.Utils.uuid(),
params = Tr8n.Utils.extend((params||{}), {callback: 'Tr8n.SDK.Request.callbacks.' + uuid}),
url = url + (url.indexOf('?')>-1 ? '&' : '?') + Tr8n.Utils.encodeQueryString(params);
this.callbacks[uuid] = function(data) {
if(data.error) {
Tr8n.log([data.error,data.error_description].join(' : '));
}
if(cb) cb(data);
delete self.callbacks[uuid];
}
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
},
///////////////////////////////////////////////////////////////////////////////////////////////
// CORS request
//
// Tr8n.SDK.Request.cors(url[, paramerters, callback])
//
///////////////////////////////////////////////////////////////////////////////////////////////
cors: function(url, params, cb) {
window.tr8nJQ.ajax({
url: url,
type: 'POST',
data: params,
crossDomain: true
})
.done(function(data) {
if(cb) cb(window.tr8nJQ.parseJSON(data));
})
.fail(function(data) {
alert("error");
})
.always(function(data) {
});
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Same as a jsonp request but with an access token for oauth authentication
//
// Tr8n.SDK.Request.oauth(url[, paramerters, callback])
//
///////////////////////////////////////////////////////////////////////////////////////////////
oauth: function(url, params, cb) {
params || (params = {});
if (Tr8n.access_token) {
Tr8n.Utils.extend(params, {access_token: Tr8n.access_token});
}
this.cors(url, params, cb);
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Opens a popup window with the given url and places it at the
// center of the current window. Used for app authentication. Should only
// be called on a user event like a click as many browsers block popups
// if not initiated by a user.
//
// Tr8n.Request.popup(url[, paramerters, callback])
//
///////////////////////////////////////////////////////////////////////////////////////////////
popup: function(url, params, cb) {
this.registerXDHandler();
// figure out where the center is
var
screenX = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft,
screenY = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop,
outerWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.documentElement.clientWidth,
outerHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : (document.documentElement.clientHeight - 22),
width = params.width || 600,
height = params.height || 400,
left = parseInt(screenX + ((outerWidth - width) / 2), 10),
top = parseInt(screenY + ((outerHeight - height) / 2.5), 10),
features = (
'width=' + width +
',height=' + height +
',left=' + left +
',top=' + top
);
var
uuid = Tr8n.Utils.uuid(),
params = Tr8n.Utils.extend((params||{}),{
callback : uuid,
display : 'popup',
origin : this.origin()
}),
url = url + (url.indexOf('?')>-1 ? '&' : '?') + Tr8n.Utils.encodeQueryString(params);
var win = window.open(url, uuid, features);
this.callbacks[uuid] = function(data) {
if(cb) cb(data,win);
delete Tr8n.SDK.Request.callbacks[uuid];
}
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Creates and inserts a hidden iframe with the given url then removes
// the iframe from the DOM
//
// Tr8n.SDK.Request.hidden(url[, paramerters, callback])
//
///////////////////////////////////////////////////////////////////////////////////////////////
hidden: function(url, params, cb) {
this.registerXDHandler();
var
iframe = document.createElement('iframe'),
uuid = Tr8n.Utils.uuid(),
params = Tr8n.Utils.extend((params||{}),{
callback : uuid,
display : 'hidden',
origin : this.origin()
}),
url = url + (url.indexOf('?')>-1 ? '&' : '?') + Tr8n.Utils.encodeQueryString(params);
iframe.style.display = "none";
this.callbacks[uuid] = function(data) {
if(cb) cb(data);
delete Tr8n.SDK.Request.callbacks[uuid];
iframe.parentNode.removeChild(iframe);
}
iframe.src = url;
document.getElementsByTagName('body')[0].appendChild(iframe);
},
///////////////////////////////////////////////////////////////////////////////////////////////
// Make sure we're listening to the onMessage event
///////////////////////////////////////////////////////////////////////////////////////////////
registerXDHandler: function() {
if(this.xd_registered) return;
var
self = Tr8n.SDK.Request,
fn = function(e) { Tr8n.SDK.Request.onMessage(e) }
window.addEventListener ? window.addEventListener('message', fn, false) : window.attachEvent('onmessage', fn);
this.xd_registered = true;
},
///////////////////////////////////////////////////////////////////////////////////////////////
// handles message events sent via postMessage, and fires the appropriate callback
///////////////////////////////////////////////////////////////////////////////////////////////
onMessage: function(e) {
var data = {};
if (e.data && typeof e.data == 'string') {
data = Tr8n.Utils.decodeQueryString(e.data);
}
if (data.error) {
Tr8n.log(data.error, data.error_description);
}
if (data.callback) {
var cb = this.callbacks[data.callback];
if (cb) {
cb(data);
delete this.callbacks[data.callback];
}
}
},
///////////////////////////////////////////////////////////////////////////////////////////////
// get the origin of the page
///////////////////////////////////////////////////////////////////////////////////////////////
origin: function() {
return (window.location.protocol + '//' + window.location.host)
},
sameOrigin: function() {
if (Tr8n.host == '') return true;
var local_domain = document.location.href.split("/")[2];
var origin_domain = Tr8n.host.split("/")[2];
return (local_domain == origin_domain);
}
}
|
window.react = window.React;
window['react-dom'] = window.ReactDOM;
|
var register = require("./util").register;
var Factory = require("../factory").Factory;
var Workspace = require("./workspace").Workspace;
var UTIL = require("../util");
var geotools = Packages.org.geotools;
var ShapefileDataStoreFactory = geotools.data.shapefile.ShapefileDataStoreFactory;
var prepConfig = function(config) {
if (config) {
if (typeof config === "string") {
config = {path: String(config)};
}
if (!config.path) {
throw "Directory config must include a path.";
}
}
return config;
};
/** api: (define)
* module = workspace
* class = Directory
*/
/** api: (extends)
* workspace/workspace.js
*/
var Directory = UTIL.extend(Workspace, {
/** api: property[path]
* ``String``
* The absolute directory path.
*/
/** api: constructor
* .. class:: Directory
*
* :arg path: ``String`` Path to the directory.
*
* Create a workspace from a directory.
*/
constructor: function Directory(config) {
Workspace.prototype.constructor.apply(this, [prepConfig(config)]);
},
/** private: method[_create]
* :arg config: ``Object``
* :returns: ``org.geotools.data.directory.DirectoryDataStore``
*
* Create the underlying store for the workspace.
*/
_create: function(config) {
if (!UTIL.isDirectory(config.path)) {
throw "Directory path must exist.";
}
var factory = new ShapefileDataStoreFactory();
return factory.createDataStore({url: UTIL.toURL(config.path)});
},
/** private: property[config]
*/
get config() {
return {
type: this.constructor.name,
path: this.path
};
}
});
/** private: staticmethod[from_]
* :arg _store: ``org.geotools.data.DataStore`` A GeoTools store.
* :returns: :class`Directory`
*
* Create a geoscript workspace object from a GeoTools store.
*/
Directory.from_ = function(_store) {
var workspace = new Directory();
workspace._store = _store;
return workspace;
};
/** api: example
* Sample code create a new workspace for accessing data on the filesystem:
*
* .. code-block:: javascript
*
* js> var dir = new WORKSPACE.Directory("data/shp");
* js> dir
* <Directory ["states"]>
* js> var states = dir.get("states");
* js> states
* <Layer name: states, count: 49>
*/
exports.Directory = Directory;
// register a directory factory for the module
register(new Factory(Directory, {
handles: function(config) {
var capable;
try {
config = prepConfig(config);
capable = true;
} catch (err) {
capable = false;
}
return capable;
},
wraps: function(_store) {
return (
_store instanceof geotools.data.shapefile.ShapefileDataStore ||
_store instanceof geotools.data.directory.DirectoryDataStore
);
}
}));
|
import React, {PropTypes} from 'react';
import {Link, IndexLink} from 'react-router';
import LoadingDots from './LoadingDots';
import LoginLink from './LoginLink';
import LogoutLink from './LogoutLink';
import AdminLink from './AdminLink';
const Header = ({loading, signOut, auth, user}) => {
let loginLogoutLink = auth.isLogged ? <LogoutLink signOut={signOut} /> : <LoginLink />;
let adminLink = user.isAdmin ? <AdminLink /> : null;
return (
<nav>
<IndexLink to="/" activeClassName="active">Home</IndexLink>
{" | "}
<Link to="/about" activeClassName="active">About</Link>
{" | "}
<Link to="/protected" activeClassName="active">Protected</Link>
{adminLink}
{" | "}
{loginLogoutLink}
{loading && <LoadingDots interval={100} dots={20}/>}
</nav>
);
};
Header.propTypes = {
signOut: React.PropTypes.func.isRequired,
auth: React.PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired,
loading: PropTypes.bool.isRequired
};
export default Header;
|
'use strict';
describe('By', function() {
var assert = require('assert');
var path = require('path');
var driver = require(path.resolve(__dirname, '..', 'lib', 'driver')).driver;
var By = require(
path.resolve(__dirname, '..', '..', 'src', 'webdriver-sync')
).By;
beforeEach(function() {
driver.get('http://getbootstrap.com');
});
after(function(){
driver.quit();
});
describe('#className', function() {
it('can be used', function() {
driver.findElements(By.className('navbar')).length.should.equal(1);
});
});
describe('#cssSelector', function() {
it('can be used', function() {
driver.findElements(By.cssSelector('body')).length.should.equal(1);
});
});
describe('#id', function() {
it('can be used', function() {
driver.findElements(By.id('content')).length.should.equal(1);
});
});
describe('#linkText', function() {
it('can be used', function() {
driver.findElements(By.linkText('GitHub')).length.should.equal(1);
});
});
describe('#name', function() {
it('can be used', function() {
driver.findElements(By.name('viewport')).length.should.equal(1);
});
});
describe('#partialLinkText', function() {
it('can be used', function() {
driver.findElements(
By.partialLinkText('Download')
).length.should.equal(1);
});
});
describe('#tagName', function() {
it('can be used', function() {
driver.findElements(By.tagName('div')).length.should.be.above(1);
});
});
describe('#xpath', function() {
it('can be used', function() {
driver.findElements(By.xpath('//div')).length.should.be.above(1);
});
});
});
|
(function(global) {
var SETTINGS_KEY = "remotestorage:access";
/**
* Class: RemoteStorage.Access
*
* Keeps track of claimed access and scopes.
*/
RemoteStorage.Access = function() {
this.reset();
};
RemoteStorage.Access.prototype = {
/**
* Method: claim
*
* Claim access on a given scope with given mode.
*
* Parameters:
* scope - An access scope, such as "contacts" or "calendar"
* mode - Access mode. Either "r" for read-only or "rw" for read/write
*
* Example:
* (start code)
* remoteStorage.access.claim('contacts', 'r');
* remoteStorage.access.claim('pictures', 'rw');
* (end code)
*
* Root access:
* Claiming root access, meaning complete access to all files and folders
* of a storage, can be done using an asterisk:
*
* (start code)
* remoteStorage.access.claim('*', 'rw');
* (end code)
*/
claim: function(scope, mode) {
if (typeof(scope) !== 'string' || scope.indexOf('/') !== -1 || scope.length === 0) {
throw new Error('Scope should be a non-empty string without forward slashes');
}
if (!mode.match(/^rw?$/)) {
throw new Error('Mode should be either \'r\' or \'rw\'');
}
this._adjustRootPaths(scope);
this.scopeModeMap[scope] = mode;
},
get: function(scope) {
return this.scopeModeMap[scope];
},
remove: function(scope) {
var savedMap = {};
var name;
for (name in this.scopeModeMap) {
savedMap[name] = this.scopeModeMap[name];
}
this.reset();
delete savedMap[scope];
for (name in savedMap) {
this.set(name, savedMap[name]);
}
},
/**
* Verify permission for a given scope.
*/
checkPermission: function(scope, mode) {
var actualMode = this.get(scope);
return actualMode && (mode === 'r' || actualMode === 'rw');
},
/**
* Verify permission for a given path.
*/
checkPathPermission: function(path, mode) {
if (this.checkPermission('*', mode)) {
return true;
}
return !!this.checkPermission(this._getModuleName(path), mode);
},
reset: function() {
this.rootPaths = [];
this.scopeModeMap = {};
},
/**
* Return the module name for a given path.
*/
_getModuleName: function(path) {
if (path[0] !== '/') {
throw new Error('Path should start with a slash');
}
var moduleMatch = path.replace(/^\/public/, '').match(/^\/([^\/]*)\//);
return moduleMatch ? moduleMatch[1] : '*';
},
_adjustRootPaths: function(newScope) {
if ('*' in this.scopeModeMap || newScope === '*') {
this.rootPaths = ['/'];
} else if (! (newScope in this.scopeModeMap)) {
this.rootPaths.push('/' + newScope + '/');
this.rootPaths.push('/public/' + newScope + '/');
}
},
_scopeNameForParameter: function(scope) {
if (scope.name === '*' && this.storageType) {
if (this.storageType === '2012.04') {
return '';
} else if (this.storageType.match(/remotestorage-0[01]/)) {
return 'root';
}
}
return scope.name;
},
setStorageType: function(type) {
this.storageType = type;
}
};
/**
* Property: scopes
*
* Holds an array of claimed scopes in the form
* > { name: "<scope-name>", mode: "<mode>" }
*/
Object.defineProperty(RemoteStorage.Access.prototype, 'scopes', {
get: function() {
return Object.keys(this.scopeModeMap).map(function(key) {
return { name: key, mode: this.scopeModeMap[key] };
}.bind(this));
}
});
Object.defineProperty(RemoteStorage.Access.prototype, 'scopeParameter', {
get: function() {
return this.scopes.map(function(scope) {
return this._scopeNameForParameter(scope) + ':' + scope.mode;
}.bind(this)).join(' ');
}
});
// Documented in src/remotestorage.js
Object.defineProperty(RemoteStorage.prototype, 'access', {
get: function() {
var access = new RemoteStorage.Access();
Object.defineProperty(this, 'access', {
value: access
});
return access;
},
configurable: true
});
RemoteStorage.Access._rs_init = function() {};
})(typeof(window) !== 'undefined' ? window : global);
|
$(document).ready(function () {
'use strict';
$.tablesorter.addParser({
id : 'status',
is : function (s) {
return false;
},
format: function (s) {
return s.replace('未知', 0).replace('人工维护', 1).replace('同步失败', 2).replace('正在同步', 3).replace('同步完成', 4);
},
type: 'numeric'
});
$.tablesorter.addParser({
id : 'size',
is : function (s) {
return false;
},
format: function (s) {
// Assume unknown size as zero.
var the_number = (s !== '-') ? parseFloat(s) : 0;
if (s.indexOf('K') >= 0) {
the_number = the_number * 1000;
}
if (s.indexOf('M') >= 0) {
the_number = the_number * 1000 * 1000;
}
if (s.indexOf('G') >= 0) {
the_number = the_number * 1000 * 1000 * 1000;
}
if (s.indexOf('T') >= 0) {
the_number = the_number * 1000 * 1000 * 1000 * 1000;
}
return the_number;
},
type: 'numeric'
});
$('#status-main-table').tablesorter({
sortList: [[1, 0]],
textExtraction: function (s) {
var $el = $(s),
$img = $el.find('img');
return $img.length ? $img.attr('alt') : $el.text();
},
headers : {
3: {
'sorter' : 'status'
},
4: {
'sorter' : 'size'
},
8: {
'sorter' : 'size'
}
}
});
});
// vi: set et sw=4 sts=4:
|
var HTTP_STATUS_CODES = require('http').STATUS_CODES;
var fs = require('fs');
var os = require('os');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var request = require('request');
var xmlbuilder = require('xmlbuilder');
var stackTrace = require('stack-trace');
var hashish = require('hashish');
var querystring = require('querystring');
module.exports = Airbrake;
util.inherits(Airbrake, EventEmitter);
function Airbrake() {
this.key = null;
this.host = 'http://' + os.hostname();
this.env = process.env.NODE_ENV || 'development';
this.projectRoot = null;
this.appVersion = null;
this.timeout = 30 * 1000;
this.developmentEnvironments = ['development', 'test'];
this.protocol = 'http';
this.serviceHost = process.env.AIRBRAKE_SERVER || 'api.airbrake.io';
this.requestOptions = {};
}
Airbrake.PACKAGE = (function() {
var json = fs.readFileSync(__dirname + '/../package.json', 'utf8');
return JSON.parse(json);
})();
Airbrake.createClient = function(key, env) {
var instance = new this();
instance.key = key;
instance.env = env || instance.env;
return instance;
};
Airbrake.prototype.expressHandler = function(disableUncaughtException) {
var self = this;
if(!disableUncaughtException) {
process.on('uncaughtException', function(err) {
self._onError(err, true);
});
}
return function errorHandler(err, req, res, next) {
if (res.statusCode < 400) res.statusCode = 500;
err.url = req.url;
err.component = req.url;
err.action = req.method;
err.params = req.body;
err.session = req.session;
self._onError(err, false);
next(err);
};
};
Airbrake.prototype._onError = function(err, die) {
var self = this;
if (!(err instanceof Error)) {
err = new Error(err);
}
self.log('Airbrake: Uncaught exception, sending notification for:');
self.log(err.stack || err);
self.notify(err, function(notifyErr, url, devMode) {
if (notifyErr) {
self.log('Airbrake: Could not notify service.');
self.log(notifyErr.stack);
} else if (devMode) {
self.log('Airbrake: Dev mode, did not send.');
} else {
self.log('Airbrake: Notified service: ' + url);
}
if (die) {
process.exit(1);
}
});
};
Airbrake.prototype.handleExceptions = function() {
var self = this;
process.on('uncaughtException', function(err) {
self._onError(err, true);
});
};
Airbrake.prototype.log = function(str) {
console.error(str);
};
Airbrake.prototype.notify = function(err, cb) {
var callback = this._callback(cb);
// log errors instead of posting to airbrake if a dev enviroment
if (this.developmentEnvironments.indexOf(this.env) != -1) {
this.log(err);
return callback(null, null, true);
}
var body = this.notifyXml(err);
var options = hashish.merge({
method: 'POST',
url: this.url('/notifier_api/v2/notices'),
body: body,
timeout: this.timeout,
headers: {
'Content-Length': body.length,
'Content-Type': 'text/xml',
'Accept': 'text/xml',
},
}, this.requestOptions);
request(options, function(err, res, body) {
if (err) {
return callback(err);
}
if (undefined === body) {
return callback(new Error('invalid body'));
}
if (res.statusCode >= 300) {
var status = HTTP_STATUS_CODES[res.statusCode];
var explanation = body.match(/<error>([^<]+)/i);
explanation = (explanation)
? ': ' + explanation[1]
: ': ' + body;
return callback(new Error(
'Notification failed: ' + res.statusCode + ' ' + status + explanation
));
}
// Give me a break, this is legit : )
var m = body.match(/<url>([^<]+)/i);
var url = (m)
? m[1]
: null;
callback(null, url);
});
};
Airbrake.prototype._callback = function(cb) {
var self = this;
return function(err) {
if (cb) {
cb.apply(self, arguments);
return;
}
if (err) {
self.emit('error', err);
}
};
};
Airbrake.prototype.url = function(path) {
return this.protocol + '://' + this.serviceHost + path;
};
Airbrake.prototype.notifyXml = function(err, pretty) {
var notice = xmlbuilder.create().begin('notice', {
version: '1.0',
encoding: 'UTF-8'
});
this.appendHeaderXml(notice);
this.appendErrorXml(notice, err);
this.appendRequestXml(notice, err);
this.appendServerEnvironmentXml(notice);
return notice.doc().toString({pretty: pretty});
};
Airbrake.prototype.appendHeaderXml = function(notice) {
notice
.att('version', '2.2')
.ele('api-key')
.txt(this.key || '-')
.up()
.ele('notifier')
.ele('name')
.txt(Airbrake.PACKAGE.name)
.up()
.ele('version')
.txt(Airbrake.PACKAGE.version)
.up()
.ele('url')
.txt(Airbrake.PACKAGE.homepage)
.up()
.up();
};
Airbrake.prototype.appendErrorXml = function(notice, err) {
var trace = stackTrace.parse(err);
var error = notice
.ele('error')
.ele('class')
.txt(err.type || 'Error')
.up()
.ele('message')
.txt(err.message || '-')
.up()
.ele('backtrace');
var self = this;
trace.forEach(function(callSite) {
error
.ele('line')
.att('method', callSite.getFunctionName() || '')
.att('file', (callSite.getFileName() || '').replace(self.projectRoot, ""))
.att('number', callSite.getLineNumber() || '');
});
};
Airbrake.prototype.appendRequestXml = function(notice, err) {
var request = notice.ele('request');
var self = this;
['url', 'component', 'action'].forEach(function(nodeName) {
var node = request.ele(nodeName);
var val = err[nodeName];
if (nodeName === 'url') {
if (!val) {
val = self.host;
} else if (val.substr(0, 1) === '/') {
val = self.host + val;
}
}
if (val) {
node.txt(val);
}
});
this.addRequestVars(request, 'cgi-data', this.cgiDataVars(err));
this.addRequestVars(request, 'session', this.sessionVars(err));
this.addRequestVars(request, 'params', this.paramsVars(err));
};
Airbrake.prototype.addRequestVars = function(request, type, vars) {
this.emit('vars', type, vars);
var node;
Object.keys(vars).forEach(function(key) {
node = node || request.ele(type);
value = vars[key];
if ('string' !== typeof value) {
value = util.inspect(value, { showHidden: true, depth: null });
}
value = value.replace(/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/g, " ");
node
.ele('var')
.att('key', key)
.txt(value);
});
};
Airbrake.prototype.cgiDataVars = function(err) {
var cgiData = {};
Object.keys(process.env).forEach(function(key) {
cgiData[key] = process.env[key];
});
var exclude = [
'type',
'message',
'arguments',
'stack',
'url',
'session',
'params',
'component',
'action',
];
Object.keys(err).forEach(function(key) {
if (exclude.indexOf(key) >= 0) {
return;
}
cgiData['err.' + key] = err[key];
});
cgiData['process.pid'] = process.pid;
if(os.platform() != "win32") {
// this two properties are *NIX only
cgiData['process.uid'] = process.getuid();
cgiData['process.gid'] = process.getgid();
}
cgiData['process.cwd'] = process.cwd();
cgiData['process.execPath'] = process.execPath;
cgiData['process.version'] = process.version;
cgiData['process.argv'] = process.argv;
cgiData['process.memoryUsage'] = process.memoryUsage();
cgiData['os.loadavg'] = os.loadavg();
cgiData['os.uptime'] = os.uptime();
return cgiData;
};
Airbrake.prototype.sessionVars = function(err) {
return (err.session instanceof Object)
? err.session
: {};
};
Airbrake.prototype.paramsVars = function(err) {
return (err.params instanceof Object)
? err.params
: {};
};
Airbrake.prototype.appendServerEnvironmentXml = function(notice) {
var serverEnvironment = notice.ele('server-environment');
if (this.projectRoot) {
serverEnvironment
.ele('project-root')
.txt(this.projectRoot);
}
serverEnvironment
.ele('environment-name')
.txt(this.env)
if (this.appVersion) {
serverEnvironment
.ele('app-version')
.txt(this.appVersion);
}
};
Airbrake.prototype.trackDeployment = function(params, cb) {
if (typeof params === 'function') {
cb = params;
params = {};
}
params = hashish.merge({
key: this.key,
env: this.env,
user: process.env.USER,
rev: '',
repo: '',
}, params);
var body = this.deploymentPostData(params);
var options = hashish.merge({
method: 'POST',
url: this.url('/deploys.txt'),
body: body,
timeout: this.timeout,
headers: {
'Content-Length': body.length,
'Content-Type': 'application/x-www-form-urlencoded',
},
}, this.requestOptions);
var callback = this._callback(cb);
request(options, function(err, res, body) {
if (err) {
return callback(err);
}
if (res.statusCode >= 300) {
var status = HTTP_STATUS_CODES[res.statusCode];
return callback(new Error(
'Deployment failed: ' + res.statusCode + ' ' + status + ': ' + body
));
}
callback(null, params);
});
};
Airbrake.prototype.deploymentPostData = function(params) {
return querystring.stringify({
'api_key': params.key,
'deploy[rails_env]': params.env,
'deploy[local_username]': params.user,
'deploy[scm_revision]': params.rev,
'deploy[scm_repository]': params.repo
});
};
|
// Setup basic express server
const express = require('express');
const app = express();
const path = require('path');
const server = require('http').createServer(app);
const io = require('socket.io')(server);
const port = process.env.PORT || 3000;
server.listen(port, () => {
console.log('Server listening at port %d', port);
});
// Routing
app.use(express.static(path.join(__dirname, 'public')));
// Chatroom
let numUsers = 0;
io.on('connection', (socket) => {
let addedUser = false;
// when the client emits 'new message', this listens and executes
socket.on('new message', (data) => {
// we tell the client to execute 'new message'
socket.broadcast.emit('new message', {
username: socket.username,
message: data
});
});
// when the client emits 'add user', this listens and executes
socket.on('add user', (username) => {
if (addedUser) return;
// we store the username in the socket session for this client
socket.username = username;
++numUsers;
addedUser = true;
socket.emit('login', {
numUsers: numUsers
});
// echo globally (all clients) that a person has connected
socket.broadcast.emit('user joined', {
username: socket.username,
numUsers: numUsers
});
});
// when the client emits 'typing', we broadcast it to others
socket.on('typing', () => {
socket.broadcast.emit('typing', {
username: socket.username
});
});
// when the client emits 'stop typing', we broadcast it to others
socket.on('stop typing', () => {
socket.broadcast.emit('stop typing', {
username: socket.username
});
});
// when the user disconnects.. perform this
socket.on('disconnect', () => {
if (addedUser) {
--numUsers;
// echo globally that this client has left
socket.broadcast.emit('user left', {
username: socket.username,
numUsers: numUsers
});
}
});
});
|
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requirejs.exec()/transpiler plugins that may not be strict.
/*jslint regexp: true, nomen: true, sloppy: true */
/*global window, navigator, document, importScripts, setTimeout, opera */
var requirejs, require, define;
(function (global) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.5',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
currDirRegExp = /^\.\//,
op = Object.prototype,
ostring = op.toString,
hasOwn = op.hasOwnProperty,
ap = Array.prototype,
apsp = ap.splice,
isBrowser = !!(typeof window !== 'undefined' && navigator && document),
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is 'loading', 'loaded', execution,
// then 'complete'. The UA check is unfortunate, but not sure how
//to feature test w/o causing perf issues.
readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
/^complete$/ : /^(complete|loaded)$/,
defContextName = '_',
//Oh the tragedy, detecting opera. See the usage of isOpera for reason.
isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
contexts = {},
cfg = {},
globalDefQueue = [],
useInteractive = false;
function isFunction(it) {
return ostring.call(it) === '[object Function]';
}
function isArray(it) {
return ostring.call(it) === '[object Array]';
}
/**
* Helper function for iterating over an array. If the func returns
* a true value, it will break out of the loop.
*/
function each(ary, func) {
if (ary) {
var i;
for (i = 0; i < ary.length; i += 1) {
if (ary[i] && func(ary[i], i, ary)) {
break;
}
}
}
}
/**
* Helper function for iterating over an array backwards. If the func
* returns a true value, it will break out of the loop.
*/
function eachReverse(ary, func) {
if (ary) {
var i;
for (i = ary.length - 1; i > -1; i -= 1) {
if (ary[i] && func(ary[i], i, ary)) {
break;
}
}
}
}
function hasProp(obj, prop) {
return hasOwn.call(obj, prop);
}
function getOwn(obj, prop) {
return hasProp(obj, prop) && obj[prop];
}
/**
* Cycles over properties in an object and calls a function for each
* property value. If the function returns a truthy value, then the
* iteration is stopped.
*/
function eachProp(obj, func) {
var prop;
for (prop in obj) {
if (hasProp(obj, prop)) {
if (func(obj[prop], prop)) {
break;
}
}
}
}
/**
* Simple function to mix in properties from source into target,
* but only if target does not already have a property of the same name.
*/
function mixin(target, source, force, deepStringMixin) {
if (source) {
eachProp(source, function (value, prop) {
if (force || !hasProp(target, prop)) {
if (deepStringMixin && typeof value !== 'string') {
if (!target[prop]) {
target[prop] = {};
}
mixin(target[prop], value, force, deepStringMixin);
} else {
target[prop] = value;
}
}
});
}
return target;
}
//Similar to Function.prototype.bind, but the 'this' object is specified
//first, since it is easier to read/figure out what 'this' will be.
function bind(obj, fn) {
return function () {
return fn.apply(obj, arguments);
};
}
function scripts() {
return document.getElementsByTagName('script');
}
//Allow getting a global that expressed in
//dot notation, like 'a.b.c'.
function getGlobal(value) {
if (!value) {
return value;
}
var g = global;
each(value.split('.'), function (part) {
g = g[part];
});
return g;
}
/**
* Constructs an error with a pointer to an URL with more information.
* @param {String} id the error ID that maps to an ID on a web page.
* @param {String} message human readable error.
* @param {Error} [err] the original error, if there is one.
*
* @returns {Error}
*/
function makeError(id, msg, err, requireModules) {
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
e.requireType = id;
e.requireModules = requireModules;
if (err) {
e.originalError = err;
}
return e;
}
if (typeof define !== 'undefined') {
//If a define is already in play via another AMD loader,
//do not overwrite.
return;
}
if (typeof requirejs !== 'undefined') {
if (isFunction(requirejs)) {
//Do not overwrite and existing requirejs instance.
return;
}
cfg = requirejs;
requirejs = undefined;
}
//Allow for a require config object
if (typeof require !== 'undefined' && !isFunction(require)) {
//assume it is a config object.
cfg = require;
require = undefined;
}
function newContext(contextName) {
var inCheckLoaded, Module, context, handlers,
checkLoadedTimeoutId,
config = {
//Defaults. Do not set a default for map
//config to speed up normalize(), which
//will run faster if there is no default.
waitSeconds: 7,
baseUrl: './',
paths: {},
pkgs: {},
shim: {},
config: {}
},
registry = {},
//registry of just enabled modules, to speed
//cycle breaking code when lots of modules
//are registered, but not activated.
enabledRegistry = {},
undefEvents = {},
defQueue = [],
defined = {},
urlFetched = {},
requireCounter = 1,
unnormalizedCounter = 1;
/**
* Trims the . and .. from an array of path segments.
* It will keep a leading path segment if a .. will become
* the first path segment, to help with module name lookups,
* which act like paths, but can be remapped. But the end result,
* all paths that use this function should look normalized.
* NOTE: this method MODIFIES the input array.
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part;
for (i = 0; ary[i]; i += 1) {
part = ary[i];
if (part === '.') {
ary.splice(i, 1);
i -= 1;
} else if (part === '..') {
if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
ary.splice(i - 1, 2);
i -= 2;
}
}
}
}
/**
* Given a relative module name, like ./something, normalize it to
* a real name that can be mapped to a path.
* @param {String} name the relative name
* @param {String} baseName a real name that the name arg is relative
* to.
* @param {Boolean} applyMap apply the map config to the value. Should
* only be done if this normalization is for a dependency ID.
* @returns {String} normalized name
*/
function normalize(name, baseName, applyMap) {
var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
foundMap, foundI, foundStarMap, starI,
baseParts = baseName && baseName.split('/'),
normalizedBaseParts = baseParts,
map = config.map,
starMap = map && map['*'];
//Adjust any relative paths.
if (name && name.charAt(0) === '.') {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
if (getOwn(config.pkgs, baseName)) {
//If the baseName is a package name, then just treat it as one
//name to concat the name with.
normalizedBaseParts = baseParts = [baseName];
} else {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
}
name = normalizedBaseParts.concat(name.split('/'));
trimDots(name);
//Some use of packages may use a . path to reference the
//'main' module name, so normalize for that.
pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
name = name.join('/');
if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
name = pkgName;
}
} else if (name.indexOf('./') === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
name = name.substring(2);
}
}
//Apply map config if available.
if (applyMap && map && (baseParts || starMap)) {
nameParts = name.split('/');
for (i = nameParts.length; i > 0; i -= 1) {
nameSegment = nameParts.slice(0, i).join('/');
if (baseParts) {
//Find the longest baseName segment match in the config.
//So, do joins on the biggest to smallest lengths of baseParts.
for (j = baseParts.length; j > 0; j -= 1) {
mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
//baseName segment has config, find if it has one for
//this name.
if (mapValue) {
mapValue = getOwn(mapValue, nameSegment);
if (mapValue) {
//Match, update name to the new value.
foundMap = mapValue;
foundI = i;
break;
}
}
}
}
if (foundMap) {
break;
}
//Check for a star map match, but just hold on to it,
//if there is a shorter segment match later in a matching
//config, then favor over this star map.
if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
foundStarMap = getOwn(starMap, nameSegment);
starI = i;
}
}
if (!foundMap && foundStarMap) {
foundMap = foundStarMap;
foundI = starI;
}
if (foundMap) {
nameParts.splice(0, foundI, foundMap);
name = nameParts.join('/');
}
}
return name;
}
function removeScript(name) {
if (isBrowser) {
each(scripts(), function (scriptNode) {
if (scriptNode.getAttribute('data-requiremodule') === name &&
scriptNode.getAttribute('data-requirecontext') === context.contextName) {
scriptNode.parentNode.removeChild(scriptNode);
return true;
}
});
}
}
function hasPathFallback(id) {
var pathConfig = getOwn(config.paths, id);
if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
removeScript(id);
//Pop off the first array value, since it failed, and
//retry
pathConfig.shift();
context.require.undef(id);
context.require([id]);
return true;
}
}
//Turns a plugin!resource to [plugin, resource]
//with the plugin being undefined if the name
//did not have a plugin prefix.
function splitPrefix(name) {
var prefix,
index = name ? name.indexOf('!') : -1;
if (index > -1) {
prefix = name.substring(0, index);
name = name.substring(index + 1, name.length);
}
return [prefix, name];
}
/**
* Creates a module mapping that includes plugin prefix, module
* name, and path. If parentModuleMap is provided it will
* also normalize the name via require.normalize()
*
* @param {String} name the module name
* @param {String} [parentModuleMap] parent module map
* for the module name, used to resolve relative names.
* @param {Boolean} isNormalized: is the ID already normalized.
* This is true if this call is done for a define() module ID.
* @param {Boolean} applyMap: apply the map config to the ID.
* Should only be true if this map is for a dependency.
*
* @returns {Object}
*/
function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
var url, pluginModule, suffix, nameParts,
prefix = null,
parentName = parentModuleMap ? parentModuleMap.name : null,
originalName = name,
isDefine = true,
normalizedName = '';
//If no name, then it means it is a require call, generate an
//internal name.
if (!name) {
isDefine = false;
name = '_@r' + (requireCounter += 1);
}
nameParts = splitPrefix(name);
prefix = nameParts[0];
name = nameParts[1];
if (prefix) {
prefix = normalize(prefix, parentName, applyMap);
pluginModule = getOwn(defined, prefix);
}
//Account for relative paths if there is a base name.
if (name) {
if (prefix) {
if (pluginModule && pluginModule.normalize) {
//Plugin is loaded, use its normalize method.
normalizedName = pluginModule.normalize(name, function (name) {
return normalize(name, parentName, applyMap);
});
} else {
normalizedName = normalize(name, parentName, applyMap);
}
} else {
//A regular module.
normalizedName = normalize(name, parentName, applyMap);
//Normalized name may be a plugin ID due to map config
//application in normalize. The map config values must
//already be normalized, so do not need to redo that part.
nameParts = splitPrefix(normalizedName);
prefix = nameParts[0];
normalizedName = nameParts[1];
isNormalized = true;
url = context.nameToUrl(normalizedName);
}
}
//If the id is a plugin id that cannot be determined if it needs
//normalization, stamp it with a unique ID so two matching relative
//ids that may conflict can be separate.
suffix = prefix && !pluginModule && !isNormalized ?
'_unnormalized' + (unnormalizedCounter += 1) :
'';
return {
prefix: prefix,
name: normalizedName,
parentMap: parentModuleMap,
unnormalized: !!suffix,
url: url,
originalName: originalName,
isDefine: isDefine,
id: (prefix ?
prefix + '!' + normalizedName :
normalizedName) + suffix
};
}
function getModule(depMap) {
var id = depMap.id,
mod = getOwn(registry, id);
if (!mod) {
mod = registry[id] = new context.Module(depMap);
}
return mod;
}
function on(depMap, name, fn) {
var id = depMap.id,
mod = getOwn(registry, id);
if (hasProp(defined, id) &&
(!mod || mod.defineEmitComplete)) {
if (name === 'defined') {
fn(defined[id]);
}
} else {
getModule(depMap).on(name, fn);
}
}
function onError(err, errback) {
var ids = err.requireModules,
notified = false;
if (errback) {
errback(err);
} else {
each(ids, function (id) {
var mod = getOwn(registry, id);
if (mod) {
//Set error on module, so it skips timeout checks.
mod.error = err;
if (mod.events.error) {
notified = true;
mod.emit('error', err);
}
}
});
if (!notified) {
req.onError(err);
}
}
}
/**
* Internal method to transfer globalQueue items to this context's
* defQueue.
*/
function takeGlobalQueue() {
//Push all the globalDefQueue items into the context's defQueue
if (globalDefQueue.length) {
//Array splice in the values since the context code has a
//local var ref to defQueue, so cannot just reassign the one
//on context.
apsp.apply(defQueue,
[defQueue.length - 1, 0].concat(globalDefQueue));
globalDefQueue = [];
}
}
handlers = {
'require': function (mod) {
if (mod.require) {
return mod.require;
} else {
return (mod.require = context.makeRequire(mod.map));
}
},
'exports': function (mod) {
mod.usingExports = true;
if (mod.map.isDefine) {
if (mod.exports) {
return mod.exports;
} else {
return (mod.exports = defined[mod.map.id] = {});
}
}
},
'module': function (mod) {
if (mod.module) {
return mod.module;
} else {
return (mod.module = {
id: mod.map.id,
uri: mod.map.url,
config: function () {
return (config.config && getOwn(config.config, mod.map.id)) || {};
},
exports: defined[mod.map.id]
});
}
}
};
function cleanRegistry(id) {
//Clean up machinery used for waiting modules.
delete registry[id];
delete enabledRegistry[id];
}
function breakCycle(mod, traced, processed) {
var id = mod.map.id;
if (mod.error) {
mod.emit('error', mod.error);
} else {
traced[id] = true;
each(mod.depMaps, function (depMap, i) {
var depId = depMap.id,
dep = getOwn(registry, depId);
//Only force things that have not completed
//being defined, so still in the registry,
//and only if it has not been matched up
//in the module already.
if (dep && !mod.depMatched[i] && !processed[depId]) {
if (getOwn(traced, depId)) {
mod.defineDep(i, defined[depId]);
mod.check(); //pass false?
} else {
breakCycle(dep, traced, processed);
}
}
});
processed[id] = true;
}
}
function checkLoaded() {
var map, modId, err, usingPathFallback,
waitInterval = config.waitSeconds * 1000,
//It is possible to disable the wait interval by using waitSeconds of 0.
expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
noLoads = [],
reqCalls = [],
stillLoading = false,
needCycleCheck = true;
//Do not bother if this call was a result of a cycle break.
if (inCheckLoaded) {
return;
}
inCheckLoaded = true;
//Figure out the state of all the modules.
eachProp(enabledRegistry, function (mod) {
map = mod.map;
modId = map.id;
//Skip things that are not enabled or in error state.
if (!mod.enabled) {
return;
}
if (!map.isDefine) {
reqCalls.push(mod);
}
if (!mod.error) {
//If the module should be executed, and it has not
//been inited and time is up, remember it.
if (!mod.inited && expired) {
if (hasPathFallback(modId)) {
usingPathFallback = true;
stillLoading = true;
} else {
noLoads.push(modId);
removeScript(modId);
}
} else if (!mod.inited && mod.fetched && map.isDefine) {
stillLoading = true;
if (!map.prefix) {
//No reason to keep looking for unfinished
//loading. If the only stillLoading is a
//plugin resource though, keep going,
//because it may be that a plugin resource
//is waiting on a non-plugin cycle.
return (needCycleCheck = false);
}
}
}
});
if (expired && noLoads.length) {
//If wait time expired, throw error of unloaded modules.
err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
err.contextName = context.contextName;
return onError(err);
}
//Not expired, check for a cycle.
if (needCycleCheck) {
each(reqCalls, function (mod) {
breakCycle(mod, {}, {});
});
}
//If still waiting on loads, and the waiting load is something
//other than a plugin resource, or there are still outstanding
//scripts, then just try back later.
if ((!expired || usingPathFallback) && stillLoading) {
//Something is still waiting to load. Wait for it, but only
//if a timeout is not already in effect.
if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
checkLoadedTimeoutId = setTimeout(function () {
checkLoadedTimeoutId = 0;
checkLoaded();
}, 50);
}
}
inCheckLoaded = false;
}
Module = function (map) {
this.events = getOwn(undefEvents, map.id) || {};
this.map = map;
this.shim = getOwn(config.shim, map.id);
this.depExports = [];
this.depMaps = [];
this.depMatched = [];
this.pluginMaps = {};
this.depCount = 0;
/* this.exports this.factory
this.depMaps = [],
this.enabled, this.fetched
*/
};
Module.prototype = {
init: function (depMaps, factory, errback, options) {
options = options || {};
//Do not do more inits if already done. Can happen if there
//are multiple define calls for the same module. That is not
//a normal, common case, but it is also not unexpected.
if (this.inited) {
return;
}
this.factory = factory;
if (errback) {
//Register for errors on this module.
this.on('error', errback);
} else if (this.events.error) {
//If no errback already, but there are error listeners
//on this module, set up an errback to pass to the deps.
errback = bind(this, function (err) {
this.emit('error', err);
});
}
//Do a copy of the dependency array, so that
//source inputs are not modified. For example
//"shim" deps are passed in here directly, and
//doing a direct modification of the depMaps array
//would affect that config.
this.depMaps = depMaps && depMaps.slice(0);
this.errback = errback;
//Indicate this module has be initialized
this.inited = true;
this.ignore = options.ignore;
//Could have option to init this module in enabled mode,
//or could have been previously marked as enabled. However,
//the dependencies are not known until init is called. So
//if enabled previously, now trigger dependencies as enabled.
if (options.enabled || this.enabled) {
//Enable this module and dependencies.
//Will call this.check()
this.enable();
} else {
this.check();
}
},
defineDep: function (i, depExports) {
//Because of cycles, defined callback for a given
//export can be called more than once.
if (!this.depMatched[i]) {
this.depMatched[i] = true;
this.depCount -= 1;
this.depExports[i] = depExports;
}
},
fetch: function () {
if (this.fetched) {
return;
}
this.fetched = true;
context.startTime = (new Date()).getTime();
var map = this.map;
//If the manager is for a plugin managed resource,
//ask the plugin to load it now.
if (this.shim) {
context.makeRequire(this.map, {
enableBuildCallback: true
})(this.shim.deps || [], bind(this, function () {
return map.prefix ? this.callPlugin() : this.load();
}));
} else {
//Regular dependency.
return map.prefix ? this.callPlugin() : this.load();
}
},
load: function () {
var url = this.map.url;
//Regular dependency.
if (!urlFetched[url]) {
urlFetched[url] = true;
context.load(this.map.id, url);
}
},
/**
* Checks if the module is ready to define itself, and if so,
* define it.
*/
check: function () {
if (!this.enabled || this.enabling) {
return;
}
var err, cjsModule,
id = this.map.id,
depExports = this.depExports,
exports = this.exports,
factory = this.factory;
if (!this.inited) {
this.fetch();
} else if (this.error) {
this.emit('error', this.error);
} else if (!this.defining) {
//The factory could trigger another require call
//that would result in checking this module to
//define itself again. If already in the process
//of doing that, skip this work.
this.defining = true;
if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) {
//If there is an error listener, favor passing
//to that instead of throwing an error.
if (this.events.error) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}
} else {
exports = context.execCb(id, factory, depExports, exports);
}
if (this.map.isDefine) {
//If setting exports via 'module' is in play,
//favor that over return value and exports. After that,
//favor a non-undefined return value over exports use.
cjsModule = this.module;
if (cjsModule &&
cjsModule.exports !== undefined &&
//Make sure it is not already the exports value
cjsModule.exports !== this.exports) {
exports = cjsModule.exports;
} else if (exports === undefined && this.usingExports) {
//exports already set the defined value.
exports = this.exports;
}
}
if (err) {
err.requireMap = this.map;
err.requireModules = [this.map.id];
err.requireType = 'define';
return onError((this.error = err));
}
} else {
//Just a literal value
exports = factory;
}
this.exports = exports;
if (this.map.isDefine && !this.ignore) {
defined[id] = exports;
if (req.onResourceLoad) {
req.onResourceLoad(context, this.map, this.depMaps);
}
}
//Clean up
cleanRegistry(id);
this.defined = true;
}
//Finished the define stage. Allow calling check again
//to allow define notifications below in the case of a
//cycle.
this.defining = false;
if (this.defined && !this.defineEmitted) {
this.defineEmitted = true;
this.emit('defined', this.exports);
this.defineEmitComplete = true;
}
}
},
callPlugin: function () {
var map = this.map,
id = map.id,
//Map already normalized the prefix.
pluginMap = makeModuleMap(map.prefix);
//Mark this as a dependency for this plugin, so it
//can be traced for cycles.
this.depMaps.push(pluginMap);
on(pluginMap, 'defined', bind(this, function (plugin) {
var load, normalizedMap, normalizedMod,
name = this.map.name,
parentName = this.map.parentMap ? this.map.parentMap.name : null,
localRequire = context.makeRequire(map.parentMap, {
enableBuildCallback: true
});
//If current map is not normalized, wait for that
//normalized name to load instead of continuing.
if (this.map.unnormalized) {
//Normalize the ID if the plugin allows it.
if (plugin.normalize) {
name = plugin.normalize(name, function (name) {
return normalize(name, parentName, true);
}) || '';
}
//prefix and name should already be normalized, no need
//for applying map config again either.
normalizedMap = makeModuleMap(map.prefix + '!' + name,
this.map.parentMap);
on(normalizedMap,
'defined', bind(this, function (value) {
this.init([], function () { return value; }, null, {
enabled: true,
ignore: true
});
}));
normalizedMod = getOwn(registry, normalizedMap.id);
if (normalizedMod) {
//Mark this as a dependency for this plugin, so it
//can be traced for cycles.
this.depMaps.push(normalizedMap);
if (this.events.error) {
normalizedMod.on('error', bind(this, function (err) {
this.emit('error', err);
}));
}
normalizedMod.enable();
}
return;
}
load = bind(this, function (value) {
this.init([], function () { return value; }, null, {
enabled: true
});
});
load.error = bind(this, function (err) {
this.inited = true;
this.error = err;
err.requireModules = [id];
//Remove temp unnormalized modules for this module,
//since they will never be resolved otherwise now.
eachProp(registry, function (mod) {
if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
cleanRegistry(mod.map.id);
}
});
onError(err);
});
//Allow plugins to load other code without having to know the
//context or how to 'complete' the load.
load.fromText = bind(this, function (text, textAlt) {
/*jslint evil: true */
var moduleName = map.name,
moduleMap = makeModuleMap(moduleName),
hasInteractive = useInteractive;
//As of 2.1.0, support just passing the text, to reinforce
//fromText only being called once per resource. Still
//support old style of passing moduleName but discard
//that moduleName in favor of the internal ref.
if (textAlt) {
text = textAlt;
}
//Turn off interactive script matching for IE for any define
//calls in the text, then turn it back on at the end.
if (hasInteractive) {
useInteractive = false;
}
//Prime the system by creating a module instance for
//it.
getModule(moduleMap);
//Transfer any config to this other module.
if (hasProp(config.config, id)) {
config.config[moduleName] = config.config[id];
}
try {
req.exec(text);
} catch (e) {
return onError(makeError('fromtexteval',
'fromText eval for ' + id +
' failed: ' + e,
e,
[id]));
}
if (hasInteractive) {
useInteractive = true;
}
//Mark this as a dependency for the plugin
//resource
this.depMaps.push(moduleMap);
//Support anonymous modules.
context.completeLoad(moduleName);
//Bind the value of that module to the value for this
//resource ID.
localRequire([moduleName], load);
});
//Use parentName here since the plugin's name is not reliable,
//could be some weird string with no path that actually wants to
//reference the parentName's path.
plugin.load(map.name, localRequire, load, config);
}));
context.enable(pluginMap, this);
this.pluginMaps[pluginMap.id] = pluginMap;
},
enable: function () {
enabledRegistry[this.map.id] = this;
this.enabled = true;
//Set flag mentioning that the module is enabling,
//so that immediate calls to the defined callbacks
//for dependencies do not trigger inadvertent load
//with the depCount still being zero.
this.enabling = true;
//Enable each dependency
each(this.depMaps, bind(this, function (depMap, i) {
var id, mod, handler;
if (typeof depMap === 'string') {
//Dependency needs to be converted to a depMap
//and wired up to this module.
depMap = makeModuleMap(depMap,
(this.map.isDefine ? this.map : this.map.parentMap),
false,
!this.skipMap);
this.depMaps[i] = depMap;
handler = getOwn(handlers, depMap.id);
if (handler) {
this.depExports[i] = handler(this);
return;
}
this.depCount += 1;
on(depMap, 'defined', bind(this, function (depExports) {
this.defineDep(i, depExports);
this.check();
}));
if (this.errback) {
on(depMap, 'error', this.errback);
}
}
id = depMap.id;
mod = registry[id];
//Skip special modules like 'require', 'exports', 'module'
//Also, don't call enable if it is already enabled,
//important in circular dependency cases.
if (!hasProp(handlers, id) && mod && !mod.enabled) {
context.enable(depMap, this);
}
}));
//Enable each plugin that is used in
//a dependency
eachProp(this.pluginMaps, bind(this, function (pluginMap) {
var mod = getOwn(registry, pluginMap.id);
if (mod && !mod.enabled) {
context.enable(pluginMap, this);
}
}));
this.enabling = false;
this.check();
},
on: function (name, cb) {
var cbs = this.events[name];
if (!cbs) {
cbs = this.events[name] = [];
}
cbs.push(cb);
},
emit: function (name, evt) {
each(this.events[name], function (cb) {
cb(evt);
});
if (name === 'error') {
//Now that the error handler was triggered, remove
//the listeners, since this broken Module instance
//can stay around for a while in the registry.
delete this.events[name];
}
}
};
function callGetModule(args) {
//Skip modules already defined.
if (!hasProp(defined, args[0])) {
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
}
}
function removeListener(node, func, name, ieName) {
//Favor detachEvent because of IE9
//issue, see attachEvent/addEventListener comment elsewhere
//in this file.
if (node.detachEvent && !isOpera) {
//Probably IE. If not it will throw an error, which will be
//useful to know.
if (ieName) {
node.detachEvent(ieName, func);
}
} else {
node.removeEventListener(name, func, false);
}
}
/**
* Given an event from a script node, get the requirejs info from it,
* and then removes the event listeners on the node.
* @param {Event} evt
* @returns {Object}
*/
function getScriptData(evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
var node = evt.currentTarget || evt.srcElement;
//Remove the listeners once here.
removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
removeListener(node, context.onScriptError, 'error');
return {
node: node,
id: node && node.getAttribute('data-requiremodule')
};
}
function intakeDefines() {
var args;
//Any defined modules in the global queue, intake them now.
takeGlobalQueue();
//Make sure any remaining defQueue items get properly processed.
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
} else {
//args are id, deps, factory. Should be normalized by the
//define() function.
callGetModule(args);
}
}
}
context = {
config: config,
contextName: contextName,
registry: registry,
defined: defined,
urlFetched: urlFetched,
defQueue: defQueue,
Module: Module,
makeModuleMap: makeModuleMap,
nextTick: req.nextTick,
onError: onError,
/**
* Set a configuration for the context.
* @param {Object} cfg config object to integrate.
*/
configure: function (cfg) {
//Make sure the baseUrl ends in a slash.
if (cfg.baseUrl) {
if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
cfg.baseUrl += '/';
}
}
//Save off the paths and packages since they require special processing,
//they are additive.
var pkgs = config.pkgs,
shim = config.shim,
objs = {
paths: true,
config: true,
map: true
};
eachProp(cfg, function (value, prop) {
if (objs[prop]) {
if (prop === 'map') {
if (!config.map) {
config.map = {};
}
mixin(config[prop], value, true, true);
} else {
mixin(config[prop], value, true);
}
} else {
config[prop] = value;
}
});
//Merge shim
if (cfg.shim) {
eachProp(cfg.shim, function (value, id) {
//Normalize the structure
if (isArray(value)) {
value = {
deps: value
};
}
if ((value.exports || value.init) && !value.exportsFn) {
value.exportsFn = context.makeShimExports(value);
}
shim[id] = value;
});
config.shim = shim;
}
//Adjust packages if necessary.
if (cfg.packages) {
each(cfg.packages, function (pkgObj) {
var location;
pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
location = pkgObj.location;
//Create a brand new object on pkgs, since currentPackages can
//be passed in again, and config.pkgs is the internal transformed
//state for all package configs.
pkgs[pkgObj.name] = {
name: pkgObj.name,
location: location || pkgObj.name,
//Remove leading dot in main, so main paths are normalized,
//and remove any trailing .js, since different package
//envs have different conventions: some use a module name,
//some use a file name.
main: (pkgObj.main || 'main')
.replace(currDirRegExp, '')
.replace(jsSuffixRegExp, '')
};
});
//Done with modifications, assing packages back to context config
config.pkgs = pkgs;
}
//If there are any "waiting to execute" modules in the registry,
//update the maps for them, since their info, like URLs to load,
//may have changed.
eachProp(registry, function (mod, id) {
//If module already has init called, since it is too
//late to modify them, and ignore unnormalized ones
//since they are transient.
if (!mod.inited && !mod.map.unnormalized) {
mod.map = makeModuleMap(id);
}
});
//If a deps array or a config callback is specified, then call
//require with those args. This is useful when require is defined as a
//config object before require.js is loaded.
if (cfg.deps || cfg.callback) {
context.require(cfg.deps || [], cfg.callback);
}
},
makeShimExports: function (value) {
function fn() {
var ret;
if (value.init) {
ret = value.init.apply(global, arguments);
}
return ret || (value.exports && getGlobal(value.exports));
}
return fn;
},
makeRequire: function (relMap, options) {
options = options || {};
function localRequire(deps, callback, errback) {
var id, map, requireMod;
if (options.enableBuildCallback && callback && isFunction(callback)) {
callback.__requireJsBuild = true;
}
if (typeof deps === 'string') {
if (isFunction(callback)) {
//Invalid call
return onError(makeError('requireargs', 'Invalid require call'), errback);
}
//If require|exports|module are requested, get the
//value for them from the special handlers. Caveat:
//this only works while module is being defined.
if (relMap && hasProp(handlers, deps)) {
return handlers[deps](registry[relMap.id]);
}
//Synchronous access to one module. If require.get is
//available (as in the Node adapter), prefer that.
if (req.get) {
return req.get(context, deps, relMap, localRequire);
}
//Normalize module name, if it contains . or ..
map = makeModuleMap(deps, relMap, false, true);
id = map.id;
if (!hasProp(defined, id)) {
return onError(makeError('notloaded', 'Module name "' +
id +
'" has not been loaded yet for context: ' +
contextName +
(relMap ? '' : '. Use require([])')));
}
return defined[id];
}
//Grab defines waiting in the global queue.
intakeDefines();
//Mark all the dependencies as needing to be loaded.
context.nextTick(function () {
//Some defines could have been added since the
//require call, collect them.
intakeDefines();
requireMod = getModule(makeModuleMap(null, relMap));
//Store if map config should be applied to this require
//call for dependencies.
requireMod.skipMap = options.skipMap;
requireMod.init(deps, callback, errback, {
enabled: true
});
checkLoaded();
});
return localRequire;
}
mixin(localRequire, {
isBrowser: isBrowser,
/**
* Converts a module name + .extension into an URL path.
* *Requires* the use of a module name. It does not support using
* plain URLs like nameToUrl.
*/
toUrl: function (moduleNamePlusExt) {
var ext,
index = moduleNamePlusExt.lastIndexOf('.'),
segment = moduleNamePlusExt.split('/')[0],
isRelative = segment === '.' || segment === '..';
//Have a file extension alias, and it is not the
//dots from a relative path.
if (index !== -1 && (!isRelative || index > 1)) {
ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
}
return context.nameToUrl(normalize(moduleNamePlusExt,
relMap && relMap.id, true), ext, true);
},
defined: function (id) {
return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
},
specified: function (id) {
id = makeModuleMap(id, relMap, false, true).id;
return hasProp(defined, id) || hasProp(registry, id);
}
});
//Only allow undef on top level require calls
if (!relMap) {
localRequire.undef = function (id) {
//Bind any waiting define() calls to this context,
//fix for #408
takeGlobalQueue();
var map = makeModuleMap(id, relMap, true),
mod = getOwn(registry, id);
delete defined[id];
delete urlFetched[map.url];
delete undefEvents[id];
if (mod) {
//Hold on to listeners in case the
//module will be attempted to be reloaded
//using a different config.
if (mod.events.defined) {
undefEvents[id] = mod.events;
}
cleanRegistry(id);
}
};
}
return localRequire;
},
/**
* Called to enable a module if it is still in the registry
* awaiting enablement. A second arg, parent, the parent module,
* is passed in for context, when this method is overriden by
* the optimizer. Not shown here to keep code compact.
*/
enable: function (depMap) {
var mod = getOwn(registry, depMap.id);
if (mod) {
getModule(depMap).enable();
}
},
/**
* Internal method used by environment adapters to complete a load event.
* A load event could be a script load or just a load pass from a synchronous
* load call.
* @param {String} moduleName the name of the module to potentially complete.
*/
completeLoad: function (moduleName) {
var found, args, mod,
shim = getOwn(config.shim, moduleName) || {},
shExports = shim.exports;
takeGlobalQueue();
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
args[0] = moduleName;
//If already found an anonymous module and bound it
//to this name, then this is some other anon module
//waiting for its completeLoad to fire.
if (found) {
break;
}
found = true;
} else if (args[0] === moduleName) {
//Found matching define call for this script!
found = true;
}
callGetModule(args);
}
//Do this after the cycle of callGetModule in case the result
//of those calls/init calls changes the registry.
mod = getOwn(registry, moduleName);
if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
if (hasPathFallback(moduleName)) {
return;
} else {
return onError(makeError('nodefine',
'No define call for ' + moduleName,
null,
[moduleName]));
}
} else {
//A script that does not call define(), so just simulate
//the call for it.
callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
}
}
checkLoaded();
},
/**
* Converts a module name to a file path. Supports cases where
* moduleName may actually be just an URL.
* Note that it **does not** call normalize on the moduleName,
* it is assumed to have already been normalized. This is an
* internal API, not a public one. Use toUrl for the public API.
*/
nameToUrl: function (moduleName, ext, skipExt) {
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
parentPath;
//If a colon is in the URL, it indicates a protocol is used and it is just
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
//or ends with .js, then assume the user meant to use an url and not a module id.
//The slash is important for protocol-less URLs as well as full paths.
if (req.jsExtRegExp.test(moduleName)) {
//Just a plain path, not module name lookup, so just return it.
//Add extension if it is included. This is a bit wonky, only non-.js things pass
//an extension, this method probably needs to be reworked.
url = moduleName + (ext || '');
} else {
//A module that needs to be converted to a path.
paths = config.paths;
pkgs = config.pkgs;
syms = moduleName.split('/');
//For each module name segment, see if there is a path
//registered for it. Start with most specific name
//and work up from it.
for (i = syms.length; i > 0; i -= 1) {
parentModule = syms.slice(0, i).join('/');
pkg = getOwn(pkgs, parentModule);
parentPath = getOwn(paths, parentModule);
if (parentPath) {
//If an array, it means there are a few choices,
//Choose the one that is desired
if (isArray(parentPath)) {
parentPath = parentPath[0];
}
syms.splice(0, i, parentPath);
break;
} else if (pkg) {
//If module name is just the package name, then looking
//for the main module.
if (moduleName === pkg.name) {
pkgPath = pkg.location + '/' + pkg.main;
} else {
pkgPath = pkg.location;
}
syms.splice(0, i, pkgPath);
break;
}
}
//Join the path parts together, then figure out if baseUrl is needed.
url = syms.join('/');
url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
}
return config.urlArgs ? url +
((url.indexOf('?') === -1 ? '?' : '&') +
config.urlArgs) : url;
},
//Delegates to req.load. Broken out as a separate function to
//allow overriding in the optimizer.
load: function (id, url) {
req.load(context, id, url);
},
/**
* Executes a module callack function. Broken out as a separate function
* solely to allow the build system to sequence the files in the built
* layer in the right sequence.
*
* @private
*/
execCb: function (name, callback, args, exports) {
return callback.apply(exports, args);
},
/**
* callback for script loads, used to check status of loading.
*
* @param {Event} evt the event from the browser for the script
* that was loaded.
*/
onScriptLoad: function (evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
if (evt.type === 'load' ||
(readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
//Reset interactive script so a script node is not held onto for
//to long.
interactiveScript = null;
//Pull out the name of the module and the context.
var data = getScriptData(evt);
context.completeLoad(data.id);
}
},
/**
* Callback for script errors.
*/
onScriptError: function (evt) {
var data = getScriptData(evt);
if (!hasPathFallback(data.id)) {
return onError(makeError('scripterror', 'Script error', evt, [data.id]));
}
}
};
context.require = context.makeRequire();
return context;
}
/**
* Main entry point.
*
* If the only argument to require is a string, then the module that
* is represented by that string is fetched for the appropriate context.
*
* If the first argument is an array, then it will be treated as an array
* of dependency string names to fetch. An optional function callback can
* be specified to execute when all of those dependencies are available.
*
* Make a local req variable to help Caja compliance (it assumes things
* on a require that are not standardized), and to give a short
* name for minification/local scope use.
*/
req = requirejs = function (deps, callback, errback, optional) {
//Find the right context, use default
var context, config,
contextName = defContextName;
// Determine if have config object in the call.
if (!isArray(deps) && typeof deps !== 'string') {
// deps is a config object
config = deps;
if (isArray(callback)) {
// Adjust args if there are dependencies
deps = callback;
callback = errback;
errback = optional;
} else {
deps = [];
}
}
if (config && config.context) {
contextName = config.context;
}
context = getOwn(contexts, contextName);
if (!context) {
context = contexts[contextName] = req.s.newContext(contextName);
}
if (config) {
context.configure(config);
}
return context.require(deps, callback, errback);
};
/**
* Support require.config() to make it easier to cooperate with other
* AMD loaders on globally agreed names.
*/
req.config = function (config) {
return req(config);
};
/**
* Execute something after the current tick
* of the event loop. Override for other envs
* that have a better solution than setTimeout.
* @param {Function} fn function to execute later.
*/
req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
setTimeout(fn, 4);
} : function (fn) { fn(); };
/**
* Export require as a global, but only if it does not already exist.
*/
if (!require) {
require = req;
}
req.version = version;
//Used to filter out dependencies that are already paths.
req.jsExtRegExp = /^\/|:|\?|\.js$/;
req.isBrowser = isBrowser;
s = req.s = {
contexts: contexts,
newContext: newContext
};
//Create default context.
req({});
//Exports some context-sensitive methods on global require.
each([
'toUrl',
'undef',
'defined',
'specified'
], function (prop) {
//Reference from contexts instead of early binding to default context,
//so that during builds, the latest instance of the default context
//with its config gets used.
req[prop] = function () {
var ctx = contexts[defContextName];
return ctx.require[prop].apply(ctx, arguments);
};
});
if (isBrowser) {
head = s.head = document.getElementsByTagName('head')[0];
//If BASE tag is in play, using appendChild is a problem for IE6.
//When that browser dies, this can be removed. Details in this jQuery bug:
//http://dev.jquery.com/ticket/2709
baseElement = document.getElementsByTagName('base')[0];
if (baseElement) {
head = s.head = baseElement.parentNode;
}
}
/**
* Any errors that require explicitly generates will be passed to this
* function. Intercept/override it if you want custom error handling.
* @param {Error} err the error object.
*/
req.onError = function (err) {
throw err;
};
/**
* Does the request to load a module for the browser case.
* Make this a separate function to allow other environments
* to override it.
*
* @param {Object} context the require context to find state.
* @param {String} moduleName the name of the module.
* @param {Object} url the URL to the module.
*/
req.load = function (context, moduleName, url) {
var config = (context && context.config) || {},
node;
if (isBrowser) {
//In the browser so use a script tag
node = config.xhtml ?
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
document.createElement('script');
node.type = config.scriptType || 'text/javascript';
node.charset = 'utf-8';
node.async = true;
node.setAttribute('data-requirecontext', context.contextName);
node.setAttribute('data-requiremodule', moduleName);
//Set up load listener. Test attachEvent first because IE9 has
//a subtle issue in its addEventListener and script onload firings
//that do not match the behavior of all other browsers with
//addEventListener support, which fire the onload event for a
//script right after the script execution. See:
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
//script execution mode.
if (node.attachEvent &&
//Check if node.attachEvent is artificially added by custom script or
//natively supported by browser
//read https://github.com/jrburke/requirejs/issues/187
//if we can NOT find [native code] then it must NOT natively supported.
//in IE8, node.attachEvent does not have toString()
//Note the test for "[native code" with no closing brace, see:
//https://github.com/jrburke/requirejs/issues/273
!(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
!isOpera) {
//Probably IE. IE (at least 6-8) do not fire
//script onload right after executing the script, so
//we cannot tie the anonymous define call to a name.
//However, IE reports the script as being in 'interactive'
//readyState at the time of the define call.
useInteractive = true;
node.attachEvent('onreadystatechange', context.onScriptLoad);
//It would be great to add an error handler here to catch
//404s in IE9+. However, onreadystatechange will fire before
//the error handler, so that does not help. If addEventListener
//is used, then IE will fire error before load, but we cannot
//use that pathway given the connect.microsoft.com issue
//mentioned above about not doing the 'script execute,
//then fire the script load event listener before execute
//next script' that other browsers do.
//Best hope: IE10 fixes the issues,
//and then destroys all installs of IE 6-9.
//node.attachEvent('onerror', context.onScriptError);
} else {
node.addEventListener('load', context.onScriptLoad, false);
node.addEventListener('error', context.onScriptError, false);
}
node.src = url;
//For some cache cases in IE 6-8, the script executes before the end
//of the appendChild execution, so to tie an anonymous define
//call to the module name (which is stored on the node), hold on
//to a reference to this node, but clear after the DOM insertion.
currentlyAddingScript = node;
if (baseElement) {
head.insertBefore(node, baseElement);
} else {
head.appendChild(node);
}
currentlyAddingScript = null;
return node;
} else if (isWebWorker) {
try {
//In a web worker, use importScripts. This is not a very
//efficient use of importScripts, importScripts will block until
//its script is downloaded and evaluated. However, if web workers
//are in play, the expectation that a build has been done so that
//only one script needs to be loaded anyway. This may need to be
//reevaluated if other use cases become common.
importScripts(url);
//Account for anonymous modules
context.completeLoad(moduleName);
} catch (e) {
context.onError(makeError('importscripts',
'importScripts failed for ' +
moduleName + ' at ' + url,
e,
[moduleName]));
}
}
};
function getInteractiveScript() {
if (interactiveScript && interactiveScript.readyState === 'interactive') {
return interactiveScript;
}
eachReverse(scripts(), function (script) {
if (script.readyState === 'interactive') {
return (interactiveScript = script);
}
});
return interactiveScript;
}
//Look for a data-main script attribute, which could also adjust the baseUrl.
if (isBrowser) {
//Figure out baseUrl. Get it from the script tag with require.js in it.
eachReverse(scripts(), function (script) {
//Set the 'head' where we can append children by
//using the script's parent.
if (!head) {
head = script.parentNode;
}
//Look for a data-main attribute to set main script for the page
//to load. If it is there, the path to data main becomes the
//baseUrl, if it is not already set.
dataMain = script.getAttribute('data-main');
if (dataMain) {
//Set final baseUrl if there is not already an explicit one.
if (!cfg.baseUrl) {
//Pull off the directory of data-main for use as the
//baseUrl.
src = dataMain.split('/');
mainScript = src.pop();
subPath = src.length ? src.join('/') + '/' : './';
cfg.baseUrl = subPath;
dataMain = mainScript;
}
//Strip off any trailing .js since dataMain is now
//like a module name.
dataMain = dataMain.replace(jsSuffixRegExp, '');
//Put the data-main script in the files to load.
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
return true;
}
});
}
/**
* The function that handles definitions of modules. Differs from
* require() in that a string for the module should be the first argument,
* and the function to execute after dependencies are loaded should
* return a value to define the module corresponding to the first argument's
* name.
*/
define = function (name, deps, callback) {
var node, context;
//Allow for anonymous modules
if (typeof name !== 'string') {
//Adjust args appropriately
callback = deps;
deps = name;
name = null;
}
//This module may not have dependencies
if (!isArray(deps)) {
callback = deps;
deps = [];
}
//If no name, and callback is a function, then figure out if it a
//CommonJS thing with dependencies.
if (!deps.length && isFunction(callback)) {
//Remove comments from the callback string,
//look for require calls, and pull them into the dependencies,
//but only if there are function args.
if (callback.length) {
callback
.toString()
.replace(commentRegExp, '')
.replace(cjsRequireRegExp, function (match, dep) {
deps.push(dep);
});
//May be a CommonJS thing even without require calls, but still
//could use exports, and module. Avoid doing exports and module
//work though if it just needs require.
//REQUIRES the function to expect the CommonJS variables in the
//order listed below.
deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
}
}
//If in IE 6-8 and hit an anonymous define() call, do the interactive
//work.
if (useInteractive) {
node = currentlyAddingScript || getInteractiveScript();
if (node) {
if (!name) {
name = node.getAttribute('data-requiremodule');
}
context = contexts[node.getAttribute('data-requirecontext')];
}
}
//Always save off evaluating the def call until the script onload handler.
//This allows multiple modules to be in a file without prematurely
//tracing dependencies, and allows for anonymous module support,
//where the module name is not known until the script onload event
//occurs. If no context, use the global queue, and get it processed
//in the onscript load callback.
(context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
};
define.amd = {
jQuery: true
};
/**
* Executes the text. Normally just uses eval, but can be modified
* to use a better, environment-specific call. Only used for transpiling
* loader plugins, not for plain JS modules.
* @param {String} text the text to execute/evaluate.
*/
req.exec = function (text) {
/*jslint evil: true */
return eval(text);
};
//Set up with config info.
req(cfg);
}(this));
var components = {
"packages": [
{
"name": "jquery",
"main": "jquery-built.js"
},
{
"name": "moment",
"main": "moment-built.js"
}
],
"baseUrl": "components"
};
if (typeof require !== "undefined" && require.config) {
require.config(components);
} else {
var require = components;
}
if (typeof exports !== "undefined" && typeof module !== "undefined") {
module.exports = components;
} |
'use strict';
import gulp from 'gulp';
import htmlhint from 'gulp-htmlhint';
import paths from '../paths';
import {ENV} from '../utils.js';
/**
* The 'htmlhint' task defines the rules of our hinter as well as which files we
* should check. It helps to detect errors and potential problems in our
* HTML code.
*
* Can also be executed in test env, like the jshint task
*
* @return {Stream}
*/
gulp.task('htmlhint', () => {
var src;
switch (ENV) {
case 'test':
src = [].concat(paths.app.html, paths.app.templates, paths.test.fixtures);
break;
case 'dev':
default:
src = [].concat(paths.app.html, paths.app.templates);
break;
}
return gulp.src(src)
.pipe(htmlhint('.htmlhintrc'))
.pipe(htmlhint.reporter())
.pipe(htmlhint.failReporter());
});
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'about', 'en-ca', {
copy: 'Copyright © $1. All rights reserved.',
dlgTitle: 'About CKEditor',
help: 'Check $1 for help.', // MISSING
moreInfo: 'For licensing information please visit our web site:',
title: 'About CKEditor',
userGuide: 'CKEditor User\'s Guide'
});
|
const escapeBackticks = (string) => string.replace(/`/g, '\\`');
module.exports = (
body,
{
category,
id,
title,
description,
published,
siteName,
section,
next,
author,
},
isHomepage = false
) =>
isHomepage
? `
import marksy from 'marksy';
import Homepage from '~/components/template';
import { A, H1, H2, H3, H4, H5, P, Li, Ol, Ul, Hr, Code, Blockquote, ArticleHeader, Video } from '~/templates/global/styled';
import { createElement } from 'react';
const convertMarkdown = marksy({
createElement,
elements: {
a: A,
h1: ArticleHeader,
h2: H2,
h3: H3,
h4: H4,
h5: H5,
p: P,
code: Code,
li: Li,
ol: Ol,
ul: Ul,
hr: Hr,
blockquote: Blockquote,
}
});
const Page = ({ section }) => (
<Homepage tableOfContents={content.toc}>
{content.tree}
</Homepage>
);
const content = convertMarkdown(\`${escapeBackticks(body)}\`);
export default Page;
`
: `
import { createElement } from 'react';
import marksy from 'marksy/jsx';
import { A, H1, H2, H3, H4, H5, P, Li, Ol, Ul, Hr, Code, Blockquote, ArticleHeader, Video } from '~/templates/global/styled';
import { Img } from '~/templates/content/styled';
import ContentTemplate from '~/templates/content/Template';
import Example from '~/components/examples/Example';
import CodePen from '~/components/examples/CodePen';
import CodeSandbox from '~/components/examples/CodeSandbox';
import TOC from '~/templates/content/TableOfContents';
const removeEmpty = filename => filename !== '';
const convertMarkdown = marksy({
createElement,
elements: {
a: A,
h1: ArticleHeader,
h2: H2,
h3: H3,
h4: H4,
h5: H5,
p: P,
code: Code,
li: Li,
ol: Ol,
ul: Ul,
hr: Hr,
img: Img,
blockquote: Blockquote,
},
components: {
Example,
CodePen,
Video,
TOC: () => <TOC toc={content.toc} />,
CodeSandbox
}
});
const content = convertMarkdown(\`${escapeBackticks(body)}\`);
const Page = ({ section }) => (
<ContentTemplate
id="${id}"
section="${section}"
${category && `category="${category}"`}
title="${title}"
description="${description}"
published="${published}"
author="${author}"
theme="${siteName}"
${next && `next="${next}"`}
>
{content.tree}
</ContentTemplate>
);
export default Page;
`;
|
'use strict';
require('mocha');
var assert = require('assert');
var update = require('..');
var app;
describe('app.cli', function() {
beforeEach(function() {
app = update({cli: true});
});
describe('app.cli.map', function() {
it('should add a property to app.cli', function() {
app.cli.map('abc', function() {});
assert.equal(app.cli.keys.pop(), 'abc');
});
});
});
|
require('./warning-esm-transpiled-a.js').missingPropESM;
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
(function(global) {
global.ng = global.ng || {};
global.ng.common = global.ng.common || {};
global.ng.common.locales = global.ng.common.locales || {};
const u = undefined;
function plural(n) {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0) return 1;
return 5;
}
global.ng.common.locales['en-lc'] = [
'en-LC',
[['a', 'p'], ['am', 'pm'], u],
[['am', 'pm'], u, u],
[
['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
],
u,
[
['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
[
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'
]
],
u,
[['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']],
1,
[6, 0],
['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE, d MMMM y'],
['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],
['{1}, {0}', u, '{1} \'at\' {0}', u],
['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'],
'XCD',
'$',
'East Caribbean Dollar',
{'JPY': ['JP¥', '¥'], 'USD': ['US$', '$'], 'XCD': ['$']},
'ltr',
plural,
[
[
['mi', 'n', 'in the morning', 'in the afternoon', 'in the evening', 'at night'],
['midnight', 'noon', 'in the morning', 'in the afternoon', 'in the evening', 'at night'], u
],
[['midnight', 'noon', 'morning', 'afternoon', 'evening', 'night'], u, u],
[
'00:00', '12:00', ['06:00', '12:00'], ['12:00', '18:00'], ['18:00', '21:00'],
['21:00', '06:00']
]
]
];
})(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global ||
typeof window !== 'undefined' && window);
|
const tuple1 = #[1, 2, 3];
|
const AuthenticationServiceException = Jymfony.Component.Security.Exception.AuthenticationServiceException;
/**
* This exception is thrown when an account is reloaded from a provider which
* doesn't support the passed implementation of UserInterface.
*
* @memberOf Jymfony.Component.Security.Exception
*/
export default class UnsupportedUserException extends AuthenticationServiceException {
}
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'css/hover.css': 'scss/hover.scss'
}
}
},
autoprefixer: {
options: {
browsers: ['last 2 version', 'ie 8', 'ie 9']
},
multiple_files: {
expand: true,
flatten: true,
src: 'css/*.css',
dest: 'css/'
}
},
cssmin: {
combine: {
files: {
'css/hover-min.css': ['css/hover.css']
}
}
},
watch: {
options: {
livereload: true,
},
css: {
files: ['scss/**/*.scss', 'css/*.css', '*.html'],
tasks: ['sass', 'autoprefixer', 'cssmin'],
options: {
spawn: false,
}
}
},
connect: {
server: {
options: {
port: 8000,
base: './'
}
}
},
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['connect', 'watch']);
}; |
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, Input, Optional, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { clamp, isPresent, isTrueProperty } from '../../util/util';
import { Config } from '../../config/config';
import { DomController } from '../../platform/dom-controller';
import { Form } from '../../util/form';
import { Haptic } from '../../tap-click/haptic';
import { Ion } from '../ion';
import { Item } from '../item/item';
import { Platform } from '../../platform/platform';
import { pointerCoord } from '../../util/dom';
import { TimeoutDebouncer } from '../../util/debouncer';
import { UIEventManager } from '../../gestures/ui-event-manager';
export const RANGE_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => Range),
multi: true
};
/**
* @name Range
* @description
* The Range slider lets users select from a range of values by moving
* the slider knob. It can accept dual knobs, but by default one knob
* controls the value of the range.
*
* ### Range Labels
* Labels can be placed on either side of the range by adding the
* `range-left` or `range-right` property to the element. The element
* doesn't have to be an `ion-label`, it can be added to any element
* to place it to the left or right of the range. See [usage](#usage)
* below for examples.
*
*
* ### Minimum and Maximum Values
* Minimum and maximum values can be passed to the range through the `min`
* and `max` properties, respectively. By default, the range sets the `min`
* to `0` and the `max` to `100`.
*
*
* ### Steps and Snaps
* The `step` property specifies the value granularity of the range's value.
* It can be useful to set the `step` when the value isn't in increments of `1`.
* Setting the `step` property will show tick marks on the range for each step.
* The `snaps` property can be set to automatically move the knob to the nearest
* tick mark based on the step property value.
*
*
* ### Dual Knobs
* Setting the `dualKnobs` property to `true` on the range component will
* enable two knobs on the range. If the range has two knobs, the value will
* be an object containing two properties: `lower` and `upper`.
*
*
* @usage
* ```html
* <ion-list>
* <ion-item>
* <ion-range [(ngModel)]="singleValue" color="danger" pin="true"></ion-range>
* </ion-item>
*
* <ion-item>
* <ion-range min="-200" max="200" [(ngModel)]="saturation" color="secondary">
* <ion-label range-left>-200</ion-label>
* <ion-label range-right>200</ion-label>
* </ion-range>
* </ion-item>
*
* <ion-item>
* <ion-range min="20" max="80" step="2" [(ngModel)]="brightness">
* <ion-icon small range-left name="sunny"></ion-icon>
* <ion-icon range-right name="sunny"></ion-icon>
* </ion-range>
* </ion-item>
*
* <ion-item>
* <ion-label>step=100, snaps, {{singleValue4}}</ion-label>
* <ion-range min="1000" max="2000" step="100" snaps="true" color="secondary" [(ngModel)]="singleValue4"></ion-range>
* </ion-item>
*
* <ion-item>
* <ion-label>dual, step=3, snaps, {{dualValue2 | json}}</ion-label>
* <ion-range dualKnobs="true" [(ngModel)]="dualValue2" min="21" max="72" step="3" snaps="true"></ion-range>
* </ion-item>
* </ion-list>
* ```
*
*
* @demo /docs/v2/demos/src/range/
*/
export class Range extends Ion {
constructor(_form, _haptic, _item, config, _plt, elementRef, renderer, _dom, _cd) {
super(config, elementRef, renderer, 'range');
this._form = _form;
this._haptic = _haptic;
this._item = _item;
this._plt = _plt;
this._dom = _dom;
this._cd = _cd;
this._disabled = false;
this._min = 0;
this._max = 100;
this._step = 1;
this._valA = 0;
this._valB = 0;
this._ratioA = 0;
this._ratioB = 0;
this._debouncer = new TimeoutDebouncer(0);
/**
* @output {Range} Emitted when the range value changes.
*/
this.ionChange = new EventEmitter();
this._events = new UIEventManager(_plt);
_form.register(this);
if (_item) {
this.id = 'rng-' + _item.registerInput('range');
this._lblId = 'lbl-' + _item.id;
_item.setElementClass('item-range', true);
}
}
/**
* @input {string} The color to use from your Sass `$colors` map.
* Default options are: `"primary"`, `"secondary"`, `"danger"`, `"light"`, and `"dark"`.
* For more information, see [Theming your App](/docs/v2/theming/theming-your-app).
*/
set color(val) {
this._setColor(val);
}
/**
* @input {string} The mode determines which platform styles to use.
* Possible values are: `"ios"`, `"md"`, or `"wp"`.
* For more information, see [Platform Styles](/docs/v2/theming/platform-specific-styles).
*/
set mode(val) {
this._setMode(val);
}
/**
* @input {number} Minimum integer value of the range. Defaults to `0`.
*/
get min() {
return this._min;
}
set min(val) {
val = Math.round(val);
if (!isNaN(val)) {
this._min = val;
}
}
/**
* @input {number} Maximum integer value of the range. Defaults to `100`.
*/
get max() {
return this._max;
}
set max(val) {
val = Math.round(val);
if (!isNaN(val)) {
this._max = val;
}
}
/**
* @input {number} Specifies the value granularity. Defaults to `1`.
*/
get step() {
return this._step;
}
set step(val) {
val = Math.round(val);
if (!isNaN(val) && val > 0) {
this._step = val;
}
}
/**
* @input {boolean} If true, the knob snaps to tick marks evenly spaced based
* on the step property value. Defaults to `false`.
*/
get snaps() {
return this._snaps;
}
set snaps(val) {
this._snaps = isTrueProperty(val);
}
/**
* @input {boolean} If true, a pin with integer value is shown when the knob
* is pressed. Defaults to `false`.
*/
get pin() {
return this._pin;
}
set pin(val) {
this._pin = isTrueProperty(val);
}
/**
* @input {number} How long, in milliseconds, to wait to trigger the
* `ionChange` event after each change in the range value. Default `0`.
*/
get debounce() {
return this._debouncer.wait;
}
set debounce(val) {
this._debouncer.wait = val;
}
/**
* @input {boolean} Show two knobs. Defaults to `false`.
*/
get dualKnobs() {
return this._dual;
}
set dualKnobs(val) {
this._dual = isTrueProperty(val);
}
/**
* @input {boolean} If true, the user cannot interact with this element.
*/
get disabled() {
return this._disabled;
}
set disabled(val) {
this._disabled = val = isTrueProperty(val);
const item = this._item;
item && item.setElementClass('item-range-disabled', val);
}
/**
* Returns the ratio of the knob's is current location, which is a number
* between `0` and `1`. If two knobs are used, this property represents
* the lower value.
*/
get ratio() {
if (this._dual) {
return Math.min(this._ratioA, this._ratioB);
}
return this._ratioA;
}
/**
* Returns the ratio of the upper value's is current location, which is
* a number between `0` and `1`. If there is only one knob, then this
* will return `null`.
*/
get ratioUpper() {
if (this._dual) {
return Math.max(this._ratioA, this._ratioB);
}
return null;
}
/**
* @private
*/
ngAfterViewInit() {
// add touchstart/mousedown listeners
this._events.pointerEvents({
element: this._slider.nativeElement,
pointerDown: this._pointerDown.bind(this),
pointerMove: this._pointerMove.bind(this),
pointerUp: this._pointerUp.bind(this),
zone: true
});
// build all the ticks if there are any to show
this._createTicks();
}
/** @internal */
_pointerDown(ev) {
// TODO: we could stop listening for events instead of checking this._disabled.
// since there are a lot of events involved, this solution is
// enough for the moment
if (this._disabled) {
return false;
}
// prevent default so scrolling does not happen
ev.preventDefault();
ev.stopPropagation();
// get the start coordinates
const current = pointerCoord(ev);
// get the full dimensions of the slider element
const rect = this._rect = this._plt.getElementBoundingClientRect(this._slider.nativeElement);
// figure out which knob they started closer to
const ratio = clamp(0, (current.x - rect.left) / (rect.width), 1);
this._activeB = (Math.abs(ratio - this._ratioA) > Math.abs(ratio - this._ratioB));
// update the active knob's position
this._update(current, rect, true);
// trigger a haptic start
this._haptic.gestureSelectionStart();
// return true so the pointer events
// know everything's still valid
return true;
}
/** @internal */
_pointerMove(ev) {
if (!this._disabled) {
// prevent default so scrolling does not happen
ev.preventDefault();
ev.stopPropagation();
// update the active knob's position
const hasChanged = this._update(pointerCoord(ev), this._rect, true);
if (hasChanged && this._snaps) {
// trigger a haptic selection changed event
// if this is a snap range
this._haptic.gestureSelectionChanged();
}
}
}
/** @internal */
_pointerUp(ev) {
if (!this._disabled) {
// prevent default so scrolling does not happen
ev.preventDefault();
ev.stopPropagation();
// update the active knob's position
this._update(pointerCoord(ev), this._rect, false);
// trigger a haptic end
this._haptic.gestureSelectionEnd();
}
}
/** @internal */
_update(current, rect, isPressed) {
// figure out where the pointer is currently at
// update the knob being interacted with
let ratio = clamp(0, (current.x - rect.left) / (rect.width), 1);
let val = this._ratioToValue(ratio);
if (this._snaps) {
// snaps the ratio to the current value
ratio = this._valueToRatio(val);
}
// update which knob is pressed
this._pressed = isPressed;
if (this._activeB) {
// when the pointer down started it was determined
// that knob B was the one they were interacting with
this._pressedB = isPressed;
this._pressedA = false;
this._ratioB = ratio;
if (val === this._valB) {
// hasn't changed
return false;
}
this._valB = val;
}
else {
// interacting with knob A
this._pressedA = isPressed;
this._pressedB = false;
this._ratioA = ratio;
if (val === this._valA) {
// hasn't changed
return false;
}
this._valA = val;
}
// value has been updated
if (this._dual) {
// dual knobs have an lower and upper value
if (!this.value) {
// ensure we're always updating the same object
this.value = {};
}
this.value.lower = Math.min(this._valA, this._valB);
this.value.upper = Math.max(this._valA, this._valB);
(void 0) /* console.debug */;
}
else {
// single knob only has one value
this.value = this._valA;
(void 0) /* console.debug */;
}
this._debouncer.debounce(() => {
this.onChange(this.value);
this.ionChange.emit(this);
});
this._updateBar();
return true;
}
/** @internal */
_updateBar() {
const ratioA = this._ratioA;
const ratioB = this._ratioB;
if (this._dual) {
this._barL = `${(Math.min(ratioA, ratioB) * 100)}%`;
this._barR = `${100 - (Math.max(ratioA, ratioB) * 100)}%`;
}
else {
this._barL = '';
this._barR = `${100 - (ratioA * 100)}%`;
}
this._updateTicks();
}
/** @internal */
_createTicks() {
if (this._snaps) {
this._dom.write(() => {
// TODO: Fix to not use RAF
this._ticks = [];
for (var value = this._min; value <= this._max; value += this._step) {
var ratio = this._valueToRatio(value);
this._ticks.push({
ratio: ratio,
left: `${ratio * 100}%`,
});
}
this._updateTicks();
});
}
}
/** @internal */
_updateTicks() {
const ticks = this._ticks;
const ratio = this.ratio;
if (this._snaps && ticks) {
if (this._dual) {
var upperRatio = this.ratioUpper;
ticks.forEach(t => {
t.active = (t.ratio >= ratio && t.ratio <= upperRatio);
});
}
else {
ticks.forEach(t => {
t.active = (t.ratio <= ratio);
});
}
}
}
/** @private */
_keyChg(isIncrease, isKnobB) {
const step = this._step;
if (isKnobB) {
if (isIncrease) {
this._valB += step;
}
else {
this._valB -= step;
}
this._valB = clamp(this._min, this._valB, this._max);
this._ratioB = this._valueToRatio(this._valB);
}
else {
if (isIncrease) {
this._valA += step;
}
else {
this._valA -= step;
}
this._valA = clamp(this._min, this._valA, this._max);
this._ratioA = this._valueToRatio(this._valA);
}
this._updateBar();
}
/** @internal */
_ratioToValue(ratio) {
ratio = Math.round(((this._max - this._min) * ratio));
ratio = Math.round(ratio / this._step) * this._step + this._min;
return clamp(this._min, ratio, this._max);
}
/** @internal */
_valueToRatio(value) {
value = Math.round((value - this._min) / this._step) * this._step;
value = value / (this._max - this._min);
return clamp(0, value, 1);
}
/**
* @private
*/
writeValue(val) {
if (isPresent(val)) {
this.value = val;
if (this._dual) {
this._valA = val.lower;
this._valB = val.upper;
this._ratioA = this._valueToRatio(val.lower);
this._ratioB = this._valueToRatio(val.upper);
}
else {
this._valA = val;
this._ratioA = this._valueToRatio(val);
}
this._updateBar();
}
}
/**
* @private
*/
registerOnChange(fn) {
this._fn = fn;
this.onChange = (val) => {
fn(val);
this.onTouched();
};
}
/**
* @private
*/
registerOnTouched(fn) { this.onTouched = fn; }
/**
* @private
*/
onChange(val) {
// used when this input does not have an ngModel or formControlName
this.onTouched();
this._cd.detectChanges();
}
/**
* @private
*/
onTouched() { }
/**
* @private
*/
setDisabledState(isDisabled) {
this.disabled = isDisabled;
}
/**
* @private
*/
ngOnDestroy() {
this._form.deregister(this);
this._events.destroy();
}
}
Range.decorators = [
{ type: Component, args: [{
selector: 'ion-range',
template: '<ng-content select="[range-left]"></ng-content>' +
'<div class="range-slider" #slider>' +
'<div class="range-tick" *ngFor="let t of _ticks" [style.left]="t.left" [class.range-tick-active]="t.active" role="presentation"></div>' +
'<div class="range-bar" role="presentation"></div>' +
'<div class="range-bar range-bar-active" [style.left]="_barL" [style.right]="_barR" #bar role="presentation"></div>' +
'<div class="range-knob-handle" (ionIncrease)="_keyChg(true, false)" (ionDecrease)="_keyChg(false, false)" [ratio]="_ratioA" [val]="_valA" [pin]="_pin" [pressed]="_pressedA" [min]="_min" [max]="_max" [disabled]="_disabled" [labelId]="_lblId"></div>' +
'<div class="range-knob-handle" (ionIncrease)="_keyChg(true, true)" (ionDecrease)="_keyChg(false, true)" [ratio]="_ratioB" [val]="_valB" [pin]="_pin" [pressed]="_pressedB" [min]="_min" [max]="_max" [disabled]="_disabled" [labelId]="_lblId" *ngIf="_dual"></div>' +
'</div>' +
'<ng-content select="[range-right]"></ng-content>',
host: {
'[class.range-disabled]': '_disabled',
'[class.range-pressed]': '_pressed',
'[class.range-has-pin]': '_pin'
},
providers: [RANGE_VALUE_ACCESSOR],
encapsulation: ViewEncapsulation.None,
},] },
];
/** @nocollapse */
Range.ctorParameters = [
{ type: Form, },
{ type: Haptic, },
{ type: Item, decorators: [{ type: Optional },] },
{ type: Config, },
{ type: Platform, },
{ type: ElementRef, },
{ type: Renderer, },
{ type: DomController, },
{ type: ChangeDetectorRef, },
];
Range.propDecorators = {
'_slider': [{ type: ViewChild, args: ['slider',] },],
'color': [{ type: Input },],
'mode': [{ type: Input },],
'min': [{ type: Input },],
'max': [{ type: Input },],
'step': [{ type: Input },],
'snaps': [{ type: Input },],
'pin': [{ type: Input },],
'debounce': [{ type: Input },],
'dualKnobs': [{ type: Input },],
'disabled': [{ type: Input },],
'ionChange': [{ type: Output },],
};
//# sourceMappingURL=range.js.map |
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-example-database
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var path = require('path');
var app = require(path.resolve(__dirname, '../server/server'));
var ds = app.datasources.considr_db;
ds.autoupdate('PostalCode', function(err) {
if (err) throw err;
var postal_codes =
[
{
"postal_code": 1067
},
{
"postal_code": 1445
},
{
"postal_code": 1454
},
{
"postal_code": 1458
},
{
"postal_code": 1468
},
{
"postal_code": 1471
},
{
"postal_code": 1477
},
{
"postal_code": 1558
},
{
"postal_code": 1561
},
{
"postal_code": 1589
},
{
"postal_code": 1594
},
{
"postal_code": 1609
},
{
"postal_code": 1612
},
{
"postal_code": 1616
},
{
"postal_code": 1619
},
{
"postal_code": 1623
},
{
"postal_code": 1640
},
{
"postal_code": 1662
},
{
"postal_code": 1665
},
{
"postal_code": 1683
},
{
"postal_code": 1689
},
{
"postal_code": 1705
},
{
"postal_code": 1723
},
{
"postal_code": 1728
},
{
"postal_code": 1731
},
{
"postal_code": 1734
},
{
"postal_code": 1737
},
{
"postal_code": 1738
},
{
"postal_code": 1744
},
{
"postal_code": 1762
},
{
"postal_code": 1768
},
{
"postal_code": 1773
},
{
"postal_code": 1774
},
{
"postal_code": 1776
},
{
"postal_code": 1796
},
{
"postal_code": 1809
},
{
"postal_code": 1814
},
{
"postal_code": 1816
},
{
"postal_code": 1819
},
{
"postal_code": 1824
},
{
"postal_code": 1825
},
{
"postal_code": 1829
},
{
"postal_code": 1833
},
{
"postal_code": 1844
},
{
"postal_code": 1847
},
{
"postal_code": 1848
},
{
"postal_code": 1855
},
{
"postal_code": 1877
},
{
"postal_code": 1896
},
{
"postal_code": 1900
},
{
"postal_code": 1904
},
{
"postal_code": 1906
},
{
"postal_code": 1909
},
{
"postal_code": 1917
},
{
"postal_code": 1920
},
{
"postal_code": 1936
},
{
"postal_code": 1945
},
{
"postal_code": 1968
},
{
"postal_code": 1979
},
{
"postal_code": 1983
},
{
"postal_code": 1987
},
{
"postal_code": 1990
},
{
"postal_code": 1998
},
{
"postal_code": 2625
},
{
"postal_code": 2627
},
{
"postal_code": 2633
},
{
"postal_code": 2681
},
{
"postal_code": 2689
},
{
"postal_code": 2692
},
{
"postal_code": 2694
},
{
"postal_code": 2699
},
{
"postal_code": 2708
},
{
"postal_code": 2730
},
{
"postal_code": 2733
},
{
"postal_code": 2736
},
{
"postal_code": 2739
},
{
"postal_code": 2742
},
{
"postal_code": 2747
},
{
"postal_code": 2748
},
{
"postal_code": 2763
},
{
"postal_code": 2779
},
{
"postal_code": 2782
},
{
"postal_code": 2785
},
{
"postal_code": 2791
},
{
"postal_code": 2794
},
{
"postal_code": 2796
},
{
"postal_code": 2797
},
{
"postal_code": 2826
},
{
"postal_code": 2829
},
{
"postal_code": 2894
},
{
"postal_code": 2899
},
{
"postal_code": 2906
},
{
"postal_code": 2923
},
{
"postal_code": 2929
},
{
"postal_code": 2943
},
{
"postal_code": 2953
},
{
"postal_code": 2956
},
{
"postal_code": 2957
},
{
"postal_code": 2959
},
{
"postal_code": 2977
},
{
"postal_code": 2979
},
{
"postal_code": 2991
},
{
"postal_code": 2994
},
{
"postal_code": 2997
},
{
"postal_code": 2999
},
{
"postal_code": 3046
},
{
"postal_code": 3058
},
{
"postal_code": 3096
},
{
"postal_code": 3099
},
{
"postal_code": 3103
},
{
"postal_code": 3116
},
{
"postal_code": 3119
},
{
"postal_code": 3130
},
{
"postal_code": 3149
},
{
"postal_code": 3159
},
{
"postal_code": 3172
},
{
"postal_code": 3185
},
{
"postal_code": 3197
},
{
"postal_code": 3205
},
{
"postal_code": 3222
},
{
"postal_code": 3226
},
{
"postal_code": 3229
},
{
"postal_code": 3238
},
{
"postal_code": 3246
},
{
"postal_code": 3249
},
{
"postal_code": 3253
},
{
"postal_code": 4109
},
{
"postal_code": 4416
},
{
"postal_code": 4420
},
{
"postal_code": 4425
},
{
"postal_code": 4435
},
{
"postal_code": 4442
},
{
"postal_code": 4451
},
{
"postal_code": 4463
},
{
"postal_code": 4509
},
{
"postal_code": 4519
},
{
"postal_code": 4523
},
{
"postal_code": 4539
},
{
"postal_code": 4552
},
{
"postal_code": 4564
},
{
"postal_code": 4565
},
{
"postal_code": 4567
},
{
"postal_code": 4571
},
{
"postal_code": 4574
},
{
"postal_code": 4575
},
{
"postal_code": 4579
},
{
"postal_code": 4600
},
{
"postal_code": 4603
},
{
"postal_code": 4610
},
{
"postal_code": 4613
},
{
"postal_code": 4617
},
{
"postal_code": 4618
},
{
"postal_code": 4626
},
{
"postal_code": 4639
},
{
"postal_code": 4643
},
{
"postal_code": 4651
},
{
"postal_code": 4654
},
{
"postal_code": 4655
},
{
"postal_code": 4657
},
{
"postal_code": 4668
},
{
"postal_code": 4680
},
{
"postal_code": 4683
},
{
"postal_code": 4687
},
{
"postal_code": 4703
},
{
"postal_code": 4720
},
{
"postal_code": 4736
},
{
"postal_code": 4741
},
{
"postal_code": 4746
},
{
"postal_code": 4749
},
{
"postal_code": 4758
},
{
"postal_code": 4769
},
{
"postal_code": 4774
},
{
"postal_code": 4779
},
{
"postal_code": 4808
},
{
"postal_code": 4821
},
{
"postal_code": 4827
},
{
"postal_code": 4828
},
{
"postal_code": 4838
},
{
"postal_code": 4849
},
{
"postal_code": 4860
},
{
"postal_code": 4862
},
{
"postal_code": 4874
},
{
"postal_code": 4880
},
{
"postal_code": 4886
},
{
"postal_code": 4895
},
{
"postal_code": 4910
},
{
"postal_code": 4916
},
{
"postal_code": 4924
},
{
"postal_code": 4928
},
{
"postal_code": 4931
},
{
"postal_code": 4932
},
{
"postal_code": 4934
},
{
"postal_code": 4936
},
{
"postal_code": 4938
},
{
"postal_code": 6108
},
{
"postal_code": 6179
},
{
"postal_code": 6184
},
{
"postal_code": 6188
},
{
"postal_code": 6193
},
{
"postal_code": 6198
},
{
"postal_code": 6217
},
{
"postal_code": 6231
},
{
"postal_code": 6237
},
{
"postal_code": 6242
},
{
"postal_code": 6246
},
{
"postal_code": 6249
},
{
"postal_code": 6258
},
{
"postal_code": 6268
},
{
"postal_code": 6279
},
{
"postal_code": 6295
},
{
"postal_code": 6308
},
{
"postal_code": 6311
},
{
"postal_code": 6313
},
{
"postal_code": 6317
},
{
"postal_code": 6333
},
{
"postal_code": 6343
},
{
"postal_code": 6347
},
{
"postal_code": 6366
},
{
"postal_code": 6369
},
{
"postal_code": 6385
},
{
"postal_code": 6386
},
{
"postal_code": 6406
},
{
"postal_code": 6408
},
{
"postal_code": 6420
},
{
"postal_code": 6425
},
{
"postal_code": 6429
},
{
"postal_code": 6449
},
{
"postal_code": 6458
},
{
"postal_code": 6463
},
{
"postal_code": 6469
},
{
"postal_code": 6484
},
{
"postal_code": 6493
},
{
"postal_code": 6502
},
{
"postal_code": 6526
},
{
"postal_code": 6528
},
{
"postal_code": 6536
},
{
"postal_code": 6537
},
{
"postal_code": 6542
},
{
"postal_code": 6556
},
{
"postal_code": 6567
},
{
"postal_code": 6571
},
{
"postal_code": 6577
},
{
"postal_code": 6578
},
{
"postal_code": 6618
},
{
"postal_code": 6628
},
{
"postal_code": 6632
},
{
"postal_code": 6636
},
{
"postal_code": 6638
},
{
"postal_code": 6642
},
{
"postal_code": 6647
},
{
"postal_code": 6648
},
{
"postal_code": 6667
},
{
"postal_code": 6679
},
{
"postal_code": 6682
},
{
"postal_code": 6686
},
{
"postal_code": 6712
},
{
"postal_code": 6721
},
{
"postal_code": 6722
},
{
"postal_code": 6724
},
{
"postal_code": 6729
},
{
"postal_code": 6766
},
{
"postal_code": 6773
},
{
"postal_code": 6774
},
{
"postal_code": 6779
},
{
"postal_code": 6780
},
{
"postal_code": 6785
},
{
"postal_code": 6792
},
{
"postal_code": 6844
},
{
"postal_code": 6869
},
{
"postal_code": 6886
},
{
"postal_code": 6895
},
{
"postal_code": 6901
},
{
"postal_code": 6905
},
{
"postal_code": 6917
},
{
"postal_code": 6925
},
{
"postal_code": 7318
},
{
"postal_code": 7330
},
{
"postal_code": 7333
},
{
"postal_code": 7334
},
{
"postal_code": 7338
},
{
"postal_code": 7343
},
{
"postal_code": 7349
},
{
"postal_code": 7356
},
{
"postal_code": 7366
},
{
"postal_code": 7368
},
{
"postal_code": 7381
},
{
"postal_code": 7387
},
{
"postal_code": 7389
},
{
"postal_code": 7407
},
{
"postal_code": 7422
},
{
"postal_code": 7426
},
{
"postal_code": 7427
},
{
"postal_code": 7429
},
{
"postal_code": 7545
},
{
"postal_code": 7554
},
{
"postal_code": 7557
},
{
"postal_code": 7570
},
{
"postal_code": 7580
},
{
"postal_code": 7586
},
{
"postal_code": 7589
},
{
"postal_code": 7607
},
{
"postal_code": 7613
},
{
"postal_code": 7616
},
{
"postal_code": 7619
},
{
"postal_code": 7629
},
{
"postal_code": 7639
},
{
"postal_code": 7646
},
{
"postal_code": 7743
},
{
"postal_code": 7751
},
{
"postal_code": 7768
},
{
"postal_code": 7774
},
{
"postal_code": 7778
},
{
"postal_code": 7806
},
{
"postal_code": 7819
},
{
"postal_code": 7907
},
{
"postal_code": 7919
},
{
"postal_code": 7922
},
{
"postal_code": 7924
},
{
"postal_code": 7926
},
{
"postal_code": 7927
},
{
"postal_code": 7929
},
{
"postal_code": 7937
},
{
"postal_code": 7950
},
{
"postal_code": 7952
},
{
"postal_code": 7955
},
{
"postal_code": 7957
},
{
"postal_code": 7958
},
{
"postal_code": 7973
},
{
"postal_code": 7980
},
{
"postal_code": 7985
},
{
"postal_code": 7987
},
{
"postal_code": 8056
},
{
"postal_code": 8107
},
{
"postal_code": 8112
},
{
"postal_code": 8115
},
{
"postal_code": 8118
},
{
"postal_code": 8132
},
{
"postal_code": 8134
},
{
"postal_code": 8141
},
{
"postal_code": 8144
},
{
"postal_code": 8147
},
{
"postal_code": 8209
},
{
"postal_code": 8223
},
{
"postal_code": 8228
},
{
"postal_code": 8233
},
{
"postal_code": 8236
},
{
"postal_code": 8237
},
{
"postal_code": 8239
},
{
"postal_code": 8248
},
{
"postal_code": 8258
},
{
"postal_code": 8261
},
{
"postal_code": 8262
},
{
"postal_code": 8265
},
{
"postal_code": 8280
},
{
"postal_code": 8289
},
{
"postal_code": 8294
},
{
"postal_code": 8297
},
{
"postal_code": 8301
},
{
"postal_code": 8304
},
{
"postal_code": 8309
},
{
"postal_code": 8312
},
{
"postal_code": 8321
},
{
"postal_code": 8324
},
{
"postal_code": 8328
},
{
"postal_code": 8340
},
{
"postal_code": 8344
},
{
"postal_code": 8349
},
{
"postal_code": 8352
},
{
"postal_code": 8359
},
{
"postal_code": 8371
},
{
"postal_code": 8373
},
{
"postal_code": 8393
},
{
"postal_code": 8396
},
{
"postal_code": 8412
},
{
"postal_code": 8427
},
{
"postal_code": 8428
},
{
"postal_code": 8451
},
{
"postal_code": 8459
},
{
"postal_code": 8468
},
{
"postal_code": 8485
},
{
"postal_code": 8491
},
{
"postal_code": 8496
},
{
"postal_code": 8499
},
{
"postal_code": 8523
},
{
"postal_code": 8538
},
{
"postal_code": 8539
},
{
"postal_code": 8541
},
{
"postal_code": 8543
},
{
"postal_code": 8606
},
{
"postal_code": 8626
},
{
"postal_code": 8645
},
{
"postal_code": 8648
},
{
"postal_code": 9111
},
{
"postal_code": 9212
},
{
"postal_code": 9217
},
{
"postal_code": 9221
},
{
"postal_code": 9232
},
{
"postal_code": 9235
},
{
"postal_code": 9236
},
{
"postal_code": 9241
},
{
"postal_code": 9243
},
{
"postal_code": 9244
},
{
"postal_code": 9249
},
{
"postal_code": 9306
},
{
"postal_code": 9322
},
{
"postal_code": 9326
},
{
"postal_code": 9328
},
{
"postal_code": 9337
},
{
"postal_code": 9350
},
{
"postal_code": 9353
},
{
"postal_code": 9355
},
{
"postal_code": 9356
},
{
"postal_code": 9366
},
{
"postal_code": 9376
},
{
"postal_code": 9380
},
{
"postal_code": 9385
},
{
"postal_code": 9387
},
{
"postal_code": 9390
},
{
"postal_code": 9392
},
{
"postal_code": 9394
},
{
"postal_code": 9399
},
{
"postal_code": 9405
},
{
"postal_code": 9419
},
{
"postal_code": 9423
},
{
"postal_code": 9427
},
{
"postal_code": 9429
},
{
"postal_code": 9430
},
{
"postal_code": 9432
},
{
"postal_code": 9437
},
{
"postal_code": 9439
},
{
"postal_code": 9456
},
{
"postal_code": 9465
},
{
"postal_code": 9468
},
{
"postal_code": 9471
},
{
"postal_code": 9474
},
{
"postal_code": 9477
},
{
"postal_code": 9481
},
{
"postal_code": 9484
},
{
"postal_code": 9487
},
{
"postal_code": 9488
},
{
"postal_code": 9496
},
{
"postal_code": 9509
},
{
"postal_code": 9514
},
{
"postal_code": 9518
},
{
"postal_code": 9526
},
{
"postal_code": 9544
},
{
"postal_code": 9548
},
{
"postal_code": 9557
},
{
"postal_code": 9569
},
{
"postal_code": 9573
},
{
"postal_code": 9575
},
{
"postal_code": 9577
},
{
"postal_code": 9579
},
{
"postal_code": 9599
},
{
"postal_code": 9600
},
{
"postal_code": 9603
},
{
"postal_code": 9618
},
{
"postal_code": 9619
},
{
"postal_code": 9623
},
{
"postal_code": 9627
},
{
"postal_code": 9629
},
{
"postal_code": 9633
},
{
"postal_code": 9638
},
{
"postal_code": 9648
},
{
"postal_code": 9661
},
{
"postal_code": 9669
},
{
"postal_code": 10178
},
{
"postal_code": 12529
},
{
"postal_code": 14461
},
{
"postal_code": 14513
},
{
"postal_code": 14532
},
{
"postal_code": 14542
},
{
"postal_code": 14547
},
{
"postal_code": 14548
},
{
"postal_code": 14550
},
{
"postal_code": 14552
},
{
"postal_code": 14554
},
{
"postal_code": 14558
},
{
"postal_code": 14612
},
{
"postal_code": 14621
},
{
"postal_code": 14624
},
{
"postal_code": 14641
},
{
"postal_code": 14656
},
{
"postal_code": 14662
},
{
"postal_code": 14669
},
{
"postal_code": 14712
},
{
"postal_code": 14715
},
{
"postal_code": 14727
},
{
"postal_code": 14728
},
{
"postal_code": 14770
},
{
"postal_code": 14778
},
{
"postal_code": 14789
},
{
"postal_code": 14793
},
{
"postal_code": 14797
},
{
"postal_code": 14798
},
{
"postal_code": 14806
},
{
"postal_code": 14822
},
{
"postal_code": 14823
},
{
"postal_code": 14827
},
{
"postal_code": 14828
},
{
"postal_code": 14913
},
{
"postal_code": 14929
},
{
"postal_code": 14943
},
{
"postal_code": 14947
},
{
"postal_code": 14959
},
{
"postal_code": 14974
},
{
"postal_code": 14979
},
{
"postal_code": 15230
},
{
"postal_code": 15236
},
{
"postal_code": 15295
},
{
"postal_code": 15299
},
{
"postal_code": 15306
},
{
"postal_code": 15320
},
{
"postal_code": 15324
},
{
"postal_code": 15326
},
{
"postal_code": 15328
},
{
"postal_code": 15344
},
{
"postal_code": 15345
},
{
"postal_code": 15366
},
{
"postal_code": 15370
},
{
"postal_code": 15374
},
{
"postal_code": 15377
},
{
"postal_code": 15517
},
{
"postal_code": 15518
},
{
"postal_code": 15526
},
{
"postal_code": 15528
},
{
"postal_code": 15537
},
{
"postal_code": 15562
},
{
"postal_code": 15566
},
{
"postal_code": 15569
},
{
"postal_code": 15711
},
{
"postal_code": 15732
},
{
"postal_code": 15738
},
{
"postal_code": 15741
},
{
"postal_code": 15745
},
{
"postal_code": 15746
},
{
"postal_code": 15748
},
{
"postal_code": 15749
},
{
"postal_code": 15754
},
{
"postal_code": 15755
},
{
"postal_code": 15757
},
{
"postal_code": 15806
},
{
"postal_code": 15827
},
{
"postal_code": 15834
},
{
"postal_code": 15837
},
{
"postal_code": 15838
},
{
"postal_code": 15848
},
{
"postal_code": 15859
},
{
"postal_code": 15864
},
{
"postal_code": 15868
},
{
"postal_code": 15890
},
{
"postal_code": 15898
},
{
"postal_code": 15907
},
{
"postal_code": 15910
},
{
"postal_code": 15913
},
{
"postal_code": 15926
},
{
"postal_code": 15936
},
{
"postal_code": 15938
},
{
"postal_code": 16225
},
{
"postal_code": 16230
},
{
"postal_code": 16244
},
{
"postal_code": 16247
},
{
"postal_code": 16248
},
{
"postal_code": 16259
},
{
"postal_code": 16269
},
{
"postal_code": 16278
},
{
"postal_code": 16303
},
{
"postal_code": 16306
},
{
"postal_code": 16307
},
{
"postal_code": 16321
},
{
"postal_code": 16341
},
{
"postal_code": 16348
},
{
"postal_code": 16356
},
{
"postal_code": 16359
},
{
"postal_code": 16515
},
{
"postal_code": 16540
},
{
"postal_code": 16547
},
{
"postal_code": 16548
},
{
"postal_code": 16559
},
{
"postal_code": 16567
},
{
"postal_code": 16727
},
{
"postal_code": 16761
},
{
"postal_code": 16766
},
{
"postal_code": 16767
},
{
"postal_code": 16775
},
{
"postal_code": 16792
},
{
"postal_code": 16798
},
{
"postal_code": 16816
},
{
"postal_code": 16818
},
{
"postal_code": 16831
},
{
"postal_code": 16833
},
{
"postal_code": 16835
},
{
"postal_code": 16845
},
{
"postal_code": 16866
},
{
"postal_code": 16868
},
{
"postal_code": 16909
},
{
"postal_code": 16928
},
{
"postal_code": 16945
},
{
"postal_code": 16949
},
{
"postal_code": 17033
},
{
"postal_code": 17039
},
{
"postal_code": 17087
},
{
"postal_code": 17089
},
{
"postal_code": 17091
},
{
"postal_code": 17094
},
{
"postal_code": 17098
},
{
"postal_code": 17099
},
{
"postal_code": 17109
},
{
"postal_code": 17111
},
{
"postal_code": 17121
},
{
"postal_code": 17126
},
{
"postal_code": 17129
},
{
"postal_code": 17139
},
{
"postal_code": 17153
},
{
"postal_code": 17154
},
{
"postal_code": 17159
},
{
"postal_code": 17166
},
{
"postal_code": 17168
},
{
"postal_code": 17179
},
{
"postal_code": 17192
},
{
"postal_code": 17194
},
{
"postal_code": 17207
},
{
"postal_code": 17209
},
{
"postal_code": 17213
},
{
"postal_code": 17214
},
{
"postal_code": 17217
},
{
"postal_code": 17219
},
{
"postal_code": 17235
},
{
"postal_code": 17237
},
{
"postal_code": 17248
},
{
"postal_code": 17252
},
{
"postal_code": 17255
},
{
"postal_code": 17258
},
{
"postal_code": 17268
},
{
"postal_code": 17279
},
{
"postal_code": 17291
},
{
"postal_code": 17309
},
{
"postal_code": 17321
},
{
"postal_code": 17322
},
{
"postal_code": 17326
},
{
"postal_code": 17328
},
{
"postal_code": 17329
},
{
"postal_code": 17335
},
{
"postal_code": 17337
},
{
"postal_code": 17348
},
{
"postal_code": 17349
},
{
"postal_code": 17358
},
{
"postal_code": 17367
},
{
"postal_code": 17373
},
{
"postal_code": 17375
},
{
"postal_code": 17379
},
{
"postal_code": 17389
},
{
"postal_code": 17390
},
{
"postal_code": 17391
},
{
"postal_code": 17392
},
{
"postal_code": 17398
},
{
"postal_code": 17406
},
{
"postal_code": 17419
},
{
"postal_code": 17424
},
{
"postal_code": 17429
},
{
"postal_code": 17438
},
{
"postal_code": 17440
},
{
"postal_code": 17449
},
{
"postal_code": 17454
},
{
"postal_code": 17459
},
{
"postal_code": 17489
},
{
"postal_code": 17495
},
{
"postal_code": 17498
},
{
"postal_code": 17506
},
{
"postal_code": 17509
},
{
"postal_code": 18055
},
{
"postal_code": 18059
},
{
"postal_code": 18069
},
{
"postal_code": 18107
},
{
"postal_code": 18181
},
{
"postal_code": 18182
},
{
"postal_code": 18184
},
{
"postal_code": 18190
},
{
"postal_code": 18195
},
{
"postal_code": 18196
},
{
"postal_code": 18198
},
{
"postal_code": 18209
},
{
"postal_code": 18211
},
{
"postal_code": 18225
},
{
"postal_code": 18230
},
{
"postal_code": 18233
},
{
"postal_code": 18236
},
{
"postal_code": 18239
},
{
"postal_code": 18246
},
{
"postal_code": 18249
},
{
"postal_code": 18258
},
{
"postal_code": 18273
},
{
"postal_code": 18276
},
{
"postal_code": 18279
},
{
"postal_code": 18292
},
{
"postal_code": 18299
},
{
"postal_code": 18311
},
{
"postal_code": 18314
},
{
"postal_code": 18317
},
{
"postal_code": 18320
},
{
"postal_code": 18334
},
{
"postal_code": 18337
},
{
"postal_code": 18347
},
{
"postal_code": 18356
},
{
"postal_code": 18374
},
{
"postal_code": 18375
},
{
"postal_code": 18439
},
{
"postal_code": 18442
},
{
"postal_code": 18445
},
{
"postal_code": 18461
},
{
"postal_code": 18465
},
{
"postal_code": 18469
},
{
"postal_code": 18507
},
{
"postal_code": 18510
},
{
"postal_code": 18513
},
{
"postal_code": 18516
},
{
"postal_code": 18528
},
{
"postal_code": 18546
},
{
"postal_code": 18551
},
{
"postal_code": 18556
},
{
"postal_code": 18565
},
{
"postal_code": 18569
},
{
"postal_code": 18573
},
{
"postal_code": 18574
},
{
"postal_code": 18581
},
{
"postal_code": 18586
},
{
"postal_code": 18609
},
{
"postal_code": 19053
},
{
"postal_code": 19065
},
{
"postal_code": 19067
},
{
"postal_code": 19069
},
{
"postal_code": 19071
},
{
"postal_code": 19073
},
{
"postal_code": 19075
},
{
"postal_code": 19077
},
{
"postal_code": 19079
},
{
"postal_code": 19086
},
{
"postal_code": 19089
},
{
"postal_code": 19205
},
{
"postal_code": 19209
},
{
"postal_code": 19217
},
{
"postal_code": 19230
},
{
"postal_code": 19243
},
{
"postal_code": 19246
},
{
"postal_code": 19249
},
{
"postal_code": 19258
},
{
"postal_code": 19260
},
{
"postal_code": 19273
},
{
"postal_code": 19288
},
{
"postal_code": 19294
},
{
"postal_code": 19300
},
{
"postal_code": 19303
},
{
"postal_code": 19306
},
{
"postal_code": 19309
},
{
"postal_code": 19322
},
{
"postal_code": 19336
},
{
"postal_code": 19339
},
{
"postal_code": 19348
},
{
"postal_code": 19357
},
{
"postal_code": 19370
},
{
"postal_code": 19372
},
{
"postal_code": 19374
},
{
"postal_code": 19376
},
{
"postal_code": 19386
},
{
"postal_code": 19395
},
{
"postal_code": 19399
},
{
"postal_code": 19406
},
{
"postal_code": 19412
},
{
"postal_code": 19417
},
{
"postal_code": 20038
},
{
"postal_code": 21039
},
{
"postal_code": 21218
},
{
"postal_code": 21224
},
{
"postal_code": 21227
},
{
"postal_code": 21228
},
{
"postal_code": 21244
},
{
"postal_code": 21255
},
{
"postal_code": 21256
},
{
"postal_code": 21258
},
{
"postal_code": 21259
},
{
"postal_code": 21261
},
{
"postal_code": 21266
},
{
"postal_code": 21271
},
{
"postal_code": 21272
},
{
"postal_code": 21274
},
{
"postal_code": 21279
},
{
"postal_code": 21335
},
{
"postal_code": 21354
},
{
"postal_code": 21357
},
{
"postal_code": 21358
},
{
"postal_code": 21360
},
{
"postal_code": 21365
},
{
"postal_code": 21368
},
{
"postal_code": 21369
},
{
"postal_code": 21371
},
{
"postal_code": 21376
},
{
"postal_code": 21379
},
{
"postal_code": 21380
},
{
"postal_code": 21382
},
{
"postal_code": 21385
},
{
"postal_code": 21386
},
{
"postal_code": 21388
},
{
"postal_code": 21391
},
{
"postal_code": 21394
},
{
"postal_code": 21395
},
{
"postal_code": 21397
},
{
"postal_code": 21398
},
{
"postal_code": 21400
},
{
"postal_code": 21401
},
{
"postal_code": 21403
},
{
"postal_code": 21406
},
{
"postal_code": 21407
},
{
"postal_code": 21409
},
{
"postal_code": 21423
},
{
"postal_code": 21435
},
{
"postal_code": 21436
},
{
"postal_code": 21438
},
{
"postal_code": 21439
},
{
"postal_code": 21441
},
{
"postal_code": 21442
},
{
"postal_code": 21444
},
{
"postal_code": 21445
},
{
"postal_code": 21447
},
{
"postal_code": 21449
},
{
"postal_code": 21465
},
{
"postal_code": 21481
},
{
"postal_code": 21483
},
{
"postal_code": 21493
},
{
"postal_code": 21502
},
{
"postal_code": 21509
},
{
"postal_code": 21514
},
{
"postal_code": 21516
},
{
"postal_code": 21521
},
{
"postal_code": 21522
},
{
"postal_code": 21524
},
{
"postal_code": 21526
},
{
"postal_code": 21527
},
{
"postal_code": 21529
},
{
"postal_code": 21614
},
{
"postal_code": 21629
},
{
"postal_code": 21635
},
{
"postal_code": 21640
},
{
"postal_code": 21641
},
{
"postal_code": 21643
},
{
"postal_code": 21644
},
{
"postal_code": 21646
},
{
"postal_code": 21647
},
{
"postal_code": 21649
},
{
"postal_code": 21682
},
{
"postal_code": 21684
},
{
"postal_code": 21698
},
{
"postal_code": 21702
},
{
"postal_code": 21706
},
{
"postal_code": 21709
},
{
"postal_code": 21710
},
{
"postal_code": 21712
},
{
"postal_code": 21714
},
{
"postal_code": 21717
},
{
"postal_code": 21720
},
{
"postal_code": 21723
},
{
"postal_code": 21726
},
{
"postal_code": 21727
},
{
"postal_code": 21729
},
{
"postal_code": 21730
},
{
"postal_code": 21732
},
{
"postal_code": 21734
},
{
"postal_code": 21737
},
{
"postal_code": 21739
},
{
"postal_code": 21745
},
{
"postal_code": 21755
},
{
"postal_code": 21756
},
{
"postal_code": 21762
},
{
"postal_code": 21763
},
{
"postal_code": 21765
},
{
"postal_code": 21769
},
{
"postal_code": 21770
},
{
"postal_code": 21772
},
{
"postal_code": 21775
},
{
"postal_code": 21776
},
{
"postal_code": 21781
},
{
"postal_code": 21782
},
{
"postal_code": 21784
},
{
"postal_code": 21785
},
{
"postal_code": 21787
},
{
"postal_code": 21789
},
{
"postal_code": 22113
},
{
"postal_code": 22145
},
{
"postal_code": 22846
},
{
"postal_code": 22869
},
{
"postal_code": 22880
},
{
"postal_code": 22885
},
{
"postal_code": 22889
},
{
"postal_code": 22926
},
{
"postal_code": 22927
},
{
"postal_code": 22929
},
{
"postal_code": 22941
},
{
"postal_code": 22946
},
{
"postal_code": 22949
},
{
"postal_code": 22952
},
{
"postal_code": 22955
},
{
"postal_code": 22956
},
{
"postal_code": 22958
},
{
"postal_code": 22959
},
{
"postal_code": 22962
},
{
"postal_code": 22964
},
{
"postal_code": 22965
},
{
"postal_code": 22967
},
{
"postal_code": 22969
},
{
"postal_code": 23539
},
{
"postal_code": 23611
},
{
"postal_code": 23617
},
{
"postal_code": 23619
},
{
"postal_code": 23623
},
{
"postal_code": 23626
},
{
"postal_code": 23627
},
{
"postal_code": 23628
},
{
"postal_code": 23669
},
{
"postal_code": 23683
},
{
"postal_code": 23701
},
{
"postal_code": 23714
},
{
"postal_code": 23715
},
{
"postal_code": 23717
},
{
"postal_code": 23719
},
{
"postal_code": 23730
},
{
"postal_code": 23738
},
{
"postal_code": 23743
},
{
"postal_code": 23744
},
{
"postal_code": 23758
},
{
"postal_code": 23769
},
{
"postal_code": 23774
},
{
"postal_code": 23775
},
{
"postal_code": 23777
},
{
"postal_code": 23779
},
{
"postal_code": 23795
},
{
"postal_code": 23812
},
{
"postal_code": 23813
},
{
"postal_code": 23815
},
{
"postal_code": 23816
},
{
"postal_code": 23818
},
{
"postal_code": 23820
},
{
"postal_code": 23821
},
{
"postal_code": 23823
},
{
"postal_code": 23824
},
{
"postal_code": 23826
},
{
"postal_code": 23827
},
{
"postal_code": 23829
},
{
"postal_code": 23843
},
{
"postal_code": 23845
},
{
"postal_code": 23847
},
{
"postal_code": 23858
},
{
"postal_code": 23860
},
{
"postal_code": 23863
},
{
"postal_code": 23866
},
{
"postal_code": 23867
},
{
"postal_code": 23869
},
{
"postal_code": 23879
},
{
"postal_code": 23881
},
{
"postal_code": 23883
},
{
"postal_code": 23896
},
{
"postal_code": 23898
},
{
"postal_code": 23899
},
{
"postal_code": 23909
},
{
"postal_code": 23911
},
{
"postal_code": 23919
},
{
"postal_code": 23923
},
{
"postal_code": 23936
},
{
"postal_code": 23942
},
{
"postal_code": 23946
},
{
"postal_code": 23948
},
{
"postal_code": 23952
},
{
"postal_code": 23968
},
{
"postal_code": 23970
},
{
"postal_code": 23972
},
{
"postal_code": 23974
},
{
"postal_code": 23992
},
{
"postal_code": 23996
},
{
"postal_code": 23999
},
{
"postal_code": 24103
},
{
"postal_code": 24107
},
{
"postal_code": 24109
},
{
"postal_code": 24113
},
{
"postal_code": 24119
},
{
"postal_code": 24161
},
{
"postal_code": 24211
},
{
"postal_code": 24214
},
{
"postal_code": 24217
},
{
"postal_code": 24220
},
{
"postal_code": 24223
},
{
"postal_code": 24226
},
{
"postal_code": 24229
},
{
"postal_code": 24232
},
{
"postal_code": 24235
},
{
"postal_code": 24238
},
{
"postal_code": 24239
},
{
"postal_code": 24241
},
{
"postal_code": 24242
},
{
"postal_code": 24244
},
{
"postal_code": 24245
},
{
"postal_code": 24247
},
{
"postal_code": 24250
},
{
"postal_code": 24251
},
{
"postal_code": 24253
},
{
"postal_code": 24254
},
{
"postal_code": 24256
},
{
"postal_code": 24257
},
{
"postal_code": 24259
},
{
"postal_code": 24306
},
{
"postal_code": 24321
},
{
"postal_code": 24326
},
{
"postal_code": 24327
},
{
"postal_code": 24329
},
{
"postal_code": 24340
},
{
"postal_code": 24351
},
{
"postal_code": 24354
},
{
"postal_code": 24357
},
{
"postal_code": 24358
},
{
"postal_code": 24360
},
{
"postal_code": 24361
},
{
"postal_code": 24363
},
{
"postal_code": 24364
},
{
"postal_code": 24366
},
{
"postal_code": 24367
},
{
"postal_code": 24369
},
{
"postal_code": 24376
},
{
"postal_code": 24392
},
{
"postal_code": 24395
},
{
"postal_code": 24398
},
{
"postal_code": 24399
},
{
"postal_code": 24401
},
{
"postal_code": 24402
},
{
"postal_code": 24404
},
{
"postal_code": 24405
},
{
"postal_code": 24407
},
{
"postal_code": 24409
},
{
"postal_code": 24534
},
{
"postal_code": 24536
},
{
"postal_code": 24558
},
{
"postal_code": 24568
},
{
"postal_code": 24576
},
{
"postal_code": 24582
},
{
"postal_code": 24589
},
{
"postal_code": 24594
},
{
"postal_code": 24598
},
{
"postal_code": 24601
},
{
"postal_code": 24610
},
{
"postal_code": 24613
},
{
"postal_code": 24616
},
{
"postal_code": 24619
},
{
"postal_code": 24620
},
{
"postal_code": 24622
},
{
"postal_code": 24623
},
{
"postal_code": 24625
},
{
"postal_code": 24626
},
{
"postal_code": 24628
},
{
"postal_code": 24629
},
{
"postal_code": 24631
},
{
"postal_code": 24632
},
{
"postal_code": 24634
},
{
"postal_code": 24635
},
{
"postal_code": 24637
},
{
"postal_code": 24638
},
{
"postal_code": 24640
},
{
"postal_code": 24641
},
{
"postal_code": 24643
},
{
"postal_code": 24644
},
{
"postal_code": 24646
},
{
"postal_code": 24647
},
{
"postal_code": 24649
},
{
"postal_code": 24768
},
{
"postal_code": 24782
},
{
"postal_code": 24783
},
{
"postal_code": 24784
},
{
"postal_code": 24787
},
{
"postal_code": 24790
},
{
"postal_code": 24791
},
{
"postal_code": 24793
},
{
"postal_code": 24794
},
{
"postal_code": 24796
},
{
"postal_code": 24797
},
{
"postal_code": 24799
},
{
"postal_code": 24800
},
{
"postal_code": 24802
},
{
"postal_code": 24803
},
{
"postal_code": 24805
},
{
"postal_code": 24806
},
{
"postal_code": 24808
},
{
"postal_code": 24809
},
{
"postal_code": 24811
},
{
"postal_code": 24813
},
{
"postal_code": 24814
},
{
"postal_code": 24816
},
{
"postal_code": 24817
},
{
"postal_code": 24819
},
{
"postal_code": 24837
},
{
"postal_code": 24848
},
{
"postal_code": 24850
},
{
"postal_code": 24852
},
{
"postal_code": 24855
},
{
"postal_code": 24857
},
{
"postal_code": 24860
},
{
"postal_code": 24861
},
{
"postal_code": 24863
},
{
"postal_code": 24864
},
{
"postal_code": 24866
},
{
"postal_code": 24867
},
{
"postal_code": 24869
},
{
"postal_code": 24870
},
{
"postal_code": 24873
},
{
"postal_code": 24876
},
{
"postal_code": 24878
},
{
"postal_code": 24879
},
{
"postal_code": 24881
},
{
"postal_code": 24882
},
{
"postal_code": 24884
},
{
"postal_code": 24885
},
{
"postal_code": 24887
},
{
"postal_code": 24888
},
{
"postal_code": 24890
},
{
"postal_code": 24891
},
{
"postal_code": 24893
},
{
"postal_code": 24894
},
{
"postal_code": 24896
},
{
"postal_code": 24897
},
{
"postal_code": 24899
},
{
"postal_code": 24937
},
{
"postal_code": 24943
},
{
"postal_code": 24955
},
{
"postal_code": 24960
},
{
"postal_code": 24963
},
{
"postal_code": 24966
},
{
"postal_code": 24969
},
{
"postal_code": 24972
},
{
"postal_code": 24975
},
{
"postal_code": 24977
},
{
"postal_code": 24980
},
{
"postal_code": 24983
},
{
"postal_code": 24986
},
{
"postal_code": 24988
},
{
"postal_code": 24989
},
{
"postal_code": 24991
},
{
"postal_code": 24992
},
{
"postal_code": 24994
},
{
"postal_code": 24996
},
{
"postal_code": 24997
},
{
"postal_code": 24999
},
{
"postal_code": 25335
},
{
"postal_code": 25336
},
{
"postal_code": 25337
},
{
"postal_code": 25348
},
{
"postal_code": 25355
},
{
"postal_code": 25358
},
{
"postal_code": 25361
},
{
"postal_code": 25364
},
{
"postal_code": 25365
},
{
"postal_code": 25368
},
{
"postal_code": 25370
},
{
"postal_code": 25371
},
{
"postal_code": 25373
},
{
"postal_code": 25376
},
{
"postal_code": 25377
},
{
"postal_code": 25379
},
{
"postal_code": 25421
},
{
"postal_code": 25436
},
{
"postal_code": 25451
},
{
"postal_code": 25462
},
{
"postal_code": 25469
},
{
"postal_code": 25474
},
{
"postal_code": 25479
},
{
"postal_code": 25482
},
{
"postal_code": 25485
},
{
"postal_code": 25486
},
{
"postal_code": 25488
},
{
"postal_code": 25489
},
{
"postal_code": 25491
},
{
"postal_code": 25492
},
{
"postal_code": 25494
},
{
"postal_code": 25495
},
{
"postal_code": 25497
},
{
"postal_code": 25499
},
{
"postal_code": 25524
},
{
"postal_code": 25541
},
{
"postal_code": 25548
},
{
"postal_code": 25551
},
{
"postal_code": 25554
},
{
"postal_code": 25557
},
{
"postal_code": 25560
},
{
"postal_code": 25563
},
{
"postal_code": 25566
},
{
"postal_code": 25569
},
{
"postal_code": 25572
},
{
"postal_code": 25573
},
{
"postal_code": 25575
},
{
"postal_code": 25576
},
{
"postal_code": 25578
},
{
"postal_code": 25579
},
{
"postal_code": 25581
},
{
"postal_code": 25582
},
{
"postal_code": 25584
},
{
"postal_code": 25585
},
{
"postal_code": 25587
},
{
"postal_code": 25588
},
{
"postal_code": 25590
},
{
"postal_code": 25591
},
{
"postal_code": 25593
},
{
"postal_code": 25594
},
{
"postal_code": 25596
},
{
"postal_code": 25597
},
{
"postal_code": 25599
},
{
"postal_code": 25693
},
{
"postal_code": 25704
},
{
"postal_code": 25709
},
{
"postal_code": 25712
},
{
"postal_code": 25715
},
{
"postal_code": 25718
},
{
"postal_code": 25719
},
{
"postal_code": 25721
},
{
"postal_code": 25724
},
{
"postal_code": 25725
},
{
"postal_code": 25727
},
{
"postal_code": 25729
},
{
"postal_code": 25746
},
{
"postal_code": 25761
},
{
"postal_code": 25764
},
{
"postal_code": 25767
},
{
"postal_code": 25770
},
{
"postal_code": 25774
},
{
"postal_code": 25776
},
{
"postal_code": 25779
},
{
"postal_code": 25782
},
{
"postal_code": 25785
},
{
"postal_code": 25786
},
{
"postal_code": 25788
},
{
"postal_code": 25791
},
{
"postal_code": 25792
},
{
"postal_code": 25794
},
{
"postal_code": 25795
},
{
"postal_code": 25797
},
{
"postal_code": 25799
},
{
"postal_code": 25813
},
{
"postal_code": 25821
},
{
"postal_code": 25826
},
{
"postal_code": 25832
},
{
"postal_code": 25836
},
{
"postal_code": 25840
},
{
"postal_code": 25842
},
{
"postal_code": 25845
},
{
"postal_code": 25849
},
{
"postal_code": 25850
},
{
"postal_code": 25852
},
{
"postal_code": 25853
},
{
"postal_code": 25855
},
{
"postal_code": 25856
},
{
"postal_code": 25858
},
{
"postal_code": 25859
},
{
"postal_code": 25860
},
{
"postal_code": 25862
},
{
"postal_code": 25863
},
{
"postal_code": 25864
},
{
"postal_code": 25866
},
{
"postal_code": 25868
},
{
"postal_code": 25869
},
{
"postal_code": 25870
},
{
"postal_code": 25872
},
{
"postal_code": 25873
},
{
"postal_code": 25876
},
{
"postal_code": 25878
},
{
"postal_code": 25879
},
{
"postal_code": 25881
},
{
"postal_code": 25882
},
{
"postal_code": 25884
},
{
"postal_code": 25885
},
{
"postal_code": 25887
},
{
"postal_code": 25889
},
{
"postal_code": 25899
},
{
"postal_code": 25917
},
{
"postal_code": 25920
},
{
"postal_code": 25923
},
{
"postal_code": 25924
},
{
"postal_code": 25926
},
{
"postal_code": 25927
},
{
"postal_code": 25938
},
{
"postal_code": 25946
},
{
"postal_code": 25980
},
{
"postal_code": 25992
},
{
"postal_code": 25996
},
{
"postal_code": 25997
},
{
"postal_code": 25999
},
{
"postal_code": 26122
},
{
"postal_code": 26160
},
{
"postal_code": 26169
},
{
"postal_code": 26180
},
{
"postal_code": 26188
},
{
"postal_code": 26197
},
{
"postal_code": 26203
},
{
"postal_code": 26209
},
{
"postal_code": 26215
},
{
"postal_code": 26219
},
{
"postal_code": 26316
},
{
"postal_code": 26340
},
{
"postal_code": 26345
},
{
"postal_code": 26349
},
{
"postal_code": 26382
},
{
"postal_code": 26409
},
{
"postal_code": 26419
},
{
"postal_code": 26427
},
{
"postal_code": 26434
},
{
"postal_code": 26441
},
{
"postal_code": 26446
},
{
"postal_code": 26452
},
{
"postal_code": 26465
},
{
"postal_code": 26474
},
{
"postal_code": 26486
},
{
"postal_code": 26487
},
{
"postal_code": 26489
},
{
"postal_code": 26506
},
{
"postal_code": 26524
},
{
"postal_code": 26529
},
{
"postal_code": 26532
},
{
"postal_code": 26548
},
{
"postal_code": 26553
},
{
"postal_code": 26556
},
{
"postal_code": 26571
},
{
"postal_code": 26579
},
{
"postal_code": 26603
},
{
"postal_code": 26624
},
{
"postal_code": 26629
},
{
"postal_code": 26632
},
{
"postal_code": 26639
},
{
"postal_code": 26655
},
{
"postal_code": 26670
},
{
"postal_code": 26676
},
{
"postal_code": 26683
},
{
"postal_code": 26689
},
{
"postal_code": 26721
},
{
"postal_code": 26736
},
{
"postal_code": 26757
},
{
"postal_code": 26759
},
{
"postal_code": 26789
},
{
"postal_code": 26802
},
{
"postal_code": 26810
},
{
"postal_code": 26817
},
{
"postal_code": 26826
},
{
"postal_code": 26831
},
{
"postal_code": 26835
},
{
"postal_code": 26842
},
{
"postal_code": 26844
},
{
"postal_code": 26845
},
{
"postal_code": 26847
},
{
"postal_code": 26849
},
{
"postal_code": 26871
},
{
"postal_code": 26892
},
{
"postal_code": 26897
},
{
"postal_code": 26899
},
{
"postal_code": 26901
},
{
"postal_code": 26903
},
{
"postal_code": 26904
},
{
"postal_code": 26906
},
{
"postal_code": 26907
},
{
"postal_code": 26909
},
{
"postal_code": 26919
},
{
"postal_code": 26931
},
{
"postal_code": 26935
},
{
"postal_code": 26939
},
{
"postal_code": 26954
},
{
"postal_code": 26969
},
{
"postal_code": 27211
},
{
"postal_code": 27232
},
{
"postal_code": 27239
},
{
"postal_code": 27243
},
{
"postal_code": 27245
},
{
"postal_code": 27246
},
{
"postal_code": 27248
},
{
"postal_code": 27249
},
{
"postal_code": 27251
},
{
"postal_code": 27252
},
{
"postal_code": 27254
},
{
"postal_code": 27257
},
{
"postal_code": 27259
},
{
"postal_code": 27283
},
{
"postal_code": 27299
},
{
"postal_code": 27305
},
{
"postal_code": 27308
},
{
"postal_code": 27313
},
{
"postal_code": 27318
},
{
"postal_code": 27321
},
{
"postal_code": 27324
},
{
"postal_code": 27327
},
{
"postal_code": 27330
},
{
"postal_code": 27333
},
{
"postal_code": 27336
},
{
"postal_code": 27337
},
{
"postal_code": 27339
},
{
"postal_code": 27356
},
{
"postal_code": 27367
},
{
"postal_code": 27374
},
{
"postal_code": 27383
},
{
"postal_code": 27386
},
{
"postal_code": 27389
},
{
"postal_code": 27404
},
{
"postal_code": 27412
},
{
"postal_code": 27419
},
{
"postal_code": 27432
},
{
"postal_code": 27442
},
{
"postal_code": 27446
},
{
"postal_code": 27449
},
{
"postal_code": 27472
},
{
"postal_code": 27498
},
{
"postal_code": 27576
},
{
"postal_code": 27607
},
{
"postal_code": 27612
},
{
"postal_code": 27616
},
{
"postal_code": 27619
},
{
"postal_code": 27624
},
{
"postal_code": 27628
},
{
"postal_code": 27632
},
{
"postal_code": 27637
},
{
"postal_code": 27638
},
{
"postal_code": 27711
},
{
"postal_code": 27721
},
{
"postal_code": 27726
},
{
"postal_code": 27729
},
{
"postal_code": 27749
},
{
"postal_code": 27777
},
{
"postal_code": 27793
},
{
"postal_code": 27798
},
{
"postal_code": 27801
},
{
"postal_code": 27804
},
{
"postal_code": 27809
},
{
"postal_code": 28195
},
{
"postal_code": 28790
},
{
"postal_code": 28816
},
{
"postal_code": 28832
},
{
"postal_code": 28844
},
{
"postal_code": 28857
},
{
"postal_code": 28865
},
{
"postal_code": 28870
},
{
"postal_code": 28876
},
{
"postal_code": 28879
},
{
"postal_code": 29221
},
{
"postal_code": 29303
},
{
"postal_code": 29308
},
{
"postal_code": 29313
},
{
"postal_code": 29320
},
{
"postal_code": 29323
},
{
"postal_code": 29328
},
{
"postal_code": 29331
},
{
"postal_code": 29336
},
{
"postal_code": 29339
},
{
"postal_code": 29342
},
{
"postal_code": 29345
},
{
"postal_code": 29348
},
{
"postal_code": 29351
},
{
"postal_code": 29352
},
{
"postal_code": 29353
},
{
"postal_code": 29355
},
{
"postal_code": 29356
},
{
"postal_code": 29358
},
{
"postal_code": 29359
},
{
"postal_code": 29361
},
{
"postal_code": 29362
},
{
"postal_code": 29364
},
{
"postal_code": 29365
},
{
"postal_code": 29367
},
{
"postal_code": 29369
},
{
"postal_code": 29378
},
{
"postal_code": 29386
},
{
"postal_code": 29389
},
{
"postal_code": 29392
},
{
"postal_code": 29393
},
{
"postal_code": 29394
},
{
"postal_code": 29396
},
{
"postal_code": 29399
},
{
"postal_code": 29410
},
{
"postal_code": 29413
},
{
"postal_code": 29416
},
{
"postal_code": 29439
},
{
"postal_code": 29451
},
{
"postal_code": 29456
},
{
"postal_code": 29459
},
{
"postal_code": 29462
},
{
"postal_code": 29465
},
{
"postal_code": 29468
},
{
"postal_code": 29471
},
{
"postal_code": 29472
},
{
"postal_code": 29473
},
{
"postal_code": 29475
},
{
"postal_code": 29476
},
{
"postal_code": 29478
},
{
"postal_code": 29479
},
{
"postal_code": 29481
},
{
"postal_code": 29482
},
{
"postal_code": 29484
},
{
"postal_code": 29485
},
{
"postal_code": 29487
},
{
"postal_code": 29488
},
{
"postal_code": 29490
},
{
"postal_code": 29491
},
{
"postal_code": 29493
},
{
"postal_code": 29494
},
{
"postal_code": 29496
},
{
"postal_code": 29497
},
{
"postal_code": 29499
},
{
"postal_code": 29525
},
{
"postal_code": 29549
},
{
"postal_code": 29553
},
{
"postal_code": 29556
},
{
"postal_code": 29559
},
{
"postal_code": 29562
},
{
"postal_code": 29565
},
{
"postal_code": 29571
},
{
"postal_code": 29574
},
{
"postal_code": 29575
},
{
"postal_code": 29576
},
{
"postal_code": 29578
},
{
"postal_code": 29579
},
{
"postal_code": 29581
},
{
"postal_code": 29582
},
{
"postal_code": 29584
},
{
"postal_code": 29585
},
{
"postal_code": 29587
},
{
"postal_code": 29588
},
{
"postal_code": 29590
},
{
"postal_code": 29591
},
{
"postal_code": 29593
},
{
"postal_code": 29594
},
{
"postal_code": 29597
},
{
"postal_code": 29599
},
{
"postal_code": 29614
},
{
"postal_code": 29633
},
{
"postal_code": 29640
},
{
"postal_code": 29643
},
{
"postal_code": 29646
},
{
"postal_code": 29649
},
{
"postal_code": 29664
},
{
"postal_code": 29683
},
{
"postal_code": 29690
},
{
"postal_code": 29693
},
{
"postal_code": 29699
},
{
"postal_code": 30159
},
{
"postal_code": 30827
},
{
"postal_code": 30853
},
{
"postal_code": 30880
},
{
"postal_code": 30890
},
{
"postal_code": 30900
},
{
"postal_code": 30916
},
{
"postal_code": 30926
},
{
"postal_code": 30938
},
{
"postal_code": 30952
},
{
"postal_code": 30966
},
{
"postal_code": 30974
},
{
"postal_code": 30982
},
{
"postal_code": 30989
},
{
"postal_code": 31008
},
{
"postal_code": 31020
},
{
"postal_code": 31028
},
{
"postal_code": 31029
},
{
"postal_code": 31032
},
{
"postal_code": 31033
},
{
"postal_code": 31035
},
{
"postal_code": 31036
},
{
"postal_code": 31039
},
{
"postal_code": 31061
},
{
"postal_code": 31073
},
{
"postal_code": 31079
},
{
"postal_code": 31084
},
{
"postal_code": 31085
},
{
"postal_code": 31087
},
{
"postal_code": 31088
},
{
"postal_code": 31089
},
{
"postal_code": 31091
},
{
"postal_code": 31093
},
{
"postal_code": 31094
},
{
"postal_code": 31096
},
{
"postal_code": 31097
},
{
"postal_code": 31099
},
{
"postal_code": 31134
},
{
"postal_code": 31157
},
{
"postal_code": 31162
},
{
"postal_code": 31167
},
{
"postal_code": 31171
},
{
"postal_code": 31174
},
{
"postal_code": 31177
},
{
"postal_code": 31180
},
{
"postal_code": 31185
},
{
"postal_code": 31188
},
{
"postal_code": 31191
},
{
"postal_code": 31195
},
{
"postal_code": 31196
},
{
"postal_code": 31199
},
{
"postal_code": 31224
},
{
"postal_code": 31234
},
{
"postal_code": 31241
},
{
"postal_code": 31246
},
{
"postal_code": 31249
},
{
"postal_code": 31275
},
{
"postal_code": 31303
},
{
"postal_code": 31311
},
{
"postal_code": 31319
},
{
"postal_code": 31515
},
{
"postal_code": 31535
},
{
"postal_code": 31542
},
{
"postal_code": 31547
},
{
"postal_code": 31552
},
{
"postal_code": 31553
},
{
"postal_code": 31555
},
{
"postal_code": 31556
},
{
"postal_code": 31558
},
{
"postal_code": 31559
},
{
"postal_code": 31582
},
{
"postal_code": 31592
},
{
"postal_code": 31595
},
{
"postal_code": 31600
},
{
"postal_code": 31603
},
{
"postal_code": 31604
},
{
"postal_code": 31606
},
{
"postal_code": 31608
},
{
"postal_code": 31609
},
{
"postal_code": 31613
},
{
"postal_code": 31618
},
{
"postal_code": 31619
},
{
"postal_code": 31621
},
{
"postal_code": 31622
},
{
"postal_code": 31623
},
{
"postal_code": 31626
},
{
"postal_code": 31627
},
{
"postal_code": 31628
},
{
"postal_code": 31629
},
{
"postal_code": 31632
},
{
"postal_code": 31633
},
{
"postal_code": 31634
},
{
"postal_code": 31636
},
{
"postal_code": 31637
},
{
"postal_code": 31638
},
{
"postal_code": 31655
},
{
"postal_code": 31675
},
{
"postal_code": 31683
},
{
"postal_code": 31688
},
{
"postal_code": 31691
},
{
"postal_code": 31693
},
{
"postal_code": 31698
},
{
"postal_code": 31699
},
{
"postal_code": 31700
},
{
"postal_code": 31702
},
{
"postal_code": 31707
},
{
"postal_code": 31708
},
{
"postal_code": 31710
},
{
"postal_code": 31711
},
{
"postal_code": 31712
},
{
"postal_code": 31714
},
{
"postal_code": 31715
},
{
"postal_code": 31717
},
{
"postal_code": 31718
},
{
"postal_code": 31719
},
{
"postal_code": 31737
},
{
"postal_code": 31749
},
{
"postal_code": 31785
},
{
"postal_code": 31812
},
{
"postal_code": 31832
},
{
"postal_code": 31840
},
{
"postal_code": 31848
},
{
"postal_code": 31855
},
{
"postal_code": 31860
},
{
"postal_code": 31863
},
{
"postal_code": 31867
},
{
"postal_code": 31868
},
{
"postal_code": 32052
},
{
"postal_code": 32105
},
{
"postal_code": 32120
},
{
"postal_code": 32130
},
{
"postal_code": 32139
},
{
"postal_code": 32257
},
{
"postal_code": 32278
},
{
"postal_code": 32289
},
{
"postal_code": 32312
},
{
"postal_code": 32339
},
{
"postal_code": 32351
},
{
"postal_code": 32361
},
{
"postal_code": 32369
},
{
"postal_code": 32423
},
{
"postal_code": 32457
},
{
"postal_code": 32469
},
{
"postal_code": 32479
},
{
"postal_code": 32545
},
{
"postal_code": 32584
},
{
"postal_code": 32602
},
{
"postal_code": 32609
},
{
"postal_code": 32657
},
{
"postal_code": 32676
},
{
"postal_code": 32683
},
{
"postal_code": 32689
},
{
"postal_code": 32694
},
{
"postal_code": 32699
},
{
"postal_code": 32756
},
{
"postal_code": 32791
},
{
"postal_code": 32805
},
{
"postal_code": 32816
},
{
"postal_code": 32825
},
{
"postal_code": 32832
},
{
"postal_code": 32839
},
{
"postal_code": 33014
},
{
"postal_code": 33034
},
{
"postal_code": 33039
},
{
"postal_code": 33098
},
{
"postal_code": 33129
},
{
"postal_code": 33142
},
{
"postal_code": 33154
},
{
"postal_code": 33161
},
{
"postal_code": 33165
},
{
"postal_code": 33175
},
{
"postal_code": 33178
},
{
"postal_code": 33181
},
{
"postal_code": 33184
},
{
"postal_code": 33189
},
{
"postal_code": 33330
},
{
"postal_code": 33378
},
{
"postal_code": 33397
},
{
"postal_code": 33415
},
{
"postal_code": 33428
},
{
"postal_code": 33442
},
{
"postal_code": 33449
},
{
"postal_code": 33602
},
{
"postal_code": 33758
},
{
"postal_code": 33775
},
{
"postal_code": 33790
},
{
"postal_code": 33803
},
{
"postal_code": 33813
},
{
"postal_code": 33818
},
{
"postal_code": 33824
},
{
"postal_code": 33829
},
{
"postal_code": 34117
},
{
"postal_code": 34212
},
{
"postal_code": 34225
},
{
"postal_code": 34233
},
{
"postal_code": 34246
},
{
"postal_code": 34253
},
{
"postal_code": 34260
},
{
"postal_code": 34266
},
{
"postal_code": 34270
},
{
"postal_code": 34277
},
{
"postal_code": 34281
},
{
"postal_code": 34286
},
{
"postal_code": 34289
},
{
"postal_code": 34292
},
{
"postal_code": 34295
},
{
"postal_code": 34298
},
{
"postal_code": 34302
},
{
"postal_code": 34305
},
{
"postal_code": 34308
},
{
"postal_code": 34311
},
{
"postal_code": 34314
},
{
"postal_code": 34317
},
{
"postal_code": 34320
},
{
"postal_code": 34323
},
{
"postal_code": 34326
},
{
"postal_code": 34327
},
{
"postal_code": 34329
},
{
"postal_code": 34346
},
{
"postal_code": 34355
},
{
"postal_code": 34359
},
{
"postal_code": 34369
},
{
"postal_code": 34376
},
{
"postal_code": 34379
},
{
"postal_code": 34385
},
{
"postal_code": 34388
},
{
"postal_code": 34393
},
{
"postal_code": 34396
},
{
"postal_code": 34399
},
{
"postal_code": 34414
},
{
"postal_code": 34431
},
{
"postal_code": 34434
},
{
"postal_code": 34439
},
{
"postal_code": 34454
},
{
"postal_code": 34466
},
{
"postal_code": 34471
},
{
"postal_code": 34474
},
{
"postal_code": 34477
},
{
"postal_code": 34479
},
{
"postal_code": 34497
},
{
"postal_code": 34508
},
{
"postal_code": 34513
},
{
"postal_code": 34516
},
{
"postal_code": 34519
},
{
"postal_code": 34537
},
{
"postal_code": 34549
},
{
"postal_code": 34560
},
{
"postal_code": 34576
},
{
"postal_code": 34582
},
{
"postal_code": 34587
},
{
"postal_code": 34590
},
{
"postal_code": 34593
},
{
"postal_code": 34596
},
{
"postal_code": 34599
},
{
"postal_code": 34613
},
{
"postal_code": 34621
},
{
"postal_code": 34626
},
{
"postal_code": 34628
},
{
"postal_code": 34630
},
{
"postal_code": 34632
},
{
"postal_code": 34633
},
{
"postal_code": 34637
},
{
"postal_code": 34639
},
{
"postal_code": 35037
},
{
"postal_code": 35066
},
{
"postal_code": 35075
},
{
"postal_code": 35080
},
{
"postal_code": 35083
},
{
"postal_code": 35085
},
{
"postal_code": 35088
},
{
"postal_code": 35091
},
{
"postal_code": 35094
},
{
"postal_code": 35096
},
{
"postal_code": 35099
},
{
"postal_code": 35102
},
{
"postal_code": 35104
},
{
"postal_code": 35108
},
{
"postal_code": 35110
},
{
"postal_code": 35112
},
{
"postal_code": 35114
},
{
"postal_code": 35116
},
{
"postal_code": 35117
},
{
"postal_code": 35119
},
{
"postal_code": 35216
},
{
"postal_code": 35232
},
{
"postal_code": 35236
},
{
"postal_code": 35239
},
{
"postal_code": 35260
},
{
"postal_code": 35274
},
{
"postal_code": 35279
},
{
"postal_code": 35282
},
{
"postal_code": 35285
},
{
"postal_code": 35287
},
{
"postal_code": 35288
},
{
"postal_code": 35305
},
{
"postal_code": 35315
},
{
"postal_code": 35321
},
{
"postal_code": 35325
},
{
"postal_code": 35327
},
{
"postal_code": 35329
},
{
"postal_code": 35390
},
{
"postal_code": 35410
},
{
"postal_code": 35415
},
{
"postal_code": 35418
},
{
"postal_code": 35423
},
{
"postal_code": 35428
},
{
"postal_code": 35435
},
{
"postal_code": 35440
},
{
"postal_code": 35444
},
{
"postal_code": 35447
},
{
"postal_code": 35452
},
{
"postal_code": 35457
},
{
"postal_code": 35460
},
{
"postal_code": 35463
},
{
"postal_code": 35466
},
{
"postal_code": 35469
},
{
"postal_code": 35510
},
{
"postal_code": 35516
},
{
"postal_code": 35519
},
{
"postal_code": 35578
},
{
"postal_code": 35606
},
{
"postal_code": 35614
},
{
"postal_code": 35619
},
{
"postal_code": 35625
},
{
"postal_code": 35630
},
{
"postal_code": 35633
},
{
"postal_code": 35638
},
{
"postal_code": 35641
},
{
"postal_code": 35644
},
{
"postal_code": 35647
},
{
"postal_code": 35649
},
{
"postal_code": 35683
},
{
"postal_code": 35708
},
{
"postal_code": 35713
},
{
"postal_code": 35716
},
{
"postal_code": 35719
},
{
"postal_code": 35745
},
{
"postal_code": 35753
},
{
"postal_code": 35756
},
{
"postal_code": 35759
},
{
"postal_code": 35764
},
{
"postal_code": 35767
},
{
"postal_code": 35768
},
{
"postal_code": 35781
},
{
"postal_code": 35789
},
{
"postal_code": 35792
},
{
"postal_code": 35794
},
{
"postal_code": 35796
},
{
"postal_code": 35799
},
{
"postal_code": 36037
},
{
"postal_code": 36088
},
{
"postal_code": 36093
},
{
"postal_code": 36100
},
{
"postal_code": 36103
},
{
"postal_code": 36110
},
{
"postal_code": 36115
},
{
"postal_code": 36119
},
{
"postal_code": 36124
},
{
"postal_code": 36129
},
{
"postal_code": 36132
},
{
"postal_code": 36137
},
{
"postal_code": 36142
},
{
"postal_code": 36145
},
{
"postal_code": 36148
},
{
"postal_code": 36151
},
{
"postal_code": 36154
},
{
"postal_code": 36157
},
{
"postal_code": 36160
},
{
"postal_code": 36163
},
{
"postal_code": 36166
},
{
"postal_code": 36167
},
{
"postal_code": 36169
},
{
"postal_code": 36179
},
{
"postal_code": 36199
},
{
"postal_code": 36205
},
{
"postal_code": 36208
},
{
"postal_code": 36211
},
{
"postal_code": 36214
},
{
"postal_code": 36217
},
{
"postal_code": 36219
},
{
"postal_code": 36251
},
{
"postal_code": 36266
},
{
"postal_code": 36269
},
{
"postal_code": 36272
},
{
"postal_code": 36275
},
{
"postal_code": 36277
},
{
"postal_code": 36280
},
{
"postal_code": 36282
},
{
"postal_code": 36284
},
{
"postal_code": 36286
},
{
"postal_code": 36287
},
{
"postal_code": 36289
},
{
"postal_code": 36304
},
{
"postal_code": 36318
},
{
"postal_code": 36320
},
{
"postal_code": 36323
},
{
"postal_code": 36325
},
{
"postal_code": 36326
},
{
"postal_code": 36329
},
{
"postal_code": 36341
},
{
"postal_code": 36355
},
{
"postal_code": 36358
},
{
"postal_code": 36364
},
{
"postal_code": 36367
},
{
"postal_code": 36369
},
{
"postal_code": 36381
},
{
"postal_code": 36391
},
{
"postal_code": 36396
},
{
"postal_code": 36399
},
{
"postal_code": 36404
},
{
"postal_code": 36414
},
{
"postal_code": 36419
},
{
"postal_code": 36433
},
{
"postal_code": 36448
},
{
"postal_code": 36452
},
{
"postal_code": 36456
},
{
"postal_code": 36457
},
{
"postal_code": 36460
},
{
"postal_code": 36466
},
{
"postal_code": 36469
},
{
"postal_code": 37083
},
{
"postal_code": 37115
},
{
"postal_code": 37120
},
{
"postal_code": 37124
},
{
"postal_code": 37127
},
{
"postal_code": 37130
},
{
"postal_code": 37133
},
{
"postal_code": 37136
},
{
"postal_code": 37139
},
{
"postal_code": 37154
},
{
"postal_code": 37170
},
{
"postal_code": 37176
},
{
"postal_code": 37181
},
{
"postal_code": 37186
},
{
"postal_code": 37191
},
{
"postal_code": 37194
},
{
"postal_code": 37197
},
{
"postal_code": 37199
},
{
"postal_code": 37213
},
{
"postal_code": 37235
},
{
"postal_code": 37242
},
{
"postal_code": 37247
},
{
"postal_code": 37249
},
{
"postal_code": 37269
},
{
"postal_code": 37276
},
{
"postal_code": 37281
},
{
"postal_code": 37284
},
{
"postal_code": 37287
},
{
"postal_code": 37290
},
{
"postal_code": 37293
},
{
"postal_code": 37296
},
{
"postal_code": 37297
},
{
"postal_code": 37299
},
{
"postal_code": 37308
},
{
"postal_code": 37318
},
{
"postal_code": 37327
},
{
"postal_code": 37339
},
{
"postal_code": 37345
},
{
"postal_code": 37351
},
{
"postal_code": 37355
},
{
"postal_code": 37359
},
{
"postal_code": 37412
},
{
"postal_code": 37431
},
{
"postal_code": 37434
},
{
"postal_code": 37441
},
{
"postal_code": 37445
},
{
"postal_code": 37447
},
{
"postal_code": 37449
},
{
"postal_code": 37520
},
{
"postal_code": 37539
},
{
"postal_code": 37574
},
{
"postal_code": 37581
},
{
"postal_code": 37586
},
{
"postal_code": 37589
},
{
"postal_code": 37603
},
{
"postal_code": 37619
},
{
"postal_code": 37620
},
{
"postal_code": 37627
},
{
"postal_code": 37632
},
{
"postal_code": 37633
},
{
"postal_code": 37635
},
{
"postal_code": 37639
},
{
"postal_code": 37640
},
{
"postal_code": 37642
},
{
"postal_code": 37643
},
{
"postal_code": 37647
},
{
"postal_code": 37649
},
{
"postal_code": 37671
},
{
"postal_code": 37688
},
{
"postal_code": 37691
},
{
"postal_code": 37696
},
{
"postal_code": 37697
},
{
"postal_code": 37699
},
{
"postal_code": 38100
},
{
"postal_code": 38154
},
{
"postal_code": 38159
},
{
"postal_code": 38162
},
{
"postal_code": 38165
},
{
"postal_code": 38170
},
{
"postal_code": 38173
},
{
"postal_code": 38176
},
{
"postal_code": 38179
},
{
"postal_code": 38226
},
{
"postal_code": 38268
},
{
"postal_code": 38271
},
{
"postal_code": 38272
},
{
"postal_code": 38274
},
{
"postal_code": 38275
},
{
"postal_code": 38277
},
{
"postal_code": 38279
},
{
"postal_code": 38300
},
{
"postal_code": 38312
},
{
"postal_code": 38315
},
{
"postal_code": 38319
},
{
"postal_code": 38321
},
{
"postal_code": 38322
},
{
"postal_code": 38324
},
{
"postal_code": 38325
},
{
"postal_code": 38327
},
{
"postal_code": 38329
},
{
"postal_code": 38350
},
{
"postal_code": 38364
},
{
"postal_code": 38368
},
{
"postal_code": 38372
},
{
"postal_code": 38373
},
{
"postal_code": 38375
},
{
"postal_code": 38376
},
{
"postal_code": 38378
},
{
"postal_code": 38379
},
{
"postal_code": 38381
},
{
"postal_code": 38382
},
{
"postal_code": 38384
},
{
"postal_code": 38385
},
{
"postal_code": 38387
},
{
"postal_code": 38388
},
{
"postal_code": 38440
},
{
"postal_code": 38458
},
{
"postal_code": 38459
},
{
"postal_code": 38461
},
{
"postal_code": 38462
},
{
"postal_code": 38464
},
{
"postal_code": 38465
},
{
"postal_code": 38467
},
{
"postal_code": 38468
},
{
"postal_code": 38470
},
{
"postal_code": 38471
},
{
"postal_code": 38473
},
{
"postal_code": 38474
},
{
"postal_code": 38476
},
{
"postal_code": 38477
},
{
"postal_code": 38479
},
{
"postal_code": 38486
},
{
"postal_code": 38489
},
{
"postal_code": 38518
},
{
"postal_code": 38524
},
{
"postal_code": 38527
},
{
"postal_code": 38528
},
{
"postal_code": 38530
},
{
"postal_code": 38531
},
{
"postal_code": 38533
},
{
"postal_code": 38536
},
{
"postal_code": 38539
},
{
"postal_code": 38542
},
{
"postal_code": 38543
},
{
"postal_code": 38547
},
{
"postal_code": 38550
},
{
"postal_code": 38551
},
{
"postal_code": 38553
},
{
"postal_code": 38554
},
{
"postal_code": 38556
},
{
"postal_code": 38557
},
{
"postal_code": 38559
},
{
"postal_code": 38640
},
{
"postal_code": 38667
},
{
"postal_code": 38678
},
{
"postal_code": 38685
},
{
"postal_code": 38690
},
{
"postal_code": 38700
},
{
"postal_code": 38704
},
{
"postal_code": 38707
},
{
"postal_code": 38709
},
{
"postal_code": 38723
},
{
"postal_code": 38729
},
{
"postal_code": 38820
},
{
"postal_code": 38822
},
{
"postal_code": 38828
},
{
"postal_code": 38829
},
{
"postal_code": 38835
},
{
"postal_code": 38838
},
{
"postal_code": 38855
},
{
"postal_code": 38871
},
{
"postal_code": 38875
},
{
"postal_code": 38889
},
{
"postal_code": 39104
},
{
"postal_code": 39164
},
{
"postal_code": 39167
},
{
"postal_code": 39171
},
{
"postal_code": 39175
},
{
"postal_code": 39179
},
{
"postal_code": 39218
},
{
"postal_code": 39221
},
{
"postal_code": 39240
},
{
"postal_code": 39245
},
{
"postal_code": 39249
},
{
"postal_code": 39261
},
{
"postal_code": 39288
},
{
"postal_code": 39291
},
{
"postal_code": 39307
},
{
"postal_code": 39317
},
{
"postal_code": 39319
},
{
"postal_code": 39326
},
{
"postal_code": 39340
},
{
"postal_code": 39343
},
{
"postal_code": 39345
},
{
"postal_code": 39359
},
{
"postal_code": 39365
},
{
"postal_code": 39387
},
{
"postal_code": 39393
},
{
"postal_code": 39397
},
{
"postal_code": 39418
},
{
"postal_code": 39435
},
{
"postal_code": 39439
},
{
"postal_code": 39444
},
{
"postal_code": 39448
},
{
"postal_code": 39517
},
{
"postal_code": 39524
},
{
"postal_code": 39539
},
{
"postal_code": 39576
},
{
"postal_code": 39579
},
{
"postal_code": 39590
},
{
"postal_code": 39596
},
{
"postal_code": 39606
},
{
"postal_code": 39615
},
{
"postal_code": 39619
},
{
"postal_code": 39624
},
{
"postal_code": 39629
},
{
"postal_code": 39638
},
{
"postal_code": 39646
},
{
"postal_code": 40213
},
{
"postal_code": 40667
},
{
"postal_code": 40699
},
{
"postal_code": 40721
},
{
"postal_code": 40764
},
{
"postal_code": 40789
},
{
"postal_code": 40822
},
{
"postal_code": 40878
},
{
"postal_code": 41061
},
{
"postal_code": 41334
},
{
"postal_code": 41352
},
{
"postal_code": 41363
},
{
"postal_code": 41366
},
{
"postal_code": 41372
},
{
"postal_code": 41379
},
{
"postal_code": 41460
},
{
"postal_code": 41515
},
{
"postal_code": 41539
},
{
"postal_code": 41564
},
{
"postal_code": 41569
},
{
"postal_code": 41747
},
{
"postal_code": 41812
},
{
"postal_code": 41836
},
{
"postal_code": 41844
},
{
"postal_code": 41849
},
{
"postal_code": 42275
},
{
"postal_code": 42477
},
{
"postal_code": 42489
},
{
"postal_code": 42499
},
{
"postal_code": 42551
},
{
"postal_code": 42579
},
{
"postal_code": 42651
},
{
"postal_code": 42781
},
{
"postal_code": 42799
},
{
"postal_code": 42853
},
{
"postal_code": 42929
},
{
"postal_code": 44135
},
{
"postal_code": 44532
},
{
"postal_code": 44575
},
{
"postal_code": 44623
},
{
"postal_code": 44787
},
{
"postal_code": 45127
},
{
"postal_code": 45468
},
{
"postal_code": 45525
},
{
"postal_code": 45549
},
{
"postal_code": 45657
},
{
"postal_code": 45699
},
{
"postal_code": 45711
},
{
"postal_code": 45721
},
{
"postal_code": 45731
},
{
"postal_code": 45739
},
{
"postal_code": 45768
},
{
"postal_code": 45879
},
{
"postal_code": 45964
},
{
"postal_code": 46045
},
{
"postal_code": 46236
},
{
"postal_code": 46284
},
{
"postal_code": 46325
},
{
"postal_code": 46342
},
{
"postal_code": 46348
},
{
"postal_code": 46354
},
{
"postal_code": 46359
},
{
"postal_code": 46395
},
{
"postal_code": 46414
},
{
"postal_code": 46419
},
{
"postal_code": 46446
},
{
"postal_code": 46459
},
{
"postal_code": 46483
},
{
"postal_code": 46499
},
{
"postal_code": 46509
},
{
"postal_code": 46514
},
{
"postal_code": 46519
},
{
"postal_code": 46535
},
{
"postal_code": 46562
},
{
"postal_code": 46569
},
{
"postal_code": 47051
},
{
"postal_code": 47441
},
{
"postal_code": 47475
},
{
"postal_code": 47495
},
{
"postal_code": 47506
},
{
"postal_code": 47509
},
{
"postal_code": 47533
},
{
"postal_code": 47546
},
{
"postal_code": 47551
},
{
"postal_code": 47559
},
{
"postal_code": 47574
},
{
"postal_code": 47589
},
{
"postal_code": 47608
},
{
"postal_code": 47623
},
{
"postal_code": 47638
},
{
"postal_code": 47647
},
{
"postal_code": 47652
},
{
"postal_code": 47661
},
{
"postal_code": 47665
},
{
"postal_code": 47669
},
{
"postal_code": 47803
},
{
"postal_code": 47877
},
{
"postal_code": 47906
},
{
"postal_code": 47918
},
{
"postal_code": 47929
},
{
"postal_code": 48143
},
{
"postal_code": 48231
},
{
"postal_code": 48249
},
{
"postal_code": 48268
},
{
"postal_code": 48282
},
{
"postal_code": 48291
},
{
"postal_code": 48301
},
{
"postal_code": 48308
},
{
"postal_code": 48317
},
{
"postal_code": 48324
},
{
"postal_code": 48329
},
{
"postal_code": 48336
},
{
"postal_code": 48341
},
{
"postal_code": 48346
},
{
"postal_code": 48351
},
{
"postal_code": 48356
},
{
"postal_code": 48361
},
{
"postal_code": 48366
},
{
"postal_code": 48369
},
{
"postal_code": 48431
},
{
"postal_code": 48455
},
{
"postal_code": 48465
},
{
"postal_code": 48477
},
{
"postal_code": 48480
},
{
"postal_code": 48485
},
{
"postal_code": 48488
},
{
"postal_code": 48493
},
{
"postal_code": 48496
},
{
"postal_code": 48499
},
{
"postal_code": 48529
},
{
"postal_code": 48565
},
{
"postal_code": 48599
},
{
"postal_code": 48607
},
{
"postal_code": 48612
},
{
"postal_code": 48619
},
{
"postal_code": 48624
},
{
"postal_code": 48629
},
{
"postal_code": 48653
},
{
"postal_code": 48683
},
{
"postal_code": 48691
},
{
"postal_code": 48703
},
{
"postal_code": 48712
},
{
"postal_code": 48720
},
{
"postal_code": 48727
},
{
"postal_code": 48734
},
{
"postal_code": 48739
},
{
"postal_code": 49074
},
{
"postal_code": 49124
},
{
"postal_code": 49134
},
{
"postal_code": 49143
},
{
"postal_code": 49152
},
{
"postal_code": 49163
},
{
"postal_code": 49170
},
{
"postal_code": 49176
},
{
"postal_code": 49179
},
{
"postal_code": 49186
},
{
"postal_code": 49191
},
{
"postal_code": 49196
},
{
"postal_code": 49201
},
{
"postal_code": 49205
},
{
"postal_code": 49214
},
{
"postal_code": 49219
},
{
"postal_code": 49324
},
{
"postal_code": 49356
},
{
"postal_code": 49377
},
{
"postal_code": 49393
},
{
"postal_code": 49401
},
{
"postal_code": 49406
},
{
"postal_code": 49413
},
{
"postal_code": 49419
},
{
"postal_code": 49424
},
{
"postal_code": 49429
},
{
"postal_code": 49434
},
{
"postal_code": 49439
},
{
"postal_code": 49448
},
{
"postal_code": 49451
},
{
"postal_code": 49453
},
{
"postal_code": 49456
},
{
"postal_code": 49457
},
{
"postal_code": 49459
},
{
"postal_code": 49477
},
{
"postal_code": 49492
},
{
"postal_code": 49497
},
{
"postal_code": 49504
},
{
"postal_code": 49509
},
{
"postal_code": 49525
},
{
"postal_code": 49536
},
{
"postal_code": 49545
},
{
"postal_code": 49549
},
{
"postal_code": 49565
},
{
"postal_code": 49577
},
{
"postal_code": 49584
},
{
"postal_code": 49586
},
{
"postal_code": 49593
},
{
"postal_code": 49594
},
{
"postal_code": 49596
},
{
"postal_code": 49597
},
{
"postal_code": 49599
},
{
"postal_code": 49610
},
{
"postal_code": 49624
},
{
"postal_code": 49626
},
{
"postal_code": 49632
},
{
"postal_code": 49635
},
{
"postal_code": 49637
},
{
"postal_code": 49638
},
{
"postal_code": 49661
},
{
"postal_code": 49681
},
{
"postal_code": 49685
},
{
"postal_code": 49688
},
{
"postal_code": 49692
},
{
"postal_code": 49696
},
{
"postal_code": 49699
},
{
"postal_code": 49716
},
{
"postal_code": 49733
},
{
"postal_code": 49740
},
{
"postal_code": 49744
},
{
"postal_code": 49751
},
{
"postal_code": 49757
},
{
"postal_code": 49762
},
{
"postal_code": 49767
},
{
"postal_code": 49770
},
{
"postal_code": 49774
},
{
"postal_code": 49777
},
{
"postal_code": 49779
},
{
"postal_code": 49808
},
{
"postal_code": 49824
},
{
"postal_code": 49828
},
{
"postal_code": 49832
},
{
"postal_code": 49835
},
{
"postal_code": 49838
},
{
"postal_code": 49843
},
{
"postal_code": 49844
},
{
"postal_code": 49846
},
{
"postal_code": 49847
},
{
"postal_code": 49849
},
{
"postal_code": 50126
},
{
"postal_code": 50171
},
{
"postal_code": 50181
},
{
"postal_code": 50189
},
{
"postal_code": 50226
},
{
"postal_code": 50259
},
{
"postal_code": 50321
},
{
"postal_code": 50354
},
{
"postal_code": 50374
},
{
"postal_code": 50389
},
{
"postal_code": 50667
},
{
"postal_code": 51373
},
{
"postal_code": 51399
},
{
"postal_code": 51465
},
{
"postal_code": 51491
},
{
"postal_code": 51503
},
{
"postal_code": 51515
},
{
"postal_code": 51519
},
{
"postal_code": 51545
},
{
"postal_code": 51570
},
{
"postal_code": 51580
},
{
"postal_code": 51588
},
{
"postal_code": 51597
},
{
"postal_code": 51598
},
{
"postal_code": 51643
},
{
"postal_code": 51674
},
{
"postal_code": 51688
},
{
"postal_code": 51702
},
{
"postal_code": 51709
},
{
"postal_code": 51766
},
{
"postal_code": 51789
},
{
"postal_code": 52062
},
{
"postal_code": 52134
},
{
"postal_code": 52146
},
{
"postal_code": 52152
},
{
"postal_code": 52156
},
{
"postal_code": 52159
},
{
"postal_code": 52222
},
{
"postal_code": 52249
},
{
"postal_code": 52349
},
{
"postal_code": 52372
},
{
"postal_code": 52379
},
{
"postal_code": 52382
},
{
"postal_code": 52385
},
{
"postal_code": 52388
},
{
"postal_code": 52391
},
{
"postal_code": 52393
},
{
"postal_code": 52396
},
{
"postal_code": 52399
},
{
"postal_code": 52428
},
{
"postal_code": 52441
},
{
"postal_code": 52445
},
{
"postal_code": 52457
},
{
"postal_code": 52459
},
{
"postal_code": 52477
},
{
"postal_code": 52499
},
{
"postal_code": 52511
},
{
"postal_code": 52525
},
{
"postal_code": 52531
},
{
"postal_code": 52538
},
{
"postal_code": 53111
},
{
"postal_code": 53332
},
{
"postal_code": 53340
},
{
"postal_code": 53343
},
{
"postal_code": 53347
},
{
"postal_code": 53359
},
{
"postal_code": 53424
},
{
"postal_code": 53426
},
{
"postal_code": 53474
},
{
"postal_code": 53489
},
{
"postal_code": 53498
},
{
"postal_code": 53501
},
{
"postal_code": 53505
},
{
"postal_code": 53506
},
{
"postal_code": 53507
},
{
"postal_code": 53508
},
{
"postal_code": 53518
},
{
"postal_code": 53520
},
{
"postal_code": 53533
},
{
"postal_code": 53534
},
{
"postal_code": 53539
},
{
"postal_code": 53545
},
{
"postal_code": 53547
},
{
"postal_code": 53557
},
{
"postal_code": 53560
},
{
"postal_code": 53562
},
{
"postal_code": 53567
},
{
"postal_code": 53572
},
{
"postal_code": 53577
},
{
"postal_code": 53578
},
{
"postal_code": 53579
},
{
"postal_code": 53604
},
{
"postal_code": 53619
},
{
"postal_code": 53639
},
{
"postal_code": 53721
},
{
"postal_code": 53757
},
{
"postal_code": 53773
},
{
"postal_code": 53783
},
{
"postal_code": 53797
},
{
"postal_code": 53804
},
{
"postal_code": 53809
},
{
"postal_code": 53819
},
{
"postal_code": 53840
},
{
"postal_code": 53859
},
{
"postal_code": 53879
},
{
"postal_code": 53894
},
{
"postal_code": 53902
},
{
"postal_code": 53909
},
{
"postal_code": 53913
},
{
"postal_code": 53919
},
{
"postal_code": 53925
},
{
"postal_code": 53937
},
{
"postal_code": 53940
},
{
"postal_code": 53945
},
{
"postal_code": 53947
},
{
"postal_code": 53949
},
{
"postal_code": 54290
},
{
"postal_code": 54298
},
{
"postal_code": 54306
},
{
"postal_code": 54308
},
{
"postal_code": 54309
},
{
"postal_code": 54310
},
{
"postal_code": 54311
},
{
"postal_code": 54313
},
{
"postal_code": 54314
},
{
"postal_code": 54316
},
{
"postal_code": 54317
},
{
"postal_code": 54318
},
{
"postal_code": 54320
},
{
"postal_code": 54329
},
{
"postal_code": 54331
},
{
"postal_code": 54332
},
{
"postal_code": 54338
},
{
"postal_code": 54340
},
{
"postal_code": 54341
},
{
"postal_code": 54343
},
{
"postal_code": 54344
},
{
"postal_code": 54346
},
{
"postal_code": 54347
},
{
"postal_code": 54349
},
{
"postal_code": 54411
},
{
"postal_code": 54413
},
{
"postal_code": 54421
},
{
"postal_code": 54422
},
{
"postal_code": 54424
},
{
"postal_code": 54426
},
{
"postal_code": 54427
},
{
"postal_code": 54429
},
{
"postal_code": 54439
},
{
"postal_code": 54441
},
{
"postal_code": 54450
},
{
"postal_code": 54451
},
{
"postal_code": 54453
},
{
"postal_code": 54455
},
{
"postal_code": 54456
},
{
"postal_code": 54457
},
{
"postal_code": 54459
},
{
"postal_code": 54470
},
{
"postal_code": 54472
},
{
"postal_code": 54483
},
{
"postal_code": 54484
},
{
"postal_code": 54486
},
{
"postal_code": 54487
},
{
"postal_code": 54492
},
{
"postal_code": 54497
},
{
"postal_code": 54498
},
{
"postal_code": 54516
},
{
"postal_code": 54518
},
{
"postal_code": 54523
},
{
"postal_code": 54524
},
{
"postal_code": 54526
},
{
"postal_code": 54528
},
{
"postal_code": 54529
},
{
"postal_code": 54531
},
{
"postal_code": 54533
},
{
"postal_code": 54534
},
{
"postal_code": 54536
},
{
"postal_code": 54538
},
{
"postal_code": 54539
},
{
"postal_code": 54550
},
{
"postal_code": 54552
},
{
"postal_code": 54558
},
{
"postal_code": 54568
},
{
"postal_code": 54570
},
{
"postal_code": 54574
},
{
"postal_code": 54576
},
{
"postal_code": 54578
},
{
"postal_code": 54579
},
{
"postal_code": 54584
},
{
"postal_code": 54585
},
{
"postal_code": 54586
},
{
"postal_code": 54587
},
{
"postal_code": 54589
},
{
"postal_code": 54595
},
{
"postal_code": 54597
},
{
"postal_code": 54608
},
{
"postal_code": 54610
},
{
"postal_code": 54611
},
{
"postal_code": 54612
},
{
"postal_code": 54614
},
{
"postal_code": 54616
},
{
"postal_code": 54617
},
{
"postal_code": 54619
},
{
"postal_code": 54634
},
{
"postal_code": 54636
},
{
"postal_code": 54646
},
{
"postal_code": 54647
},
{
"postal_code": 54649
},
{
"postal_code": 54655
},
{
"postal_code": 54657
},
{
"postal_code": 54662
},
{
"postal_code": 54664
},
{
"postal_code": 54666
},
{
"postal_code": 54668
},
{
"postal_code": 54669
},
{
"postal_code": 54673
},
{
"postal_code": 54675
},
{
"postal_code": 54687
},
{
"postal_code": 54689
},
{
"postal_code": 55116
},
{
"postal_code": 55218
},
{
"postal_code": 55232
},
{
"postal_code": 55234
},
{
"postal_code": 55237
},
{
"postal_code": 55239
},
{
"postal_code": 55257
},
{
"postal_code": 55262
},
{
"postal_code": 55263
},
{
"postal_code": 55268
},
{
"postal_code": 55270
},
{
"postal_code": 55271
},
{
"postal_code": 55276
},
{
"postal_code": 55278
},
{
"postal_code": 55283
},
{
"postal_code": 55286
},
{
"postal_code": 55288
},
{
"postal_code": 55291
},
{
"postal_code": 55294
},
{
"postal_code": 55296
},
{
"postal_code": 55299
},
{
"postal_code": 55411
},
{
"postal_code": 55413
},
{
"postal_code": 55422
},
{
"postal_code": 55424
},
{
"postal_code": 55425
},
{
"postal_code": 55430
},
{
"postal_code": 55432
},
{
"postal_code": 55435
},
{
"postal_code": 55437
},
{
"postal_code": 55442
},
{
"postal_code": 55444
},
{
"postal_code": 55450
},
{
"postal_code": 55452
},
{
"postal_code": 55457
},
{
"postal_code": 55459
},
{
"postal_code": 55469
},
{
"postal_code": 55471
},
{
"postal_code": 55481
},
{
"postal_code": 55483
},
{
"postal_code": 55487
},
{
"postal_code": 55490
},
{
"postal_code": 55491
},
{
"postal_code": 55494
},
{
"postal_code": 55496
},
{
"postal_code": 55497
},
{
"postal_code": 55499
},
{
"postal_code": 55545
},
{
"postal_code": 55546
},
{
"postal_code": 55559
},
{
"postal_code": 55566
},
{
"postal_code": 55568
},
{
"postal_code": 55569
},
{
"postal_code": 55571
},
{
"postal_code": 55576
},
{
"postal_code": 55578
},
{
"postal_code": 55583
},
{
"postal_code": 55585
},
{
"postal_code": 55590
},
{
"postal_code": 55592
},
{
"postal_code": 55593
},
{
"postal_code": 55595
},
{
"postal_code": 55596
},
{
"postal_code": 55597
},
{
"postal_code": 55599
},
{
"postal_code": 55606
},
{
"postal_code": 55608
},
{
"postal_code": 55618
},
{
"postal_code": 55619
},
{
"postal_code": 55621
},
{
"postal_code": 55624
},
{
"postal_code": 55626
},
{
"postal_code": 55627
},
{
"postal_code": 55629
},
{
"postal_code": 55743
},
{
"postal_code": 55756
},
{
"postal_code": 55758
},
{
"postal_code": 55765
},
{
"postal_code": 55767
},
{
"postal_code": 55768
},
{
"postal_code": 55774
},
{
"postal_code": 55776
},
{
"postal_code": 55777
},
{
"postal_code": 55779
},
{
"postal_code": 56068
},
{
"postal_code": 56112
},
{
"postal_code": 56130
},
{
"postal_code": 56132
},
{
"postal_code": 56133
},
{
"postal_code": 56154
},
{
"postal_code": 56170
},
{
"postal_code": 56179
},
{
"postal_code": 56182
},
{
"postal_code": 56191
},
{
"postal_code": 56203
},
{
"postal_code": 56204
},
{
"postal_code": 56206
},
{
"postal_code": 56218
},
{
"postal_code": 56220
},
{
"postal_code": 56235
},
{
"postal_code": 56237
},
{
"postal_code": 56242
},
{
"postal_code": 56244
},
{
"postal_code": 56249
},
{
"postal_code": 56253
},
{
"postal_code": 56254
},
{
"postal_code": 56269
},
{
"postal_code": 56271
},
{
"postal_code": 56276
},
{
"postal_code": 56281
},
{
"postal_code": 56283
},
{
"postal_code": 56288
},
{
"postal_code": 56290
},
{
"postal_code": 56291
},
{
"postal_code": 56294
},
{
"postal_code": 56295
},
{
"postal_code": 56299
},
{
"postal_code": 56305
},
{
"postal_code": 56307
},
{
"postal_code": 56316
},
{
"postal_code": 56317
},
{
"postal_code": 56321
},
{
"postal_code": 56322
},
{
"postal_code": 56323
},
{
"postal_code": 56329
},
{
"postal_code": 56330
},
{
"postal_code": 56332
},
{
"postal_code": 56333
},
{
"postal_code": 56335
},
{
"postal_code": 56337
},
{
"postal_code": 56338
},
{
"postal_code": 56340
},
{
"postal_code": 56341
},
{
"postal_code": 56346
},
{
"postal_code": 56348
},
{
"postal_code": 56349
},
{
"postal_code": 56355
},
{
"postal_code": 56357
},
{
"postal_code": 56368
},
{
"postal_code": 56370
},
{
"postal_code": 56377
},
{
"postal_code": 56379
},
{
"postal_code": 56410
},
{
"postal_code": 56412
},
{
"postal_code": 56414
},
{
"postal_code": 56422
},
{
"postal_code": 56424
},
{
"postal_code": 56427
},
{
"postal_code": 56428
},
{
"postal_code": 56457
},
{
"postal_code": 56459
},
{
"postal_code": 56462
},
{
"postal_code": 56470
},
{
"postal_code": 56472
},
{
"postal_code": 56477
},
{
"postal_code": 56479
},
{
"postal_code": 56564
},
{
"postal_code": 56575
},
{
"postal_code": 56579
},
{
"postal_code": 56581
},
{
"postal_code": 56584
},
{
"postal_code": 56587
},
{
"postal_code": 56588
},
{
"postal_code": 56589
},
{
"postal_code": 56593
},
{
"postal_code": 56594
},
{
"postal_code": 56598
},
{
"postal_code": 56599
},
{
"postal_code": 56626
},
{
"postal_code": 56630
},
{
"postal_code": 56637
},
{
"postal_code": 56642
},
{
"postal_code": 56645
},
{
"postal_code": 56648
},
{
"postal_code": 56651
},
{
"postal_code": 56653
},
{
"postal_code": 56656
},
{
"postal_code": 56659
},
{
"postal_code": 56727
},
{
"postal_code": 56729
},
{
"postal_code": 56736
},
{
"postal_code": 56743
},
{
"postal_code": 56745
},
{
"postal_code": 56746
},
{
"postal_code": 56751
},
{
"postal_code": 56753
},
{
"postal_code": 56754
},
{
"postal_code": 56759
},
{
"postal_code": 56761
},
{
"postal_code": 56766
},
{
"postal_code": 56767
},
{
"postal_code": 56769
},
{
"postal_code": 56812
},
{
"postal_code": 56814
},
{
"postal_code": 56818
},
{
"postal_code": 56820
},
{
"postal_code": 56821
},
{
"postal_code": 56823
},
{
"postal_code": 56825
},
{
"postal_code": 56826
},
{
"postal_code": 56828
},
{
"postal_code": 56829
},
{
"postal_code": 56841
},
{
"postal_code": 56843
},
{
"postal_code": 56850
},
{
"postal_code": 56856
},
{
"postal_code": 56858
},
{
"postal_code": 56859
},
{
"postal_code": 56861
},
{
"postal_code": 56862
},
{
"postal_code": 56864
},
{
"postal_code": 56865
},
{
"postal_code": 56867
},
{
"postal_code": 56869
},
{
"postal_code": 57072
},
{
"postal_code": 57223
},
{
"postal_code": 57234
},
{
"postal_code": 57250
},
{
"postal_code": 57258
},
{
"postal_code": 57271
},
{
"postal_code": 57290
},
{
"postal_code": 57299
},
{
"postal_code": 57319
},
{
"postal_code": 57334
},
{
"postal_code": 57339
},
{
"postal_code": 57368
},
{
"postal_code": 57392
},
{
"postal_code": 57399
},
{
"postal_code": 57413
},
{
"postal_code": 57439
},
{
"postal_code": 57462
},
{
"postal_code": 57482
},
{
"postal_code": 57489
},
{
"postal_code": 57518
},
{
"postal_code": 57520
},
{
"postal_code": 57537
},
{
"postal_code": 57539
},
{
"postal_code": 57548
},
{
"postal_code": 57555
},
{
"postal_code": 57562
},
{
"postal_code": 57567
},
{
"postal_code": 57572
},
{
"postal_code": 57577
},
{
"postal_code": 57578
},
{
"postal_code": 57580
},
{
"postal_code": 57581
},
{
"postal_code": 57583
},
{
"postal_code": 57584
},
{
"postal_code": 57586
},
{
"postal_code": 57587
},
{
"postal_code": 57589
},
{
"postal_code": 57610
},
{
"postal_code": 57612
},
{
"postal_code": 57614
},
{
"postal_code": 57627
},
{
"postal_code": 57629
},
{
"postal_code": 57632
},
{
"postal_code": 57635
},
{
"postal_code": 57636
},
{
"postal_code": 57638
},
{
"postal_code": 57639
},
{
"postal_code": 57641
},
{
"postal_code": 57642
},
{
"postal_code": 57644
},
{
"postal_code": 57645
},
{
"postal_code": 57647
},
{
"postal_code": 57648
},
{
"postal_code": 58095
},
{
"postal_code": 58239
},
{
"postal_code": 58256
},
{
"postal_code": 58285
},
{
"postal_code": 58300
},
{
"postal_code": 58313
},
{
"postal_code": 58332
},
{
"postal_code": 58339
},
{
"postal_code": 58452
},
{
"postal_code": 58507
},
{
"postal_code": 58540
},
{
"postal_code": 58553
},
{
"postal_code": 58566
},
{
"postal_code": 58579
},
{
"postal_code": 58636
},
{
"postal_code": 58675
},
{
"postal_code": 58706
},
{
"postal_code": 58730
},
{
"postal_code": 58739
},
{
"postal_code": 58762
},
{
"postal_code": 58769
},
{
"postal_code": 58791
},
{
"postal_code": 58802
},
{
"postal_code": 58809
},
{
"postal_code": 58840
},
{
"postal_code": 58849
},
{
"postal_code": 59065
},
{
"postal_code": 59174
},
{
"postal_code": 59192
},
{
"postal_code": 59199
},
{
"postal_code": 59227
},
{
"postal_code": 59269
},
{
"postal_code": 59302
},
{
"postal_code": 59320
},
{
"postal_code": 59329
},
{
"postal_code": 59348
},
{
"postal_code": 59368
},
{
"postal_code": 59379
},
{
"postal_code": 59387
},
{
"postal_code": 59394
},
{
"postal_code": 59399
},
{
"postal_code": 59423
},
{
"postal_code": 59439
},
{
"postal_code": 59457
},
{
"postal_code": 59469
},
{
"postal_code": 59494
},
{
"postal_code": 59505
},
{
"postal_code": 59510
},
{
"postal_code": 59514
},
{
"postal_code": 59519
},
{
"postal_code": 59555
},
{
"postal_code": 59581
},
{
"postal_code": 59590
},
{
"postal_code": 59597
},
{
"postal_code": 59602
},
{
"postal_code": 59609
},
{
"postal_code": 59759
},
{
"postal_code": 59846
},
{
"postal_code": 59872
},
{
"postal_code": 59889
},
{
"postal_code": 59909
},
{
"postal_code": 59929
},
{
"postal_code": 59939
},
{
"postal_code": 59955
},
{
"postal_code": 59964
},
{
"postal_code": 59969
},
{
"postal_code": 60311
},
{
"postal_code": 61118
},
{
"postal_code": 61130
},
{
"postal_code": 61137
},
{
"postal_code": 61138
},
{
"postal_code": 61169
},
{
"postal_code": 61184
},
{
"postal_code": 61191
},
{
"postal_code": 61194
},
{
"postal_code": 61197
},
{
"postal_code": 61200
},
{
"postal_code": 61203
},
{
"postal_code": 61206
},
{
"postal_code": 61209
},
{
"postal_code": 61231
},
{
"postal_code": 61239
},
{
"postal_code": 61250
},
{
"postal_code": 61267
},
{
"postal_code": 61273
},
{
"postal_code": 61276
},
{
"postal_code": 61279
},
{
"postal_code": 61348
},
{
"postal_code": 61381
},
{
"postal_code": 61389
},
{
"postal_code": 61440
},
{
"postal_code": 61449
},
{
"postal_code": 61462
},
{
"postal_code": 61476
},
{
"postal_code": 61479
},
{
"postal_code": 63065
},
{
"postal_code": 63110
},
{
"postal_code": 63128
},
{
"postal_code": 63150
},
{
"postal_code": 63165
},
{
"postal_code": 63179
},
{
"postal_code": 63225
},
{
"postal_code": 63263
},
{
"postal_code": 63303
},
{
"postal_code": 63322
},
{
"postal_code": 63329
},
{
"postal_code": 63450
},
{
"postal_code": 63477
},
{
"postal_code": 63486
},
{
"postal_code": 63500
},
{
"postal_code": 63505
},
{
"postal_code": 63512
},
{
"postal_code": 63517
},
{
"postal_code": 63526
},
{
"postal_code": 63533
},
{
"postal_code": 63538
},
{
"postal_code": 63543
},
{
"postal_code": 63546
},
{
"postal_code": 63549
},
{
"postal_code": 63571
},
{
"postal_code": 63579
},
{
"postal_code": 63584
},
{
"postal_code": 63589
},
{
"postal_code": 63594
},
{
"postal_code": 63599
},
{
"postal_code": 63607
},
{
"postal_code": 63619
},
{
"postal_code": 63628
},
{
"postal_code": 63633
},
{
"postal_code": 63636
},
{
"postal_code": 63637
},
{
"postal_code": 63639
},
{
"postal_code": 63654
},
{
"postal_code": 63667
},
{
"postal_code": 63674
},
{
"postal_code": 63679
},
{
"postal_code": 63683
},
{
"postal_code": 63688
},
{
"postal_code": 63691
},
{
"postal_code": 63694
},
{
"postal_code": 63695
},
{
"postal_code": 63697
},
{
"postal_code": 63699
},
{
"postal_code": 63739
},
{
"postal_code": 63755
},
{
"postal_code": 63762
},
{
"postal_code": 63768
},
{
"postal_code": 63773
},
{
"postal_code": 63776
},
{
"postal_code": 63785
},
{
"postal_code": 63791
},
{
"postal_code": 63796
},
{
"postal_code": 63801
},
{
"postal_code": 63808
},
{
"postal_code": 63811
},
{
"postal_code": 63814
},
{
"postal_code": 63820
},
{
"postal_code": 63825
},
{
"postal_code": 63826
},
{
"postal_code": 63828
},
{
"postal_code": 63829
},
{
"postal_code": 63831
},
{
"postal_code": 63834
},
{
"postal_code": 63839
},
{
"postal_code": 63840
},
{
"postal_code": 63843
},
{
"postal_code": 63846
},
{
"postal_code": 63849
},
{
"postal_code": 63853
},
{
"postal_code": 63856
},
{
"postal_code": 63857
},
{
"postal_code": 63860
},
{
"postal_code": 63863
},
{
"postal_code": 63864
},
{
"postal_code": 63867
},
{
"postal_code": 63868
},
{
"postal_code": 63869
},
{
"postal_code": 63871
},
{
"postal_code": 63872
},
{
"postal_code": 63874
},
{
"postal_code": 63875
},
{
"postal_code": 63877
},
{
"postal_code": 63879
},
{
"postal_code": 63897
},
{
"postal_code": 63906
},
{
"postal_code": 63911
},
{
"postal_code": 63916
},
{
"postal_code": 63920
},
{
"postal_code": 63924
},
{
"postal_code": 63925
},
{
"postal_code": 63927
},
{
"postal_code": 63928
},
{
"postal_code": 63930
},
{
"postal_code": 63931
},
{
"postal_code": 63933
},
{
"postal_code": 63934
},
{
"postal_code": 63936
},
{
"postal_code": 63937
},
{
"postal_code": 63939
},
{
"postal_code": 64283
},
{
"postal_code": 64319
},
{
"postal_code": 64331
},
{
"postal_code": 64342
},
{
"postal_code": 64347
},
{
"postal_code": 64354
},
{
"postal_code": 64367
},
{
"postal_code": 64372
},
{
"postal_code": 64380
},
{
"postal_code": 64385
},
{
"postal_code": 64390
},
{
"postal_code": 64395
},
{
"postal_code": 64397
},
{
"postal_code": 64401
},
{
"postal_code": 64404
},
{
"postal_code": 64405
},
{
"postal_code": 64407
},
{
"postal_code": 64409
},
{
"postal_code": 64521
},
{
"postal_code": 64546
},
{
"postal_code": 64560
},
{
"postal_code": 64569
},
{
"postal_code": 64572
},
{
"postal_code": 64579
},
{
"postal_code": 64584
},
{
"postal_code": 64589
},
{
"postal_code": 64625
},
{
"postal_code": 64646
},
{
"postal_code": 64653
},
{
"postal_code": 64658
},
{
"postal_code": 64665
},
{
"postal_code": 64668
},
{
"postal_code": 64673
},
{
"postal_code": 64678
},
{
"postal_code": 64683
},
{
"postal_code": 64686
},
{
"postal_code": 64689
},
{
"postal_code": 64711
},
{
"postal_code": 64720
},
{
"postal_code": 64732
},
{
"postal_code": 64739
},
{
"postal_code": 64743
},
{
"postal_code": 64747
},
{
"postal_code": 64750
},
{
"postal_code": 64753
},
{
"postal_code": 64754
},
{
"postal_code": 64756
},
{
"postal_code": 64757
},
{
"postal_code": 64759
},
{
"postal_code": 64807
},
{
"postal_code": 64823
},
{
"postal_code": 64832
},
{
"postal_code": 64839
},
{
"postal_code": 64846
},
{
"postal_code": 64850
},
{
"postal_code": 64853
},
{
"postal_code": 64859
},
{
"postal_code": 65183
},
{
"postal_code": 65232
},
{
"postal_code": 65239
},
{
"postal_code": 65307
},
{
"postal_code": 65321
},
{
"postal_code": 65326
},
{
"postal_code": 65329
},
{
"postal_code": 65343
},
{
"postal_code": 65366
},
{
"postal_code": 65375
},
{
"postal_code": 65385
},
{
"postal_code": 65388
},
{
"postal_code": 65391
},
{
"postal_code": 65396
},
{
"postal_code": 65399
},
{
"postal_code": 65428
},
{
"postal_code": 65439
},
{
"postal_code": 65451
},
{
"postal_code": 65462
},
{
"postal_code": 65468
},
{
"postal_code": 65474
},
{
"postal_code": 65479
},
{
"postal_code": 65510
},
{
"postal_code": 65520
},
{
"postal_code": 65527
},
{
"postal_code": 65529
},
{
"postal_code": 65549
},
{
"postal_code": 65558
},
{
"postal_code": 65582
},
{
"postal_code": 65589
},
{
"postal_code": 65594
},
{
"postal_code": 65597
},
{
"postal_code": 65599
},
{
"postal_code": 65604
},
{
"postal_code": 65606
},
{
"postal_code": 65611
},
{
"postal_code": 65614
},
{
"postal_code": 65618
},
{
"postal_code": 65620
},
{
"postal_code": 65623
},
{
"postal_code": 65624
},
{
"postal_code": 65626
},
{
"postal_code": 65627
},
{
"postal_code": 65629
},
{
"postal_code": 65719
},
{
"postal_code": 65760
},
{
"postal_code": 65779
},
{
"postal_code": 65795
},
{
"postal_code": 65812
},
{
"postal_code": 65817
},
{
"postal_code": 65824
},
{
"postal_code": 65830
},
{
"postal_code": 65835
},
{
"postal_code": 65843
},
{
"postal_code": 66111
},
{
"postal_code": 66265
},
{
"postal_code": 66271
},
{
"postal_code": 66280
},
{
"postal_code": 66287
},
{
"postal_code": 66292
},
{
"postal_code": 66299
},
{
"postal_code": 66333
},
{
"postal_code": 66346
},
{
"postal_code": 66352
},
{
"postal_code": 66359
},
{
"postal_code": 66386
},
{
"postal_code": 66399
},
{
"postal_code": 66424
},
{
"postal_code": 66440
},
{
"postal_code": 66450
},
{
"postal_code": 66453
},
{
"postal_code": 66459
},
{
"postal_code": 66482
},
{
"postal_code": 66484
},
{
"postal_code": 66497
},
{
"postal_code": 66500
},
{
"postal_code": 66501
},
{
"postal_code": 66503
},
{
"postal_code": 66504
},
{
"postal_code": 66506
},
{
"postal_code": 66507
},
{
"postal_code": 66509
},
{
"postal_code": 66538
},
{
"postal_code": 66557
},
{
"postal_code": 66564
},
{
"postal_code": 66571
},
{
"postal_code": 66578
},
{
"postal_code": 66583
},
{
"postal_code": 66589
},
{
"postal_code": 66606
},
{
"postal_code": 66620
},
{
"postal_code": 66625
},
{
"postal_code": 66629
},
{
"postal_code": 66636
},
{
"postal_code": 66640
},
{
"postal_code": 66646
},
{
"postal_code": 66649
},
{
"postal_code": 66663
},
{
"postal_code": 66679
},
{
"postal_code": 66687
},
{
"postal_code": 66693
},
{
"postal_code": 66701
},
{
"postal_code": 66706
},
{
"postal_code": 66709
},
{
"postal_code": 66740
},
{
"postal_code": 66763
},
{
"postal_code": 66773
},
{
"postal_code": 66780
},
{
"postal_code": 66787
},
{
"postal_code": 66793
},
{
"postal_code": 66798
},
{
"postal_code": 66802
},
{
"postal_code": 66806
},
{
"postal_code": 66809
},
{
"postal_code": 66822
},
{
"postal_code": 66839
},
{
"postal_code": 66849
},
{
"postal_code": 66851
},
{
"postal_code": 66862
},
{
"postal_code": 66869
},
{
"postal_code": 66871
},
{
"postal_code": 66877
},
{
"postal_code": 66879
},
{
"postal_code": 66882
},
{
"postal_code": 66885
},
{
"postal_code": 66887
},
{
"postal_code": 66892
},
{
"postal_code": 66894
},
{
"postal_code": 66901
},
{
"postal_code": 66903
},
{
"postal_code": 66904
},
{
"postal_code": 66907
},
{
"postal_code": 66909
},
{
"postal_code": 66914
},
{
"postal_code": 66916
},
{
"postal_code": 66917
},
{
"postal_code": 66919
},
{
"postal_code": 66953
},
{
"postal_code": 66957
},
{
"postal_code": 66969
},
{
"postal_code": 66976
},
{
"postal_code": 66978
},
{
"postal_code": 66981
},
{
"postal_code": 66987
},
{
"postal_code": 66989
},
{
"postal_code": 66994
},
{
"postal_code": 66996
},
{
"postal_code": 66999
},
{
"postal_code": 67059
},
{
"postal_code": 67098
},
{
"postal_code": 67105
},
{
"postal_code": 67112
},
{
"postal_code": 67117
},
{
"postal_code": 67122
},
{
"postal_code": 67125
},
{
"postal_code": 67126
},
{
"postal_code": 67127
},
{
"postal_code": 67133
},
{
"postal_code": 67134
},
{
"postal_code": 67136
},
{
"postal_code": 67141
},
{
"postal_code": 67146
},
{
"postal_code": 67147
},
{
"postal_code": 67149
},
{
"postal_code": 67150
},
{
"postal_code": 67152
},
{
"postal_code": 67157
},
{
"postal_code": 67158
},
{
"postal_code": 67159
},
{
"postal_code": 67161
},
{
"postal_code": 67165
},
{
"postal_code": 67166
},
{
"postal_code": 67167
},
{
"postal_code": 67169
},
{
"postal_code": 67227
},
{
"postal_code": 67229
},
{
"postal_code": 67240
},
{
"postal_code": 67245
},
{
"postal_code": 67246
},
{
"postal_code": 67251
},
{
"postal_code": 67256
},
{
"postal_code": 67258
},
{
"postal_code": 67259
},
{
"postal_code": 67269
},
{
"postal_code": 67271
},
{
"postal_code": 67273
},
{
"postal_code": 67278
},
{
"postal_code": 67280
},
{
"postal_code": 67281
},
{
"postal_code": 67283
},
{
"postal_code": 67292
},
{
"postal_code": 67294
},
{
"postal_code": 67295
},
{
"postal_code": 67297
},
{
"postal_code": 67304
},
{
"postal_code": 67305
},
{
"postal_code": 67307
},
{
"postal_code": 67308
},
{
"postal_code": 67310
},
{
"postal_code": 67311
},
{
"postal_code": 67316
},
{
"postal_code": 67317
},
{
"postal_code": 67319
},
{
"postal_code": 67346
},
{
"postal_code": 67354
},
{
"postal_code": 67360
},
{
"postal_code": 67361
},
{
"postal_code": 67363
},
{
"postal_code": 67365
},
{
"postal_code": 67366
},
{
"postal_code": 67368
},
{
"postal_code": 67373
},
{
"postal_code": 67374
},
{
"postal_code": 67376
},
{
"postal_code": 67377
},
{
"postal_code": 67378
},
{
"postal_code": 67433
},
{
"postal_code": 67454
},
{
"postal_code": 67459
},
{
"postal_code": 67466
},
{
"postal_code": 67468
},
{
"postal_code": 67471
},
{
"postal_code": 67472
},
{
"postal_code": 67473
},
{
"postal_code": 67475
},
{
"postal_code": 67480
},
{
"postal_code": 67482
},
{
"postal_code": 67483
},
{
"postal_code": 67487
},
{
"postal_code": 67489
},
{
"postal_code": 67547
},
{
"postal_code": 67574
},
{
"postal_code": 67575
},
{
"postal_code": 67577
},
{
"postal_code": 67578
},
{
"postal_code": 67580
},
{
"postal_code": 67582
},
{
"postal_code": 67583
},
{
"postal_code": 67585
},
{
"postal_code": 67586
},
{
"postal_code": 67587
},
{
"postal_code": 67590
},
{
"postal_code": 67591
},
{
"postal_code": 67592
},
{
"postal_code": 67593
},
{
"postal_code": 67595
},
{
"postal_code": 67596
},
{
"postal_code": 67598
},
{
"postal_code": 67599
},
{
"postal_code": 67657
},
{
"postal_code": 67677
},
{
"postal_code": 67678
},
{
"postal_code": 67680
},
{
"postal_code": 67681
},
{
"postal_code": 67685
},
{
"postal_code": 67686
},
{
"postal_code": 67688
},
{
"postal_code": 67691
},
{
"postal_code": 67693
},
{
"postal_code": 67697
},
{
"postal_code": 67699
},
{
"postal_code": 67700
},
{
"postal_code": 67701
},
{
"postal_code": 67705
},
{
"postal_code": 67706
},
{
"postal_code": 67707
},
{
"postal_code": 67714
},
{
"postal_code": 67715
},
{
"postal_code": 67716
},
{
"postal_code": 67718
},
{
"postal_code": 67722
},
{
"postal_code": 67724
},
{
"postal_code": 67725
},
{
"postal_code": 67727
},
{
"postal_code": 67728
},
{
"postal_code": 67729
},
{
"postal_code": 67731
},
{
"postal_code": 67732
},
{
"postal_code": 67734
},
{
"postal_code": 67735
},
{
"postal_code": 67737
},
{
"postal_code": 67742
},
{
"postal_code": 67744
},
{
"postal_code": 67745
},
{
"postal_code": 67746
},
{
"postal_code": 67748
},
{
"postal_code": 67749
},
{
"postal_code": 67752
},
{
"postal_code": 67753
},
{
"postal_code": 67754
},
{
"postal_code": 67756
},
{
"postal_code": 67757
},
{
"postal_code": 67759
},
{
"postal_code": 67806
},
{
"postal_code": 67808
},
{
"postal_code": 67811
},
{
"postal_code": 67813
},
{
"postal_code": 67814
},
{
"postal_code": 67816
},
{
"postal_code": 67817
},
{
"postal_code": 67819
},
{
"postal_code": 67821
},
{
"postal_code": 67822
},
{
"postal_code": 67823
},
{
"postal_code": 67824
},
{
"postal_code": 67826
},
{
"postal_code": 67827
},
{
"postal_code": 67829
},
{
"postal_code": 68159
},
{
"postal_code": 68519
},
{
"postal_code": 68526
},
{
"postal_code": 68535
},
{
"postal_code": 68542
},
{
"postal_code": 68549
},
{
"postal_code": 68623
},
{
"postal_code": 68642
},
{
"postal_code": 68647
},
{
"postal_code": 68649
},
{
"postal_code": 68723
},
{
"postal_code": 68753
},
{
"postal_code": 68766
},
{
"postal_code": 68775
},
{
"postal_code": 68782
},
{
"postal_code": 68789
},
{
"postal_code": 68794
},
{
"postal_code": 68799
},
{
"postal_code": 68804
},
{
"postal_code": 68809
},
{
"postal_code": 69117
},
{
"postal_code": 69151
},
{
"postal_code": 69168
},
{
"postal_code": 69181
},
{
"postal_code": 69190
},
{
"postal_code": 69198
},
{
"postal_code": 69207
},
{
"postal_code": 69214
},
{
"postal_code": 69221
},
{
"postal_code": 69226
},
{
"postal_code": 69231
},
{
"postal_code": 69234
},
{
"postal_code": 69239
},
{
"postal_code": 69242
},
{
"postal_code": 69245
},
{
"postal_code": 69250
},
{
"postal_code": 69251
},
{
"postal_code": 69253
},
{
"postal_code": 69254
},
{
"postal_code": 69256
},
{
"postal_code": 69257
},
{
"postal_code": 69259
},
{
"postal_code": 69412
},
{
"postal_code": 69427
},
{
"postal_code": 69429
},
{
"postal_code": 69434
},
{
"postal_code": 69436
},
{
"postal_code": 69437
},
{
"postal_code": 69439
},
{
"postal_code": 69469
},
{
"postal_code": 69483
},
{
"postal_code": 69488
},
{
"postal_code": 69493
},
{
"postal_code": 69502
},
{
"postal_code": 69509
},
{
"postal_code": 69514
},
{
"postal_code": 69517
},
{
"postal_code": 69518
},
{
"postal_code": 70173
},
{
"postal_code": 70734
},
{
"postal_code": 70771
},
{
"postal_code": 70794
},
{
"postal_code": 70806
},
{
"postal_code": 70825
},
{
"postal_code": 70839
},
{
"postal_code": 71032
},
{
"postal_code": 71063
},
{
"postal_code": 71083
},
{
"postal_code": 71088
},
{
"postal_code": 71093
},
{
"postal_code": 71101
},
{
"postal_code": 71106
},
{
"postal_code": 71111
},
{
"postal_code": 71116
},
{
"postal_code": 71120
},
{
"postal_code": 71126
},
{
"postal_code": 71131
},
{
"postal_code": 71134
},
{
"postal_code": 71139
},
{
"postal_code": 71144
},
{
"postal_code": 71149
},
{
"postal_code": 71154
},
{
"postal_code": 71155
},
{
"postal_code": 71157
},
{
"postal_code": 71159
},
{
"postal_code": 71229
},
{
"postal_code": 71254
},
{
"postal_code": 71263
},
{
"postal_code": 71272
},
{
"postal_code": 71277
},
{
"postal_code": 71282
},
{
"postal_code": 71287
},
{
"postal_code": 71292
},
{
"postal_code": 71296
},
{
"postal_code": 71297
},
{
"postal_code": 71299
},
{
"postal_code": 71332
},
{
"postal_code": 71364
},
{
"postal_code": 71384
},
{
"postal_code": 71394
},
{
"postal_code": 71397
},
{
"postal_code": 71404
},
{
"postal_code": 71409
},
{
"postal_code": 71522
},
{
"postal_code": 71540
},
{
"postal_code": 71543
},
{
"postal_code": 71546
},
{
"postal_code": 71549
},
{
"postal_code": 71554
},
{
"postal_code": 71560
},
{
"postal_code": 71563
},
{
"postal_code": 71566
},
{
"postal_code": 71570
},
{
"postal_code": 71573
},
{
"postal_code": 71576
},
{
"postal_code": 71577
},
{
"postal_code": 71579
},
{
"postal_code": 71638
},
{
"postal_code": 71665
},
{
"postal_code": 71672
},
{
"postal_code": 71679
},
{
"postal_code": 71686
},
{
"postal_code": 71691
},
{
"postal_code": 71696
},
{
"postal_code": 71701
},
{
"postal_code": 71706
},
{
"postal_code": 71711
},
{
"postal_code": 71717
},
{
"postal_code": 71720
},
{
"postal_code": 71723
},
{
"postal_code": 71726
},
{
"postal_code": 71729
},
{
"postal_code": 71732
},
{
"postal_code": 71735
},
{
"postal_code": 71737
},
{
"postal_code": 71739
},
{
"postal_code": 72070
},
{
"postal_code": 72108
},
{
"postal_code": 72116
},
{
"postal_code": 72119
},
{
"postal_code": 72124
},
{
"postal_code": 72127
},
{
"postal_code": 72131
},
{
"postal_code": 72135
},
{
"postal_code": 72138
},
{
"postal_code": 72141
},
{
"postal_code": 72144
},
{
"postal_code": 72145
},
{
"postal_code": 72147
},
{
"postal_code": 72149
},
{
"postal_code": 72160
},
{
"postal_code": 72172
},
{
"postal_code": 72175
},
{
"postal_code": 72178
},
{
"postal_code": 72181
},
{
"postal_code": 72184
},
{
"postal_code": 72186
},
{
"postal_code": 72189
},
{
"postal_code": 72202
},
{
"postal_code": 72213
},
{
"postal_code": 72218
},
{
"postal_code": 72221
},
{
"postal_code": 72224
},
{
"postal_code": 72226
},
{
"postal_code": 72227
},
{
"postal_code": 72229
},
{
"postal_code": 72250
},
{
"postal_code": 72270
},
{
"postal_code": 72275
},
{
"postal_code": 72280
},
{
"postal_code": 72285
},
{
"postal_code": 72290
},
{
"postal_code": 72293
},
{
"postal_code": 72294
},
{
"postal_code": 72296
},
{
"postal_code": 72297
},
{
"postal_code": 72299
},
{
"postal_code": 72336
},
{
"postal_code": 72348
},
{
"postal_code": 72351
},
{
"postal_code": 72355
},
{
"postal_code": 72356
},
{
"postal_code": 72358
},
{
"postal_code": 72359
},
{
"postal_code": 72361
},
{
"postal_code": 72362
},
{
"postal_code": 72364
},
{
"postal_code": 72365
},
{
"postal_code": 72367
},
{
"postal_code": 72369
},
{
"postal_code": 72379
},
{
"postal_code": 72393
},
{
"postal_code": 72401
},
{
"postal_code": 72406
},
{
"postal_code": 72411
},
{
"postal_code": 72414
},
{
"postal_code": 72415
},
{
"postal_code": 72417
},
{
"postal_code": 72419
},
{
"postal_code": 72458
},
{
"postal_code": 72469
},
{
"postal_code": 72474
},
{
"postal_code": 72475
},
{
"postal_code": 72477
},
{
"postal_code": 72479
},
{
"postal_code": 72488
},
{
"postal_code": 72501
},
{
"postal_code": 72505
},
{
"postal_code": 72510
},
{
"postal_code": 72511
},
{
"postal_code": 72513
},
{
"postal_code": 72514
},
{
"postal_code": 72516
},
{
"postal_code": 72517
},
{
"postal_code": 72519
},
{
"postal_code": 72525
},
{
"postal_code": 72531
},
{
"postal_code": 72532
},
{
"postal_code": 72534
},
{
"postal_code": 72535
},
{
"postal_code": 72537
},
{
"postal_code": 72539
},
{
"postal_code": 72555
},
{
"postal_code": 72574
},
{
"postal_code": 72581
},
{
"postal_code": 72582
},
{
"postal_code": 72584
},
{
"postal_code": 72585
},
{
"postal_code": 72587
},
{
"postal_code": 72589
},
{
"postal_code": 72622
},
{
"postal_code": 72631
},
{
"postal_code": 72636
},
{
"postal_code": 72639
},
{
"postal_code": 72644
},
{
"postal_code": 72649
},
{
"postal_code": 72654
},
{
"postal_code": 72655
},
{
"postal_code": 72657
},
{
"postal_code": 72658
},
{
"postal_code": 72660
},
{
"postal_code": 72661
},
{
"postal_code": 72663
},
{
"postal_code": 72664
},
{
"postal_code": 72666
},
{
"postal_code": 72667
},
{
"postal_code": 72669
},
{
"postal_code": 72764
},
{
"postal_code": 72793
},
{
"postal_code": 72800
},
{
"postal_code": 72805
},
{
"postal_code": 72810
},
{
"postal_code": 72813
},
{
"postal_code": 72818
},
{
"postal_code": 72820
},
{
"postal_code": 72827
},
{
"postal_code": 72829
},
{
"postal_code": 73033
},
{
"postal_code": 73054
},
{
"postal_code": 73061
},
{
"postal_code": 73066
},
{
"postal_code": 73072
},
{
"postal_code": 73079
},
{
"postal_code": 73084
},
{
"postal_code": 73087
},
{
"postal_code": 73092
},
{
"postal_code": 73095
},
{
"postal_code": 73098
},
{
"postal_code": 73099
},
{
"postal_code": 73101
},
{
"postal_code": 73102
},
{
"postal_code": 73104
},
{
"postal_code": 73105
},
{
"postal_code": 73107
},
{
"postal_code": 73108
},
{
"postal_code": 73110
},
{
"postal_code": 73111
},
{
"postal_code": 73113
},
{
"postal_code": 73114
},
{
"postal_code": 73116
},
{
"postal_code": 73117
},
{
"postal_code": 73119
},
{
"postal_code": 73207
},
{
"postal_code": 73230
},
{
"postal_code": 73235
},
{
"postal_code": 73240
},
{
"postal_code": 73249
},
{
"postal_code": 73252
},
{
"postal_code": 73257
},
{
"postal_code": 73262
},
{
"postal_code": 73265
},
{
"postal_code": 73266
},
{
"postal_code": 73268
},
{
"postal_code": 73269
},
{
"postal_code": 73271
},
{
"postal_code": 73272
},
{
"postal_code": 73274
},
{
"postal_code": 73275
},
{
"postal_code": 73277
},
{
"postal_code": 73278
},
{
"postal_code": 73312
},
{
"postal_code": 73326
},
{
"postal_code": 73329
},
{
"postal_code": 73333
},
{
"postal_code": 73337
},
{
"postal_code": 73340
},
{
"postal_code": 73342
},
{
"postal_code": 73344
},
{
"postal_code": 73345
},
{
"postal_code": 73347
},
{
"postal_code": 73349
},
{
"postal_code": 73430
},
{
"postal_code": 73441
},
{
"postal_code": 73447
},
{
"postal_code": 73450
},
{
"postal_code": 73453
},
{
"postal_code": 73457
},
{
"postal_code": 73460
},
{
"postal_code": 73463
},
{
"postal_code": 73466
},
{
"postal_code": 73467
},
{
"postal_code": 73469
},
{
"postal_code": 73479
},
{
"postal_code": 73485
},
{
"postal_code": 73486
},
{
"postal_code": 73488
},
{
"postal_code": 73489
},
{
"postal_code": 73491
},
{
"postal_code": 73492
},
{
"postal_code": 73494
},
{
"postal_code": 73495
},
{
"postal_code": 73497
},
{
"postal_code": 73499
},
{
"postal_code": 73525
},
{
"postal_code": 73527
},
{
"postal_code": 73540
},
{
"postal_code": 73547
},
{
"postal_code": 73550
},
{
"postal_code": 73553
},
{
"postal_code": 73557
},
{
"postal_code": 73560
},
{
"postal_code": 73563
},
{
"postal_code": 73565
},
{
"postal_code": 73566
},
{
"postal_code": 73568
},
{
"postal_code": 73569
},
{
"postal_code": 73571
},
{
"postal_code": 73572
},
{
"postal_code": 73574
},
{
"postal_code": 73575
},
{
"postal_code": 73577
},
{
"postal_code": 73579
},
{
"postal_code": 73614
},
{
"postal_code": 73630
},
{
"postal_code": 73635
},
{
"postal_code": 73642
},
{
"postal_code": 73650
},
{
"postal_code": 73655
},
{
"postal_code": 73660
},
{
"postal_code": 73663
},
{
"postal_code": 73666
},
{
"postal_code": 73667
},
{
"postal_code": 73669
},
{
"postal_code": 73728
},
{
"postal_code": 73760
},
{
"postal_code": 73765
},
{
"postal_code": 73770
},
{
"postal_code": 73773
},
{
"postal_code": 73776
},
{
"postal_code": 73779
},
{
"postal_code": 74072
},
{
"postal_code": 74172
},
{
"postal_code": 74177
},
{
"postal_code": 74182
},
{
"postal_code": 74189
},
{
"postal_code": 74193
},
{
"postal_code": 74196
},
{
"postal_code": 74199
},
{
"postal_code": 74206
},
{
"postal_code": 74211
},
{
"postal_code": 74214
},
{
"postal_code": 74219
},
{
"postal_code": 74223
},
{
"postal_code": 74226
},
{
"postal_code": 74229
},
{
"postal_code": 74232
},
{
"postal_code": 74235
},
{
"postal_code": 74238
},
{
"postal_code": 74239
},
{
"postal_code": 74243
},
{
"postal_code": 74245
},
{
"postal_code": 74246
},
{
"postal_code": 74248
},
{
"postal_code": 74249
},
{
"postal_code": 74251
},
{
"postal_code": 74252
},
{
"postal_code": 74254
},
{
"postal_code": 74255
},
{
"postal_code": 74257
},
{
"postal_code": 74259
},
{
"postal_code": 74321
},
{
"postal_code": 74336
},
{
"postal_code": 74343
},
{
"postal_code": 74348
},
{
"postal_code": 74354
},
{
"postal_code": 74357
},
{
"postal_code": 74360
},
{
"postal_code": 74363
},
{
"postal_code": 74366
},
{
"postal_code": 74369
},
{
"postal_code": 74372
},
{
"postal_code": 74374
},
{
"postal_code": 74376
},
{
"postal_code": 74379
},
{
"postal_code": 74382
},
{
"postal_code": 74385
},
{
"postal_code": 74388
},
{
"postal_code": 74389
},
{
"postal_code": 74391
},
{
"postal_code": 74392
},
{
"postal_code": 74394
},
{
"postal_code": 74395
},
{
"postal_code": 74397
},
{
"postal_code": 74399
},
{
"postal_code": 74405
},
{
"postal_code": 74417
},
{
"postal_code": 74420
},
{
"postal_code": 74423
},
{
"postal_code": 74424
},
{
"postal_code": 74426
},
{
"postal_code": 74427
},
{
"postal_code": 74429
},
{
"postal_code": 74523
},
{
"postal_code": 74532
},
{
"postal_code": 74535
},
{
"postal_code": 74538
},
{
"postal_code": 74541
},
{
"postal_code": 74542
},
{
"postal_code": 74544
},
{
"postal_code": 74545
},
{
"postal_code": 74547
},
{
"postal_code": 74549
},
{
"postal_code": 74564
},
{
"postal_code": 74572
},
{
"postal_code": 74575
},
{
"postal_code": 74579
},
{
"postal_code": 74582
},
{
"postal_code": 74585
},
{
"postal_code": 74586
},
{
"postal_code": 74589
},
{
"postal_code": 74592
},
{
"postal_code": 74594
},
{
"postal_code": 74595
},
{
"postal_code": 74597
},
{
"postal_code": 74599
},
{
"postal_code": 74613
},
{
"postal_code": 74626
},
{
"postal_code": 74629
},
{
"postal_code": 74632
},
{
"postal_code": 74635
},
{
"postal_code": 74638
},
{
"postal_code": 74639
},
{
"postal_code": 74653
},
{
"postal_code": 74670
},
{
"postal_code": 74673
},
{
"postal_code": 74676
},
{
"postal_code": 74677
},
{
"postal_code": 74679
},
{
"postal_code": 74706
},
{
"postal_code": 74722
},
{
"postal_code": 74731
},
{
"postal_code": 74736
},
{
"postal_code": 74740
},
{
"postal_code": 74743
},
{
"postal_code": 74744
},
{
"postal_code": 74746
},
{
"postal_code": 74747
},
{
"postal_code": 74749
},
{
"postal_code": 74821
},
{
"postal_code": 74831
},
{
"postal_code": 74834
},
{
"postal_code": 74838
},
{
"postal_code": 74842
},
{
"postal_code": 74847
},
{
"postal_code": 74850
},
{
"postal_code": 74855
},
{
"postal_code": 74858
},
{
"postal_code": 74861
},
{
"postal_code": 74862
},
{
"postal_code": 74864
},
{
"postal_code": 74865
},
{
"postal_code": 74867
},
{
"postal_code": 74869
},
{
"postal_code": 74889
},
{
"postal_code": 74906
},
{
"postal_code": 74909
},
{
"postal_code": 74912
},
{
"postal_code": 74915
},
{
"postal_code": 74918
},
{
"postal_code": 74921
},
{
"postal_code": 74924
},
{
"postal_code": 74925
},
{
"postal_code": 74927
},
{
"postal_code": 74928
},
{
"postal_code": 74930
},
{
"postal_code": 74931
},
{
"postal_code": 74933
},
{
"postal_code": 74934
},
{
"postal_code": 74936
},
{
"postal_code": 74937
},
{
"postal_code": 74939
},
{
"postal_code": 75015
},
{
"postal_code": 75031
},
{
"postal_code": 75038
},
{
"postal_code": 75045
},
{
"postal_code": 75050
},
{
"postal_code": 75053
},
{
"postal_code": 75056
},
{
"postal_code": 75057
},
{
"postal_code": 75059
},
{
"postal_code": 75175
},
{
"postal_code": 75196
},
{
"postal_code": 75203
},
{
"postal_code": 75210
},
{
"postal_code": 75217
},
{
"postal_code": 75223
},
{
"postal_code": 75228
},
{
"postal_code": 75233
},
{
"postal_code": 75236
},
{
"postal_code": 75239
},
{
"postal_code": 75242
},
{
"postal_code": 75245
},
{
"postal_code": 75248
},
{
"postal_code": 75249
},
{
"postal_code": 75305
},
{
"postal_code": 75323
},
{
"postal_code": 75328
},
{
"postal_code": 75331
},
{
"postal_code": 75334
},
{
"postal_code": 75335
},
{
"postal_code": 75337
},
{
"postal_code": 75339
},
{
"postal_code": 75365
},
{
"postal_code": 75378
},
{
"postal_code": 75382
},
{
"postal_code": 75385
},
{
"postal_code": 75387
},
{
"postal_code": 75389
},
{
"postal_code": 75391
},
{
"postal_code": 75392
},
{
"postal_code": 75394
},
{
"postal_code": 75395
},
{
"postal_code": 75397
},
{
"postal_code": 75399
},
{
"postal_code": 75417
},
{
"postal_code": 75428
},
{
"postal_code": 75433
},
{
"postal_code": 75438
},
{
"postal_code": 75443
},
{
"postal_code": 75446
},
{
"postal_code": 75447
},
{
"postal_code": 75449
},
{
"postal_code": 76133
},
{
"postal_code": 76275
},
{
"postal_code": 76287
},
{
"postal_code": 76297
},
{
"postal_code": 76307
},
{
"postal_code": 76316
},
{
"postal_code": 76327
},
{
"postal_code": 76332
},
{
"postal_code": 76337
},
{
"postal_code": 76344
},
{
"postal_code": 76351
},
{
"postal_code": 76356
},
{
"postal_code": 76359
},
{
"postal_code": 76437
},
{
"postal_code": 76448
},
{
"postal_code": 76456
},
{
"postal_code": 76461
},
{
"postal_code": 76467
},
{
"postal_code": 76470
},
{
"postal_code": 76473
},
{
"postal_code": 76474
},
{
"postal_code": 76476
},
{
"postal_code": 76477
},
{
"postal_code": 76479
},
{
"postal_code": 76530
},
{
"postal_code": 76547
},
{
"postal_code": 76549
},
{
"postal_code": 76571
},
{
"postal_code": 76593
},
{
"postal_code": 76596
},
{
"postal_code": 76597
},
{
"postal_code": 76599
},
{
"postal_code": 76646
},
{
"postal_code": 76661
},
{
"postal_code": 76669
},
{
"postal_code": 76676
},
{
"postal_code": 76684
},
{
"postal_code": 76689
},
{
"postal_code": 76694
},
{
"postal_code": 76698
},
{
"postal_code": 76703
},
{
"postal_code": 76706
},
{
"postal_code": 76707
},
{
"postal_code": 76709
},
{
"postal_code": 76726
},
{
"postal_code": 76744
},
{
"postal_code": 76751
},
{
"postal_code": 76756
},
{
"postal_code": 76761
},
{
"postal_code": 76764
},
{
"postal_code": 76767
},
{
"postal_code": 76768
},
{
"postal_code": 76770
},
{
"postal_code": 76771
},
{
"postal_code": 76773
},
{
"postal_code": 76774
},
{
"postal_code": 76776
},
{
"postal_code": 76777
},
{
"postal_code": 76779
},
{
"postal_code": 76829
},
{
"postal_code": 76831
},
{
"postal_code": 76833
},
{
"postal_code": 76835
},
{
"postal_code": 76846
},
{
"postal_code": 76848
},
{
"postal_code": 76855
},
{
"postal_code": 76857
},
{
"postal_code": 76863
},
{
"postal_code": 76865
},
{
"postal_code": 76870
},
{
"postal_code": 76872
},
{
"postal_code": 76877
},
{
"postal_code": 76879
},
{
"postal_code": 76887
},
{
"postal_code": 76889
},
{
"postal_code": 76891
},
{
"postal_code": 77652
},
{
"postal_code": 77694
},
{
"postal_code": 77704
},
{
"postal_code": 77709
},
{
"postal_code": 77716
},
{
"postal_code": 77723
},
{
"postal_code": 77728
},
{
"postal_code": 77731
},
{
"postal_code": 77736
},
{
"postal_code": 77740
},
{
"postal_code": 77743
},
{
"postal_code": 77746
},
{
"postal_code": 77749
},
{
"postal_code": 77756
},
{
"postal_code": 77761
},
{
"postal_code": 77767
},
{
"postal_code": 77770
},
{
"postal_code": 77773
},
{
"postal_code": 77776
},
{
"postal_code": 77781
},
{
"postal_code": 77784
},
{
"postal_code": 77787
},
{
"postal_code": 77790
},
{
"postal_code": 77791
},
{
"postal_code": 77793
},
{
"postal_code": 77794
},
{
"postal_code": 77796
},
{
"postal_code": 77797
},
{
"postal_code": 77799
},
{
"postal_code": 77815
},
{
"postal_code": 77830
},
{
"postal_code": 77833
},
{
"postal_code": 77836
},
{
"postal_code": 77839
},
{
"postal_code": 77855
},
{
"postal_code": 77866
},
{
"postal_code": 77871
},
{
"postal_code": 77876
},
{
"postal_code": 77880
},
{
"postal_code": 77883
},
{
"postal_code": 77886
},
{
"postal_code": 77887
},
{
"postal_code": 77889
},
{
"postal_code": 77933
},
{
"postal_code": 77948
},
{
"postal_code": 77955
},
{
"postal_code": 77960
},
{
"postal_code": 77963
},
{
"postal_code": 77966
},
{
"postal_code": 77971
},
{
"postal_code": 77972
},
{
"postal_code": 77974
},
{
"postal_code": 77975
},
{
"postal_code": 77977
},
{
"postal_code": 77978
},
{
"postal_code": 78050
},
{
"postal_code": 78073
},
{
"postal_code": 78078
},
{
"postal_code": 78083
},
{
"postal_code": 78086
},
{
"postal_code": 78087
},
{
"postal_code": 78089
},
{
"postal_code": 78098
},
{
"postal_code": 78112
},
{
"postal_code": 78120
},
{
"postal_code": 78126
},
{
"postal_code": 78132
},
{
"postal_code": 78136
},
{
"postal_code": 78141
},
{
"postal_code": 78147
},
{
"postal_code": 78148
},
{
"postal_code": 78166
},
{
"postal_code": 78176
},
{
"postal_code": 78183
},
{
"postal_code": 78187
},
{
"postal_code": 78194
},
{
"postal_code": 78199
},
{
"postal_code": 78224
},
{
"postal_code": 78234
},
{
"postal_code": 78239
},
{
"postal_code": 78244
},
{
"postal_code": 78247
},
{
"postal_code": 78250
},
{
"postal_code": 78253
},
{
"postal_code": 78256
},
{
"postal_code": 78259
},
{
"postal_code": 78262
},
{
"postal_code": 78266
},
{
"postal_code": 78267
},
{
"postal_code": 78269
},
{
"postal_code": 78315
},
{
"postal_code": 78333
},
{
"postal_code": 78337
},
{
"postal_code": 78343
},
{
"postal_code": 78345
},
{
"postal_code": 78351
},
{
"postal_code": 78354
},
{
"postal_code": 78355
},
{
"postal_code": 78357
},
{
"postal_code": 78359
},
{
"postal_code": 78462
},
{
"postal_code": 78476
},
{
"postal_code": 78479
},
{
"postal_code": 78532
},
{
"postal_code": 78549
},
{
"postal_code": 78554
},
{
"postal_code": 78559
},
{
"postal_code": 78564
},
{
"postal_code": 78567
},
{
"postal_code": 78570
},
{
"postal_code": 78573
},
{
"postal_code": 78576
},
{
"postal_code": 78579
},
{
"postal_code": 78580
},
{
"postal_code": 78582
},
{
"postal_code": 78583
},
{
"postal_code": 78585
},
{
"postal_code": 78586
},
{
"postal_code": 78588
},
{
"postal_code": 78589
},
{
"postal_code": 78591
},
{
"postal_code": 78592
},
{
"postal_code": 78594
},
{
"postal_code": 78595
},
{
"postal_code": 78597
},
{
"postal_code": 78598
},
{
"postal_code": 78600
},
{
"postal_code": 78601
},
{
"postal_code": 78603
},
{
"postal_code": 78604
},
{
"postal_code": 78606
},
{
"postal_code": 78607
},
{
"postal_code": 78609
},
{
"postal_code": 78628
},
{
"postal_code": 78647
},
{
"postal_code": 78652
},
{
"postal_code": 78655
},
{
"postal_code": 78658
},
{
"postal_code": 78661
},
{
"postal_code": 78662
},
{
"postal_code": 78664
},
{
"postal_code": 78665
},
{
"postal_code": 78667
},
{
"postal_code": 78669
},
{
"postal_code": 78713
},
{
"postal_code": 78727
},
{
"postal_code": 78730
},
{
"postal_code": 78733
},
{
"postal_code": 78736
},
{
"postal_code": 78737
},
{
"postal_code": 78739
},
{
"postal_code": 79098
},
{
"postal_code": 79183
},
{
"postal_code": 79189
},
{
"postal_code": 79194
},
{
"postal_code": 79199
},
{
"postal_code": 79206
},
{
"postal_code": 79211
},
{
"postal_code": 79215
},
{
"postal_code": 79219
},
{
"postal_code": 79224
},
{
"postal_code": 79227
},
{
"postal_code": 79232
},
{
"postal_code": 79235
},
{
"postal_code": 79238
},
{
"postal_code": 79241
},
{
"postal_code": 79244
},
{
"postal_code": 79249
},
{
"postal_code": 79252
},
{
"postal_code": 79254
},
{
"postal_code": 79256
},
{
"postal_code": 79258
},
{
"postal_code": 79261
},
{
"postal_code": 79263
},
{
"postal_code": 79268
},
{
"postal_code": 79271
},
{
"postal_code": 79274
},
{
"postal_code": 79276
},
{
"postal_code": 79279
},
{
"postal_code": 79280
},
{
"postal_code": 79282
},
{
"postal_code": 79283
},
{
"postal_code": 79285
},
{
"postal_code": 79286
},
{
"postal_code": 79288
},
{
"postal_code": 79289
},
{
"postal_code": 79291
},
{
"postal_code": 79292
},
{
"postal_code": 79294
},
{
"postal_code": 79295
},
{
"postal_code": 79297
},
{
"postal_code": 79299
},
{
"postal_code": 79312
},
{
"postal_code": 79331
},
{
"postal_code": 79336
},
{
"postal_code": 79341
},
{
"postal_code": 79346
},
{
"postal_code": 79348
},
{
"postal_code": 79350
},
{
"postal_code": 79353
},
{
"postal_code": 79356
},
{
"postal_code": 79359
},
{
"postal_code": 79361
},
{
"postal_code": 79362
},
{
"postal_code": 79364
},
{
"postal_code": 79365
},
{
"postal_code": 79367
},
{
"postal_code": 79369
},
{
"postal_code": 79379
},
{
"postal_code": 79395
},
{
"postal_code": 79400
},
{
"postal_code": 79410
},
{
"postal_code": 79415
},
{
"postal_code": 79418
},
{
"postal_code": 79423
},
{
"postal_code": 79424
},
{
"postal_code": 79426
},
{
"postal_code": 79427
},
{
"postal_code": 79429
},
{
"postal_code": 79539
},
{
"postal_code": 79576
},
{
"postal_code": 79585
},
{
"postal_code": 79588
},
{
"postal_code": 79589
},
{
"postal_code": 79591
},
{
"postal_code": 79592
},
{
"postal_code": 79594
},
{
"postal_code": 79595
},
{
"postal_code": 79597
},
{
"postal_code": 79599
},
{
"postal_code": 79618
},
{
"postal_code": 79639
},
{
"postal_code": 79650
},
{
"postal_code": 79664
},
{
"postal_code": 79669
},
{
"postal_code": 79674
},
{
"postal_code": 79677
},
{
"postal_code": 79682
},
{
"postal_code": 79685
},
{
"postal_code": 79686
},
{
"postal_code": 79688
},
{
"postal_code": 79689
},
{
"postal_code": 79692
},
{
"postal_code": 79694
},
{
"postal_code": 79695
},
{
"postal_code": 79713
},
{
"postal_code": 79725
},
{
"postal_code": 79730
},
{
"postal_code": 79733
},
{
"postal_code": 79736
},
{
"postal_code": 79737
},
{
"postal_code": 79739
},
{
"postal_code": 79761
},
{
"postal_code": 79771
},
{
"postal_code": 79774
},
{
"postal_code": 79777
},
{
"postal_code": 79780
},
{
"postal_code": 79787
},
{
"postal_code": 79790
},
{
"postal_code": 79793
},
{
"postal_code": 79798
},
{
"postal_code": 79801
},
{
"postal_code": 79802
},
{
"postal_code": 79804
},
{
"postal_code": 79805
},
{
"postal_code": 79807
},
{
"postal_code": 79809
},
{
"postal_code": 79822
},
{
"postal_code": 79837
},
{
"postal_code": 79843
},
{
"postal_code": 79848
},
{
"postal_code": 79853
},
{
"postal_code": 79856
},
{
"postal_code": 79859
},
{
"postal_code": 79862
},
{
"postal_code": 79865
},
{
"postal_code": 79868
},
{
"postal_code": 79871
},
{
"postal_code": 79872
},
{
"postal_code": 79874
},
{
"postal_code": 79875
},
{
"postal_code": 79877
},
{
"postal_code": 79879
},
{
"postal_code": 80331
},
{
"postal_code": 82008
},
{
"postal_code": 82024
},
{
"postal_code": 82031
},
{
"postal_code": 82041
},
{
"postal_code": 82049
},
{
"postal_code": 82054
},
{
"postal_code": 82057
},
{
"postal_code": 82061
},
{
"postal_code": 82064
},
{
"postal_code": 82065
},
{
"postal_code": 82069
},
{
"postal_code": 82110
},
{
"postal_code": 82131
},
{
"postal_code": 82140
},
{
"postal_code": 82152
},
{
"postal_code": 82166
},
{
"postal_code": 82178
},
{
"postal_code": 82194
},
{
"postal_code": 82205
},
{
"postal_code": 82211
},
{
"postal_code": 82216
},
{
"postal_code": 82223
},
{
"postal_code": 82229
},
{
"postal_code": 82234
},
{
"postal_code": 82237
},
{
"postal_code": 82239
},
{
"postal_code": 82256
},
{
"postal_code": 82266
},
{
"postal_code": 82269
},
{
"postal_code": 82272
},
{
"postal_code": 82275
},
{
"postal_code": 82276
},
{
"postal_code": 82278
},
{
"postal_code": 82279
},
{
"postal_code": 82281
},
{
"postal_code": 82284
},
{
"postal_code": 82285
},
{
"postal_code": 82287
},
{
"postal_code": 82288
},
{
"postal_code": 82290
},
{
"postal_code": 82291
},
{
"postal_code": 82293
},
{
"postal_code": 82294
},
{
"postal_code": 82296
},
{
"postal_code": 82297
},
{
"postal_code": 82299
},
{
"postal_code": 82319
},
{
"postal_code": 82327
},
{
"postal_code": 82335
},
{
"postal_code": 82340
},
{
"postal_code": 82343
},
{
"postal_code": 82346
},
{
"postal_code": 82347
},
{
"postal_code": 82362
},
{
"postal_code": 82377
},
{
"postal_code": 82380
},
{
"postal_code": 82383
},
{
"postal_code": 82386
},
{
"postal_code": 82387
},
{
"postal_code": 82389
},
{
"postal_code": 82390
},
{
"postal_code": 82392
},
{
"postal_code": 82393
},
{
"postal_code": 82395
},
{
"postal_code": 82396
},
{
"postal_code": 82398
},
{
"postal_code": 82399
},
{
"postal_code": 82401
},
{
"postal_code": 82402
},
{
"postal_code": 82404
},
{
"postal_code": 82405
},
{
"postal_code": 82407
},
{
"postal_code": 82409
},
{
"postal_code": 82418
},
{
"postal_code": 82431
},
{
"postal_code": 82433
},
{
"postal_code": 82435
},
{
"postal_code": 82436
},
{
"postal_code": 82438
},
{
"postal_code": 82439
},
{
"postal_code": 82441
},
{
"postal_code": 82442
},
{
"postal_code": 82444
},
{
"postal_code": 82445
},
{
"postal_code": 82447
},
{
"postal_code": 82449
},
{
"postal_code": 82467
},
{
"postal_code": 82481
},
{
"postal_code": 82487
},
{
"postal_code": 82488
},
{
"postal_code": 82490
},
{
"postal_code": 82491
},
{
"postal_code": 82494
},
{
"postal_code": 82496
},
{
"postal_code": 82497
},
{
"postal_code": 82499
},
{
"postal_code": 82515
},
{
"postal_code": 82538
},
{
"postal_code": 82541
},
{
"postal_code": 82544
},
{
"postal_code": 82547
},
{
"postal_code": 82549
},
{
"postal_code": 83022
},
{
"postal_code": 83043
},
{
"postal_code": 83052
},
{
"postal_code": 83059
},
{
"postal_code": 83064
},
{
"postal_code": 83071
},
{
"postal_code": 83075
},
{
"postal_code": 83080
},
{
"postal_code": 83083
},
{
"postal_code": 83088
},
{
"postal_code": 83093
},
{
"postal_code": 83098
},
{
"postal_code": 83101
},
{
"postal_code": 83104
},
{
"postal_code": 83109
},
{
"postal_code": 83112
},
{
"postal_code": 83115
},
{
"postal_code": 83119
},
{
"postal_code": 83122
},
{
"postal_code": 83123
},
{
"postal_code": 83125
},
{
"postal_code": 83126
},
{
"postal_code": 83128
},
{
"postal_code": 83129
},
{
"postal_code": 83131
},
{
"postal_code": 83132
},
{
"postal_code": 83134
},
{
"postal_code": 83135
},
{
"postal_code": 83137
},
{
"postal_code": 83139
},
{
"postal_code": 83209
},
{
"postal_code": 83224
},
{
"postal_code": 83229
},
{
"postal_code": 83233
},
{
"postal_code": 83236
},
{
"postal_code": 83242
},
{
"postal_code": 83246
},
{
"postal_code": 83250
},
{
"postal_code": 83253
},
{
"postal_code": 83254
},
{
"postal_code": 83256
},
{
"postal_code": 83257
},
{
"postal_code": 83259
},
{
"postal_code": 83278
},
{
"postal_code": 83301
},
{
"postal_code": 83308
},
{
"postal_code": 83313
},
{
"postal_code": 83317
},
{
"postal_code": 83324
},
{
"postal_code": 83329
},
{
"postal_code": 83334
},
{
"postal_code": 83339
},
{
"postal_code": 83342
},
{
"postal_code": 83346
},
{
"postal_code": 83349
},
{
"postal_code": 83352
},
{
"postal_code": 83355
},
{
"postal_code": 83358
},
{
"postal_code": 83361
},
{
"postal_code": 83362
},
{
"postal_code": 83365
},
{
"postal_code": 83367
},
{
"postal_code": 83373
},
{
"postal_code": 83377
},
{
"postal_code": 83395
},
{
"postal_code": 83404
},
{
"postal_code": 83410
},
{
"postal_code": 83413
},
{
"postal_code": 83416
},
{
"postal_code": 83417
},
{
"postal_code": 83435
},
{
"postal_code": 83451
},
{
"postal_code": 83454
},
{
"postal_code": 83457
},
{
"postal_code": 83458
},
{
"postal_code": 83471
},
{
"postal_code": 83483
},
{
"postal_code": 83486
},
{
"postal_code": 83487
},
{
"postal_code": 83512
},
{
"postal_code": 83527
},
{
"postal_code": 83530
},
{
"postal_code": 83533
},
{
"postal_code": 83536
},
{
"postal_code": 83539
},
{
"postal_code": 83543
},
{
"postal_code": 83544
},
{
"postal_code": 83547
},
{
"postal_code": 83549
},
{
"postal_code": 83550
},
{
"postal_code": 83553
},
{
"postal_code": 83556
},
{
"postal_code": 83558
},
{
"postal_code": 83561
},
{
"postal_code": 83562
},
{
"postal_code": 83564
},
{
"postal_code": 83567
},
{
"postal_code": 83569
},
{
"postal_code": 83607
},
{
"postal_code": 83620
},
{
"postal_code": 83623
},
{
"postal_code": 83624
},
{
"postal_code": 83626
},
{
"postal_code": 83627
},
{
"postal_code": 83629
},
{
"postal_code": 83646
},
{
"postal_code": 83661
},
{
"postal_code": 83666
},
{
"postal_code": 83670
},
{
"postal_code": 83671
},
{
"postal_code": 83673
},
{
"postal_code": 83674
},
{
"postal_code": 83676
},
{
"postal_code": 83677
},
{
"postal_code": 83679
},
{
"postal_code": 83684
},
{
"postal_code": 83700
},
{
"postal_code": 83703
},
{
"postal_code": 83707
},
{
"postal_code": 83708
},
{
"postal_code": 83714
},
{
"postal_code": 83727
},
{
"postal_code": 83730
},
{
"postal_code": 83734
},
{
"postal_code": 83735
},
{
"postal_code": 83737
},
{
"postal_code": 84028
},
{
"postal_code": 84030
},
{
"postal_code": 84032
},
{
"postal_code": 84036
},
{
"postal_code": 84048
},
{
"postal_code": 84051
},
{
"postal_code": 84056
},
{
"postal_code": 84061
},
{
"postal_code": 84066
},
{
"postal_code": 84069
},
{
"postal_code": 84072
},
{
"postal_code": 84076
},
{
"postal_code": 84079
},
{
"postal_code": 84082
},
{
"postal_code": 84085
},
{
"postal_code": 84088
},
{
"postal_code": 84089
},
{
"postal_code": 84091
},
{
"postal_code": 84092
},
{
"postal_code": 84094
},
{
"postal_code": 84095
},
{
"postal_code": 84097
},
{
"postal_code": 84098
},
{
"postal_code": 84100
},
{
"postal_code": 84101
},
{
"postal_code": 84103
},
{
"postal_code": 84104
},
{
"postal_code": 84106
},
{
"postal_code": 84107
},
{
"postal_code": 84109
},
{
"postal_code": 84130
},
{
"postal_code": 84137
},
{
"postal_code": 84140
},
{
"postal_code": 84144
},
{
"postal_code": 84149
},
{
"postal_code": 84152
},
{
"postal_code": 84155
},
{
"postal_code": 84160
},
{
"postal_code": 84163
},
{
"postal_code": 84164
},
{
"postal_code": 84166
},
{
"postal_code": 84168
},
{
"postal_code": 84169
},
{
"postal_code": 84171
},
{
"postal_code": 84172
},
{
"postal_code": 84174
},
{
"postal_code": 84175
},
{
"postal_code": 84177
},
{
"postal_code": 84178
},
{
"postal_code": 84180
},
{
"postal_code": 84181
},
{
"postal_code": 84183
},
{
"postal_code": 84184
},
{
"postal_code": 84186
},
{
"postal_code": 84187
},
{
"postal_code": 84189
},
{
"postal_code": 84307
},
{
"postal_code": 84323
},
{
"postal_code": 84326
},
{
"postal_code": 84329
},
{
"postal_code": 84332
},
{
"postal_code": 84333
},
{
"postal_code": 84335
},
{
"postal_code": 84337
},
{
"postal_code": 84339
},
{
"postal_code": 84347
},
{
"postal_code": 84359
},
{
"postal_code": 84364
},
{
"postal_code": 84367
},
{
"postal_code": 84371
},
{
"postal_code": 84375
},
{
"postal_code": 84378
},
{
"postal_code": 84381
},
{
"postal_code": 84384
},
{
"postal_code": 84385
},
{
"postal_code": 84387
},
{
"postal_code": 84389
},
{
"postal_code": 84405
},
{
"postal_code": 84416
},
{
"postal_code": 84419
},
{
"postal_code": 84424
},
{
"postal_code": 84427
},
{
"postal_code": 84428
},
{
"postal_code": 84431
},
{
"postal_code": 84432
},
{
"postal_code": 84434
},
{
"postal_code": 84435
},
{
"postal_code": 84437
},
{
"postal_code": 84439
},
{
"postal_code": 84453
},
{
"postal_code": 84478
},
{
"postal_code": 84489
},
{
"postal_code": 84494
},
{
"postal_code": 84503
},
{
"postal_code": 84508
},
{
"postal_code": 84513
},
{
"postal_code": 84518
},
{
"postal_code": 84524
},
{
"postal_code": 84529
},
{
"postal_code": 84533
},
{
"postal_code": 84539
},
{
"postal_code": 84543
},
{
"postal_code": 84544
},
{
"postal_code": 84546
},
{
"postal_code": 84547
},
{
"postal_code": 84549
},
{
"postal_code": 84550
},
{
"postal_code": 84552
},
{
"postal_code": 84553
},
{
"postal_code": 84555
},
{
"postal_code": 84556
},
{
"postal_code": 84558
},
{
"postal_code": 84559
},
{
"postal_code": 84561
},
{
"postal_code": 84562
},
{
"postal_code": 84564
},
{
"postal_code": 84565
},
{
"postal_code": 84567
},
{
"postal_code": 84568
},
{
"postal_code": 84570
},
{
"postal_code": 84571
},
{
"postal_code": 84573
},
{
"postal_code": 84574
},
{
"postal_code": 84576
},
{
"postal_code": 84577
},
{
"postal_code": 84579
},
{
"postal_code": 85049
},
{
"postal_code": 85072
},
{
"postal_code": 85077
},
{
"postal_code": 85080
},
{
"postal_code": 85084
},
{
"postal_code": 85088
},
{
"postal_code": 85092
},
{
"postal_code": 85095
},
{
"postal_code": 85098
},
{
"postal_code": 85101
},
{
"postal_code": 85104
},
{
"postal_code": 85107
},
{
"postal_code": 85110
},
{
"postal_code": 85111
},
{
"postal_code": 85113
},
{
"postal_code": 85114
},
{
"postal_code": 85116
},
{
"postal_code": 85117
},
{
"postal_code": 85119
},
{
"postal_code": 85120
},
{
"postal_code": 85122
},
{
"postal_code": 85123
},
{
"postal_code": 85125
},
{
"postal_code": 85126
},
{
"postal_code": 85128
},
{
"postal_code": 85129
},
{
"postal_code": 85131
},
{
"postal_code": 85132
},
{
"postal_code": 85134
},
{
"postal_code": 85135
},
{
"postal_code": 85137
},
{
"postal_code": 85139
},
{
"postal_code": 85221
},
{
"postal_code": 85229
},
{
"postal_code": 85232
},
{
"postal_code": 85235
},
{
"postal_code": 85238
},
{
"postal_code": 85241
},
{
"postal_code": 85244
},
{
"postal_code": 85247
},
{
"postal_code": 85250
},
{
"postal_code": 85253
},
{
"postal_code": 85254
},
{
"postal_code": 85256
},
{
"postal_code": 85258
},
{
"postal_code": 85276
},
{
"postal_code": 85283
},
{
"postal_code": 85290
},
{
"postal_code": 85293
},
{
"postal_code": 85296
},
{
"postal_code": 85298
},
{
"postal_code": 85301
},
{
"postal_code": 85302
},
{
"postal_code": 85304
},
{
"postal_code": 85305
},
{
"postal_code": 85307
},
{
"postal_code": 85309
},
{
"postal_code": 85354
},
{
"postal_code": 85368
},
{
"postal_code": 85375
},
{
"postal_code": 85386
},
{
"postal_code": 85391
},
{
"postal_code": 85395
},
{
"postal_code": 85399
},
{
"postal_code": 85402
},
{
"postal_code": 85405
},
{
"postal_code": 85406
},
{
"postal_code": 85408
},
{
"postal_code": 85410
},
{
"postal_code": 85411
},
{
"postal_code": 85413
},
{
"postal_code": 85414
},
{
"postal_code": 85416
},
{
"postal_code": 85417
},
{
"postal_code": 85419
},
{
"postal_code": 85435
},
{
"postal_code": 85445
},
{
"postal_code": 85447
},
{
"postal_code": 85452
},
{
"postal_code": 85456
},
{
"postal_code": 85457
},
{
"postal_code": 85459
},
{
"postal_code": 85461
},
{
"postal_code": 85462
},
{
"postal_code": 85464
},
{
"postal_code": 85465
},
{
"postal_code": 85467
},
{
"postal_code": 85469
},
{
"postal_code": 85521
},
{
"postal_code": 85540
},
{
"postal_code": 85551
},
{
"postal_code": 85560
},
{
"postal_code": 85567
},
{
"postal_code": 85570
},
{
"postal_code": 85579
},
{
"postal_code": 85586
},
{
"postal_code": 85591
},
{
"postal_code": 85604
},
{
"postal_code": 85609
},
{
"postal_code": 85614
},
{
"postal_code": 85617
},
{
"postal_code": 85622
},
{
"postal_code": 85625
},
{
"postal_code": 85630
},
{
"postal_code": 85635
},
{
"postal_code": 85640
},
{
"postal_code": 85643
},
{
"postal_code": 85646
},
{
"postal_code": 85649
},
{
"postal_code": 85652
},
{
"postal_code": 85653
},
{
"postal_code": 85656
},
{
"postal_code": 85658
},
{
"postal_code": 85659
},
{
"postal_code": 85661
},
{
"postal_code": 85662
},
{
"postal_code": 85664
},
{
"postal_code": 85665
},
{
"postal_code": 85667
},
{
"postal_code": 85669
},
{
"postal_code": 85716
},
{
"postal_code": 85737
},
{
"postal_code": 85748
},
{
"postal_code": 85757
},
{
"postal_code": 85764
},
{
"postal_code": 85774
},
{
"postal_code": 85777
},
{
"postal_code": 85778
},
{
"postal_code": 86150
},
{
"postal_code": 86316
},
{
"postal_code": 86343
},
{
"postal_code": 86356
},
{
"postal_code": 86368
},
{
"postal_code": 86381
},
{
"postal_code": 86391
},
{
"postal_code": 86399
},
{
"postal_code": 86405
},
{
"postal_code": 86415
},
{
"postal_code": 86420
},
{
"postal_code": 86424
},
{
"postal_code": 86438
},
{
"postal_code": 86441
},
{
"postal_code": 86444
},
{
"postal_code": 86447
},
{
"postal_code": 86450
},
{
"postal_code": 86453
},
{
"postal_code": 86456
},
{
"postal_code": 86459
},
{
"postal_code": 86462
},
{
"postal_code": 86465
},
{
"postal_code": 86470
},
{
"postal_code": 86473
},
{
"postal_code": 86476
},
{
"postal_code": 86477
},
{
"postal_code": 86479
},
{
"postal_code": 86480
},
{
"postal_code": 86482
},
{
"postal_code": 86483
},
{
"postal_code": 86485
},
{
"postal_code": 86486
},
{
"postal_code": 86488
},
{
"postal_code": 86489
},
{
"postal_code": 86491
},
{
"postal_code": 86492
},
{
"postal_code": 86494
},
{
"postal_code": 86495
},
{
"postal_code": 86497
},
{
"postal_code": 86498
},
{
"postal_code": 86500
},
{
"postal_code": 86502
},
{
"postal_code": 86504
},
{
"postal_code": 86505
},
{
"postal_code": 86507
},
{
"postal_code": 86508
},
{
"postal_code": 86510
},
{
"postal_code": 86511
},
{
"postal_code": 86513
},
{
"postal_code": 86514
},
{
"postal_code": 86517
},
{
"postal_code": 86519
},
{
"postal_code": 86529
},
{
"postal_code": 86551
},
{
"postal_code": 86554
},
{
"postal_code": 86556
},
{
"postal_code": 86558
},
{
"postal_code": 86559
},
{
"postal_code": 86561
},
{
"postal_code": 86562
},
{
"postal_code": 86564
},
{
"postal_code": 86565
},
{
"postal_code": 86567
},
{
"postal_code": 86568
},
{
"postal_code": 86570
},
{
"postal_code": 86571
},
{
"postal_code": 86573
},
{
"postal_code": 86574
},
{
"postal_code": 86576
},
{
"postal_code": 86577
},
{
"postal_code": 86579
},
{
"postal_code": 86609
},
{
"postal_code": 86633
},
{
"postal_code": 86637
},
{
"postal_code": 86641
},
{
"postal_code": 86643
},
{
"postal_code": 86647
},
{
"postal_code": 86650
},
{
"postal_code": 86653
},
{
"postal_code": 86655
},
{
"postal_code": 86657
},
{
"postal_code": 86660
},
{
"postal_code": 86663
},
{
"postal_code": 86666
},
{
"postal_code": 86668
},
{
"postal_code": 86669
},
{
"postal_code": 86672
},
{
"postal_code": 86673
},
{
"postal_code": 86674
},
{
"postal_code": 86675
},
{
"postal_code": 86676
},
{
"postal_code": 86678
},
{
"postal_code": 86679
},
{
"postal_code": 86681
},
{
"postal_code": 86682
},
{
"postal_code": 86684
},
{
"postal_code": 86685
},
{
"postal_code": 86687
},
{
"postal_code": 86688
},
{
"postal_code": 86690
},
{
"postal_code": 86692
},
{
"postal_code": 86694
},
{
"postal_code": 86695
},
{
"postal_code": 86697
},
{
"postal_code": 86698
},
{
"postal_code": 86700
},
{
"postal_code": 86701
},
{
"postal_code": 86703
},
{
"postal_code": 86704
},
{
"postal_code": 86706
},
{
"postal_code": 86707
},
{
"postal_code": 86709
},
{
"postal_code": 86720
},
{
"postal_code": 86732
},
{
"postal_code": 86733
},
{
"postal_code": 86735
},
{
"postal_code": 86736
},
{
"postal_code": 86738
},
{
"postal_code": 86739
},
{
"postal_code": 86741
},
{
"postal_code": 86742
},
{
"postal_code": 86744
},
{
"postal_code": 86745
},
{
"postal_code": 86747
},
{
"postal_code": 86748
},
{
"postal_code": 86750
},
{
"postal_code": 86751
},
{
"postal_code": 86753
},
{
"postal_code": 86754
},
{
"postal_code": 86756
},
{
"postal_code": 86757
},
{
"postal_code": 86759
},
{
"postal_code": 86807
},
{
"postal_code": 86825
},
{
"postal_code": 86830
},
{
"postal_code": 86833
},
{
"postal_code": 86836
},
{
"postal_code": 86842
},
{
"postal_code": 86845
},
{
"postal_code": 86850
},
{
"postal_code": 86853
},
{
"postal_code": 86854
},
{
"postal_code": 86856
},
{
"postal_code": 86857
},
{
"postal_code": 86859
},
{
"postal_code": 86860
},
{
"postal_code": 86862
},
{
"postal_code": 86863
},
{
"postal_code": 86865
},
{
"postal_code": 86866
},
{
"postal_code": 86868
},
{
"postal_code": 86869
},
{
"postal_code": 86871
},
{
"postal_code": 86872
},
{
"postal_code": 86874
},
{
"postal_code": 86875
},
{
"postal_code": 86877
},
{
"postal_code": 86879
},
{
"postal_code": 86899
},
{
"postal_code": 86911
},
{
"postal_code": 86916
},
{
"postal_code": 86919
},
{
"postal_code": 86920
},
{
"postal_code": 86922
},
{
"postal_code": 86923
},
{
"postal_code": 86925
},
{
"postal_code": 86926
},
{
"postal_code": 86928
},
{
"postal_code": 86929
},
{
"postal_code": 86931
},
{
"postal_code": 86932
},
{
"postal_code": 86934
},
{
"postal_code": 86935
},
{
"postal_code": 86937
},
{
"postal_code": 86938
},
{
"postal_code": 86940
},
{
"postal_code": 86943
},
{
"postal_code": 86944
},
{
"postal_code": 86946
},
{
"postal_code": 86947
},
{
"postal_code": 86949
},
{
"postal_code": 86956
},
{
"postal_code": 86971
},
{
"postal_code": 86972
},
{
"postal_code": 86974
},
{
"postal_code": 86975
},
{
"postal_code": 86977
},
{
"postal_code": 86978
},
{
"postal_code": 86980
},
{
"postal_code": 86981
},
{
"postal_code": 86983
},
{
"postal_code": 86984
},
{
"postal_code": 86986
},
{
"postal_code": 86987
},
{
"postal_code": 86989
},
{
"postal_code": 87435
},
{
"postal_code": 87448
},
{
"postal_code": 87452
},
{
"postal_code": 87459
},
{
"postal_code": 87463
},
{
"postal_code": 87466
},
{
"postal_code": 87471
},
{
"postal_code": 87474
},
{
"postal_code": 87477
},
{
"postal_code": 87480
},
{
"postal_code": 87484
},
{
"postal_code": 87487
},
{
"postal_code": 87488
},
{
"postal_code": 87490
},
{
"postal_code": 87493
},
{
"postal_code": 87494
},
{
"postal_code": 87496
},
{
"postal_code": 87497
},
{
"postal_code": 87499
},
{
"postal_code": 87509
},
{
"postal_code": 87527
},
{
"postal_code": 87534
},
{
"postal_code": 87538
},
{
"postal_code": 87541
},
{
"postal_code": 87544
},
{
"postal_code": 87545
},
{
"postal_code": 87547
},
{
"postal_code": 87549
},
{
"postal_code": 87561
},
{
"postal_code": 87600
},
{
"postal_code": 87616
},
{
"postal_code": 87629
},
{
"postal_code": 87634
},
{
"postal_code": 87637
},
{
"postal_code": 87640
},
{
"postal_code": 87642
},
{
"postal_code": 87645
},
{
"postal_code": 87647
},
{
"postal_code": 87648
},
{
"postal_code": 87650
},
{
"postal_code": 87651
},
{
"postal_code": 87653
},
{
"postal_code": 87654
},
{
"postal_code": 87656
},
{
"postal_code": 87657
},
{
"postal_code": 87659
},
{
"postal_code": 87660
},
{
"postal_code": 87662
},
{
"postal_code": 87663
},
{
"postal_code": 87665
},
{
"postal_code": 87666
},
{
"postal_code": 87668
},
{
"postal_code": 87669
},
{
"postal_code": 87671
},
{
"postal_code": 87672
},
{
"postal_code": 87674
},
{
"postal_code": 87675
},
{
"postal_code": 87677
},
{
"postal_code": 87679
},
{
"postal_code": 87700
},
{
"postal_code": 87719
},
{
"postal_code": 87724
},
{
"postal_code": 87727
},
{
"postal_code": 87730
},
{
"postal_code": 87733
},
{
"postal_code": 87734
},
{
"postal_code": 87736
},
{
"postal_code": 87737
},
{
"postal_code": 87739
},
{
"postal_code": 87740
},
{
"postal_code": 87742
},
{
"postal_code": 87743
},
{
"postal_code": 87745
},
{
"postal_code": 87746
},
{
"postal_code": 87748
},
{
"postal_code": 87749
},
{
"postal_code": 87751
},
{
"postal_code": 87752
},
{
"postal_code": 87754
},
{
"postal_code": 87755
},
{
"postal_code": 87757
},
{
"postal_code": 87758
},
{
"postal_code": 87760
},
{
"postal_code": 87761
},
{
"postal_code": 87763
},
{
"postal_code": 87764
},
{
"postal_code": 87766
},
{
"postal_code": 87767
},
{
"postal_code": 87769
},
{
"postal_code": 87770
},
{
"postal_code": 87772
},
{
"postal_code": 87773
},
{
"postal_code": 87775
},
{
"postal_code": 87776
},
{
"postal_code": 87778
},
{
"postal_code": 87779
},
{
"postal_code": 87781
},
{
"postal_code": 87782
},
{
"postal_code": 87784
},
{
"postal_code": 87785
},
{
"postal_code": 87787
},
{
"postal_code": 87789
},
{
"postal_code": 88045
},
{
"postal_code": 88069
},
{
"postal_code": 88074
},
{
"postal_code": 88079
},
{
"postal_code": 88085
},
{
"postal_code": 88090
},
{
"postal_code": 88094
},
{
"postal_code": 88097
},
{
"postal_code": 88099
},
{
"postal_code": 88131
},
{
"postal_code": 88138
},
{
"postal_code": 88142
},
{
"postal_code": 88145
},
{
"postal_code": 88147
},
{
"postal_code": 88149
},
{
"postal_code": 88161
},
{
"postal_code": 88167
},
{
"postal_code": 88171
},
{
"postal_code": 88175
},
{
"postal_code": 88178
},
{
"postal_code": 88179
},
{
"postal_code": 88212
},
{
"postal_code": 88239
},
{
"postal_code": 88250
},
{
"postal_code": 88255
},
{
"postal_code": 88260
},
{
"postal_code": 88263
},
{
"postal_code": 88267
},
{
"postal_code": 88271
},
{
"postal_code": 88273
},
{
"postal_code": 88276
},
{
"postal_code": 88279
},
{
"postal_code": 88281
},
{
"postal_code": 88284
},
{
"postal_code": 88285
},
{
"postal_code": 88287
},
{
"postal_code": 88289
},
{
"postal_code": 88299
},
{
"postal_code": 88316
},
{
"postal_code": 88317
},
{
"postal_code": 88319
},
{
"postal_code": 88326
},
{
"postal_code": 88339
},
{
"postal_code": 88348
},
{
"postal_code": 88353
},
{
"postal_code": 88356
},
{
"postal_code": 88361
},
{
"postal_code": 88364
},
{
"postal_code": 88367
},
{
"postal_code": 88368
},
{
"postal_code": 88370
},
{
"postal_code": 88371
},
{
"postal_code": 88373
},
{
"postal_code": 88374
},
{
"postal_code": 88376
},
{
"postal_code": 88377
},
{
"postal_code": 88379
},
{
"postal_code": 88400
},
{
"postal_code": 88410
},
{
"postal_code": 88416
},
{
"postal_code": 88422
},
{
"postal_code": 88427
},
{
"postal_code": 88430
},
{
"postal_code": 88433
},
{
"postal_code": 88436
},
{
"postal_code": 88437
},
{
"postal_code": 88441
},
{
"postal_code": 88444
},
{
"postal_code": 88447
},
{
"postal_code": 88448
},
{
"postal_code": 88450
},
{
"postal_code": 88451
},
{
"postal_code": 88453
},
{
"postal_code": 88454
},
{
"postal_code": 88456
},
{
"postal_code": 88457
},
{
"postal_code": 88459
},
{
"postal_code": 88471
},
{
"postal_code": 88477
},
{
"postal_code": 88480
},
{
"postal_code": 88481
},
{
"postal_code": 88483
},
{
"postal_code": 88484
},
{
"postal_code": 88486
},
{
"postal_code": 88487
},
{
"postal_code": 88489
},
{
"postal_code": 88499
},
{
"postal_code": 88512
},
{
"postal_code": 88515
},
{
"postal_code": 88518
},
{
"postal_code": 88521
},
{
"postal_code": 88524
},
{
"postal_code": 88525
},
{
"postal_code": 88527
},
{
"postal_code": 88529
},
{
"postal_code": 88605
},
{
"postal_code": 88630
},
{
"postal_code": 88631
},
{
"postal_code": 88633
},
{
"postal_code": 88634
},
{
"postal_code": 88636
},
{
"postal_code": 88637
},
{
"postal_code": 88639
},
{
"postal_code": 88662
},
{
"postal_code": 88677
},
{
"postal_code": 88682
},
{
"postal_code": 88690
},
{
"postal_code": 88693
},
{
"postal_code": 88696
},
{
"postal_code": 88697
},
{
"postal_code": 88699
},
{
"postal_code": 88709
},
{
"postal_code": 88718
},
{
"postal_code": 88719
},
{
"postal_code": 89073
},
{
"postal_code": 89129
},
{
"postal_code": 89134
},
{
"postal_code": 89143
},
{
"postal_code": 89150
},
{
"postal_code": 89155
},
{
"postal_code": 89160
},
{
"postal_code": 89165
},
{
"postal_code": 89168
},
{
"postal_code": 89171
},
{
"postal_code": 89173
},
{
"postal_code": 89174
},
{
"postal_code": 89176
},
{
"postal_code": 89177
},
{
"postal_code": 89179
},
{
"postal_code": 89180
},
{
"postal_code": 89182
},
{
"postal_code": 89183
},
{
"postal_code": 89185
},
{
"postal_code": 89186
},
{
"postal_code": 89188
},
{
"postal_code": 89189
},
{
"postal_code": 89191
},
{
"postal_code": 89192
},
{
"postal_code": 89194
},
{
"postal_code": 89195
},
{
"postal_code": 89197
},
{
"postal_code": 89198
},
{
"postal_code": 89231
},
{
"postal_code": 89250
},
{
"postal_code": 89257
},
{
"postal_code": 89264
},
{
"postal_code": 89269
},
{
"postal_code": 89275
},
{
"postal_code": 89278
},
{
"postal_code": 89281
},
{
"postal_code": 89284
},
{
"postal_code": 89287
},
{
"postal_code": 89290
},
{
"postal_code": 89291
},
{
"postal_code": 89293
},
{
"postal_code": 89294
},
{
"postal_code": 89296
},
{
"postal_code": 89297
},
{
"postal_code": 89299
},
{
"postal_code": 89312
},
{
"postal_code": 89331
},
{
"postal_code": 89335
},
{
"postal_code": 89340
},
{
"postal_code": 89343
},
{
"postal_code": 89344
},
{
"postal_code": 89346
},
{
"postal_code": 89347
},
{
"postal_code": 89349
},
{
"postal_code": 89350
},
{
"postal_code": 89352
},
{
"postal_code": 89353
},
{
"postal_code": 89355
},
{
"postal_code": 89356
},
{
"postal_code": 89358
},
{
"postal_code": 89359
},
{
"postal_code": 89361
},
{
"postal_code": 89362
},
{
"postal_code": 89364
},
{
"postal_code": 89365
},
{
"postal_code": 89367
},
{
"postal_code": 89368
},
{
"postal_code": 89407
},
{
"postal_code": 89415
},
{
"postal_code": 89420
},
{
"postal_code": 89423
},
{
"postal_code": 89426
},
{
"postal_code": 89428
},
{
"postal_code": 89429
},
{
"postal_code": 89431
},
{
"postal_code": 89434
},
{
"postal_code": 89435
},
{
"postal_code": 89437
},
{
"postal_code": 89438
},
{
"postal_code": 89440
},
{
"postal_code": 89441
},
{
"postal_code": 89443
},
{
"postal_code": 89446
},
{
"postal_code": 89447
},
{
"postal_code": 89522
},
{
"postal_code": 89537
},
{
"postal_code": 89542
},
{
"postal_code": 89547
},
{
"postal_code": 89551
},
{
"postal_code": 89555
},
{
"postal_code": 89558
},
{
"postal_code": 89561
},
{
"postal_code": 89564
},
{
"postal_code": 89567
},
{
"postal_code": 89568
},
{
"postal_code": 89584
},
{
"postal_code": 89597
},
{
"postal_code": 89601
},
{
"postal_code": 89604
},
{
"postal_code": 89605
},
{
"postal_code": 89607
},
{
"postal_code": 89608
},
{
"postal_code": 89610
},
{
"postal_code": 89611
},
{
"postal_code": 89613
},
{
"postal_code": 89614
},
{
"postal_code": 89616
},
{
"postal_code": 89617
},
{
"postal_code": 89619
},
{
"postal_code": 90403
},
{
"postal_code": 90513
},
{
"postal_code": 90518
},
{
"postal_code": 90522
},
{
"postal_code": 90530
},
{
"postal_code": 90537
},
{
"postal_code": 90542
},
{
"postal_code": 90547
},
{
"postal_code": 90552
},
{
"postal_code": 90556
},
{
"postal_code": 90559
},
{
"postal_code": 90562
},
{
"postal_code": 90571
},
{
"postal_code": 90574
},
{
"postal_code": 90579
},
{
"postal_code": 90584
},
{
"postal_code": 90587
},
{
"postal_code": 90592
},
{
"postal_code": 90596
},
{
"postal_code": 90599
},
{
"postal_code": 90602
},
{
"postal_code": 90607
},
{
"postal_code": 90610
},
{
"postal_code": 90613
},
{
"postal_code": 90614
},
{
"postal_code": 90616
},
{
"postal_code": 90617
},
{
"postal_code": 90619
},
{
"postal_code": 90762
},
{
"postal_code": 91052
},
{
"postal_code": 91054
},
{
"postal_code": 91074
},
{
"postal_code": 91077
},
{
"postal_code": 91080
},
{
"postal_code": 91083
},
{
"postal_code": 91085
},
{
"postal_code": 91086
},
{
"postal_code": 91088
},
{
"postal_code": 91090
},
{
"postal_code": 91091
},
{
"postal_code": 91093
},
{
"postal_code": 91094
},
{
"postal_code": 91096
},
{
"postal_code": 91097
},
{
"postal_code": 91099
},
{
"postal_code": 91126
},
{
"postal_code": 91154
},
{
"postal_code": 91161
},
{
"postal_code": 91166
},
{
"postal_code": 91171
},
{
"postal_code": 91174
},
{
"postal_code": 91177
},
{
"postal_code": 91180
},
{
"postal_code": 91183
},
{
"postal_code": 91186
},
{
"postal_code": 91187
},
{
"postal_code": 91189
},
{
"postal_code": 91207
},
{
"postal_code": 91217
},
{
"postal_code": 91220
},
{
"postal_code": 91224
},
{
"postal_code": 91227
},
{
"postal_code": 91230
},
{
"postal_code": 91233
},
{
"postal_code": 91235
},
{
"postal_code": 91236
},
{
"postal_code": 91238
},
{
"postal_code": 91239
},
{
"postal_code": 91241
},
{
"postal_code": 91242
},
{
"postal_code": 91244
},
{
"postal_code": 91245
},
{
"postal_code": 91247
},
{
"postal_code": 91249
},
{
"postal_code": 91257
},
{
"postal_code": 91275
},
{
"postal_code": 91278
},
{
"postal_code": 91281
},
{
"postal_code": 91282
},
{
"postal_code": 91284
},
{
"postal_code": 91286
},
{
"postal_code": 91287
},
{
"postal_code": 91289
},
{
"postal_code": 91301
},
{
"postal_code": 91315
},
{
"postal_code": 91320
},
{
"postal_code": 91322
},
{
"postal_code": 91325
},
{
"postal_code": 91327
},
{
"postal_code": 91330
},
{
"postal_code": 91332
},
{
"postal_code": 91334
},
{
"postal_code": 91336
},
{
"postal_code": 91338
},
{
"postal_code": 91341
},
{
"postal_code": 91344
},
{
"postal_code": 91346
},
{
"postal_code": 91347
},
{
"postal_code": 91349
},
{
"postal_code": 91350
},
{
"postal_code": 91352
},
{
"postal_code": 91353
},
{
"postal_code": 91355
},
{
"postal_code": 91356
},
{
"postal_code": 91358
},
{
"postal_code": 91359
},
{
"postal_code": 91361
},
{
"postal_code": 91362
},
{
"postal_code": 91364
},
{
"postal_code": 91365
},
{
"postal_code": 91367
},
{
"postal_code": 91369
},
{
"postal_code": 91413
},
{
"postal_code": 91438
},
{
"postal_code": 91443
},
{
"postal_code": 91448
},
{
"postal_code": 91452
},
{
"postal_code": 91456
},
{
"postal_code": 91459
},
{
"postal_code": 91460
},
{
"postal_code": 91462
},
{
"postal_code": 91463
},
{
"postal_code": 91465
},
{
"postal_code": 91466
},
{
"postal_code": 91468
},
{
"postal_code": 91469
},
{
"postal_code": 91471
},
{
"postal_code": 91472
},
{
"postal_code": 91474
},
{
"postal_code": 91475
},
{
"postal_code": 91477
},
{
"postal_code": 91478
},
{
"postal_code": 91480
},
{
"postal_code": 91481
},
{
"postal_code": 91483
},
{
"postal_code": 91484
},
{
"postal_code": 91486
},
{
"postal_code": 91487
},
{
"postal_code": 91489
},
{
"postal_code": 91522
},
{
"postal_code": 91541
},
{
"postal_code": 91550
},
{
"postal_code": 91555
},
{
"postal_code": 91560
},
{
"postal_code": 91564
},
{
"postal_code": 91567
},
{
"postal_code": 91572
},
{
"postal_code": 91575
},
{
"postal_code": 91578
},
{
"postal_code": 91580
},
{
"postal_code": 91583
},
{
"postal_code": 91586
},
{
"postal_code": 91587
},
{
"postal_code": 91589
},
{
"postal_code": 91590
},
{
"postal_code": 91592
},
{
"postal_code": 91593
},
{
"postal_code": 91595
},
{
"postal_code": 91596
},
{
"postal_code": 91598
},
{
"postal_code": 91599
},
{
"postal_code": 91601
},
{
"postal_code": 91602
},
{
"postal_code": 91604
},
{
"postal_code": 91605
},
{
"postal_code": 91607
},
{
"postal_code": 91608
},
{
"postal_code": 91610
},
{
"postal_code": 91611
},
{
"postal_code": 91613
},
{
"postal_code": 91614
},
{
"postal_code": 91616
},
{
"postal_code": 91617
},
{
"postal_code": 91619
},
{
"postal_code": 91620
},
{
"postal_code": 91622
},
{
"postal_code": 91623
},
{
"postal_code": 91625
},
{
"postal_code": 91626
},
{
"postal_code": 91628
},
{
"postal_code": 91629
},
{
"postal_code": 91631
},
{
"postal_code": 91632
},
{
"postal_code": 91634
},
{
"postal_code": 91635
},
{
"postal_code": 91637
},
{
"postal_code": 91639
},
{
"postal_code": 91710
},
{
"postal_code": 91717
},
{
"postal_code": 91719
},
{
"postal_code": 91720
},
{
"postal_code": 91722
},
{
"postal_code": 91723
},
{
"postal_code": 91725
},
{
"postal_code": 91726
},
{
"postal_code": 91728
},
{
"postal_code": 91729
},
{
"postal_code": 91731
},
{
"postal_code": 91732
},
{
"postal_code": 91734
},
{
"postal_code": 91735
},
{
"postal_code": 91737
},
{
"postal_code": 91738
},
{
"postal_code": 91740
},
{
"postal_code": 91741
},
{
"postal_code": 91743
},
{
"postal_code": 91744
},
{
"postal_code": 91746
},
{
"postal_code": 91747
},
{
"postal_code": 91749
},
{
"postal_code": 91757
},
{
"postal_code": 91781
},
{
"postal_code": 91785
},
{
"postal_code": 91788
},
{
"postal_code": 91790
},
{
"postal_code": 91792
},
{
"postal_code": 91793
},
{
"postal_code": 91795
},
{
"postal_code": 91796
},
{
"postal_code": 91798
},
{
"postal_code": 91799
},
{
"postal_code": 91801
},
{
"postal_code": 91802
},
{
"postal_code": 91804
},
{
"postal_code": 91805
},
{
"postal_code": 91807
},
{
"postal_code": 91809
},
{
"postal_code": 92224
},
{
"postal_code": 92237
},
{
"postal_code": 92242
},
{
"postal_code": 92245
},
{
"postal_code": 92249
},
{
"postal_code": 92253
},
{
"postal_code": 92256
},
{
"postal_code": 92259
},
{
"postal_code": 92260
},
{
"postal_code": 92262
},
{
"postal_code": 92263
},
{
"postal_code": 92265
},
{
"postal_code": 92266
},
{
"postal_code": 92268
},
{
"postal_code": 92269
},
{
"postal_code": 92271
},
{
"postal_code": 92272
},
{
"postal_code": 92274
},
{
"postal_code": 92275
},
{
"postal_code": 92277
},
{
"postal_code": 92278
},
{
"postal_code": 92280
},
{
"postal_code": 92281
},
{
"postal_code": 92283
},
{
"postal_code": 92284
},
{
"postal_code": 92286
},
{
"postal_code": 92287
},
{
"postal_code": 92289
},
{
"postal_code": 92318
},
{
"postal_code": 92331
},
{
"postal_code": 92334
},
{
"postal_code": 92339
},
{
"postal_code": 92342
},
{
"postal_code": 92345
},
{
"postal_code": 92348
},
{
"postal_code": 92353
},
{
"postal_code": 92355
},
{
"postal_code": 92358
},
{
"postal_code": 92360
},
{
"postal_code": 92361
},
{
"postal_code": 92363
},
{
"postal_code": 92364
},
{
"postal_code": 92366
},
{
"postal_code": 92367
},
{
"postal_code": 92369
},
{
"postal_code": 92421
},
{
"postal_code": 92431
},
{
"postal_code": 92436
},
{
"postal_code": 92439
},
{
"postal_code": 92442
},
{
"postal_code": 92444
},
{
"postal_code": 92445
},
{
"postal_code": 92447
},
{
"postal_code": 92449
},
{
"postal_code": 92507
},
{
"postal_code": 92521
},
{
"postal_code": 92526
},
{
"postal_code": 92533
},
{
"postal_code": 92536
},
{
"postal_code": 92539
},
{
"postal_code": 92540
},
{
"postal_code": 92542
},
{
"postal_code": 92543
},
{
"postal_code": 92545
},
{
"postal_code": 92546
},
{
"postal_code": 92548
},
{
"postal_code": 92549
},
{
"postal_code": 92551
},
{
"postal_code": 92552
},
{
"postal_code": 92554
},
{
"postal_code": 92555
},
{
"postal_code": 92557
},
{
"postal_code": 92559
},
{
"postal_code": 92637
},
{
"postal_code": 92648
},
{
"postal_code": 92655
},
{
"postal_code": 92660
},
{
"postal_code": 92665
},
{
"postal_code": 92670
},
{
"postal_code": 92676
},
{
"postal_code": 92681
},
{
"postal_code": 92685
},
{
"postal_code": 92690
},
{
"postal_code": 92693
},
{
"postal_code": 92694
},
{
"postal_code": 92696
},
{
"postal_code": 92697
},
{
"postal_code": 92699
},
{
"postal_code": 92702
},
{
"postal_code": 92703
},
{
"postal_code": 92705
},
{
"postal_code": 92706
},
{
"postal_code": 92708
},
{
"postal_code": 92709
},
{
"postal_code": 92711
},
{
"postal_code": 92712
},
{
"postal_code": 92714
},
{
"postal_code": 92715
},
{
"postal_code": 92717
},
{
"postal_code": 92718
},
{
"postal_code": 92720
},
{
"postal_code": 92721
},
{
"postal_code": 92723
},
{
"postal_code": 92724
},
{
"postal_code": 92726
},
{
"postal_code": 92727
},
{
"postal_code": 92729
},
{
"postal_code": 93047
},
{
"postal_code": 93073
},
{
"postal_code": 93077
},
{
"postal_code": 93080
},
{
"postal_code": 93083
},
{
"postal_code": 93086
},
{
"postal_code": 93087
},
{
"postal_code": 93089
},
{
"postal_code": 93090
},
{
"postal_code": 93092
},
{
"postal_code": 93093
},
{
"postal_code": 93095
},
{
"postal_code": 93096
},
{
"postal_code": 93098
},
{
"postal_code": 93099
},
{
"postal_code": 93101
},
{
"postal_code": 93102
},
{
"postal_code": 93104
},
{
"postal_code": 93105
},
{
"postal_code": 93107
},
{
"postal_code": 93109
},
{
"postal_code": 93128
},
{
"postal_code": 93133
},
{
"postal_code": 93138
},
{
"postal_code": 93142
},
{
"postal_code": 93149
},
{
"postal_code": 93152
},
{
"postal_code": 93155
},
{
"postal_code": 93158
},
{
"postal_code": 93161
},
{
"postal_code": 93164
},
{
"postal_code": 93167
},
{
"postal_code": 93170
},
{
"postal_code": 93173
},
{
"postal_code": 93176
},
{
"postal_code": 93177
},
{
"postal_code": 93179
},
{
"postal_code": 93180
},
{
"postal_code": 93182
},
{
"postal_code": 93183
},
{
"postal_code": 93185
},
{
"postal_code": 93186
},
{
"postal_code": 93188
},
{
"postal_code": 93189
},
{
"postal_code": 93191
},
{
"postal_code": 93192
},
{
"postal_code": 93194
},
{
"postal_code": 93195
},
{
"postal_code": 93197
},
{
"postal_code": 93199
},
{
"postal_code": 93309
},
{
"postal_code": 93326
},
{
"postal_code": 93333
},
{
"postal_code": 93336
},
{
"postal_code": 93339
},
{
"postal_code": 93342
},
{
"postal_code": 93343
},
{
"postal_code": 93345
},
{
"postal_code": 93346
},
{
"postal_code": 93348
},
{
"postal_code": 93349
},
{
"postal_code": 93351
},
{
"postal_code": 93352
},
{
"postal_code": 93354
},
{
"postal_code": 93356
},
{
"postal_code": 93358
},
{
"postal_code": 93359
},
{
"postal_code": 93413
},
{
"postal_code": 93426
},
{
"postal_code": 93437
},
{
"postal_code": 93444
},
{
"postal_code": 93449
},
{
"postal_code": 93453
},
{
"postal_code": 93455
},
{
"postal_code": 93458
},
{
"postal_code": 93462
},
{
"postal_code": 93464
},
{
"postal_code": 93466
},
{
"postal_code": 93468
},
{
"postal_code": 93470
},
{
"postal_code": 93471
},
{
"postal_code": 93473
},
{
"postal_code": 93474
},
{
"postal_code": 93476
},
{
"postal_code": 93477
},
{
"postal_code": 93479
},
{
"postal_code": 93480
},
{
"postal_code": 93482
},
{
"postal_code": 93483
},
{
"postal_code": 93485
},
{
"postal_code": 93486
},
{
"postal_code": 93488
},
{
"postal_code": 93489
},
{
"postal_code": 93491
},
{
"postal_code": 93492
},
{
"postal_code": 93494
},
{
"postal_code": 93495
},
{
"postal_code": 93497
},
{
"postal_code": 93499
},
{
"postal_code": 94032
},
{
"postal_code": 94051
},
{
"postal_code": 94060
},
{
"postal_code": 94065
},
{
"postal_code": 94072
},
{
"postal_code": 94078
},
{
"postal_code": 94081
},
{
"postal_code": 94086
},
{
"postal_code": 94089
},
{
"postal_code": 94094
},
{
"postal_code": 94099
},
{
"postal_code": 94104
},
{
"postal_code": 94107
},
{
"postal_code": 94110
},
{
"postal_code": 94113
},
{
"postal_code": 94116
},
{
"postal_code": 94118
},
{
"postal_code": 94121
},
{
"postal_code": 94124
},
{
"postal_code": 94127
},
{
"postal_code": 94130
},
{
"postal_code": 94133
},
{
"postal_code": 94136
},
{
"postal_code": 94137
},
{
"postal_code": 94139
},
{
"postal_code": 94140
},
{
"postal_code": 94142
},
{
"postal_code": 94143
},
{
"postal_code": 94145
},
{
"postal_code": 94146
},
{
"postal_code": 94148
},
{
"postal_code": 94149
},
{
"postal_code": 94151
},
{
"postal_code": 94152
},
{
"postal_code": 94154
},
{
"postal_code": 94157
},
{
"postal_code": 94158
},
{
"postal_code": 94160
},
{
"postal_code": 94161
},
{
"postal_code": 94163
},
{
"postal_code": 94164
},
{
"postal_code": 94166
},
{
"postal_code": 94167
},
{
"postal_code": 94169
},
{
"postal_code": 94209
},
{
"postal_code": 94227
},
{
"postal_code": 94234
},
{
"postal_code": 94239
},
{
"postal_code": 94244
},
{
"postal_code": 94249
},
{
"postal_code": 94250
},
{
"postal_code": 94252
},
{
"postal_code": 94253
},
{
"postal_code": 94255
},
{
"postal_code": 94256
},
{
"postal_code": 94258
},
{
"postal_code": 94259
},
{
"postal_code": 94261
},
{
"postal_code": 94262
},
{
"postal_code": 94264
},
{
"postal_code": 94265
},
{
"postal_code": 94267
},
{
"postal_code": 94269
},
{
"postal_code": 94315
},
{
"postal_code": 94327
},
{
"postal_code": 94330
},
{
"postal_code": 94333
},
{
"postal_code": 94336
},
{
"postal_code": 94339
},
{
"postal_code": 94342
},
{
"postal_code": 94344
},
{
"postal_code": 94345
},
{
"postal_code": 94347
},
{
"postal_code": 94348
},
{
"postal_code": 94350
},
{
"postal_code": 94351
},
{
"postal_code": 94353
},
{
"postal_code": 94354
},
{
"postal_code": 94356
},
{
"postal_code": 94357
},
{
"postal_code": 94359
},
{
"postal_code": 94360
},
{
"postal_code": 94362
},
{
"postal_code": 94363
},
{
"postal_code": 94365
},
{
"postal_code": 94366
},
{
"postal_code": 94368
},
{
"postal_code": 94369
},
{
"postal_code": 94371
},
{
"postal_code": 94372
},
{
"postal_code": 94374
},
{
"postal_code": 94375
},
{
"postal_code": 94377
},
{
"postal_code": 94379
},
{
"postal_code": 94405
},
{
"postal_code": 94419
},
{
"postal_code": 94424
},
{
"postal_code": 94428
},
{
"postal_code": 94431
},
{
"postal_code": 94436
},
{
"postal_code": 94437
},
{
"postal_code": 94439
},
{
"postal_code": 94447
},
{
"postal_code": 94469
},
{
"postal_code": 94474
},
{
"postal_code": 94481
},
{
"postal_code": 94486
},
{
"postal_code": 94491
},
{
"postal_code": 94496
},
{
"postal_code": 94501
},
{
"postal_code": 94505
},
{
"postal_code": 94508
},
{
"postal_code": 94513
},
{
"postal_code": 94518
},
{
"postal_code": 94522
},
{
"postal_code": 94526
},
{
"postal_code": 94527
},
{
"postal_code": 94529
},
{
"postal_code": 94530
},
{
"postal_code": 94532
},
{
"postal_code": 94533
},
{
"postal_code": 94535
},
{
"postal_code": 94536
},
{
"postal_code": 94538
},
{
"postal_code": 94539
},
{
"postal_code": 94541
},
{
"postal_code": 94542
},
{
"postal_code": 94544
},
{
"postal_code": 94545
},
{
"postal_code": 94547
},
{
"postal_code": 94548
},
{
"postal_code": 94550
},
{
"postal_code": 94551
},
{
"postal_code": 94553
},
{
"postal_code": 94554
},
{
"postal_code": 94556
},
{
"postal_code": 94557
},
{
"postal_code": 94559
},
{
"postal_code": 94560
},
{
"postal_code": 94562
},
{
"postal_code": 94563
},
{
"postal_code": 94568
},
{
"postal_code": 94569
},
{
"postal_code": 94571
},
{
"postal_code": 94572
},
{
"postal_code": 94574
},
{
"postal_code": 94575
},
{
"postal_code": 94577
},
{
"postal_code": 94579
},
{
"postal_code": 95028
},
{
"postal_code": 95100
},
{
"postal_code": 95111
},
{
"postal_code": 95119
},
{
"postal_code": 95126
},
{
"postal_code": 95131
},
{
"postal_code": 95138
},
{
"postal_code": 95145
},
{
"postal_code": 95152
},
{
"postal_code": 95158
},
{
"postal_code": 95163
},
{
"postal_code": 95168
},
{
"postal_code": 95173
},
{
"postal_code": 95176
},
{
"postal_code": 95179
},
{
"postal_code": 95180
},
{
"postal_code": 95182
},
{
"postal_code": 95183
},
{
"postal_code": 95185
},
{
"postal_code": 95186
},
{
"postal_code": 95188
},
{
"postal_code": 95189
},
{
"postal_code": 95191
},
{
"postal_code": 95192
},
{
"postal_code": 95194
},
{
"postal_code": 95195
},
{
"postal_code": 95197
},
{
"postal_code": 95199
},
{
"postal_code": 95213
},
{
"postal_code": 95233
},
{
"postal_code": 95234
},
{
"postal_code": 95236
},
{
"postal_code": 95237
},
{
"postal_code": 95239
},
{
"postal_code": 95326
},
{
"postal_code": 95336
},
{
"postal_code": 95339
},
{
"postal_code": 95346
},
{
"postal_code": 95349
},
{
"postal_code": 95352
},
{
"postal_code": 95355
},
{
"postal_code": 95356
},
{
"postal_code": 95358
},
{
"postal_code": 95359
},
{
"postal_code": 95361
},
{
"postal_code": 95362
},
{
"postal_code": 95364
},
{
"postal_code": 95365
},
{
"postal_code": 95367
},
{
"postal_code": 95369
},
{
"postal_code": 95444
},
{
"postal_code": 95460
},
{
"postal_code": 95463
},
{
"postal_code": 95466
},
{
"postal_code": 95469
},
{
"postal_code": 95473
},
{
"postal_code": 95478
},
{
"postal_code": 95482
},
{
"postal_code": 95485
},
{
"postal_code": 95488
},
{
"postal_code": 95490
},
{
"postal_code": 95491
},
{
"postal_code": 95493
},
{
"postal_code": 95494
},
{
"postal_code": 95496
},
{
"postal_code": 95497
},
{
"postal_code": 95499
},
{
"postal_code": 95500
},
{
"postal_code": 95502
},
{
"postal_code": 95503
},
{
"postal_code": 95505
},
{
"postal_code": 95506
},
{
"postal_code": 95508
},
{
"postal_code": 95509
},
{
"postal_code": 95511
},
{
"postal_code": 95512
},
{
"postal_code": 95514
},
{
"postal_code": 95515
},
{
"postal_code": 95517
},
{
"postal_code": 95519
},
{
"postal_code": 95615
},
{
"postal_code": 95632
},
{
"postal_code": 95643
},
{
"postal_code": 95652
},
{
"postal_code": 95659
},
{
"postal_code": 95666
},
{
"postal_code": 95671
},
{
"postal_code": 95676
},
{
"postal_code": 95679
},
{
"postal_code": 95680
},
{
"postal_code": 95682
},
{
"postal_code": 95683
},
{
"postal_code": 95685
},
{
"postal_code": 95686
},
{
"postal_code": 95688
},
{
"postal_code": 95689
},
{
"postal_code": 95691
},
{
"postal_code": 95692
},
{
"postal_code": 95694
},
{
"postal_code": 95695
},
{
"postal_code": 95697
},
{
"postal_code": 95698
},
{
"postal_code": 95700
},
{
"postal_code": 95701
},
{
"postal_code": 95703
},
{
"postal_code": 95704
},
{
"postal_code": 95706
},
{
"postal_code": 95707
},
{
"postal_code": 95709
},
{
"postal_code": 96047
},
{
"postal_code": 96103
},
{
"postal_code": 96106
},
{
"postal_code": 96110
},
{
"postal_code": 96114
},
{
"postal_code": 96117
},
{
"postal_code": 96120
},
{
"postal_code": 96123
},
{
"postal_code": 96126
},
{
"postal_code": 96129
},
{
"postal_code": 96132
},
{
"postal_code": 96135
},
{
"postal_code": 96138
},
{
"postal_code": 96142
},
{
"postal_code": 96145
},
{
"postal_code": 96146
},
{
"postal_code": 96148
},
{
"postal_code": 96149
},
{
"postal_code": 96151
},
{
"postal_code": 96152
},
{
"postal_code": 96154
},
{
"postal_code": 96155
},
{
"postal_code": 96157
},
{
"postal_code": 96158
},
{
"postal_code": 96160
},
{
"postal_code": 96161
},
{
"postal_code": 96163
},
{
"postal_code": 96164
},
{
"postal_code": 96166
},
{
"postal_code": 96167
},
{
"postal_code": 96169
},
{
"postal_code": 96170
},
{
"postal_code": 96172
},
{
"postal_code": 96173
},
{
"postal_code": 96175
},
{
"postal_code": 96176
},
{
"postal_code": 96178
},
{
"postal_code": 96179
},
{
"postal_code": 96181
},
{
"postal_code": 96182
},
{
"postal_code": 96184
},
{
"postal_code": 96185
},
{
"postal_code": 96187
},
{
"postal_code": 96188
},
{
"postal_code": 96190
},
{
"postal_code": 96191
},
{
"postal_code": 96193
},
{
"postal_code": 96194
},
{
"postal_code": 96196
},
{
"postal_code": 96197
},
{
"postal_code": 96199
},
{
"postal_code": 96215
},
{
"postal_code": 96224
},
{
"postal_code": 96231
},
{
"postal_code": 96237
},
{
"postal_code": 96242
},
{
"postal_code": 96247
},
{
"postal_code": 96250
},
{
"postal_code": 96253
},
{
"postal_code": 96257
},
{
"postal_code": 96260
},
{
"postal_code": 96264
},
{
"postal_code": 96268
},
{
"postal_code": 96269
},
{
"postal_code": 96271
},
{
"postal_code": 96272
},
{
"postal_code": 96274
},
{
"postal_code": 96275
},
{
"postal_code": 96277
},
{
"postal_code": 96279
},
{
"postal_code": 96317
},
{
"postal_code": 96328
},
{
"postal_code": 96332
},
{
"postal_code": 96337
},
{
"postal_code": 96342
},
{
"postal_code": 96346
},
{
"postal_code": 96349
},
{
"postal_code": 96352
},
{
"postal_code": 96355
},
{
"postal_code": 96358
},
{
"postal_code": 96361
},
{
"postal_code": 96364
},
{
"postal_code": 96365
},
{
"postal_code": 96367
},
{
"postal_code": 96369
},
{
"postal_code": 96450
},
{
"postal_code": 96465
},
{
"postal_code": 96472
},
{
"postal_code": 96476
},
{
"postal_code": 96479
},
{
"postal_code": 96482
},
{
"postal_code": 96484
},
{
"postal_code": 96486
},
{
"postal_code": 96487
},
{
"postal_code": 96489
},
{
"postal_code": 96515
},
{
"postal_code": 96523
},
{
"postal_code": 96524
},
{
"postal_code": 96528
},
{
"postal_code": 97070
},
{
"postal_code": 97199
},
{
"postal_code": 97204
},
{
"postal_code": 97209
},
{
"postal_code": 97215
},
{
"postal_code": 97218
},
{
"postal_code": 97222
},
{
"postal_code": 97225
},
{
"postal_code": 97228
},
{
"postal_code": 97230
},
{
"postal_code": 97232
},
{
"postal_code": 97234
},
{
"postal_code": 97236
},
{
"postal_code": 97237
},
{
"postal_code": 97239
},
{
"postal_code": 97241
},
{
"postal_code": 97243
},
{
"postal_code": 97244
},
{
"postal_code": 97246
},
{
"postal_code": 97247
},
{
"postal_code": 97249
},
{
"postal_code": 97250
},
{
"postal_code": 97252
},
{
"postal_code": 97253
},
{
"postal_code": 97255
},
{
"postal_code": 97256
},
{
"postal_code": 97258
},
{
"postal_code": 97259
},
{
"postal_code": 97261
},
{
"postal_code": 97262
},
{
"postal_code": 97264
},
{
"postal_code": 97265
},
{
"postal_code": 97267
},
{
"postal_code": 97268
},
{
"postal_code": 97270
},
{
"postal_code": 97271
},
{
"postal_code": 97273
},
{
"postal_code": 97274
},
{
"postal_code": 97276
},
{
"postal_code": 97277
},
{
"postal_code": 97279
},
{
"postal_code": 97280
},
{
"postal_code": 97282
},
{
"postal_code": 97283
},
{
"postal_code": 97285
},
{
"postal_code": 97286
},
{
"postal_code": 97288
},
{
"postal_code": 97289
},
{
"postal_code": 97291
},
{
"postal_code": 97292
},
{
"postal_code": 97294
},
{
"postal_code": 97295
},
{
"postal_code": 97297
},
{
"postal_code": 97299
},
{
"postal_code": 97318
},
{
"postal_code": 97320
},
{
"postal_code": 97332
},
{
"postal_code": 97334
},
{
"postal_code": 97337
},
{
"postal_code": 97340
},
{
"postal_code": 97342
},
{
"postal_code": 97346
},
{
"postal_code": 97348
},
{
"postal_code": 97350
},
{
"postal_code": 97353
},
{
"postal_code": 97355
},
{
"postal_code": 97357
},
{
"postal_code": 97359
},
{
"postal_code": 97421
},
{
"postal_code": 97437
},
{
"postal_code": 97440
},
{
"postal_code": 97447
},
{
"postal_code": 97450
},
{
"postal_code": 97453
},
{
"postal_code": 97456
},
{
"postal_code": 97461
},
{
"postal_code": 97464
},
{
"postal_code": 97469
},
{
"postal_code": 97475
},
{
"postal_code": 97478
},
{
"postal_code": 97483
},
{
"postal_code": 97486
},
{
"postal_code": 97488
},
{
"postal_code": 97490
},
{
"postal_code": 97491
},
{
"postal_code": 97493
},
{
"postal_code": 97494
},
{
"postal_code": 97496
},
{
"postal_code": 97497
},
{
"postal_code": 97499
},
{
"postal_code": 97500
},
{
"postal_code": 97502
},
{
"postal_code": 97503
},
{
"postal_code": 97505
},
{
"postal_code": 97506
},
{
"postal_code": 97508
},
{
"postal_code": 97509
},
{
"postal_code": 97511
},
{
"postal_code": 97513
},
{
"postal_code": 97514
},
{
"postal_code": 97516
},
{
"postal_code": 97517
},
{
"postal_code": 97519
},
{
"postal_code": 97520
},
{
"postal_code": 97522
},
{
"postal_code": 97523
},
{
"postal_code": 97525
},
{
"postal_code": 97526
},
{
"postal_code": 97528
},
{
"postal_code": 97529
},
{
"postal_code": 97531
},
{
"postal_code": 97532
},
{
"postal_code": 97534
},
{
"postal_code": 97535
},
{
"postal_code": 97537
},
{
"postal_code": 97539
},
{
"postal_code": 97616
},
{
"postal_code": 97618
},
{
"postal_code": 97631
},
{
"postal_code": 97633
},
{
"postal_code": 97638
},
{
"postal_code": 97640
},
{
"postal_code": 97645
},
{
"postal_code": 97647
},
{
"postal_code": 97650
},
{
"postal_code": 97653
},
{
"postal_code": 97654
},
{
"postal_code": 97656
},
{
"postal_code": 97657
},
{
"postal_code": 97659
},
{
"postal_code": 97688
},
{
"postal_code": 97702
},
{
"postal_code": 97705
},
{
"postal_code": 97708
},
{
"postal_code": 97711
},
{
"postal_code": 97714
},
{
"postal_code": 97717
},
{
"postal_code": 97720
},
{
"postal_code": 97723
},
{
"postal_code": 97724
},
{
"postal_code": 97725
},
{
"postal_code": 97727
},
{
"postal_code": 97729
},
{
"postal_code": 97737
},
{
"postal_code": 97753
},
{
"postal_code": 97762
},
{
"postal_code": 97769
},
{
"postal_code": 97772
},
{
"postal_code": 97773
},
{
"postal_code": 97775
},
{
"postal_code": 97776
},
{
"postal_code": 97778
},
{
"postal_code": 97779
},
{
"postal_code": 97780
},
{
"postal_code": 97782
},
{
"postal_code": 97783
},
{
"postal_code": 97785
},
{
"postal_code": 97786
},
{
"postal_code": 97788
},
{
"postal_code": 97789
},
{
"postal_code": 97791
},
{
"postal_code": 97792
},
{
"postal_code": 97794
},
{
"postal_code": 97795
},
{
"postal_code": 97797
},
{
"postal_code": 97799
},
{
"postal_code": 97816
},
{
"postal_code": 97828
},
{
"postal_code": 97833
},
{
"postal_code": 97834
},
{
"postal_code": 97836
},
{
"postal_code": 97837
},
{
"postal_code": 97839
},
{
"postal_code": 97840
},
{
"postal_code": 97842
},
{
"postal_code": 97843
},
{
"postal_code": 97845
},
{
"postal_code": 97846
},
{
"postal_code": 97848
},
{
"postal_code": 97849
},
{
"postal_code": 97851
},
{
"postal_code": 97852
},
{
"postal_code": 97854
},
{
"postal_code": 97855
},
{
"postal_code": 97857
},
{
"postal_code": 97859
},
{
"postal_code": 97877
},
{
"postal_code": 97892
},
{
"postal_code": 97896
},
{
"postal_code": 97900
},
{
"postal_code": 97901
},
{
"postal_code": 97903
},
{
"postal_code": 97904
},
{
"postal_code": 97906
},
{
"postal_code": 97907
},
{
"postal_code": 97909
},
{
"postal_code": 97922
},
{
"postal_code": 97941
},
{
"postal_code": 97944
},
{
"postal_code": 97947
},
{
"postal_code": 97950
},
{
"postal_code": 97953
},
{
"postal_code": 97956
},
{
"postal_code": 97957
},
{
"postal_code": 97959
},
{
"postal_code": 97980
},
{
"postal_code": 97990
},
{
"postal_code": 97993
},
{
"postal_code": 97996
},
{
"postal_code": 97999
},
{
"postal_code": 98527
},
{
"postal_code": 98530
},
{
"postal_code": 98544
},
{
"postal_code": 98547
},
{
"postal_code": 98553
},
{
"postal_code": 98554
},
{
"postal_code": 98559
},
{
"postal_code": 98574
},
{
"postal_code": 98587
},
{
"postal_code": 98590
},
{
"postal_code": 98593
},
{
"postal_code": 98596
},
{
"postal_code": 98597
},
{
"postal_code": 98617
},
{
"postal_code": 98630
},
{
"postal_code": 98631
},
{
"postal_code": 98634
},
{
"postal_code": 98639
},
{
"postal_code": 98646
},
{
"postal_code": 98660
},
{
"postal_code": 98663
},
{
"postal_code": 98666
},
{
"postal_code": 98667
},
{
"postal_code": 98669
},
{
"postal_code": 98673
},
{
"postal_code": 98678
},
{
"postal_code": 98693
},
{
"postal_code": 98701
},
{
"postal_code": 98704
},
{
"postal_code": 98708
},
{
"postal_code": 98711
},
{
"postal_code": 98714
},
{
"postal_code": 98716
},
{
"postal_code": 98724
},
{
"postal_code": 98739
},
{
"postal_code": 98743
},
{
"postal_code": 98744
},
{
"postal_code": 98746
},
{
"postal_code": 99084
},
{
"postal_code": 99100
},
{
"postal_code": 99102
},
{
"postal_code": 99189
},
{
"postal_code": 99192
},
{
"postal_code": 99195
},
{
"postal_code": 99198
},
{
"postal_code": 99310
},
{
"postal_code": 99326
},
{
"postal_code": 99330
},
{
"postal_code": 99334
},
{
"postal_code": 99338
},
{
"postal_code": 99423
},
{
"postal_code": 99428
},
{
"postal_code": 99438
},
{
"postal_code": 99439
},
{
"postal_code": 99441
},
{
"postal_code": 99444
},
{
"postal_code": 99448
},
{
"postal_code": 99510
},
{
"postal_code": 99518
},
{
"postal_code": 99610
},
{
"postal_code": 99625
},
{
"postal_code": 99628
},
{
"postal_code": 99631
},
{
"postal_code": 99634
},
{
"postal_code": 99636
},
{
"postal_code": 99638
},
{
"postal_code": 99706
},
{
"postal_code": 99713
},
{
"postal_code": 99718
},
{
"postal_code": 99734
},
{
"postal_code": 99735
},
{
"postal_code": 99752
},
{
"postal_code": 99755
},
{
"postal_code": 99759
},
{
"postal_code": 99762
},
{
"postal_code": 99765
},
{
"postal_code": 99768
},
{
"postal_code": 99817
},
{
"postal_code": 99819
},
{
"postal_code": 99820
},
{
"postal_code": 99826
},
{
"postal_code": 99830
},
{
"postal_code": 99831
},
{
"postal_code": 99834
},
{
"postal_code": 99837
},
{
"postal_code": 99842
},
{
"postal_code": 99846
},
{
"postal_code": 99848
},
{
"postal_code": 99867
},
{
"postal_code": 99869
},
{
"postal_code": 99880
},
{
"postal_code": 99885
},
{
"postal_code": 99887
},
{
"postal_code": 99891
},
{
"postal_code": 99894
},
{
"postal_code": 99897
},
{
"postal_code": 99947
},
{
"postal_code": 99955
},
{
"postal_code": 99958
},
{
"postal_code": 99974
},
{
"postal_code": 99976
},
{
"postal_code": 99986
},
{
"postal_code": 99991
},
{
"postal_code": 99994
},
{
"postal_code": 99996
},
{
"postal_code": 99998
},
{
"postal_code": 1067
},
{
"postal_code": 1454
},
{
"postal_code": 1561
},
{
"postal_code": 1594
},
{
"postal_code": 1609
},
{
"postal_code": 1612
},
{
"postal_code": 1623
},
{
"postal_code": 1665
},
{
"postal_code": 1689
},
{
"postal_code": 1762
},
{
"postal_code": 1796
},
{
"postal_code": 1809
},
{
"postal_code": 1814
},
{
"postal_code": 1824
},
{
"postal_code": 1833
},
{
"postal_code": 1877
},
{
"postal_code": 1896
},
{
"postal_code": 1900
},
{
"postal_code": 1904
},
{
"postal_code": 1909
},
{
"postal_code": 1920
},
{
"postal_code": 1936
},
{
"postal_code": 1945
},
{
"postal_code": 1990
},
{
"postal_code": 2627
},
{
"postal_code": 2681
},
{
"postal_code": 2692
},
{
"postal_code": 2694
},
{
"postal_code": 2699
},
{
"postal_code": 2708
},
{
"postal_code": 2736
},
{
"postal_code": 2763
},
{
"postal_code": 2779
},
{
"postal_code": 2829
},
{
"postal_code": 2894
},
{
"postal_code": 2899
},
{
"postal_code": 2906
},
{
"postal_code": 2923
},
{
"postal_code": 2943
},
{
"postal_code": 2953
},
{
"postal_code": 2957
},
{
"postal_code": 2959
},
{
"postal_code": 2979
},
{
"postal_code": 3096
},
{
"postal_code": 3103
},
{
"postal_code": 3130
},
{
"postal_code": 3149
},
{
"postal_code": 3159
},
{
"postal_code": 3172
},
{
"postal_code": 3185
},
{
"postal_code": 3205
},
{
"postal_code": 3229
},
{
"postal_code": 3238
},
{
"postal_code": 3253
},
{
"postal_code": 4109
},
{
"postal_code": 4509
},
{
"postal_code": 4523
},
{
"postal_code": 4603
},
{
"postal_code": 4617
},
{
"postal_code": 4618
},
{
"postal_code": 4626
},
{
"postal_code": 4639
},
{
"postal_code": 4668
},
{
"postal_code": 4683
},
{
"postal_code": 4720
},
{
"postal_code": 4758
},
{
"postal_code": 4808
},
{
"postal_code": 4838
},
{
"postal_code": 4860
},
{
"postal_code": 4880
},
{
"postal_code": 4886
},
{
"postal_code": 4916
},
{
"postal_code": 4928
},
{
"postal_code": 4932
},
{
"postal_code": 4936
},
{
"postal_code": 6193
},
{
"postal_code": 6268
},
{
"postal_code": 6279
},
{
"postal_code": 6295
},
{
"postal_code": 6308
},
{
"postal_code": 6313
},
{
"postal_code": 6333
},
{
"postal_code": 6425
},
{
"postal_code": 6449
},
{
"postal_code": 6458
},
{
"postal_code": 6484
},
{
"postal_code": 6493
},
{
"postal_code": 6528
},
{
"postal_code": 6536
},
{
"postal_code": 6556
},
{
"postal_code": 6571
},
{
"postal_code": 6577
},
{
"postal_code": 6578
},
{
"postal_code": 6618
},
{
"postal_code": 6632
},
{
"postal_code": 6642
},
{
"postal_code": 6647
},
{
"postal_code": 6667
},
{
"postal_code": 6712
},
{
"postal_code": 6721
},
{
"postal_code": 6722
},
{
"postal_code": 7318
},
{
"postal_code": 7338
},
{
"postal_code": 7356
},
{
"postal_code": 7366
},
{
"postal_code": 7381
},
{
"postal_code": 7389
},
{
"postal_code": 7407
},
{
"postal_code": 7422
},
{
"postal_code": 7426
},
{
"postal_code": 7429
},
{
"postal_code": 7554
},
{
"postal_code": 7557
},
{
"postal_code": 7570
},
{
"postal_code": 7580
},
{
"postal_code": 7586
},
{
"postal_code": 7589
},
{
"postal_code": 7607
},
{
"postal_code": 7613
},
{
"postal_code": 7616
},
{
"postal_code": 7619
},
{
"postal_code": 7629
},
{
"postal_code": 7639
},
{
"postal_code": 7646
},
{
"postal_code": 7751
},
{
"postal_code": 7768
},
{
"postal_code": 7778
},
{
"postal_code": 7806
},
{
"postal_code": 7819
},
{
"postal_code": 7907
},
{
"postal_code": 7924
},
{
"postal_code": 7937
},
{
"postal_code": 7957
},
{
"postal_code": 7980
},
{
"postal_code": 8107
},
{
"postal_code": 8134
},
{
"postal_code": 8223
},
{
"postal_code": 8393
},
{
"postal_code": 8396
},
{
"postal_code": 8468
},
{
"postal_code": 8491
},
{
"postal_code": 8538
},
{
"postal_code": 8541
},
{
"postal_code": 8606
},
{
"postal_code": 8626
},
{
"postal_code": 9306
},
{
"postal_code": 9337
},
{
"postal_code": 9366
},
{
"postal_code": 9405
},
{
"postal_code": 9456
},
{
"postal_code": 9468
},
{
"postal_code": 9471
},
{
"postal_code": 9481
},
{
"postal_code": 9526
},
{
"postal_code": 9548
},
{
"postal_code": 9573
},
{
"postal_code": 9579
},
{
"postal_code": 9600
},
{
"postal_code": 9618
},
{
"postal_code": 9619
},
{
"postal_code": 9623
},
{
"postal_code": 9648
},
{
"postal_code": 9661
},
{
"postal_code": 10178
},
{
"postal_code": 14532
},
{
"postal_code": 14641
},
{
"postal_code": 14662
},
{
"postal_code": 14715
},
{
"postal_code": 14728
},
{
"postal_code": 14778
},
{
"postal_code": 14789
},
{
"postal_code": 14793
},
{
"postal_code": 14806
},
{
"postal_code": 14822
},
{
"postal_code": 14823
},
{
"postal_code": 14913
},
{
"postal_code": 15236
},
{
"postal_code": 15295
},
{
"postal_code": 15299
},
{
"postal_code": 15306
},
{
"postal_code": 15320
},
{
"postal_code": 15326
},
{
"postal_code": 15328
},
{
"postal_code": 15345
},
{
"postal_code": 15366
},
{
"postal_code": 15370
},
{
"postal_code": 15377
},
{
"postal_code": 15518
},
{
"postal_code": 15526
},
{
"postal_code": 15537
},
{
"postal_code": 15732
},
{
"postal_code": 15748
},
{
"postal_code": 15755
},
{
"postal_code": 15848
},
{
"postal_code": 15864
},
{
"postal_code": 15868
},
{
"postal_code": 15890
},
{
"postal_code": 15898
},
{
"postal_code": 15910
},
{
"postal_code": 15913
},
{
"postal_code": 15926
},
{
"postal_code": 15936
},
{
"postal_code": 15938
},
{
"postal_code": 16230
},
{
"postal_code": 16247
},
{
"postal_code": 16248
},
{
"postal_code": 16259
},
{
"postal_code": 16269
},
{
"postal_code": 16278
},
{
"postal_code": 16306
},
{
"postal_code": 16307
},
{
"postal_code": 16321
},
{
"postal_code": 16348
},
{
"postal_code": 16356
},
{
"postal_code": 16727
},
{
"postal_code": 16775
},
{
"postal_code": 16818
},
{
"postal_code": 16835
},
{
"postal_code": 16845
},
{
"postal_code": 16866
},
{
"postal_code": 16909
},
{
"postal_code": 16928
},
{
"postal_code": 16945
},
{
"postal_code": 16949
},
{
"postal_code": 17039
},
{
"postal_code": 17089
},
{
"postal_code": 17091
},
{
"postal_code": 17094
},
{
"postal_code": 17099
},
{
"postal_code": 17111
},
{
"postal_code": 17121
},
{
"postal_code": 17129
},
{
"postal_code": 17139
},
{
"postal_code": 17153
},
{
"postal_code": 17166
},
{
"postal_code": 17168
},
{
"postal_code": 17179
},
{
"postal_code": 17192
},
{
"postal_code": 17194
},
{
"postal_code": 17207
},
{
"postal_code": 17209
},
{
"postal_code": 17213
},
{
"postal_code": 17214
},
{
"postal_code": 17217
},
{
"postal_code": 17219
},
{
"postal_code": 17237
},
{
"postal_code": 17248
},
{
"postal_code": 17252
},
{
"postal_code": 17255
},
{
"postal_code": 17268
},
{
"postal_code": 17291
},
{
"postal_code": 17309
},
{
"postal_code": 17321
},
{
"postal_code": 17322
},
{
"postal_code": 17328
},
{
"postal_code": 17337
},
{
"postal_code": 17348
},
{
"postal_code": 17349
},
{
"postal_code": 17358
},
{
"postal_code": 17375
},
{
"postal_code": 17379
},
{
"postal_code": 17390
},
{
"postal_code": 17391
},
{
"postal_code": 17392
},
{
"postal_code": 17398
},
{
"postal_code": 17406
},
{
"postal_code": 17419
},
{
"postal_code": 17429
},
{
"postal_code": 17440
},
{
"postal_code": 17449
},
{
"postal_code": 17459
},
{
"postal_code": 17495
},
{
"postal_code": 17498
},
{
"postal_code": 17506
},
{
"postal_code": 17509
},
{
"postal_code": 18059
},
{
"postal_code": 18182
},
{
"postal_code": 18184
},
{
"postal_code": 18195
},
{
"postal_code": 18198
},
{
"postal_code": 18209
},
{
"postal_code": 18211
},
{
"postal_code": 18230
},
{
"postal_code": 18233
},
{
"postal_code": 18246
},
{
"postal_code": 18249
},
{
"postal_code": 18258
},
{
"postal_code": 18276
},
{
"postal_code": 18279
},
{
"postal_code": 18292
},
{
"postal_code": 18299
},
{
"postal_code": 18314
},
{
"postal_code": 18320
},
{
"postal_code": 18334
},
{
"postal_code": 18347
},
{
"postal_code": 18356
},
{
"postal_code": 18375
},
{
"postal_code": 18442
},
{
"postal_code": 18445
},
{
"postal_code": 18461
},
{
"postal_code": 18465
},
{
"postal_code": 18469
},
{
"postal_code": 18510
},
{
"postal_code": 18513
},
{
"postal_code": 18528
},
{
"postal_code": 18551
},
{
"postal_code": 18556
},
{
"postal_code": 18569
},
{
"postal_code": 18573
},
{
"postal_code": 18574
},
{
"postal_code": 18586
},
{
"postal_code": 19065
},
{
"postal_code": 19067
},
{
"postal_code": 19069
},
{
"postal_code": 19071
},
{
"postal_code": 19073
},
{
"postal_code": 19075
},
{
"postal_code": 19077
},
{
"postal_code": 19079
},
{
"postal_code": 19089
},
{
"postal_code": 19205
},
{
"postal_code": 19209
},
{
"postal_code": 19217
},
{
"postal_code": 19230
},
{
"postal_code": 19243
},
{
"postal_code": 19246
},
{
"postal_code": 19258
},
{
"postal_code": 19260
},
{
"postal_code": 19273
},
{
"postal_code": 19288
},
{
"postal_code": 19294
},
{
"postal_code": 19300
},
{
"postal_code": 19303
},
{
"postal_code": 19306
},
{
"postal_code": 19309
},
{
"postal_code": 19322
},
{
"postal_code": 19336
},
{
"postal_code": 19348
},
{
"postal_code": 19357
},
{
"postal_code": 19372
},
{
"postal_code": 19374
},
{
"postal_code": 19376
},
{
"postal_code": 19386
},
{
"postal_code": 19395
},
{
"postal_code": 19399
},
{
"postal_code": 19406
},
{
"postal_code": 19412
},
{
"postal_code": 19417
},
{
"postal_code": 20038
},
{
"postal_code": 21039
},
{
"postal_code": 21255
},
{
"postal_code": 21271
},
{
"postal_code": 21279
},
{
"postal_code": 21357
},
{
"postal_code": 21368
},
{
"postal_code": 21376
},
{
"postal_code": 21379
},
{
"postal_code": 21385
},
{
"postal_code": 21394
},
{
"postal_code": 21397
},
{
"postal_code": 21406
},
{
"postal_code": 21423
},
{
"postal_code": 21465
},
{
"postal_code": 21481
},
{
"postal_code": 21483
},
{
"postal_code": 21493
},
{
"postal_code": 21502
},
{
"postal_code": 21514
},
{
"postal_code": 21516
},
{
"postal_code": 21521
},
{
"postal_code": 21522
},
{
"postal_code": 21640
},
{
"postal_code": 21698
},
{
"postal_code": 21709
},
{
"postal_code": 21717
},
{
"postal_code": 21720
},
{
"postal_code": 21726
},
{
"postal_code": 21762
},
{
"postal_code": 21769
},
{
"postal_code": 21775
},
{
"postal_code": 21785
},
{
"postal_code": 22145
},
{
"postal_code": 22929
},
{
"postal_code": 22941
},
{
"postal_code": 22946
},
{
"postal_code": 23619
},
{
"postal_code": 23627
},
{
"postal_code": 23628
},
{
"postal_code": 23701
},
{
"postal_code": 23714
},
{
"postal_code": 23730
},
{
"postal_code": 23738
},
{
"postal_code": 23743
},
{
"postal_code": 23758
},
{
"postal_code": 23795
},
{
"postal_code": 23813
},
{
"postal_code": 23815
},
{
"postal_code": 23816
},
{
"postal_code": 23824
},
{
"postal_code": 23826
},
{
"postal_code": 23827
},
{
"postal_code": 23829
},
{
"postal_code": 23843
},
{
"postal_code": 23845
},
{
"postal_code": 23847
},
{
"postal_code": 23858
},
{
"postal_code": 23860
},
{
"postal_code": 23863
},
{
"postal_code": 23881
},
{
"postal_code": 23883
},
{
"postal_code": 23896
},
{
"postal_code": 23898
},
{
"postal_code": 23899
},
{
"postal_code": 23909
},
{
"postal_code": 23911
},
{
"postal_code": 23919
},
{
"postal_code": 23923
},
{
"postal_code": 23936
},
{
"postal_code": 23942
},
{
"postal_code": 23948
},
{
"postal_code": 23968
},
{
"postal_code": 23972
},
{
"postal_code": 23974
},
{
"postal_code": 23992
},
{
"postal_code": 23996
},
{
"postal_code": 24107
},
{
"postal_code": 24211
},
{
"postal_code": 24214
},
{
"postal_code": 24217
},
{
"postal_code": 24220
},
{
"postal_code": 24226
},
{
"postal_code": 24229
},
{
"postal_code": 24235
},
{
"postal_code": 24238
},
{
"postal_code": 24241
},
{
"postal_code": 24245
},
{
"postal_code": 24247
},
{
"postal_code": 24250
},
{
"postal_code": 24253
},
{
"postal_code": 24256
},
{
"postal_code": 24257
},
{
"postal_code": 24306
},
{
"postal_code": 24321
},
{
"postal_code": 24326
},
{
"postal_code": 24327
},
{
"postal_code": 24329
},
{
"postal_code": 24340
},
{
"postal_code": 24351
},
{
"postal_code": 24354
},
{
"postal_code": 24357
},
{
"postal_code": 24358
},
{
"postal_code": 24361
},
{
"postal_code": 24376
},
{
"postal_code": 24392
},
{
"postal_code": 24395
},
{
"postal_code": 24398
},
{
"postal_code": 24405
},
{
"postal_code": 24407
},
{
"postal_code": 24558
},
{
"postal_code": 24568
},
{
"postal_code": 24576
},
{
"postal_code": 24582
},
{
"postal_code": 24589
},
{
"postal_code": 24594
},
{
"postal_code": 24598
},
{
"postal_code": 24601
},
{
"postal_code": 24610
},
{
"postal_code": 24613
},
{
"postal_code": 24616
},
{
"postal_code": 24619
},
{
"postal_code": 24625
},
{
"postal_code": 24632
},
{
"postal_code": 24634
},
{
"postal_code": 24635
},
{
"postal_code": 24640
},
{
"postal_code": 24641
},
{
"postal_code": 24644
},
{
"postal_code": 24647
},
{
"postal_code": 24649
},
{
"postal_code": 24782
},
{
"postal_code": 24783
},
{
"postal_code": 24790
},
{
"postal_code": 24793
},
{
"postal_code": 24794
},
{
"postal_code": 24796
},
{
"postal_code": 24797
},
{
"postal_code": 24799
},
{
"postal_code": 24802
},
{
"postal_code": 24803
},
{
"postal_code": 24805
},
{
"postal_code": 24806
},
{
"postal_code": 24811
},
{
"postal_code": 24816
},
{
"postal_code": 24819
},
{
"postal_code": 24848
},
{
"postal_code": 24850
},
{
"postal_code": 24852
},
{
"postal_code": 24855
},
{
"postal_code": 24857
},
{
"postal_code": 24860
},
{
"postal_code": 24864
},
{
"postal_code": 24878
},
{
"postal_code": 24879
},
{
"postal_code": 24884
},
{
"postal_code": 24888
},
{
"postal_code": 24890
},
{
"postal_code": 24891
},
{
"postal_code": 24894
},
{
"postal_code": 24960
},
{
"postal_code": 24963
},
{
"postal_code": 24969
},
{
"postal_code": 24972
},
{
"postal_code": 24975
},
{
"postal_code": 24977
},
{
"postal_code": 24980
},
{
"postal_code": 24991
},
{
"postal_code": 24992
},
{
"postal_code": 24994
},
{
"postal_code": 24996
},
{
"postal_code": 25335
},
{
"postal_code": 25337
},
{
"postal_code": 25348
},
{
"postal_code": 25355
},
{
"postal_code": 25358
},
{
"postal_code": 25361
},
{
"postal_code": 25364
},
{
"postal_code": 25376
},
{
"postal_code": 25436
},
{
"postal_code": 25474
},
{
"postal_code": 25485
},
{
"postal_code": 25489
},
{
"postal_code": 25524
},
{
"postal_code": 25548
},
{
"postal_code": 25551
},
{
"postal_code": 25554
},
{
"postal_code": 25557
},
{
"postal_code": 25560
},
{
"postal_code": 25563
},
{
"postal_code": 25566
},
{
"postal_code": 25569
},
{
"postal_code": 25572
},
{
"postal_code": 25578
},
{
"postal_code": 25579
},
{
"postal_code": 25581
},
{
"postal_code": 25582
},
{
"postal_code": 25584
},
{
"postal_code": 25585
},
{
"postal_code": 25588
},
{
"postal_code": 25593
},
{
"postal_code": 25594
},
{
"postal_code": 25596
},
{
"postal_code": 25597
},
{
"postal_code": 25693
},
{
"postal_code": 25704
},
{
"postal_code": 25709
},
{
"postal_code": 25712
},
{
"postal_code": 25715
},
{
"postal_code": 25719
},
{
"postal_code": 25724
},
{
"postal_code": 25727
},
{
"postal_code": 25746
},
{
"postal_code": 25761
},
{
"postal_code": 25764
},
{
"postal_code": 25767
},
{
"postal_code": 25770
},
{
"postal_code": 25774
},
{
"postal_code": 25776
},
{
"postal_code": 25779
},
{
"postal_code": 25782
},
{
"postal_code": 25785
},
{
"postal_code": 25788
},
{
"postal_code": 25791
},
{
"postal_code": 25792
},
{
"postal_code": 25794
},
{
"postal_code": 25795
},
{
"postal_code": 25813
},
{
"postal_code": 25821
},
{
"postal_code": 25832
},
{
"postal_code": 25836
},
{
"postal_code": 25840
},
{
"postal_code": 25842
},
{
"postal_code": 25845
},
{
"postal_code": 25850
},
{
"postal_code": 25853
},
{
"postal_code": 25856
},
{
"postal_code": 25860
},
{
"postal_code": 25862
},
{
"postal_code": 25870
},
{
"postal_code": 25872
},
{
"postal_code": 25873
},
{
"postal_code": 25876
},
{
"postal_code": 25878
},
{
"postal_code": 25881
},
{
"postal_code": 25884
},
{
"postal_code": 25885
},
{
"postal_code": 25889
},
{
"postal_code": 25899
},
{
"postal_code": 25917
},
{
"postal_code": 25920
},
{
"postal_code": 25923
},
{
"postal_code": 25924
},
{
"postal_code": 25926
},
{
"postal_code": 25927
},
{
"postal_code": 25938
},
{
"postal_code": 25946
},
{
"postal_code": 26427
},
{
"postal_code": 26487
},
{
"postal_code": 26524
},
{
"postal_code": 26529
},
{
"postal_code": 26556
},
{
"postal_code": 26835
},
{
"postal_code": 26892
},
{
"postal_code": 26897
},
{
"postal_code": 26901
},
{
"postal_code": 26909
},
{
"postal_code": 27243
},
{
"postal_code": 27245
},
{
"postal_code": 27249
},
{
"postal_code": 27251
},
{
"postal_code": 27254
},
{
"postal_code": 27257
},
{
"postal_code": 27259
},
{
"postal_code": 27305
},
{
"postal_code": 27318
},
{
"postal_code": 27321
},
{
"postal_code": 27324
},
{
"postal_code": 27327
},
{
"postal_code": 27333
},
{
"postal_code": 27336
},
{
"postal_code": 27367
},
{
"postal_code": 27386
},
{
"postal_code": 27389
},
{
"postal_code": 27404
},
{
"postal_code": 27412
},
{
"postal_code": 27419
},
{
"postal_code": 27432
},
{
"postal_code": 27446
},
{
"postal_code": 27624
},
{
"postal_code": 27628
},
{
"postal_code": 27632
},
{
"postal_code": 27729
},
{
"postal_code": 28195
},
{
"postal_code": 29303
},
{
"postal_code": 29348
},
{
"postal_code": 29386
},
{
"postal_code": 29413
},
{
"postal_code": 29664
},
{
"postal_code": 29690
},
{
"postal_code": 29693
},
{
"postal_code": 30159
},
{
"postal_code": 31079
},
{
"postal_code": 31195
},
{
"postal_code": 31552
},
{
"postal_code": 31553
},
{
"postal_code": 31559
},
{
"postal_code": 31691
},
{
"postal_code": 31707
},
{
"postal_code": 31867
},
{
"postal_code": 36115
},
{
"postal_code": 36251
},
{
"postal_code": 36404
},
{
"postal_code": 36419
},
{
"postal_code": 36433
},
{
"postal_code": 36452
},
{
"postal_code": 36457
},
{
"postal_code": 36460
},
{
"postal_code": 36466
},
{
"postal_code": 37127
},
{
"postal_code": 37136
},
{
"postal_code": 37194
},
{
"postal_code": 37308
},
{
"postal_code": 37318
},
{
"postal_code": 37339
},
{
"postal_code": 37345
},
{
"postal_code": 37351
},
{
"postal_code": 37355
},
{
"postal_code": 37359
},
{
"postal_code": 37412
},
{
"postal_code": 37434
},
{
"postal_code": 37619
},
{
"postal_code": 37627
},
{
"postal_code": 37632
},
{
"postal_code": 37647
},
{
"postal_code": 37691
},
{
"postal_code": 38170
},
{
"postal_code": 38173
},
{
"postal_code": 38312
},
{
"postal_code": 38315
},
{
"postal_code": 38368
},
{
"postal_code": 38373
},
{
"postal_code": 38486
},
{
"postal_code": 38489
},
{
"postal_code": 38707
},
{
"postal_code": 38729
},
{
"postal_code": 38871
},
{
"postal_code": 39291
},
{
"postal_code": 39326
},
{
"postal_code": 39343
},
{
"postal_code": 39345
},
{
"postal_code": 39365
},
{
"postal_code": 39393
},
{
"postal_code": 39397
},
{
"postal_code": 39435
},
{
"postal_code": 39517
},
{
"postal_code": 39524
},
{
"postal_code": 39579
},
{
"postal_code": 39596
},
{
"postal_code": 39606
},
{
"postal_code": 39615
},
{
"postal_code": 40213
},
{
"postal_code": 42275
},
{
"postal_code": 44135
},
{
"postal_code": 44787
},
{
"postal_code": 45127
},
{
"postal_code": 47051
},
{
"postal_code": 47803
},
{
"postal_code": 48465
},
{
"postal_code": 48480
},
{
"postal_code": 49406
},
{
"postal_code": 49448
},
{
"postal_code": 49453
},
{
"postal_code": 49577
},
{
"postal_code": 49586
},
{
"postal_code": 49626
},
{
"postal_code": 49751
},
{
"postal_code": 49757
},
{
"postal_code": 49762
},
{
"postal_code": 49770
},
{
"postal_code": 49777
},
{
"postal_code": 49779
},
{
"postal_code": 49824
},
{
"postal_code": 49828
},
{
"postal_code": 49832
},
{
"postal_code": 49838
},
{
"postal_code": 49843
},
{
"postal_code": 49847
},
{
"postal_code": 50667
},
{
"postal_code": 52525
},
{
"postal_code": 52538
},
{
"postal_code": 53426
},
{
"postal_code": 53498
},
{
"postal_code": 53505
},
{
"postal_code": 53506
},
{
"postal_code": 53518
},
{
"postal_code": 53520
},
{
"postal_code": 53533
},
{
"postal_code": 53534
},
{
"postal_code": 53539
},
{
"postal_code": 53545
},
{
"postal_code": 53547
},
{
"postal_code": 53567
},
{
"postal_code": 53572
},
{
"postal_code": 54298
},
{
"postal_code": 54310
},
{
"postal_code": 54314
},
{
"postal_code": 54316
},
{
"postal_code": 54317
},
{
"postal_code": 54331
},
{
"postal_code": 54338
},
{
"postal_code": 54340
},
{
"postal_code": 54411
},
{
"postal_code": 54413
},
{
"postal_code": 54421
},
{
"postal_code": 54422
},
{
"postal_code": 54424
},
{
"postal_code": 54426
},
{
"postal_code": 54429
},
{
"postal_code": 54439
},
{
"postal_code": 54441
},
{
"postal_code": 54456
},
{
"postal_code": 54470
},
{
"postal_code": 54472
},
{
"postal_code": 54492
},
{
"postal_code": 54497
},
{
"postal_code": 54516
},
{
"postal_code": 54518
},
{
"postal_code": 54523
},
{
"postal_code": 54531
},
{
"postal_code": 54533
},
{
"postal_code": 54534
},
{
"postal_code": 54538
},
{
"postal_code": 54552
},
{
"postal_code": 54558
},
{
"postal_code": 54570
},
{
"postal_code": 54574
},
{
"postal_code": 54576
},
{
"postal_code": 54578
},
{
"postal_code": 54584
},
{
"postal_code": 54587
},
{
"postal_code": 54589
},
{
"postal_code": 54595
},
{
"postal_code": 54597
},
{
"postal_code": 54608
},
{
"postal_code": 54611
},
{
"postal_code": 54612
},
{
"postal_code": 54614
},
{
"postal_code": 54617
},
{
"postal_code": 54619
},
{
"postal_code": 54634
},
{
"postal_code": 54636
},
{
"postal_code": 54646
},
{
"postal_code": 54647
},
{
"postal_code": 54649
},
{
"postal_code": 54655
},
{
"postal_code": 54657
},
{
"postal_code": 54662
},
{
"postal_code": 54664
},
{
"postal_code": 54668
},
{
"postal_code": 54673
},
{
"postal_code": 54675
},
{
"postal_code": 54689
},
{
"postal_code": 55232
},
{
"postal_code": 55234
},
{
"postal_code": 55237
},
{
"postal_code": 55270
},
{
"postal_code": 55276
},
{
"postal_code": 55278
},
{
"postal_code": 55286
},
{
"postal_code": 55288
},
{
"postal_code": 55296
},
{
"postal_code": 55422
},
{
"postal_code": 55430
},
{
"postal_code": 55432
},
{
"postal_code": 55437
},
{
"postal_code": 55442
},
{
"postal_code": 55444
},
{
"postal_code": 55452
},
{
"postal_code": 55457
},
{
"postal_code": 55459
},
{
"postal_code": 55469
},
{
"postal_code": 55471
},
{
"postal_code": 55481
},
{
"postal_code": 55483
},
{
"postal_code": 55487
},
{
"postal_code": 55490
},
{
"postal_code": 55491
},
{
"postal_code": 55494
},
{
"postal_code": 55497
},
{
"postal_code": 55546
},
{
"postal_code": 55566
},
{
"postal_code": 55568
},
{
"postal_code": 55569
},
{
"postal_code": 55576
},
{
"postal_code": 55578
},
{
"postal_code": 55585
},
{
"postal_code": 55592
},
{
"postal_code": 55595
},
{
"postal_code": 55596
},
{
"postal_code": 55597
},
{
"postal_code": 55599
},
{
"postal_code": 55606
},
{
"postal_code": 55608
},
{
"postal_code": 55624
},
{
"postal_code": 55627
},
{
"postal_code": 55629
},
{
"postal_code": 55743
},
{
"postal_code": 55758
},
{
"postal_code": 55765
},
{
"postal_code": 55767
},
{
"postal_code": 55776
},
{
"postal_code": 55777
},
{
"postal_code": 55779
},
{
"postal_code": 56132
},
{
"postal_code": 56179
},
{
"postal_code": 56206
},
{
"postal_code": 56220
},
{
"postal_code": 56235
},
{
"postal_code": 56237
},
{
"postal_code": 56242
},
{
"postal_code": 56244
},
{
"postal_code": 56254
},
{
"postal_code": 56269
},
{
"postal_code": 56271
},
{
"postal_code": 56276
},
{
"postal_code": 56281
},
{
"postal_code": 56283
},
{
"postal_code": 56288
},
{
"postal_code": 56290
},
{
"postal_code": 56291
},
{
"postal_code": 56294
},
{
"postal_code": 56295
},
{
"postal_code": 56305
},
{
"postal_code": 56307
},
{
"postal_code": 56316
},
{
"postal_code": 56317
},
{
"postal_code": 56321
},
{
"postal_code": 56332
},
{
"postal_code": 56337
},
{
"postal_code": 56340
},
{
"postal_code": 56341
},
{
"postal_code": 56346
},
{
"postal_code": 56348
},
{
"postal_code": 56355
},
{
"postal_code": 56357
},
{
"postal_code": 56368
},
{
"postal_code": 56370
},
{
"postal_code": 56377
},
{
"postal_code": 56379
},
{
"postal_code": 56412
},
{
"postal_code": 56414
},
{
"postal_code": 56424
},
{
"postal_code": 56457
},
{
"postal_code": 56459
},
{
"postal_code": 56472
},
{
"postal_code": 56477
},
{
"postal_code": 56479
},
{
"postal_code": 56579
},
{
"postal_code": 56581
},
{
"postal_code": 56584
},
{
"postal_code": 56587
},
{
"postal_code": 56589
},
{
"postal_code": 56593
},
{
"postal_code": 56598
},
{
"postal_code": 56651
},
{
"postal_code": 56653
},
{
"postal_code": 56727
},
{
"postal_code": 56729
},
{
"postal_code": 56743
},
{
"postal_code": 56745
},
{
"postal_code": 56746
},
{
"postal_code": 56751
},
{
"postal_code": 56753
},
{
"postal_code": 56754
},
{
"postal_code": 56759
},
{
"postal_code": 56761
},
{
"postal_code": 56766
},
{
"postal_code": 56767
},
{
"postal_code": 56769
},
{
"postal_code": 56812
},
{
"postal_code": 56814
},
{
"postal_code": 56820
},
{
"postal_code": 56825
},
{
"postal_code": 56826
},
{
"postal_code": 56829
},
{
"postal_code": 56843
},
{
"postal_code": 56850
},
{
"postal_code": 56858
},
{
"postal_code": 56859
},
{
"postal_code": 56865
},
{
"postal_code": 57518
},
{
"postal_code": 57520
},
{
"postal_code": 57537
},
{
"postal_code": 57539
},
{
"postal_code": 57555
},
{
"postal_code": 57572
},
{
"postal_code": 57577
},
{
"postal_code": 57580
},
{
"postal_code": 57583
},
{
"postal_code": 57584
},
{
"postal_code": 57589
},
{
"postal_code": 57610
},
{
"postal_code": 57612
},
{
"postal_code": 57614
},
{
"postal_code": 57627
},
{
"postal_code": 57629
},
{
"postal_code": 57632
},
{
"postal_code": 57635
},
{
"postal_code": 57636
},
{
"postal_code": 57638
},
{
"postal_code": 57639
},
{
"postal_code": 57644
},
{
"postal_code": 57647
},
{
"postal_code": 57648
},
{
"postal_code": 59969
},
{
"postal_code": 60311
},
{
"postal_code": 63825
},
{
"postal_code": 63924
},
{
"postal_code": 65391
},
{
"postal_code": 65510
},
{
"postal_code": 65558
},
{
"postal_code": 65582
},
{
"postal_code": 65623
},
{
"postal_code": 66484
},
{
"postal_code": 66500
},
{
"postal_code": 66501
},
{
"postal_code": 66851
},
{
"postal_code": 66869
},
{
"postal_code": 66871
},
{
"postal_code": 66879
},
{
"postal_code": 66885
},
{
"postal_code": 66887
},
{
"postal_code": 66894
},
{
"postal_code": 66903
},
{
"postal_code": 66904
},
{
"postal_code": 66907
},
{
"postal_code": 66909
},
{
"postal_code": 66916
},
{
"postal_code": 66917
},
{
"postal_code": 66919
},
{
"postal_code": 66957
},
{
"postal_code": 66978
},
{
"postal_code": 66989
},
{
"postal_code": 66996
},
{
"postal_code": 67229
},
{
"postal_code": 67259
},
{
"postal_code": 67271
},
{
"postal_code": 67273
},
{
"postal_code": 67280
},
{
"postal_code": 67281
},
{
"postal_code": 67294
},
{
"postal_code": 67304
},
{
"postal_code": 67308
},
{
"postal_code": 67468
},
{
"postal_code": 67482
},
{
"postal_code": 67483
},
{
"postal_code": 67487
},
{
"postal_code": 67591
},
{
"postal_code": 67593
},
{
"postal_code": 67596
},
{
"postal_code": 67681
},
{
"postal_code": 67685
},
{
"postal_code": 67693
},
{
"postal_code": 67699
},
{
"postal_code": 67705
},
{
"postal_code": 67724
},
{
"postal_code": 67725
},
{
"postal_code": 67734
},
{
"postal_code": 67737
},
{
"postal_code": 67742
},
{
"postal_code": 67744
},
{
"postal_code": 67746
},
{
"postal_code": 67749
},
{
"postal_code": 67752
},
{
"postal_code": 67753
},
{
"postal_code": 67756
},
{
"postal_code": 67759
},
{
"postal_code": 67806
},
{
"postal_code": 67808
},
{
"postal_code": 67813
},
{
"postal_code": 67814
},
{
"postal_code": 67816
},
{
"postal_code": 67821
},
{
"postal_code": 67822
},
{
"postal_code": 67823
},
{
"postal_code": 67829
},
{
"postal_code": 68723
},
{
"postal_code": 69434
},
{
"postal_code": 70173
},
{
"postal_code": 71711
},
{
"postal_code": 73345
},
{
"postal_code": 73569
},
{
"postal_code": 74653
},
{
"postal_code": 76744
},
{
"postal_code": 76829
},
{
"postal_code": 76831
},
{
"postal_code": 76833
},
{
"postal_code": 76835
},
{
"postal_code": 76848
},
{
"postal_code": 76857
},
{
"postal_code": 76863
},
{
"postal_code": 76865
},
{
"postal_code": 76872
},
{
"postal_code": 76879
},
{
"postal_code": 76887
},
{
"postal_code": 76889
},
{
"postal_code": 76891
},
{
"postal_code": 77709
},
{
"postal_code": 77716
},
{
"postal_code": 78564
},
{
"postal_code": 79194
},
{
"postal_code": 79215
},
{
"postal_code": 79677
},
{
"postal_code": 79837
},
{
"postal_code": 80331
},
{
"postal_code": 82152
},
{
"postal_code": 82386
},
{
"postal_code": 82418
},
{
"postal_code": 83224
},
{
"postal_code": 83329
},
{
"postal_code": 83471
},
{
"postal_code": 83527
},
{
"postal_code": 83646
},
{
"postal_code": 83677
},
{
"postal_code": 84175
},
{
"postal_code": 84326
},
{
"postal_code": 84367
},
{
"postal_code": 84416
},
{
"postal_code": 84419
},
{
"postal_code": 84431
},
{
"postal_code": 84494
},
{
"postal_code": 84513
},
{
"postal_code": 84533
},
{
"postal_code": 84539
},
{
"postal_code": 84558
},
{
"postal_code": 84567
},
{
"postal_code": 85235
},
{
"postal_code": 85276
},
{
"postal_code": 85368
},
{
"postal_code": 85395
},
{
"postal_code": 85567
},
{
"postal_code": 85570
},
{
"postal_code": 85625
},
{
"postal_code": 86447
},
{
"postal_code": 86465
},
{
"postal_code": 86480
},
{
"postal_code": 86507
},
{
"postal_code": 86637
},
{
"postal_code": 86653
},
{
"postal_code": 86695
},
{
"postal_code": 86707
},
{
"postal_code": 86735
},
{
"postal_code": 86836
},
{
"postal_code": 87527
},
{
"postal_code": 87538
},
{
"postal_code": 87616
},
{
"postal_code": 87634
},
{
"postal_code": 87637
},
{
"postal_code": 87647
},
{
"postal_code": 87662
},
{
"postal_code": 87675
},
{
"postal_code": 87742
},
{
"postal_code": 88131
},
{
"postal_code": 88138
},
{
"postal_code": 88145
},
{
"postal_code": 88167
},
{
"postal_code": 88255
},
{
"postal_code": 88348
},
{
"postal_code": 88361
},
{
"postal_code": 88379
},
{
"postal_code": 88416
},
{
"postal_code": 88422
},
{
"postal_code": 88499
},
{
"postal_code": 88605
},
{
"postal_code": 88637
},
{
"postal_code": 88709
},
{
"postal_code": 89129
},
{
"postal_code": 89177
},
{
"postal_code": 89183
},
{
"postal_code": 89426
},
{
"postal_code": 89584
},
{
"postal_code": 89597
},
{
"postal_code": 89611
},
{
"postal_code": 89613
},
{
"postal_code": 90403
},
{
"postal_code": 90556
},
{
"postal_code": 90562
},
{
"postal_code": 90587
},
{
"postal_code": 91077
},
{
"postal_code": 91080
},
{
"postal_code": 91126
},
{
"postal_code": 91235
},
{
"postal_code": 91238
},
{
"postal_code": 91583
},
{
"postal_code": 91790
},
{
"postal_code": 92331
},
{
"postal_code": 92637
},
{
"postal_code": 92665
},
{
"postal_code": 92676
},
{
"postal_code": 92699
},
{
"postal_code": 92723
},
{
"postal_code": 93104
},
{
"postal_code": 93164
},
{
"postal_code": 93183
},
{
"postal_code": 93354
},
{
"postal_code": 94094
},
{
"postal_code": 94104
},
{
"postal_code": 94227
},
{
"postal_code": 94239
},
{
"postal_code": 94244
},
{
"postal_code": 94330
},
{
"postal_code": 94336
},
{
"postal_code": 94342
},
{
"postal_code": 94501
},
{
"postal_code": 94551
},
{
"postal_code": 95183
},
{
"postal_code": 95339
},
{
"postal_code": 95466
},
{
"postal_code": 95473
},
{
"postal_code": 95517
},
{
"postal_code": 95519
},
{
"postal_code": 95666
},
{
"postal_code": 96126
},
{
"postal_code": 96170
},
{
"postal_code": 96257
},
{
"postal_code": 96358
},
{
"postal_code": 96515
},
{
"postal_code": 96523
},
{
"postal_code": 96524
},
{
"postal_code": 96528
},
{
"postal_code": 97215
},
{
"postal_code": 97241
},
{
"postal_code": 97255
},
{
"postal_code": 97258
},
{
"postal_code": 97285
},
{
"postal_code": 97286
},
{
"postal_code": 97292
},
{
"postal_code": 97318
},
{
"postal_code": 97320
},
{
"postal_code": 97334
},
{
"postal_code": 97340
},
{
"postal_code": 97342
},
{
"postal_code": 97348
},
{
"postal_code": 97355
},
{
"postal_code": 97447
},
{
"postal_code": 97616
},
{
"postal_code": 97618
},
{
"postal_code": 97633
},
{
"postal_code": 97640
},
{
"postal_code": 97647
},
{
"postal_code": 97711
},
{
"postal_code": 97717
},
{
"postal_code": 98530
},
{
"postal_code": 98547
},
{
"postal_code": 98553
},
{
"postal_code": 98559
},
{
"postal_code": 98587
},
{
"postal_code": 98590
},
{
"postal_code": 98597
},
{
"postal_code": 98617
},
{
"postal_code": 98634
},
{
"postal_code": 98639
},
{
"postal_code": 98646
},
{
"postal_code": 98660
},
{
"postal_code": 98663
},
{
"postal_code": 98673
},
{
"postal_code": 98693
},
{
"postal_code": 98701
},
{
"postal_code": 98704
},
{
"postal_code": 98708
},
{
"postal_code": 98711
},
{
"postal_code": 98716
},
{
"postal_code": 98724
},
{
"postal_code": 98739
},
{
"postal_code": 98744
},
{
"postal_code": 98746
},
{
"postal_code": 99100
},
{
"postal_code": 99102
},
{
"postal_code": 99189
},
{
"postal_code": 99192
},
{
"postal_code": 99195
},
{
"postal_code": 99198
},
{
"postal_code": 99310
},
{
"postal_code": 99326
},
{
"postal_code": 99330
},
{
"postal_code": 99334
},
{
"postal_code": 99338
},
{
"postal_code": 99428
},
{
"postal_code": 99438
},
{
"postal_code": 99439
},
{
"postal_code": 99441
},
{
"postal_code": 99448
},
{
"postal_code": 99510
},
{
"postal_code": 99518
},
{
"postal_code": 99610
},
{
"postal_code": 99625
},
{
"postal_code": 99628
},
{
"postal_code": 99631
},
{
"postal_code": 99634
},
{
"postal_code": 99636
},
{
"postal_code": 99638
},
{
"postal_code": 99706
},
{
"postal_code": 99713
},
{
"postal_code": 99718
},
{
"postal_code": 99735
},
{
"postal_code": 99752
},
{
"postal_code": 99755
},
{
"postal_code": 99759
},
{
"postal_code": 99762
},
{
"postal_code": 99765
},
{
"postal_code": 99819
},
{
"postal_code": 99826
},
{
"postal_code": 99831
},
{
"postal_code": 99837
},
{
"postal_code": 99869
},
{
"postal_code": 99880
},
{
"postal_code": 99885
},
{
"postal_code": 99887
},
{
"postal_code": 99891
},
{
"postal_code": 99894
},
{
"postal_code": 99947
},
{
"postal_code": 99955
},
{
"postal_code": 99958
},
{
"postal_code": 99974
},
{
"postal_code": 99976
},
{
"postal_code": 99986
},
{
"postal_code": 99991
},
{
"postal_code": 99994
},
{
"postal_code": 99996
},
{
"postal_code": 99998
},
{
"postal_code": 14641
},
{
"postal_code": 14715
},
{
"postal_code": 14913
},
{
"postal_code": 16230
},
{
"postal_code": 19273
},
{
"postal_code": 22929
}
];
var count = postal_codes.length;
postal_codes.forEach(function(postal_code) {
app.models.PostalCode.create(postal_code, function(err, model) {
if (err) throw err;
console.log('Created:', model);
count--;
if (count === 0)
ds.disconnect();
});
});
}); |
require('./test.jpg');
require('./test.png');
require('./test.svg');
|
this.cloudopacity = 0.0;
this.dataopacity = 1;
function createEarth() {
var geometry = new THREE.SphereGeometry(1, 32, 32)
var material = new THREE.MeshPhongMaterial({
map : THREE.ImageUtils.loadTexture('img/earthmap1k.jpg'),
bumpMap : THREE.ImageUtils.loadTexture('img/earthbump1k.jpg'),
bumpScale : 0.05,
})
var mesh = new THREE.Mesh(geometry, material)
return mesh;
}
function createPoints() {
points = new THREE.Mesh(this._baseGeometry, new THREE.MeshBasicMaterial({
color: 0xffffff,
vertexColors: THREE.FaceColors,
morphTargets: false
}));
points.dynamic = true;
return points;
}
//var canvasTexture;
function addCanvasOverlay() {
var spGeo = new THREE.SphereGeometry(1.02,32,32);
var canvasTexture = new THREE.Texture($('#maincanvas')[0]);
canvasTexture.needsUpdate = true;
var material = new THREE.MeshBasicMaterial({
map : canvasTexture,
transparent : true,
opacity: 1
});
var mesh = new THREE.Mesh(spGeo,material);
mesh.dynamic = true;
mesh.rotation.x = -2 * Math.PI / 180;
return mesh;
}
function createEarthCloud(){
// create destination canvas
var canvasResult = document.createElement('canvas')
canvasResult.width = 1024
canvasResult.height = 512
var contextResult = canvasResult.getContext('2d')
// load earthcloudmap
var imageMap = new Image();
imageMap.addEventListener("load", function() {
// create dataMap ImageData for earthcloudmap1
var canvasMap = document.createElement('canvas')
canvasMap.width = imageMap.width
canvasMap.height= imageMap.height
var contextMap = canvasMap.getContext('2d')
contextMap.drawImage(imageMap, 0, 0)
var dataMap = contextMap.getImageData(0, 0, canvasMap.width, canvasMap.height)
// load earthcloudmaptrans
var imageTrans = new Image();
imageTrans.addEventListener("load", function(){
// create dataTrans ImageData for earthcloudmaptrans
var canvasTrans = document.createElement('canvas')
canvasTrans.width = imageTrans.width
canvasTrans.height = imageTrans.height
var contextTrans = canvasTrans.getContext('2d')
contextTrans.drawImage(imageTrans, 0, 0)
var dataTrans = contextTrans.getImageData(0, 0, canvasTrans.width, canvasTrans.height)
// merge dataMap + dataTrans into dataResult
var dataResult = contextMap.createImageData(canvasMap.width, canvasMap.height)
for(var y = 0, offset = 0; y < imageMap.height; y++){
for(var x = 0; x < imageMap.width; x++, offset += 4){
dataResult.data[offset+0] = dataMap.data[offset+0]
dataResult.data[offset+1] = dataMap.data[offset+1]
dataResult.data[offset+2] = dataMap.data[offset+2]
dataResult.data[offset+3] = 255 - dataTrans.data[offset+0]
}
}
// update texture with result
contextResult.putImageData(dataResult,0,0)
material.map.needsUpdate = true;
})
imageTrans.src = 'img/earthcloudmaptrans.jpg';
}, false);
imageMap.src = 'img/earthcloudmap.jpg';
var geometry = new THREE.SphereGeometry(1.02, 32, 32)
var material = new THREE.MeshPhongMaterial({
map : new THREE.Texture(canvasResult),
side : THREE.DoubleSide,
transparent : true,
opacity : this.cloudopacity,
})
var mesh = new THREE.Mesh(geometry, material)
return mesh;
}
function createStarfield(){
var texture = THREE.ImageUtils.loadTexture('img/starfield.png')
var material = new THREE.MeshBasicMaterial({
map : texture,
side : THREE.BackSide
})
var geometry = new THREE.SphereGeometry(225, 32, 32)
var mesh = new THREE.Mesh(geometry, material)
return mesh
}
|
/**
@module ember
@submodule ember-handlebars-compiler
*/
// Eliminate dependency on any Ember to simplify precompilation workflow
var objectCreate = Object.create || function(parent) {
function F() {}
F.prototype = parent;
return new F();
};
var Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);
if(!Handlebars && typeof require === 'function') {
Handlebars = require('handlebars');
}
Ember.assert("Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.", Handlebars && Handlebars.COMPILER_REVISION === 2);
/**
Prepares the Handlebars templating library for use inside Ember's view
system.
The `Ember.Handlebars` object is the standard Handlebars library, extended to
use Ember's `get()` method instead of direct property access, which allows
computed properties to be used inside templates.
To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.
This will return a function that can be used by `Ember.View` for rendering.
@class Handlebars
@namespace Ember
*/
Ember.Handlebars = objectCreate(Handlebars);
function makeBindings(options) {
var hash = options.hash,
hashType = options.hashTypes;
for (var prop in hash) {
if (hashType[prop] === 'ID') {
hash[prop + 'Binding'] = hash[prop];
hashType[prop + 'Binding'] = 'STRING';
delete hash[prop];
delete hashType[prop];
}
}
}
Ember.Handlebars.helper = function(name, value) {
if (Ember.View.detect(value)) {
Ember.Handlebars.registerHelper(name, function(options) {
Ember.assert("You can only pass attributes as parameters to a application-defined helper", arguments.length < 3);
makeBindings(options);
return Ember.Handlebars.helpers.view.call(this, value, options);
});
} else {
Ember.Handlebars.registerBoundHelper.apply(null, arguments);
}
}
/**
@class helpers
@namespace Ember.Handlebars
*/
Ember.Handlebars.helpers = objectCreate(Handlebars.helpers);
/**
Override the the opcode compiler and JavaScript compiler for Handlebars.
@class Compiler
@namespace Ember.Handlebars
@private
@constructor
*/
Ember.Handlebars.Compiler = function() {};
// Handlebars.Compiler doesn't exist in runtime-only
if (Handlebars.Compiler) {
Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);
}
Ember.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;
/**
@class JavaScriptCompiler
@namespace Ember.Handlebars
@private
@constructor
*/
Ember.Handlebars.JavaScriptCompiler = function() {};
// Handlebars.JavaScriptCompiler doesn't exist in runtime-only
if (Handlebars.JavaScriptCompiler) {
Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);
Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;
}
Ember.Handlebars.JavaScriptCompiler.prototype.namespace = "Ember.Handlebars";
Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {
return "''";
};
/**
@private
Override the default buffer for Ember Handlebars. By default, Handlebars
creates an empty String at the beginning of each invocation and appends to
it. Ember's Handlebars overrides this to append to a single shared buffer.
@method appendToBuffer
@param string {String}
*/
Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {
return "data.buffer.push("+string+");";
};
var prefix = "ember" + (+new Date()), incr = 1;
/**
@private
Rewrite simple mustaches from `{{foo}}` to `{{bind "foo"}}`. This means that
all simple mustaches in Ember's Handlebars will also set up an observer to
keep the DOM up to date when the underlying property changes.
@method mustache
@for Ember.Handlebars.Compiler
@param mustache
*/
Ember.Handlebars.Compiler.prototype.mustache = function(mustache) {
if (mustache.isHelper && mustache.id.string === 'control') {
mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);
mustache.hash.pairs.push(["controlID", new Handlebars.AST.StringNode(prefix + incr++)]);
} else if (mustache.params.length || mustache.hash) {
// no changes required
} else {
var id = new Handlebars.AST.IdNode(['_triageMustache']);
// Update the mustache node to include a hash value indicating whether the original node
// was escaped. This will allow us to properly escape values when the underlying value
// changes and we need to re-render the value.
if(!mustache.escaped) {
mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);
mustache.hash.pairs.push(["unescaped", new Handlebars.AST.StringNode("true")]);
}
mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);
}
return Handlebars.Compiler.prototype.mustache.call(this, mustache);
};
/**
Used for precompilation of Ember Handlebars templates. This will not be used
during normal app execution.
@method precompile
@for Ember.Handlebars
@static
@param {String} string The template to precompile
*/
Ember.Handlebars.precompile = function(string) {
var ast = Handlebars.parse(string);
var options = {
knownHelpers: {
action: true,
unbound: true,
bindAttr: true,
template: true,
view: true,
_triageMustache: true
},
data: true,
stringParams: true
};
var environment = new Ember.Handlebars.Compiler().compile(ast, options);
return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
};
// We don't support this for Handlebars runtime-only
if (Handlebars.compile) {
/**
The entry point for Ember Handlebars. This replaces the default
`Handlebars.compile` and turns on template-local data and String
parameters.
@method compile
@for Ember.Handlebars
@static
@param {String} string The template to compile
@return {Function}
*/
Ember.Handlebars.compile = function(string) {
var ast = Handlebars.parse(string);
var options = { data: true, stringParams: true };
var environment = new Ember.Handlebars.Compiler().compile(ast, options);
var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
return Ember.Handlebars.template(templateSpec);
};
}
|
import Ember from 'ember';
const { computed, get } = Ember;
export default Ember.Controller.extend({
selectedColor: '',
colors: 5,
hues: 5,
halfHues: computed('hues', function() {
return Math.round(get(this, 'hues') / 2);
})
});
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* Magento server linked service.
*
* @extends models['LinkedService']
*/
class MagentoLinkedService extends models['LinkedService'] {
/**
* Create a MagentoLinkedService.
* @member {object} host The URL of the Magento instance. (i.e.
* 192.168.222.110/magento3)
* @member {object} [accessToken] The access token from Magento.
* @member {string} [accessToken.type] Polymorphic Discriminator
* @member {object} [useEncryptedEndpoints] Specifies whether the data source
* endpoints are encrypted using HTTPS. The default value is true.
* @member {object} [useHostVerification] Specifies whether to require the
* host name in the server's certificate to match the host name of the server
* when connecting over SSL. The default value is true.
* @member {object} [usePeerVerification] Specifies whether to verify the
* identity of the server when connecting over SSL. The default value is
* true.
* @member {object} [encryptedCredential] The encrypted credential used for
* authentication. Credentials are encrypted using the integration runtime
* credential manager. Type: string (or Expression with resultType string).
*/
constructor() {
super();
}
/**
* Defines the metadata of MagentoLinkedService
*
* @returns {object} metadata of MagentoLinkedService
*
*/
mapper() {
return {
required: false,
serializedName: 'Magento',
type: {
name: 'Composite',
className: 'MagentoLinkedService',
modelProperties: {
connectVia: {
required: false,
serializedName: 'connectVia',
type: {
name: 'Composite',
className: 'IntegrationRuntimeReference'
}
},
description: {
required: false,
serializedName: 'description',
type: {
name: 'String'
}
},
type: {
required: true,
serializedName: 'type',
type: {
name: 'String'
}
},
host: {
required: true,
serializedName: 'typeProperties.host',
type: {
name: 'Object'
}
},
accessToken: {
required: false,
serializedName: 'typeProperties.accessToken',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'type',
clientName: 'type'
},
uberParent: 'SecretBase',
className: 'SecretBase'
}
},
useEncryptedEndpoints: {
required: false,
serializedName: 'typeProperties.useEncryptedEndpoints',
type: {
name: 'Object'
}
},
useHostVerification: {
required: false,
serializedName: 'typeProperties.useHostVerification',
type: {
name: 'Object'
}
},
usePeerVerification: {
required: false,
serializedName: 'typeProperties.usePeerVerification',
type: {
name: 'Object'
}
},
encryptedCredential: {
required: false,
serializedName: 'typeProperties.encryptedCredential',
type: {
name: 'Object'
}
}
}
}
};
}
}
module.exports = MagentoLinkedService;
|
import { extend } from 'flarum/extend';
import AdminNav from 'flarum/components/AdminNav';
import AdminLinkButton from 'flarum/components/AdminLinkButton';
import ImageUploadPage from 'flagrow/image-upload/components/ImageUploadPage';
export default function() {
// create the route
app.routes['image-upload'] = {path: '/image-upload', component: ImageUploadPage.component()};
// bind the route we created to the three dots settings button
app.extensionSettings['flagrow-image-upload'] = () => m.route(app.route('image-upload'));
extend(AdminNav.prototype, 'items', items => {
// add the Image Upload tab to the admin navigation menu
items.add('image-upload', AdminLinkButton.component({
href: app.route('image-upload'),
icon: 'picture-o',
children: 'Image Upload',
description: app.translator.trans('flagrow-image-upload.admin.help_texts.description')
}));
});
}
|
import Ember from "ember-metal/core";
import {dasherize} from "ember-runtime/system/string";
module('EmberStringUtils.dasherize');
if (!Ember.EXTEND_PROTOTYPES && !Ember.EXTEND_PROTOTYPES.String) {
test("String.prototype.dasherize is not modified without EXTEND_PROTOTYPES", function() {
ok("undefined" === typeof String.prototype.dasherize, 'String.prototype helper disabled');
});
}
test("dasherize normal string", function() {
deepEqual(dasherize('my favorite items'), 'my-favorite-items');
if (Ember.EXTEND_PROTOTYPES) {
deepEqual('my favorite items'.dasherize(), 'my-favorite-items');
}
});
test("does nothing with dasherized string", function() {
deepEqual(dasherize('css-class-name'), 'css-class-name');
if (Ember.EXTEND_PROTOTYPES) {
deepEqual('css-class-name'.dasherize(), 'css-class-name');
}
});
test("dasherize underscored string", function() {
deepEqual(dasherize('action_name'), 'action-name');
if (Ember.EXTEND_PROTOTYPES) {
deepEqual('action_name'.dasherize(), 'action-name');
}
});
test("dasherize camelcased string", function() {
deepEqual(dasherize('innerHTML'), 'inner-html');
if (Ember.EXTEND_PROTOTYPES) {
deepEqual('innerHTML'.dasherize(), 'inner-html');
}
});
test("dasherize string that is the property name of Object.prototype", function() {
deepEqual(dasherize('toString'), 'to-string');
if (Ember.EXTEND_PROTOTYPES) {
deepEqual('toString'.dasherize(), 'to-string');
}
});
|
// JavaScript Document
/*------------------------------------------------------------------------*/
function showcataloghierarchical(catalogmasterid){
var POSTDATA="action=getallcatalogvalues&catalogmasterid="+encodeURIComponent(catalogmasterid);
callservicebyajax(POSTDATA,"service/catalogserver.php",function(){showcataloghierarchicalresponse(catalogmasterid)});
}
/*------------------------------------------------------------------------*/
function showcataloghierarchicalresponse(catalogmasterid){
$('#catalogvaluestr_'+catalogmasterid).toggle().html(ajaxResponse);
$('#anchorcataloghierarchical_'+catalogmasterid).toggleClass('glyphicon-plus glyphicon-minus');
$("#anchorcataloghierarchical_"+catalogmasterid).attr("onClick","hidecatalogmasterhierarchical("+catalogmasterid+")");
}
/*------------------------------------------------------------------------*/
function hidecatalogmasterhierarchical(catalogmasterid)
{
$('#anchorcataloghierarchical_'+catalogmasterid).toggleClass('glyphicon-plus glyphicon-minus');;
$('#anchorcataloghierarchical_'+catalogmasterid).attr("onClick","showcataloghierarchical("+catalogmasterid+")");
$('#catalogvaluestr_'+catalogmasterid).toggle();
$('#applicacatalogvaluestr_ntstr_'+catalogmasterid).html("");
}
/*------------------------------------------------------------------------*/
function showmngcatalogpaging(page){
if(!page&& page!=0)
page = parseInt($("#catalogmastertable").attr("page"));
var searchObj = getcatalogsearchcriteria();
getallcatalogmasters(page,searchObj);
}
/*----------------------------------------------------------------*/
function searchcatalogs(page)
{
if(!page && page!=0)
page = parseInt($("#catalogmastertable").attr("page"));
var searchObj = getcatalogsearchcriteria();
if(searchObj!=null)
getallcatalogmasters(page,searchObj);
else{
notifyDanger("Empty search is not allowed");
}
}
/*----------------------------------------------------------------*/
function getallcatalogmasters(page,searchCriteria){
var rows=$('#rows').val();
if(rows=='' || rows==null)
rows=20;
searchobj=JSON.stringify(searchCriteria);
var POSTDATA="action=showmngcatalogpaging&searchObj="+encodeURIComponent(searchobj)+"&page="+encodeURIComponent(page)+"&rows="+encodeURIComponent(rows);
$('#loading').html("<img src=\"loader.gif\">");
callservicebyajax(POSTDATA,"service/catalogserver.php",function(){savedataresponse()});
}
/*----------------------------------------------------------------*/
function getcatalogsearchcriteria()
{
var searchCriteria={};
var catalogmasterid= $("#catalogmasterid").val();
var catalogmastername= $("#catalogmastername").val();
var description= $("#description").val();
var code= $("#mastercode").val();
if(catalogmasterid && (catalogmasterid!="" && catalogmasterid!=null))
searchCriteria.catalogmasterid=parseInt(trim(catalogmasterid));
if(catalogmastername && (catalogmastername!="" && catalogmastername!=null))
searchCriteria.catalogmastername=trim(catalogmastername);
if(description && (description!="" && description!=null))
searchCriteria.description=trim(description);
if(code && (code!="" && code!=null))
searchCriteria.code=trim(code);
if(!$.isEmptyObject(searchCriteria))
return searchCriteria;
else
return null;
}
/*------------------------------------------------------------------------*/
function SaveCatalogList(){
catalogmasterid=$('#catalogmasterid').val();
catalogmastername=$('#catalogmastername').val();
description=$('#description').val();
if((addedcatalogs.length>0 || removedcatalogs.length>0 || enabledcatalogs.length>0 || disabledcatalogs.length>0) && catalogmastername ){
var POSTDATA="action=savecatalogvalues&catalogmasterid="+encodeURIComponent(catalogmasterid)+"&catalogmastername="+encodeURIComponent(catalogmastername)
+"&description="+encodeURIComponent(description);
if(addedcatalogs.length>0) POSTDATA+="&addedcatalogs="+encodeURIComponent(JSON.stringify(addedcatalogs));
if(removedcatalogs.length>0) POSTDATA+="&removedcatalogs="+encodeURIComponent(removedcatalogs);
if(enabledcatalogs.length>0) POSTDATA+="&enabledcatalogs="+encodeURIComponent(enabledcatalogs);
if(disabledcatalogs.length>0) POSTDATA+="&disabledcatalogs="+encodeURIComponent(disabledcatalogs);
$('#loading').html("<img src=\"loader.gif\">");
callservicebyajax(POSTDATA,"service/catalogserver.php",function(){savedataresponse(refreshCatalogGrid)}) ;
}
else{
notifyDanger("Invalid Catalog MasterName/Changes is not valid to save");
}
}
/*------------------------------------------------------------------------*/
function loadcatalogchilds(){
masterid=$('#catalogvalueparent').val();
if(masterid){
var POSTDATA="action=getallCatalogValuesNamesForDropDown&catalogmasterid="+encodeURIComponent(masterid);
callservicebyajax(POSTDATA,"service/catalogserver.php",function(){
$("#childcatalogs").html(ajaxResponse);
});
}
}
/*------------------------------------------------------------------------*/
var addedcatalogs=[];
var removedcatalogs=[];
var enabledcatalogs=[];
var disabledcatalogs=[];
var did=0;
function addcatalogtolist(){
values=$('#catalogvalue').val();
code=$('#catalogcode').val();
parentname='';
parent=$('#childcatalogs').val();
if(parent) parentname=$("#childcatalogs :selected").text();
if(values){
valuearray=values.split(',');
$.each(valuearray,function(i){
if($('tr[catalogname="'+$.trim(valuearray[i])+'"]').length<=0){
catalogvaluename=$.trim(valuearray[i]);
dummy=++did;
obj={};
obj.catalogvaluename=catalogvaluename; //persistent data
obj.code= $.trim(code); //persistent data
obj.parentid= $.trim(parent); //persistent data
obj.trid="dummyid_"+dummy; // required to delete tr on client add
addedcatalogs.push(obj);
$('#catalogvaluelist tbody').append('<tr id="dummyid_'+ dummy +'" catalogname="'+catalogvaluename+'"><td><input type="checkbox" name="selectCatalogValue" trid="dummyid_'+dummy+'"/></td><td>'+catalogvaluename+'</td><td>'
+$.trim(parentname)+'</td><td><a href="#" onclick=removecatalogvalue("dummyid_'+dummy+'"); class="btn btn-default btn-default-inverse btn-sm"><i class="glyphicon glyphicon-remove-sign white"></i></a></td></tr>');
}
});
$('#catalogvalue').html('');
notifyInfo("New catalog values updated in the list");
notifyInfo("Please click Apply All Changes for permanant changes");
}
else{
notifyDanger("Empty catalogs can not be updated");
}
}
function refreshCatalogGrid(){
addedcatalogs=[];
removedcatalogs=[];
enabledcatalogs=[];
disabledcatalogs=[];
getcontents('pages/configs/catalogs/allcatalogs.php','content');
}
/*------------------------------------------------------------------------*/
function removecatalogvalue(trid){
catalogvalueid=$("#"+trid).attr("catalogvalueid")
if(catalogvalueid)
removedcatalogs.push(catalogvalueid);
else{
Cleanunsaveditem(trid,"trid");
}
$("#"+trid).remove();
}
function enableSelectedCatalogvalues(chkboxname){
enabledcatalogs=[];
pushselectedItemsToArray(enabledcatalogs,chkboxname);
notifyInfo(enabledcatalogs.length+ " Catalogs selected to Enable");
}
function disableSelectedCatalogvalues(chkboxname){
disabledcatalogs=[];
pushselectedItemsToArray(disabledcatalogs,chkboxname);
notifyInfo(disabledcatalogs.length+ " Catalogs selected to Disable");
}
function pushselectedItemsToArray(container, controlName){
$('[name='+controlName+']:checked').each(function() {
catalogid=$(this).attr('catalogvalueid');
if(catalogid){
container.push(catalogid);
}
});
}
/*------------------------------------------------------------------------*/
function Cleanunsaveditem(value,property) {
len = addedcatalogs.length;
for (var i = 0; i < len; i++){
if (addedcatalogs[i][property] === value) {
addedcatalogs.splice(i,1);
return
}
}
}
function selectallcatalogvalues(parentname,chkboxname){
selectchildcheckboxes(parentname,chkboxname);
}
function removeAllCatalogvalues(chkboxname){
//Get All count to get user confirmation
chackedvalues=pushcheckedvaluetoarray(chkboxname);
if(chackedvalues && chackedvalues.length>0)
var isConfirmed=confirm("Are you sure want to delete selected catalog values.?");
if(!isConfirmed)
return;
//Select all checked checkbox and remove one by one
$('[name='+chkboxname+']:checked').each(function() {
catalogid=$(this).attr('catalogvalueid');
trid='';
//To remove existing catalog
if(catalogid){
removedcatalogs.push(catalogid);
trid='dummy_'+catalogid;
}
//To remove newly added catalog
else{
trid=$(this).attr("trid");
Cleanunsaveditem(trid,"trid");
}
$("#"+trid).remove();
});
notifyInfo(removedcatalogs.length+ " Catalogs selected to Delete");
}
/*------------------------------------------------------------------------*/ |
/*
* Globalize Culture se-SE
*
* http://github.com/jquery/globalize
*
* Copyright Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* This file was generated by the Globalize Culture Generator
* Translation: bugs found in this file need to be fixed in the generator
*/
(function( window, undefined ) {
var Globalize;
if ( typeof require !== "undefined"
&& typeof exports !== "undefined"
&& typeof module !== "undefined" ) {
// Assume CommonJS
Globalize = require( "globalize" );
} else {
// Global variable
Globalize = window.Globalize;
}
Globalize.addCultureInfo( "se-SE", "default", {
name: "se-SE",
englishName: "Sami, Northern (Sweden)",
nativeName: "davvisámegiella (Ruoŧŧa)",
language: "se",
numberFormat: {
",": " ",
".": ",",
percent: {
",": " ",
".": ","
},
currency: {
pattern: ["-n $","n $"],
",": ".",
".": ",",
symbol: "kr"
}
},
calendars: {
standard: {
"/": "-",
firstDay: 1,
days: {
names: ["sotnabeaivi","mánnodat","disdat","gaskavahkku","duorastat","bearjadat","lávvardat"],
namesAbbr: ["sotn","mán","dis","gask","duor","bear","láv"],
namesShort: ["s","m","d","g","d","b","l"]
},
months: {
names: ["ođđajagemánnu","guovvamánnu","njukčamánnu","cuoŋománnu","miessemánnu","geassemánnu","suoidnemánnu","borgemánnu","čakčamánnu","golggotmánnu","skábmamánnu","juovlamánnu",""],
namesAbbr: ["ođđj","guov","njuk","cuo","mies","geas","suoi","borg","čakč","golg","skáb","juov",""]
},
monthsGenitive: {
names: ["ođđajagimánu","guovvamánu","njukčamánu","cuoŋománu","miessemánu","geassemánu","suoidnemánu","borgemánu","čakčamánu","golggotmánu","skábmamánu","juovlamánu",""],
namesAbbr: ["ođđj","guov","njuk","cuo","mies","geas","suoi","borg","čakč","golg","skáb","juov",""]
},
AM: null,
PM: null,
patterns: {
d: "yyyy-MM-dd",
D: "MMMM d'. b. 'yyyy",
t: "HH:mm",
T: "HH:mm:ss",
f: "MMMM d'. b. 'yyyy HH:mm",
F: "MMMM d'. b. 'yyyy HH:mm:ss",
M: "MMMM d'. b. '",
Y: "MMMM yyyy"
}
}
}
});
}( this ));
|
var webpack = require('webpack')
var license = require('./license.js')
module.exports = {
context: __dirname,
entry: [
'./src/synaptic.js'
],
output: {
path: 'dist',
filename: 'synaptic.js',
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.BannerPlugin(license())
]
}
|
export function formatCurrency(valueInMilliDollars, hideSymbol) {
const {
currencyFormatter,
} = ynab.YNABSharedLibWebInstance.firstInstanceCreated.formattingManager;
const userCurrency = currencyFormatter.getCurrency();
let formattedCurrency = currencyFormatter.format(valueInMilliDollars).toString();
if (hideSymbol === true) return formattedCurrency;
if (userCurrency.display_symbol) {
if (userCurrency.symbol_first) {
if (formattedCurrency.charAt(0) === '-') {
formattedCurrency = `-${userCurrency.currency_symbol}${formattedCurrency.slice(1)}`;
} else {
formattedCurrency = `${userCurrency.currency_symbol}${formattedCurrency}`;
}
} else {
formattedCurrency = `${formattedCurrency}${userCurrency.currency_symbol}`;
}
}
return formattedCurrency;
}
export function stripCurrency(formattedCurrencyText) {
const {
currencyFormatter,
} = ynab.YNABSharedLibWebInstance.firstInstanceCreated.formattingManager;
const numberInDollars = currencyFormatter.unformat(formattedCurrencyText);
return currencyFormatter.convertToMilliDollars(numberInDollars);
}
|
// Retrieve information about screen size, displays, cursor position, etc.
//
// For more info, see:
// https://electronjs.org/docs/api/screen
const { app, BrowserWindow } = require('electron')
let mainWindow = null
app.whenReady().then(() => {
// We cannot require the screen module until the app is ready.
const { screen } = require('electron')
// Create a window that fills the screen's available work area.
const primaryDisplay = screen.getPrimaryDisplay()
const { width, height } = primaryDisplay.workAreaSize
mainWindow = new BrowserWindow({ width, height })
mainWindow.loadURL('https://electronjs.org')
})
|
var buildings = {};
buildings.db = [];
function Building(name, types, price_ratio, price_resource, multiplying_formula, base_rate, text) {
this.name = name;
this.types = types; // [] of: simple, upgradable, maintainable
this.price_ratio = price_ratio;
this.price_resource = price_resource;
this.multiplying_formula = multiplying_formula; // function() { return (1 + (Player[this.multiplying_skill] / 60); }
this.base_rate = base_rate;
this.text = text;
this.workers = 0;
this.level = 0;
this.increase = function() {
if (Player.volunteers < 1) {
message('Not enough free volunteers');
} else if (this.workers + 1 > Civilization.updates.teamwork.level) {
message('Not enough teamwork');
} else {
Player.volunteers--;
this.workers++;
draw_all();
}
};
this.decrease = function() {
if (this.workers >= 1) {
Player.volunteers++;
this.workers--;
draw_all();
// message('One volunteer from the Department of ' + this.name + ' was released.');
}
else {
message('Not enough volunteers in department');
}
};
this.upgrade = function() {
if (Player.withdrawArray(this.getUpgradeCost())) {
this.level++;
draw_all();
}
};
this.getUpgradeCost = function() {
var cost = {};
// console.log(this.price_resource, this.base_rate, this.level, this.price_ratio)
cost[this.price_resource] = this.base_rate * (1 + Math.pow(this.level, this.price_ratio));
return cost;
};
this.getEfficiency = function() {
return Civilization.getHappiness() * this.workers * (1 + (0.1 * this.level)) * this.multiplying_formula();
};
this.getProductivity = function() {
var adjustment = 10 / 60 / 60;
// console.log(this.name, rate, adjustment);
return this.getEfficiency() * this.base_rate * adjustment;
};
return this;
} |
(function (Prism) {
// https://freemarker.apache.org/docs/dgui_template_exp.html
// FTL expression with 4 levels of nesting supported
var FTL_EXPR = /[^<()"']|\((?:<expr>)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source;
for (var i = 0; i < 2; i++) {
FTL_EXPR = FTL_EXPR.replace(/<expr>/g, function () { return FTL_EXPR; });
}
FTL_EXPR = FTL_EXPR.replace(/<expr>/g, /[^\s\S]/.source);
var ftl = {
'comment': /<#--[\s\S]*?-->/,
'string': [
{
// raw string
pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/,
greedy: true
},
{
pattern: RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:<expr>))*\})*\1/.source.replace(/<expr>/g, function () { return FTL_EXPR; })),
greedy: true,
inside: {
'interpolation': {
pattern: RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:<expr>))*\}/.source.replace(/<expr>/g, function () { return FTL_EXPR; })),
lookbehind: true,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{|\}$/,
alias: 'punctuation'
},
rest: null
}
}
}
}
],
'keyword': /\b(?:as)\b/,
'boolean': /\b(?:true|false)\b/,
'builtin-function': {
pattern: /((?:^|[^?])\?\s*)\w+/,
lookbehind: true,
alias: 'function'
},
'function': /\b\w+(?=\s*\()/,
'number': /\b\d+(?:\.\d+)?\b/,
'operator': /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
'punctuation': /[,;.:()[\]{}]/
};
ftl.string[1].inside.interpolation.inside.rest = ftl;
Prism.languages.ftl = {
'ftl-comment': {
// the pattern is shortened to be more efficient
pattern: /^<#--[\s\S]*/,
alias: 'comment'
},
'ftl-directive': {
pattern: /^<[\s\S]+>$/,
inside: {
'directive': {
pattern: /(^<\/?)[#@][a-z]\w*/i,
lookbehind: true,
alias: 'keyword'
},
'punctuation': /^<\/?|\/?>$/,
'content': {
pattern: /\s*\S[\s\S]*/,
alias: 'ftl',
inside: ftl
}
}
},
'ftl-interpolation': {
pattern: /^\$\{[\s\S]*\}$/,
inside: {
'punctuation': /^\$\{|\}$/,
'content': {
pattern: /\s*\S[\s\S]*/,
alias: 'ftl',
inside: ftl
}
}
}
};
Prism.hooks.add('before-tokenize', function (env) {
var pattern = RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(/<expr>/g, function () { return FTL_EXPR; }), 'gi');
Prism.languages['markup-templating'].buildPlaceholders(env, 'ftl', pattern);
});
Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ftl');
});
}(Prism));
|
import * as React from 'react';
import ApiPage from 'docs/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './portal.json';
export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}
Page.getInitialProps = () => {
const req = require.context('docs/translations/api-docs/portal', false, /portal.*.json$/);
const descriptions = mapApiPageTranslations(req);
return {
descriptions,
pageContent: jsonPageContent,
};
};
|
/**
* Copyright (c) 2015-present, goreutils
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
|
/*
*
* https://github.com/fatlinesofcode/ngDraggable
*/
/* jshint ignore:start */
angular.module("ngDraggable", [])
.directive('ngDrag', ['$rootScope', '$parse', '$document', '$window', function($rootScope, $parse, $document, $window) {
return {
restrict: 'A',
scope: true,
link: function(scope, element, attrs) {
scope.value = attrs.ngDrag;
var offset, _centerAnchor = false,
_mx, _my, _tx, _ty, _mrx, _mry;
var _hasTouch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
var _pressEvents = 'touchstart mousedown';
var _moveEvents = 'touchmove mousemove';
var _releaseEvents = 'touchend mouseup';
// to identify the element in order to prevent getting superflous events when a single element has both drag and drop directives on it.
var _myid = scope.$id;
var _data = null;
var _dragEnabled = false;
var _pressTimer = null;
var onDragSuccessCallback = $parse(attrs.ngDragSuccess) || null;
var initialize = function() {
element.attr('draggable', 'false'); // prevent native drag
toggleListeners(true);
};
// this same func is in ngDrop, it needs to be DRYed up but don't know if its
// worth writing a service (or equivalent) for one function
var _privoffset = function(docElem) {
var box = {
top: 0,
left: 0
};
if (typeof docElem[0].getBoundingClientRect !== undefined) {
box = docElem[0].getBoundingClientRect();
}
return {
top: box.top + $window.pageYOffset - docElem[0].clientTop,
left: box.left + $window.pageXOffset - docElem[0].clientLeft
};
}
var toggleListeners = function(enable) {
if (!enable) return;
// add listeners.
scope.$on('$destroy', onDestroy);
scope.$watch(attrs.ngDrag, onEnableChange);
scope.$watch(attrs.ngCenterAnchor, onCenterAnchor);
scope.$watch(attrs.ngDragData, onDragDataChange);
element.on(_pressEvents, onpress);
if (!_hasTouch && element[0].nodeName.toLowerCase() == "img") {
element.on('mousedown', function() {
return false;
}); // prevent native drag for images
}
};
var onDestroy = function(enable) {
toggleListeners(false);
};
var onDragDataChange = function(newVal, oldVal) {
_data = newVal;
};
var onEnableChange = function(newVal, oldVal) {
_dragEnabled = (newVal);
};
var onCenterAnchor = function(newVal, oldVal) {
if (angular.isDefined(newVal))
_centerAnchor = (newVal || 'true');
}
var isClickableElement = function(evt) {
return (
angular.isDefined(angular.element(evt.target).attr("ng-click")) || angular.isDefined(angular.element(evt.target).attr("ng-dblclick")) || angular.isDefined(angular.element(evt.target).attr("ng-cancel-drag"))
);
}
// var isDragHandle = function (evt) {
// return !(angular.element(evt.target).closest("[ng-drag-handle]").length > 0);
// }
var isDragHandle = function(evt) {
var attr = angular.element(evt.target).attr("ng-drag-handle");
return (typeof attr !== typeof undefined && attr !== false);
}
/*
* When the element is clicked start the drag behaviour
* On touch devices as a small delay so as not to prevent native window scrolling
*/
var onpress = function(evt) {
if (!_dragEnabled || !isDragHandle(evt)) return;
if (evt.type == "mousedown" && evt.button !== 0) return;
element.css('width', element.width() + 'px');
// disable drag on clickable element
// if (isClickableElement(evt) || !isDragHandle(evt)) {
// return;
// }
if (_hasTouch) {
cancelPress();
_pressTimer = setTimeout(function() {
cancelPress();
onlongpress(evt);
}, 100);
$document.on(_moveEvents, cancelPress);
$document.on(_releaseEvents, cancelPress);
} else {
onlongpress(evt);
}
}
var cancelPress = function() {
clearTimeout(_pressTimer);
$document.off(_moveEvents, cancelPress);
$document.off(_releaseEvents, cancelPress);
}
var onlongpress = function(evt) {
if (!_dragEnabled) return;
evt.preventDefault();
element.addClass('dragging');
offset = _privoffset(element);
element.centerX = element[0].offsetWidth / 2;
element.centerY = element[0].offsetHeight / 2;
_mx = (evt.pageX || evt.touches[0].pageX);
_my = (evt.pageY || evt.touches[0].pageY);
_mrx = _mx - offset.left;
_mry = _my - offset.top;
if (_centerAnchor) {
_tx = _mx - element.centerX - $window.pageXOffset;
_ty = _my - element.centerY - $window.pageYOffset;
} else {
_tx = _mx - _mrx - $window.pageXOffset;
_ty = _my - _mry - $window.pageYOffset;
}
$document.on(_moveEvents, onmove);
$document.on(_releaseEvents, onrelease);
$rootScope.$broadcast('draggable:start', {
x: _mx,
y: _my,
tx: _tx,
ty: _ty,
event: evt,
element: element,
data: _data
});
}
var onmove = function(evt) {
if (!_dragEnabled) return;
evt.preventDefault();
_mx = (evt.pageX || evt.touches[0].pageX);
_my = (evt.pageY || evt.touches[0].pageY);
if (_centerAnchor) {
_tx = _mx - element.centerX - $window.pageXOffset;
_ty = _my - element.centerY - $window.pageYOffset;
} else {
_tx = _mx - _mrx - $window.pageXOffset;
_ty = _my - _mry - $window.pageYOffset;
}
moveElement(_tx, _ty);
$rootScope.$broadcast('draggable:move', {
x: _mx,
y: _my,
tx: _tx,
ty: _ty,
event: evt,
element: element,
data: _data,
uid: _myid
});
}
var onrelease = function(evt) {
if (!_dragEnabled)
return;
evt.preventDefault();
$rootScope.$broadcast('draggable:end', {
x: _mx,
y: _my,
tx: _tx,
ty: _ty,
event: evt,
element: element,
data: _data,
callback: onDragComplete,
uid: _myid
});
element.removeClass('dragging');
reset();
$document.off(_moveEvents, onmove);
$document.off(_releaseEvents, onrelease);
}
var onDragComplete = function(evt) {
if (!onDragSuccessCallback) return;
scope.$apply(function() {
onDragSuccessCallback(scope, {
$data: _data,
$event: evt
});
});
}
var reset = function() {
element.css({
left: '',
top: '',
position: '',
'z-index': '',
margin: ''
});
}
var moveElement = function(x, y) {
element.css({
left: (x + 'px'),
top: (y + 'px'),
position: 'fixed',
'z-index': 99999
//,margin: '0' don't monkey with the margin,
});
}
initialize();
}
}
}])
.directive('ngDrop', ['$parse', '$timeout', '$window', function($parse, $timeout, $window) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
scope.value = attrs.ngDrop;
var _myid = scope.$id;
var _dropEnabled = false;
var onDropCallback = ($parse(attrs.ngDropSuccess) == angular.noop) ? function(scope, obj) {
element.find('.drag-placeholder').after(obj.$event.element);
obj.$event.element.show();
} : $parse(attrs.ngDropSuccess);
var initialize = function() {
toggleListeners(true);
};
var toggleListeners = function(enable) {
// remove listeners
if (!enable) return;
// add listeners.
attrs.$observe("ngDrop", onEnableChange);
scope.$on('$destroy', onDestroy);
//scope.$watch(attrs.uiDraggable, onDraggableChange);
scope.$on('draggable:start', onDragStart);
scope.$on('draggable:move', onDragMove);
scope.$on('draggable:end', onDragEnd);
};
// this same func is in ngDrag, it needs to be DRYed up but don't know if its
// worth writing a service (or equivalent) for one function
var _privoffset = function(docElem) {
var box = {
top: 0,
left: 0
};
if (typeof docElem[0].getBoundingClientRect !== undefined) {
box = docElem[0].getBoundingClientRect();
}
return {
top: box.top + $window.pageYOffset - docElem[0].clientTop,
left: box.left + $window.pageXOffset - docElem[0].clientLeft
};
}
var onDestroy = function(enable) {
toggleListeners(false);
};
var onEnableChange = function(newVal, oldVal) {
_dropEnabled = scope.$eval(newVal);
}
var onDragStart = function(evt, obj) {
if (!_dropEnabled) return;
$('.drag-placeholder').show();
if (isTouching(obj.x, obj.y, obj.element)) {
obj.element.css({
position: 'fixed',
top: obj.ty + 'px',
left: obj.tx + 'px'
});
if (element.find('.drag-placeholder').length < 1) {
var dragPlaceholder = $('<div class="drag-placeholder"></div>').css({
height: obj.element.innerHeight() + 'px',
width: '100%'
});
$(obj.element).after(dragPlaceholder);
}
}
}
var onDragMove = function(evt, obj) {
if (!_dropEnabled) return;
if (isTouching(obj.x, obj.y, obj.element)) {
if (element.find('.drag-placeholder').length < 1) {
var dragPlaceholder = $('<div class="drag-placeholder"></div>').css({
height: obj.element.innerHeight() + 'px',
width: '100%'
});
$(element).append(dragPlaceholder);
}
element.find('[ng-drag]:not(.dragging)').each(function() {
if (hitTestElement(obj.x, obj.y, $(this))) {
// $(this).css('border', '1px solid blue');
if (($(this).offset().top + $(this).height() / 2) < obj.y) {
// $(this).css('border', '1px solid red');
// element.find('.drag-placeholder').before(this);
$(this).after(element.find('.drag-placeholder'));
} else {
// element.find('.drag-placeholder').after(this);
$(this).before(element.find('.drag-placeholder'));
}
// else
}
})
} else {
if (element.find('.drag-placeholder').length > 0) {
element.find('.drag-placeholder').remove();
}
}
}
var onDragEnd = function(evt, obj) {
// don't listen to drop events if this is the element being dragged
if (!_dropEnabled || _myid === obj.uid) return;
$('.drag-placeholder').hide();
obj.element.css('width', '');
if (isTouching(obj.x, obj.y, obj.element)) {
obj.element.hide();
// call the ngDraggable ngDragSuccess element callback
if (obj.callback) {
obj.callback(obj);
}
$timeout(function() {
onDropCallback(scope, {
$data: obj.data,
$event: obj
});
$('.drag-placeholder').remove();
});
}
updateDragStyles(false, obj.element);
}
var isTouching = function(mouseX, mouseY, dragElement) {
var touching = hitTest(mouseX, mouseY);
updateDragStyles(touching, dragElement);
return touching;
}
var updateDragStyles = function(touching, dragElement) {
if (touching) {
element.addClass('drag-enter');
dragElement.addClass('drag-over');
} else {
element.removeClass('drag-enter');
dragElement.removeClass('drag-over');
}
}
var hitTest = function(x, y) {
var bounds = _privoffset(element);
bounds.right = bounds.left + element[0].offsetWidth;
bounds.bottom = bounds.top + element[0].offsetHeight;
return x >= bounds.left && x <= bounds.right && y <= bounds.bottom && y >= bounds.top;
}
var hitTestElement = function(x, y, element) {
var bounds = _privoffset(element);
bounds.right = bounds.left + element[0].offsetWidth;
bounds.bottom = bounds.top + element[0].offsetHeight;
return x >= bounds.left && x <= bounds.right && y <= bounds.bottom && y >= bounds.top;
}
initialize();
}
}
}])
.directive('ngDragClone', ['$parse', '$timeout', function($parse, $timeout) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var img, _allowClone = true;
scope.clonedData = {};
var initialize = function() {
img = element.find('img');
element.attr('draggable', 'false');
img.attr('draggable', 'false');
reset();
toggleListeners(true);
};
var toggleListeners = function(enable) {
// remove listeners
if (!enable) return;
// add listeners.
scope.$on('draggable:start', onDragStart);
scope.$on('draggable:move', onDragMove);
scope.$on('draggable:end', onDragEnd);
preventContextMenu();
};
var preventContextMenu = function() {
// element.off('mousedown touchstart touchmove touchend touchcancel', absorbEvent_);
img.off('mousedown touchstart touchmove touchend touchcancel', absorbEvent_);
// element.on('mousedown touchstart touchmove touchend touchcancel', absorbEvent_);
img.on('mousedown touchstart touchmove touchend touchcancel', absorbEvent_);
}
var onDragStart = function(evt, obj, elm) {
_allowClone = true
if (angular.isDefined(obj.data.allowClone)) {
_allowClone = obj.data.allowClone;
}
if (_allowClone) {
scope.$apply(function() {
scope.clonedData = obj.data;
});
element.css('width', obj.element[0].offsetWidth);
element.css('height', obj.element[0].offsetHeight);
moveElement(obj.tx, obj.ty);
}
}
var onDragMove = function(evt, obj) {
if (_allowClone) {
moveElement(obj.tx, obj.ty);
}
}
var onDragEnd = function(evt, obj) {
//moveElement(obj.tx,obj.ty);
if (_allowClone) {
reset();
}
}
var reset = function() {
element.css({
left: 0,
top: 0,
position: 'fixed',
'z-index': -1,
visibility: 'hidden'
});
}
var moveElement = function(x, y) {
element.css({
left: (x + 'px'),
top: (y + 'px'),
position: 'fixed',
'z-index': 99999,
'visibility': 'visible'
//,margin: '0' don't monkey with the margin,
});
}
var absorbEvent_ = function(event) {
var e = event.originalEvent;
e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
e.cancelBubble = true;
e.returnValue = false;
return false;
}
initialize();
}
}
}])
.directive('ngPreventDrag', ['$parse', '$timeout', function($parse, $timeout) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var initialize = function() {
element.attr('draggable', 'false');
toggleListeners(true);
};
var toggleListeners = function(enable) {
// remove listeners
if (!enable) return;
// add listeners.
element.on('mousedown touchstart touchmove touchend touchcancel', absorbEvent_);
};
var absorbEvent_ = function(event) {
var e = event.originalEvent;
e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
e.cancelBubble = true;
e.returnValue = false;
return false;
}
initialize();
}
}
}])
.directive('ngCancelDrag', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.find('*').attr('ng-cancel-drag', 'ng-cancel-drag');
}
}
}]);
/* jshint ignore:end */ |
var StatementKind = {
PROPOSITION: 0,
NEGATION: 1,
AND: 2,
OR: 3,
IMPLIES: 4
}
Polymer({
is: 'marklogic-play',
properties: {
answers: Array,
premises: Array,
selectedAnswer: Object,
isCorrect: Boolean,
formattedPremises: {
type: Array,
readOnly: true,
notify: true
},
formattedAnswers: {
type: Array,
readOnly: true,
notify: true
},
guess: {
type: Array,
readOnly: true,
notify: true
},
answeredCorrectly: {
type: Boolean,
readOnly: true,
notify: true
},
hasAnswered: {
type: Boolean,
readOnly: true,
notify: true
}
},
observers: [
'onAnswers(answers)',
'onPremises(premises)',
'onIsCorrect(isCorrect)'
],
onAnswers: function() {
this.notifyPath('formattedAnswers', formatAnswers(this.answers))
},
onPremises: function() {
function formatStatement(statement) {
switch (statement.kind) {
case StatementKind.PROPOSITION:
return statement.proposition
case StatementKind.NEGATION:
return '! (' + formatStatement(statement.a) + ')'
case StatementKind.AND:
return formatStatement(statement.a) + ' & ' + formatStatement(statement.b)
case StatementKind.OR:
return formatStatement(statement.a) + ' | ' + formatStatement(statement.b)
case StatementKind.IMPLIES:
return formatStatement(statement.a) + ' => ' + formatStatement(statement.b)
}
}
this.notifyPath('formattedPremises', this.premises.map(formatStatement))
},
onIsCorrect: function() {
if (this.isCorrect) {
this.notifyPath('answeredCorrectly', true)
} else {
this.notifyPath('answeredIncorrectly', true)
}
},
submit: function() {
this.notifyPath('hasAnswered', true)
this.notifyPath('guess', [this.selectedAnswer.id])
}
})
|
// taken from https://github.com/remy/polyfills and modified
define(function() {
"use strict";
var toggle = function(token, force) {
if (typeof force === 'boolean') {
this[force ? 'add' : 'remove'](token);
} else {
this[!this.contains(token) ? 'add' : 'remove'](token);
}
return this.contains(token);
};
if (window.DOMTokenList) {
var a = document.createElement('a');
a.classList.toggle('x', false);
if (a.className) {
window.DOMTokenList.prototype.toggle = toggle;
}
}
if (typeof window.Element === "undefined" || "classList" in document.documentElement) return;
var prototype = Array.prototype,
push = prototype.push,
splice = prototype.splice,
join = prototype.join;
function DOMTokenList(el) {
this.el = el;
// The className needs to be trimmed and split on whitespace
// to retrieve a list of classes.
var classes = el.className.replace(/^\s+|\s+$/g, '').split(/\s+/);
for (var i = 0; i < classes.length; i++) {
push.call(this, classes[i]);
}
}
DOMTokenList.prototype = {
add: function(token) {
if (this.contains(token)) return;
push.call(this, token);
this.el.className = this.toString();
},
contains: function(token) {
return this.el.className.indexOf(token) != -1;
},
item: function(index) {
return this[index] || null;
},
remove: function(token) {
if (!this.contains(token)) return;
for (var i = 0; i < this.length; i++) {
if (this[i] == token) break;
}
splice.call(this, i, 1);
this.el.className = this.toString();
},
toString: function() {
return join.call(this, ' ');
},
toggle: toggle
};
window.DOMTokenList = DOMTokenList;
function defineElementGetter(obj, prop, getter) {
if (Object.defineProperty) {
Object.defineProperty(obj, prop, {
get: getter
});
} else {
obj.__defineGetter__(prop, getter);
}
}
defineElementGetter(Element.prototype, 'classList', function() {
return new DOMTokenList(this);
});
});
|
/****************************************************************************
Copyright (c) 2011-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
/**
* The main class of Armature, it plays armature animation, manages and updates bones' state.
* @class
* @extends ccs.Node
*
* @property {ccs.Bone} parentBone - The parent bone of the armature node
* @property {ccs.ArmatureAnimation} animation - The animation
* @property {ccs.ArmatureData} armatureData - The armature data
* @property {String} name - The name of the armature
* @property {cc.SpriteBatchNode} batchNode - The batch node of the armature
* @property {Number} version - The version
* @property {Object} body - The body of the armature
* @property {ccs.ColliderFilter} colliderFilter - <@writeonly> The collider filter of the armature
*/
ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
animation: null,
armatureData: null,
batchNode: null,
_textureAtlas: null,
_parentBone: null,
_boneDic: null,
_topBoneList: null,
_armatureIndexDic: null,
_offsetPoint: null,
version: 0,
_armatureTransformDirty: true,
_body: null,
_blendFunc: null,
_className: "Armature",
/**
* Create a armature node.
* Constructor of ccs.Armature
* @param {String} name
* @param {ccs.Bone} parentBone
* @example
* var armature = new ccs.Armature();
*/
ctor: function (name, parentBone) {
cc.Node.prototype.ctor.call(this);
this._name = "";
this._topBoneList = [];
this._armatureIndexDic = {};
this._offsetPoint = cc.p(0, 0);
this._armatureTransformDirty = true;
this._blendFunc = {src: cc.BLEND_SRC, dst: cc.BLEND_DST};
name && ccs.Armature.prototype.init.call(this, name, parentBone);
},
/**
* Initializes a CCArmature with the specified name and CCBone
* @param {String} [name]
* @param {ccs.Bone} [parentBone]
* @return {Boolean}
*/
init: function (name, parentBone) {
cc.Node.prototype.init.call(this);
if (parentBone)
this._parentBone = parentBone;
this.removeAllChildren();
this.animation = new ccs.ArmatureAnimation();
this.animation.init(this);
this._boneDic = {};
this._topBoneList.length = 0;
//this._name = name || "";
var armatureDataManager = ccs.armatureDataManager;
var animationData;
if (name !== "") {
//animationData
animationData = armatureDataManager.getAnimationData(name);
cc.assert(animationData, "AnimationData not exist!");
this.animation.setAnimationData(animationData);
//armatureData
var armatureData = armatureDataManager.getArmatureData(name);
cc.assert(armatureData, "ArmatureData not exist!");
this.armatureData = armatureData;
//boneDataDic
var boneDataDic = armatureData.getBoneDataDic();
for (var key in boneDataDic) {
var bone = this.createBone(String(key));
//! init bone's Tween to 1st movement's 1st frame
do {
var movData = animationData.getMovement(animationData.movementNames[0]);
if (!movData) break;
var _movBoneData = movData.getMovementBoneData(bone.getName());
if (!_movBoneData || _movBoneData.frameList.length <= 0) break;
var frameData = _movBoneData.getFrameData(0);
if (!frameData) break;
bone.getTweenData().copy(frameData);
bone.changeDisplayWithIndex(frameData.displayIndex, false);
} while (0);
}
this.update(0);
this.updateOffsetPoint();
} else {
name = "new_armature";
this.armatureData = new ccs.ArmatureData();
this.armatureData.name = name;
animationData = new ccs.AnimationData();
animationData.name = name;
armatureDataManager.addArmatureData(name, this.armatureData);
armatureDataManager.addAnimationData(name, animationData);
this.animation.setAnimationData(animationData);
}
this._renderCmd.initShaderCache();
this.setCascadeOpacityEnabled(true);
this.setCascadeColorEnabled(true);
return true;
},
addChild: function (child, localZOrder, tag) {
if(child instanceof ccui.Widget){
cc.log("Armature doesn't support to add Widget as its child, it will be fix soon.");
return;
}
cc.Node.prototype.addChild.call(this, child, localZOrder, tag);
},
/**
* create a bone with name
* @param {String} boneName
* @return {ccs.Bone}
*/
createBone: function (boneName) {
var existedBone = this.getBone(boneName);
if (existedBone)
return existedBone;
var boneData = this.armatureData.getBoneData(boneName);
var parentName = boneData.parentName;
var bone = null;
if (parentName) {
this.createBone(parentName);
bone = new ccs.Bone(boneName);
this.addBone(bone, parentName);
} else {
bone = new ccs.Bone(boneName);
this.addBone(bone, "");
}
bone.setBoneData(boneData);
bone.getDisplayManager().changeDisplayWithIndex(-1, false);
return bone;
},
/**
* Add a Bone to this Armature
* @param {ccs.Bone} bone The Bone you want to add to Armature
* @param {String} parentName The parent Bone's name you want to add to. If it's null, then set Armature to its parent
*/
addBone: function (bone, parentName) {
cc.assert(bone, "Argument must be non-nil");
var locBoneDic = this._boneDic;
if(bone.getName())
cc.assert(!locBoneDic[bone.getName()], "bone already added. It can't be added again");
if (parentName) {
var boneParent = locBoneDic[parentName];
if (boneParent)
boneParent.addChildBone(bone);
else
this._topBoneList.push(bone);
} else
this._topBoneList.push(bone);
bone.setArmature(this);
locBoneDic[bone.getName()] = bone;
this.addChild(bone);
},
/**
* Remove a bone with the specified name. If recursion it will also remove child Bone recursively.
* @param {ccs.Bone} bone The bone you want to remove
* @param {Boolean} recursion Determine whether remove the bone's child recursion.
*/
removeBone: function (bone, recursion) {
cc.assert(bone, "bone must be added to the bone dictionary!");
bone.setArmature(null);
bone.removeFromParent(recursion);
cc.arrayRemoveObject(this._topBoneList, bone);
delete this._boneDic[bone.getName()];
this.removeChild(bone, true);
},
/**
* Gets a bone with the specified name
* @param {String} name The bone's name you want to get
* @return {ccs.Bone}
*/
getBone: function (name) {
return this._boneDic[name];
},
/**
* Change a bone's parent with the specified parent name.
* @param {ccs.Bone} bone The bone you want to change parent
* @param {String} parentName The new parent's name
*/
changeBoneParent: function (bone, parentName) {
cc.assert(bone, "bone must be added to the bone dictionary!");
var parentBone = bone.getParentBone();
if (parentBone) {
cc.arrayRemoveObject(parentBone.getChildren(), bone);
bone.setParentBone(null);
}
if (parentName) {
var boneParent = this._boneDic[parentName];
if (boneParent) {
boneParent.addChildBone(bone);
cc.arrayRemoveObject(this._topBoneList, bone);
} else
this._topBoneList.push(bone);
}
},
/**
* Get CCArmature's bone dictionary
* @return {Object} Armature's bone dictionary
*/
getBoneDic: function () {
return this._boneDic;
},
/**
* Set contentSize and Calculate anchor point.
*/
updateOffsetPoint: function () {
// Set contentsize and Calculate anchor point.
var rect = this.getBoundingBox();
this.setContentSize(rect);
var locOffsetPoint = this._offsetPoint;
locOffsetPoint.x = -rect.x;
locOffsetPoint.y = -rect.y;
if (rect.width !== 0 && rect.height !== 0)
this.setAnchorPoint(locOffsetPoint.x / rect.width, locOffsetPoint.y / rect.height);
},
getOffsetPoints: function(){
return {x: this._offsetPoint.x, y: this._offsetPoint.y};
},
/**
* Sets animation to this Armature
* @param {ccs.ArmatureAnimation} animation
*/
setAnimation: function (animation) {
this.animation = animation;
},
/**
* Gets the animation of this Armature.
* @return {ccs.ArmatureAnimation}
*/
getAnimation: function () {
return this.animation;
},
/**
* armatureTransformDirty getter
* @returns {Boolean}
*/
getArmatureTransformDirty: function () {
return this._armatureTransformDirty;
},
/**
* The update callback of ccs.Armature, it updates animation's state and updates bone's state.
* @override
* @param {Number} dt
*/
update: function (dt) {
this.animation.update(dt);
var locTopBoneList = this._topBoneList;
for (var i = 0; i < locTopBoneList.length; i++)
locTopBoneList[i].update(dt);
this._armatureTransformDirty = false;
},
/**
* The callback when ccs.Armature enter stage.
* @override
*/
onEnter: function () {
cc.Node.prototype.onEnter.call(this);
this.scheduleUpdate();
},
/**
* The callback when ccs.Armature exit stage.
* @override
*/
onExit: function () {
cc.Node.prototype.onExit.call(this);
this.unscheduleUpdate();
},
/**
* This boundingBox will calculate all bones' boundingBox every time
* @returns {cc.Rect}
*/
getBoundingBox: function(){
var minX, minY, maxX, maxY = 0;
var first = true;
var boundingBox = cc.rect(0, 0, 0, 0), locChildren = this._children;
var len = locChildren.length;
for (var i=0; i<len; i++) {
var bone = locChildren[i];
if (bone) {
var r = bone.getDisplayManager().getBoundingBox();
if (r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0)
continue;
if(first) {
minX = r.x;
minY = r.y;
maxX = r.x + r.width;
maxY = r.y + r.height;
first = false;
} else {
minX = r.x < boundingBox.x ? r.x : boundingBox.x;
minY = r.y < boundingBox.y ? r.y : boundingBox.y;
maxX = r.x + r.width > boundingBox.x + boundingBox.width ?
r.x + r.width : boundingBox.x + boundingBox.width;
maxY = r.y + r.height > boundingBox.y + boundingBox.height ?
r.y + r.height : boundingBox.y + boundingBox.height;
}
boundingBox.x = minX;
boundingBox.y = minY;
boundingBox.width = maxX - minX;
boundingBox.height = maxY - minY;
}
}
return cc.rectApplyAffineTransform(boundingBox, this.getNodeToParentTransform());
},
/**
* when bone contain the point ,then return it.
* @param {Number} x
* @param {Number} y
* @returns {ccs.Bone}
*/
getBoneAtPoint: function (x, y) {
var locChildren = this._children;
for (var i = locChildren.length - 1; i >= 0; i--) {
var child = locChildren[i];
if (child instanceof ccs.Bone && child.getDisplayManager().containPoint(x, y))
return child;
}
return null;
},
/**
* Sets parent bone of this Armature
* @param {ccs.Bone} parentBone
*/
setParentBone: function (parentBone) {
this._parentBone = parentBone;
var locBoneDic = this._boneDic;
for (var key in locBoneDic) {
locBoneDic[key].setArmature(this);
}
},
/**
* Return parent bone of ccs.Armature.
* @returns {ccs.Bone}
*/
getParentBone: function () {
return this._parentBone;
},
/**
* draw contour
*/
drawContour: function () {
cc._drawingUtil.setDrawColor(255, 255, 255, 255);
cc._drawingUtil.setLineWidth(1);
var locBoneDic = this._boneDic;
for (var key in locBoneDic) {
var bone = locBoneDic[key];
var detector = bone.getColliderDetector();
if(!detector)
continue;
var bodyList = detector.getColliderBodyList();
for (var i = 0; i < bodyList.length; i++) {
var body = bodyList[i];
var vertexList = body.getCalculatedVertexList();
cc._drawingUtil.drawPoly(vertexList, vertexList.length, true);
}
}
},
setBody: function (body) {
if (this._body === body)
return;
this._body = body;
this._body.data = this;
var child, displayObject, locChildren = this._children;
for (var i = 0; i < locChildren.length; i++) {
child = locChildren[i];
if (child instanceof ccs.Bone) {
var displayList = child.getDisplayManager().getDecorativeDisplayList();
for (var j = 0; j < displayList.length; j++) {
displayObject = displayList[j];
var detector = displayObject.getColliderDetector();
if (detector)
detector.setBody(this._body);
}
}
}
},
getShapeList: function () {
if (this._body)
return this._body.shapeList;
return null;
},
getBody: function () {
return this._body;
},
/**
* Sets the blendFunc to ccs.Armature
* @param {cc.BlendFunc|Number} blendFunc
* @param {Number} [dst]
*/
setBlendFunc: function (blendFunc, dst) {
if(dst === undefined){
this._blendFunc.src = blendFunc.src;
this._blendFunc.dst = blendFunc.dst;
} else {
this._blendFunc.src = blendFunc;
this._blendFunc.dst = dst;
}
},
/**
* Returns the blendFunc of ccs.Armature
* @returns {cc.BlendFunc}
*/
getBlendFunc: function () {
return new cc.BlendFunc(this._blendFunc.src, this._blendFunc.dst);
},
/**
* set collider filter
* @param {ccs.ColliderFilter} filter
*/
setColliderFilter: function (filter) {
var locBoneDic = this._boneDic;
for (var key in locBoneDic)
locBoneDic[key].setColliderFilter(filter);
},
/**
* Returns the armatureData of ccs.Armature
* @return {ccs.ArmatureData}
*/
getArmatureData: function () {
return this.armatureData;
},
/**
* Sets armatureData to this Armature
* @param {ccs.ArmatureData} armatureData
*/
setArmatureData: function (armatureData) {
this.armatureData = armatureData;
},
getBatchNode: function () {
return this.batchNode;
},
setBatchNode: function (batchNode) {
this.batchNode = batchNode;
},
/**
* version getter
* @returns {Number}
*/
getVersion: function () {
return this.version;
},
/**
* version setter
* @param {Number} version
*/
setVersion: function (version) {
this.version = version;
},
_createRenderCmd: function(){
if(cc._renderType === cc._RENDER_TYPE_CANVAS)
return new ccs.Armature.CanvasRenderCmd(this);
else
return new ccs.Armature.WebGLRenderCmd(this);
}
});
var _p = ccs.Armature.prototype;
/** @expose */
_p.parentBone;
cc.defineGetterSetter(_p, "parentBone", _p.getParentBone, _p.setParentBone);
/** @expose */
_p.body;
cc.defineGetterSetter(_p, "body", _p.getBody, _p.setBody);
/** @expose */
_p.colliderFilter;
cc.defineGetterSetter(_p, "colliderFilter", null, _p.setColliderFilter);
_p = null;
/**
* Allocates an armature, and use the ArmatureData named name in ArmatureDataManager to initializes the armature.
* @param {String} [name] Bone name
* @param {ccs.Bone} [parentBone] the parent bone
* @return {ccs.Armature}
* @deprecated since v3.1, please use new construction instead
*/
ccs.Armature.create = function (name, parentBone) {
return new ccs.Armature(name, parentBone);
};
|
/* YeAPF 0.8.57-15 built on 2017-05-18 18:44 (-3 DST) Copyright (C) 2004-2017 Esteban Daniel Dortta - dortta@yahoo.com */
importScripts("yloader.js");yCommWorker=function(b){var a=b.data;switch(a.cmd){case "start":var c=a.invoker.callbackFunction;a.invoker.callbackFunction=function(b){a.invoker.callbackFunction=c;self.postMessage({cmd:"response",invoker:a.invoker,text:b})};"object"==typeof a.invoker.limits&&(a.invoker.limits._start_=0);ycomm.invoke(a.invoker)}};self.addEventListener("message",yCommWorker,!1);
|
'use strict';
var Pooling = require('generic-pool')
, Promise = require('../../promise')
, _ = require('lodash')
, semver = require('semver')
, defaultPoolingConfig = {
max: 5,
min: 0,
idle: 10000,
handleDisconnects: true
}
, ConnectionManager;
ConnectionManager = function(dialect, sequelize) {
var config = _.cloneDeep(sequelize.config);
this.sequelize = sequelize;
this.config = config;
this.dialect = dialect;
this.versionPromise = null;
this.dialectName = this.sequelize.options.dialect;
if (config.pool) {
config.pool = _.clone(config.pool); // Make sure we don't modify the existing config object (user might re-use it)
config.pool =_.defaults(config.pool, defaultPoolingConfig, {
validate: this.$validate.bind(this)
}) ;
} else {
// If the user has turned off pooling we provide a 0/1 pool for backwards compat
config.pool = _.defaults({
max: 1,
min: 0
}, defaultPoolingConfig, {
validate: this.$validate.bind(this)
});
}
// Map old names
if (config.pool.maxIdleTime) config.pool.idle = config.pool.maxIdleTime;
if (config.pool.maxConnections) config.pool.max = config.pool.maxConnections;
if (config.pool.minConnections) config.pool.min = config.pool.minConnections;
this.onProcessExit = this.onProcessExit.bind(this); // Save a reference to the bound version so we can remove it with removeListener
process.on('exit', this.onProcessExit);
};
ConnectionManager.prototype.refreshTypeParser = function(dataTypes) {
_.each(dataTypes, function (dataType, key) {
if (dataType.hasOwnProperty('parse')) {
var dialectName = this.dialectName;
if (dialectName === 'mariadb') {
dialectName = 'mysql';
}
if (dataType.types[dialectName]) {
this.$refreshTypeParser(dataType);
} else {
throw new Error('Parse function not supported for type ' + dataType.key + ' in dialect ' + this.dialectName);
}
}
}, this);
};
ConnectionManager.prototype.onProcessExit = function() {
var self = this;
if (this.pool) {
this.pool.drain(function() {
self.pool.destroyAllNow();
});
}
};
ConnectionManager.prototype.close = function () {
this.onProcessExit();
process.removeListener('exit', this.onProcessExit); // Remove the listener, so all references to this instance can be garbage collected.
this.getConnection = function () {
return Promise.reject(new Error('ConnectionManager.getConnection was called after the connection manager was closed!'));
};
};
// This cannot happen in the constructor because the user can specify a min. number of connections to have in the pool
// If he does this, generic-pool will try to call connect before the dialect-specific connection manager has been correctly set up
ConnectionManager.prototype.initPools = function () {
var self = this
, config = this.config;
if (!config.replication) {
this.pool = Pooling.Pool({
name: 'sequelize-connection',
create: function(callback) {
self.$connect(config).nodeify(function (err, connection) {
callback(err, connection); // For some reason this is needed, else generic-pool things err is a connection or some shit
});
},
destroy: function(connection) {
self.$disconnect(connection);
return null;
},
max: config.pool.max,
min: config.pool.min,
validate: config.pool.validate,
idleTimeoutMillis: config.pool.idle
});
return;
}
var reads = 0;
if (!Array.isArray(config.replication.read)) {
config.replication.read = [config.replication.read];
}
// Map main connection config
config.replication.write = _.defaults(config.replication.write, _.omit(config, 'replication'));
// Apply defaults to each read config
config.replication.read = _.map(config.replication.read, function(readConfig) {
return _.defaults(readConfig, _.omit(self.config, 'replication'));
});
// I'll make my own pool, with blackjack and hookers! (original credit goes to @janzeh)
this.pool = {
release: function(client) {
if (client.queryType === 'read') {
return self.pool.read.release(client);
} else {
return self.pool.write.release(client);
}
},
acquire: function(callback, priority, queryType, useMaster) {
useMaster = _.isUndefined(useMaster) ? false : useMaster;
if (queryType === 'SELECT' && !useMaster) {
self.pool.read.acquire(callback, priority);
} else {
self.pool.write.acquire(callback, priority);
}
},
destroy: function(connection) {
return self.pool[connection.queryType].destroy(connection);
},
destroyAllNow: function() {
self.pool.read.destroyAllNow();
self.pool.write.destroyAllNow();
},
drain: function(cb) {
self.pool.write.drain(function() {
self.pool.read.drain(cb);
});
},
read: Pooling.Pool({
name: 'sequelize-connection-read',
create: function(callback) {
// Simple round robin config
var nextRead = reads++ % config.replication.read.length;
self.$connect(config.replication.read[nextRead]).tap(function (connection) {
connection.queryType = 'read';
}).nodeify(function (err, connection) {
callback(err, connection); // For some reason this is needed, else generic-pool things err is a connection or some shit
});
},
destroy: function(connection) {
self.$disconnect(connection);
return null;
},
validate: config.pool.validate,
max: config.pool.max,
min: config.pool.min,
idleTimeoutMillis: config.pool.idle
}),
write: Pooling.Pool({
name: 'sequelize-connection-write',
create: function(callback) {
self.$connect(config.replication.write).tap(function (connection) {
connection.queryType = 'write';
}).nodeify(function (err, connection) {
callback(err, connection); // For some reason this is needed, else generic-pool things err is a connection or some shit
});
},
destroy: function(connection) {
self.$disconnect(connection);
return null;
},
validate: config.pool.validate,
max: config.pool.max,
min: config.pool.min,
idleTimeoutMillis: config.pool.idle
})
};
};
ConnectionManager.prototype.getConnection = function(options) {
var self = this;
options = options || {};
var promise;
if (this.sequelize.options.databaseVersion === 0) {
if (this.versionPromise) {
promise = this.versionPromise;
} else {
promise = this.versionPromise = self.$connect(self.config.replication.write || self.config).then(function (connection) {
var _options = {};
_options.transaction = { connection: connection }; // Cheat .query to use our private connection
_options.logging = function () {};
_options.logging.__testLoggingFn = true;
return self.sequelize.databaseVersion(_options).then(function (version) {
self.sequelize.options.databaseVersion = semver.valid(version) ? version : self.defaultVersion;
self.versionPromise = null;
self.$disconnect(connection);
return null;
});
}).catch(function (err) {
self.versionPromise = null;
throw err;
});
}
} else {
promise = Promise.resolve();
}
return promise.then(function () {
return new Promise(function (resolve, reject) {
self.pool.acquire(function(err, connection) {
if (err) return reject(err);
resolve(connection);
}, options.priority, options.type, options.useMaster);
});
});
};
ConnectionManager.prototype.releaseConnection = function(connection) {
var self = this;
return new Promise(function (resolve, reject) {
self.pool.release(connection);
resolve();
});
};
ConnectionManager.prototype.$connect = function(config) {
return this.dialect.connectionManager.connect(config);
};
ConnectionManager.prototype.$disconnect = function(connection) {
return this.dialect.connectionManager.disconnect(connection);
};
ConnectionManager.prototype.$validate = function(connection) {
if (!this.dialect.connectionManager.validate) return Promise.resolve();
return this.dialect.connectionManager.validate(connection);
};
module.exports = ConnectionManager;
|
'use strict';
const chalk = require('chalk');
const format = require('date-fns/format');
exports.log = (options, output) => {
const timestamp = format(new Date(), options.dateFormat);
console.log(chalk.dim(`[${timestamp}]`) + ` ${output}`);
};
|
exports.require = require;
exports.__filename = __filename;
exports.__dirname = __dirname;
exports.module = module;
exports.exports = exports;
|
import test from 'tape';
import getDisplayName from '../getDisplayName';
test('getDisplayName should return String or Component for empty object', assert => {
const mapped = [
{ displayName: 'hey' },
{ name: 'ho' },
{}
].map(getDisplayName);
assert.deepEqual(mapped, ['hey', 'ho', 'Component']);
assert.end();
});
|
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojox.wire.XmlWire"]){
dojo._hasResource["dojox.wire.XmlWire"]=true;
dojo.provide("dojox.wire.XmlWire");
dojo.require("dojox.xml.parser");
dojo.require("dojox.wire.Wire");
dojo.declare("dojox.wire.XmlWire",dojox.wire.Wire,{_wireClass:"dojox.wire.XmlWire",constructor:function(_1){
},_getValue:function(_2){
if(!_2||!this.path){
return _2;
}
var _3=_2;
var _4=this.path;
var i;
if(_4.charAt(0)=="/"){
i=_4.indexOf("/",1);
_4=_4.substring(i+1);
}
var _5=_4.split("/");
var _6=_5.length-1;
for(i=0;i<_6;i++){
_3=this._getChildNode(_3,_5[i]);
if(!_3){
return undefined;
}
}
var _7=this._getNodeValue(_3,_5[_6]);
return _7;
},_setValue:function(_8,_9){
if(!this.path){
return _8;
}
var _a=_8;
var _b=this._getDocument(_a);
var _c=this.path;
var i;
if(_c.charAt(0)=="/"){
i=_c.indexOf("/",1);
if(!_a){
var _d=_c.substring(1,i);
_a=_b.createElement(_d);
_8=_a;
}
_c=_c.substring(i+1);
}else{
if(!_a){
return undefined;
}
}
var _e=_c.split("/");
var _f=_e.length-1;
for(i=0;i<_f;i++){
var _10=this._getChildNode(_a,_e[i]);
if(!_10){
_10=_b.createElement(_e[i]);
_a.appendChild(_10);
}
_a=_10;
}
this._setNodeValue(_a,_e[_f],_9);
return _8;
},_getNodeValue:function(_11,exp){
var _12=undefined;
if(exp.charAt(0)=="@"){
var _13=exp.substring(1);
_12=_11.getAttribute(_13);
}else{
if(exp=="text()"){
var _14=_11.firstChild;
if(_14){
_12=_14.nodeValue;
}
}else{
_12=[];
for(var i=0;i<_11.childNodes.length;i++){
var _15=_11.childNodes[i];
if(_15.nodeType===1&&_15.nodeName==exp){
_12.push(_15);
}
}
}
}
return _12;
},_setNodeValue:function(_16,exp,_17){
if(exp.charAt(0)=="@"){
var _18=exp.substring(1);
if(_17){
_16.setAttribute(_18,_17);
}else{
_16.removeAttribute(_18);
}
}else{
if(exp=="text()"){
while(_16.firstChild){
_16.removeChild(_16.firstChild);
}
if(_17){
var _19=this._getDocument(_16).createTextNode(_17);
_16.appendChild(_19);
}
}
}
},_getChildNode:function(_1a,_1b){
var _1c=1;
var i1=_1b.indexOf("[");
if(i1>=0){
var i2=_1b.indexOf("]");
_1c=_1b.substring(i1+1,i2);
_1b=_1b.substring(0,i1);
}
var _1d=1;
for(var i=0;i<_1a.childNodes.length;i++){
var _1e=_1a.childNodes[i];
if(_1e.nodeType===1&&_1e.nodeName==_1b){
if(_1d==_1c){
return _1e;
}
_1d++;
}
}
return null;
},_getDocument:function(_1f){
if(_1f){
return (_1f.nodeType==9?_1f:_1f.ownerDocument);
}else{
return dojox.xml.parser.parse();
}
}});
}
|
'use strict';
var React = require('react');
var PureRenderMixin = require('react-addons-pure-render-mixin');
var SvgIcon = require('../../svg-icon');
var HardwareMemory = React.createClass({
displayName: 'HardwareMemory',
mixins: [PureRenderMixin],
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.createElement('path', { d: 'M15 9H9v6h6V9zm-2 4h-2v-2h2v2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2h2zm-4 6H7V7h10v10z' })
);
}
});
module.exports = HardwareMemory; |
'use strict'
const multiaddr = require('multiaddr')
function ensureMultiaddr (ma) {
if (multiaddr.isMultiaddr(ma)) {
return ma
}
return multiaddr(ma)
}
module.exports = {
ensureMultiaddr: ensureMultiaddr
}
|
var editorXX={};
editorXX.addCustomLink("");
editorXX.removeCustomLink("");
editorXX.removeCustomStyle("");
editorXX._onSetMode("");
editorXX.addAttrs({},{});
editorXX._onSetElAttrs();
editorXX._onSetElCls();
editorXX._onSetElStyle();
editorXX._onSetElAttrs();
editorXX._onSetElAttrs(); |
const { expect } = require('chai');
const proxyquire = require('proxyquire');
const Packet = require('../../lib/services/utils/ipc/packet');
describe('IPC Packet', () => {
it('Should serialize and parse data', () => {
const originalMessage = Buffer.from('hello world');
let packet = Packet.serialize(originalMessage);
let parsedMessage = Packet.parse(packet);
expect(packet).be.instanceof(Buffer);
expect(parsedMessage.header.head).equal(false);
expect(parsedMessage.header.tail).equal(false);
expect(parsedMessage.header.totalSize).equal(packet.length);
expect(parsedMessage.header.size).equal(packet.length - Packet.HEADER_SIZE);
expect(parsedMessage.data).deep.equal(originalMessage);
packet = Packet.serialize(originalMessage, { head: true });
parsedMessage = Packet.parse(packet);
expect(packet).be.instanceof(Buffer);
expect(parsedMessage.header.head).equal(true);
expect(parsedMessage.header.tail).equal(false);
expect(parsedMessage.header.totalSize).equal(packet.length);
expect(parsedMessage.header.size).equal(packet.length - Packet.HEADER_SIZE);
expect(parsedMessage.data).deep.equal(originalMessage);
packet = Packet.serialize(originalMessage, { tail: true });
parsedMessage = Packet.parse(packet);
expect(packet).be.instanceof(Buffer);
expect(parsedMessage.header.head).equal(false);
expect(parsedMessage.header.tail).equal(true);
expect(parsedMessage.header.totalSize).equal(packet.length);
expect(parsedMessage.header.size).equal(packet.length - Packet.HEADER_SIZE);
expect(parsedMessage.data).deep.equal(originalMessage);
packet = Packet.serialize(originalMessage, { head: true, tail: true });
parsedMessage = Packet.parse(packet);
expect(packet).be.instanceof(Buffer);
expect(parsedMessage.header.head).equal(true);
expect(parsedMessage.header.tail).equal(true);
expect(parsedMessage.header.totalSize).equal(packet.length);
expect(parsedMessage.header.size).equal(packet.length - Packet.HEADER_SIZE);
expect(parsedMessage.data).deep.equal(originalMessage);
});
it('Should throw an error if data is too large', () => {
const bigPacket = proxyquire('../../lib/services/utils/ipc/packet', {});
bigPacket.MAX_PAYLOAD_SIZE = 2;
bigPacket.MAX_PACKET_SIZE = bigPacket.HEADER_SIZE + bigPacket.MAX_PAYLOAD_SIZE;
const smallPacket = proxyquire('../../lib/services/utils/ipc/packet', {});
smallPacket.MAX_PAYLOAD_SIZE = 1;
smallPacket.MAX_PACKET_SIZE = smallPacket.HEADER_SIZE + smallPacket.MAX_PAYLOAD_SIZE;
expect(() => smallPacket.serialize(Buffer.from('XX'))).throw('The specified payload is too large to form an IPC packet.');
expect(() => smallPacket.parse(bigPacket.serialize(Buffer.from('XX')))).throw('The specified payload is too large to form an IPC packet.');
});
it('Should parse packets from a stream data', () => {
const originalMessageA = Buffer.from('A');
const originalMessageB = Buffer.from('B');
const originalMessageC = Buffer.from('C');
const data = Buffer.concat([
Packet.serialize(originalMessageA, { head: true }),
Packet.serialize(originalMessageB),
Packet.serialize(originalMessageC, { tail: true }),
]);
const messageA = Packet.parse(data);
expect(messageA.data).deep.equal(originalMessageA);
expect(messageA.header.head).equal(true);
expect(messageA.header.tail).equal(false);
const messageB = Packet.parse(data.slice(messageA.header.totalSize));
expect(messageB.data).deep.equal(originalMessageB);
expect(messageB.header.head).equal(false);
expect(messageB.header.tail).equal(false);
const messageC = Packet.parse(data.slice(messageA.header.totalSize + messageB.header.totalSize));
expect(messageC.data).deep.equal(originalMessageC);
expect(messageC.header.head).equal(false);
expect(messageC.header.tail).equal(true);
});
});
|
import Ember from "ember-metal/core";
import { get } from "ember-metal/property_get";
import { set } from "ember-metal/property_set";
import run from "ember-metal/run_loop";
import {
addObserver,
removeObserver
} from "ember-metal/observer";
import EmberObject from "ember-runtime/system/object";
import EmberDataAdapter from "ember-extension-support/data_adapter";
import EmberApplication from "ember-application/system/application";
import DefaultResolver from "ember-application/system/resolver";
var adapter, App;
var Model = EmberObject.extend();
var DataAdapter = EmberDataAdapter.extend({
detect: function(klass) {
return klass !== Model && Model.detect(klass);
}
});
QUnit.module("Data Adapter", {
setup: function() {
run(function() {
App = EmberApplication.create();
App.toString = function() { return 'App'; };
App.deferReadiness();
App.__registry__.register('data-adapter:main', DataAdapter);
});
},
teardown: function() {
run(function() {
adapter.destroy();
App.destroy();
});
}
});
test("Model types added with DefaultResolver", function() {
App.Post = Model.extend();
adapter = App.__container__.lookup('data-adapter:main');
adapter.reopen({
getRecords: function() {
return Ember.A([1,2,3]);
},
columnsForType: function() {
return [{ name: 'title', desc: 'Title' }];
}
});
run(App, 'advanceReadiness');
var modelTypesAdded = function(types) {
equal(types.length, 1);
var postType = types[0];
equal(postType.name, 'post', 'Correctly sets the name');
equal(postType.count, 3, 'Correctly sets the record count');
strictEqual(postType.object, App.Post, 'Correctly sets the object');
deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns');
};
adapter.watchModelTypes(modelTypesAdded);
});
test("Model types added with custom container-debug-adapter", function() {
var PostClass = Model.extend();
var StubContainerDebugAdapter = DefaultResolver.extend({
canCatalogEntriesByType: function(type) {
return true;
},
catalogEntriesByType: function(type) {
return [PostClass];
}
});
App.__registry__.register('container-debug-adapter:main', StubContainerDebugAdapter);
adapter = App.__container__.lookup('data-adapter:main');
adapter.reopen({
getRecords: function() {
return Ember.A([1,2,3]);
},
columnsForType: function() {
return [{ name: 'title', desc: 'Title' }];
}
});
run(App, 'advanceReadiness');
var modelTypesAdded = function(types) {
equal(types.length, 1);
var postType = types[0];
equal(postType.name, PostClass.toString(), 'Correctly sets the name');
equal(postType.count, 3, 'Correctly sets the record count');
strictEqual(postType.object, PostClass, 'Correctly sets the object');
deepEqual(postType.columns, [{ name: 'title', desc: 'Title' }], 'Correctly sets the columns');
};
adapter.watchModelTypes(modelTypesAdded);
});
test("Model Types Updated", function() {
App.Post = Model.extend();
adapter = App.__container__.lookup('data-adapter:main');
var records = Ember.A([1,2,3]);
adapter.reopen({
getRecords: function() {
return records;
}
});
run(App, 'advanceReadiness');
var modelTypesAdded = function() {
run(function() {
records.pushObject(4);
});
};
var modelTypesUpdated = function(types) {
var postType = types[0];
equal(postType.count, 4, 'Correctly updates the count');
};
adapter.watchModelTypes(modelTypesAdded, modelTypesUpdated);
});
test("Records Added", function() {
expect(8);
var countAdded = 1;
App.Post = Model.extend();
var post = App.Post.create();
var recordList = Ember.A([post]);
adapter = App.__container__.lookup('data-adapter:main');
adapter.reopen({
getRecords: function() {
return recordList;
},
getRecordColor: function() {
return 'blue';
},
getRecordColumnValues: function() {
return { title: 'Post ' + countAdded };
},
getRecordKeywords: function() {
return ['Post ' + countAdded];
}
});
var recordsAdded = function(records) {
var record = records[0];
equal(record.color, 'blue', 'Sets the color correctly');
deepEqual(record.columnValues, { title: 'Post ' + countAdded }, 'Sets the column values correctly');
deepEqual(record.searchKeywords, ['Post ' + countAdded], 'Sets search keywords correctly');
strictEqual(record.object, post, 'Sets the object to the record instance');
};
adapter.watchRecords(App.Post, recordsAdded);
countAdded++;
post = App.Post.create();
recordList.pushObject(post);
});
test("Observes and releases a record correctly", function() {
var updatesCalled = 0;
App.Post = Model.extend();
var post = App.Post.create({ title: 'Post' });
var recordList = Ember.A([post]);
adapter = App.__container__.lookup('data-adapter:main');
adapter.reopen({
getRecords: function() {
return recordList;
},
observeRecord: function(record, recordUpdated) {
var self = this;
var callback = function() {
recordUpdated(self.wrapRecord(record));
};
addObserver(record, 'title', callback);
return function() {
removeObserver(record, 'title', callback);
};
},
getRecordColumnValues: function(record) {
return { title: get(record, 'title') };
}
});
var recordsAdded = function() {
set(post, 'title', 'Post Modified');
};
var recordsUpdated = function(records) {
updatesCalled++;
equal(records[0].columnValues.title, 'Post Modified');
};
var release = adapter.watchRecords(App.Post, recordsAdded, recordsUpdated);
release();
set(post, 'title', 'New Title');
equal(updatesCalled, 1, 'Release function removes observers');
});
|
goog.provide('ns.reserved.a');
goog.provide('ns.reserved.switch');
/** @const */
ns.reserved.a = 0;
/** @const */
ns.reserved.switch = 0;
|
//// Copyright (c) Microsoft Corporation. All rights reserved
(function () {
"use strict";
// Commonly-used types.
var StandardDataFormats = Windows.ApplicationModel.DataTransfer.StandardDataFormats;
var HtmlFormatHelper = Windows.ApplicationModel.DataTransfer.HtmlFormatHelper;
var QuickLink = Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink;
// Variable to store the ShareOperation object
var shareOperation = null;
// Variable to store the visibility of the Extended Sharing section
var extendedSharingCollapsed = true;
// Variable to store the custom format string
var customFormatName = "http://schema.org/Book";
/// <summary>
/// Helper function to set an element's inner text to a value.
/// </summary>
function setInnerText(id, value) {
document.getElementById(id).innerText = value;
}
/// <summary>
/// Helper function to display textual information in an element.
/// </summary>
/// <param name="container">
/// The element in which to add new information.
/// </param>
/// <param name="label">
/// A text label to show before the text content.
/// </param>
/// <param name="text">
/// The text content to display.
/// </param>
/// <param name="className">
/// Optional class name to assign to the div.
/// </param>
function addTextContent(container, label, text, className) {
var div = document.createElement("div");
var labelNode = document.createElement("strong");
labelNode.innerText = label;
div.appendChild(labelNode);
var span = document.createElement("span");
span.innerText = ": " + text;
div.appendChild(span);
if (className) {
div.className = className;
}
return container.appendChild(div);
}
function addError(container, label, message, e) {
return addTextContainer(container, label, "Error retrieving data: " + e, "error");
}
/// <summary>
/// Helper function to display bitmap information in an element.
/// Returns the div wrapper for the image.
/// </summary>
/// <param name="container">
/// The element in which to add new information.
/// </param>
/// <param name="label">
/// A text label to show before the text content.
/// </param>
/// <param name="streamReference">
/// A random access stream reference containing the bitmap.
/// </param>
/// <param name="className">
/// Class to assign to the div that wraps the image.
/// </param>
function addImageContent(container, label, streamReference, className) {
addTextContent(container, label, "");
var div = document.createElement("div");
div.className = className;
streamReference.openReadAsync().done(function (stream) {
var img = document.createElement("img");
img.src = URL.createObjectURL(stream, { oneTimeOnly: true });
div.appendChild(img);
}, function (e) {
div.innerText = "Error reading image stream: " + e;
});
return container.appendChild(div);
}
function addContent(label, text) {
var contentValue = document.getElementById("contentValue");
addTextContent(contentValue, label, text);
}
function displayError(label, errorString) {
return addContent(label, errorString);
}
/// <summary>
/// Handler executed on activation of the target
/// </summary>
/// <param name="eventArgs">
/// Arguments of the event. In the case of the Share contract, it has the ShareOperation
/// </param>
function activatedHandler(eventObject) {
// In this sample we only do something if it was activated with the Share contract
if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.shareTarget) {
eventObject.setPromise(WinJS.UI.processAll());
// We receive the ShareOperation object as part of the eventArgs
shareOperation = eventObject.detail.shareOperation;
// We queue an asychronous event so that working with the ShareOperation object does not
// block or delay the return of the activation handler.
WinJS.Application.queueEvent({ type: "shareready" });
}
}
/// <summary>
/// Display properties of the data package.
/// </summary>
function showProperties() {
var container = document.getElementById("dataPackageProperties");
var properties = shareOperation.data.properties;
addTextContent(container, "Title", properties.title);
addTextContent(container, "Description", properties.description);
addTextContent(container, "Package Family Name", properties.packageFamilyName);
if (properties.contentSourceWebLink) {
addTextContent(container, "Content Source Web Link", properties.contentSourceWebLink.rawUri);
}
if (properties.contentSourceApplicationLink) {
addTextContent(container, "Content Source Application Link", properties.contentSourceApplicationLink.rawUri);
}
if (properties.square30x30Logo) {
var div = addImageContent(container, "Logo", properties.square30x30Logo, "package-logo");
var backgroundColor = properties.logoBackgroundColor;
div.style.backgroundColor = "rgba(" + backgroundColor.r + "," + backgroundColor.g + "," + backgroundColor.b + "," + backgroundColor.a + ")";
}
if (properties.thumbnail) {
addImageContent(container, "Thumbnail", properties.thumbnail, "thumbnail");
}
}
/// <summary>
/// Handle the incoming shared data. This should be done outside the activation handler.
/// </summary>
function shareReady() {
var data = shareOperation.data;
// Display properties of the data package.
showProperties();
// If this app was activated via a QuickLink, display the QuickLinkId
if (shareOperation.quickLinkId) {
document.getElementById("selectedQuickLinkId").innerText = shareOperation.quickLinkId;
document.getElementById("quickLinkArea").className = "hidden";
}
// Display the data received based on data type
var container = document.getElementById("dataPackageContents");
if (data.contains(StandardDataFormats.text)) {
data.getTextAsync().done(function (text) {
addTextContent(container, "Text", text);
}, function (e) {
addError(container, "Text", e);
});
}
if (data.contains(StandardDataFormats.webLink)) {
data.getWebLinkAsync().done(function (webLink) {
addTextContent(container, "WebLink", webLink.rawUri);
}, function (e) {
addError(container, "WebLink", e);
});
}
if (data.contains(StandardDataFormats.applicationLink)) {
data.getApplicationLinkAsync().done(function (applicationLink) {
addTextContent(container, "ApplicationLink", applicationLink.rawUri);
}, function (e) {
addError(container, "ApplicationLink", e);
});
}
if (data.contains(StandardDataFormats.storageItems)) {
data.getStorageItemsAsync().done(function (storageItems) {
var itemCount = storageItems.size;
// Display info about the first 10 files.
if (storageItems.size > 10) {
storageItems = storageItems.slice(0, 10);
}
var fileList = storageItems.map(item => item.name).join(", ");
if (itemCount > 10) {
fileList += ` and ${itemCount - 10} more`;
}
addTextContent(container, "Storage Items", fileList);
}, function (e) {
addError(container, "Storage Items", e);
});
}
if (data.contains(StandardDataFormats.bitmap)) {
data.getBitmapAsync().done(function (bitmapStreamReference) {
addImageContent(container, "Bitmap", bitmapStreamReference, "package-bitmap");
}, function (e) {
addError(container, "Bitmap", e);
});
}
if (data.contains(StandardDataFormats.html)) {
data.getHtmlFormatAsync().done(function (htmlFormat) {
addTextContent(container, "HTML", "");
// Extract the HTML fragment from the HTML format
var htmlFragment = HtmlFormatHelper.getStaticFragment(htmlFormat);
// Create an iframe and add it to the content.
var iframe = document.createElement("iframe");
iframe.style.width = "600px";
container.appendChild(iframe);
// Set the innerHTML of the iframe to the HTML fragment
iframe.contentDocument.documentElement.innerHTML = htmlFragment;
// Now we loop through any images and use the resourceMap to map each image element's src
var images = iframe.contentDocument.documentElement.getElementsByTagName("img");
if (images.length > 0) {
data.getResourceMapAsync().done(function (resourceMap) {
Array.prototype.forEach.call(images, function (image) {
var streamReference = resourceMap[image.src];
if (streamReference) {
// Call a helper function to map the image element's src to a corresponding blob URL generated from the streamReference
setResourceMapURL(streamReference, image);
}
});
}, function (e) {
addError(container, "Resource Map", e);
});
}
}, function (e) {
addError(container, "HTML", e);
});
}
if (data.contains(customFormatName)) {
data.getTextAsync(customFormatName).done(function (customFormatString) {
var customFormatObject = {};
try {
customFormatObject = JSON.parse(customFormatString);
} catch (e) {
// invalid JSON
}
// This sample expects the custom format to be of type http://schema.org/Book
if (customFormatObject.type === "http://schema.org/Book") {
var lines = ["Type: " + customFormatObject.type];
var properties = customFormatObject.properties;
if (properties) {
lines.push(
`Image: ${properties.image}`,
`Name: ${properties.name}`,
`Book Format: ${properties.bookFormat}`,
`Author: ${properties.author}`,
`Number of Pages: ${properties.numberOfPages}`,
`Publisher: ${properties.publisher}`,
`Date Published: ${properties.datePublished}`,
`In Language: ${properties.inLanguage}`,
`ISBN: ${properties.isbn}`);
}
addTextContent(container, "Custom data", lines.join("\n"));
} else {
addError(container, "Custom data", "Malformed data");
}
}, function (e) {
addError(container, "Custom data", e);
});
}
}
/// <summary>
/// Sets the blob URL for an image element based on a reference to an image stream within a resource map
/// </summary>
function setResourceMapURL(streamReference, imageElement) {
if (streamReference) {
streamReference.openReadAsync().done(function (imageStream) {
if (imageStream) {
imageElement.src = URL.createObjectURL(imageStream, { oneTimeOnly: true });
}
}, function (e) {
imageElement.alt = "Failed to load";
});
}
}
/// <summary>
/// Use to simulate that an extended share operation has started
/// </summary>
function reportStarted() {
shareOperation.reportStarted();
}
/// <summary>
/// Use to simulate that an extended share operation has retrieved the data
/// </summary>
function reportDataRetrieved() {
shareOperation.reportDataRetrieved();
}
/// <summary>
/// Use to simulate that an extended share operation has reached the status "submittedToBackgroundManager"
/// </summary>
function reportSubmittedBackgroundTask() {
shareOperation.reportSubmittedBackgroundTask();
}
/// <summary>
/// Submit for extended share operations. Can either report success or failure, and in case of success, can add a quicklink.
/// This does NOT take care of all the prerequisites (such as calling reportExtendedShareStatus(started)) before submitting.
/// </summary>
function reportError() {
var errorText = document.getElementById("extendedShareErrorMessage").value;
shareOperation.reportError(errorText);
}
/// <summary>
/// Call the reportCompleted API with the proper quicklink (if needed)
/// </summary>
function reportCompleted() {
var addQuickLink = document.getElementById("addQuickLink").checked;
if (addQuickLink) {
var el;
var quickLink = new QuickLink();
var quickLinkId = document.getElementById("quickLinkId").value;
if (!quickLinkId) {
el = document.getElementById("quickLinkError");
el.className = "unhidden";
el.innerText = "Missing QuickLink ID";
return;
}
quickLink.id = quickLinkId;
var quickLinkTitle = document.getElementById("quickLinkTitle").value;
if (!quickLinkTitle) {
el = document.getElementById("quickLinkError");
el.className = "unhidden";
el.innerText = "Missing QuickLink title";
return;
}
quickLink.title = quickLinkTitle;
// For quicklinks, the supported FileTypes and DataFormats are set independently from the manifest
quickLink.supportedFileTypes.replaceAll(["*"]);
quickLink.supportedDataFormats.replaceAll([StandardDataFormats.text, StandardDataFormats.webLink, StandardDataFormats.applicationLink, StandardDataFormats.bitmap, StandardDataFormats.storageItems, StandardDataFormats.html, customFormatName]);
// Prepare the icon for a QuickLink
var iconUri = new Windows.Foundation.Uri(quickLinkIcon.src);
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(iconUri).done(function (iconFile) {
quickLink.thumbnail = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(iconFile);
shareOperation.reportCompleted(quickLink);
}, function (e) {
// Even if the QuickLink cannot be created it is important to call ReportCompleted. Otherwise, if this is a long-running share,
// the app will stick around in the long-running share progress list.
shareOperation.reportCompleted();
throw e;
});
} else {
shareOperation.reportCompleted();
}
}
/// <summary>
/// Calls the share operation's dismiss UI function.
/// </summary>
function dismissUI() {
shareOperation.dismissUI();
}
/// <summary>
/// Expand/collapse the Extended Sharing div
/// </summary>
function expandoClick() {
if (extendedSharingCollapsed) {
document.getElementById("extendedSharing").className = "unhidden";
// Set expando glyph to up arrow
document.getElementById("expandoGlyph").innerHTML = "";
extendedSharingCollapsed = false;
} else {
document.getElementById("extendedSharing").className = "hidden";
// Set expando glyph to down arrow
document.getElementById("expandoGlyph").innerHTML = "";
extendedSharingCollapsed = true;
}
}
/// <summary>
/// Expand/collapse the QuickLink fields
/// </summary>
function addQuickLinkChanged() {
if (document.getElementById("addQuickLink").checked) {
quickLinkFields.className = "unhidden";
} else {
quickLinkFields.className = "hidden";
document.getElementById("quickLinkError").className = "hidden";
}
}
// Initialize the activation handler
WinJS.Application.addEventListener("activated", activatedHandler, false);
WinJS.Application.addEventListener("shareready", shareReady, false);
WinJS.Application.start();
function initialize() {
document.getElementById("addQuickLink").addEventListener("change", addQuickLinkChanged, false);
document.getElementById("reportCompleted").addEventListener("click", reportCompleted, false);
document.getElementById("dismissUI").addEventListener("click", dismissUI, false);
document.getElementById("expandoClick").addEventListener("click", expandoClick, false);
document.getElementById("reportStarted").addEventListener("click", reportStarted, false);
document.getElementById("reportDataRetrieved").addEventListener("click", reportDataRetrieved, false);
document.getElementById("reportSubmittedBackgroundTask").addEventListener("click", reportSubmittedBackgroundTask, false);
document.getElementById("reportError").addEventListener("click", reportError, false);
}
document.addEventListener("DOMContentLoaded", initialize, false);
})(); |
// ----------------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// v 1.1.6.1
// Dual licensed under the MIT and GPL licenses.
// ----------------------------------------------------------------------------
// Copyright (C) 2007-2010 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ----------------------------------------------------------------------------
(function($) {
$.fn.markItUp = function(settings, extraSettings) {
var options, ctrlKey, shiftKey, altKey;
ctrlKey = shiftKey = altKey = false;
options = { id: '',
nameSpace: '',
root: '',
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
previewAutoRefresh: true,
previewPosition: 'after',
previewTemplatePath: '~/templates/preview.html',
previewParserPath: '',
previewParserVar: 'data',
resizeHandle: true,
beforeInsert: '',
afterInsert: '',
onEnter: {},
onShiftEnter: {},
onCtrlEnter: {},
onTab: {},
markupSet: [ { /* set */ } ]
};
$.extend(options, settings, extraSettings);
// compute markItUp! path
if (!options.root) {
$('script').each(function(a, tag) {
miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
if (miuScript !== null) {
options.root = miuScript[1];
}
});
}
return this.each(function() {
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
$$ = $(this);
textarea = this;
levels = [];
abort = false;
scrollPosition = caretPosition = 0;
caretOffset = -1;
options.previewParserPath = localize(options.previewParserPath);
options.previewTemplatePath = localize(options.previewTemplatePath);
// apply the computed path to ~/
function localize(data, inText) {
if (inText) {
return data.replace(/("|')~\//g, "$1"+options.root);
}
return data.replace(/^~\//, options.root);
}
// init and build editor
function init() {
id = ''; nameSpace = '';
if (options.id) {
id = 'id="'+options.id+'"';
} else if ($$.attr("id")) {
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
}
if (options.nameSpace) {
nameSpace = 'class="'+options.nameSpace+'"';
}
$$.wrap('<div '+nameSpace+'></div>');
$$.wrap('<div '+id+' class="markItUp"></div>');
$$.wrap('<div class="markItUpContainer"></div>');
$$.addClass("markItUpEditor");
// add the header before the textarea
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
$(dropMenus(options.markupSet)).appendTo(header);
// add the footer after the textarea
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
// add the resize handle after textarea
if (options.resizeHandle === true && $.browser.safari !== true) {
resizeHandle = $('<div class="markItUpResizeHandle"></div>')
.insertAfter($$)
.bind("mousedown", function(e) {
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
mouseMove = function(e) {
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
return false;
};
mouseUp = function(e) {
$("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
return false;
};
$("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
});
footer.append(resizeHandle);
}
// listen key events
$$.keydown(keyPressed).keyup(keyPressed);
// bind an event to catch external calls
$$.bind("insertion", function(e, settings) {
if (settings.target !== false) {
get();
}
if (textarea === $.markItUp.focused) {
markup(settings);
}
});
// remember the last focus
$$.focus(function() {
$.markItUp.focused = this;
});
}
// recursively build header with dropMenus from markupset
function dropMenus(markupSet) {
var ul = $('<ul></ul>'), i = 0;
$('li:hover > ul', ul).css('display', 'block');
$.each(markupSet, function() {
var button = this, t = '', title, li, j;
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
if (button.separator) {
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
} else {
i++;
for (j = levels.length -1; j >= 0; j--) {
t += levels[j]+"-";
}
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
.bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
return false;
}).click(function() {
return false;
}).mouseup(function() {
if (button.call) {
eval(button.call)();
}
markup(button);
return false;
}).hover(function() {
$('> ul', this).show();
$(document).one('click', function() { // close dropmenu if click outside
$('ul ul', header).hide();
}
);
}, function() {
$('> ul', this).hide();
}
).appendTo(ul);
if (button.dropMenu) {
levels.push(i);
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
}
}
});
levels.pop();
return ul;
}
// markItUp! markups
function magicMarkups(string) {
if (string) {
string = string.toString();
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
function(x, a) {
var b = a.split('|!|');
if (altKey === true) {
return (b[1] !== undefined) ? b[1] : b[0];
} else {
return (b[1] === undefined) ? "" : b[0];
}
}
);
// [![prompt]!], [![prompt:!:value]!]
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
function(x, a) {
var b = a.split(':!:');
if (abort === true) {
return false;
}
value = prompt(b[0], (b[1]) ? b[1] : '');
if (value === null) {
abort = true;
}
return value;
}
);
return string;
}
return "";
}
// prepare action
function prepare(action) {
if ($.isFunction(action)) {
action = action(hash);
}
return magicMarkups(action);
}
// build block to insert
function build(string) {
openWith = prepare(clicked.openWith);
placeHolder = prepare(clicked.placeHolder);
replaceWith = prepare(clicked.replaceWith);
closeWith = prepare(clicked.closeWith);
if (replaceWith !== "") {
block = openWith + replaceWith + closeWith;
} else if (selection === '' && placeHolder !== '') {
block = openWith + placeHolder + closeWith;
} else {
block = openWith + (string||selection) + closeWith;
}
return { block:block,
openWith:openWith,
replaceWith:replaceWith,
placeHolder:placeHolder,
closeWith:closeWith
};
}
// define markup to insert
function markup(button) {
var len, j, n, i;
hash = clicked = button;
get();
$.extend(hash, { line:"",
root:options.root,
textarea:textarea,
selection:(selection||''),
caretPosition:caretPosition,
ctrlKey:ctrlKey,
shiftKey:shiftKey,
altKey:altKey
}
);
// callbacks before insertion
prepare(options.beforeInsert);
prepare(clicked.beforeInsert);
if (ctrlKey === true && shiftKey === true) {
prepare(clicked.beforeMultiInsert);
}
$.extend(hash, { line:1 });
if (ctrlKey === true && shiftKey === true) {
lines = selection.split(/\r?\n/);
for (j = 0, n = lines.length, i = 0; i < n; i++) {
if ($.trim(lines[i]) !== '') {
$.extend(hash, { line:++j, selection:lines[i] } );
lines[i] = build(lines[i]).block;
} else {
lines[i] = "";
}
}
string = { block:lines.join('\n')};
start = caretPosition;
len = string.block.length + (($.browser.opera) ? n : 0);
} else if (ctrlKey === true) {
string = build(selection);
start = caretPosition + string.openWith.length;
len = string.block.length - string.openWith.length - string.closeWith.length;
len -= fixIeBug(string.block);
} else if (shiftKey === true) {
string = build(selection);
start = caretPosition;
len = string.block.length;
len -= fixIeBug(string.block);
} else {
string = build(selection);
start = caretPosition + string.block.length ;
len = 0;
start -= fixIeBug(string.block);
}
if ((selection === '' && string.replaceWith === '')) {
caretOffset += fixOperaBug(string.block);
start = caretPosition + string.openWith.length;
len = string.block.length - string.openWith.length - string.closeWith.length;
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
}
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
if (string.block !== selection && abort === false) {
insert(string.block);
set(start, len);
} else {
caretOffset = -1;
}
get();
$.extend(hash, { line:'', selection:selection });
// callbacks after insertion
if (ctrlKey === true && shiftKey === true) {
prepare(clicked.afterMultiInsert);
}
prepare(clicked.afterInsert);
prepare(options.afterInsert);
// refresh preview if opened
if (previewWindow && options.previewAutoRefresh) {
refreshPreview();
}
// reinit keyevent
shiftKey = altKey = ctrlKey = abort = false;
}
// Substract linefeed in Opera
function fixOperaBug(string) {
if ($.browser.opera) {
return string.length - string.replace(/\n*/g, '').length;
}
return 0;
}
// Substract linefeed in IE
function fixIeBug(string) {
if ($.browser.msie) {
return string.length - string.replace(/\r*/g, '').length;
}
return 0;
}
// add markup
function insert(block) {
if (document.selection) {
var newSelection = document.selection.createRange();
newSelection.text = block;
} else {
$$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length));
}
}
// set a selection
function set(start, len) {
if (textarea.createTextRange){
// quick fix to make it work on Opera 9.5
if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
return false;
}
range = textarea.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', len);
range.select();
} else if (textarea.setSelectionRange ){
textarea.setSelectionRange(start, start + len);
}
textarea.scrollTop = scrollPosition;
textarea.focus();
}
// get the selection
function get() {
textarea.focus();
scrollPosition = textarea.scrollTop;
if (document.selection) {
selection = document.selection.createRange().text;
if ($.browser.msie) { // ie
var range = document.selection.createRange(), rangeCopy = range.duplicate();
rangeCopy.moveToElementText(textarea);
caretPosition = -1;
while(rangeCopy.inRange(range)) { // fix most of the ie bugs with linefeeds...
rangeCopy.moveStart('character');
caretPosition ++;
}
} else { // opera
caretPosition = textarea.selectionStart;
}
} else { // gecko
caretPosition = textarea.selectionStart;
selection = $$.val().substring(caretPosition, textarea.selectionEnd);
}
return selection;
}
// open preview window
function preview() {
if (!previewWindow || previewWindow.closed) {
if (options.previewInWindow) {
previewWindow = window.open('', 'preview', options.previewInWindow);
} else {
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
if (options.previewPosition == 'after') {
iFrame.insertAfter(footer);
} else {
iFrame.insertBefore(header);
}
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
}
} else if (altKey === true) {
// Thx Stephen M. Redd for the IE8 fix
if (iFrame) {
iFrame.remove();
} else {
previewWindow.close();
}
previewWindow = iFrame = false;
}
if (!options.previewAutoRefresh) {
refreshPreview();
}
}
// refresh Preview window
function refreshPreview() {
renderPreview();
}
function renderPreview() {
var phtml;
if (options.previewParserPath !== '') {
$.ajax( {
type: 'POST',
url: options.previewParserPath,
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
success: function(data) {
writeInPreview( localize(data, 1) );
}
} );
} else {
if (!template) {
$.ajax( {
url: options.previewTemplatePath,
success: function(data) {
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
}
} );
}
}
return false;
}
function writeInPreview(data) {
if (previewWindow.document) {
try {
sp = previewWindow.document.documentElement.scrollTop
} catch(e) {
sp = 0;
}
var h = "test";
previewWindow.document.open();
previewWindow.document.write(data);
previewWindow.document.close();
previewWindow.document.documentElement.scrollTop = sp;
}
if (options.previewInWindow) {
previewWindow.focus();
}
}
// set keys pressed
function keyPressed(e) {
shiftKey = e.shiftKey;
altKey = e.altKey;
ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false;
if (e.type === 'keydown') {
if (ctrlKey === true) {
li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li');
if (li.length !== 0) {
ctrlKey = false;
li.triggerHandler('mouseup');
return false;
}
}
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
if (ctrlKey === true) { // Enter + Ctrl
ctrlKey = false;
markup(options.onCtrlEnter);
return options.onCtrlEnter.keepDefault;
} else if (shiftKey === true) { // Enter + Shift
shiftKey = false;
markup(options.onShiftEnter);
return options.onShiftEnter.keepDefault;
} else { // only Enter
markup(options.onEnter);
return options.onEnter.keepDefault;
}
}
if (e.keyCode === 9) { // Tab key
if (shiftKey == true || ctrlKey == true || altKey == true) { // Thx Dr Floob.
return false;
}
if (caretOffset !== -1) {
get();
caretOffset = $$.val().length - caretOffset;
set(caretOffset, 0);
caretOffset = -1;
return false;
} else {
markup(options.onTab);
return options.onTab.keepDefault;
}
}
}
}
init();
});
};
$.fn.markItUpRemove = function() {
return this.each(function() {
$$ = $(this).unbind().removeClass('markItUpEditor');
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
}
);
};
$.markItUp = function(settings) {
var options = { target:false };
$.extend(options, settings);
if (options.target) {
return $(options.target).each(function() {
$(this).focus();
$(this).trigger('insertion', [options]);
});
} else {
$('textarea').trigger('insertion', [options]);
}
};
})(jQuery);
|
'use strict';
/*
* This is a regression test for https://github.com/joyent/node/issues/8874.
*/
require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;
// Use -i to force node into interactive mode, despite stdout not being a TTY
const args = [ '-i' ];
const child = spawn(process.execPath, args);
const input = 'const foo = "bar\\\nbaz"';
// Match '...' as well since it marks a multi-line statement
const expectOut = /> \.\.\. undefined\n/;
child.stderr.setEncoding('utf8');
child.stderr.on('data', (d) => {
throw new Error('child.stderr be silent');
});
child.stdout.setEncoding('utf8');
let out = '';
child.stdout.on('data', (d) => {
out += d;
});
child.stdout.on('end', () => {
assert(expectOut.test(out));
console.log('ok');
});
child.stdin.end(input);
|
var FoodChain = require('./food-chain');
describe('Food Chain', function () {
var song = new FoodChain();
it('fly', function () {
var expected = 'I know an old lady who swallowed a fly.\nI don\'t know why she swallowed the fly. Perhaps she\'ll die.\n';
expect(song.verse(1)).toEqual(expected);
});
it('spider', function () {
var expected = 'I know an old lady who swallowed a spider.\nIt wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' + 'I don\'t know why she swallowed the fly. Perhaps she\'ll die.\n';
expect(song.verse(2)).toEqual(expected);
});
it('bird', function () {
var expected = 'I know an old lady who swallowed a bird.\n' +
'How absurd to swallow a bird!\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. Perhaps she\'ll die.\n';
expect(song.verse(3)).toEqual(expected);
});
it('cat', function () {
var expected = 'I know an old lady who swallowed a cat.\n' +
'Imagine that, to swallow a cat!\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n';
expect(song.verse(4)).toEqual(expected);
});
it('dog', function () {
var expected = 'I know an old lady who swallowed a dog.\n' +
'What a hog, to swallow a dog!\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n';
expect(song.verse(5)).toEqual(expected);
});
it('goat', function () {
var expected = 'I know an old lady who swallowed a goat.\n' +
'Just opened her throat and swallowed a goat!\n' +
'She swallowed the goat to catch the dog.\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n';
expect(song.verse(6)).toEqual(expected);
});
it('cow', function () {
var expected = 'I know an old lady who swallowed a cow.\n' +
'I don\'t know how she swallowed a cow!\n' +
'She swallowed the cow to catch the goat.\n' +
'She swallowed the goat to catch the dog.\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n';
expect(song.verse(7)).toEqual(expected);
});
it('horse', function () {
var expected = 'I know an old lady who swallowed a horse.\n' + 'She\'s dead, of course!\n';
expect(song.verse(8)).toEqual(expected);
});
it('multiple verses', function () {
var expected = '';
expected += 'I know an old lady who swallowed a fly.\nI don\'t know why she swallowed the fly. Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a spider.\nIt wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. Perhaps she\'ll die.\n\n';
expect(song.verses(1, 2)).toEqual(expected);
});
it('the whole song', function () {
var expected = '';
expected += 'I know an old lady who swallowed a fly.\nI don\'t know why she swallowed the fly. Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a spider.\nIt wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a bird.\n' +
'How absurd to swallow a bird!\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a cat.\n' +
'Imagine that, to swallow a cat!\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a dog.\n' +
'What a hog, to swallow a dog!\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a goat.\n' +
'Just opened her throat and swallowed a goat!\n' +
'She swallowed the goat to catch the dog.\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a cow.\n' +
'I don\'t know how she swallowed a cow!\n' +
'She swallowed the cow to catch the goat.\n' +
'She swallowed the goat to catch the dog.\n' +
'She swallowed the dog to catch the cat.\n' +
'She swallowed the cat to catch the bird.\n' +
'She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.\n' +
'She swallowed the spider to catch the fly.\n' +
'I don\'t know why she swallowed the fly. ' +
'Perhaps she\'ll die.\n\n';
expected += 'I know an old lady who swallowed a horse.\n' + 'She\'s dead, of course!\n\n';
expect(song.verses(1, 8)).toEqual(expected);
});
});
|
import { isPresent, isBlank, BaseException, FunctionWrapper } from 'angular2/src/facade/lang';
import { ListWrapper } from 'angular2/src/facade/collection';
import { AbstractChangeDetector } from './abstract_change_detector';
import { ChangeDetectionUtil, uninitialized } from './change_detection_util';
import { RecordType } from './proto_record';
import { ChangeDetectionError } from './exceptions';
export class DynamicChangeDetector extends AbstractChangeDetector {
constructor(changeControlStrategy, dispatcher, pipeRegistry, protos, directiveRecords) {
super();
this.changeControlStrategy = changeControlStrategy;
this.dispatcher = dispatcher;
this.pipeRegistry = pipeRegistry;
this.protos = protos;
this.directiveRecords = directiveRecords;
this.locals = null;
this.directives = null;
this.alreadyChecked = false;
this.values = ListWrapper.createFixedSize(protos.length + 1);
this.pipes = ListWrapper.createFixedSize(protos.length + 1);
this.prevContexts = ListWrapper.createFixedSize(protos.length + 1);
this.changes = ListWrapper.createFixedSize(protos.length + 1);
this.values[0] = null;
ListWrapper.fill(this.values, uninitialized, 1);
ListWrapper.fill(this.pipes, null);
ListWrapper.fill(this.prevContexts, uninitialized);
ListWrapper.fill(this.changes, false);
}
hydrate(context, locals, directives) {
this.mode = ChangeDetectionUtil.changeDetectionMode(this.changeControlStrategy);
this.values[0] = context;
this.locals = locals;
this.directives = directives;
this.alreadyChecked = false;
}
dehydrate() {
this._destroyPipes();
this.values[0] = null;
ListWrapper.fill(this.values, uninitialized, 1);
ListWrapper.fill(this.changes, false);
ListWrapper.fill(this.pipes, null);
ListWrapper.fill(this.prevContexts, uninitialized);
this.locals = null;
}
_destroyPipes() {
for (var i = 0; i < this.pipes.length; ++i) {
if (isPresent(this.pipes[i])) {
this.pipes[i].onDestroy();
}
}
}
hydrated() { return this.values[0] !== null; }
detectChangesInRecords(throwOnChange) {
if (!this.hydrated()) {
ChangeDetectionUtil.throwDehydrated();
}
var protos = this.protos;
var changes = null;
var isChanged = false;
for (var i = 0; i < protos.length; ++i) {
var proto = protos[i];
var bindingRecord = proto.bindingRecord;
var directiveRecord = bindingRecord.directiveRecord;
if (proto.isLifeCycleRecord()) {
if (proto.name === "onCheck" && !throwOnChange) {
this._getDirectiveFor(directiveRecord.directiveIndex).onCheck();
}
else if (proto.name === "onInit" && !throwOnChange && !this.alreadyChecked) {
this._getDirectiveFor(directiveRecord.directiveIndex).onInit();
}
else if (proto.name === "onChange" && isPresent(changes) && !throwOnChange) {
this._getDirectiveFor(directiveRecord.directiveIndex).onChange(changes);
}
}
else {
var change = this._check(proto, throwOnChange);
if (isPresent(change)) {
this._updateDirectiveOrElement(change, bindingRecord);
isChanged = true;
changes = this._addChange(bindingRecord, change, changes);
}
}
if (proto.lastInDirective) {
changes = null;
if (isChanged && bindingRecord.isOnPushChangeDetection()) {
this._getDetectorFor(directiveRecord.directiveIndex).markAsCheckOnce();
}
isChanged = false;
}
}
this.alreadyChecked = true;
}
callOnAllChangesDone() {
this.dispatcher.notifyOnAllChangesDone();
var dirs = this.directiveRecords;
for (var i = dirs.length - 1; i >= 0; --i) {
var dir = dirs[i];
if (dir.callOnAllChangesDone) {
this._getDirectiveFor(dir.directiveIndex).onAllChangesDone();
}
}
}
_updateDirectiveOrElement(change, bindingRecord) {
if (isBlank(bindingRecord.directiveRecord)) {
this.dispatcher.notifyOnBinding(bindingRecord, change.currentValue);
}
else {
var directiveIndex = bindingRecord.directiveRecord.directiveIndex;
bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue);
}
}
_addChange(bindingRecord, change, changes) {
if (bindingRecord.callOnChange()) {
return ChangeDetectionUtil.addChange(changes, bindingRecord.propertyName, change);
}
else {
return changes;
}
}
_getDirectiveFor(directiveIndex) { return this.directives.getDirectiveFor(directiveIndex); }
_getDetectorFor(directiveIndex) { return this.directives.getDetectorFor(directiveIndex); }
_check(proto, throwOnChange) {
try {
if (proto.isPipeRecord()) {
return this._pipeCheck(proto, throwOnChange);
}
else {
return this._referenceCheck(proto, throwOnChange);
}
}
catch (e) {
throw new ChangeDetectionError(proto, e);
}
}
_referenceCheck(proto, throwOnChange) {
if (this._pureFuncAndArgsDidNotChange(proto)) {
this._setChanged(proto, false);
return null;
}
var prevValue = this._readSelf(proto);
var currValue = this._calculateCurrValue(proto);
if (!isSame(prevValue, currValue)) {
if (proto.lastInBinding) {
var change = ChangeDetectionUtil.simpleChange(prevValue, currValue);
if (throwOnChange)
ChangeDetectionUtil.throwOnChange(proto, change);
this._writeSelf(proto, currValue);
this._setChanged(proto, true);
return change;
}
else {
this._writeSelf(proto, currValue);
this._setChanged(proto, true);
return null;
}
}
else {
this._setChanged(proto, false);
return null;
}
}
_calculateCurrValue(proto) {
switch (proto.mode) {
case RecordType.SELF:
return this._readContext(proto);
case RecordType.CONST:
return proto.funcOrValue;
case RecordType.PROPERTY:
var context = this._readContext(proto);
return proto.funcOrValue(context);
case RecordType.SAFE_PROPERTY:
var context = this._readContext(proto);
return isBlank(context) ? null : proto.funcOrValue(context);
case RecordType.LOCAL:
return this.locals.get(proto.name);
case RecordType.INVOKE_METHOD:
var context = this._readContext(proto);
var args = this._readArgs(proto);
return proto.funcOrValue(context, args);
case RecordType.SAFE_INVOKE_METHOD:
var context = this._readContext(proto);
if (isBlank(context)) {
return null;
}
var args = this._readArgs(proto);
return proto.funcOrValue(context, args);
case RecordType.KEYED_ACCESS:
var arg = this._readArgs(proto)[0];
return this._readContext(proto)[arg];
case RecordType.INVOKE_CLOSURE:
return FunctionWrapper.apply(this._readContext(proto), this._readArgs(proto));
case RecordType.INTERPOLATE:
case RecordType.PRIMITIVE_OP:
return FunctionWrapper.apply(proto.funcOrValue, this._readArgs(proto));
default:
throw new BaseException(`Unknown operation ${proto.mode}`);
}
}
_pipeCheck(proto, throwOnChange) {
var context = this._readContext(proto);
var pipe = this._pipeFor(proto, context);
var prevValue = this._readSelf(proto);
var currValue = pipe.transform(context);
if (!isSame(prevValue, currValue)) {
currValue = ChangeDetectionUtil.unwrapValue(currValue);
if (proto.lastInBinding) {
var change = ChangeDetectionUtil.simpleChange(prevValue, currValue);
if (throwOnChange)
ChangeDetectionUtil.throwOnChange(proto, change);
this._writeSelf(proto, currValue);
this._setChanged(proto, true);
return change;
}
else {
this._writeSelf(proto, currValue);
this._setChanged(proto, true);
return null;
}
}
else {
this._setChanged(proto, false);
return null;
}
}
_pipeFor(proto, context) {
var storedPipe = this._readPipe(proto);
if (isPresent(storedPipe) && storedPipe.supports(context)) {
return storedPipe;
}
if (isPresent(storedPipe)) {
storedPipe.onDestroy();
}
// Currently, only pipes that used in bindings in the template get
// the changeDetectorRef of the encompassing component.
//
// In the future, pipes declared in the bind configuration should
// be able to access the changeDetectorRef of that component.
var cdr = proto.mode === RecordType.BINDING_PIPE ? this.ref : null;
var pipe = this.pipeRegistry.get(proto.name, context, cdr);
this._writePipe(proto, pipe);
return pipe;
}
_readContext(proto) {
if (proto.contextIndex == -1) {
return this._getDirectiveFor(proto.directiveIndex);
}
else {
return this.values[proto.contextIndex];
}
return this.values[proto.contextIndex];
}
_readSelf(proto) { return this.values[proto.selfIndex]; }
_writeSelf(proto, value) { this.values[proto.selfIndex] = value; }
_readPipe(proto) { return this.pipes[proto.selfIndex]; }
_writePipe(proto, value) { this.pipes[proto.selfIndex] = value; }
_setChanged(proto, value) { this.changes[proto.selfIndex] = value; }
_pureFuncAndArgsDidNotChange(proto) {
return proto.isPureFunction() && !this._argsChanged(proto);
}
_argsChanged(proto) {
var args = proto.args;
for (var i = 0; i < args.length; ++i) {
if (this.changes[args[i]]) {
return true;
}
}
return false;
}
_readArgs(proto) {
var res = ListWrapper.createFixedSize(proto.args.length);
var args = proto.args;
for (var i = 0; i < args.length; ++i) {
res[i] = this.values[args[i]];
}
return res;
}
}
function isSame(a, b) {
if (a === b)
return true;
if (a instanceof String && b instanceof String && a == b)
return true;
if ((a !== a) && (b !== b))
return true;
return false;
}
//# sourceMappingURL=dynamic_change_detector.js.map |
/**
* Tests for the environmental (browser, jquery, etc.) options
*/
"use strict";
var JSHINT = require('../../src/jshint.js').JSHINT;
var fs = require('fs');
var TestRun = require("../helpers/testhelper").setup.testRun;
function wrap(globals) {
return '(function () { return [ ' + globals.join(',') + ' ]; }());';
}
function globalsKnown(test, globals, options) {
JSHINT(wrap(globals), options || {});
var report = JSHINT.data();
test.ok(report.implied === undefined);
test.equal(report.globals.length, globals.length);
for (var i = 0, g; g = report.globals[i]; i += 1)
globals[g] = true;
for (i = 0, g = null; g = globals[i]; i += 1)
test.ok(g in globals);
}
function globalsImplied(test, globals, options) {
JSHINT(wrap(globals), options || {});
var report = JSHINT.data();
test.ok(report.implieds != null);
test.ok(report.globals === undefined);
var implieds = [];
for (var i = 0, warn; warn = report.implieds[i]; i += 1)
implieds.push(warn.name);
test.equal(implieds.length, globals.length);
}
/*
* Option `node` predefines Node.js (v 0.5.9) globals
*
* More info:
* + http://nodejs.org/docs/v0.5.9/api/globals.html
*/
exports.node = function (test) {
// Node environment assumes `globalstrict`
var globalStrict = [
'"use strict";',
"function test() { return; }",
].join('\n');
TestRun(test)
.addError(1, 'Use the function form of "use strict".')
.test(globalStrict, { es3: true, strict: true });
TestRun(test)
.test(globalStrict, { es3: true, node: true, strict: true });
TestRun(test)
.test(globalStrict, { es3: true, browserify: true, strict: true });
// Don't assume strict:true for Node environments. See bug GH-721.
TestRun(test)
.test("function test() { return; }", { es3: true, node: true });
TestRun(test)
.test("function test() { return; }", { es3: true, browserify: true });
// Make sure that we can do fancy Node export
var overwrites = [
"global = {};",
"Buffer = {};",
"exports = module.exports = {};"
];
TestRun(test)
.addError(1, "Read only.")
.test(overwrites, { es3: true, node: true });
TestRun(test)
.addError(1, "Read only.")
.test(overwrites, { es3: true, browserify: true });
test.done();
};
exports.typed = function (test) {
var globals = [
"ArrayBuffer",
"ArrayBufferView",
"DataView",
"Float32Array",
"Float64Array",
"Int16Array",
"Int32Array",
"Int8Array",
"Uint16Array",
"Uint32Array",
"Uint8Array",
"Uint8ClampedArray"
];
globalsImplied(test, globals);
globalsKnown(test, globals, { browser: true });
globalsKnown(test, globals, { node: true });
globalsKnown(test, globals, { typed: true });
test.done();
};
exports.es5 = function (test) {
var src = fs.readFileSync(__dirname + "/fixtures/es5.js", "utf8");
TestRun(test)
.addError(3, "Extra comma. (it breaks older versions of IE)")
.addError(8, "Extra comma. (it breaks older versions of IE)")
.addError(15, "get/set are ES5 features.")
.addError(16, "get/set are ES5 features.")
.addError(20, "get/set are ES5 features.")
.addError(22, "get/set are ES5 features.")
.addError(26, "get/set are ES5 features.")
.addError(30, "get/set are ES5 features.")
.addError(31, "get/set are ES5 features.")
.addError(36, "get/set are ES5 features.")
.addError(41, "get/set are ES5 features.")
.addError(42, "get/set are ES5 features.")
.addError(43, "Duplicate key 'x'.")
.addError(47, "get/set are ES5 features.")
.addError(48, "get/set are ES5 features.")
.addError(48, "Duplicate key 'x'.")
.addError(52, "get/set are ES5 features.")
.addError(53, "get/set are ES5 features.")
.addError(54, "get/set are ES5 features.")
.addError(54, "Duplicate key 'x'.")
.addError(58, "get/set are ES5 features.")
.addError(58, "Unexpected parameter 'a' in get x function.")
.addError(59, "get/set are ES5 features.")
.addError(59, "Unexpected parameter 'a' in get y function.")
.addError(60, "get/set are ES5 features.")
.addError(62, "get/set are ES5 features.")
.addError(62, "Expected a single parameter in set x function.")
.addError(63, "get/set are ES5 features.")
.addError(64, "get/set are ES5 features.")
.addError(64, "Expected a single parameter in set z function.")
.addError(68, "get/set are ES5 features.")
.addError(69, "get/set are ES5 features.")
.addError(68, "Missing property name.")
.addError(69, "Missing property name.")
.addError(75, "get/set are ES5 features.")
.addError(76, "get/set are ES5 features.")
.addError(80, "get/set are ES5 features.")
.test(src, { es3: true });
TestRun(test)
.addError(36, "Setter is defined without getter.")
.addError(43, "Duplicate key 'x'.")
.addError(48, "Duplicate key 'x'.")
.addError(54, "Duplicate key 'x'.")
.addError(58, "Unexpected parameter 'a' in get x function.")
.addError(59, "Unexpected parameter 'a' in get y function.")
.addError(62, "Expected a single parameter in set x function.")
.addError(64, "Expected a single parameter in set z function.")
.addError(68, "Missing property name.")
.addError(69, "Missing property name.")
.addError(80, "Setter is defined without getter.")
.test(src, { }); // es5
// JSHint should not throw "Missing property name" error on nameless getters/setters
// using Method Definition Shorthand if esnext flag is enabled.
TestRun(test)
.addError(36, "Setter is defined without getter.")
.addError(43, "Duplicate key 'x'.")
.addError(48, "Duplicate key 'x'.")
.addError(54, "Duplicate key 'x'.")
.addError(58, "Unexpected parameter 'a' in get x function.")
.addError(59, "Unexpected parameter 'a' in get y function.")
.addError(62, "Expected a single parameter in set x function.")
.addError(64, "Expected a single parameter in set z function.")
.addError(80, "Setter is defined without getter.")
.test(src, { esnext: true });
// Make sure that JSHint parses getters/setters as function expressions
// (https://github.com/jshint/jshint/issues/96)
src = fs.readFileSync(__dirname + "/fixtures/es5.funcexpr.js", "utf8");
TestRun(test).test(src, { }); // es5
test.done();
};
exports.phantom = function (test) {
// Phantom environment assumes `globalstrict`
var globalStrict = [
'"use strict";',
"function test() { return; }",
].join('\n');
TestRun(test)
.addError(1, 'Use the function form of "use strict".')
.test(globalStrict, { es3: true, strict: true });
TestRun(test)
.test(globalStrict, { es3: true, phantom: true, strict: true });
test.done();
};
|
class Padding {
constructor (padding) {
this.left = padding.left
this.right = padding.right
}
length () {
return this.left.length + this.right.length
}
}
/**
@module padding
*/
module.exports = Padding
|
function send_to_Enrichr(options) { // http://amp.pharm.mssm.edu/Enrichr/#help
var defaultOptions = {
description: "",
popup: false
};
if (typeof options.description == 'undefined')
options.description = defaultOptions.description;
if (typeof options.popup == 'undefined')
options.popup = defaultOptions.popup;
if (typeof options.list == 'undefined')
alert('No genes defined.');
var form = document.createElement('form');
form.setAttribute('method', 'post');
form.setAttribute('action', 'https://amp.pharm.mssm.edu/Enrichr/enrich');
if (options.popup)
form.setAttribute('target', '_blank');
form.setAttribute('enctype', 'multipart/form-data');
var listField = document.createElement('input');
listField.setAttribute('type', 'hidden');
listField.setAttribute('name', 'list');
listField.setAttribute('value', options.list);
form.appendChild(listField);
var descField = document.createElement('input');
descField.setAttribute('type', 'hidden');
descField.setAttribute('name', 'description');
descField.setAttribute('value', options.description);
form.appendChild(descField);
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
} |
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):a.dayjs_locale_eu=e(a.dayjs)}(this,function(a){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(a){return a}};return a.locale(e,null,!0),e});
|
/*!
FullCalendar RRule Plugin v4.1.0
Docs & License: https://fullcalendar.io/
(c) 2019 Adam Shaw
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rrule'), require('@fullcalendar/core')) :
typeof define === 'function' && define.amd ? define(['exports', 'rrule', '@fullcalendar/core'], factory) :
(global = global || self, factory(global.FullCalendarRrule = {}, global.rrule, global.FullCalendar));
}(this, function (exports, rrule, core) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var EVENT_DEF_PROPS = {
rrule: null,
duration: core.createDuration
};
var recurring = {
parse: function (rawEvent, leftoverProps, dateEnv) {
if (rawEvent.rrule != null) {
var props = core.refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps);
var parsed = parseRRule(props.rrule, dateEnv);
if (parsed) {
return {
typeData: parsed.rrule,
allDayGuess: parsed.allDayGuess,
duration: props.duration
};
}
}
return null;
},
expand: function (rrule, framingRange) {
// we WANT an inclusive start and in exclusive end, but the js rrule lib will only do either BOTH
// inclusive or BOTH exclusive, which is stupid: https://github.com/jakubroztocil/rrule/issues/84
// Workaround: make inclusive, which will generate extra occurences, and then trim.
return rrule.between(framingRange.start, framingRange.end, true)
.filter(function (date) {
return date.valueOf() < framingRange.end.valueOf();
});
}
};
var main = core.createPlugin({
recurringTypes: [recurring]
});
function parseRRule(input, dateEnv) {
var allDayGuess = null;
var rrule$1;
if (typeof input === 'string') {
rrule$1 = rrule.rrulestr(input);
}
else if (typeof input === 'object' && input) { // non-null object
var refined = __assign({}, input); // copy
if (typeof refined.dtstart === 'string') {
var dtstartMeta = dateEnv.createMarkerMeta(refined.dtstart);
if (dtstartMeta) {
refined.dtstart = dtstartMeta.marker;
allDayGuess = dtstartMeta.isTimeUnspecified;
}
else {
delete refined.dtstart;
}
}
if (typeof refined.until === 'string') {
refined.until = dateEnv.createMarker(refined.until);
}
if (refined.freq != null) {
refined.freq = convertConstant(refined.freq);
}
if (refined.wkst != null) {
refined.wkst = convertConstant(refined.wkst);
}
else {
refined.wkst = (dateEnv.weekDow - 1 + 7) % 7; // convert Sunday-first to Monday-first
}
if (refined.byweekday != null) {
refined.byweekday = convertConstants(refined.byweekday); // the plural version
}
rrule$1 = new rrule.RRule(refined);
}
if (rrule$1) {
return { rrule: rrule$1, allDayGuess: allDayGuess };
}
return null;
}
function convertConstants(input) {
if (Array.isArray(input)) {
return input.map(convertConstant);
}
return convertConstant(input);
}
function convertConstant(input) {
if (typeof input === 'string') {
return rrule.RRule[input.toUpperCase()];
}
return input;
}
exports.default = main;
Object.defineProperty(exports, '__esModule', { value: true });
}));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.