text
stringlengths 3
1.05M
|
---|
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import MobileContainer from './container'
import MobileNavigationBar from './navigation-bar'
import LocationField from '../form/location-field'
import { MobileScreens, setMobileScreen } from '../../actions/ui'
class MobileLocationSearch extends Component {
static propTypes = {
backScreen: PropTypes.number,
locationType: PropTypes.string
}
_locationSelected = () => {
this.props.setMobileScreen(MobileScreens.SEARCH_FORM)
}
render () {
const {
backScreen,
location,
locationType,
otherLocation
} = this.props
const suppressNearby = otherLocation &&
otherLocation.category === 'CURRENT_LOCATION'
return (
<MobileContainer>
<MobileNavigationBar
headerText={`Set ${locationType === 'to' ? 'Destination' : 'Origin'}`}
showBackButton
backScreen={backScreen}
/>
<div className='location-search mobile-padding'>
<LocationField
type={locationType}
hideExistingValue
suppressNearby={suppressNearby}
label={location ? location.name : 'Enter location'}
static
onLocationSelected={this._locationSelected}
/>
</div>
</MobileContainer>
)
}
}
// connect to the redux store
const mapStateToProps = (state, ownProps) => {
return {
location: state.otp.currentQuery[ownProps.locationType],
otherLocation: ownProps.type === 'from'
? state.otp.currentQuery.to
: state.otp.currentQuery.from
}
}
const mapDispatchToProps = {
setMobileScreen
}
export default connect(mapStateToProps, mapDispatchToProps)(MobileLocationSearch)
|
# Copyright 2014 Uri Laserson
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import itertools
import numpy as np
# from numpy import ma
# import scipy as sp
# import scipy.stats
# import scipy.special
# import matplotlib as mpl
# import matplotlib.pyplot as plt
import pyutils
import vdj
def iterator2countdict(iterable,features,count='read'):
counts = pyutils.nesteddict()
uniq_feature_values = dict([(f,set()) for f in features])
for chain in iterable:
try: # get the feature tuple
feature_list = [chain.__getattribute__(f) for f in features]
for (feature,value) in zip(features,feature_list): uniq_feature_values[feature].add(value)
except AttributeError: # chain is missing a feature; abandon it
continue
# update the dictionary
if count == 'read':
counts.nested_increment(feature_list)
elif count in ['junction','clone']:
counts.nested_add(feature_list,chain.__getattribute__(count))
else:
raise ValueError, "'count' must be 'read', 'junction', or 'clone'"
# if counting clones/junctions, convert sets to numbers
if count in ['junction','clone']:
for tup in counts.walk():
(keylist,val) = (tup[:-1],tup[-1])
counts.nested_assign(keylist,len(val))
counts.lock()
for feature in features: uniq_feature_values[feature] = list(uniq_feature_values[feature])
return (uniq_feature_values,counts)
def imgt2countdict(inhandle,features,count='read'):
return iterator2countdict(vdj.parse_imgt(inhandle),features,count)
def countdict2matrix(features,feature_values,countdict):
# feature_values is a dict where keys are the features and the values are
# the list of specific values I should process for that feature.
dim = tuple([len(feature_values[f]) for f in features])
matrix = np.zeros(dim,dtype=np.int)
for posvals in itertools.product( *[list(enumerate(feature_values[f])) for f in features] ):
(pos,vals) = zip(*posvals)
count = countdict
for val in vals:
try:
count = count[val]
except KeyError:
count = 0
break
matrix[pos] = count
return matrix
def barcode_clone_counts(inhandle):
"""Return count dict from vdjxml file with counts[barcode][clone]"""
counts = dict()
for chain in vdj.parse_VDJXML(inhandle):
try: # chain may not have barcode
counts_barcode = counts.setdefault(chain.barcode,dict())
except AttributeError:
continue
counts_barcode[chain.clone] = counts_barcode.get(chain.clone,0) + 1
return counts
def barcode_junction_counts(inhandle):
"""Return count dict from vdjxml file with counts[barcode][junction]"""
counts = dict()
for chain in vdj.parse_VDJXML(inhandle):
try: # chain may not have barcode
counts_barcode = counts.setdefault(chain.barcode,dict())
except AttributeError:
continue
counts_barcode[chain.junction] = counts_barcode.get(chain.junction,0) + 1
return counts
def barcode_clone_counts2matrix(counts,barcodes=None,clones=None):
"""Generates matrix from count dict"""
if barcodes == None:
barcodes = counts.keys()
if clones == None:
clones = list( reduce( lambda x,y: x|y, [set(c.keys()) for c in counts.itervalues()] ) )
matrix = np.zeros((len(clones),len(barcodes)))
for (col,barcode) in enumerate(barcodes):
for (row,clone) in enumerate(clones):
matrix[row,col] = counts.get(barcode,dict()).get(clone,0)
return (clones,barcodes,matrix)
barcode_junction_counts2matrix = barcode_clone_counts2matrix
# ====================================================================
# = OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD =
# ====================================================================
# # ===============
# # = Time series =
# # ===============
#
# def clone_timeseries(inhandle, barcodes, reference_clones=None):
# # generate count data
# for chain in vdj.parse_VDJXML(inhandle):
# counts
#
# def clone_timeseries(inhandle,time_tags,reference_clones=None):
# # get count data
# time_tags_set = set(time_tags)
# clone_counts = {}
# for tag in time_tags:
# clone_counts[tag]={}
# for chain in vdj.parse_VDJXML(inhandle):
# try:
# curr_time_tag = (chain.tags&time_tags_set).pop()
# except KeyError:
# continue
#
# try:
# clone_counts[curr_time_tag][vdj.get_clone(chain)] += 1
# except KeyError:
# clone_counts[curr_time_tag][vdj.get_clone(chain)] = 1
#
# # set up reference clones
# if reference_clones == None:
# reference_clones = set()
# for counts in clone_counts.itervalues():
# reference_clones.update(counts.keys())
# reference_clones = list(reference_clones)
#
# # build timeseries matrix
# num_clones = len(reference_clones)
# num_times = len(time_tags)
# countdata = np.zeros((num_clones,num_times))
# for (i,tag) in enumerate(time_tags):
# countdata[:,i] = vdj.count_dict_clone_counts(clone_counts[tag],reference_clones)
#
# return countdata,reference_clones
#
#
# def timeseries2proportions(countdata,freq=True,log=True,pseudocount=1e-1):
# num_time_series, num_times = countdata.shape
# num_transitions = num_times - 1
# if pseudocount != 0:
# proportions = np.zeros((num_time_series,num_transitions))
# countdata_pseudo = countdata + np.float_(pseudocount)
# if freq == True:
# countdata_pseudo = countdata_pseudo / countdata_pseudo.sum(axis=0)
# for i in range(num_transitions):
# proportions[:,i] = countdata_pseudo[:,i+1] / countdata_pseudo[:,i]
# else: # only look at time series that are non-zero the whole way through
# idxs = np.sum(countdata>0,axis=1)==num_times
# proportions = np.zeros((np.sum(idxs),num_transitions))
# if freq == True:
# countdata_modified = np.float_(countdata) / countdata.sum(axis=0)
# else:
# countdata_modified = np.float_(countdata)
# for i in range(num_transitions):
# proportions[:,i] = countdata_modified[idxs,i+1] / countdata_modified[idxs,i]
# if log==True:
# return np.log10(proportions)
# else:
# return proportions
#
#
# def timeseries2autocorrelation(timeseries):
# ac = [1.] + [sp.stats.pearsonr(timeseries[:-i],timeseries[i:])[0] for i in range(1,len(timeseries)-2)]
# return ac
#
# # ================
# # = Spectratypes =
# # ================
#
# def cdr3s2spectratype(cdr3s):
# min_raw_cdr3 = np.min(cdr3s)
# max_raw_cdr3 = np.max(cdr3s)
# min_cdr3 = np.int(np.ceil( min_raw_cdr3 / 3.) * 3) # will be a nonzero mult of 3
# max_cdr3 = np.int(np.floor(max_raw_cdr3 / 3.) * 3) # will be a mult of 3
#
# # bin the CDR3s lengths. The first elt is rep zero len (and should be zero)
# # and the last bin always represents one greater than the biggest mult of 3
# binnedcdr3s = np.histogram(cdr3s,bins=np.arange(0,max_cdr3+2))[0] # the +2 is due to the pecul. of np.hist.
#
# gaussians = []
# for cdr3len in np.arange(min_cdr3,max_raw_cdr3,3):
# totalcdr3s = np.sum(binnedcdr3s[cdr3len-1:cdr3len+2])
# goodcdr3s = binnedcdr3s[cdr3len]
# if totalcdr3s == 0:
# continue
# mu = cdr3len
# x = cdr3len-0.5
# tail = (1 - (np.float(goodcdr3s)/totalcdr3s)) / 2.
# sigma = (x-mu) / (np.sqrt(2.)*sp.special.erfinv(2*tail-1))
# rv = sp.stats.norm(loc=mu,scale=sigma)
# gaussians.append( (totalcdr3s,rv) )
#
# t = np.linspace(0,max_cdr3+1,1000)
# y = np.zeros(len(t))
# for (s,rv) in gaussians:
# y += s*rv.pdf(t)
# return (t,y)
#
#
# def spectratype_curves(inhandle):
# # NOTE: requires chains with V and J alns
#
# # init data structure
# cdr3s = {}
# for v_seg in vdj.refseq.IGHV_seqs.keys():
# for j_seg in vdj.refseq.IGHJ_seqs.keys():
# cdr3s[vdj.vj_id(v_seg,j_seg)] = []
#
# # load data
# for chain in vdj.parse_VDJXML(inhandle):
# if chain.v == '' or chain.j == '' or chain.junction == '':
# continue
# cdr3s[vdj.vj_id(chain.v,chain.j)].append(chain.cdr3)
#
# spectras = {}
# for v_seg in vdj.refseq.IGHV_seqs.keys():
# for j_seg in vdj.refseq.IGHJ_seqs.keys():
# if len(cdr3s[vdj.vj_id(v_seg,j_seg)]) == 0:
# # empty VJ combo:
# spectras[vdj.vj_id(v_seg,j_seg)] = (np.array([0,150]),np.array([0,0]))
# else:
# spectras[vdj.vj_id(v_seg,j_seg)] = cdr3s2spectratype(cdr3s[vdj.vj_id(v_seg,j_seg)])
#
# return spectras
#
#
#
# # ========================
# # = Diversity estimation =
# # ========================
#
#
# def estimator_chao1(counts):
# """Bias corrected. See EstimateS doc (Colwell)"""
# Sobs = len(counts)
# F1 = np.float_(np.sum(np.int_(counts)==1))
# F2 = np.float_(np.sum(np.int_(counts)==2))
# chao1 = Sobs + F1*(F1-1)/(2*(F2+1))
# return chao1
#
#
# def estimator_chao1_variance(counts):
# F1 = np.float_(np.sum(np.int_(counts)==1))
# F2 = np.float_(np.sum(np.int_(counts)==2))
# if F1 > 0 and F2 > 0:
# chao1_var = (F1*(F1-1)/(2*(F2+1))) + (F1*(2*F1-1)*(2*F1-1)/(4*(F2+1)*(F2+1))) + (F1*F1*F2*(F1-1)*(F1-1)/(4*(F2+1)*(F2+1)*(F2+1)*(F2+1)))
# elif F1 > 0 and F2 == 0:
# Schao1 = estimator_chao1(counts)
# chao1_var = (F1*(F1-1)/2) + (F1*(2*F1-1)*(2*F1-1)/4) - (F1*F1*F1*F1/(4*Schao1))
# elif F1 == 0:
# N = np.float_(np.sum(counts))
# Sobs = np.float_(len(counts))
# chao1_var = Sobs*np.exp(-1*N*Sobs) * (1-np.exp(-1*N*Sobs))
# return chao1_var
#
#
# def estimator_ace(counts,rare_cutoff=10):
# Sobs = np.float_(len(counts))
# Srare = np.float_(np.sum(np.int_(counts)<=rare_cutoff))
# Sabund = Sobs - Srare
# F1 = np.float_(np.sum(np.int_(counts)==1))
# F = lambda i: np.float_(np.sum(np.int_(counts)==i))
# Nrare = np.float_(np.sum([i*F(i) for i in range(1,rare_cutoff+1)]))
# #Nrare = np.float_(np.sum(counts[np.int_(counts)<=rare_cutoff]))
# if Nrare == F1: # in accordance with EstimateS
# return estimator_chao1(counts)
# Cace = 1 - (F1/Nrare)
# gamma_squared = Srare*np.sum([i*(i-1)*F(i) for i in range(1,rare_cutoff+1)])/(Cace*Nrare*(Nrare-1))
# if gamma_squared < 0:
# gamma_squared = 0
# Sace = Sabund + (Srare/Cace) + (F1/Cace)*gamma_squared
# return Sace
#
#
# def accumulation_curve(sample,sampling_levels):
# pass
#
#
# # =========================
# # = Statistical utilities =
# # =========================
#
# def counts2sample(counts):
# """Computes a consistent sample from a vector of counts.
#
# Takes a vector of counts and returns a vector of indices x
# such that len(x) = sum(c) and each elt of x is the index of
# a corresponding elt in c
# """
# x = np.ones(np.sum(counts),dtype=np.int_)
#
# start_idx = 0
# end_idx = 0
# for i in xrange(len(counts)):
# start_idx = end_idx
# end_idx = end_idx + counts[i]
# x[start_idx:end_idx] = x[start_idx:end_idx] * i
# return x
#
#
# def sample2counts(sample):
# """Return count vector from list of samples.
#
# The ordering etc is ignored; only the uniqueness
# of the objects is considered.
# """
# num_categories = len(set(sample))
# count_dict = {}
# for elt in sample:
# try: count_dict[elt] += 1
# except KeyError: count_dict[elt] = 1
# return count_dict.values()
#
#
# # def sample2counts(sample, categories=0):
# # """Return count vector from list of samples.
# #
# # Take vector of samples and return a vector of counts. The elts
# # refer to indices in something that would ultimately map to the
# # originating category (like from a multinomial). Therefore, if there
# # are, say, 8 categories, then valid values in sample should be 0-7.
# # If categories is not given, then i compute it from the highest value
# # present in sample (+1).
# # """
# # counts = np.bincount(sample)
# # if (categories > 0) and (categories > len(counts)):
# # counts = np.append( counts, np.zeros(categories-len(counts)) )
# # return counts
#
#
# def scoreatpercentile(values,rank):
# return sp.stats.scoreatpercentile(values,rank)
#
#
# def percentileofscore(values,score):
# values.sort()
# return values.searchsorted(score) / np.float_(len(values))
#
#
# def bootstrap(x, nboot, theta, *args):
# '''return n bootstrap replications of theta from x'''
# N = len(x)
# th_star = np.zeros(nboot)
#
# for i in xrange(nboot):
# th_star[i] = theta( x[ np.random.randint(0,N,N) ], *args ) # bootstrap repl from x
#
# return th_star
#
#
# def subsample(x, num_samples, sample_size, theta, *args):
# """return num_samples evaluations of the statistic theta
# on subsamples of size sample_size"""
# N = len(x)
# th_star = np.zeros(num_samples)
#
# for i in xrange(num_samples):
# th_star[i] = theta( x[ np.random.randint(0,N,sample_size) ], *args ) # subsample from from x
#
# return th_star
#
#
# def randint_without_replacement(low,high=None,size=None):
# if high == None:
# high = low
# low = 0
# if size == None:
# size = 1
# urn = range(low,high)
# N = len(urn)
# flip = False
# if size > N/2:
# flip = True
# size = N - size
# sample = []
# for i in xrange(size):
# draw = np.random.randint(0,N-i)
# sample.append(urn.pop(draw))
# if not flip:
# return np.asarray(sample)
# else:
# return np.asarray(urn)
#
#
# def subsample_without_replacement(x, num_samples, sample_size, theta, *args):
# """return num_samples evaluations of the statistic theta
# on subsamples of size sample_size"""
# N = len(x)
# th_star = np.zeros(num_samples)
#
# for i in xrange(num_samples):
# th_star[i] = theta( x[ randint_without_replacement(0,N,sample_size) ], *args ) # subsample from from x
#
# return th_star
#
#
#
# # =================
# # = Visualization =
# # =================
#
# class ConstWidthRectangle(mpl.patches.Patch):
#
# def __init__(self, x, y1, y2, w, **kwargs):
# self.x = x
# self.y1 = y1
# self.y2 = y2
# self.w = w
# mpl.patches.Patch.__init__(self,**kwargs)
#
# def get_path(self):
# return mpl.path.Path.unit_rectangle()
#
# def get_transform(self):
# box = np.array([[self.x,self.y1],
# [self.x,self.y2]])
# box = self.axes.transData.transform(box)
#
# w = self.w * self.axes.bbox.width / 2.0
#
# box[0,0] -= w
# box[1,0] += w
#
# return mpl.transforms.BboxTransformTo(mpl.transforms.Bbox(box))
#
# class ConstWidthLine(mpl.lines.Line2D):
#
# def __init__(self,x,y,w,**kwargs):
# self.x = x
# self.y = y
# self.w = w
# mpl.lines.Line2D.__init__(self,[0,1],[0,0],**kwargs) # init to unit line
#
# def get_transform(self):
# # define transform that takes unit horiz line seg
# # and places it in correct position using display
# # coords
#
# box = np.array([[self.x,self.y],
# [self.x,self.y+1]])
# box = self.axes.transData.transform(box)
#
# w = self.w * self.axes.bbox.width / 2.0
#
# box[0,0] -= w
# box[1,0] += w
#
# #xdisp,ydisp = self.axes.transData.transform_point([self.x,self.y])
# #xdisp -= w
# #xleft = xdisp - w
# #xright = xdisp + w
#
# return mpl.transforms.BboxTransformTo(mpl.transforms.Bbox(box))
# #return mpl.transforms.Affine2D().scale(w,1).translate(xdisp,ydisp)
#
# def draw(self,renderer):
# # the ONLY purpose of redefining this function is to force the Line2D
# # object to execute recache(). Otherwise, certain changes in the scale
# # do not invalidate the Line2D object, and the transform will not be
# # recomputed (and so the Axes coords computed earlier will be obsolete)
# self.recache()
# return mpl.lines.Line2D.draw(self,renderer)
#
#
# class ConstHeightRectangle(mpl.patches.Patch):
#
# def __init__(self, x1, x2, y, h, **kwargs):
# self.x1 = x1
# self.x2 = x2
# self.y = y
# self.h = h
# mpl.patches.Patch.__init__(self,**kwargs)
#
# def get_path(self):
# return mpl.path.Path.unit_rectangle()
#
# def get_transform(self):
# box = np.array([[self.x1,self.y],
# [self.x2,self.y]])
# box = self.axes.transData.transform(box)
#
# h = self.h * self.axes.bbox.height / 2.0
#
# box[0,1] -= h
# box[1,1] += h
#
# return mpl.transforms.BboxTransformTo(mpl.transforms.Bbox(box))
#
# class ConstHeightLine(mpl.lines.Line2D):
#
# def __init__(self,x,y,h,**kwargs):
# self.x = x
# self.y = y
# self.h = h
# mpl.lines.Line2D.__init__(self,[0,0],[0,1],**kwargs) # init to unit line
#
# # self.x = x
# # self.y = y
# # self.w = w
# # mpl.lines.Line2D.__init__(self,[0,1],[0,0],**kwargs) # init to unit line
#
# def get_transform(self):
# # define transform that takes unit horiz line seg
# # and places it in correct position using display
# # coords
#
# box = np.array([[self.x,self.y],
# [self.x+1,self.y]])
# box = self.axes.transData.transform(box)
#
# h = self.h * self.axes.bbox.height / 2.0
#
# box[0,1] -= h
# box[1,1] += h
#
# #xdisp,ydisp = self.axes.transData.transform_point([self.x,self.y])
# #xdisp -= w
# #xleft = xdisp - w
# #xright = xdisp + w
#
# return mpl.transforms.BboxTransformTo(mpl.transforms.Bbox(box))
# #return mpl.transforms.Affine2D().scale(w,1).translate(xdisp,ydisp)
#
# def draw(self,renderer):
# # the ONLY purpose of redefining this function is to force the Line2D
# # object to execute recache(). Otherwise, certain changes in the scale
# # do not invalidate the Line2D object, and the transform will not be
# # recomputed (and so the Axes coords computed earlier will be obsolete)
# self.recache()
# return mpl.lines.Line2D.draw(self,renderer)
#
#
# def boxplot(ax, x, positions=None, widths=None, vert=1):
# # adapted from matplotlib
#
# # convert x to a list of vectors
# if hasattr(x, 'shape'):
# if len(x.shape) == 1:
# if hasattr(x[0], 'shape'):
# x = list(x)
# else:
# x = [x,]
# elif len(x.shape) == 2:
# nr, nc = x.shape
# if nr == 1:
# x = [x]
# elif nc == 1:
# x = [x.ravel()]
# else:
# x = [x[:,i] for i in xrange(nc)]
# else:
# raise ValueError, "input x can have no more than 2 dimensions"
# if not hasattr(x[0], '__len__'):
# x = [x]
# col = len(x)
#
# # get some plot info
# if positions is None:
# positions = range(1, col + 1)
# if widths is None:
# widths = min(0.3/len(positions),0.05)
# if isinstance(widths, float) or isinstance(widths, int):
# widths = np.ones((col,), float) * widths
#
# # loop through columns, adding each to plot
# for i,pos in enumerate(positions):
# d = np.ravel(x[i])
# row = len(d)
# if row==0:
# # no data, skip this position
# continue
# # get distrib info
# q1, med, q3 = mpl.mlab.prctile(d,[25,50,75])
# dmax = np.max(d)
# dmin = np.min(d)
#
# line_color = '#074687'
# face_color = '#96B7EC'
# if vert == 1:
# medline = ConstWidthLine(pos,med,widths[i],color=line_color,zorder=3)
# box = ConstWidthRectangle(pos,q1,q3,widths[i],facecolor=face_color,edgecolor=line_color,zorder=2)
# vertline = mpl.lines.Line2D([pos,pos],[dmin,dmax],color=line_color,zorder=1)
# else:
# medline = ConstHeightLine(med,pos,widths[i],color=line_color,zorder=3)
# box = ConstHeightRectangle(q1,q3,pos,widths[i],facecolor=face_color,edgecolor=line_color,zorder=2)
# vertline = mpl.lines.Line2D([dmin,dmax],[pos,pos],color=line_color,zorder=1)
#
# ax.add_line(vertline)
# ax.add_patch(box)
# ax.add_line(medline)
#
#
#
#
#
#
# #==============================================================================
# #==============================================================================
# #==============================================================================
#
# def rep2spectratype(rep):
# """Compute spectratype curves from Repertoire object."""
#
# cdr3s = np.array([c.cdr3 for c in rep if c.junction != ''])
# min_raw_cdr3 = np.min(cdr3s)
# max_raw_cdr3 = np.max(cdr3s)
# min_cdr3 = np.int(np.ceil( min_raw_cdr3 / 3.) * 3) # will be a nonzero mult of 3
# max_cdr3 = np.int(np.floor(max_raw_cdr3 / 3.) * 3) # will be a mult of 3
#
# # bin the CDR3s lengths. The first elt is rep zero len (and should be zero)
# # and the last bin always represents one greater than the biggest mult of 3
# binnedcdr3s = np.histogram(cdr3s,bins=np.arange(0,max_cdr3+2))[0] # the +2 is due to the pecul. of np.hist.
#
# gaussians = []
# for cdr3len in np.arange(min_cdr3,max_raw_cdr3,3):
# totalcdr3s = np.sum(binnedcdr3s[cdr3len-1:cdr3len+2])
# goodcdr3s = binnedcdr3s[cdr3len]
# if totalcdr3s == 0:
# continue
# mu = cdr3len
# x = cdr3len-0.5
# tail = (1 - (np.float(goodcdr3s)/totalcdr3s)) / 2.
# sigma = (x-mu) / (np.sqrt(2.)*sp.special.erfinv(2*tail-1))
# rv = sp.stats.norm(loc=mu,scale=sigma)
# gaussians.append( (totalcdr3s,rv) )
#
# t = np.linspace(0,max_cdr3+1,1000)
# y = np.zeros(len(t))
# for (s,rv) in gaussians:
# y += s*rv.pdf(t)
# return (t,y)
#
#
#
#
# def scatter_repertoires_ontology(reps,info='VJCDR3',gooddata=False,measurement='proportions'):
# """Create a grid of scatter plots showing corelations between all pairs of repertoires.
#
# reps -- list of Repertoire objects
#
# """
# numreps = len(reps)
#
# datalist = []
# for rep in reps:
# datalist.append( vdj.counts_ontology_1D(rep,info,gooddata) )
#
# if measurement == 'proportions':
# for i in xrange(len(datalist)):
# datalist[i] = np.float_(datalist[i]) / np.sum(datalist[i])
#
# min_nonzero = np.min([np.min(data[data>0]) for data in datalist])
# max_nonzero = np.max([np.max(data[data>0]) for data in datalist])
# axislo = 10**np.floor( np.frexp(min_nonzero)[1] * np.log10(2) )
# axishi = 10**np.ceil( np.frexp(max_nonzero)[1] * np.log10(2) )
#
# fig = plt.figure()
#
# hist_axs = []
# for row in xrange(numreps):
# col = row
# plotnum = numreps*row + col + 1
# ax = fig.add_subplot(numreps,numreps,plotnum)
# ax.hist(datalist[row],bins=100,log=True,facecolor='k')
# hist_axs.append(ax)
#
# scatter_axs = []
# for row in xrange(numreps-1):
# for col in xrange(row+1,numreps):
# plotnum = numreps*row + col + 1
# ax = fig.add_subplot(numreps,numreps,plotnum)
# ax.scatter(datalist[row],datalist[col],c='k',marker='o',s=2,edgecolors=None)
# ax.set_xscale('log')
# ax.set_yscale('log')
# ax.axis([axislo,axishi,axislo,axishi])
# scatter_axs.append(ax)
#
# return fig
#
# def scatter_repertoires_clusters(reps,refclusters,measurement='proportions'):
# """Create a grid of scatter plots showing corelations between all pairs of repertoires.
#
# reps -- list of Repertoire objects
#
# """
# numreps = len(reps)
#
# datalist = []
# for rep in reps:
# clusters = vdj.getClusters(rep)
# datalist.append( vdj.countsClusters(clusters,refclusters) )
#
# if measurement == 'proportions':
# for i in xrange(len(datalist)):
# datalist[i] = np.float_(datalist[i]) / np.sum(datalist[i])
#
# min_nonzero = np.min([np.min(data[data>0]) for data in datalist])
# max_nonzero = np.max([np.max(data[data>0]) for data in datalist])
# axislo = 10**np.floor( np.frexp(min_nonzero)[1] * np.log10(2) )
# axishi = 10**np.ceil( np.frexp(max_nonzero)[1] * np.log10(2) )
#
# fig = plt.figure()
#
# hist_axs = []
# for row in xrange(numreps):
# col = row
# plotnum = numreps*row + col + 1
# ax = fig.add_subplot(numreps,numreps,plotnum)
# ax.hist(datalist[row],bins=100,log=True,facecolor='k')
# hist_axs.append(ax)
#
# scatter_axs = []
# for row in xrange(numreps-1):
# for col in xrange(row+1,numreps):
# plotnum = numreps*row + col + 1
# ax = fig.add_subplot(numreps,numreps,plotnum)
# ax.scatter(datalist[row],datalist[col],c='k',marker='o',s=0.5,edgecolors=None)
# ax.set_xscale('log')
# ax.set_yscale('log')
# ax.axis([axislo,axishi,axislo,axishi])
# scatter_axs.append(ax)
#
# return fig
#
# def reps2timeseries(reps,refclusters):
# """Return time series matrix from list or Repertoire objs in chron order.
#
# reps is list of Repertoire objects
# refclusters is the master list of reference clusters
# """
# numreps = len(reps)
# numclusters = len(refclusters)
#
# countdata = np.zeros((numclusters,numreps))
# for (i,rep) in enumerate(reps):
# clusters = vdj.getClusters(rep)
# countdata[:,i] = vdj.countsClusters(clusters,refclusters)
#
# return countdata
#
# def timeseries_repertoires(times,reps,refclusters,idxsbool=None,allpositive=False):
# """Create a time-series of the different clusters in refclusters.
#
# If allpositive is True, then it will limit itself to drawing timeseries
# only for those clusters that are non-zero at all timepoints.
#
# """
# ax = plt.gca()
#
# numreps = len(reps)
# numclusters = len(refclusters)
#
# countdata = np.zeros((numclusters,numreps))
# for (i,rep) in enumerate(reps):
# clusters = vdj.getClusters(rep)
# countdata[:,i] = vdj.countsClusters(clusters,refclusters)
#
# sums = countdata.sum(0)
# proportions = np.float_(countdata) / sums
#
# if idxsbool == None:
# if allpositive == True:
# idxsbool = np.sum(proportions,axis=1) > 0
# else:
# idxsbool = np.array([True]*proportions.shape[0])
#
# ax.plot(times,countdata[idxsbool,:].transpose(),'k-',linewidth=0.2)
#
# plt.draw_if_interactive()
# return ax
#
#
# def rep2spectratype(rep):
# """Compute spectratype curves from Repertoire object."""
#
# cdr3s = np.array([c.cdr3 for c in rep if c.junction != ''])
# min_raw_cdr3 = np.min(cdr3s)
# max_raw_cdr3 = np.max(cdr3s)
# min_cdr3 = np.int(np.ceil( min_raw_cdr3 / 3.) * 3) # will be a nonzero mult of 3
# max_cdr3 = np.int(np.floor(max_raw_cdr3 / 3.) * 3) # will be a mult of 3
#
# # bin the CDR3s lengths. The first elt is rep zero len (and should be zero)
# # and the last bin always represents one greater than the biggest mult of 3
# binnedcdr3s = np.histogram(cdr3s,bins=np.arange(0,max_cdr3+2))[0] # the +2 is due to the pecul. of np.hist.
#
# gaussians = []
# for cdr3len in np.arange(min_cdr3,max_raw_cdr3,3):
# totalcdr3s = np.sum(binnedcdr3s[cdr3len-1:cdr3len+2])
# goodcdr3s = binnedcdr3s[cdr3len]
# if totalcdr3s == 0:
# continue
# mu = cdr3len
# x = cdr3len-0.5
# tail = (1 - (np.float(goodcdr3s)/totalcdr3s)) / 2.
# sigma = (x-mu) / (np.sqrt(2.)*sp.special.erfinv(2*tail-1))
# rv = sp.stats.norm(loc=mu,scale=sigma)
# gaussians.append( (totalcdr3s,rv) )
#
# t = np.linspace(0,max_cdr3+1,1000)
# y = np.zeros(len(t))
# for (s,rv) in gaussians:
# y += s*rv.pdf(t)
# return (t,y)
#
# def circlemapVJ(ax,counts,rowlabels=None,collabels=None,scale='linear'):
# numV = counts.shape[0]
# numJ = counts.shape[1]
# X,Y = np.meshgrid(range(numJ),range(numV))
#
# # mask zero positions
# X,Y = ma.array(X), ma.array(Y)
# C = ma.array(counts)
#
# zeromask = (counts == 0)
# X.mask = zeromask
# Y.mask = zeromask
# C.mask = zeromask
#
# # ravel nonzero elts (deletes zero-positions)
# x = ma.compressed(X)
# y = ma.compressed(Y)
# c = ma.compressed(C)
#
# # log normalize counts if requested
# if scale == 'log':
# c = ma.log10(c)
#
# if scale == 'linear' or scale == 'log':
# # normalize counts to desired size-range
# max_counts = ma.max(c)
# min_counts = ma.min(c)
# counts_range = max_counts - min_counts
#
# max_size = 100
# min_size = 5
# size_range = max_size - min_size
#
# sizes = (np.float(size_range) / counts_range) * (c - min_counts) + min_size
#
# if scale == 'custom':
# trans_counts = 1000
# linear_positions = c >= trans_counts
# log_positions = c < trans_counts
#
# min_size = 3
# trans_size = 40 # 30
# max_size = 200 # 150
# log_size_range = trans_size - min_size
# linear_size_range = max_size - trans_size
#
# linear_max_counts = ma.max(c[linear_positions])
# linear_min_counts = ma.min(c[linear_positions])
# linear_counts_range = linear_max_counts - linear_min_counts
# log_max_counts = ma.max(c[log_positions])
# log_min_counts = ma.min(c[log_positions])
# log_counts_range = np.log10(log_max_counts) - np.log10(log_min_counts)
#
# sizes = np.zeros(len(c))
# sizes[linear_positions] = (np.float(linear_size_range) / linear_counts_range) * (c[linear_positions] - linear_min_counts) + trans_size
# sizes[log_positions] = (np.float(log_size_range) / log_counts_range) * (ma.log10(c[log_positions]) - ma.log10(log_min_counts)) + min_size
#
# collection = mpl.collections.CircleCollection(
# sizes,
# offsets = zip(x,y),
# transOffset = ax.transData, # i may need to explicitly set the xlim and ylim info for this to work correctly
# facecolors = '#1873C1',
# linewidths = 0.25,
# clip_on = False)
#
# ax.add_collection(collection)
#
# ax.set_aspect('equal')
# ax.autoscale_view()
#
# ax.xaxis.set_major_locator(mpl.ticker.FixedLocator(range(counts.shape[1])))
# ax.yaxis.set_major_locator(mpl.ticker.FixedLocator(range(counts.shape[0])))
#
# if rowlabels != None:
# ax.xaxis.set_major_formatter(mpl.ticker.FixedFormatter(collabels))
# if collabels != None:
# ax.yaxis.set_major_formatter(mpl.ticker.FixedFormatter(rowlabels))
#
# for ticklabel in ax.xaxis.get_ticklabels():
# ticklabel.set_horizontalalignment('left')
# ticklabel.set_rotation(-45)
# ticklabel.set_size(8)
#
# for ticklabel in ax.yaxis.get_ticklabels():
# ticklabel.set_size(8)
#
# if scale == 'linear' or scale == 'log':
# return (min_counts,max_counts),(min_size,max_size)
# else:
# return (linear_min_counts,trans_counts,log_max_counts),(min_size,trans_size,max_size)
#
# # define colormap for -1 to 1 (green-black-red) like gene expression
# redgreencdict = {'red': [(0.0, 0.0, 0.0),
# (0.5, 0.0, 0.0),
# (1.0, 1.0, 0.0)],
#
# 'green':[(0.0, 0.0, 1.0),
# (0.5, 0.0, 0.0),
# (1.0, 0.0, 0.0)],
#
# 'blue': [(0.0, 0.0, 0.0),
# (0.5, 0.0, 0.0),
# (1.0, 0.0, 0.0)]}
#
# redgreen = mpl.colors.LinearSegmentedColormap('redgreen',redgreencdict,256)
# redgreen.set_bad(color='w')
|
// The main purpose of this file is to provide an interface for database
// connection. Even though the code is quite simple and basically a tiny
// wrapper around mongoose package, it works as single point where
// database setup/config is performed and the interface provided here can be
// reused by both the main application and all tests which require database
// connection.
const Mongoose = require('mongoose');
const getMongoDBURL = (config)=>{
return config.get('mongodb_uri') ||
config.get('mongolab_uri') ||
'mongodb://localhost/homebrewery';
};
const handleConnectionError = (error)=>{
if(error) {
console.error('Could not connect to a Mongo database: \n');
console.error(error);
console.error('\nIf you are running locally, make sure mongodb.exe is running and DB URL is configured properly');
process.exit(1); // non-zero exit code to indicate an error
}
};
const disconnect = async ()=>{
return await Mongoose.disconnect();
};
const connect = async (config)=>{
return await Mongoose.connect(getMongoDBURL(config),
{ retryWrites: false }, handleConnectionError);
};
module.exports = {
connect : connect,
disconnect : disconnect
};
|
const Discord = module.require('discord.js');
const ms = require('parse-ms');
module.exports.run = async (client, message, args) => {
try {
let config = require('../config.json');
let lang = require(`../lang_${client.lang}.json`);
let evaled = eval('`' + lang.economy.bonus + '`');
let ntf = eval('`' + lang.other.ntf + '`');
let msgs = evaled.split('<>');
let time = client.profile.fetch(`bonustime_${message.author.id}`);
let s = ms(((cooldown / 60) / 1000) - (Date.now() - time), {
long: true
});
let cooldown = 60; //Кулдаун бонуса в минутах
let bonus = Math.floor(Math.random() * (120 - 10)) + 10 + (lvl * 5); //Формуа выдачи бонуса с помощью лвла
let wrong = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(config.color.red)
.setDescription(`**${message.author.tag}** ${msgs[0]} **${s.minutes} minutes ${s.seconds} seconds**`)
.setFooter(ntf, client.user.avatarURL)
.setTimestamp();
if (time > Date.now()) return message.channel.send(wrong)
let add = Date.now() + ((cooldown * 60) * 1000);
let mh;
let cd;
//if (cooldown > 60) { mh = ' hours'; cd = (cooldown / 60) } else { mh = ' minutes'; cd = cooldown };
client.profile.add(`coins_${message.author.id}`, bonus);
client.profile.set(`bonustime_${message.author.id}`, add);
client.lprofile.add(`coins_${message.author.id}_${message.guild.id}`, bonus);
let bembed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(config.color.green)
.setDescription(`${msgs[1]}${cd}${mh}`)
.setFooter(ntf, client.user.avatarURL)
.setTimestamp();
message.channel.send(bembed);
} catch (err) {
let config = require('../config.json');
let a = client.users.get(config.dev)
let errEmb = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setTitle(`${err[0]}`)
.setColor(config.color.red)
.addField(`**${err.name}**`, `**${err.message}**`)
.setFooter(`${err[1]} ${a.tag}`, client.user.avatarURL)
.setTimestamp();
message.channel.send(errEmb);
console.log(err.stack);
};
};
module.exports.help = {
name: 'bonus',
aliases: ['b', 'бонус', '$']
}; |
console.log('Background.js file loaded');
import { wrapStore, alias } from 'webext-redux';
import { createStore } from 'easy-peasy';
import { initial } from '../store/store';
const addTodoAsync = (action) => {
return () => {
return store.getActions().waitAndAddTodo(action.payload).then(result => {
action.payload = result;
return action;
});
}
}
const reduxPromiseResponder = (dispatchResult, send) => {
Promise
.resolve(dispatchResult.payload.promise) // pull out the promise
.then((res) => {
// if success then respond with value
send({ error: null, value: res });
})
.catch((err) => {
// if error then respond with error
send({ error: err, value: null });
});
};
const actionLogMiddleware = _ => next => action => {
next(action);
}
const store = createStore(initial, {
middleware: [alias({ addTodoAsync })]
});
wrapStore(store,
// { dispatchResponder: reduxPromiseResponder, }
);
|
const { MessageEmbed } = require('discord.js');
const { red_light } = require("../../colours.json");
const db = require("quick.db");
const config = require('../../botconfig.json')
module.exports = {
config: {
name: "freeze",
description: "Freezes current channel!",
category: "moderation",
accessableby: "Administrators",
aliases: ["lock"]
},
run: async (bot, message, args) => {
if(message.channel.type === "dm") return;
const embed1 = new MessageEmbed()
.setTitle('<:disagree:782705809359765526> Error <:disagree:782705809359765526>')
.setDescription("I don't have enough permissions to do this command. \n Please, give me permission -> ``ADMINISTRATOR``")
.setColor('#d12828');
const embed2 = new MessageEmbed()
.setTitle('<:disagree:782705809359765526> Error <:disagree:782705809359765526>')
.setDescription("You don't have enough permissions to use this command. \n - Required permission -> ``MANAGE CHANNELS``")
.setColor('#d12828');
if (!message.guild.me.hasPermission('ADMINISTRATOR')) {
message.channel.send(embed1)
.then(m => m.delete({ timeout: 7000 }));
return message.delete({ timeout: 7000 });
}
if (!message.member.hasPermission("MANAGE_CHANNELS")) {
message.channel.send(embed2)
.then(m => m.delete({ timeout: 7000 }));
return message.delete({ timeout: 7000 });
}
const embed = new MessageEmbed()
.setTitle("<:disagree:782705809359765526> CLOSED <:disagree:782705809359765526>")
.setTimestamp()
.setColor(red_light)
.setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL())
.setDescription(`This room have been temporarily closed\n\n[ ${message.author} ]`);
await message.channel.updateOverwrite(message.channel.guild.roles.everyone, { SEND_MESSAGES: false });
message.channel.send(embed);
message.delete();
let embeddw = new MessageEmbed()
.setColor(red_light)
.setAuthor(`Modlogs`)
.setThumbnail(message.guild.iconURL())
.addField("Moderation:", "Freeze")
.addField("Channel", `${message.channel}`)
.addField("Moderator:", message.author.tag)
.addField("Date:", message.createdAt.toLocaleString())
let lawdw = await message.guild.channels.cache.get(config.logchannel)
return lawdw.send(embeddw)
}
} |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 Nathan Juraj Michlo
#
# 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.
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
import logging
import os
import shutil
import numpy as np
from scipy.io import loadmat
from disent.data.groundtruth.base import DownloadableGroundTruthData
log = logging.getLogger(__name__)
# ========================================================================= #
# dataset_cars3d #
# ========================================================================= #
class Cars3dData(DownloadableGroundTruthData):
"""
Cars3D Dataset
- Deep Visual Analogy-Making (https://papers.nips.cc/paper/5845-deep-visual-analogy-making)
http://www.scottreed.info
Files:
- http://www.scottreed.info/files/nips2015-analogy-data.tar.gz
# reference implementation: https://github.com/google-research/disentanglement_lib/blob/master/disentanglement_lib/data/ground_truth/cars3d.py
"""
factor_names = ('elevation', 'azimuth', 'object_type')
factor_sizes = (4, 24, 183) # TOTAL: 17568
observation_shape = (128, 128, 3)
dataset_urls = ['http://www.scottreed.info/files/nips2015-analogy-data.tar.gz']
def __init__(self, data_dir='data/dataset/cars3d', force_download=False):
super().__init__(data_dir=data_dir, force_download=force_download)
converted_file = self._make_converted_file(data_dir, force_download)
if not hasattr(self.__class__, '_DATA'):
# store data on class
self.__class__._DATA = np.load(converted_file)['images']
def __getitem__(self, idx):
return self.__class__._DATA[idx]
def _make_converted_file(self, data_dir, force_download):
# get files & folders
zip_path = self.dataset_paths[0]
dataset_dir = os.path.splitext(os.path.splitext(zip_path)[0])[0] # remove .tar & .gz, name of directory after renaming
images_dir = os.path.join(dataset_dir, 'cars') # mesh folder inside renamed folder
converted_file = os.path.join(dataset_dir, 'cars.npz')
if not os.path.exists(converted_file) or force_download:
# extract data if required
if (not os.path.exists(images_dir)) or force_download:
extract_dir = os.path.join(data_dir, 'data') # directory after extracting, before renaming
# make sure the extract directory doesnt exist
if os.path.exists(extract_dir):
shutil.rmtree(extract_dir)
if os.path.exists(dataset_dir):
shutil.rmtree(dataset_dir)
# extract the files
log.info(f'[UNZIPPING]: {zip_path} to {dataset_dir}')
shutil.unpack_archive(zip_path, data_dir)
# rename dir
shutil.move(extract_dir, dataset_dir)
images = self._load_cars3d_images(images_dir)
log.info(f'[CONVERTING]: {converted_file}')
np.savez(os.path.splitext(converted_file)[0], images=images)
return converted_file
@staticmethod
def _load_cars3d_images(images_dir):
images = []
log.info(f'[LOADING]: {images_dir}')
with open(os.path.join(images_dir, 'list.txt'), 'r') as img_names:
for i, img_name in enumerate(img_names):
img_path = os.path.join(images_dir, f'{img_name.strip()}.mat')
img = loadmat(img_path)['im']
img = img[..., None].transpose([4, 3, 5, 0, 1, 2]) # (128, 128, 3, 24, 4, 1) -> (4, 24, 1, 128, 128, 3)
images.append(img)
return np.concatenate(images, axis=2).reshape([-1, 128, 128, 3]) # (4, 24, 183, 128, 128, 3) -> (17568, 1, 128, 128, 3)
# ========================================================================= #
# END #
# ========================================================================= #
if __name__ == '__main__':
Cars3dData()
|
import AxisLabel from './AxisLabel.vue'
import { valueToPoint } from './util.js'
export default {
components: {
AxisLabel
},
props: {
stats: Array
},
computed: {
// a computed property for the polygon's points
points() {
const total = this.stats.length
return this.stats
.map((stat, i) => {
const { x, y } = valueToPoint(stat.value, i, total)
return `${x},${y}`
})
.join(' ')
}
}
}
|
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes the specified Firewall Policy.
*
* @summary Deletes the specified Firewall Policy.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyDelete.json
*/
async function deleteFirewallPolicy() {
const subscriptionId = "subid";
const resourceGroupName = "rg1";
const firewallPolicyName = "firewallPolicy";
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.firewallPolicies.beginDeleteAndWait(
resourceGroupName,
firewallPolicyName
);
console.log(result);
}
deleteFirewallPolicy().catch(console.error);
|
/*!
* html2canvas 1.0.0-rc.5 <https://html2canvas.hertzen.com>
* Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A=A||self).html2canvas=e()}(this,function(){"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 r=function(A,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)};function A(A,e){function t(){this.constructor=A}r(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var K=function(){return(K=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n]);return A}).apply(this,arguments)};function a(B,s,o,i){return new(o||(o=Promise))(function(A,e){function t(A){try{n(i.next(A))}catch(A){e(A)}}function r(A){try{n(i.throw(A))}catch(A){e(A)}}function n(e){e.done?A(e.value):new o(function(A){A(e.value)}).then(t,r)}n((i=i.apply(B,s||[])).next())})}function S(t,r){var n,B,s,A,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return A={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function e(e){return function(A){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,B&&(s=2&e[0]?B.return:e[0]?B.throw||((s=B.return)&&s.call(B),0):B.next)&&!(s=s.call(B,e[1])).done)return s;switch(B=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return o.label++,{value:e[1],done:!1};case 5:o.label++,B=e[1],e=[0];continue;case 7:e=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){o=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){o.label=e[1];break}if(6===e[0]&&o.label<s[1]){o.label=s[1],s=e;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(e);break}s[2]&&o.ops.pop(),o.trys.pop();continue}e=r.call(t,o)}catch(A){e=[6,A],B=0}finally{n=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,A])}}}var I=(n.prototype.add=function(A,e,t,r){return new n(this.left+A,this.top+e,this.width+t,this.height+r)},n.fromClientRect=function(A){return new n(A.left,A.top,A.width,A.height)},n);function n(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}for(var T=function(A){return I.fromClientRect(A.getBoundingClientRect())},c=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(55296<=n&&n<=56319&&t<r){var B=A.charCodeAt(t++);56320==(64512&B)?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--)}else e.push(n)}return e},l=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,B="";++n<t;){var s=A[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===t||16384<r.length)&&(B+=String.fromCharCode.apply(String,r),r.length=0)}return B},e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q="undefined"==typeof Uint8Array?[]:new Uint8Array(256),t=0;t<e.length;t++)Q[e.charCodeAt(t)]=t;function B(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))}var s=(o.prototype.get=function(A){var e;if(0<=A){if(A<55296||56319<A&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},o);function o(A,e,t,r,n,B){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=B}function C(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){if((i=r[++B])===e)return!0;if(i!==H)break}if(n===H)for(B=t;0<B;){var s=r[--B];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o=t;o<=r.length;){var i;if((i=r[++o])===e)return!0;if(i!==H)break}if(s!==H)break}return!1}function g(A,e){for(var t=A;0<=t;){var r=e[t];if(r!==H)return r;t--}return 0}function w(A,e,t,r,n){if(0===t[r])return Y;var B=r-1;if(Array.isArray(n)&&!0===n[B])return Y;var s=B-1,o=1+B,i=e[B],a=0<=s?e[s]:0,c=e[o];if(2===i&&3===c)return Y;if(-1!==j.indexOf(i))return"!";if(-1!==j.indexOf(c))return Y;if(-1!==$.indexOf(c))return Y;if(8===g(B,e))return"÷";if(11===q.get(A[B])&&(c===X||c===P||c===x))return Y;if(7===i||7===c)return Y;if(9===i)return Y;if(-1===[H,d,f].indexOf(i)&&9===c)return Y;
// LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
if(-1!==[p,N,m,O,y].indexOf(c))return Y;if(g(B,e)===v)return Y;if(C(23,v,B,e))return Y;if(C([p,N],L,B,e))return Y;if(C(12,12,B,e))return Y;if(i===H)return"÷";if(23===i||23===c)return Y;if(16===c||16===i)return"÷";if(-1!==[d,f,L].indexOf(c)||14===i)return Y;if(36===a&&-1!==rA.indexOf(i))return Y;if(i===y&&36===c)return Y;if(c===R&&-1!==Z.concat(R,m,D,X,P,x).indexOf(i))return Y;if(-1!==Z.indexOf(c)&&i===D||-1!==Z.indexOf(i)&&c===D)return Y;if(i===M&&-1!==[X,P,x].indexOf(c)||-1!==[X,P,x].indexOf(i)&&c===b)return Y;if(-1!==Z.indexOf(i)&&-1!==AA.indexOf(c)||-1!==AA.indexOf(i)&&-1!==Z.indexOf(c))return Y;if(-1!==[M,b].indexOf(i)&&(c===D||-1!==[v,f].indexOf(c)&&e[1+o]===D)||-1!==[v,f].indexOf(i)&&c===D||i===D&&-1!==[D,y,O].indexOf(c))return Y;if(-1!==[D,y,O,p,N].indexOf(c))for(var Q=B;0<=Q;){if((w=e[Q])===D)return Y;if(-1===[y,O].indexOf(w))break;Q--}if(-1!==[M,b].indexOf(c))for(Q=-1!==[p,N].indexOf(i)?s:B;0<=Q;){var w;if((w=e[Q])===D)return Y;if(-1===[y,O].indexOf(w))break;Q--}if(J===i&&-1!==[J,G,V,z].indexOf(c)||-1!==[G,V].indexOf(i)&&-1!==[G,k].indexOf(c)||-1!==[k,z].indexOf(i)&&c===k)return Y;if(-1!==tA.indexOf(i)&&-1!==[R,b].indexOf(c)||-1!==tA.indexOf(c)&&i===M)return Y;if(-1!==Z.indexOf(i)&&-1!==Z.indexOf(c))return Y;if(i===O&&-1!==Z.indexOf(c))return Y;if(-1!==Z.concat(D).indexOf(i)&&c===v||-1!==Z.concat(D).indexOf(c)&&i===N)return Y;if(41===i&&41===c){for(var u=t[B],U=1;0<u&&41===e[--u];)U++;if(U%2!=0)return Y}return i===P&&c===x?Y:"÷"}function u(t,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var e=function(A,n){void 0===n&&(n="strict");var B=[],s=[],o=[];return A.forEach(function(A,e){var t=q.get(A);if(50<t?(o.push(!0),t-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(n)&&-1!==[8208,8211,12316,12448].indexOf(A))return s.push(e),B.push(16);if(4!==t&&11!==t)return s.push(e),31===t?B.push("strict"===n?L:X):t===W?B.push(_):29===t?B.push(_):43===t?131072<=A&&A<=196605||196608<=A&&A<=262141?B.push(X):B.push(_):void B.push(t);if(0===e)return s.push(e),B.push(_);var r=B[e-1];return-1===eA.indexOf(r)?(s.push(s[e-1]),B.push(r)):(s.push(e),B.push(_))}),[s,B,o]}(t,A.lineBreak),r=e[0],n=e[1],B=e[2];return"break-all"!==A.wordBreak&&"break-word"!==A.wordBreak||(n=n.map(function(A){return-1!==[D,_,W].indexOf(A)?X:A})),[r,n,"keep-all"===A.wordBreak?B.map(function(A,e){return A&&19968<=t[e]&&t[e]<=40959}):void 0]}var i,U,E,F,h,H=10,d=13,f=15,p=17,N=18,m=19,R=20,L=21,v=22,O=24,D=25,b=26,M=27,y=28,_=30,P=32,x=33,V=34,z=35,X=37,J=38,G=39,k=40,W=42,Y="×",q=(i=function(A){var e,t,r,n,B,s=.75*A.length,o=A.length,i=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e<o;e+=4)t=Q[A.charCodeAt(e)],r=Q[A.charCodeAt(e+1)],n=Q[A.charCodeAt(e+2)],B=Q[A.charCodeAt(e+3)],c[i++]=t<<2|r>>4,c[i++]=(15&r)<<4|n>>2,c[i++]=(3&n)<<6|63&B;return a}("KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"),U=Array.isArray(i)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(i):new Uint32Array(i),E=Array.isArray(i)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(i):new Uint16Array(i),F=B(E,12,U[4]/2),h=2===U[5]?B(E,(24+U[4])/2):function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))}(U,Math.ceil((24+U[4])/4)),new s(U[0],U[1],U[2],U[3],F,h)),Z=[_,36],j=[1,2,3,5],$=[H,8],AA=[M,b],eA=j.concat($),tA=[J,G,k,V,z],rA=[f,d],nA=(BA.prototype.slice=function(){return l.apply(void 0,this.codePoints.slice(this.start,this.end))},BA);function BA(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}var sA,oA;(oA=sA||(sA={}))[oA.STRING_TOKEN=0]="STRING_TOKEN",oA[oA.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",oA[oA.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",oA[oA.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",oA[oA.COMMA_TOKEN=4]="COMMA_TOKEN",oA[oA.HASH_TOKEN=5]="HASH_TOKEN",oA[oA.DELIM_TOKEN=6]="DELIM_TOKEN",oA[oA.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",oA[oA.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",oA[oA.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",oA[oA.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",oA[oA.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",oA[oA.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",oA[oA.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",oA[oA.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",oA[oA.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",oA[oA.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",oA[oA.NUMBER_TOKEN=17]="NUMBER_TOKEN",oA[oA.FUNCTION=18]="FUNCTION",oA[oA.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",oA[oA.IDENT_TOKEN=20]="IDENT_TOKEN",oA[oA.COLUMN_TOKEN=21]="COLUMN_TOKEN",oA[oA.URL_TOKEN=22]="URL_TOKEN",oA[oA.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",oA[oA.CDC_TOKEN=24]="CDC_TOKEN",oA[oA.CDO_TOKEN=25]="CDO_TOKEN",oA[oA.COLON_TOKEN=26]="COLON_TOKEN",oA[oA.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",oA[oA.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",oA[oA.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",oA[oA.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",oA[oA.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",oA[oA.EOF_TOKEN=32]="EOF_TOKEN";function iA(A){return 48<=A&&A<=57}function aA(A){return iA(A)||65<=A&&A<=70||97<=A&&A<=102}function cA(A){return 10===A||9===A||32===A}function QA(A){return function(A){return function(A){return 97<=A&&A<=122}(A)||function(A){return 65<=A&&A<=90}(A)}(A)||function(A){return 128<=A}(A)||95===A}function wA(A){return QA(A)||iA(A)||45===A}function uA(A,e){return 92===A&&10!==e}function UA(A,e,t){return 45===A?QA(e)||uA(e,t):!!QA(A)||!(92!==A||!uA(A,e))}function lA(A,e,t){return 43===A||45===A?!!iA(e)||46===e&&iA(t):iA(46===A?e:A)}var CA={type:sA.LEFT_PARENTHESIS_TOKEN},gA={type:sA.RIGHT_PARENTHESIS_TOKEN},EA={type:sA.COMMA_TOKEN},FA={type:sA.SUFFIX_MATCH_TOKEN},hA={type:sA.PREFIX_MATCH_TOKEN},HA={type:sA.COLUMN_TOKEN},dA={type:sA.DASH_MATCH_TOKEN},fA={type:sA.INCLUDE_MATCH_TOKEN},pA={type:sA.LEFT_CURLY_BRACKET_TOKEN},NA={type:sA.RIGHT_CURLY_BRACKET_TOKEN},KA={type:sA.SUBSTRING_MATCH_TOKEN},IA={type:sA.BAD_URL_TOKEN},TA={type:sA.BAD_STRING_TOKEN},mA={type:sA.CDO_TOKEN},RA={type:sA.CDC_TOKEN},LA={type:sA.COLON_TOKEN},vA={type:sA.SEMICOLON_TOKEN},OA={type:sA.LEFT_SQUARE_BRACKET_TOKEN},DA={type:sA.RIGHT_SQUARE_BRACKET_TOKEN},bA={type:sA.WHITESPACE_TOKEN},SA={type:sA.EOF_TOKEN},MA=(yA.prototype.write=function(A){this._value=this._value.concat(c(A))},yA.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==SA;)A.push(e),e=this.consumeToken();return A},yA.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(wA(e)||uA(t,r)){var n=UA(e,t,r)?2:1,B=this.consumeName();return{type:sA.HASH_TOKEN,value:B,flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),FA;break;case 39:return this.consumeStringToken(39);case 40:return CA;case 41:return gA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),KA;break;case 43:if(lA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return EA;case 45:var s=A,o=this.peekCodePoint(0),i=this.peekCodePoint(1);if(lA(s,o,i))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(UA(s,o,i))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===o&&62===i)return this.consumeCodePoint(),this.consumeCodePoint(),RA;break;case 46:if(lA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var a=this.consumeCodePoint();if(42===a&&47===(a=this.consumeCodePoint()))return this.consumeToken();if(-1===a)return this.consumeToken()}break;case 58:return LA;case 59:return vA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),mA;break;case 64:var c=this.peekCodePoint(0),Q=this.peekCodePoint(1),w=this.peekCodePoint(2);if(UA(c,Q,w))return B=this.consumeName(),{type:sA.AT_KEYWORD_TOKEN,value:B};break;case 91:return OA;case 92:if(uA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return DA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),hA;break;case 123:return pA;case 125:return NA;case 117:case 85:var u=this.peekCodePoint(0),U=this.peekCodePoint(1);return 43!==u||!aA(U)&&63!==U||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),dA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),HA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fA;break;case-1:return SA}return cA(A)?(this.consumeWhiteSpace(),bA):iA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):QA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:sA.DELIM_TOKEN,value:l(A)}},yA.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},yA.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},yA.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},yA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();aA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(l.apply(void 0,A.map(function(A){return 63===A?48:A})),16),n=parseInt(l.apply(void 0,A.map(function(A){return 63===A?70:A})),16);return{type:sA.UNICODE_RANGE_TOKEN,start:r,end:n}}var B=parseInt(l.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&aA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var s=[];aA(e)&&s.length<6;)s.push(e),e=this.consumeCodePoint();return n=parseInt(l.apply(void 0,s),16),{type:sA.UNICODE_RANGE_TOKEN,start:B,end:n}}return{type:sA.UNICODE_RANGE_TOKEN,start:B,end:B}},yA.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:sA.FUNCTION_TOKEN,value:A}):{type:sA.IDENT_TOKEN,value:A}},yA.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:sA.URL_TOKEN,value:""};var e,t=this.peekCodePoint(0);if(39===t||34===t){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===sA.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:sA.URL_TOKEN,value:r.value}):(this.consumeBadUrlRemnants(),IA)}for(;;){var n=this.consumeCodePoint();if(-1===n||41===n)return{type:sA.URL_TOKEN,value:l.apply(void 0,A)};if(cA(n))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:sA.URL_TOKEN,value:l.apply(void 0,A)}):(this.consumeBadUrlRemnants(),IA);if(34===n||39===n||40===n||0<=(e=n)&&e<=8||11===e||14<=e&&e<=31||127===e)return this.consumeBadUrlRemnants(),IA;if(92===n){if(!uA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),IA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},yA.prototype.consumeWhiteSpace=function(){for(;cA(this.peekCodePoint(0));)this.consumeCodePoint()},yA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;uA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},yA.prototype.consumeStringSlice=function(A){for(var e="";0<A;){var t=Math.min(6e4,A);e+=l.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},yA.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(-1===r||void 0===r||r===A)return e+=this.consumeStringSlice(t),{type:sA.STRING_TOKEN,value:e};if(10===r)return this._value.splice(0,t),TA;if(92===r){var n=this._value[t+1];-1!==n&&void 0!==n&&(10===n?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):uA(r,n)&&(e+=this.consumeStringSlice(t),e+=l(this.consumeEscapedCodePoint()),t=-1))}t++}},yA.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(43!==t&&45!==t||A.push(this.consumeCodePoint());iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&iA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&iA(n)||iA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;iA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[function(A){var e=0,t=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(t=-1),e++);for(var r=[];iA(A[e]);)r.push(A[e++]);var n=r.length?parseInt(l.apply(void 0,r),10):0;46===A[e]&&e++;for(var B=[];iA(A[e]);)B.push(A[e++]);var s=B.length,o=s?parseInt(l.apply(void 0,B),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(i=-1),e++);for(var a=[];iA(A[e]);)a.push(A[e++]);var c=a.length?parseInt(l.apply(void 0,a),10):0;return t*(n+o*Math.pow(10,-s))*Math.pow(10,i*c)}(A),e]},yA.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),B=this.peekCodePoint(2);if(UA(r,n,B)){var s=this.consumeName();return{type:sA.DIMENSION_TOKEN,number:e,flags:t,unit:s}}return 37===r?(this.consumeCodePoint(),{type:sA.PERCENTAGE_TOKEN,number:e,flags:t}):{type:sA.NUMBER_TOKEN,number:e,flags:t}},yA.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(aA(A)){for(var e=l(A);aA(this.peekCodePoint(0))&&e.length<6;)e+=l(this.consumeCodePoint());cA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return 55296<=A&&A<=57343}(t)||1114111<t?65533:t}return-1===A?65533:A},yA.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(wA(e))A+=l(e);else{if(!uA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=l(this.consumeEscapedCodePoint())}}},yA);function yA(){this._value=[]}var _A=(PA.create=function(A){var e=new MA;return e.write(A),new PA(e.read())},PA.parseValue=function(A){return PA.create(A).parseComponentValue()},PA.parseValues=function(A){return PA.create(A).parseComponentValues()},PA.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===sA.WHITESPACE_TOKEN;)A=this.consumeToken();if(A.type===sA.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);for(var e=this.consumeComponentValue();(A=this.consumeToken()).type===sA.WHITESPACE_TOKEN;);if(A.type===sA.EOF_TOKEN)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},PA.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(e.type===sA.EOF_TOKEN)return A;A.push(e),A.push()}},PA.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case sA.LEFT_CURLY_BRACKET_TOKEN:case sA.LEFT_SQUARE_BRACKET_TOKEN:case sA.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(A.type);case sA.FUNCTION_TOKEN:return this.consumeFunction(A)}return A},PA.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(t.type===sA.EOF_TOKEN||Be(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},PA.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:sA.FUNCTION};;){var t=this.consumeToken();if(t.type===sA.EOF_TOKEN||t.type===sA.RIGHT_PARENTHESIS_TOKEN)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},PA.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?SA:A},PA.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},PA);function PA(A){this._tokens=A}function xA(A){return A.type===sA.DIMENSION_TOKEN}function VA(A){return A.type===sA.NUMBER_TOKEN}function zA(A){return A.type===sA.IDENT_TOKEN}function XA(A){return A.type===sA.STRING_TOKEN}function JA(A,e){return zA(A)&&A.value===e}function GA(A){return A.type!==sA.WHITESPACE_TOKEN}function kA(A){return A.type!==sA.WHITESPACE_TOKEN&&A.type!==sA.COMMA_TOKEN}function WA(A){var e=[],t=[];return A.forEach(function(A){if(A.type===sA.COMMA_TOKEN){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}A.type!==sA.WHITESPACE_TOKEN&&t.push(A)}),t.length&&e.push(t),e}function YA(A){return A.type===sA.NUMBER_TOKEN||A.type===sA.DIMENSION_TOKEN}function qA(A){return A.type===sA.PERCENTAGE_TOKEN||YA(A)}function ZA(A){return 1<A.length?[A[0],A[1]]:[A[0]]}function jA(A,e,t){var r=A[0],n=A[1];return[ae(r,e),ae(void 0!==n?n:r,t)]}function $A(A){return A.type===sA.DIMENSION_TOKEN&&("deg"===A.unit||"grad"===A.unit||"rad"===A.unit||"turn"===A.unit)}function Ae(A){switch(A.filter(zA).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[se,se];case"to top":case"bottom":return Qe(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[se,ie];case"to right":case"left":return Qe(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ie,ie];case"to bottom":case"top":return Qe(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ie,se];case"to left":case"right":return Qe(270)}return 0}function ee(A){return 0==(255&A)}function te(A){var e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"}function re(A,e){if(A.type===sA.NUMBER_TOKEN)return A.number;if(A.type!==sA.PERCENTAGE_TOKEN)return 0;var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}function ne(A){var e=A.filter(kA);if(3===e.length){var t=e.map(re),r=t[0],n=t[1],B=t[2];return ue(r,n,B,1)}if(4!==e.length)return 0;var s=e.map(re),o=(r=s[0],n=s[1],B=s[2],s[3]);return ue(r,n,B,o)}var Be=function(A,e){return e===sA.LEFT_CURLY_BRACKET_TOKEN&&A.type===sA.RIGHT_CURLY_BRACKET_TOKEN||(e===sA.LEFT_SQUARE_BRACKET_TOKEN&&A.type===sA.RIGHT_SQUARE_BRACKET_TOKEN||e===sA.LEFT_PARENTHESIS_TOKEN&&A.type===sA.RIGHT_PARENTHESIS_TOKEN)},se={type:sA.NUMBER_TOKEN,number:0,flags:4},oe={type:sA.PERCENTAGE_TOKEN,number:50,flags:4},ie={type:sA.PERCENTAGE_TOKEN,number:100,flags:4},ae=function(A,e){if(A.type===sA.PERCENTAGE_TOKEN)return A.number/100*e;if(xA(A))switch(A.unit){case"rem":case"em":return 16*A.number;case"px":default:return A.number}return A.number},ce=function(A){if(A.type===sA.DIMENSION_TOKEN)switch(A.unit){case"deg":return Math.PI*A.number/180;case"grad":return Math.PI/200*A.number;case"rad":return A.number;case"turn":return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},Qe=function(A){return Math.PI*A/180},we=function(A){if(A.type===sA.FUNCTION){var e=he[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(A.values)}if(A.type===sA.HASH_TOKEN){if(3===A.value.length){var t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);return ue(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===A.value.length){t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);var B=A.value.substring(3,4);return ue(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(B+B,16)/255)}if(6===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6);return ue(parseInt(t,16),parseInt(r,16),parseInt(n,16),1)}if(8===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6),B=A.value.substring(6,8);return ue(parseInt(t,16),parseInt(r,16),parseInt(n,16),parseInt(B,16)/255)}}if(A.type===sA.IDENT_TOKEN){var s=He[A.value.toUpperCase()];if(void 0!==s)return s}return He.TRANSPARENT},ue=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0};function Ue(A,e,t){return t<0&&(t+=1),1<=t&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function le(A){var e=A.filter(kA),t=e[0],r=e[1],n=e[2],B=e[3],s=(t.type===sA.NUMBER_TOKEN?Qe(t.number):ce(t))/(2*Math.PI),o=qA(r)?r.number/100:0,i=qA(n)?n.number/100:0,a=void 0!==B&&qA(B)?ae(B,1):1;if(0==o)return ue(255*i,255*i,255*i,1);var c=i<=.5?i*(1+o):i+o-i*o,Q=2*i-c,w=Ue(Q,c,s+1/3),u=Ue(Q,c,s),U=Ue(Q,c,s-1/3);return ue(255*w,255*u,255*U,a)}var Ce,ge,Ee,Fe,he={hsl:le,hsla:le,rgb:ne,rgba:ne},He={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(ge=Ce||(Ce={}))[ge.VALUE=0]="VALUE",ge[ge.LIST=1]="LIST",ge[ge.IDENT_VALUE=2]="IDENT_VALUE",ge[ge.TYPE_VALUE=3]="TYPE_VALUE",ge[ge.TOKEN_VALUE=4]="TOKEN_VALUE",(Fe=Ee||(Ee={}))[Fe.BORDER_BOX=0]="BORDER_BOX",Fe[Fe.PADDING_BOX=1]="PADDING_BOX";function de(A){var e=we(A[0]),t=A[1];return t&&qA(t)?{color:e,stop:t}:{color:e,stop:null}}function fe(A,t){var e=A[0],r=A[A.length-1];null===e.stop&&(e.stop=se),null===r.stop&&(r.stop=ie);for(var n=[],B=0,s=0;s<A.length;s++){var o=A[s].stop;if(null!==o){var i=ae(o,t);B<i?n.push(i):n.push(B),B=i}else n.push(null)}var a=null;for(s=0;s<n.length;s++){var c=n[s];if(null===c)null===a&&(a=s);else if(null!==a){for(var Q=s-a,w=(c-n[a-1])/(1+Q),u=1;u<=Q;u++)n[a+u-1]=w*u;a=null}}return A.map(function(A,e){return{color:A.color,stop:Math.max(Math.min(1,n[e]/t),0)}})}function pe(A,e,t){var r="number"==typeof A?A:function(A,e,t){var r=e/2,n=t/2,B=ae(A[0],e)-r,s=n-ae(A[1],t);return(Math.atan2(s,B)+2*Math.PI)%(2*Math.PI)}(A,e,t),n=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),B=e/2,s=t/2,o=n/2,i=Math.sin(r-Math.PI/2)*o,a=Math.cos(r-Math.PI/2)*o;return[n,B-a,B+a,s-i,s+i]}function Ne(A,e){return Math.sqrt(A*A+e*e)}function Ke(A,e,B,s,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var t=e[0],r=e[1],n=Ne(B-t,s-r);return(o?n<A.optimumDistance:n>A.optimumDistance)?{optimumCorner:e,optimumDistance:n}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner}function Ie(A){var n=Qe(180),B=[];return WA(A).forEach(function(A,e){if(0===e){var t=A[0];if(t.type===sA.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(t.value))return void(n=Ae(A));if($A(t))return void(n=(ce(t)+Qe(270))%Qe(360))}var r=de(A);B.push(r)}),{angle:n,stops:B,type:xe.LINEAR_GRADIENT}}function Te(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var me={name:"background-clip",initialValue:"border-box",prefix:!(Fe[Fe.CONTENT_BOX=2]="CONTENT_BOX"),type:Ce.LIST,parse:function(A){return A.map(function(A){if(zA(A))switch(A.value){case"padding-box":return Ee.PADDING_BOX;case"content-box":return Ee.CONTENT_BOX}return Ee.BORDER_BOX})}},Re={name:"background-color",initialValue:"transparent",prefix:!1,type:Ce.TYPE_VALUE,format:"color"},Le=function(A,e,t,r,n){var B="http://www.w3.org/2000/svg",s=document.createElementNS(B,"svg"),o=document.createElementNS(B,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},ve=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(r))})},Oe={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(Oe,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Oe,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(r){var A=r.createElement("canvas"),n=100;A.width=n,A.height=n;var B=A.getContext("2d");if(!B)return Promise.reject(!1);B.fillStyle="rgb(0, 255, 0)",B.fillRect(0,0,n,n);var e=new Image,s=A.toDataURL();e.src=s;var t=Le(n,n,0,0,e);return B.fillStyle="red",B.fillRect(0,0,n,n),ve(t).then(function(A){B.drawImage(A,0,0);var e=B.getImageData(0,0,n,n).data;B.fillStyle="red",B.fillRect(0,0,n,n);var t=r.createElement("div");return t.style.backgroundImage="url("+s+")",t.style.height="100px",Te(e)?ve(Le(n,n,0,0,t)):Promise.reject(!1)}).then(function(A){return B.drawImage(A,0,0),Te(B.getImageData(0,0,n,n).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Oe,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Oe,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Oe,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Oe,"SUPPORT_CORS_XHR",{value:A}),A}},De=(be.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},be.prototype.getTime=function(){return Date.now()-this.start},be.create=function(A){be.instances[A.id]=new be(A)},be.destroy=function(A){delete be.instances[A]},be.getInstance=function(A){var e=be.instances[A];if(void 0===e)throw new Error("No logger instance found with id "+A);return e},be.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,[this.id,this.getTime()+"ms"].concat(A))},be.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},be.instances={},be);function be(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}var Se=(Me.create=function(A,e){return Me._caches[A]=new ye(A,e)},Me.destroy=function(A){delete Me._caches[A]},Me.open=function(A){var e=Me._caches[A];if(void 0!==e)return e;throw new Error('Cache with key "'+A+'" not found')},Me.getOrigin=function(A){var e=Me._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},Me.isSameOrigin=function(A){return Me.getOrigin(A)===Me._origin},Me.setContext=function(A){Me._link=A.document.createElement("a"),Me._origin=Me.getOrigin(A.location.href)},Me.getInstance=function(){var A=Me._current;if(null===A)throw new Error("No cache instance attached");return A},Me.attachInstance=function(A){Me._current=A},Me.detachInstance=function(){Me._current=null},Me._caches={},Me._origin="about:blank",Me._current=null,Me);function Me(){}var ye=(_e.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Ye(A)||Ge(A))&&(this._cache[A]=this.loadImage(A)),e},_e.prototype.match=function(A){return this._cache[A]},_e.prototype.loadImage=function(s){return a(this,void 0,void 0,function(){var e,r,t,n,B=this;return S(this,function(A){switch(A.label){case 0:return e=Se.isSameOrigin(s),r=!ke(s)&&!0===this._options.useCORS&&Oe.SUPPORT_CORS_IMAGES&&!e,t=!ke(s)&&!e&&"string"==typeof this._options.proxy&&Oe.SUPPORT_CORS_XHR&&!r,e||!1!==this._options.allowTaint||ke(s)||t||r?(n=s,t?[4,this.proxy(n)]:[3,2]):[2];case 1:n=A.sent(),A.label=2;case 2:return De.getInstance(this.id).debug("Added image "+s.substring(0,256)),[4,new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(We(n)||r)&&(t.crossOrigin="anonymous"),t.src=n,!0===t.complete&&setTimeout(function(){return A(t)},500),0<B._options.imageTimeout&&setTimeout(function(){return e("Timed out ("+B._options.imageTimeout+"ms) loading image")},B._options.imageTimeout)})];case 3:return[2,A.sent()]}})})},_e.prototype.has=function(A){return void 0!==this._cache[A]},_e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},_e.prototype.proxy=function(B){var s=this,o=this._options.proxy;if(!o)throw new Error("No proxy defined");var i=B.substring(0,256);return new Promise(function(e,t){var r=Oe.SUPPORT_RESPONSE_TYPE?"blob":"text",n=new XMLHttpRequest;if(n.onload=function(){if(200===n.status)if("text"==r)e(n.response);else{var A=new FileReader;A.addEventListener("load",function(){return e(A.result)},!1),A.addEventListener("error",function(A){return t(A)},!1),A.readAsDataURL(n.response)}else t("Failed to proxy resource "+i+" with status code "+n.status)},n.onerror=t,n.open("GET",o+"?url="+encodeURIComponent(B)+"&responseType="+r),"text"!=r&&n instanceof XMLHttpRequest&&(n.responseType=r),s._options.imageTimeout){var A=s._options.imageTimeout;n.timeout=A,n.ontimeout=function(){return t("Timed out ("+A+"ms) proxying "+i)}}n.send()})},_e);function _e(A,e){this.id=A,this._options=e,this._cache={}}function Pe(A){var n=rt.CIRCLE,B=Bt.FARTHEST_CORNER,s=[],o=[];return WA(A).forEach(function(A,e){var t=!0;if(0===e?t=A.reduce(function(A,e){if(zA(e))switch(e.value){case"center":return o.push(oe),!1;case"top":case"left":return o.push(se),!1;case"right":case"bottom":return o.push(ie),!1}else if(qA(e)||YA(e))return o.push(e),!1;return A},t):1===e&&(t=A.reduce(function(A,e){if(zA(e))switch(e.value){case"circle":return n=rt.CIRCLE,!1;case et:return n=rt.ELLIPSE,!1;case tt:case Ze:return B=Bt.CLOSEST_SIDE,!1;case je:return B=Bt.FARTHEST_SIDE,!1;case $e:return B=Bt.CLOSEST_CORNER,!1;case"cover":case At:return B=Bt.FARTHEST_CORNER,!1}else if(YA(e)||qA(e))return Array.isArray(B)||(B=[]),B.push(e),!1;return A},t)),t){var r=de(A);s.push(r)}}),{size:B,shape:n,stops:s,position:o,type:xe.RADIAL_GRADIENT}}var xe,Ve,ze=/^data:image\/svg\+xml/i,Xe=/^data:image\/.*;base64,/i,Je=/^data:image\/.*/i,Ge=function(A){return Oe.SUPPORT_SVG_DRAWING||!qe(A)},ke=function(A){return Je.test(A)},We=function(A){return Xe.test(A)},Ye=function(A){return"blob"===A.substr(0,4)},qe=function(A){return"svg"===A.substr(-3).toLowerCase()||ze.test(A)},Ze="closest-side",je="farthest-side",$e="closest-corner",At="farthest-corner",et="ellipse",tt="contain";(Ve=xe||(xe={}))[Ve.URL=0]="URL",Ve[Ve.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",Ve[Ve.RADIAL_GRADIENT=2]="RADIAL_GRADIENT";var rt,nt,Bt,st;(nt=rt||(rt={}))[nt.CIRCLE=0]="CIRCLE",nt[nt.ELLIPSE=1]="ELLIPSE",(st=Bt||(Bt={}))[st.CLOSEST_SIDE=0]="CLOSEST_SIDE",st[st.FARTHEST_SIDE=1]="FARTHEST_SIDE",st[st.CLOSEST_CORNER=2]="CLOSEST_CORNER",st[st.FARTHEST_CORNER=3]="FARTHEST_CORNER";var ot=function(A){if(A.type===sA.URL_TOKEN){var e={url:A.value,type:xe.URL};return Se.getInstance().addImage(A.value),e}if(A.type!==sA.FUNCTION)throw new Error("Unsupported image type");var t=ct[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return t(A.values)};var it,at,ct={"linear-gradient":function(A){var n=Qe(180),B=[];return WA(A).forEach(function(A,e){if(0===e){var t=A[0];if(t.type===sA.IDENT_TOKEN&&"to"===t.value)return void(n=Ae(A));if($A(t))return void(n=ce(t))}var r=de(A);B.push(r)}),{angle:n,stops:B,type:xe.LINEAR_GRADIENT}},"-moz-linear-gradient":Ie,"-ms-linear-gradient":Ie,"-o-linear-gradient":Ie,"-webkit-linear-gradient":Ie,"radial-gradient":function(A){var B=rt.CIRCLE,s=Bt.FARTHEST_CORNER,o=[],i=[];return WA(A).forEach(function(A,e){var t=!0;if(0===e){var r=!1;t=A.reduce(function(A,e){if(r)if(zA(e))switch(e.value){case"center":return i.push(oe),A;case"top":case"left":return i.push(se),A;case"right":case"bottom":return i.push(ie),A}else(qA(e)||YA(e))&&i.push(e);else if(zA(e))switch(e.value){case"circle":return B=rt.CIRCLE,!1;case et:return B=rt.ELLIPSE,!1;case"at":return!(r=!0);case Ze:return s=Bt.CLOSEST_SIDE,!1;case"cover":case je:return s=Bt.FARTHEST_SIDE,!1;case tt:case $e:return s=Bt.CLOSEST_CORNER,!1;case At:return s=Bt.FARTHEST_CORNER,!1}else if(YA(e)||qA(e))return Array.isArray(s)||(s=[]),s.push(e),!1;return A},t)}if(t){var n=de(A);o.push(n)}}),{size:s,shape:B,stops:o,position:i,type:xe.RADIAL_GRADIENT}},"-moz-radial-gradient":Pe,"-ms-radial-gradient":Pe,"-o-radial-gradient":Pe,"-webkit-radial-gradient":Pe,"-webkit-gradient":function(A){var e=Qe(180),s=[],o=xe.LINEAR_GRADIENT,t=rt.CIRCLE,r=Bt.FARTHEST_CORNER;return WA(A).forEach(function(A,e){var t=A[0];if(0===e){if(zA(t)&&"linear"===t.value)return void(o=xe.LINEAR_GRADIENT);if(zA(t)&&"radial"===t.value)return void(o=xe.RADIAL_GRADIENT)}if(t.type===sA.FUNCTION)if("from"===t.name){var r=we(t.values[0]);s.push({stop:se,color:r})}else if("to"===t.name)r=we(t.values[0]),s.push({stop:ie,color:r});else if("color-stop"===t.name){var n=t.values.filter(kA);if(2===n.length){r=we(n[1]);var B=n[0];VA(B)&&s.push({stop:{type:sA.PERCENTAGE_TOKEN,number:100*B.number,flags:B.flags},color:r})}}}),o===xe.LINEAR_GRADIENT?{angle:(e+Qe(180))%Qe(360),stops:s,type:o}:{size:r,shape:t,stops:s,position:[],type:o}}},Qt={name:"background-image",initialValue:"none",type:Ce.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===sA.IDENT_TOKEN&&"none"===e.value?[]:A.filter(function(A){return kA(A)&&function(A){return A.type!==sA.FUNCTION||ct[A.name]}(A)}).map(ot)}},wt={name:"background-origin",initialValue:"border-box",prefix:!1,type:Ce.LIST,parse:function(A){return A.map(function(A){if(zA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ut={name:"background-position",initialValue:"0% 0%",type:Ce.LIST,prefix:!1,parse:function(A){return WA(A).map(function(A){return A.filter(qA)}).map(ZA)}};(at=it||(it={}))[at.REPEAT=0]="REPEAT",at[at.NO_REPEAT=1]="NO_REPEAT",at[at.REPEAT_X=2]="REPEAT_X";var Ut,lt,Ct={name:"background-repeat",initialValue:"repeat",prefix:!(at[at.REPEAT_Y=3]="REPEAT_Y"),type:Ce.LIST,parse:function(A){return WA(A).map(function(A){return A.filter(zA).map(function(A){return A.value}).join(" ")}).map(gt)}},gt=function(A){switch(A){case"no-repeat":return it.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return it.REPEAT_X;case"repeat-y":case"no-repeat repeat":return it.REPEAT_Y;case"repeat":default:return it.REPEAT}};(lt=Ut||(Ut={})).AUTO="auto",lt.CONTAIN="contain";function Et(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:Ce.TYPE_VALUE,format:"color"}}function Ft(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:Ce.LIST,parse:function(A){return ZA(A.filter(qA))}}}var ht,Ht,dt={name:"background-size",initialValue:"0",prefix:!(lt.COVER="cover"),type:Ce.LIST,parse:function(A){return WA(A).map(function(A){return A.filter(ft)})}},ft=function(A){return zA(A)||qA(A)},pt=Et("top"),Nt=Et("right"),Kt=Et("bottom"),It=Et("left"),Tt=Ft("top-left"),mt=Ft("top-right"),Rt=Ft("bottom-right"),Lt=Ft("bottom-left");(Ht=ht||(ht={}))[Ht.NONE=0]="NONE",Ht[Ht.SOLID=1]="SOLID";function vt(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"none":return ht.NONE}return ht.SOLID}}}function Ot(A){return{name:"border-"+A+"-width",initialValue:"0",type:Ce.VALUE,prefix:!1,parse:function(A){return xA(A)?A.number:0}}}var Dt,bt,St=vt("top"),Mt=vt("right"),yt=vt("bottom"),_t=vt("left"),Pt=Ot("top"),xt=Ot("right"),Vt=Ot("bottom"),zt=Ot("left"),Xt={name:"color",initialValue:"transparent",prefix:!1,type:Ce.TYPE_VALUE,format:"color"},Jt={name:"display",initialValue:"inline-block",prefix:!1,type:Ce.LIST,parse:function(A){return A.filter(zA).reduce(function(A,e){return A|Gt(e.value)},0)}},Gt=function(A){switch(A){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};(bt=Dt||(Dt={}))[bt.NONE=0]="NONE",bt[bt.LEFT=1]="LEFT",bt[bt.RIGHT=2]="RIGHT",bt[bt.INLINE_START=3]="INLINE_START";var kt,Wt,Yt,qt,Zt={name:"float",initialValue:"none",prefix:!(bt[bt.INLINE_END=4]="INLINE_END"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"left":return Dt.LEFT;case"right":return Dt.RIGHT;case"inline-start":return Dt.INLINE_START;case"inline-end":return Dt.INLINE_END}return Dt.NONE}},jt={name:"letter-spacing",initialValue:"0",prefix:!1,type:Ce.VALUE,parse:function(A){return A.type===sA.IDENT_TOKEN&&"normal"===A.value?0:A.type===sA.NUMBER_TOKEN?A.number:A.type===sA.DIMENSION_TOKEN?A.number:0}},$t={name:"line-break",initialValue:(Wt=kt||(kt={})).NORMAL="normal",prefix:!(Wt.STRICT="strict"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"strict":return kt.STRICT;case"normal":default:return kt.NORMAL}}},Ar={name:"line-height",initialValue:"normal",prefix:!1,type:Ce.TOKEN_VALUE},er={name:"list-style-image",initialValue:"none",type:Ce.VALUE,prefix:!1,parse:function(A){return A.type===sA.IDENT_TOKEN&&"none"===A.value?null:ot(A)}};(qt=Yt||(Yt={}))[qt.INSIDE=0]="INSIDE";var tr,rr,nr={name:"list-style-position",initialValue:"outside",prefix:!(qt[qt.OUTSIDE=1]="OUTSIDE"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"inside":return Yt.INSIDE;case"outside":default:return Yt.OUTSIDE}}};(rr=tr||(tr={}))[rr.NONE=-1]="NONE",rr[rr.DISC=0]="DISC",rr[rr.CIRCLE=1]="CIRCLE",rr[rr.SQUARE=2]="SQUARE",rr[rr.DECIMAL=3]="DECIMAL",rr[rr.CJK_DECIMAL=4]="CJK_DECIMAL",rr[rr.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",rr[rr.LOWER_ROMAN=6]="LOWER_ROMAN",rr[rr.UPPER_ROMAN=7]="UPPER_ROMAN",rr[rr.LOWER_GREEK=8]="LOWER_GREEK",rr[rr.LOWER_ALPHA=9]="LOWER_ALPHA",rr[rr.UPPER_ALPHA=10]="UPPER_ALPHA",rr[rr.ARABIC_INDIC=11]="ARABIC_INDIC",rr[rr.ARMENIAN=12]="ARMENIAN",rr[rr.BENGALI=13]="BENGALI",rr[rr.CAMBODIAN=14]="CAMBODIAN",rr[rr.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",rr[rr.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",rr[rr.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",rr[rr.DEVANAGARI=18]="DEVANAGARI",rr[rr.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",rr[rr.GEORGIAN=20]="GEORGIAN",rr[rr.GUJARATI=21]="GUJARATI",rr[rr.GURMUKHI=22]="GURMUKHI",rr[rr.HEBREW=22]="HEBREW",rr[rr.HIRAGANA=23]="HIRAGANA",rr[rr.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",rr[rr.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",rr[rr.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",rr[rr.KANNADA=27]="KANNADA",rr[rr.KATAKANA=28]="KATAKANA",rr[rr.KATAKANA_IROHA=29]="KATAKANA_IROHA",rr[rr.KHMER=30]="KHMER",rr[rr.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",rr[rr.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",rr[rr.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",rr[rr.LAO=34]="LAO",rr[rr.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",rr[rr.MALAYALAM=36]="MALAYALAM",rr[rr.MONGOLIAN=37]="MONGOLIAN",rr[rr.MYANMAR=38]="MYANMAR",rr[rr.ORIYA=39]="ORIYA",rr[rr.PERSIAN=40]="PERSIAN",rr[rr.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",rr[rr.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",rr[rr.TAMIL=43]="TAMIL",rr[rr.TELUGU=44]="TELUGU",rr[rr.THAI=45]="THAI",rr[rr.TIBETAN=46]="TIBETAN",rr[rr.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",rr[rr.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",rr[rr.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",rr[rr.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN";function Br(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:Ce.TOKEN_VALUE}}var sr,or,ir={name:"list-style-type",initialValue:"none",prefix:!(rr[rr.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"disc":return tr.DISC;case"circle":return tr.CIRCLE;case"square":return tr.SQUARE;case"decimal":return tr.DECIMAL;case"cjk-decimal":return tr.CJK_DECIMAL;case"decimal-leading-zero":return tr.DECIMAL_LEADING_ZERO;case"lower-roman":return tr.LOWER_ROMAN;case"upper-roman":return tr.UPPER_ROMAN;case"lower-greek":return tr.LOWER_GREEK;case"lower-alpha":return tr.LOWER_ALPHA;case"upper-alpha":return tr.UPPER_ALPHA;case"arabic-indic":return tr.ARABIC_INDIC;case"armenian":return tr.ARMENIAN;case"bengali":return tr.BENGALI;case"cambodian":return tr.CAMBODIAN;case"cjk-earthly-branch":return tr.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return tr.CJK_HEAVENLY_STEM;case"cjk-ideographic":return tr.CJK_IDEOGRAPHIC;case"devanagari":return tr.DEVANAGARI;case"ethiopic-numeric":return tr.ETHIOPIC_NUMERIC;case"georgian":return tr.GEORGIAN;case"gujarati":return tr.GUJARATI;case"gurmukhi":return tr.GURMUKHI;case"hebrew":return tr.HEBREW;case"hiragana":return tr.HIRAGANA;case"hiragana-iroha":return tr.HIRAGANA_IROHA;case"japanese-formal":return tr.JAPANESE_FORMAL;case"japanese-informal":return tr.JAPANESE_INFORMAL;case"kannada":return tr.KANNADA;case"katakana":return tr.KATAKANA;case"katakana-iroha":return tr.KATAKANA_IROHA;case"khmer":return tr.KHMER;case"korean-hangul-formal":return tr.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return tr.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return tr.KOREAN_HANJA_INFORMAL;case"lao":return tr.LAO;case"lower-armenian":return tr.LOWER_ARMENIAN;case"malayalam":return tr.MALAYALAM;case"mongolian":return tr.MONGOLIAN;case"myanmar":return tr.MYANMAR;case"oriya":return tr.ORIYA;case"persian":return tr.PERSIAN;case"simp-chinese-formal":return tr.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return tr.SIMP_CHINESE_INFORMAL;case"tamil":return tr.TAMIL;case"telugu":return tr.TELUGU;case"thai":return tr.THAI;case"tibetan":return tr.TIBETAN;case"trad-chinese-formal":return tr.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return tr.TRAD_CHINESE_INFORMAL;case"upper-armenian":return tr.UPPER_ARMENIAN;case"disclosure-open":return tr.DISCLOSURE_OPEN;case"disclosure-closed":return tr.DISCLOSURE_CLOSED;case"none":default:return tr.NONE}}},ar=Br("top"),cr=Br("right"),Qr=Br("bottom"),wr=Br("left");(or=sr||(sr={}))[or.VISIBLE=0]="VISIBLE",or[or.HIDDEN=1]="HIDDEN",or[or.SCROLL=2]="SCROLL";function ur(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:Ce.TYPE_VALUE,format:"length-percentage"}}var Ur,lr,Cr,gr,Er={name:"overflow",initialValue:"visible",prefix:!(or[or.AUTO=3]="AUTO"),type:Ce.LIST,parse:function(A){return A.filter(zA).map(function(A){switch(A.value){case"hidden":return sr.HIDDEN;case"scroll":return sr.SCROLL;case"auto":return sr.AUTO;case"visible":default:return sr.VISIBLE}})}},Fr={name:"overflow-wrap",initialValue:(lr=Ur||(Ur={})).NORMAL="normal",prefix:!(lr.BREAK_WORD="break-word"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"break-word":return Ur.BREAK_WORD;case"normal":default:return Ur.NORMAL}}},hr=ur("top"),Hr=ur("right"),dr=ur("bottom"),fr=ur("left");(gr=Cr||(Cr={}))[gr.LEFT=0]="LEFT",gr[gr.CENTER=1]="CENTER";var pr,Nr,Kr={name:"text-align",initialValue:"left",prefix:!(gr[gr.RIGHT=2]="RIGHT"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"right":return Cr.RIGHT;case"center":case"justify":return Cr.CENTER;case"left":default:return Cr.LEFT}}};(Nr=pr||(pr={}))[Nr.STATIC=0]="STATIC",Nr[Nr.RELATIVE=1]="RELATIVE",Nr[Nr.ABSOLUTE=2]="ABSOLUTE",Nr[Nr.FIXED=3]="FIXED";var Ir,Tr,mr={name:"position",initialValue:"static",prefix:!(Nr[Nr.STICKY=4]="STICKY"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"relative":return pr.RELATIVE;case"absolute":return pr.ABSOLUTE;case"fixed":return pr.FIXED;case"sticky":return pr.STICKY}return pr.STATIC}},Rr={name:"text-shadow",initialValue:"none",type:Ce.LIST,prefix:!1,parse:function(A){return 1===A.length&&JA(A[0],"none")?[]:WA(A).map(function(A){for(var e={color:He.TRANSPARENT,offsetX:se,offsetY:se,blur:se},t=0,r=0;r<A.length;r++){var n=A[r];YA(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:e.blur=n,t++):e.color=we(n)}return e})}};(Tr=Ir||(Ir={}))[Tr.NONE=0]="NONE",Tr[Tr.LOWERCASE=1]="LOWERCASE",Tr[Tr.UPPERCASE=2]="UPPERCASE";var Lr,vr,Or={name:"text-transform",initialValue:"none",prefix:!(Tr[Tr.CAPITALIZE=3]="CAPITALIZE"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"uppercase":return Ir.UPPERCASE;case"lowercase":return Ir.LOWERCASE;case"capitalize":return Ir.CAPITALIZE}return Ir.NONE}},Dr={name:"transform",initialValue:"none",prefix:!0,type:Ce.VALUE,parse:function(A){if(A.type===sA.IDENT_TOKEN&&"none"===A.value)return null;if(A.type!==sA.FUNCTION)return null;var e=br[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return e(A.values)}},br={matrix:function(A){var e=A.filter(function(A){return A.type===sA.NUMBER_TOKEN}).map(function(A){return A.number});return 6===e.length?e:null},matrix3d:function(A){var e=A.filter(function(A){return A.type===sA.NUMBER_TOKEN}).map(function(A){return A.number}),t=e[0],r=e[1],n=(e[2],e[3],e[4]),B=e[5],s=(e[6],e[7],e[8],e[9],e[10],e[11],e[12]),o=e[13];e[14],e[15];return 16===e.length?[t,r,n,B,s,o]:null}},Sr={type:sA.PERCENTAGE_TOKEN,number:50,flags:4},Mr=[Sr,Sr],yr={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:Ce.LIST,parse:function(A){var e=A.filter(qA);return 2!==e.length?Mr:[e[0],e[1]]}};(vr=Lr||(Lr={}))[vr.VISIBLE=0]="VISIBLE",vr[vr.HIDDEN=1]="HIDDEN";var _r,Pr,xr={name:"visible",initialValue:"none",prefix:!(vr[vr.COLLAPSE=2]="COLLAPSE"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"hidden":return Lr.HIDDEN;case"collapse":return Lr.COLLAPSE;case"visible":default:return Lr.VISIBLE}}};(Pr=_r||(_r={})).NORMAL="normal",Pr.BREAK_ALL="break-all";var Vr,zr,Xr={name:"word-break",initialValue:"normal",prefix:!(Pr.KEEP_ALL="keep-all"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"break-all":return _r.BREAK_ALL;case"keep-all":return _r.KEEP_ALL;case"normal":default:return _r.NORMAL}}},Jr={name:"z-index",initialValue:"auto",prefix:!1,type:Ce.VALUE,parse:function(A){if(A.type===sA.IDENT_TOKEN)return{auto:!0,order:0};if(VA(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},Gr={name:"opacity",initialValue:"1",type:Ce.VALUE,prefix:!1,parse:function(A){return VA(A)?A.number:1}},kr={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:Ce.TYPE_VALUE,format:"color"},Wr={name:"text-decoration-line",initialValue:"none",prefix:!1,type:Ce.LIST,parse:function(A){return A.filter(zA).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return 0!==A})}},Yr={name:"font-family",initialValue:"",prefix:!1,type:Ce.LIST,parse:function(A){return A.filter(qr).map(function(A){return A.value})}},qr=function(A){return A.type===sA.STRING_TOKEN||A.type===sA.IDENT_TOKEN},Zr={name:"font-size",initialValue:"0",prefix:!1,type:Ce.TYPE_VALUE,format:"length"},jr={name:"font-weight",initialValue:"normal",type:Ce.VALUE,prefix:!1,parse:function(A){if(VA(A))return A.number;if(zA(A))switch(A.value){case"bold":return 700;case"normal":default:return 400}return 400}},$r={name:"font-variant",initialValue:"none",type:Ce.LIST,prefix:!1,parse:function(A){return A.filter(zA).map(function(A){return A.value})}};(zr=Vr||(Vr={})).NORMAL="normal",zr.ITALIC="italic";function An(A,e){return 0!=(A&e)}function en(A,e,t){if(!A)return"";var r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""}var tn={name:"font-style",initialValue:"normal",prefix:!(zr.OBLIQUE="oblique"),type:Ce.IDENT_VALUE,parse:function(A){switch(A){case"oblique":return Vr.OBLIQUE;case"italic":return Vr.ITALIC;case"normal":default:return Vr.NORMAL}}},rn={name:"content",initialValue:"none",type:Ce.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===sA.IDENT_TOKEN&&"none"===e.value?[]:A}},nn={name:"counter-increment",initialValue:"none",prefix:!0,type:Ce.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===sA.IDENT_TOKEN&&"none"===e.value)return null;for(var t=[],r=A.filter(GA),n=0;n<r.length;n++){var B=r[n],s=r[n+1];if(B.type===sA.IDENT_TOKEN){var o=s&&VA(s)?s.number:1;t.push({counter:B.value,increment:o})}}return t}},Bn={name:"counter-reset",initialValue:"none",prefix:!0,type:Ce.LIST,parse:function(A){if(0===A.length)return[];for(var e=[],t=A.filter(GA),r=0;r<t.length;r++){var n=t[r],B=t[r+1];if(zA(n)&&"none"!==n.value){var s=B&&VA(B)?B.number:0;e.push({counter:n.value,reset:s})}}return e}},sn={name:"quotes",initialValue:"none",prefix:!0,type:Ce.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===sA.IDENT_TOKEN&&"none"===e.value)return null;var t=[],r=A.filter(XA);if(r.length%2!=0)return null;for(var n=0;n<r.length;n+=2){var B=r[n].value,s=r[n+1].value;t.push({open:B,close:s})}return t}},on={name:"box-shadow",initialValue:"none",type:Ce.LIST,prefix:!1,parse:function(A){return 1===A.length&&JA(A[0],"none")?[]:WA(A).map(function(A){for(var e={color:255,offsetX:se,offsetY:se,blur:se,spread:se,inset:!1},t=0,r=0;r<A.length;r++){var n=A[r];JA(n,"inset")?e.inset=!0:YA(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:2===t?e.blur=n:e.spread=n,t++):e.color=we(n)}return e})}},an=(cn.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&this.visibility===Lr.VISIBLE},cn.prototype.isTransparent=function(){return ee(this.backgroundColor)},cn.prototype.isTransformed=function(){return null!==this.transform},cn.prototype.isPositioned=function(){return this.position!==pr.STATIC},cn.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},cn.prototype.isFloating=function(){return this.float!==Dt.NONE},cn.prototype.isInlineLevel=function(){return An(this.display,4)||An(this.display,33554432)||An(this.display,268435456)||An(this.display,536870912)||An(this.display,67108864)||An(this.display,134217728)},cn);function cn(A){this.backgroundClip=Un(me,A.backgroundClip),this.backgroundColor=Un(Re,A.backgroundColor),this.backgroundImage=Un(Qt,A.backgroundImage),this.backgroundOrigin=Un(wt,A.backgroundOrigin),this.backgroundPosition=Un(ut,A.backgroundPosition),this.backgroundRepeat=Un(Ct,A.backgroundRepeat),this.backgroundSize=Un(dt,A.backgroundSize),this.borderTopColor=Un(pt,A.borderTopColor),this.borderRightColor=Un(Nt,A.borderRightColor),this.borderBottomColor=Un(Kt,A.borderBottomColor),this.borderLeftColor=Un(It,A.borderLeftColor),this.borderTopLeftRadius=Un(Tt,A.borderTopLeftRadius),this.borderTopRightRadius=Un(mt,A.borderTopRightRadius),this.borderBottomRightRadius=Un(Rt,A.borderBottomRightRadius),this.borderBottomLeftRadius=Un(Lt,A.borderBottomLeftRadius),this.borderTopStyle=Un(St,A.borderTopStyle),this.borderRightStyle=Un(Mt,A.borderRightStyle),this.borderBottomStyle=Un(yt,A.borderBottomStyle),this.borderLeftStyle=Un(_t,A.borderLeftStyle),this.borderTopWidth=Un(Pt,A.borderTopWidth),this.borderRightWidth=Un(xt,A.borderRightWidth),this.borderBottomWidth=Un(Vt,A.borderBottomWidth),this.borderLeftWidth=Un(zt,A.borderLeftWidth),this.boxShadow=Un(on,A.boxShadow),this.color=Un(Xt,A.color),this.display=Un(Jt,A.display),this.float=Un(Zt,A.cssFloat),this.fontFamily=Un(Yr,A.fontFamily),this.fontSize=Un(Zr,A.fontSize),this.fontStyle=Un(tn,A.fontStyle),this.fontVariant=Un($r,A.fontVariant),this.fontWeight=Un(jr,A.fontWeight),this.letterSpacing=Un(jt,A.letterSpacing),this.lineBreak=Un($t,A.lineBreak),this.lineHeight=Un(Ar,A.lineHeight),this.listStyleImage=Un(er,A.listStyleImage),this.listStylePosition=Un(nr,A.listStylePosition),this.listStyleType=Un(ir,A.listStyleType),this.marginTop=Un(ar,A.marginTop),this.marginRight=Un(cr,A.marginRight),this.marginBottom=Un(Qr,A.marginBottom),this.marginLeft=Un(wr,A.marginLeft),this.opacity=Un(Gr,A.opacity);var e=Un(Er,A.overflow);this.overflowX=e[0],this.overflowY=e[1<e.length?1:0],this.overflowWrap=Un(Fr,A.overflowWrap),this.paddingTop=Un(hr,A.paddingTop),this.paddingRight=Un(Hr,A.paddingRight),this.paddingBottom=Un(dr,A.paddingBottom),this.paddingLeft=Un(fr,A.paddingLeft),this.position=Un(mr,A.position),this.textAlign=Un(Kr,A.textAlign),this.textDecorationColor=Un(kr,A.textDecorationColor||A.color),this.textDecorationLine=Un(Wr,A.textDecorationLine),this.textShadow=Un(Rr,A.textShadow),this.textTransform=Un(Or,A.textTransform),this.transform=Un(Dr,A.transform),this.transformOrigin=Un(yr,A.transformOrigin),this.visibility=Un(xr,A.visibility),this.wordBreak=Un(Xr,A.wordBreak),this.zIndex=Un(Jr,A.zIndex)}var Qn,wn=function(A){this.content=Un(rn,A.content),this.quotes=Un(sn,A.quotes)},un=function(A){this.counterIncrement=Un(nn,A.counterIncrement),this.counterReset=Un(Bn,A.counterReset)},Un=function(A,e){var t=new MA,r=null!=e?e.toString():A.initialValue;t.write(r);var n=new _A(t.read());switch(A.type){case Ce.IDENT_VALUE:var B=n.parseComponentValue();return A.parse(zA(B)?B.value:A.initialValue);case Ce.VALUE:return A.parse(n.parseComponentValue());case Ce.LIST:return A.parse(n.parseComponentValues());case Ce.TOKEN_VALUE:return n.parseComponentValue();case Ce.TYPE_VALUE:switch(A.format){case"angle":return ce(n.parseComponentValue());case"color":return we(n.parseComponentValue());case"image":return ot(n.parseComponentValue());case"length":var s=n.parseComponentValue();return YA(s)?s:se;case"length-percentage":var o=n.parseComponentValue();return qA(o)?o:se}}throw new Error("Attempting to parse unsupported css format type "+A.format)},ln=function(A){this.styles=new an(window.getComputedStyle(A,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&uB(A)&&(A.style.transform="none"),this.bounds=T(A),this.flags=0},Cn=function(A,e){this.text=A,this.bounds=e},gn=function(A){var e=A.ownerDocument;if(e){var t=e.createElement("html2canvaswrapper");t.appendChild(A.cloneNode(!0));var r=A.parentNode;if(r){r.replaceChild(t,A);var n=T(t);return t.firstChild&&r.replaceChild(t.firstChild,t),n}}return new I(0,0,0,0)},En=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),I.fromClientRect(n.getBoundingClientRect())},Fn=function(A,e){return 0!==e.letterSpacing?c(A).map(function(A){return l(A)}):hn(A,e)},hn=function(A,e){for(var t,r=function(A,e){var t=c(A),r=u(t,e),n=r[0],B=r[1],s=r[2],o=t.length,i=0,a=0;return{next:function(){if(o<=a)return{done:!0,value:null};for(var A=Y;a<o&&(A=w(t,B,n,++a,s))===Y;);if(A===Y&&a!==o)return{done:!0,value:null};var e=new nA(t,A,i,a);return i=a,{value:e,done:!1}}}}(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap===Ur.BREAK_WORD?"break-word":e.wordBreak}),n=[];!(t=r.next()).done;)t.value&&n.push(t.value.slice());return n},Hn=function(A,e){this.text=dn(A.data,e.textTransform),this.textBounds=function(A,t,r){var e=Fn(A,t),n=[],B=0;return e.forEach(function(A){if(t.textDecorationLine.length||0<A.trim().length)if(Oe.SUPPORT_RANGE_BOUNDS)n.push(new Cn(A,En(r,B,A.length)));else{var e=r.splitText(A.length);n.push(new Cn(A,gn(r))),r=e}else Oe.SUPPORT_RANGE_BOUNDS||(r=r.splitText(A.length));B+=A.length}),n}(this.text,e,A)},dn=function(A,e){switch(e){case Ir.LOWERCASE:return A.toLowerCase();case Ir.CAPITALIZE:return A.replace(fn,pn);case Ir.UPPERCASE:return A.toUpperCase();default:return A}},fn=/(^|\s|:|-|\(|\))([a-z])/g,pn=function(A,e,t){return 0<A.length?e+t.toUpperCase():A},Nn=(A(Kn,Qn=ln),Kn);function Kn(A){var e=Qn.call(this,A)||this;return e.src=A.currentSrc||A.src,e.intrinsicWidth=A.naturalWidth,e.intrinsicHeight=A.naturalHeight,Se.getInstance().addImage(e.src),e}var In,Tn=(A(mn,In=ln),mn);function mn(A){var e=In.call(this,A)||this;return e.canvas=A,e.intrinsicWidth=A.width,e.intrinsicHeight=A.height,e}var Rn,Ln=(A(vn,Rn=ln),vn);function vn(A){var e=Rn.call(this,A)||this,t=new XMLSerializer;return e.svg="data:image/svg+xml,"+encodeURIComponent(t.serializeToString(A)),e.intrinsicWidth=A.width.baseVal.value,e.intrinsicHeight=A.height.baseVal.value,Se.getInstance().addImage(e.svg),e}var On,Dn=(A(bn,On=ln),bn);function bn(A){var e=On.call(this,A)||this;return e.value=A.value,e}var Sn,Mn=(A(yn,Sn=ln),yn);function yn(A){var e=Sn.call(this,A)||this;return e.start=A.start,e.reversed="boolean"==typeof A.reversed&&!0===A.reversed,e}var _n,Pn=[{type:sA.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],xn=[{type:sA.PERCENTAGE_TOKEN,flags:0,number:50}],Vn="checkbox",zn="radio",Xn="password",Jn=707406591,Gn=(A(kn,_n=ln),kn);function kn(A){var e=_n.call(this,A)||this;switch(e.type=A.type.toLowerCase(),e.checked=A.checked,e.value=function(A){var e=A.type===Xn?new Array(A.value.length+1).join("•"):A.value;return 0===e.length?A.placeholder||"":e}(A),e.type!==Vn&&e.type!==zn||(e.styles.backgroundColor=3739148031,e.styles.borderTopColor=e.styles.borderRightColor=e.styles.borderBottomColor=e.styles.borderLeftColor=2779096575,e.styles.borderTopWidth=e.styles.borderRightWidth=e.styles.borderBottomWidth=e.styles.borderLeftWidth=1,e.styles.borderTopStyle=e.styles.borderRightStyle=e.styles.borderBottomStyle=e.styles.borderLeftStyle=ht.SOLID,e.styles.backgroundClip=[Ee.BORDER_BOX],e.styles.backgroundOrigin=[0],e.bounds=function(A){return A.width>A.height?new I(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new I(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A}(e.bounds)),e.type){case Vn:e.styles.borderTopRightRadius=e.styles.borderTopLeftRadius=e.styles.borderBottomRightRadius=e.styles.borderBottomLeftRadius=Pn;break;case zn:e.styles.borderTopRightRadius=e.styles.borderTopLeftRadius=e.styles.borderBottomRightRadius=e.styles.borderBottomLeftRadius=xn}return e}var Wn,Yn=(A(qn,Wn=ln),qn);function qn(A){var e=Wn.call(this,A)||this,t=A.options[A.selectedIndex||0];return e.value=t&&t.text||"",e}var Zn,jn=(A($n,Zn=ln),$n);function $n(A){var e=Zn.call(this,A)||this;return e.value=A.value,e}function AB(A){return we(_A.create(A).parseComponentValue())}var eB,tB=(A(rB,eB=ln),rB);function rB(A){var e=eB.call(this,A)||this;e.src=A.src,e.width=parseInt(A.width,10)||0,e.height=parseInt(A.height,10)||0,e.backgroundColor=e.styles.backgroundColor;try{if(A.contentWindow&&A.contentWindow.document&&A.contentWindow.document.documentElement){e.tree=iB(A.contentWindow.document.documentElement);var t=A.contentWindow.document.documentElement?AB(getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):He.TRANSPARENT,r=A.contentWindow.document.body?AB(getComputedStyle(A.contentWindow.document.body).backgroundColor):He.TRANSPARENT;e.backgroundColor=ee(t)?ee(r)?e.styles.backgroundColor:r:t}}catch(A){}return e}function nB(A){return"STYLE"===A.tagName}var BB=["OL","UL","MENU"],sB=function(A,e,t){for(var r=A.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,QB(r)&&0<r.data.trim().length)e.textNodes.push(new Hn(r,e.styles));else if(wB(r)){var B=oB(r);B.styles.isVisible()&&(aB(r,B,t)?B.flags|=4:cB(B.styles)&&(B.flags|=2),-1!==BB.indexOf(r.tagName)&&(B.flags|=8),e.elements.push(B),dB(r)||gB(r)||fB(r)||sB(r,B,t))}},oB=function(A){return hB(A)?new Nn(A):FB(A)?new Tn(A):gB(A)?new Ln(A):UB(A)?new Dn(A):lB(A)?new Mn(A):CB(A)?new Gn(A):fB(A)?new Yn(A):dB(A)?new jn(A):HB(A)?new tB(A):new ln(A)},iB=function(A){var e=oB(A);return e.flags|=4,sB(A,e,e),e},aB=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||EB(A)&&t.styles.isTransparent()},cB=function(A){return A.isPositioned()||A.isFloating()},QB=function(A){return A.nodeType===Node.TEXT_NODE},wB=function(A){return A.nodeType===Node.ELEMENT_NODE},uB=function(A){return void 0!==A.style},UB=function(A){return"LI"===A.tagName},lB=function(A){return"OL"===A.tagName},CB=function(A){return"INPUT"===A.tagName},gB=function(A){return"svg"===A.tagName},EB=function(A){return"BODY"===A.tagName},FB=function(A){return"CANVAS"===A.tagName},hB=function(A){return"IMG"===A.tagName},HB=function(A){return"IFRAME"===A.tagName},dB=function(A){return"TEXTAREA"===A.tagName},fB=function(A){return"SELECT"===A.tagName},pB=(NB.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},NB.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},NB.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},NB.prototype.parse=function(A){var t=this,e=A.counterIncrement,r=A.counterReset,n=!0;null!==e&&e.forEach(function(A){var e=t.counters[A.counter];e&&0!==A.increment&&(n=!1,e[Math.max(0,e.length-1)]+=A.increment)});var B=[];return n&&r.forEach(function(A){var e=t.counters[A.counter];B.push(A.counter),e||(e=t.counters[A.counter]=[]),e.push(A.reset)}),B},NB);function NB(){this.counters={}}function KB(r,A,e,n,t,B){return r<A||e<r?yB(r,t,0<B.length):n.integers.reduce(function(A,e,t){for(;e<=r;)r-=e,A+=n.values[t];return A},"")+B}function IB(A,e,t,r){for(var n="";t||A--,n=r(A)+n,e<=(A/=e)*e;);return n}function TB(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(IB(Math.abs(A),B,r,function(A){return l(Math.floor(A%B)+e)})+n)}function mB(A,e,t){void 0===t&&(t=". ");var r=e.length;return IB(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t}function RB(A,e,t,r,n,B){if(A<-9999||9999<A)return yB(A,tr.CJK_DECIMAL,0<n.length);var s=Math.abs(A),o=n;if(0===s)return e[0]+o;for(var i=0;0<s&&i<=4;i++){var a=s%10;0==a&&An(B,1)&&""!==o?o=e[a]+o:1<a||1==a&&0===i||1==a&&1===i&&An(B,2)||1==a&&1===i&&An(B,4)&&100<A||1==a&&1<i&&An(B,8)?o=e[a]+(0<i?t[i-1]:"")+o:1==a&&0<i&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o}var LB,vB,OB={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},DB={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},bB={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},SB={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},MB="마이너스",yB=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"",s=t?" ":"";switch(e){case tr.DISC:return"•"+s;case tr.CIRCLE:return"◦"+s;case tr.SQUARE:return"◾"+s;case tr.DECIMAL_LEADING_ZERO:var o=TB(A,48,57,!0,r);return o.length<4?"0"+o:o;case tr.CJK_DECIMAL:return mB(A,"〇一二三四五六七八九",n);case tr.LOWER_ROMAN:return KB(A,1,3999,OB,tr.DECIMAL,r).toLowerCase();case tr.UPPER_ROMAN:return KB(A,1,3999,OB,tr.DECIMAL,r);case tr.LOWER_GREEK:return TB(A,945,969,!1,r);case tr.LOWER_ALPHA:return TB(A,97,122,!1,r);case tr.UPPER_ALPHA:return TB(A,65,90,!1,r);case tr.ARABIC_INDIC:return TB(A,1632,1641,!0,r);case tr.ARMENIAN:case tr.UPPER_ARMENIAN:return KB(A,1,9999,DB,tr.DECIMAL,r);case tr.LOWER_ARMENIAN:return KB(A,1,9999,DB,tr.DECIMAL,r).toLowerCase();case tr.BENGALI:return TB(A,2534,2543,!0,r);case tr.CAMBODIAN:case tr.KHMER:return TB(A,6112,6121,!0,r);case tr.CJK_EARTHLY_BRANCH:return mB(A,"子丑寅卯辰巳午未申酉戌亥",n);case tr.CJK_HEAVENLY_STEM:return mB(A,"甲乙丙丁戊己庚辛壬癸",n);case tr.CJK_IDEOGRAPHIC:case tr.TRAD_CHINESE_INFORMAL:return RB(A,"零一二三四五六七八九","十百千萬","負",n,14);case tr.TRAD_CHINESE_FORMAL:return RB(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case tr.SIMP_CHINESE_INFORMAL:return RB(A,"零一二三四五六七八九","十百千萬","负",n,14);case tr.SIMP_CHINESE_FORMAL:return RB(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case tr.JAPANESE_INFORMAL:return RB(A,"〇一二三四五六七八九","十百千万","マイナス",n,0);case tr.JAPANESE_FORMAL:return RB(A,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case tr.KOREAN_HANGUL_FORMAL:return RB(A,"영일이삼사오육칠팔구","십백천만",MB,B,7);case tr.KOREAN_HANJA_INFORMAL:return RB(A,"零一二三四五六七八九","十百千萬",MB,B,0);case tr.KOREAN_HANJA_FORMAL:return RB(A,"零壹貳參四五六七八九","拾百千",MB,B,7);case tr.DEVANAGARI:return TB(A,2406,2415,!0,r);case tr.GEORGIAN:return KB(A,1,19999,SB,tr.DECIMAL,r);case tr.GUJARATI:return TB(A,2790,2799,!0,r);case tr.GURMUKHI:return TB(A,2662,2671,!0,r);case tr.HEBREW:return KB(A,1,10999,bB,tr.DECIMAL,r);case tr.HIRAGANA:return mB(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case tr.HIRAGANA_IROHA:return mB(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case tr.KANNADA:return TB(A,3302,3311,!0,r);case tr.KATAKANA:return mB(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case tr.KATAKANA_IROHA:return mB(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case tr.LAO:return TB(A,3792,3801,!0,r);case tr.MONGOLIAN:return TB(A,6160,6169,!0,r);case tr.MYANMAR:return TB(A,4160,4169,!0,r);case tr.ORIYA:return TB(A,2918,2927,!0,r);case tr.PERSIAN:return TB(A,1776,1785,!0,r);case tr.TAMIL:return TB(A,3046,3055,!0,r);case tr.TELUGU:return TB(A,3174,3183,!0,r);case tr.THAI:return TB(A,3664,3673,!0,r);case tr.TIBETAN:return TB(A,3872,3881,!0,r);case tr.DECIMAL:default:return TB(A,48,57,!0,r)}},_B="data-html2canvas-ignore",PB=(xB.prototype.toIFrame=function(A,t){var e=this,r=XB(A,t);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,B=A.defaultView.pageYOffset,s=r.contentWindow,o=s.document,i=JB(r).then(function(){return a(e,void 0,void 0,function(){var e;return S(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(YB),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(o.documentElement.style.top=-t.top+"px",o.documentElement.style.left=-t.left+"px",o.documentElement.style.position="absolute")),e=this.options.onclone,void 0===this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:A.sent(),A.label=2;case 2:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(o)}).then(function(){return r})]:[2,r]}})})});return o.open(),o.write(kB(document.doctype)+"<html></html>"),WB(this.referenceElement.ownerDocument,n,B),o.replaceChild(o.adoptNode(this.documentElement),o.documentElement),o.close(),i},xB.prototype.createElementClone=function(A){return FB(A)?this.createCanvasClone(A):nB(A)?this.createStyleClone(A):A.cloneNode(!1)},xB.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(De.getInstance(this.options.id).error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},xB.prototype.createCanvasClone=function(A){if(this.options.inlineImages&&A.ownerDocument){var e=A.ownerDocument.createElement("img");try{return e.src=A.toDataURL(),e}catch(A){De.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var t=A.cloneNode(!1);try{t.width=A.width,t.height=A.height;var r=A.getContext("2d"),n=t.getContext("2d");return n&&(r?n.putImageData(r.getImageData(0,0,A.width,A.height),0,0):n.drawImage(A,0,0)),t}catch(A){}return t},xB.prototype.cloneNode=function(A){if(QB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(uB(A)&&e){var t=this.createElementClone(A),r=e.getComputedStyle(A),n=e.getComputedStyle(A,":before"),B=e.getComputedStyle(A,":after");this.referenceElement===A&&(this.clonedReferenceElement=t),EB(t)&&$B(t);for(var s=this.counters.parse(new un(r)),o=this.resolvePseudoContent(A,t,n,LB.BEFORE),i=A.firstChild;i;i=i.nextSibling)wB(i)&&("SCRIPT"===i.tagName||i.hasAttribute(_B)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(i))||this.options.copyStyles&&wB(i)&&nB(i)||t.appendChild(this.cloneNode(i));o&&t.insertBefore(o,t.firstChild);var a=this.resolvePseudoContent(A,t,B,LB.AFTER);return a&&t.appendChild(a),this.counters.pop(s),r&&this.options.copyStyles&&!HB(A)&&GB(r,t),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([t,A.scrollLeft,A.scrollTop]),(dB(A)||fB(A))&&(dB(t)||fB(t))&&(t.value=A.value),t}return A.cloneNode(!1)},xB.prototype.resolvePseudoContent=function(U,A,e,t){var l=this;if(e){var r=e.content,C=A.ownerDocument;if(C&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==e.display){this.counters.parse(new un(e));var g=new wn(e),E=C.createElement("html2canvaspseudoelement");GB(e,E),g.content.forEach(function(A){if(A.type===sA.STRING_TOKEN)E.appendChild(C.createTextNode(A.value));else if(A.type===sA.URL_TOKEN){var e=C.createElement("img");e.src=A.value,e.style.opacity="1",E.appendChild(e)}else if(A.type===sA.FUNCTION){if("attr"===A.name){var t=A.values.filter(zA);t.length&&E.appendChild(C.createTextNode(U.getAttribute(t[0].value)||""))}else if("counter"===A.name){var r=A.values.filter(kA),n=r[0],B=r[1];if(n&&zA(n)){var s=l.counters.getCounterValue(n.value),o=B&&zA(B)?ir.parse(B.value):tr.DECIMAL;E.appendChild(C.createTextNode(yB(s,o,!1)))}}else if("counters"===A.name){var i=A.values.filter(kA),a=(n=i[0],i[1]);if(B=i[2],n&&zA(n)){var c=l.counters.getCounterValues(n.value),Q=B&&zA(B)?ir.parse(B.value):tr.DECIMAL,w=a&&a.type===sA.STRING_TOKEN?a.value:"",u=c.map(function(A){return yB(A,Q,!1)}).join(w);E.appendChild(C.createTextNode(u))}}}else if(A.type===sA.IDENT_TOKEN)switch(A.value){case"open-quote":E.appendChild(C.createTextNode(en(g.quotes,l.quoteDepth++,!0)));break;case"close-quote":E.appendChild(C.createTextNode(en(g.quotes,--l.quoteDepth,!1)));break;default:E.appendChild(C.createTextNode(A.value))}}),E.className=qB+" "+ZB;var n=t===LB.BEFORE?" "+qB:" "+ZB;return function(A){return"object"==typeof A.className}(A)?A.className.baseValue+=n:A.className+=n,E}}},xB.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},xB);function xB(A,e){if(this.options=e,this.scrolledElements=[],this.referenceElement=A,this.counters=new pB,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement)}(vB=LB||(LB={}))[vB.BEFORE=0]="BEFORE",vB[vB.AFTER=1]="AFTER";var VB,zB,XB=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(_B,"true"),A.body.appendChild(t),t},JB=function(n){return new Promise(function(e,A){var t=n.contentWindow;if(!t)return A("No window assigned for iframe");var r=t.document;t.onload=n.onload=r.onreadystatechange=function(){t.onload=n.onload=r.onreadystatechange=null;var A=setInterval(function(){0<r.body.childNodes.length&&"complete"===r.readyState&&(clearInterval(A),e(n))},50)}})},GB=function(A,e){for(var t=A.length-1;0<=t;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e},kB=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},WB=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},YB=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},qB="___html2canvas___pseudoelement_before",ZB="___html2canvas___pseudoelement_after",jB='{\n content: "" !important;\n display: none !important;\n}',$B=function(A){As(A,"."+qB+":before"+jB+"\n ."+ZB+":after"+jB)},As=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}};(zB=VB||(VB={}))[zB.VECTOR=0]="VECTOR",zB[zB.BEZIER_CURVE=1]="BEZIER_CURVE";function es(A,t){return A.length===t.length&&A.some(function(A,e){return A===t[e]})}var ts=(rs.prototype.add=function(A,e){return new rs(this.x+A,this.y+e)},rs);function rs(A,e){this.type=VB.VECTOR,this.x=A,this.y=e}function ns(A,e,t){return new ts(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var Bs=(ss.prototype.subdivide=function(A,e){var t=ns(this.start,this.startControl,A),r=ns(this.startControl,this.endControl,A),n=ns(this.endControl,this.end,A),B=ns(t,r,A),s=ns(r,n,A),o=ns(B,s,A);return e?new ss(this.start,t,B,o):new ss(o,s,n,this.end)},ss.prototype.add=function(A,e){return new ss(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},ss.prototype.reverse=function(){return new ss(this.end,this.endControl,this.startControl,this.start)},ss);function ss(A,e,t,r){this.type=VB.BEZIER_CURVE,this.start=A,this.startControl=e,this.endControl=t,this.end=r}function os(A){return A.type===VB.BEZIER_CURVE}var is,as,cs=function(A){var e=A.styles,t=A.bounds,r=jA(e.borderTopLeftRadius,t.width,t.height),n=r[0],B=r[1],s=jA(e.borderTopRightRadius,t.width,t.height),o=s[0],i=s[1],a=jA(e.borderBottomRightRadius,t.width,t.height),c=a[0],Q=a[1],w=jA(e.borderBottomLeftRadius,t.width,t.height),u=w[0],U=w[1],l=[];l.push((n+o)/t.width),l.push((u+c)/t.width),l.push((B+U)/t.height),l.push((i+Q)/t.height);var C=Math.max.apply(Math,l);1<C&&(n/=C,B/=C,o/=C,i/=C,c/=C,Q/=C,u/=C,U/=C);var g=t.width-o,E=t.height-Q,F=t.width-c,h=t.height-U,H=e.borderTopWidth,d=e.borderRightWidth,f=e.borderBottomWidth,p=e.borderLeftWidth,N=ae(e.paddingTop,A.bounds.width),K=ae(e.paddingRight,A.bounds.width),I=ae(e.paddingBottom,A.bounds.width),T=ae(e.paddingLeft,A.bounds.width);this.topLeftBorderBox=0<n||0<B?us(t.left,t.top,n,B,is.TOP_LEFT):new ts(t.left,t.top),this.topRightBorderBox=0<o||0<i?us(t.left+g,t.top,o,i,is.TOP_RIGHT):new ts(t.left+t.width,t.top),this.bottomRightBorderBox=0<c||0<Q?us(t.left+F,t.top+E,c,Q,is.BOTTOM_RIGHT):new ts(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=0<u||0<U?us(t.left,t.top+h,u,U,is.BOTTOM_LEFT):new ts(t.left,t.top+t.height),this.topLeftPaddingBox=0<n||0<B?us(t.left+p,t.top+H,Math.max(0,n-p),Math.max(0,B-H),is.TOP_LEFT):new ts(t.left+p,t.top+H),this.topRightPaddingBox=0<o||0<i?us(t.left+Math.min(g,t.width+p),t.top+H,g>t.width+p?0:o-p,i-H,is.TOP_RIGHT):new ts(t.left+t.width-d,t.top+H),this.bottomRightPaddingBox=0<c||0<Q?us(t.left+Math.min(F,t.width-p),t.top+Math.min(E,t.height+H),Math.max(0,c-d),Q-f,is.BOTTOM_RIGHT):new ts(t.left+t.width-d,t.top+t.height-f),this.bottomLeftPaddingBox=0<u||0<U?us(t.left+p,t.top+h,Math.max(0,u-p),U-f,is.BOTTOM_LEFT):new ts(t.left+p,t.top+t.height-f),this.topLeftContentBox=0<n||0<B?us(t.left+p+T,t.top+H+N,Math.max(0,n-(p+T)),Math.max(0,B-(H+N)),is.TOP_LEFT):new ts(t.left+p+T,t.top+H+N),this.topRightContentBox=0<o||0<i?us(t.left+Math.min(g,t.width+p+T),t.top+H+N,g>t.width+p+T?0:o-p+T,i-(H+N),is.TOP_RIGHT):new ts(t.left+t.width-(d+K),t.top+H+N),this.bottomRightContentBox=0<c||0<Q?us(t.left+Math.min(F,t.width-(p+T)),t.top+Math.min(E,t.height+H+N),Math.max(0,c-(d+K)),Q-(f+I),is.BOTTOM_RIGHT):new ts(t.left+t.width-(d+K),t.top+t.height-(f+I)),this.bottomLeftContentBox=0<u||0<U?us(t.left+p+T,t.top+h,Math.max(0,u-(p+T)),U-(f+I),is.BOTTOM_LEFT):new ts(t.left+p+T,t.top+t.height-(f+I))};(as=is||(is={}))[as.TOP_LEFT=0]="TOP_LEFT",as[as.TOP_RIGHT=1]="TOP_RIGHT",as[as.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",as[as.BOTTOM_LEFT=3]="BOTTOM_LEFT";function Qs(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]}function ws(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]}var us=function(A,e,t,r,n){var B=(Math.sqrt(2)-1)/3*4,s=t*B,o=r*B,i=A+t,a=e+r;switch(n){case is.TOP_LEFT:return new Bs(new ts(A,a),new ts(A,a-o),new ts(i-s,e),new ts(i,e));case is.TOP_RIGHT:return new Bs(new ts(A,e),new ts(A+s,e),new ts(i,a-o),new ts(i,a));case is.BOTTOM_RIGHT:return new Bs(new ts(i,e),new ts(i,e+o),new ts(A+s,a),new ts(A,a));case is.BOTTOM_LEFT:default:return new Bs(new ts(i,a),new ts(i-s,a),new ts(A,e+o),new ts(A,e))}},Us=function(A,e,t){this.type=0,this.offsetX=A,this.offsetY=e,this.matrix=t,this.target=6},ls=function(A,e){this.type=1,this.target=e,this.path=A},Cs=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},gs=(Es.prototype.getParentEffects=function(){var A=this.effects.slice(0);if(this.container.styles.overflowX!==sr.VISIBLE){var e=Qs(this.curves),t=ws(this.curves);es(e,t)||A.push(new ls(t,6))}return A},Es);function Es(A,e){if(this.container=A,this.effects=e.slice(0),this.curves=new cs(A),null!==A.styles.transform){var t=A.bounds.left+A.styles.transformOrigin[0].number,r=A.bounds.top+A.styles.transformOrigin[1].number,n=A.styles.transform;this.effects.push(new Us(t,r,n))}if(A.styles.overflowX!==sr.VISIBLE){var B=Qs(this.curves),s=ws(this.curves);es(B,s)?this.effects.push(new ls(B,6)):(this.effects.push(new ls(B,2)),this.effects.push(new ls(s,4)))}}function Fs(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))}function hs(A){var e=A.styles,t=A.bounds,r=ae(e.paddingLeft,t.width),n=ae(e.paddingRight,t.width),B=ae(e.paddingTop,t.width),s=ae(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,B+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+B+s))}function Hs(A,e,t){var r=function(A,e){return 0===A?e.bounds:2===A?hs(e):Fs(e)}(Ts(A.styles.backgroundOrigin,e),A),n=function(A,e){return A===Ee.BORDER_BOX?e.bounds:A===Ee.CONTENT_BOX?hs(e):Fs(e)}(Ts(A.styles.backgroundClip,e),A),B=Is(Ts(A.styles.backgroundSize,e),t,r),s=B[0],o=B[1],i=jA(Ts(A.styles.backgroundPosition,e),r.width-s,r.height-o);return[ms(Ts(A.styles.backgroundRepeat,e),i,B,r,n),Math.round(r.left+i[0]),Math.round(r.top+i[1]),s,o]}function ds(A){return zA(A)&&A.value===Ut.AUTO}function fs(A){return"number"==typeof A}var ps=function(c,Q,w,u){c.container.elements.forEach(function(A){var e=An(A.flags,4),t=An(A.flags,2),r=new gs(A,c.getParentEffects());An(A.styles.display,2048)&&u.push(r);var n=An(A.flags,8)?[]:u;if(e||t){var B=e||A.styles.isPositioned()?w:Q,s=new Cs(r);if(A.styles.isPositioned()||A.styles.opacity<1||A.styles.isTransformed()){var o=A.styles.zIndex.order;if(o<0){var i=0;B.negativeZIndex.some(function(A,e){return o>A.element.container.styles.zIndex.order?(i=e,!1):0<i}),B.negativeZIndex.splice(i,0,s)}else if(0<o){var a=0;B.positiveZIndex.some(function(A,e){return o>A.element.container.styles.zIndex.order?(a=e+1,!1):0<a}),B.positiveZIndex.splice(a,0,s)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(s)}else A.styles.isFloating()?B.nonPositionedFloats.push(s):B.nonPositionedInlineLevel.push(s);ps(r,s,e?s:w,n)}else A.styles.isInlineLevel()?Q.inlineLevel.push(r):Q.nonInlineLevel.push(r),ps(r,Q,w,n);An(A.flags,8)&&Ns(A,n)})},Ns=function(A,e){for(var t=A instanceof Mn?A.start:1,r=A instanceof Mn&&A.reversed,n=0;n<e.length;n++){var B=e[n];B.container instanceof Dn&&"number"==typeof B.container.value&&0!==B.container.value&&(t=B.container.value),B.listValue=yB(t,B.container.styles.listStyleType,!0),t+=r?-1:1}},Ks=function(A,e,t,r){var n=[];return os(A)?n.push(A.subdivide(.5,!1)):n.push(A),os(t)?n.push(t.subdivide(.5,!0)):n.push(t),os(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),os(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},Is=function(A,e,t){var r=e[0],n=e[1],B=e[2],s=A[0],o=A[1];if(qA(s)&&o&&qA(o))return[ae(s,t.width),ae(o,t.height)];var i=fs(B);if(zA(s)&&(s.value===Ut.CONTAIN||s.value===Ut.COVER))return fs(B)?t.width/t.height<B!=(s.value===Ut.COVER)?[t.width,t.width/B]:[t.height*B,t.height]:[t.width,t.height];var a=fs(r),c=fs(n),Q=a||c;if(ds(s)&&(!o||ds(o)))return a&&c?[r,n]:i||Q?Q&&i?[a?r:n*B,c?n:r/B]:[a?r:t.width,c?n:t.height]:[t.width,t.height];if(i){var w=0,u=0;return qA(s)?w=ae(s,t.width):qA(o)&&(u=ae(o,t.height)),ds(s)?w=u*B:o&&!ds(o)||(u=w/B),[w,u]}var U=null,l=null;if(qA(s)?U=ae(s,t.width):o&&qA(o)&&(l=ae(o,t.height)),null===U||o&&!ds(o)||(l=a&&c?U/r*n:t.height),null!==l&&ds(s)&&(U=a&&c?l/n*r:t.width),null!==U&&null!==l)return[U,l];throw new Error("Unable to calculate background-size for element")},Ts=function(A,e){var t=A[e];return void 0===t?A[0]:t},ms=function(A,e,t,r,n){var B=e[0],s=e[1],o=t[0],i=t[1];switch(A){case it.REPEAT_X:return[new ts(Math.round(r.left),Math.round(r.top+s)),new ts(Math.round(r.left+r.width),Math.round(r.top+s)),new ts(Math.round(r.left+r.width),Math.round(i+r.top+s)),new ts(Math.round(r.left),Math.round(i+r.top+s))];case it.REPEAT_Y:return[new ts(Math.round(r.left+B),Math.round(r.top)),new ts(Math.round(r.left+B+o),Math.round(r.top)),new ts(Math.round(r.left+B+o),Math.round(r.height+r.top)),new ts(Math.round(r.left+B),Math.round(r.height+r.top))];case it.NO_REPEAT:return[new ts(Math.round(r.left+B),Math.round(r.top+s)),new ts(Math.round(r.left+B+o),Math.round(r.top+s)),new ts(Math.round(r.left+B+o),Math.round(r.top+s+i)),new ts(Math.round(r.left+B),Math.round(r.top+s+i))];default:return[new ts(Math.round(n.left),Math.round(n.top)),new ts(Math.round(n.left+n.width),Math.round(n.top)),new ts(Math.round(n.left+n.width),Math.round(n.height+n.top)),new ts(Math.round(n.left),Math.round(n.height+n.top))]}},Rs="Hidden Text",Ls=(vs.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),B=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",B.appendChild(t),r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(Rs)),t.appendChild(n),t.appendChild(r);var s=r.offsetTop-n.offsetTop+2;t.removeChild(n),t.appendChild(this._document.createTextNode(Rs)),t.style.lineHeight="normal",r.style.verticalAlign="super";var o=r.offsetTop-t.offsetTop+2;return B.removeChild(t),{baseline:s,middle:o}},vs.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},vs);function vs(A){this._data={},this._document=A}var Os=(Ds.prototype.applyEffects=function(A,e){for(var t=this;this._activeEffects.length;)this.popEffect();A.filter(function(A){return An(A.target,e)}).forEach(function(A){return t.applyEffect(A)})},Ds.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),function(A){return 1===A.type}(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},Ds.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},Ds.prototype.renderStack=function(t){return a(this,void 0,void 0,function(){var e;return S(this,function(A){switch(A.label){case 0:return(e=t.element.container.styles).isVisible()?(this.ctx.globalAlpha=e.opacity,[4,this.renderStackContent(t)]):[3,2];case 1:A.sent(),A.label=2;case 2:return[2]}})})},Ds.prototype.renderNode=function(e){return a(this,void 0,void 0,function(){return S(this,function(A){switch(A.label){case 0:return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(e)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},Ds.prototype.renderTextWithLetterSpacing=function(t,A){var r=this;0===A?this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+t.bounds.height):c(t.text).map(function(A){return l(A)}).reduce(function(A,e){return r.ctx.fillText(e,A,t.bounds.top+t.bounds.height),A+r.ctx.measureText(e).width},t.bounds.left)},Ds.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=A.fontFamily.join(", "),r=xA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]},Ds.prototype.renderTextNode=function(r,o){return a(this,void 0,void 0,function(){var e,t,n,B,s=this;return S(this,function(A){return e=this.createFontStyle(o),t=e[0],n=e[1],B=e[2],this.ctx.font=t,r.textBounds.forEach(function(r){s.ctx.fillStyle=te(o.color),s.renderTextWithLetterSpacing(r,o.letterSpacing);var A=o.textShadow;A.length&&r.text.trim().length&&(A.slice(0).reverse().forEach(function(A){s.ctx.shadowColor=te(A.color),s.ctx.shadowOffsetX=A.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=A.offsetY.number*s.options.scale,s.ctx.shadowBlur=A.blur.number,s.ctx.fillText(r.text,r.bounds.left,r.bounds.top+r.bounds.height)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),o.textDecorationLine.length&&(s.ctx.fillStyle=te(o.textDecorationColor||o.color),o.textDecorationLine.forEach(function(A){switch(A){case 1:var e=s.fontMetrics.getMetrics(n,B).baseline;s.ctx.fillRect(r.bounds.left,Math.round(r.bounds.top+e),r.bounds.width,1);break;case 2:s.ctx.fillRect(r.bounds.left,Math.round(r.bounds.top),r.bounds.width,1);break;case 3:var t=s.fontMetrics.getMetrics(n,B).middle;s.ctx.fillRect(r.bounds.left,Math.ceil(r.bounds.top+t),r.bounds.width,1)}}))}),[2]})})},Ds.prototype.renderReplacedElement=function(A,e,t){if(t&&0<A.intrinsicWidth&&0<A.intrinsicHeight){var r=hs(A),n=ws(e);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},Ds.prototype.renderNodeContent=function(l){return a(this,void 0,void 0,function(){var e,t,r,n,B,s,o,i,a,c,Q,w,u,U;return S(this,function(A){switch(A.label){case 0:this.applyEffects(l.effects,4),e=l.container,t=l.curves,r=e.styles,n=0,B=e.textNodes,A.label=1;case 1:return n<B.length?(s=B[n],[4,this.renderTextNode(s,r)]):[3,4];case 2:A.sent(),A.label=3;case 3:return n++,[3,1];case 4:if(!(e instanceof Nn))return[3,8];A.label=5;case 5:return A.trys.push([5,7,,8]),[4,this.options.cache.match(e.src)];case 6:return w=A.sent(),this.renderReplacedElement(e,t,w),[3,8];case 7:return A.sent(),De.getInstance(this.options.id).error("Error loading image "+e.src),[3,8];case 8:if(e instanceof Tn&&this.renderReplacedElement(e,t,e.canvas),!(e instanceof Ln))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,this.options.cache.match(e.svg)];case 10:return w=A.sent(),this.renderReplacedElement(e,t,w),[3,12];case 11:return A.sent(),De.getInstance(this.options.id).error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof tB&&e.tree?[4,new Ds({id:this.options.id,scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,scrollX:0,scrollY:0,width:e.width,height:e.height,cache:this.options.cache,windowWidth:e.width,windowHeight:e.height}).render(e.tree)]:[3,14];case 13:o=A.sent(),e.width&&e.height&&this.ctx.drawImage(o,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),A.label=14;case 14:if(e instanceof Gn&&(i=Math.min(e.bounds.width,e.bounds.height),e.type===Vn?e.checked&&(this.ctx.save(),this.path([new ts(e.bounds.left+.39363*i,e.bounds.top+.79*i),new ts(e.bounds.left+.16*i,e.bounds.top+.5549*i),new ts(e.bounds.left+.27347*i,e.bounds.top+.44071*i),new ts(e.bounds.left+.39694*i,e.bounds.top+.5649*i),new ts(e.bounds.left+.72983*i,e.bounds.top+.23*i),new ts(e.bounds.left+.84*i,e.bounds.top+.34085*i),new ts(e.bounds.left+.39363*i,e.bounds.top+.79*i)]),this.ctx.fillStyle=te(Jn),this.ctx.fill(),this.ctx.restore()):e.type===zn&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+i/2,e.bounds.top+i/2,i/4,0,2*Math.PI,!0),this.ctx.fillStyle=te(Jn),this.ctx.fill(),this.ctx.restore())),bs(e)&&e.value.length){switch(this.ctx.font=this.createFontStyle(r)[0],this.ctx.fillStyle=te(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign=Ms(e.styles.textAlign),U=hs(e),a=0,e.styles.textAlign){case Cr.CENTER:a+=U.width/2;break;case Cr.RIGHT:a+=U.width}c=U.add(a,0,0,-U.height/2+1),this.ctx.save(),this.path([new ts(U.left,U.top),new ts(U.left+U.width,U.top),new ts(U.left+U.width,U.top+U.height),new ts(U.left,U.top+U.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Cn(e.value,c),r.letterSpacing),this.ctx.restore(),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"}if(!An(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if((Q=e.styles.listStyleImage).type!==xe.URL)return[3,18];w=void 0,u=Q.url,A.label=15;case 15:return A.trys.push([15,17,,18]),[4,this.options.cache.match(u)];case 16:return w=A.sent(),this.ctx.drawImage(w,e.bounds.left-(w.width+10),e.bounds.top),[3,18];case 17:return A.sent(),De.getInstance(this.options.id).error("Error loading list-style-image "+u),[3,18];case 18:return[3,20];case 19:l.listValue&&e.styles.listStyleType!==tr.NONE&&(this.ctx.font=this.createFontStyle(r)[0],this.ctx.fillStyle=te(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",U=new I(e.bounds.left,e.bounds.top+ae(e.styles.paddingTop,e.bounds.width),e.bounds.width,function(A,e){return zA(A)&&"normal"===A.value?1.2*e:A.type===sA.NUMBER_TOKEN?e*A.number:qA(A)?ae(A,e):e}(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Cn(l.listValue,U),r.letterSpacing),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),A.label=20;case 20:return[2]}})})},Ds.prototype.renderStackContent=function(C){return a(this,void 0,void 0,function(){var e,t,r,n,B,s,o,i,a,c,Q,w,u,U,l;return S(this,function(A){switch(A.label){case 0:return[4,this.renderNodeBackgroundAndBorders(C.element)];case 1:A.sent(),e=0,t=C.negativeZIndex,A.label=2;case 2:return e<t.length?(l=t[e],[4,this.renderStack(l)]):[3,5];case 3:A.sent(),A.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(C.element)];case 6:A.sent(),r=0,n=C.nonInlineLevel,A.label=7;case 7:return r<n.length?(l=n[r],[4,this.renderNode(l)]):[3,10];case 8:A.sent(),A.label=9;case 9:return r++,[3,7];case 10:B=0,s=C.nonPositionedFloats,A.label=11;case 11:return B<s.length?(l=s[B],[4,this.renderStack(l)]):[3,14];case 12:A.sent(),A.label=13;case 13:return B++,[3,11];case 14:o=0,i=C.nonPositionedInlineLevel,A.label=15;case 15:return o<i.length?(l=i[o],[4,this.renderStack(l)]):[3,18];case 16:A.sent(),A.label=17;case 17:return o++,[3,15];case 18:a=0,c=C.inlineLevel,A.label=19;case 19:return a<c.length?(l=c[a],[4,this.renderNode(l)]):[3,22];case 20:A.sent(),A.label=21;case 21:return a++,[3,19];case 22:Q=0,w=C.zeroOrAutoZIndexOrTransformedOrOpacity,A.label=23;case 23:return Q<w.length?(l=w[Q],[4,this.renderStack(l)]):[3,26];case 24:A.sent(),A.label=25;case 25:return Q++,[3,23];case 26:u=0,U=C.positiveZIndex,A.label=27;case 27:return u<U.length?(l=U[u],[4,this.renderStack(l)]):[3,30];case 28:A.sent(),A.label=29;case 29:return u++,[3,27];case 30:return[2]}})})},Ds.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},Ds.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},Ds.prototype.formatPath=function(A){var r=this;A.forEach(function(A,e){var t=os(A)?A.start:A;0===e?r.ctx.moveTo(t.x,t.y):r.ctx.lineTo(t.x,t.y),os(A)&&r.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},Ds.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},Ds.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var r=this.canvas.ownerDocument.createElement("canvas");return r.width=e,r.height=t,r.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),r},Ds.prototype.renderBackgroundImage=function(b){return a(this,void 0,void 0,function(){var O,e,D,t,r,n;return S(this,function(A){switch(A.label){case 0:O=b.styles.backgroundImage.length-1,e=function(e){var t,r,n,B,s,o,i,a,c,Q,w,u,U,l,C,g,E,F,h,H,d,f,p,N,K,I,T,m,R,L,v;return S(this,function(A){switch(A.label){case 0:if(e.type!==xe.URL)return[3,5];t=void 0,r=e.url,A.label=1;case 1:return A.trys.push([1,3,,4]),[4,D.options.cache.match(r)];case 2:return t=A.sent(),[3,4];case 3:return A.sent(),De.getInstance(D.options.id).error("Error loading background-image "+r),[3,4];case 4:return t&&(n=Hs(b,O,[t.width,t.height,t.width/t.height]),g=n[0],f=n[1],p=n[2],h=n[3],H=n[4],l=D.ctx.createPattern(D.resizeImage(t,h,H),"repeat"),D.renderRepeat(g,l,f,p)),[3,6];case 5:!function(A){return A.type===xe.LINEAR_GRADIENT}(e)?function(A){return A.type===xe.RADIAL_GRADIENT}(e)&&(C=Hs(b,O,[null,null,null]),g=C[0],E=C[1],F=C[2],h=C[3],H=C[4],d=0===e.position.length?[oe]:e.position,f=ae(d[0],h),p=ae(d[d.length-1],H),N=function(A,e,t,r,n){var B=0,s=0;switch(A.size){case Bt.CLOSEST_SIDE:A.shape===rt.CIRCLE?B=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===rt.ELLIPSE&&(B=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-n)));break;case Bt.CLOSEST_CORNER:if(A.shape===rt.CIRCLE)B=s=Math.min(Ne(e,t),Ne(e,t-n),Ne(e-r,t),Ne(e-r,t-n));else if(A.shape===rt.ELLIPSE){var o=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),i=Ke(r,n,e,t,!0),a=i[0],c=i[1];s=o*(B=Ne(a-e,(c-t)/o))}break;case Bt.FARTHEST_SIDE:A.shape===rt.CIRCLE?B=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===rt.ELLIPSE&&(B=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-n)));break;case Bt.FARTHEST_CORNER:if(A.shape===rt.CIRCLE)B=s=Math.max(Ne(e,t),Ne(e,t-n),Ne(e-r,t),Ne(e-r,t-n));else if(A.shape===rt.ELLIPSE){o=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r));var Q=Ke(r,n,e,t,!1);a=Q[0],c=Q[1],s=o*(B=Ne(a-e,(c-t)/o))}}return Array.isArray(A.size)&&(B=ae(A.size[0],r),s=2===A.size.length?ae(A.size[1],n):B),[B,s]}(e,f,p,h,H),K=N[0],I=N[1],0<K&&0<K&&(T=D.ctx.createRadialGradient(E+f,F+p,0,E+f,F+p,K),fe(e.stops,2*K).forEach(function(A){return T.addColorStop(A.stop,te(A.color))}),D.path(g),D.ctx.fillStyle=T,K!==I?(m=b.bounds.left+.5*b.bounds.width,R=b.bounds.top+.5*b.bounds.height,v=1/(L=I/K),D.ctx.save(),D.ctx.translate(m,R),D.ctx.transform(1,0,0,L,0,0),D.ctx.translate(-m,-R),D.ctx.fillRect(E,v*(F-R)+R,h,H*v),D.ctx.restore()):D.ctx.fill())):(B=Hs(b,O,[null,null,null]),g=B[0],f=B[1],p=B[2],h=B[3],H=B[4],s=pe(e.angle,h,H),o=s[0],i=s[1],a=s[2],c=s[3],Q=s[4],(w=document.createElement("canvas")).width=h,w.height=H,u=w.getContext("2d"),U=u.createLinearGradient(i,c,a,Q),fe(e.stops,o).forEach(function(A){return U.addColorStop(A.stop,te(A.color))}),u.fillStyle=U,u.fillRect(0,0,h,H),0<h&&0<H&&(l=D.ctx.createPattern(w,"repeat"),D.renderRepeat(g,l,f,p))),A.label=6;case 6:return O--,[2]}})},D=this,t=0,r=b.styles.backgroundImage.slice(0).reverse(),A.label=1;case 1:return t<r.length?(n=r[t],[5,e(n)]):[3,4];case 2:A.sent(),A.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},Ds.prototype.renderBorder=function(e,t,r){return a(this,void 0,void 0,function(){return S(this,function(A){return this.path(function(A,e){switch(e){case 0:return Ks(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ks(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ks(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return Ks(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}(r,t)),this.ctx.fillStyle=te(e),this.ctx.fill(),[2]})})},Ds.prototype.renderNodeBackgroundAndBorders=function(c){return a(this,void 0,void 0,function(){var e,t,r,n,B,s,o,i,a=this;return S(this,function(A){switch(A.label){case 0:return this.applyEffects(c.effects,2),e=c.container.styles,t=!ee(e.backgroundColor)||e.backgroundImage.length,r=[{style:e.borderTopStyle,color:e.borderTopColor},{style:e.borderRightStyle,color:e.borderRightColor},{style:e.borderBottomStyle,color:e.borderBottomColor},{style:e.borderLeftStyle,color:e.borderLeftColor}],n=Ss(Ts(e.backgroundClip,0),c.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),ee(e.backgroundColor)||(this.ctx.fillStyle=te(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(c.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(A){a.ctx.save();var e=Qs(c.curves),t=A.inset?0:1e4,r=function(A,t,r,n,B){return A.map(function(A,e){switch(e){case 0:return A.add(t,r);case 1:return A.add(t+n,r);case 2:return A.add(t+n,r+B);case 3:return A.add(t,r+B)}return A})}(e,-t+(A.inset?1:-1)*A.spread.number,(A.inset?1:-1)*A.spread.number,A.spread.number*(A.inset?-2:2),A.spread.number*(A.inset?-2:2));A.inset?(a.path(e),a.ctx.clip(),a.mask(r)):(a.mask(e),a.ctx.clip(),a.path(r)),a.ctx.shadowOffsetX=A.offsetX.number+t,a.ctx.shadowOffsetY=A.offsetY.number,a.ctx.shadowColor=te(A.color),a.ctx.shadowBlur=A.blur.number,a.ctx.fillStyle=A.inset?te(A.color):"rgba(0,0,0,1)",a.ctx.fill(),a.ctx.restore()}),A.label=2;case 2:s=B=0,o=r,A.label=3;case 3:return s<o.length?(i=o[s]).style===ht.NONE||ee(i.color)?[3,5]:[4,this.renderBorder(i.color,B,c.curves)]:[3,7];case 4:A.sent(),A.label=5;case 5:B++,A.label=6;case 6:return s++,[3,3];case 7:return[2]}})})},Ds.prototype.render=function(t){return a(this,void 0,void 0,function(){var e;return S(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=te(this.options.backgroundColor),this.ctx.fillRect(this.options.x-this.options.scrollX,this.options.y-this.options.scrollY,this.options.width,this.options.height)),e=function(A){var e=new gs(A,[]),t=new Cs(e),r=[];return ps(e,t,t,r),Ns(e.container,r),t}(t),[4,this.renderStack(e)];case 1:return A.sent(),this.applyEffects([],2),[2,this.canvas]}})})},Ds);function Ds(A){this._activeEffects=[],this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),(this.options=A).canvas||(this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px"),this.fontMetrics=new Ls(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),this.ctx.textBaseline="bottom",this._activeEffects=[],De.getInstance(A.id).debug("Canvas renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}var bs=function(A){return A instanceof jn||(A instanceof Yn||A instanceof Gn&&A.type!==zn&&A.type!==Vn)},Ss=function(A,e){switch(A){case Ee.BORDER_BOX:return Qs(e);case Ee.CONTENT_BOX:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);case Ee.PADDING_BOX:default:return ws(e)}},Ms=function(A){switch(A){case Cr.CENTER:return"center";case Cr.RIGHT:return"right";case Cr.LEFT:default:return"left"}},ys=(_s.prototype.render=function(r){return a(this,void 0,void 0,function(){var e,t;return S(this,function(A){switch(A.label){case 0:return e=Le(Math.max(this.options.windowWidth,this.options.width)*this.options.scale,Math.max(this.options.windowHeight,this.options.height)*this.options.scale,this.options.scrollX*this.options.scale,this.options.scrollY*this.options.scale,r),[4,xs(e)];case 1:return t=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=te(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},_s);function _s(A){this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=A,this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),De.getInstance(A.id).debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}function Ps(A){return we(_A.create(A).parseComponentValue())}var xs=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(r))})};"undefined"!=typeof window&&Se.setContext(window);var Vs=function(p,N){return a(void 0,void 0,void 0,function(){var e,t,r,n,B,s,o,i,a,c,Q,w,u,U,l,C,g,E,F,h,H,d,f;return S(this,function(A){switch(A.label){case 0:if(!(e=p.ownerDocument))throw new Error("Element is not attached to a Document");if(!(t=e.defaultView))throw new Error("Document is not attached to a Window");return r=(Math.round(1e3*Math.random())+Date.now()).toString(16),n=EB(p)||function(A){return"HTML"===A.tagName}(p)?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),n=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new I(0,0,r,n)}(e):T(p),B=n.width,s=n.height,o=n.left,i=n.top,a=K({},{allowTaint:!1,imageTimeout:15e3,proxy:void 0,useCORS:!1},N),c={backgroundColor:"#ffffff",cache:N.cache?N.cache:Se.create(r,a),logging:!0,removeContainer:!0,foreignObjectRendering:!1,scale:t.devicePixelRatio||1,windowWidth:t.innerWidth,windowHeight:t.innerHeight,scrollX:t.pageXOffset,scrollY:t.pageYOffset,x:o,y:i,width:Math.ceil(B),height:Math.ceil(s),id:r},Q=K({},c,a,N),w=new I(Q.scrollX,Q.scrollY,Q.windowWidth,Q.windowHeight),De.create({id:r,enabled:Q.logging}),De.getInstance(r).debug("Starting document clone"),u=new PB(p,{id:r,onclone:Q.onclone,ignoreElements:Q.ignoreElements,inlineImages:Q.foreignObjectRendering,copyStyles:Q.foreignObjectRendering}),(U=u.clonedReferenceElement)?[4,u.toIFrame(e,w)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return l=A.sent(),C=e.documentElement?Ps(getComputedStyle(e.documentElement).backgroundColor):He.TRANSPARENT,g=e.body?Ps(getComputedStyle(e.body).backgroundColor):He.TRANSPARENT,E=N.backgroundColor,F="string"==typeof E?Ps(E):null===E?He.TRANSPARENT:4294967295,h=p===e.documentElement?ee(C)?ee(g)?F:g:C:F,H={id:r,cache:Q.cache,canvas:Q.canvas,backgroundColor:h,scale:Q.scale,x:Q.x,y:Q.y,scrollX:Q.scrollX,scrollY:Q.scrollY,width:Q.width,height:Q.height,windowWidth:Q.windowWidth,windowHeight:Q.windowHeight},Q.foreignObjectRendering?(De.getInstance(r).debug("Document cloned, using foreign object rendering"),[4,new ys(H).render(U)]):[3,3];case 2:return d=A.sent(),[3,5];case 3:return De.getInstance(r).debug("Document cloned, using computed rendering"),Se.attachInstance(Q.cache),De.getInstance(r).debug("Starting DOM parsing"),f=iB(U),Se.detachInstance(),h===f.styles.backgroundColor&&(f.styles.backgroundColor=He.TRANSPARENT),De.getInstance(r).debug("Starting renderer"),[4,new Os(H).render(f)];case 4:d=A.sent(),A.label=5;case 5:return!0===Q.removeContainer&&(PB.destroy(l)||De.getInstance(r).error("Cannot detach cloned iframe as it is not in the DOM anymore")),De.getInstance(r).debug("Finished rendering"),De.destroy(r),Se.destroy(r),[2,d]}})})};return function(A,e){return void 0===e&&(e={}),Vs(A,e)}}); |
module.exports = (protocols, stylesheet) => {
return protocols.some(test => location.protocol === `${test}:`)
? stylesheet
: ''
}
|
/*globals FB, module */
(function () {
'use strict';
/**
* Callback on facebook status change
* @param {Object} response
* @param {Function} callback
* @return {none}
*/
function statusChangeCallback(response, callback) {
if (response.status === 'connected') {
callback(true);
} else if (response.status === 'not_authorized') {
callback(false);
} else {
callback(false);
}
}
/**
* Checking user facebook status
* @param {Function} callback
* @return {none}
*/
module.exports.init = function (callback) {
FB.getLoginStatus(function(response) {
statusChangeCallback(response, callback);
});
};
/**
* Fetching people invited to the event
* @param {Int} eventId
* @param {Function} callback
* @return {none}
*/
module.exports.getEventPeople = function (eventId, callback) {
FB.api(
"/v2.1/" + eventId + "/attending/?fields=first_name,last_name,picture.height(200).width(200).type(large)",
function (response) {
callback(response);
}
);
};
/**
* Fetching basic event infos
* @param {Int} eventId
* @param {Function} callback
* @return {none}
*/
module.exports.getEventInfos = function (eventId, callback) {
FB.api(
"/v2.1/" + eventId + "?fields=name,start_time",
function (response) {
callback(response);
}
);
};
/**
* Displaying the facebook login dialog
* @param {Function} callback
* @return {none}
*/
module.exports.showDialog = function (callback) {
FB.login(function(response) {
console.log(response);
statusChangeCallback(response, callback);
}, {scope: 'public_profile, user_events', });
};
})(); |
Vue.component('rightsidebar-component', {
template: `<div id="right-sidebar">
<div class="sidebar-container">
<ul class="nav nav-tabs navs-3">
<li class="active"><a data-toggle="tab" href="#tab-1">
Notes
</a></li>
<li><a data-toggle="tab" href="#tab-2">
Projects
</a></li>
<li class=""><a data-toggle="tab" href="#tab-3">
<i class="fa fa-gear"></i>
</a></li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane active">
<div class="sidebar-title">
<h3> <i class="fa fa-comments-o"></i> Latest Notes</h3>
<small><i class="fa fa-tim"></i> You have 10 new message.</small>
</div>
<div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a1.jpg">
<div class="m-t-xs">
<i class="fa fa-star text-warning"></i>
<i class="fa fa-star text-warning"></i>
</div>
</div>
<div class="media-body">
There are many variations of passages of Lorem Ipsum available.
<br>
<small class="text-muted">Today 4:21 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a2.jpg">
</div>
<div class="media-body">
The point of using Lorem Ipsum is that it has a more-or-less normal.
<br>
<small class="text-muted">Yesterday 2:45 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a3.jpg">
<div class="m-t-xs">
<i class="fa fa-star text-warning"></i>
<i class="fa fa-star text-warning"></i>
<i class="fa fa-star text-warning"></i>
</div>
</div>
<div class="media-body">
Mevolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
<br>
<small class="text-muted">Yesterday 1:10 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a4.jpg">
</div>
<div class="media-body">
Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the
<br>
<small class="text-muted">Monday 8:37 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a8.jpg">
</div>
<div class="media-body">
All the Lorem Ipsum generators on the Internet tend to repeat.
<br>
<small class="text-muted">Today 4:21 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a7.jpg">
</div>
<div class="media-body">
Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
<br>
<small class="text-muted">Yesterday 2:45 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a3.jpg">
<div class="m-t-xs">
<i class="fa fa-star text-warning"></i>
<i class="fa fa-star text-warning"></i>
<i class="fa fa-star text-warning"></i>
</div>
</div>
<div class="media-body">
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below.
<br>
<small class="text-muted">Yesterday 1:10 pm</small>
</div>
</a>
</div>
<div class="sidebar-message">
<a href="#">
<div class="pull-left text-center">
<img alt="image" class="img-circle message-avatar" src="img/a4.jpg">
</div>
<div class="media-body">
Uncover many web sites still in their infancy. Various versions have.
<br>
<small class="text-muted">Monday 8:37 pm</small>
</div>
</a>
</div>
</div>
</div>
<div id="tab-2" class="tab-pane">
<div class="sidebar-title">
<h3> <i class="fa fa-cube"></i> Latest projects</h3>
<small><i class="fa fa-tim"></i> You have 14 projects. 10 not completed.</small>
</div>
<ul class="sidebar-list">
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Business valuation</h4>
It is a long established fact that a reader will be distracted.
<div class="small">Completion with: 22%</div>
<div class="progress progress-mini">
<div style="width: 22%;" class="progress-bar progress-bar-warning"></div>
</div>
<div class="small text-muted m-t-xs">Project end: 4:00 pm - 12.06.2014</div>
</a>
</li>
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Contract with Company </h4>
Many desktop publishing packages and web page editors.
<div class="small">Completion with: 48%</div>
<div class="progress progress-mini">
<div style="width: 48%;" class="progress-bar"></div>
</div>
</a>
</li>
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Meeting</h4>
By the readable content of a page when looking at its layout.
<div class="small">Completion with: 14%</div>
<div class="progress progress-mini">
<div style="width: 14%;" class="progress-bar progress-bar-info"></div>
</div>
</a>
</li>
<li>
<a href="#">
<span class="label label-primary pull-right">NEW</span>
<h4>The generated</h4>
<!--<div class="small pull-right m-t-xs">9 hours ago</div>-->
There are many variations of passages of Lorem Ipsum available.
<div class="small">Completion with: 22%</div>
<div class="small text-muted m-t-xs">Project end: 4:00 pm - 12.06.2014</div>
</a>
</li>
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Business valuation</h4>
It is a long established fact that a reader will be distracted.
<div class="small">Completion with: 22%</div>
<div class="progress progress-mini">
<div style="width: 22%;" class="progress-bar progress-bar-warning"></div>
</div>
<div class="small text-muted m-t-xs">Project end: 4:00 pm - 12.06.2014</div>
</a>
</li>
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Contract with Company </h4>
Many desktop publishing packages and web page editors.
<div class="small">Completion with: 48%</div>
<div class="progress progress-mini">
<div style="width: 48%;" class="progress-bar"></div>
</div>
</a>
</li>
<li>
<a href="#">
<div class="small pull-right m-t-xs">9 hours ago</div>
<h4>Meeting</h4>
By the readable content of a page when looking at its layout.
<div class="small">Completion with: 14%</div>
<div class="progress progress-mini">
<div style="width: 14%;" class="progress-bar progress-bar-info"></div>
</div>
</a>
</li>
<li>
<a href="#">
<span class="label label-primary pull-right">NEW</span>
<h4>The generated</h4>
<!--<div class="small pull-right m-t-xs">9 hours ago</div>-->
There are many variations of passages of Lorem Ipsum available.
<div class="small">Completion with: 22%</div>
<div class="small text-muted m-t-xs">Project end: 4:00 pm - 12.06.2014</div>
</a>
</li>
</ul>
</div>
<div id="tab-3" class="tab-pane">
<div class="sidebar-title">
<h3><i class="fa fa-gears"></i> Settings</h3>
<small><i class="fa fa-tim"></i> You have 14 projects. 10 not completed.</small>
</div>
<div class="setings-item">
<span>
Show notifications
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="example">
<label class="onoffswitch-label" for="example">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Disable Chat
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" checked class="onoffswitch-checkbox" id="example2">
<label class="onoffswitch-label" for="example2">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Enable history
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="example3">
<label class="onoffswitch-label" for="example3">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Show charts
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="example4">
<label class="onoffswitch-label" for="example4">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Offline users
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" checked name="collapsemenu" class="onoffswitch-checkbox" id="example5">
<label class="onoffswitch-label" for="example5">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Global search
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" checked name="collapsemenu" class="onoffswitch-checkbox" id="example6">
<label class="onoffswitch-label" for="example6">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
Update everyday
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="example7">
<label class="onoffswitch-label" for="example7">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="sidebar-content">
<h4>Settings</h4>
<div class="small">
I belive that. Lorem Ipsum is simply dummy text of the printing and typesetting industry.
And typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
Over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</div>
</div>
</div>
</div>
</div>
</div>`
})
new Vue({
el: document.body
}) |
/**
* My-button custom element
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.7
* @version 1.1.7
*/
const MyDocumentList = Blast.Bound.Function.inherits('Alchemy.Element', 'MyDocumentList');
/**
* The template to use for the content of this element
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.7
* @version 1.1.7
*/
MyDocumentList.setTemplateFile('elements/my_document_list');
/**
* The model attribute: which model to use
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.7
* @version 1.1.7
*/
MyDocumentList.setAttribute('model');
/**
* Assigned value
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.5
* @version 1.1.5
*/
MyDocumentList.setAssignedProperty('value');
/**
* Prepare variables
*
* @author Jelle De Loecker <[email protected]>
* @since 1.1.7
* @version 1.1.7
*/
MyDocumentList.setMethod(async function prepareRenderVariables() {
if (!this.model) {
return;
}
let model = this.getModel(this.model);
let promise = model.find('all');
let records = await promise;
return {
records : records
};
}); |
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_debug_preprocessor_flags")
load(
"//tools/build_defs/oss:rn_defs.bzl",
"ANDROID",
"APPLE",
"get_apple_compiler_flags",
"get_apple_inspector_flags",
"react_native_xplat_target",
"rn_xplat_cxx_library",
)
def rn_codegen_test(
fixture_name = ""):
copy_schema_name = "copy_schema-{}".format(fixture_name)
fb_native.genrule(
name = copy_schema_name,
srcs = [],
cmd = "$(exe xplat//js/react-native-github/codegen:copy_fixture_schema) {} $OUT".format(fixture_name),
out = "schema-{}.json".format(fixture_name),
)
rn_codegen(fixture_name, ":{}".format(copy_schema_name))
def rn_codegen(
name = "",
schema_target = ""):
generate_fixtures_rule_name = "generate_fixtures-{}".format(name)
generate_component_descriptor_h_name = "generate_component_descriptor_h-{}".format(name)
generate_event_emitter_cpp_name = "generate_event_emitter_cpp-{}".format(name)
generate_event_emitter_h_name = "generate_event_emitter_h-{}".format(name)
generate_props_cpp_name = "generate_props_cpp-{}".format(name)
generate_props_h_name = "generated_props_h-{}".format(name)
generate_shadow_node_cpp_name = "generated_shadow_node_cpp-{}".format(name)
generate_shadow_node_h_name = "generated_shadow_node_h-{}".format(name)
fb_native.genrule(
name = generate_fixtures_rule_name,
srcs = [],
cmd = "$(exe xplat//js/react-native-github/codegen:rn_codegen) $(location {}) {} $OUT".format(schema_target, name),
out = "codegenfiles-{}".format(name),
)
fb_native.genrule(
name = generate_component_descriptor_h_name,
cmd = "cp $(location :{})/ComponentDescriptors.h $OUT".format(generate_fixtures_rule_name),
out = "ComponentDescriptors.h",
)
fb_native.genrule(
name = generate_event_emitter_cpp_name,
cmd = "cp $(location :{})/EventEmitters.cpp $OUT".format(generate_fixtures_rule_name),
out = "EventEmitters.cpp",
)
fb_native.genrule(
name = generate_event_emitter_h_name,
cmd = "cp $(location :{})/EventEmitters.h $OUT".format(generate_fixtures_rule_name),
out = "EventEmitters.h",
)
fb_native.genrule(
name = generate_props_cpp_name,
cmd = "cp $(location :{})/Props.cpp $OUT".format(generate_fixtures_rule_name),
out = "Props.cpp",
)
fb_native.genrule(
name = generate_props_h_name,
cmd = "cp $(location :{})/Props.h $OUT".format(generate_fixtures_rule_name),
out = "Props.h",
)
fb_native.genrule(
name = generate_shadow_node_cpp_name,
cmd = "cp $(location :{})/ShadowNodes.cpp $OUT".format(generate_fixtures_rule_name),
out = "ShadowNodes.cpp",
)
fb_native.genrule(
name = generate_shadow_node_h_name,
cmd = "cp $(location :{})/ShadowNodes.h $OUT".format(generate_fixtures_rule_name),
out = "ShadowNodes.h",
)
# libs
rn_xplat_cxx_library(
name = "generated_components-{}".format(name),
srcs = [
":{}".format(generate_event_emitter_cpp_name),
":{}".format(generate_props_cpp_name),
":{}".format(generate_shadow_node_cpp_name),
],
headers = [
":{}".format(generate_component_descriptor_h_name),
":{}".format(generate_event_emitter_h_name),
":{}".format(generate_props_h_name),
":{}".format(generate_shadow_node_h_name),
],
exported_headers = {
"ComponentDescriptors.h": ":{}".format(generate_component_descriptor_h_name),
"EventEmitters.h": ":{}".format(generate_event_emitter_h_name),
"Props.h": ":{}".format(generate_props_h_name),
"ShadowNodes.h": ":{}".format(generate_shadow_node_h_name),
},
header_namespace = "react/components/{}".format(name),
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++14",
"-Wall",
],
fbobjc_compiler_flags = get_apple_compiler_flags(),
fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
platforms = (ANDROID, APPLE),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
visibility = ["PUBLIC"],
deps = [
"xplat//fbsystrace:fbsystrace",
"xplat//folly:headers_only",
"xplat//folly:memory",
"xplat//folly:molly",
"xplat//third-party/glog:glog",
"xplat//yoga:yoga",
react_native_xplat_target("fabric/debug:debug"),
react_native_xplat_target("fabric/core:core"),
react_native_xplat_target("fabric/graphics:graphics"),
react_native_xplat_target("fabric/components/view:view"),
],
)
|
var counter = 1;
jQuery('a.add-item').click(function(event){
event.preventDefault();
counter++;
var newRow = jQuery('<tr id="'+counter+'_line"><td><input type="text" class="form-control" ' +
counter + '"/></td><td><input type="text" class="form-control" ' +
counter + '"/></td><td><input type="text" class="form-control" ' +
counter + '"/></td><td><input type="text" class="form-control" ' +
counter + '"/></td><td><input type="text" class="form-control" ' +
counter + '"/></td><td><a href="#" class="btn-edit">Save</a><a href="javascript:void(0);" class="btn-delete" onclick="removeline('+counter+');"> Delete</a> </td></tr>');
jQuery('table.ceremony').append(newRow);
});
function removeline(id)
{
jQuery("#"+id+"_line").remove();
}
|
import json
import os
import re
import time
import tweepy
import csv
import numpy as np
from datetime import datetime
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
twitter_secrets_path = './secrets/twitter.json'
focus_languages = ['en']
focus_hashtags = ['#bitcoin'] # '#crypto', '#cryptocurrency'
# Load Twitter credentials
try:
with open(twitter_secrets_path, 'r') as f:
twCreds = json.load(f)
consumer_key = twCreds['consumer_key']
consumer_secret = twCreds['consumer_secret']
access_token = twCreds['access_token']
access_token_secret = twCreds['access_token_secret']
except Exception as e:
logger.error('Failed to load Twitter credentials!', exc_info=True)
raise
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
def remove_pattern(input_txt, pattern):
'''
Removes substring from input matching given pattern.
Parameters:
input_txt (string): Text to remove pattern match from
pattern (string): Pattern to match to remove
Returns:
input_txt (string): Input string with any pattern matches removed
'''
r = re.findall(pattern, input_txt)
for i in r:
input_txt = re.sub(i, '', input_txt)
return input_txt
def clean_tweets(lst):
'''
Removes Twitter handles, return handles, URLs and characters
unsupported for sentiment analysis.
Parameters:
lst (list): List of tweet text strings to clean
Returns:
lst (string): List of cleaned tweet text strings
'''
# remove twitter Return handles (RT @xxx:)
lst = np.vectorize(remove_pattern)(lst, "RT @[\w]*:")
# remove twitter handles (@xxx)
lst = np.vectorize(remove_pattern)(lst, "@[\w]*")
# remove URL links (httpxxx)
lst = np.vectorize(remove_pattern)(lst, "https?://[A-Za-z0-9./]*")
# remove special characters, numbers, punctuations (except for #)
lst = np.core.defchararray.replace(lst, "[^a-zA-Z#]", " ")
return lst
def sentiment_scores(tweet):
'''
Performs VADER sentiment analysis on input string.
Parameters:
tweet (string): Cleaned tweet text string
Returns:
sent_dict (dict): A dictionary with compound, neg, neu, pos as the keys and floats as the values
'''
sent_dict = analyser.polarity_scores(tweet)
return sent_dict
def sentiment_compound_score(tweet):
'''
Performs VADER sentiment analysis on input string and
returns only an integer corresponding to positive, negative
or neutral based on compound score.
Parameters:
tweet (string): Cleaned tweet text string
Returns:
(int): -1 = negative, 0 = neutral, 1 = positive
'''
score = analyser.polarity_scores(tweet)
lb = score['compound']
if lb >= 0.05:
return 1
elif (lb > -0.05) and (lb < 0.05):
return 0
else:
return -1
tApi = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
analyser = SentimentIntensityAnalyzer()
# Open/Create a file to append data
csvFile = open('capi_twitter.csv', 'a')
#Use csv Writer
csvWriter = csv.writer(csvFile)
for tweet in tweepy.Cursor(tApi.search,q="#bitcoin",count=100,
lang="en",
since="2019-05-01",
until="2020-03-10").items():
if not '…' in tweet.text and not 'RT' in tweet.text:
out = dict()
out['created'] = tweet.created_at
out['tweet_id'] = tweet.id_str
out['user_id'] = tweet.user.id_str
try:
out['text'] = tweet.extended_tweet['full_text']
except (AttributeError, KeyError):
out['text'] = tweet.text
out['text_clean'] = clean_tweets([out['text']])[0]
out['sentiment_scores'] = sentiment_scores(out['text_clean'])
out['sentiment_rating'] = sentiment_compound_score(out['text_clean'])
csvWriter.writerow([out['created'], out['tweet_id'], out['user_id'], out['sentiment_scores']['compound']]) |
/*
Copyright 2017 Vector Creations Ltd
Copyright 2018, 2019 New Vector Ltd
Copyright 2019 Lepton Interaction.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { logger } from "../../../src/logger";
import * as utils from "../../../src/utils";
import { MemoryCryptoStore } from "../../../src/crypto/store/memory-crypto-store";
import { DeviceList } from "../../../src/crypto/DeviceList";
const signedDeviceList = {
"failures": {},
"device_keys": {
"@test1:sw1v.org": {
"HGKAWHRVJQ": {
"signatures": {
"@test1:sw1v.org": {
"ed25519:HGKAWHRVJQ":
"8PB450fxKDn5s8IiRZ2N2t6MiueQYVRLHFEzqIi1eLdxx1w" +
"XEPC1/1Uz9T4gwnKlMVAKkhB5hXQA/3kjaeLABw",
},
},
"user_id": "@test1:sw1v.org",
"keys": {
"ed25519:HGKAWHRVJQ":
"0gI/T6C+mn1pjtvnnW2yB2l1IIBb/5ULlBXi/LXFSEQ",
"curve25519:HGKAWHRVJQ":
"mbIZED1dBsgIgkgzxDpxKkJmsr4hiWlGzQTvUnQe3RY",
},
"algorithms": [
"m.olm.v1.curve25519-aes-sha2",
"m.megolm.v1.aes-sha2",
],
"device_id": "HGKAWHRVJQ",
"unsigned": {},
},
},
},
};
const signedDeviceList2 = {
"failures": {},
"device_keys": {
"@test2:sw1v.org": {
"QJVRHWAKGH": {
"signatures": {
"@test2:sw1v.org": {
"ed25519:QJVRHWAKGH":
"w1xxdLe1iIqzEFHLRVYQeuiM6t2N2ZRiI8s5nDKxf054BP8" +
"1CPEX/AQXh5BhkKAVMlKnwg4T9zU1/wBALeajk3",
},
},
"user_id": "@test2:sw1v.org",
"keys": {
"ed25519:QJVRHWAKGH":
"Ig0/C6T+bBII1l2By2Wnnvtjp1nm/iXBlLU5/QESFXL",
"curve25519:QJVRHWAKGH":
"YR3eQnUvTQzGlWih4rsmJkKxpDxzgkgIgsBd1DEZIbm",
},
"algorithms": [
"m.olm.v1.curve25519-aes-sha2",
"m.megolm.v1.aes-sha2",
],
"device_id": "QJVRHWAKGH",
"unsigned": {},
},
},
},
};
describe('DeviceList', function() {
let downloadSpy;
let cryptoStore;
let deviceLists = [];
beforeEach(function() {
deviceLists = [];
downloadSpy = jest.fn();
cryptoStore = new MemoryCryptoStore();
});
afterEach(function() {
for (const dl of deviceLists) {
dl.stop();
}
});
function createTestDeviceList(keyDownloadChunkSize = 250) {
const baseApis = {
downloadKeysForUsers: downloadSpy,
getUserId: () => '@test1:sw1v.org',
deviceId: 'HGKAWHRVJQ',
};
const mockOlm = {
verifySignature: function(key, message, signature) {},
};
const dl = new DeviceList(baseApis, cryptoStore, mockOlm, keyDownloadChunkSize);
deviceLists.push(dl);
return dl;
}
it("should successfully download and store device keys", function() {
const dl = createTestDeviceList();
dl.startTrackingDeviceList('@test1:sw1v.org');
const queryDefer1 = utils.defer();
downloadSpy.mockReturnValue(queryDefer1.promise);
const prom1 = dl.refreshOutdatedDeviceLists();
expect(downloadSpy).toHaveBeenCalledWith(['@test1:sw1v.org'], {});
queryDefer1.resolve(utils.deepCopy(signedDeviceList));
return prom1.then(() => {
const storedKeys = dl.getRawStoredDevicesForUser('@test1:sw1v.org');
expect(Object.keys(storedKeys)).toEqual(['HGKAWHRVJQ']);
});
});
it("should have an outdated devicelist on an invalidation while an " +
"update is in progress", function() {
const dl = createTestDeviceList();
dl.startTrackingDeviceList('@test1:sw1v.org');
const queryDefer1 = utils.defer();
downloadSpy.mockReturnValue(queryDefer1.promise);
const prom1 = dl.refreshOutdatedDeviceLists();
expect(downloadSpy).toHaveBeenCalledWith(['@test1:sw1v.org'], {});
downloadSpy.mockReset();
// outdated notif arrives while the request is in flight.
const queryDefer2 = utils.defer();
downloadSpy.mockReturnValue(queryDefer2.promise);
dl.invalidateUserDeviceList('@test1:sw1v.org');
dl.refreshOutdatedDeviceLists();
dl.saveIfDirty().then(() => {
// the first request completes
queryDefer1.resolve({
device_keys: {
'@test1:sw1v.org': {},
},
});
return prom1;
}).then(() => {
// uh-oh; user restarts before second request completes. The new instance
// should know we never got a complete device list.
logger.log("Creating new devicelist to simulate app reload");
downloadSpy.mockReset();
const dl2 = createTestDeviceList();
const queryDefer3 = utils.defer();
downloadSpy.mockReturnValue(queryDefer3.promise);
const prom3 = dl2.refreshOutdatedDeviceLists();
expect(downloadSpy).toHaveBeenCalledWith(['@test1:sw1v.org'], {});
queryDefer3.resolve(utils.deepCopy(signedDeviceList));
// allow promise chain to complete
return prom3;
}).then(() => {
const storedKeys = dl.getRawStoredDevicesForUser('@test1:sw1v.org');
expect(Object.keys(storedKeys)).toEqual(['HGKAWHRVJQ']);
});
});
it("should download device keys in batches", function() {
const dl = createTestDeviceList(1);
dl.startTrackingDeviceList('@test1:sw1v.org');
dl.startTrackingDeviceList('@test2:sw1v.org');
const queryDefer1 = utils.defer();
downloadSpy.mockReturnValueOnce(queryDefer1.promise);
const queryDefer2 = utils.defer();
downloadSpy.mockReturnValueOnce(queryDefer2.promise);
const prom1 = dl.refreshOutdatedDeviceLists();
expect(downloadSpy).toBeCalledTimes(2);
expect(downloadSpy).toHaveBeenNthCalledWith(1, ['@test1:sw1v.org'], {});
expect(downloadSpy).toHaveBeenNthCalledWith(2, ['@test2:sw1v.org'], {});
queryDefer1.resolve(utils.deepCopy(signedDeviceList));
queryDefer2.resolve(utils.deepCopy(signedDeviceList2));
return prom1.then(() => {
const storedKeys1 = dl.getRawStoredDevicesForUser('@test1:sw1v.org');
expect(Object.keys(storedKeys1)).toEqual(['HGKAWHRVJQ']);
const storedKeys2 = dl.getRawStoredDevicesForUser('@test2:sw1v.org');
expect(Object.keys(storedKeys2)).toEqual(['QJVRHWAKGH']);
});
});
});
|
import React from 'react';
import fibLogo from '../fiblogo.png';
import styled from 'styled-components';
const Header = styled.header`
background-color: #2a668f;
color: #fff;
`;
const Container = styled.div``;
const Heading = styled.h1`
padding-top: 3rem;
`;
const Logo = styled.img`
display: block;
margin: 0 auto;
margin-bottom: 2rem;
width: 25rem;
`;
const Description = styled.div`
padding-bottom: 3rem;
`;
export default ({heading, description}) => {
return (
<Header>
<Container>
<Heading>{heading}</Heading>
<Logo src={fibLogo} alt="logo" />
</Container>
<Description>{description}</Description>
</Header>
);
} |
import moment from 'moment-timezone'
/**
* Used to generate an object containing metadata for a custom year
* A current use case is generating the getRange() key for a custom temporal
* range dropdown option
* @param {number} customYearStart 1-based month number (i.e. 1 for January)
* @param {date} [now=new Date()] optional date to use in calcs
* @returns {object} returns an object containing the custom year name, start date, and end date
*/
export const getCustomYear = (now = new Date(), customYearStart) => {
const thisYear = now.getFullYear ? now.getFullYear() : now.year() // handle moment and plain js dates
const thisMonth = (now.getMonth ? now.getMonth() : now.month()) + 1
const startYear = thisMonth >= customYearStart ? thisYear : thisYear - 1
const startDate = moment({ days: 1, months: customYearStart - 1, years: startYear })
const endDate = moment(startDate).add(11, 'months').endOf('month')
return {
name: endDate.format('YYYY'),
start: startDate.toISOString(),
end: endDate.toISOString()
}
}
export const rotateCustomMonth = (v, customYearStart) => {
if (customYearStart == null || customYearStart === 1) return v // none set, will just default to jan in iris-ql anyways so no change needed
// this is the inverse of the function get_custom_month in iris-ql
// https://github.com/staeco/iris-ql/blob/master/src/sql/custom-year.sql#L18
if (v + customYearStart - 1 === 12) return 12
return (12 + v - 1 + customYearStart) % 12
}
export const getCustomQuarter = (v = new Date(), customYearStart) => {
if (customYearStart == null || customYearStart === 1) return moment(v).quarter() // none set, will just default to jan in iris-ql anyways so no change needed
// matches https://github.com/staeco/iris-ql/blob/master/src/sql/custom-year.sql#L11
const month = moment(v).month() + 1
// linter will tell you the parens arent needed, they are!
// eslint-disable-next-line no-extra-parens
return Math.floor(((12 + month - customYearStart) % 12) / 3) + 1
}
|
import fg from "fast-glob";
import { readJson, writeJson } from "fs-extra";
import { existsSync } from "fs";
import { dirname, join } from "path";
import copy from "recursive-copy";
import { promisify } from "util";
import resolve from "resolve";
export function collectDependencies({ onlyNative, outputDir, widgetName }) {
const managedDependencies = [];
let rollupOptions;
return {
name: "collect-native-deps",
async buildStart(options) {
rollupOptions = options;
managedDependencies.length = 0;
},
async resolveId(source, importer) {
if (source.startsWith(".") || source.startsWith("/")) {
return null;
}
const resolvedPackagePath = await resolvePackage(
source,
dirname(importer ? importer : rollupOptions.input[0])
);
if (resolvedPackagePath && (!onlyNative || (await hasNativeCode(resolvedPackagePath)))) {
if (!managedDependencies.includes(resolvedPackagePath)) {
managedDependencies.push(resolvedPackagePath);
}
return { external: true, id: source };
}
return null;
},
async writeBundle() {
const nativeDependencies = new Set(
onlyNative ? managedDependencies : await asyncWhere(managedDependencies, hasNativeCode)
);
for (let i = 0; i < managedDependencies.length; ++i) {
const dependency = managedDependencies[i];
const destinationPath = join(outputDir, "node_modules", getModuleName(dependency));
await copyJsModule(dependency, destinationPath);
const transitiveDependencies = await getTransitiveDependencies(dependency, rollupOptions.external);
for (const transitiveDependency of transitiveDependencies) {
if (await hasNativeCode(transitiveDependency)) {
nativeDependencies.add(dependency);
if (!managedDependencies.includes(transitiveDependency)) {
managedDependencies.push(transitiveDependency);
}
} else if (!transitiveDependency.startsWith(dependency)) {
await copyJsModule(
transitiveDependency,
join(destinationPath, "node_modules", getModuleName(transitiveDependency))
);
}
}
}
await writeNativeDependenciesJson(nativeDependencies, outputDir, widgetName);
}
};
}
async function resolvePackage(target, sourceDir, optional = false) {
const targetParts = target.split("/");
const targetPackage = targetParts[0].startsWith("@") ? `${targetParts[0]}/${targetParts[1]}` : targetParts[0];
try {
return dirname(await promisify(resolve)(join(targetPackage, "package.json"), { basedir: sourceDir }));
} catch (e) {
if (
e.message.includes("Cannot find module") &&
!/\.((j|t)sx?)|json|(pn|jpe?|sv)g|(tif|gi)f$/g.test(targetPackage) &&
!/configs\/jsActions/i.test(__dirname) && // Ignore errors about missing package.json in 'jsActions/**/src/*' folders
!optional // Certain (peer)dependencies can be optional, ignore throwing an error if an optional (peer)dependency is considered missing.
) {
throw e;
}
return undefined;
}
}
async function hasNativeCode(dir) {
return (await fg(["**/{android,ios}/*", "**/*.podspec"], { cwd: dir })).length > 0;
}
async function getTransitiveDependencies(packagePath, isExternal) {
const queue = [packagePath];
const result = new Set();
while (queue.length) {
const nextPath = queue.shift();
if (result.has(nextPath)) {
continue;
}
result.add(nextPath);
const packageJson = await readJson(join(nextPath, "package.json"));
const dependencies = Object.keys(packageJson.dependencies || {}).concat(
Object.keys(packageJson.peerDependencies || {})
);
const optionalDependencies = Object.keys(packageJson.optionalDependencies || {}); // certain dependencies can be optionally available, described in package.json `optionalDependencies`.
const optionalPeerDependencies = Object.entries(packageJson.peerDependenciesMeta || {}) // certain peerDependencies can be optionally available, described in package.json `peerDependencyMeta`.
.filter(dependency => !!dependency[1].optional)
.map(dependency => dependency[0]);
for (const dependency of dependencies) {
const resolvedPackagePath = await resolvePackage(
dependency,
nextPath,
optionalDependencies.includes(dependency) || optionalPeerDependencies.includes(dependency)
);
if (isExternal(dependency) || !resolvedPackagePath) {
continue;
}
queue.push(resolvedPackagePath);
}
}
return Array.from(result);
}
async function copyJsModule(moduleSourcePath, to) {
if (existsSync(to)) {
return;
}
return promisify(copy)(moduleSourcePath, to, {
filter: [
"**/*.*",
"{license,LICENSE}",
"!**/{android,ios,windows,mac,jest,github,gradle,__*__,docs,jest,example*}/**/*",
"!**/*.{config,setup}.*",
"!**/*.{podspec,flow}"
]
});
}
function getModuleName(modulePath) {
return modulePath.split(/[\\/]node_modules[\\/]/).pop();
}
async function writeNativeDependenciesJson(nativeDependencies, outputDir, widgetName) {
if (nativeDependencies.size === 0) {
return;
}
const dependencies = {};
for (const dependency of nativeDependencies) {
const dependencyJson = await readJson(join(dependency, "package.json"));
dependencies[dependencyJson.name] = dependencyJson.version;
}
await writeJson(join(outputDir, `${widgetName}.json`), { nativeDependencies: dependencies }, { spaces: 2 });
}
async function asyncWhere(array, filter) {
return (await Promise.all(array.map(async el => ((await filter(el)) ? [el] : [])))).flat();
}
|
//// [tests/cases/compiler/letDeclarations-scopes-duplicates2.ts] ////
//// [file1.ts]
let var1 = 0;
//// [file2.ts]
let var1 = 0;
//// [file1.js]
let var1 = 0;
//// [file2.js]
let var1 = 0;
|
/*!
* FullCalendar v3.0.1
* Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("moment")):t(jQuery,moment)}(function(t,e){function n(t){return q(t,qt)}function i(t,e){e.left&&t.css({"border-left-width":1,"margin-left":e.left-1}),e.right&&t.css({"border-right-width":1,"margin-right":e.right-1})}function r(t){t.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function s(){t("body").addClass("fc-not-allowed")}function o(){t("body").removeClass("fc-not-allowed")}function l(e,n,i){var r=Math.floor(n/e.length),s=Math.floor(n-r*(e.length-1)),o=[],l=[],u=[],d=0;a(e),e.each(function(n,i){var a=n===e.length-1?s:r,c=t(i).outerHeight(!0);c<a?(o.push(i),l.push(c),u.push(t(i).height())):d+=c}),i&&(n-=d,r=Math.floor(n/o.length),s=Math.floor(n-r*(o.length-1))),t(o).each(function(e,n){var i=e===o.length-1?s:r,a=l[e],d=u[e],c=i-(a-d);a<i&&t(n).height(c)})}function a(t){t.height("")}function u(e){var n=0;return e.find("> *").each(function(e,i){var r=t(i).outerWidth();r>n&&(n=r)}),n++,e.width(n),n}function d(t,e){var n,i=t.add(e);return i.css({position:"relative",left:-1}),n=t.outerHeight()-e.outerHeight(),i.css({position:"",left:""}),n}function c(e){var n=e.css("position"),i=e.parents().filter(function(){var e=t(this);return/(auto|scroll)/.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==n&&i.length?i:t(e[0].ownerDocument||document)}function h(t,e){var n=t.offset(),i=n.left-(e?e.left:0),r=n.top-(e?e.top:0);return{left:i,right:i+t.outerWidth(),top:r,bottom:r+t.outerHeight()}}function f(t,e){var n=t.offset(),i=p(t),r=n.left+y(t,"border-left-width")+i.left-(e?e.left:0),s=n.top+y(t,"border-top-width")+i.top-(e?e.top:0);return{left:r,right:r+t[0].clientWidth,top:s,bottom:s+t[0].clientHeight}}function g(t,e){var n=t.offset(),i=n.left+y(t,"border-left-width")+y(t,"padding-left")-(e?e.left:0),r=n.top+y(t,"border-top-width")+y(t,"padding-top")-(e?e.top:0);return{left:i,right:i+t.width(),top:r,bottom:r+t.height()}}function p(t){var e=t.innerWidth()-t[0].clientWidth,n={left:0,right:0,top:0,bottom:t.innerHeight()-t[0].clientHeight};return v()&&"rtl"==t.css("direction")?n.left=e:n.right=e,n}function v(){return null===Zt&&(Zt=m()),Zt}function m(){var e=t("<div><div/></div>").css({position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}).appendTo("body"),n=e.children(),i=n.offset().left>e.offset().left;return e.remove(),i}function y(t,e){return parseFloat(t.css(e))||0}function S(t){return 1==t.which&&!t.ctrlKey}function w(t){if(void 0!==t.pageX)return t.pageX;var e=t.originalEvent.touches;return e?e[0].pageX:void 0}function E(t){if(void 0!==t.pageY)return t.pageY;var e=t.originalEvent.touches;return e?e[0].pageY:void 0}function D(t){return/^touch/.test(t.type)}function b(t){t.addClass("fc-unselectable").on("selectstart",C)}function C(t){t.preventDefault()}function H(t){return!!window.addEventListener&&(window.addEventListener("scroll",t,!0),!0)}function T(t){return!!window.removeEventListener&&(window.removeEventListener("scroll",t,!0),!0)}function x(t,e){var n={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)};return n.left<n.right&&n.top<n.bottom&&n}function R(t,e){return{left:Math.min(Math.max(t.left,e.left),e.right),top:Math.min(Math.max(t.top,e.top),e.bottom)}}function I(t){return{left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}}function k(t,e){return{left:t.left-e.left,top:t.top-e.top}}function M(e){var n,i,r=[],s=[];for("string"==typeof e?s=e.split(/\s*,\s*/):"function"==typeof e?s=[e]:t.isArray(e)&&(s=e),n=0;n<s.length;n++)i=s[n],"string"==typeof i?r.push("-"==i.charAt(0)?{field:i.substring(1),order:-1}:{field:i,order:1}):"function"==typeof i&&r.push({func:i});return r}function L(t,e,n){var i,r;for(i=0;i<n.length;i++)if(r=B(t,e,n[i]))return r;return 0}function B(t,e,n){return n.func?n.func(t,e):z(t[n.field],e[n.field])*(n.order||1)}function z(e,n){return e||n?null==n?-1:null==e?1:"string"===t.type(e)||"string"===t.type(n)?String(e).localeCompare(String(n)):e-n:0}function F(t,e){var n,i,r,s,o=t.start,l=t.end,a=e.start,u=e.end;if(l>a&&o<u)return o>=a?(n=o.clone(),r=!0):(n=a.clone(),r=!1),l<=u?(i=l.clone(),s=!0):(i=u.clone(),s=!1),{start:n,end:i,isStart:r,isEnd:s}}function N(t,n){return e.duration({days:t.clone().stripTime().diff(n.clone().stripTime(),"days"),ms:t.time()-n.time()})}function G(t,n){return e.duration({days:t.clone().stripTime().diff(n.clone().stripTime(),"days")})}function A(t,n,i){return e.duration(Math.round(t.diff(n,i,!0)),i)}function O(t,e){var n,i,r;for(n=0;n<Xt.length&&(i=Xt[n],r=V(i,t,e),!(r>=1&&ot(r)));n++);return i}function V(t,n,i){return null!=i?i.diff(n,t,!0):e.isDuration(n)?n.as(t):n.end.diff(n.start,t,!0)}function P(t,e,n){var i;return W(n)?(e-t)/n:(i=n.asMonths(),Math.abs(i)>=1&&ot(i)?e.diff(t,"months",!0)/i:e.diff(t,"days",!0)/n.asDays())}function _(t,e){var n,i;return W(t)||W(e)?t/e:(n=t.asMonths(),i=e.asMonths(),Math.abs(n)>=1&&ot(n)&&Math.abs(i)>=1&&ot(i)?n/i:t.asDays()/e.asDays())}function Y(t,n){var i;return W(t)?e.duration(t*n):(i=t.asMonths(),Math.abs(i)>=1&&ot(i)?e.duration({months:i*n}):e.duration({days:t.asDays()*n}))}function W(t){return Boolean(t.hours()||t.minutes()||t.seconds()||t.milliseconds())}function j(t){return"[object Date]"===Object.prototype.toString.call(t)||t instanceof Date}function U(t){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(t)}function q(t,e){var n,i,r,s,o,l,a={};if(e)for(n=0;n<e.length;n++){for(i=e[n],r=[],s=t.length-1;s>=0;s--)if(o=t[s][i],"object"==typeof o)r.unshift(o);else if(void 0!==o){a[i]=o;break}r.length&&(a[i]=q(r))}for(n=t.length-1;n>=0;n--){l=t[n];for(i in l)i in a||(a[i]=l[i])}return a}function Z(t){var e=function(){};return e.prototype=t,new e}function $(t,e){for(var n in t)X(t,n)&&(e[n]=t[n])}function X(t,e){return Kt.call(t,e)}function K(e){return/undefined|null|boolean|number|string/.test(t.type(e))}function Q(e,n,i){if(t.isFunction(e)&&(e=[e]),e){var r,s;for(r=0;r<e.length;r++)s=e[r].apply(n,i)||s;return s}}function J(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}function tt(t){return(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function et(t){return t.replace(/&.*?;/g,"")}function nt(e){var n=[];return t.each(e,function(t,e){null!=e&&n.push(t+":"+e)}),n.join(";")}function it(e){var n=[];return t.each(e,function(t,e){null!=e&&n.push(t+'="'+tt(e)+'"')}),n.join(" ")}function rt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function st(t,e){return t-e}function ot(t){return t%1===0}function lt(t,e){var n=t[e];return function(){return n.apply(t,arguments)}}function at(t,e,n){var i,r,s,o,l,a=function(){var u=+new Date-o;u<e?i=setTimeout(a,e-u):(i=null,n||(l=t.apply(s,r),s=r=null))};return function(){s=this,r=arguments,o=+new Date;var u=n&&!i;return i||(i=setTimeout(a,e)),u&&(l=t.apply(s,r),s=r=null),l}}function ut(e,n){return e&&e.then&&"resolved"!==e.state()?n?e.then(n):void 0:t.when(n())}function dt(n,i,r){var s,o,l,a,u=n[0],d=1==n.length&&"string"==typeof u;return e.isMoment(u)||j(u)||void 0===u?a=e.apply(null,n):(s=!1,o=!1,d?Qt.test(u)?(u+="-01",n=[u],s=!0,o=!0):(l=Jt.exec(u))&&(s=!l[5],o=!0):t.isArray(u)&&(o=!0),a=i||s?e.utc.apply(e,n):e.apply(null,n),s?(a._ambigTime=!0,a._ambigZone=!0):r&&(o?a._ambigZone=!0:d&&a.utcOffset(u))),a._fullCalendar=!0,a}function ct(t,e){return ee.format.call(t,e)}function ht(t,e){return ft(t,yt(e))}function ft(t,e){var n,i="";for(n=0;n<e.length;n++)i+=gt(t,e[n]);return i}function gt(t,e){var n,i;return"string"==typeof e?e:(n=e.token)?ie[n]?ie[n](t):ct(t,n):e.maybe&&(i=ft(t,e.maybe),i.match(/[1-9]/))?i:""}function pt(t,e,n,i,r){var s;return t=jt.moment.parseZone(t),e=jt.moment.parseZone(e),s=t.localeData(),n=s.longDateFormat(n)||n,i=i||" - ",vt(t,e,yt(n),i,r)}function vt(t,e,n,i,r){var s,o,l,a,u=t.clone().stripZone(),d=e.clone().stripZone(),c="",h="",f="",g="",p="";for(o=0;o<n.length&&(s=mt(t,e,u,d,n[o]),s!==!1);o++)c+=s;for(l=n.length-1;l>o&&(s=mt(t,e,u,d,n[l]),s!==!1);l--)h=s+h;for(a=o;a<=l;a++)f+=gt(t,n[a]),g+=gt(e,n[a]);return(f||g)&&(p=r?g+i+f:f+i+g),c+p+h}function mt(t,e,n,i,r){var s,o;return"string"==typeof r?r:!!((s=r.token)&&(o=re[s.charAt(0)],o&&n.isSame(i,o)))&&ct(t,s)}function yt(t){return t in se?se[t]:se[t]=St(t)}function St(t){for(var e,n=[],i=/\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;e=i.exec(t);)e[1]?n.push(e[1]):e[2]?n.push({maybe:St(e[2])}):e[3]?n.push({token:e[3]}):e[5]&&n.push(e[5]);return n}function wt(){}function Et(t,e){var n;return X(e,"constructor")&&(n=e.constructor),"function"!=typeof n&&(n=e.constructor=function(){t.apply(this,arguments)}),n.prototype=Z(t.prototype),$(e,n.prototype),$(t,n),n}function Dt(t,e){$(e,t.prototype)}function bt(t,e){return!t&&!e||!(!t||!e)&&(t.component===e.component&&Ct(t,e)&&Ct(e,t))}function Ct(t,e){for(var n in t)if(!/^(component|left|right|top|bottom)$/.test(n)&&t[n]!==e[n])return!1;return!0}function Ht(t){return{start:t.start.clone(),end:t.end?t.end.clone():null,allDay:t.allDay}}function Tt(t){var e=Rt(t);return"background"===e||"inverse-background"===e}function xt(t){return"inverse-background"===Rt(t)}function Rt(t){return J((t.source||{}).rendering,t.rendering)}function It(t){var e,n,i={};for(e=0;e<t.length;e++)n=t[e],(i[n._id]||(i[n._id]=[])).push(n);return i}function kt(t,e){return t.start-e.start}function Mt(n){var i,r,s,o,l=jt.dataAttrPrefix;return l&&(l+="-"),i=n.data(l+"event")||null,i&&(i="object"==typeof i?t.extend({},i):{},r=i.start,null==r&&(r=i.time),s=i.duration,o=i.stick,delete i.start,delete i.time,delete i.duration,delete i.stick),null==r&&(r=n.data(l+"start")),null==r&&(r=n.data(l+"time")),null==s&&(s=n.data(l+"duration")),null==o&&(o=n.data(l+"stick")),r=null!=r?e.duration(r):null,s=null!=s?e.duration(s):null,o=Boolean(o),{eventProps:i,startTime:r,duration:s,stick:o}}function Lt(t,e){var n,i;for(n=0;n<e.length;n++)if(i=e[n],i.leftCol<=t.rightCol&&i.rightCol>=t.leftCol)return!0;return!1}function Bt(t,e){return t.leftCol-e.leftCol}function zt(t){var e,n,i,r=[];for(e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&Gt(n,r[i]).length;i++);n.level=i,(r[i]||(r[i]=[])).push(n)}return r}function Ft(t){var e,n,i,r,s;for(e=0;e<t.length;e++)for(n=t[e],i=0;i<n.length;i++)for(r=n[i],r.forwardSegs=[],s=e+1;s<t.length;s++)Gt(r,t[s],r.forwardSegs)}function Nt(t){var e,n,i=t.forwardSegs,r=0;if(void 0===t.forwardPressure){for(e=0;e<i.length;e++)n=i[e],Nt(n),r=Math.max(r,1+n.forwardPressure);t.forwardPressure=r}}function Gt(t,e,n){n=n||[];for(var i=0;i<e.length;i++)At(t,e[i])&&n.push(e[i]);return n}function At(t,e){return t.bottom>e.top&&t.top<e.bottom}function Ot(n,i){function r(t){t._locale=U}function s(){$?u()&&(g(),d()):o()}function o(){n.addClass("fc"),n.on("click.fc","a[data-goto]",function(e){var n=t(this),i=n.data("goto"),r=j.moment(i.date),s=i.type,o=K.opt("navLink"+rt(s)+"Click");"function"==typeof o?o(r,e):("string"==typeof o&&(s=o),N(r,s))}),j.bindOption("theme",function(t){X=t?"ui":"fc",n.toggleClass("ui-widget",t),n.toggleClass("fc-unthemed",!t)}),j.bindOptions(["isRTL","locale"],function(t){n.toggleClass("fc-ltr",!t),n.toggleClass("fc-rtl",t)}),$=t("<div class='fc-view-container'/>").prependTo(n),q=j.header=new _t(j),l(),d(j.options.defaultView),j.options.handleWindowResize&&(J=at(m,j.options.windowResizeDelay),t(window).resize(J))}function l(){q.render(),q.el&&n.prepend(q.el)}function a(){K&&K.removeElement(),q.removeElement(),$.remove(),n.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),n.off(".fc"),J&&t(window).unbind("resize",J)}function u(){return n.is(":visible")}function d(e,n){lt++,K&&e&&K.type!==e&&(A(),c()),!K&&e&&(K=j.view=ot[e]||(ot[e]=j.instantiateView(e)),K.setElement(t("<div class='fc-view fc-"+e+"-view' />").appendTo($)),q.activateButton(e)),K&&(tt=K.massageCurrentDate(tt),K.displaying&&tt>=K.intervalStart&&tt<K.intervalEnd||u()&&(K.display(tt,n),O(),H(),T(),E())),O(),lt--}function c(){q.deactivateButton(K.type),K.removeElement(),K=j.view=null}function h(){lt++,A();var t=K.type,e=K.queryScroll();c(),d(t,e),O(),lt--}function f(t){if(u())return t&&p(),lt++,K.updateSize(!0),lt--,!0}function g(){u()&&p()}function p(){var t=j.options.contentHeight,e=j.options.height;Q="number"==typeof t?t:"function"==typeof t?t():"number"==typeof e?e-v():"function"==typeof e?e()-v():"parent"===e?n.parent().height()-v():Math.round($.width()/Math.max(j.options.aspectRatio,.5))}function v(){return q.el?q.el.outerHeight(!0):0}function m(t){!lt&&t.target===window&&K.start&&f(!0)&&K.trigger("windowResize",st)}function y(){D()}function S(t){it(j.getEventSourcesByMatchArray(t))}function w(){u()&&(A(),K.displayEvents(ut),O())}function E(){!j.options.lazyFetching||et(K.start,K.end)?D():w()}function D(){nt(K.start,K.end)}function b(t){ut=t,w()}function C(){w()}function H(){q.updateTitle(K.title)}function T(){var t=j.getNow();t>=K.intervalStart&&t<K.intervalEnd?q.disableButton("today"):q.enableButton("today")}function x(t,e){K.select(j.buildSelectSpan.apply(j,arguments))}function R(){K&&K.unselect()}function I(){tt=K.computePrevDate(tt),d()}function k(){tt=K.computeNextDate(tt),d()}function M(){tt.add(-1,"years"),d()}function L(){tt.add(1,"years"),d()}function B(){tt=j.getNow(),d()}function z(t){tt=j.moment(t).stripZone(),d()}function F(t){tt.add(e.duration(t)),d()}function N(t,e){var n;e=e||"day",n=j.getViewSpec(e)||j.getUnitViewSpec(e),tt=t.clone(),d(n?n.type:null)}function G(){return j.applyTimezone(tt)}function A(){$.css({width:"100%",height:$.height(),overflow:"hidden"})}function O(){$.css({width:"",height:"",overflow:""})}function V(){return j}function P(){return K}function _(t,e){var n;if("string"==typeof t){if(void 0===e)return j.options[t];n={},n[t]=e,Y(n)}else"object"==typeof t&&Y(t)}function Y(t){var e,n=0;for(e in t)j.dynamicOverrides[e]=t[e];j.viewSpecCache={},j.populateOptionsHash();for(e in t)j.triggerOptionHandlers(e),n++;if(1===n){if("height"===e||"contentHeight"===e||"aspectRatio"===e)return void f(!0);if("defaultDate"===e)return;if("businessHours"===e)return void(K&&(K.unrenderBusinessHours(),K.renderBusinessHours()));if("timezone"===e)return j.rezoneArrayEventSources(),void y()}l(),ot={},h()}function W(t,e){var n=Array.prototype.slice.call(arguments,2);if(e=e||st,this.triggerWith(t,e,n),j.options[t])return j.options[t].apply(e,n)}var j=this;j.render=s,j.destroy=a,j.refetchEvents=y,j.refetchEventSources=S,j.reportEvents=b,j.reportEventChange=C,j.rerenderEvents=w,j.changeView=d,j.select=x,j.unselect=R,j.prev=I,j.next=k,j.prevYear=M,j.nextYear=L,j.today=B,j.gotoDate=z,j.incrementDate=F,j.zoomTo=N,j.getDate=G,j.getCalendar=V,j.getView=P,j.option=_,j.trigger=W,j.dynamicOverrides={},j.viewSpecCache={},j.optionHandlers={},j.overrides=t.extend({},i),j.populateOptionsHash();var U;j.bindOptions(["locale","monthNames","monthNamesShort","dayNames","dayNamesShort","firstDay","weekNumberCalculation"],function(t,e,n,i,s,o,l){if("iso"===l&&(l="ISO"),U=Z(Pt(t)),e&&(U._months=e),n&&(U._monthsShort=n),i&&(U._weekdays=i),s&&(U._weekdaysShort=s),null==o&&"ISO"===l&&(o=1),null!=o){var a=Z(U._week);a.dow=o,U._week=a}"ISO"!==l&&"local"!==l&&"function"!=typeof l||(U._fullCalendar_weekCalc=l),tt&&r(tt)}),j.defaultAllDayEventDuration=e.duration(j.options.defaultAllDayEventDuration),j.defaultTimedEventDuration=e.duration(j.options.defaultTimedEventDuration),j.moment=function(){var t;return"local"===j.options.timezone?(t=jt.moment.apply(null,arguments),t.hasTime()&&t.local()):t="UTC"===j.options.timezone?jt.moment.utc.apply(null,arguments):jt.moment.parseZone.apply(null,arguments),r(t),t},j.localizeMoment=r,j.getIsAmbigTimezone=function(){return"local"!==j.options.timezone&&"UTC"!==j.options.timezone},j.applyTimezone=function(t){if(!t.hasTime())return t.clone();var e,n=j.moment(t.toArray()),i=t.time()-n.time();return i&&(e=n.clone().add(i),t.time()-e.time()===0&&(n=e)),n},j.getNow=function(){var t=j.options.now;return"function"==typeof t&&(t=t()),j.moment(t).stripZone()},j.getEventEnd=function(t){return t.end?t.end.clone():j.getDefaultEventEnd(t.allDay,t.start)},j.getDefaultEventEnd=function(t,e){var n=e.clone();return t?n.stripTime().add(j.defaultAllDayEventDuration):n.add(j.defaultTimedEventDuration),j.getIsAmbigTimezone()&&n.stripZone(),n},j.humanizeDuration=function(t){return t.locale(j.options.locale).humanize()},Yt.call(j);var q,$,X,K,Q,J,tt,et=j.isFetchNeeded,nt=j.fetchEvents,it=j.fetchEventSources,st=n[0],ot={},lt=0,ut=[];tt=null!=j.options.defaultDate?j.moment(j.options.defaultDate).stripZone():j.getNow(),j.getSuggestedViewHeight=function(){return void 0===Q&&g(),Q},j.isHeightAuto=function(){return"auto"===j.options.contentHeight||"auto"===j.options.height},j.freezeContentHeight=A,j.unfreezeContentHeight=O,j.initialize()}function Vt(e){t.each(He,function(t,n){null==e[t]&&(e[t]=n(e))})}function Pt(t){return e.localeData(t)||e.localeData("en")}function _t(e){function n(){var n=e.options,s=n.header;f=n.theme?"ui":"fc",s?(h?h.empty():h=this.el=t("<div class='fc-toolbar'/>"),h.append(r("left")).append(r("right")).append(r("center")).append('<div class="fc-clear"/>')):i()}function i(){h&&(h.remove(),h=c.el=null)}function r(n){var i=t('<div class="fc-'+n+'"/>'),r=e.options,s=r.header[n];return s&&t.each(s.split(" "),function(n){var s,o=t(),l=!0;t.each(this.split(","),function(n,i){var s,a,u,d,c,h,p,v,m,y;"title"==i?(o=o.add(t("<h2> </h2>")),l=!1):((s=(r.customButtons||{})[i])?(u=function(t){s.click&&s.click.call(y[0],t)},d="",c=s.text):(a=e.getViewSpec(i))?(u=function(){e.changeView(i)},g.push(i),d=a.buttonTextOverride,c=a.buttonTextDefault):e[i]&&(u=function(){e[i]()},d=(e.overrides.buttonText||{})[i],c=r.buttonText[i]),u&&(h=s?s.themeIcon:r.themeButtonIcons[i],p=s?s.icon:r.buttonIcons[i],v=d?tt(d):h&&r.theme?"<span class='ui-icon ui-icon-"+h+"'></span>":p&&!r.theme?"<span class='fc-icon fc-icon-"+p+"'></span>":tt(c),m=["fc-"+i+"-button",f+"-button",f+"-state-default"],y=t('<button type="button" class="'+m.join(" ")+'">'+v+"</button>").click(function(t){y.hasClass(f+"-state-disabled")||(u(t),(y.hasClass(f+"-state-active")||y.hasClass(f+"-state-disabled"))&&y.removeClass(f+"-state-hover"))}).mousedown(function(){y.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-down")}).mouseup(function(){y.removeClass(f+"-state-down")}).hover(function(){y.not("."+f+"-state-active").not("."+f+"-state-disabled").addClass(f+"-state-hover")},function(){y.removeClass(f+"-state-hover").removeClass(f+"-state-down")}),o=o.add(y)))}),l&&o.first().addClass(f+"-corner-left").end().last().addClass(f+"-corner-right").end(),o.length>1?(s=t("<div/>"),l&&s.addClass("fc-button-group"),s.append(o),i.append(s)):i.append(o)}),i}function s(t){h&&h.find("h2").text(t)}function o(t){h&&h.find(".fc-"+t+"-button").addClass(f+"-state-active")}function l(t){h&&h.find(".fc-"+t+"-button").removeClass(f+"-state-active")}function a(t){h&&h.find(".fc-"+t+"-button").prop("disabled",!0).addClass(f+"-state-disabled")}function u(t){h&&h.find(".fc-"+t+"-button").prop("disabled",!1).removeClass(f+"-state-disabled")}function d(){return g}var c=this;c.render=n,c.removeElement=i,c.updateTitle=s,c.activateButton=o,c.deactivateButton=l,c.disableButton=a,c.enableButton=u,c.getViewsWithButtons=d,c.el=null;var h,f,g=[]}function Yt(){function n(t,e){return!O||t<O||e>V}function i(t,e){O=t,V=e,r(Y,"reset")}function r(t,e){var n,i;for("reset"===e?j=[]:"add"!==e&&(j=w(j,t)),n=0;n<t.length;n++)i=t[n],"pending"!==i._status&&W++,i._fetchId=(i._fetchId||0)+1,i._status="pending";for(n=0;n<t.length;n++)i=t[n],s(i,i._fetchId)}function s(e,n){a(e,function(i){var r,s,o,a=t.isArray(e.events);if(n===e._fetchId&&"rejected"!==e._status){if(e._status="resolved",i)for(r=0;r<i.length;r++)s=i[r],o=a?s:R(s,e),o&&j.push.apply(j,L(o));l()}})}function o(t){var e="pending"===t._status;t._status="rejected",e&&l()}function l(){W--,W||P(j)}function a(e,n){var i,r,s=jt.sourceFetchers;for(i=0;i<s.length;i++){if(r=s[i].call(F,e,O.clone(),V.clone(),F.options.timezone,n),r===!0)return;if("object"==typeof r)return void a(r,n)}var o=e.events;if(o)t.isFunction(o)?(F.pushLoading(),o.call(F,O.clone(),V.clone(),F.options.timezone,function(t){n(t),F.popLoading()})):t.isArray(o)?n(o):n();else{var l=e.url;if(l){var u,d=e.success,c=e.error,h=e.complete;u=t.isFunction(e.data)?e.data():e.data;var f=t.extend({},u||{}),g=J(e.startParam,F.options.startParam),p=J(e.endParam,F.options.endParam),v=J(e.timezoneParam,F.options.timezoneParam);g&&(f[g]=O.format()),p&&(f[p]=V.format()),F.options.timezone&&"local"!=F.options.timezone&&(f[v]=F.options.timezone),F.pushLoading(),t.ajax(t.extend({},Te,e,{data:f,success:function(e){e=e||[];var i=Q(d,this,arguments);t.isArray(i)&&(e=i),n(e)},error:function(){Q(c,this,arguments),n()},complete:function(){Q(h,this,arguments),F.popLoading()}}))}else n()}}function u(t){var e=d(t);e&&(Y.push(e),r([e],"add"))}function d(e){var n,i,r=jt.sourceNormalizers;if(t.isFunction(e)||t.isArray(e)?n={events:e}:"string"==typeof e?n={url:e}:"object"==typeof e&&(n=t.extend({},e)),n){for(n.className?"string"==typeof n.className&&(n.className=n.className.split(/\s+/)):n.className=[],t.isArray(n.events)&&(n.origArray=n.events,n.events=t.map(n.events,function(t){return R(t,n)})),i=0;i<r.length;i++)r[i].call(F,n);return n}}function c(t){f(m(t))}function h(t){null==t?f(Y,!0):f(v(t))}function f(e,n){var i;for(i=0;i<e.length;i++)o(e[i]);n?(Y=[],j=[]):(Y=t.grep(Y,function(t){for(i=0;i<e.length;i++)if(t===e[i])return!1;return!0}),j=w(j,e)),P(j)}function g(){return Y.slice(1)}function p(e){return t.grep(Y,function(t){return t.id&&t.id===e})[0]}function v(e){e?t.isArray(e)||(e=[e]):e=[];var n,i=[];for(n=0;n<e.length;n++)i.push.apply(i,m(e[n]));return i}function m(e){var n,i;for(n=0;n<Y.length;n++)if(i=Y[n],i===e)return[i];return i=p(e),i?[i]:t.grep(Y,function(t){return y(e,t)})}function y(t,e){return t&&e&&S(t)==S(e)}function S(t){return("object"==typeof t?t.origArray||t.googleCalendarId||t.url||t.events:null)||t}function w(e,n){return t.grep(e,function(t){for(var e=0;e<n.length;e++)if(t.source===n[e])return!1;return!0})}function E(t){t.start=F.moment(t.start),t.end?t.end=F.moment(t.end):t.end=null,B(t,D(t)),P(j)}function D(e){var n={};return t.each(e,function(t,e){b(t)&&void 0!==e&&K(e)&&(n[t]=e)}),n}function b(t){return!/^_|^(id|allDay|start|end)$/.test(t)}function C(t,e){var n,i,r,s=R(t);if(s){for(n=L(s),i=0;i<n.length;i++)r=n[i],r.source||(e&&(_.events.push(r),r.source=_),j.push(r));return P(j),n}return[]}function H(e){var n,i;for(null==e?e=function(){return!0}:t.isFunction(e)||(n=e+"",e=function(t){return t._id==n}),j=t.grep(j,e,!0),i=0;i<Y.length;i++)t.isArray(Y[i].events)&&(Y[i].events=t.grep(Y[i].events,e,!0));P(j)}function T(e){return t.isFunction(e)?t.grep(j,e):null!=e?(e+="",t.grep(j,function(t){return t._id==e})):j}function x(t){t.start=F.moment(t.start),t.end&&(t.end=F.moment(t.end)),Wt(t)}function R(n,i){var r,s,o,l={};if(F.options.eventDataTransform&&(n=F.options.eventDataTransform(n)),i&&i.eventDataTransform&&(n=i.eventDataTransform(n)),t.extend(l,n),i&&(l.source=i),l._id=n._id||(void 0===n.id?"_fc"+xe++:n.id+""),n.className?"string"==typeof n.className?l.className=n.className.split(/\s+/):l.className=n.className:l.className=[],r=n.start||n.date,s=n.end,U(r)&&(r=e.duration(r)),U(s)&&(s=e.duration(s)),n.dow||e.isDuration(r)||e.isDuration(s))l.start=r?e.duration(r):null,l.end=s?e.duration(s):null,l._recurring=!0;else{if(r&&(r=F.moment(r),!r.isValid()))return!1;s&&(s=F.moment(s),s.isValid()||(s=null)),o=n.allDay,void 0===o&&(o=J(i?i.allDayDefault:void 0,F.options.allDayDefault)),I(r,s,o,l)}return F.normalizeEvent(l),l}function I(t,e,n,i){i.start=t,i.end=e,i.allDay=n,k(i),Wt(i)}function k(t){M(t),t.end&&!t.end.isAfter(t.start)&&(t.end=null),t.end||(F.options.forceEventDuration?t.end=F.getDefaultEventEnd(t.allDay,t.start):t.end=null)}function M(t){null==t.allDay&&(t.allDay=!(t.start.hasTime()||t.end&&t.end.hasTime())),t.allDay?(t.start.stripTime(),t.end&&t.end.stripTime()):(t.start.hasTime()||(t.start=F.applyTimezone(t.start.time(0))),t.end&&!t.end.hasTime()&&(t.end=F.applyTimezone(t.end.time(0))))}function L(e,n,i){var r,s,o,l,a,u,d,c,h,f=[];if(n=n||O,i=i||V,e)if(e._recurring){if(s=e.dow)for(r={},o=0;o<s.length;o++)r[s[o]]=!0;for(l=n.clone().stripTime();l.isBefore(i);)r&&!r[l.day()]||(a=e.start,u=e.end,d=l.clone(),c=null,a&&(d=d.time(a)),u&&(c=l.clone().time(u)),h=t.extend({},e),I(d,c,!a&&!u,h),f.push(h)),l.add(1,"days")}else f.push(e);return f}function B(e,n,i){function r(t,e){return i?A(t,e,i):n.allDay?G(t,e):N(t,e)}var s,o,l,a,u,d,c={};return n=n||{},n.start||(n.start=e.start.clone()),void 0===n.end&&(n.end=e.end?e.end.clone():null),null==n.allDay&&(n.allDay=e.allDay),k(n),s={start:e._start.clone(),end:e._end?e._end.clone():F.getDefaultEventEnd(e._allDay,e._start),allDay:n.allDay},k(s),o=null!==e._end&&null===n.end,l=r(n.start,s.start),n.end?(a=r(n.end,s.end),u=a.subtract(l)):u=null,t.each(n,function(t,e){b(t)&&void 0!==e&&(c[t]=e)}),d=z(T(e._id),o,n.allDay,l,u,c),{dateDelta:l,durationDelta:u,undo:d}}function z(e,n,i,r,s,o){var l=F.getIsAmbigTimezone(),a=[];return r&&!r.valueOf()&&(r=null),s&&!s.valueOf()&&(s=null),t.each(e,function(e,u){var d,c;d={start:u.start.clone(),end:u.end?u.end.clone():null,allDay:u.allDay},t.each(o,function(t){d[t]=u[t]}),c={start:u._start,end:u._end,allDay:i},k(c),n?c.end=null:s&&!c.end&&(c.end=F.getDefaultEventEnd(c.allDay,c.start)),r&&(c.start.add(r),c.end&&c.end.add(r)),s&&c.end.add(s),l&&!c.allDay&&(r||s)&&(c.start.stripZone(),c.end&&c.end.stripZone()),t.extend(u,o,c),Wt(u),a.push(function(){t.extend(u,d),Wt(u)})}),function(){for(var t=0;t<a.length;t++)a[t]()}}var F=this;F.isFetchNeeded=n,F.fetchEvents=i,F.fetchEventSources=r,F.getEventSources=g,F.getEventSourceById=p,F.getEventSourcesByMatchArray=v,F.getEventSourcesByMatch=m,F.addEventSource=u,F.removeEventSource=c,F.removeEventSources=h,F.updateEvent=E,F.renderEvent=C,F.removeEvents=H,F.clientEvents=T,F.mutateEvent=B,F.normalizeEventDates=k,F.normalizeEventTimes=M;var O,V,P=F.reportEvents,_={events:[]},Y=[_],W=0,j=[];t.each((F.options.events?[F.options.events]:[]).concat(F.options.eventSources||[]),function(t,e){var n=d(e);n&&Y.push(n)}),F.rezoneArrayEventSources=function(){var e,n,i;for(e=0;e<Y.length;e++)if(n=Y[e].events,t.isArray(n))for(i=0;i<n.length;i++)x(n[i])},F.buildEventFromInput=R,F.expandEvent=L,F.getEventCache=function(){return j}}function Wt(t){t._allDay=t.allDay,t._start=t.start.clone(),t._end=t.end?t.end.clone():null}var jt=t.fullCalendar={version:"3.0.1",internalApiVersion:6},Ut=jt.views={};t.fn.fullCalendar=function(e){var n=Array.prototype.slice.call(arguments,1),i=this;return this.each(function(r,s){var o,l=t(s),a=l.data("fullCalendar");"string"==typeof e?a&&t.isFunction(a[e])&&(o=a[e].apply(a,n),r||(i=o),"destroy"===e&&l.removeData("fullCalendar")):a||(a=new Ee(l,e),l.data("fullCalendar",a),a.render())}),i};var qt=["header","buttonText","buttonIcons","themeButtonIcons"];jt.intersectRanges=F,jt.applyAll=Q,jt.debounce=at,jt.isInt=ot,jt.htmlEscape=tt,jt.cssToStr=nt,jt.proxy=lt,jt.capitaliseFirstLetter=rt,jt.getOuterRect=h,jt.getClientRect=f,jt.getContentRect=g,jt.getScrollbarWidths=p;var Zt=null;jt.preventDefault=C,jt.intersectRects=x,jt.parseFieldSpecs=M,jt.compareByFieldSpecs=L,jt.compareByFieldSpec=B,jt.flexibleCompare=z,jt.computeIntervalUnit=O,jt.divideRangeByDuration=P,jt.divideDurationByDuration=_,jt.multiplyDuration=Y,jt.durationHasTime=W;var $t=["sun","mon","tue","wed","thu","fri","sat"],Xt=["year","month","week","day","hour","minute","second","millisecond"];jt.log=function(){var t=window.console;if(t&&t.log)return t.log.apply(t,arguments)},jt.warn=function(){var t=window.console;return t&&t.warn?t.warn.apply(t,arguments):jt.log.apply(jt,arguments)};var Kt={}.hasOwnProperty,Qt=/^\s*\d{4}-\d\d$/,Jt=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,te=e.fn,ee=t.extend({},te),ne=e.momentProperties;ne.push("_fullCalendar"),ne.push("_ambigTime"),ne.push("_ambigZone"),jt.moment=function(){return dt(arguments)},jt.moment.utc=function(){var t=dt(arguments,!0);return t.hasTime()&&t.utc(),t},jt.moment.parseZone=function(){return dt(arguments,!0,!0)},te.week=te.weeks=function(t){var e=this._locale._fullCalendar_weekCalc;return null==t&&"function"==typeof e?e(this):"ISO"===e?ee.isoWeek.apply(this,arguments):ee.week.apply(this,arguments)},te.time=function(t){if(!this._fullCalendar)return ee.time.apply(this,arguments);if(null==t)return e.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1,e.isDuration(t)||e.isMoment(t)||(t=e.duration(t));var n=0;return e.isDuration(t)&&(n=24*Math.floor(t.asDays())),this.hours(n+t.hours()).minutes(t.minutes()).seconds(t.seconds()).milliseconds(t.milliseconds())},te.stripTime=function(){return this._ambigTime||(this.utc(!0),this.set({hours:0,minutes:0,seconds:0,ms:0}),this._ambigTime=!0,this._ambigZone=!0),this},te.hasTime=function(){return!this._ambigTime},te.stripZone=function(){var t;return this._ambigZone||(t=this._ambigTime,this.utc(!0),this._ambigTime=t||!1,this._ambigZone=!0),this},te.hasZone=function(){return!this._ambigZone},te.local=function(t){return ee.local.call(this,this._ambigZone||t),this._ambigTime=!1,this._ambigZone=!1,this},te.utc=function(t){return ee.utc.call(this,t),this._ambigTime=!1,this._ambigZone=!1,this},te.utcOffset=function(t){return null!=t&&(this._ambigTime=!1,this._ambigZone=!1),ee.utcOffset.apply(this,arguments)},te.format=function(){return this._fullCalendar&&arguments[0]?ht(this,arguments[0]):this._ambigTime?ct(this,"YYYY-MM-DD"):this._ambigZone?ct(this,"YYYY-MM-DD[T]HH:mm:ss"):ee.format.apply(this,arguments)},te.toISOString=function(){return this._ambigTime?ct(this,"YYYY-MM-DD"):this._ambigZone?ct(this,"YYYY-MM-DD[T]HH:mm:ss"):ee.toISOString.apply(this,arguments)};var ie={t:function(t){return ct(t,"a").charAt(0)},T:function(t){return ct(t,"A").charAt(0)}};jt.formatRange=pt;var re={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"},se={},oe={Y:{value:1,unit:"year"},M:{value:2,unit:"month"},W:{value:3,unit:"week"},w:{value:3,unit:"week"},D:{value:4,unit:"day"},d:{value:4,unit:"day"}};jt.queryMostGranularFormatUnit=function(t){var e,n,i,r,s=yt(t);for(e=0;e<s.length;e++)n=s[e],n.token&&(i=oe[n.token.charAt(0)],i&&(!r||i.value>r.value)&&(r=i));return r?r.unit:null},jt.Class=wt,wt.extend=function(){var t,e,n=arguments.length;for(t=0;t<n;t++)e=arguments[t],t<n-1&&Dt(this,e);return Et(this,e||{})},wt.mixin=function(t){Dt(this,t)};var le=jt.EmitterMixin={on:function(e,n){var i=function(t,e){return n.apply(e.context||this,e.args||[])};return n.guid||(n.guid=t.guid++),i.guid=n.guid,t(this).on(e,i),this},off:function(e,n){return t(this).off(e,n),this},trigger:function(e){var n=Array.prototype.slice.call(arguments,1);return t(this).triggerHandler(e,{args:n}),this},triggerWith:function(e,n,i){return t(this).triggerHandler(e,{context:n,args:i}),this}},ae=jt.ListenerMixin=function(){var e=0,n={listenerId:null,listenTo:function(e,n,i){if("object"==typeof n)for(var r in n)n.hasOwnProperty(r)&&this.listenTo(e,r,n[r]);else"string"==typeof n&&e.on(n+"."+this.getListenerNamespace(),t.proxy(i,this))},stopListeningTo:function(t,e){t.off((e||"")+"."+this.getListenerNamespace())},getListenerNamespace:function(){return null==this.listenerId&&(this.listenerId=e++),"_listener"+this.listenerId}};return n}(),ue={isIgnoringMouse:!1,delayUnignoreMouse:null,initMouseIgnoring:function(t){this.delayUnignoreMouse=at(lt(this,"unignoreMouse"),t||1e3)},tempIgnoreMouse:function(){this.isIgnoringMouse=!0,this.delayUnignoreMouse()},unignoreMouse:function(){this.isIgnoringMouse=!1}},de=wt.extend(ae,{isHidden:!0,options:null,el:null,margin:10,constructor:function(t){this.options=t||{}},show:function(){
this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var e=this,n=this.options;this.el=t('<div class="fc-popover"/>').addClass(n.className||"").css({top:0,left:0}).append(n.content).appendTo(n.parentEl),this.el.on("click",".fc-close",function(){e.hide()}),n.autoHide&&this.listenTo(t(document),"mousedown",this.documentMousedown)},documentMousedown:function(e){this.el&&!t(e.target).closest(this.el).length&&this.hide()},removeElement:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),this.stopListeningTo(t(document),"mousedown")},position:function(){var e,n,i,r,s,o=this.options,l=this.el.offsetParent().offset(),a=this.el.outerWidth(),u=this.el.outerHeight(),d=t(window),h=c(this.el);r=o.top||0,s=void 0!==o.left?o.left:void 0!==o.right?o.right-a:0,h.is(window)||h.is(document)?(h=d,e=0,n=0):(i=h.offset(),e=i.top,n=i.left),e+=d.scrollTop(),n+=d.scrollLeft(),o.viewportConstrain!==!1&&(r=Math.min(r,e+h.outerHeight()-u-this.margin),r=Math.max(r,e+this.margin),s=Math.min(s,n+h.outerWidth()-a-this.margin),s=Math.max(s,n+this.margin)),this.el.css({top:r-l.top,left:s-l.left})},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1))}}),ce=jt.CoordCache=wt.extend({els:null,forcedOffsetParentEl:null,origin:null,boundingRect:null,isHorizontal:!1,isVertical:!1,lefts:null,rights:null,tops:null,bottoms:null,constructor:function(e){this.els=t(e.els),this.isHorizontal=e.isHorizontal,this.isVertical=e.isVertical,this.forcedOffsetParentEl=e.offsetParent?t(e.offsetParent):null},build:function(){var t=this.forcedOffsetParentEl||this.els.eq(0).offsetParent();this.origin=t.offset(),this.boundingRect=this.queryBoundingRect(),this.isHorizontal&&this.buildElHorizontals(),this.isVertical&&this.buildElVerticals()},clear:function(){this.origin=null,this.boundingRect=null,this.lefts=null,this.rights=null,this.tops=null,this.bottoms=null},ensureBuilt:function(){this.origin||this.build()},buildElHorizontals:function(){var e=[],n=[];this.els.each(function(i,r){var s=t(r),o=s.offset().left,l=s.outerWidth();e.push(o),n.push(o+l)}),this.lefts=e,this.rights=n},buildElVerticals:function(){var e=[],n=[];this.els.each(function(i,r){var s=t(r),o=s.offset().top,l=s.outerHeight();e.push(o),n.push(o+l)}),this.tops=e,this.bottoms=n},getHorizontalIndex:function(t){this.ensureBuilt();var e,n=this.lefts,i=this.rights,r=n.length;for(e=0;e<r;e++)if(t>=n[e]&&t<i[e])return e},getVerticalIndex:function(t){this.ensureBuilt();var e,n=this.tops,i=this.bottoms,r=n.length;for(e=0;e<r;e++)if(t>=n[e]&&t<i[e])return e},getLeftOffset:function(t){return this.ensureBuilt(),this.lefts[t]},getLeftPosition:function(t){return this.ensureBuilt(),this.lefts[t]-this.origin.left},getRightOffset:function(t){return this.ensureBuilt(),this.rights[t]},getRightPosition:function(t){return this.ensureBuilt(),this.rights[t]-this.origin.left},getWidth:function(t){return this.ensureBuilt(),this.rights[t]-this.lefts[t]},getTopOffset:function(t){return this.ensureBuilt(),this.tops[t]},getTopPosition:function(t){return this.ensureBuilt(),this.tops[t]-this.origin.top},getBottomOffset:function(t){return this.ensureBuilt(),this.bottoms[t]},getBottomPosition:function(t){return this.ensureBuilt(),this.bottoms[t]-this.origin.top},getHeight:function(t){return this.ensureBuilt(),this.bottoms[t]-this.tops[t]},queryBoundingRect:function(){var t=c(this.els.eq(0));if(!t.is(document))return f(t)},isPointInBounds:function(t,e){return this.isLeftInBounds(t)&&this.isTopInBounds(e)},isLeftInBounds:function(t){return!this.boundingRect||t>=this.boundingRect.left&&t<this.boundingRect.right},isTopInBounds:function(t){return!this.boundingRect||t>=this.boundingRect.top&&t<this.boundingRect.bottom}}),he=jt.DragListener=wt.extend(ae,ue,{options:null,subjectEl:null,originX:null,originY:null,scrollEl:null,isInteracting:!1,isDistanceSurpassed:!1,isDelayEnded:!1,isDragging:!1,isTouch:!1,delay:null,delayTimeoutId:null,minDistance:null,handleTouchScrollProxy:null,constructor:function(t){this.options=t||{},this.handleTouchScrollProxy=lt(this,"handleTouchScroll"),this.initMouseIgnoring(500)},startInteraction:function(e,n){var i=D(e);if("mousedown"===e.type){if(this.isIgnoringMouse)return;if(!S(e))return;e.preventDefault()}this.isInteracting||(n=n||{},this.delay=J(n.delay,this.options.delay,0),this.minDistance=J(n.distance,this.options.distance,0),this.subjectEl=this.options.subjectEl,this.isInteracting=!0,this.isTouch=i,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.originX=w(e),this.originY=E(e),this.scrollEl=c(t(e.target)),this.bindHandlers(),this.initAutoScroll(),this.handleInteractionStart(e),this.startDelay(e),this.minDistance||this.handleDistanceSurpassed(e))},handleInteractionStart:function(t){this.trigger("interactionStart",t)},endInteraction:function(t,e){this.isInteracting&&(this.endDrag(t),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null),this.destroyAutoScroll(),this.unbindHandlers(),this.isInteracting=!1,this.handleInteractionEnd(t,e),this.isTouch&&this.tempIgnoreMouse())},handleInteractionEnd:function(t,e){this.trigger("interactionEnd",t,e||!1)},bindHandlers:function(){var e=this,n=1;this.isTouch?(this.listenTo(t(document),{touchmove:this.handleTouchMove,touchend:this.endInteraction,touchcancel:this.endInteraction,touchstart:function(t){n?n--:e.endInteraction(t,!0)}}),!H(this.handleTouchScrollProxy)&&this.scrollEl&&this.listenTo(this.scrollEl,"scroll",this.handleTouchScroll)):this.listenTo(t(document),{mousemove:this.handleMouseMove,mouseup:this.endInteraction}),this.listenTo(t(document),{selectstart:C,contextmenu:C})},unbindHandlers:function(){this.stopListeningTo(t(document)),T(this.handleTouchScrollProxy),this.scrollEl&&this.stopListeningTo(this.scrollEl,"scroll")},startDrag:function(t,e){this.startInteraction(t,e),this.isDragging||(this.isDragging=!0,this.handleDragStart(t))},handleDragStart:function(t){this.trigger("dragStart",t)},handleMove:function(t){var e,n=w(t)-this.originX,i=E(t)-this.originY,r=this.minDistance;this.isDistanceSurpassed||(e=n*n+i*i,e>=r*r&&this.handleDistanceSurpassed(t)),this.isDragging&&this.handleDrag(n,i,t)},handleDrag:function(t,e,n){this.trigger("drag",t,e,n),this.updateAutoScroll(n)},endDrag:function(t){this.isDragging&&(this.isDragging=!1,this.handleDragEnd(t))},handleDragEnd:function(t){this.trigger("dragEnd",t)},startDelay:function(t){var e=this;this.delay?this.delayTimeoutId=setTimeout(function(){e.handleDelayEnd(t)},this.delay):this.handleDelayEnd(t)},handleDelayEnd:function(t){this.isDelayEnded=!0,this.isDistanceSurpassed&&this.startDrag(t)},handleDistanceSurpassed:function(t){this.isDistanceSurpassed=!0,this.isDelayEnded&&this.startDrag(t)},handleTouchMove:function(t){this.isDragging&&t.preventDefault(),this.handleMove(t)},handleMouseMove:function(t){this.handleMove(t)},handleTouchScroll:function(t){this.isDragging||this.endInteraction(t,!0)},trigger:function(t){this.options[t]&&this.options[t].apply(this,Array.prototype.slice.call(arguments,1)),this["_"+t]&&this["_"+t].apply(this,Array.prototype.slice.call(arguments,1))}});he.mixin({isAutoScroll:!1,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,initAutoScroll:function(){var t=this.scrollEl;this.isAutoScroll=this.options.scroll&&t&&!t.is(window)&&!t.is(document),this.isAutoScroll&&this.listenTo(t,"scroll",at(this.handleDebouncedScroll,100))},destroyAutoScroll:function(){this.endAutoScroll(),this.isAutoScroll&&this.stopListeningTo(this.scrollEl,"scroll")},computeScrollBounds:function(){this.isAutoScroll&&(this.scrollBounds=h(this.scrollEl))},updateAutoScroll:function(t){var e,n,i,r,s=this.scrollSensitivity,o=this.scrollBounds,l=0,a=0;o&&(e=(s-(E(t)-o.top))/s,n=(s-(o.bottom-E(t)))/s,i=(s-(w(t)-o.left))/s,r=(s-(o.right-w(t)))/s,e>=0&&e<=1?l=e*this.scrollSpeed*-1:n>=0&&n<=1&&(l=n*this.scrollSpeed),i>=0&&i<=1?a=i*this.scrollSpeed*-1:r>=0&&r<=1&&(a=r*this.scrollSpeed)),this.setScrollVel(l,a)},setScrollVel:function(t,e){this.scrollTopVel=t,this.scrollLeftVel=e,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(lt(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var t=this.scrollEl;this.scrollTopVel<0?t.scrollTop()<=0&&(this.scrollTopVel=0):this.scrollTopVel>0&&t.scrollTop()+t[0].clientHeight>=t[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?t.scrollLeft()<=0&&(this.scrollLeftVel=0):this.scrollLeftVel>0&&t.scrollLeft()+t[0].clientWidth>=t[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var t=this.scrollEl,e=this.scrollIntervalMs/1e3;this.scrollTopVel&&t.scrollTop(t.scrollTop()+this.scrollTopVel*e),this.scrollLeftVel&&t.scrollLeft(t.scrollLeft()+this.scrollLeftVel*e),this.constrainScrollVel(),this.scrollTopVel||this.scrollLeftVel||this.endAutoScroll()},endAutoScroll:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.handleScrollEnd())},handleDebouncedScroll:function(){this.scrollIntervalId||this.handleScrollEnd()},handleScrollEnd:function(){}});var fe=he.extend({component:null,origHit:null,hit:null,coordAdjust:null,constructor:function(t,e){he.call(this,e),this.component=t},handleInteractionStart:function(t){var e,n,i,r=this.subjectEl;this.computeCoords(),t?(n={left:w(t),top:E(t)},i=n,r&&(e=h(r),i=R(i,e)),this.origHit=this.queryHit(i.left,i.top),r&&this.options.subjectCenter&&(this.origHit&&(e=x(this.origHit,e)||e),i=I(e)),this.coordAdjust=k(i,n)):(this.origHit=null,this.coordAdjust=null),he.prototype.handleInteractionStart.apply(this,arguments)},computeCoords:function(){this.component.prepareHits(),this.computeScrollBounds()},handleDragStart:function(t){var e;he.prototype.handleDragStart.apply(this,arguments),e=this.queryHit(w(t),E(t)),e&&this.handleHitOver(e)},handleDrag:function(t,e,n){var i;he.prototype.handleDrag.apply(this,arguments),i=this.queryHit(w(n),E(n)),bt(i,this.hit)||(this.hit&&this.handleHitOut(),i&&this.handleHitOver(i))},handleDragEnd:function(){this.handleHitDone(),he.prototype.handleDragEnd.apply(this,arguments)},handleHitOver:function(t){var e=bt(t,this.origHit);this.hit=t,this.trigger("hitOver",this.hit,e,this.origHit)},handleHitOut:function(){this.hit&&(this.trigger("hitOut",this.hit),this.handleHitDone(),this.hit=null)},handleHitDone:function(){this.hit&&this.trigger("hitDone",this.hit)},handleInteractionEnd:function(){he.prototype.handleInteractionEnd.apply(this,arguments),this.origHit=null,this.hit=null,this.component.releaseHits()},handleScrollEnd:function(){he.prototype.handleScrollEnd.apply(this,arguments),this.computeCoords()},queryHit:function(t,e){return this.coordAdjust&&(t+=this.coordAdjust.left,e+=this.coordAdjust.top),this.component.queryHit(t,e)}}),ge=wt.extend(ae,{options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,y0:null,x0:null,topDelta:null,leftDelta:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(e,n){this.options=n=n||{},this.sourceEl=e,this.parentEl=n.parentEl?t(n.parentEl):e.parent()},start:function(e){this.isFollowing||(this.isFollowing=!0,this.y0=E(e),this.x0=w(e),this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),D(e)?this.listenTo(t(document),"touchmove",this.handleMove):this.listenTo(t(document),"mousemove",this.handleMove))},stop:function(e,n){function i(){r.isAnimating=!1,r.removeElement(),r.top0=r.left0=null,n&&n()}var r=this,s=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,this.stopListeningTo(t(document)),e&&s&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:s,complete:i})):i())},getEl:function(){var t=this.el;return t||(t=this.el=this.sourceEl.clone().addClass(this.options.additionalClass||"").css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}),t.addClass("fc-unselectable"),t.appendTo(this.parentEl)),t},removeElement:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var t,e;this.getEl(),null===this.top0&&(t=this.sourceEl.offset(),e=this.el.offsetParent().offset(),this.top0=t.top-e.top,this.left0=t.left-e.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},handleMove:function(t){this.topDelta=E(t)-this.y0,this.leftDelta=w(t)-this.x0,this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}}),pe=jt.Grid=wt.extend(ae,ue,{hasDayInteractions:!0,view:null,isRTL:null,start:null,end:null,el:null,elsByFill:null,eventTimeFormat:null,displayEventTime:null,displayEventEnd:null,minResizeDuration:null,largeUnit:null,dayDragListener:null,segDragListener:null,segResizeListener:null,externalDragListener:null,constructor:function(t){this.view=t,this.isRTL=t.opt("isRTL"),this.elsByFill={},this.dayDragListener=this.buildDayDragListener(),this.initMouseIgnoring()},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventTime:function(){return!0},computeDisplayEventEnd:function(){return!0},setRange:function(t){this.start=t.start.clone(),this.end=t.end.clone(),this.rangeUpdated(),this.processRangeOptions()},rangeUpdated:function(){},processRangeOptions:function(){var t,e,n=this.view;this.eventTimeFormat=n.opt("eventTimeFormat")||n.opt("timeFormat")||this.computeEventTimeFormat(),t=n.opt("displayEventTime"),null==t&&(t=this.computeDisplayEventTime()),e=n.opt("displayEventEnd"),null==e&&(e=this.computeDisplayEventEnd()),this.displayEventTime=t,this.displayEventEnd=e},spanToSegs:function(t){},diffDates:function(t,e){return this.largeUnit?A(t,e,this.largeUnit):N(t,e)},prepareHits:function(){},releaseHits:function(){},queryHit:function(t,e){},getHitSpan:function(t){},getHitEl:function(t){},setElement:function(t){this.el=t,this.hasDayInteractions&&(b(t),this.bindDayHandler("touchstart",this.dayTouchStart),this.bindDayHandler("mousedown",this.dayMousedown)),this.bindSegHandlers(),this.bindGlobalHandlers()},bindDayHandler:function(e,n){var i=this;this.el.on(e,function(e){if(!t(e.target).is(i.segSelector+","+i.segSelector+" *,.fc-more,a[data-goto]"))return n.call(i,e)})},removeElement:function(){this.unbindGlobalHandlers(),this.clearDragListeners(),this.el.remove()},renderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},bindGlobalHandlers:function(){this.listenTo(t(document),{dragstart:this.externalDragStart,sortstart:this.externalDragStart})},unbindGlobalHandlers:function(){this.stopListeningTo(t(document))},dayMousedown:function(t){this.isIgnoringMouse||this.dayDragListener.startInteraction(t,{})},dayTouchStart:function(t){var e=this.view;(e.isSelected||e.selectedEvent)&&this.tempIgnoreMouse(),this.dayDragListener.startInteraction(t,{delay:this.view.opt("longPressDelay")})},buildDayDragListener:function(){var t,e,n=this,i=this.view,r=i.opt("selectable"),l=new fe(this,{scroll:i.opt("dragScroll"),interactionStart:function(){t=l.origHit,e=null},dragStart:function(){i.unselect()},hitOver:function(i,o,l){l&&(o||(t=null),r&&(e=n.computeSelection(n.getHitSpan(l),n.getHitSpan(i)),e?n.renderSelection(e):e===!1&&s()))},hitOut:function(){t=null,e=null,n.unrenderSelection()},hitDone:function(){o()},interactionEnd:function(r,s){s||(t&&!n.isIgnoringMouse&&i.triggerDayClick(n.getHitSpan(t),n.getHitEl(t),r),e&&i.reportSelection(e,r))}});return l},clearDragListeners:function(){this.dayDragListener.endInteraction(),this.segDragListener&&this.segDragListener.endInteraction(),this.segResizeListener&&this.segResizeListener.endInteraction(),this.externalDragListener&&this.externalDragListener.endInteraction()},renderEventLocationHelper:function(t,e){var n=this.fabricateHelperEvent(t,e);return this.renderHelper(n,e)},fabricateHelperEvent:function(t,e){var n=e?Z(e.event):{};return n.start=t.start.clone(),n.end=t.end?t.end.clone():null,n.allDay=null,this.view.calendar.normalizeEventDates(n),n.className=(n.className||[]).concat("fc-helper"),e||(n.editable=!1),n},renderHelper:function(t,e){},unrenderHelper:function(){},renderSelection:function(t){this.renderHighlight(t)},unrenderSelection:function(){this.unrenderHighlight()},computeSelection:function(t,e){var n=this.computeSelectionSpan(t,e);return!(n&&!this.view.calendar.isSelectionSpanAllowed(n))&&n},computeSelectionSpan:function(t,e){var n=[t.start,t.end,e.start,e.end];return n.sort(st),{start:n[0].clone(),end:n[3].clone()}},renderHighlight:function(t){this.renderFill("highlight",this.spanToSegs(t))},unrenderHighlight:function(){this.unrenderFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderBusinessHours:function(){},unrenderBusinessHours:function(){},getNowIndicatorUnit:function(){},renderNowIndicator:function(t){},unrenderNowIndicator:function(){},renderFill:function(t,e){},unrenderFill:function(t){var e=this.elsByFill[t];e&&(e.remove(),delete this.elsByFill[t])},renderFillSegEls:function(e,n){var i,r=this,s=this[e+"SegEl"],o="",l=[];if(n.length){for(i=0;i<n.length;i++)o+=this.fillSegHtml(e,n[i]);t(o).each(function(e,i){var o=n[e],a=t(i);s&&(a=s.call(r,o,a)),a&&(a=t(a),a.is(r.fillSegTag)&&(o.el=a,l.push(o)))})}return l},fillSegTag:"div",fillSegHtml:function(t,e){var n=this[t+"SegClasses"],i=this[t+"SegCss"],r=n?n.call(this,e):[],s=nt(i?i.call(this,e):{});return"<"+this.fillSegTag+(r.length?' class="'+r.join(" ")+'"':"")+(s?' style="'+s+'"':"")+" />"},getDayClasses:function(t){var e=this.view,n=e.calendar.getNow(),i=["fc-"+$t[t.day()]];return 1==e.intervalDuration.as("months")&&t.month()!=e.intervalStart.month()&&i.push("fc-other-month"),t.isSame(n,"day")?i.push("fc-today",e.highlightStateClass):t<n?i.push("fc-past"):i.push("fc-future"),i}});pe.mixin({segSelector:".fc-event-container > *",mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,isDraggingExternal:!1,segs:null,renderEvents:function(t){var e,n=[],i=[];for(e=0;e<t.length;e++)(Tt(t[e])?n:i).push(t[e]);this.segs=[].concat(this.renderBgEvents(n),this.renderFgEvents(i))},renderBgEvents:function(t){var e=this.eventsToSegs(t);return this.renderBgSegs(e)||e},renderFgEvents:function(t){var e=this.eventsToSegs(t);return this.renderFgSegs(e)||e},unrenderEvents:function(){this.handleSegMouseout(),this.clearDragListeners(),this.unrenderFgSegs(),this.unrenderBgSegs(),this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(t){},unrenderFgSegs:function(){},renderFgSegEls:function(e,n){var i,r=this.view,s="",o=[];if(e.length){for(i=0;i<e.length;i++)s+=this.fgSegHtml(e[i],n);t(s).each(function(n,i){var s=e[n],l=r.resolveEventEl(s.event,t(i));l&&(l.data("fc-seg",s),s.el=l,o.push(s))})}return o},fgSegHtml:function(t,e){},renderBgSegs:function(t){return this.renderFill("bgEvent",t)},unrenderBgSegs:function(){this.unrenderFill("bgEvent")},bgEventSegEl:function(t,e){return this.view.resolveEventEl(t.event,e)},bgEventSegClasses:function(t){var e=t.event,n=e.source||{};return["fc-bgevent"].concat(e.className,n.className||[])},bgEventSegCss:function(t){return{"background-color":this.getSegSkinCss(t)["background-color"]}},businessHoursSegClasses:function(t){return["fc-nonbusiness","fc-bgevent"]},buildBusinessHourSegs:function(e){var n=this.view.calendar.getCurrentBusinessHourEvents(e);return!n.length&&this.view.calendar.options.businessHours&&(n=[t.extend({},Re,{start:this.view.end,end:this.view.end,dow:null})]),this.eventsToSegs(n)},bindSegHandlers:function(){this.bindSegHandlersToEl(this.el)},bindSegHandlersToEl:function(t){this.bindSegHandlerToEl(t,"touchstart",this.handleSegTouchStart),this.bindSegHandlerToEl(t,"touchend",this.handleSegTouchEnd),this.bindSegHandlerToEl(t,"mouseenter",this.handleSegMouseover),this.bindSegHandlerToEl(t,"mouseleave",this.handleSegMouseout),this.bindSegHandlerToEl(t,"mousedown",this.handleSegMousedown),this.bindSegHandlerToEl(t,"click",this.handleSegClick)},bindSegHandlerToEl:function(e,n,i){var r=this;e.on(n,this.segSelector,function(e){var n=t(this).data("fc-seg");if(n&&!r.isDraggingSeg&&!r.isResizingSeg)return i.call(r,n,e)})},handleSegClick:function(t,e){var n=this.view.trigger("eventClick",t.el[0],t.event,e);n===!1&&e.preventDefault()},handleSegMouseover:function(t,e){this.isIgnoringMouse||this.mousedOverSeg||(this.mousedOverSeg=t,this.view.isEventResizable(t.event)&&t.el.addClass("fc-allow-mouse-resize"),this.view.trigger("eventMouseover",t.el[0],t.event,e))},handleSegMouseout:function(t,e){e=e||{},this.mousedOverSeg&&(t=t||this.mousedOverSeg,this.mousedOverSeg=null,this.view.isEventResizable(t.event)&&t.el.removeClass("fc-allow-mouse-resize"),this.view.trigger("eventMouseout",t.el[0],t.event,e))},handleSegMousedown:function(t,e){var n=this.startSegResize(t,e,{distance:5});!n&&this.view.isEventDraggable(t.event)&&this.buildSegDragListener(t).startInteraction(e,{distance:5})},handleSegTouchStart:function(t,e){var n,i=this.view,r=t.event,s=i.isEventSelected(r),o=i.isEventDraggable(r),l=i.isEventResizable(r),a=!1;s&&l&&(a=this.startSegResize(t,e)),a||!o&&!l||(n=o?this.buildSegDragListener(t):this.buildSegSelectListener(t),n.startInteraction(e,{delay:s?0:this.view.opt("longPressDelay")})),this.tempIgnoreMouse()},handleSegTouchEnd:function(t,e){this.tempIgnoreMouse()},startSegResize:function(e,n,i){return!!t(n.target).is(".fc-resizer")&&(this.buildSegResizeListener(e,t(n.target).is(".fc-start-resizer")).startInteraction(n,i),!0)},buildSegDragListener:function(t){var e,n,i,r=this,l=this.view,a=l.calendar,u=t.el,d=t.event;if(this.segDragListener)return this.segDragListener;var c=this.segDragListener=new fe(l,{scroll:l.opt("dragScroll"),subjectEl:u,subjectCenter:!0,interactionStart:function(i){t.component=r,e=!1,n=new ge(t.el,{additionalClass:"fc-dragging",parentEl:l.el,opacity:c.isTouch?null:l.opt("dragOpacity"),revertDuration:l.opt("dragRevertDuration"),zIndex:2}),n.hide(),n.start(i)},dragStart:function(n){c.isTouch&&!l.isEventSelected(d)&&l.selectEvent(d),e=!0,r.handleSegMouseout(t,n),r.segDragStart(t,n),l.hideEvent(d)},hitOver:function(e,o,u){var h;t.hit&&(u=t.hit),i=r.computeEventDrop(u.component.getHitSpan(u),e.component.getHitSpan(e),d),i&&!a.isEventSpanAllowed(r.eventToSpan(i),d)&&(s(),i=null),i&&(h=l.renderDrag(i,t))?(h.addClass("fc-dragging"),c.isTouch||r.applyDragOpacity(h),n.hide()):n.show(),o&&(i=null)},hitOut:function(){l.unrenderDrag(),n.show(),i=null},hitDone:function(){o()},interactionEnd:function(s){delete t.component,n.stop(!i,function(){e&&(l.unrenderDrag(),l.showEvent(d),r.segDragStop(t,s)),i&&l.reportEventDrop(d,i,this.largeUnit,u,s)}),r.segDragListener=null}});return c},buildSegSelectListener:function(t){var e=this,n=this.view,i=t.event;if(this.segDragListener)return this.segDragListener;var r=this.segDragListener=new he({dragStart:function(t){r.isTouch&&!n.isEventSelected(i)&&n.selectEvent(i)},interactionEnd:function(t){e.segDragListener=null}});return r},segDragStart:function(t,e){this.isDraggingSeg=!0,this.view.trigger("eventDragStart",t.el[0],t.event,e,{})},segDragStop:function(t,e){this.isDraggingSeg=!1,this.view.trigger("eventDragStop",t.el[0],t.event,e,{})},computeEventDrop:function(t,e,n){var i,r,s=this.view.calendar,o=t.start,l=e.start;return o.hasTime()===l.hasTime()?(i=this.diffDates(l,o),n.allDay&&W(i)?(r={start:n.start.clone(),end:s.getEventEnd(n),allDay:!1},s.normalizeEventTimes(r)):r=Ht(n),r.start.add(i),r.end&&r.end.add(i)):r={start:l.clone(),end:null,allDay:!l.hasTime()},r},applyDragOpacity:function(t){var e=this.view.opt("dragOpacity");null!=e&&t.css("opacity",e)},externalDragStart:function(e,n){var i,r,s=this.view;s.opt("droppable")&&(i=t((n?n.item:null)||e.target),r=s.opt("dropAccept"),(t.isFunction(r)?r.call(i[0],i):i.is(r))&&(this.isDraggingExternal||this.listenToExternalDrag(i,e,n)))},listenToExternalDrag:function(t,e,n){var i,r=this,l=this.view.calendar,a=Mt(t),u=r.externalDragListener=new fe(this,{interactionStart:function(){r.isDraggingExternal=!0},hitOver:function(t){i=r.computeExternalDrop(t.component.getHitSpan(t),a),i&&!l.isExternalSpanAllowed(r.eventToSpan(i),i,a.eventProps)&&(s(),i=null),i&&r.renderDrag(i)},hitOut:function(){i=null},hitDone:function(){o(),r.unrenderDrag()},interactionEnd:function(e){i&&r.view.reportExternalDrop(a,i,t,e,n),r.isDraggingExternal=!1,r.externalDragListener=null}});u.startDrag(e)},computeExternalDrop:function(t,e){var n=this.view.calendar,i={start:n.applyTimezone(t.start),end:null};return e.startTime&&!i.start.hasTime()&&i.start.time(e.startTime),e.duration&&(i.end=i.start.clone().add(e.duration)),i},renderDrag:function(t,e){},unrenderDrag:function(){},buildSegResizeListener:function(t,e){var n,i,r=this,l=this.view,a=l.calendar,u=t.el,d=t.event,c=a.getEventEnd(d),h=this.segResizeListener=new fe(this,{scroll:l.opt("dragScroll"),subjectEl:u,interactionStart:function(){n=!1},dragStart:function(e){n=!0,r.handleSegMouseout(t,e),r.segResizeStart(t,e)},hitOver:function(n,o,u){var h=r.getHitSpan(u),f=r.getHitSpan(n);i=e?r.computeEventStartResize(h,f,d):r.computeEventEndResize(h,f,d),i&&(a.isEventSpanAllowed(r.eventToSpan(i),d)?i.start.isSame(d.start.clone().stripZone())&&i.end.isSame(c.clone().stripZone())&&(i=null):(s(),i=null)),i&&(l.hideEvent(d),r.renderEventResize(i,t))},hitOut:function(){i=null},hitDone:function(){r.unrenderEventResize(),l.showEvent(d),o()},interactionEnd:function(e){n&&r.segResizeStop(t,e),i&&l.reportEventResize(d,i,this.largeUnit,u,e),r.segResizeListener=null}});return h},segResizeStart:function(t,e){this.isResizingSeg=!0,this.view.trigger("eventResizeStart",t.el[0],t.event,e,{})},segResizeStop:function(t,e){this.isResizingSeg=!1,this.view.trigger("eventResizeStop",t.el[0],t.event,e,{})},computeEventStartResize:function(t,e,n){return this.computeEventResize("start",t,e,n)},computeEventEndResize:function(t,e,n){return this.computeEventResize("end",t,e,n)},computeEventResize:function(t,e,n,i){var r,s,o=this.view.calendar,l=this.diffDates(n[t],e[t]);return r={start:i.start.clone(),end:o.getEventEnd(i),allDay:i.allDay},r.allDay&&W(l)&&(r.allDay=!1,o.normalizeEventTimes(r)),r[t].add(l),r.start.isBefore(r.end)||(s=this.minResizeDuration||(i.allDay?o.defaultAllDayEventDuration:o.defaultTimedEventDuration),"start"==t?r.start=r.end.clone().subtract(s):r.end=r.start.clone().add(s)),r},renderEventResize:function(t,e){},unrenderEventResize:function(){},getEventTimeText:function(t,e,n){return null==e&&(e=this.eventTimeFormat),null==n&&(n=this.displayEventEnd),this.displayEventTime&&t.start.hasTime()?n&&t.end?this.view.formatRange(t,e):t.start.format(e):""},getSegClasses:function(t,e,n){var i=this.view,r=["fc-event",t.isStart?"fc-start":"fc-not-start",t.isEnd?"fc-end":"fc-not-end"].concat(this.getSegCustomClasses(t));return e&&r.push("fc-draggable"),n&&r.push("fc-resizable"),i.isEventSelected(t.event)&&r.push("fc-selected"),r},getSegCustomClasses:function(t){var e=t.event;return[].concat(e.className,e.source?e.source.className:[])},getSegSkinCss:function(t){return{"background-color":this.getSegBackgroundColor(t),"border-color":this.getSegBorderColor(t),color:this.getSegTextColor(t)}},getSegBackgroundColor:function(t){return t.event.backgroundColor||t.event.color||this.getSegDefaultBackgroundColor(t)},getSegDefaultBackgroundColor:function(t){var e=t.event.source||{};return e.backgroundColor||e.color||this.view.opt("eventBackgroundColor")||this.view.opt("eventColor")},getSegBorderColor:function(t){return t.event.borderColor||t.event.color||this.getSegDefaultBorderColor(t)},getSegDefaultBorderColor:function(t){var e=t.event.source||{};return e.borderColor||e.color||this.view.opt("eventBorderColor")||this.view.opt("eventColor")},getSegTextColor:function(t){return t.event.textColor||this.getSegDefaultTextColor(t)},getSegDefaultTextColor:function(t){var e=t.event.source||{};return e.textColor||this.view.opt("eventTextColor")},eventToSegs:function(t){return this.eventsToSegs([t])},eventToSpan:function(t){return this.eventToSpans(t)[0]},eventToSpans:function(t){var e=this.eventToRange(t);return this.eventRangeToSpans(e,t)},eventsToSegs:function(e,n){var i=this,r=It(e),s=[];return t.each(r,function(t,e){var r,o=[];for(r=0;r<e.length;r++)o.push(i.eventToRange(e[r]));if(xt(e[0]))for(o=i.invertRanges(o),r=0;r<o.length;r++)s.push.apply(s,i.eventRangeToSegs(o[r],e[0],n));else for(r=0;r<o.length;r++)s.push.apply(s,i.eventRangeToSegs(o[r],e[r],n))}),s},eventToRange:function(t){var e=this.view.calendar,n=t.start.clone().stripZone(),i=(t.end?t.end.clone():e.getDefaultEventEnd(null!=t.allDay?t.allDay:!t.start.hasTime(),t.start)).stripZone();return e.localizeMoment(n),e.localizeMoment(i),{start:n,end:i}},eventRangeToSegs:function(t,e,n){var i,r=this.eventRangeToSpans(t,e),s=[];for(i=0;i<r.length;i++)s.push.apply(s,this.eventSpanToSegs(r[i],e,n));return s},eventRangeToSpans:function(e,n){return[t.extend({},e)]},eventSpanToSegs:function(t,e,n){var i,r,s=n?n(t):this.spanToSegs(t);for(i=0;i<s.length;i++)r=s[i],r.event=e,r.eventStartMS=+t.start,r.eventDurationMS=t.end-t.start;return s},invertRanges:function(t){var e,n,i=this.view,r=i.start.clone(),s=i.end.clone(),o=[],l=r;for(t.sort(kt),e=0;e<t.length;e++)n=t[e],n.start>l&&o.push({start:l,end:n.start}),l=n.end;return l<s&&o.push({start:l,end:s}),o},sortEventSegs:function(t){t.sort(lt(this,"compareEventSegs"))},compareEventSegs:function(t,e){return t.eventStartMS-e.eventStartMS||e.eventDurationMS-t.eventDurationMS||e.event.allDay-t.event.allDay||L(t.event,e.event,this.view.eventOrderSpecs)}}),jt.pluckEventDateProps=Ht,jt.isBgEvent=Tt,jt.dataAttrPrefix="";var ve=jt.DayTableMixin={breakOnWeeks:!1,dayDates:null,dayIndices:null,daysPerRow:null,rowCnt:null,colCnt:null,colHeadFormat:null,updateDayTable:function(){for(var t,e,n,i=this.view,r=this.start.clone(),s=-1,o=[],l=[];r.isBefore(this.end);)i.isHiddenDay(r)?o.push(s+.5):(s++,o.push(s),l.push(r.clone())),r.add(1,"days");if(this.breakOnWeeks){for(e=l[0].day(),t=1;t<l.length&&l[t].day()!=e;t++);n=Math.ceil(l.length/t)}else n=1,t=l.length;this.dayDates=l,this.dayIndices=o,this.daysPerRow=t,this.rowCnt=n,this.updateDayTableCols()},updateDayTableCols:function(){this.colCnt=this.computeColCnt(),this.colHeadFormat=this.view.opt("columnFormat")||this.computeColHeadFormat()},computeColCnt:function(){return this.daysPerRow},getCellDate:function(t,e){return this.dayDates[this.getCellDayIndex(t,e)].clone()},getCellRange:function(t,e){var n=this.getCellDate(t,e),i=n.clone().add(1,"days");return{start:n,end:i}},getCellDayIndex:function(t,e){return t*this.daysPerRow+this.getColDayIndex(e)},getColDayIndex:function(t){return this.isRTL?this.colCnt-1-t:t},getDateDayIndex:function(t){var e=this.dayIndices,n=t.diff(this.start,"days");return n<0?e[0]-1:n>=e.length?e[e.length-1]+1:e[n]},computeColHeadFormat:function(){return this.rowCnt>1||this.colCnt>10?"ddd":this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},sliceRangeByRow:function(t){var e,n,i,r,s,o=this.daysPerRow,l=this.view.computeDayRange(t),a=this.getDateDayIndex(l.start),u=this.getDateDayIndex(l.end.clone().subtract(1,"days")),d=[];for(e=0;e<this.rowCnt;e++)n=e*o,i=n+o-1,r=Math.max(a,n),s=Math.min(u,i),r=Math.ceil(r),s=Math.floor(s),r<=s&&d.push({row:e,firstRowDayIndex:r-n,lastRowDayIndex:s-n,isStart:r===a,isEnd:s===u});return d},sliceRangeByDay:function(t){var e,n,i,r,s,o,l=this.daysPerRow,a=this.view.computeDayRange(t),u=this.getDateDayIndex(a.start),d=this.getDateDayIndex(a.end.clone().subtract(1,"days")),c=[];for(e=0;e<this.rowCnt;e++)for(n=e*l,i=n+l-1,r=n;r<=i;r++)s=Math.max(u,r),o=Math.min(d,r),s=Math.ceil(s),o=Math.floor(o),s<=o&&c.push({row:e,firstRowDayIndex:s-n,lastRowDayIndex:o-n,isStart:s===u,isEnd:o===d});return c;
},renderHeadHtml:function(){var t=this.view;return'<div class="fc-row '+t.widgetHeaderClass+'"><table><thead>'+this.renderHeadTrHtml()+"</thead></table></div>"},renderHeadIntroHtml:function(){return this.renderIntroHtml()},renderHeadTrHtml:function(){return"<tr>"+(this.isRTL?"":this.renderHeadIntroHtml())+this.renderHeadDateCellsHtml()+(this.isRTL?this.renderHeadIntroHtml():"")+"</tr>"},renderHeadDateCellsHtml:function(){var t,e,n=[];for(t=0;t<this.colCnt;t++)e=this.getCellDate(0,t),n.push(this.renderHeadDateCellHtml(e));return n.join("")},renderHeadDateCellHtml:function(t,e,n){var i=this.view;return'<th class="fc-day-header '+i.widgetHeaderClass+" fc-"+$t[t.day()]+'"'+(1===this.rowCnt?' data-date="'+t.format("YYYY-MM-DD")+'"':"")+(e>1?' colspan="'+e+'"':"")+(n?" "+n:"")+">"+i.buildGotoAnchorHtml({date:t,forceOff:this.rowCnt>1||1===this.colCnt},tt(t.format(this.colHeadFormat)))+"</th>"},renderBgTrHtml:function(t){return"<tr>"+(this.isRTL?"":this.renderBgIntroHtml(t))+this.renderBgCellsHtml(t)+(this.isRTL?this.renderBgIntroHtml(t):"")+"</tr>"},renderBgIntroHtml:function(t){return this.renderIntroHtml()},renderBgCellsHtml:function(t){var e,n,i=[];for(e=0;e<this.colCnt;e++)n=this.getCellDate(t,e),i.push(this.renderBgCellHtml(n));return i.join("")},renderBgCellHtml:function(t,e){var n=this.view,i=this.getDayClasses(t);return i.unshift("fc-day",n.widgetContentClass),'<td class="'+i.join(" ")+'" data-date="'+t.format("YYYY-MM-DD")+'"'+(e?" "+e:"")+"></td>"},renderIntroHtml:function(){},bookendCells:function(t){var e=this.renderIntroHtml();e&&(this.isRTL?t.append(e):t.prepend(e))}},me=jt.DayGrid=pe.extend(ve,{numbersVisible:!1,bottomCoordPadding:0,rowEls:null,cellEls:null,helperEls:null,rowCoordCache:null,colCoordCache:null,renderDates:function(t){var e,n,i=this.view,r=this.rowCnt,s=this.colCnt,o="";for(e=0;e<r;e++)o+=this.renderDayRowHtml(e,t);for(this.el.html(o),this.rowEls=this.el.find(".fc-row"),this.cellEls=this.el.find(".fc-day"),this.rowCoordCache=new ce({els:this.rowEls,isVertical:!0}),this.colCoordCache=new ce({els:this.cellEls.slice(0,this.colCnt),isHorizontal:!0}),e=0;e<r;e++)for(n=0;n<s;n++)i.trigger("dayRender",null,this.getCellDate(e,n),this.getCellEl(e,n))},unrenderDates:function(){this.removeSegPopover()},renderBusinessHours:function(){var t=this.buildBusinessHourSegs(!0);this.renderFill("businessHours",t,"bgevent")},unrenderBusinessHours:function(){this.unrenderFill("businessHours")},renderDayRowHtml:function(t,e){var n=this.view,i=["fc-row","fc-week",n.widgetContentClass];return e&&i.push("fc-rigid"),'<div class="'+i.join(" ")+'"><div class="fc-bg"><table>'+this.renderBgTrHtml(t)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.renderNumberTrHtml(t)+"</thead>":"")+"</table></div></div>"},renderNumberTrHtml:function(t){return"<tr>"+(this.isRTL?"":this.renderNumberIntroHtml(t))+this.renderNumberCellsHtml(t)+(this.isRTL?this.renderNumberIntroHtml(t):"")+"</tr>"},renderNumberIntroHtml:function(t){return this.renderIntroHtml()},renderNumberCellsHtml:function(t){var e,n,i=[];for(e=0;e<this.colCnt;e++)n=this.getCellDate(t,e),i.push(this.renderNumberCellHtml(n));return i.join("")},renderNumberCellHtml:function(t){var e,n,i="";return this.view.dayNumbersVisible||this.view.cellWeekNumbersVisible?(e=this.getDayClasses(t),e.unshift("fc-day-top"),this.view.cellWeekNumbersVisible&&(n="ISO"===t._locale._fullCalendar_weekCalc?1:t._locale.firstDayOfWeek()),i+='<td class="'+e.join(" ")+'" data-date="'+t.format()+'">',this.view.cellWeekNumbersVisible&&t.day()==n&&(i+=this.view.buildGotoAnchorHtml({date:t,type:"week"},{class:"fc-week-number"},t.format("w"))),this.view.dayNumbersVisible&&(i+=this.view.buildGotoAnchorHtml(t,{class:"fc-day-number"},t.date())),i+="</td>"):"<td/>"},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return 1==this.colCnt},rangeUpdated:function(){this.updateDayTable()},spanToSegs:function(t){var e,n,i=this.sliceRangeByRow(t);for(e=0;e<i.length;e++)n=i[e],this.isRTL?(n.leftCol=this.daysPerRow-1-n.lastRowDayIndex,n.rightCol=this.daysPerRow-1-n.firstRowDayIndex):(n.leftCol=n.firstRowDayIndex,n.rightCol=n.lastRowDayIndex);return i},prepareHits:function(){this.colCoordCache.build(),this.rowCoordCache.build(),this.rowCoordCache.bottoms[this.rowCnt-1]+=this.bottomCoordPadding},releaseHits:function(){this.colCoordCache.clear(),this.rowCoordCache.clear()},queryHit:function(t,e){if(this.colCoordCache.isLeftInBounds(t)&&this.rowCoordCache.isTopInBounds(e)){var n=this.colCoordCache.getHorizontalIndex(t),i=this.rowCoordCache.getVerticalIndex(e);if(null!=i&&null!=n)return this.getCellHit(i,n)}},getHitSpan:function(t){return this.getCellRange(t.row,t.col)},getHitEl:function(t){return this.getCellEl(t.row,t.col)},getCellHit:function(t,e){return{row:t,col:e,component:this,left:this.colCoordCache.getLeftOffset(e),right:this.colCoordCache.getRightOffset(e),top:this.rowCoordCache.getTopOffset(t),bottom:this.rowCoordCache.getBottomOffset(t)}},getCellEl:function(t,e){return this.cellEls.eq(t*this.colCnt+e)},renderDrag:function(t,e){if(this.renderHighlight(this.eventToSpan(t)),e&&e.component!==this)return this.renderEventLocationHelper(t,e)},unrenderDrag:function(){this.unrenderHighlight(),this.unrenderHelper()},renderEventResize:function(t,e){return this.renderHighlight(this.eventToSpan(t)),this.renderEventLocationHelper(t,e)},unrenderEventResize:function(){this.unrenderHighlight(),this.unrenderHelper()},renderHelper:function(e,n){var i,r=[],s=this.eventToSegs(e);return s=this.renderFgSegEls(s),i=this.renderSegRows(s),this.rowEls.each(function(e,s){var o,l=t(s),a=t('<div class="fc-helper-skeleton"><table/></div>');o=n&&n.row===e?n.el.position().top:l.find(".fc-content-skeleton tbody").position().top,a.css("top",o).find("table").append(i[e].tbodyEl),l.append(a),r.push(a[0])}),this.helperEls=t(r)},unrenderHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(e,n,i){var r,s,o,l=[];for(n=this.renderFillSegEls(e,n),r=0;r<n.length;r++)s=n[r],o=this.renderFillRow(e,s,i),this.rowEls.eq(s.row).append(o),l.push(o[0]);return this.elsByFill[e]=t(l),n},renderFillRow:function(e,n,i){var r,s,o=this.colCnt,l=n.leftCol,a=n.rightCol+1;return i=i||e.toLowerCase(),r=t('<div class="fc-'+i+'-skeleton"><table><tr/></table></div>'),s=r.find("tr"),l>0&&s.append('<td colspan="'+l+'"/>'),s.append(n.el.attr("colspan",a-l)),a<o&&s.append('<td colspan="'+(o-a)+'"/>'),this.bookendCells(s),r}});me.mixin({rowStructs:null,unrenderEvents:function(){this.removeSegPopover(),pe.prototype.unrenderEvents.apply(this,arguments)},getEventSegs:function(){return pe.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(e){var n=t.grep(e,function(t){return t.event.allDay});return pe.prototype.renderBgSegs.call(this,n)},renderFgSegs:function(e){var n;return e=this.renderFgSegEls(e),n=this.rowStructs=this.renderSegRows(e),this.rowEls.each(function(e,i){t(i).find(".fc-content-skeleton > table").append(n[e].tbodyEl)}),e},unrenderFgSegs:function(){for(var t,e=this.rowStructs||[];t=e.pop();)t.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(t){var e,n,i=[];for(e=this.groupSegRows(t),n=0;n<e.length;n++)i.push(this.renderSegRow(n,e[n]));return i},fgSegHtml:function(t,e){var n,i,r=this.view,s=t.event,o=r.isEventDraggable(s),l=!e&&s.allDay&&t.isStart&&r.isEventResizableFromStart(s),a=!e&&s.allDay&&t.isEnd&&r.isEventResizableFromEnd(s),u=this.getSegClasses(t,o,l||a),d=nt(this.getSegSkinCss(t)),c="";return u.unshift("fc-day-grid-event","fc-h-event"),t.isStart&&(n=this.getEventTimeText(s),n&&(c='<span class="fc-time">'+tt(n)+"</span>")),i='<span class="fc-title">'+(tt(s.title||"")||" ")+"</span>",'<a class="'+u.join(" ")+'"'+(s.url?' href="'+tt(s.url)+'"':"")+(d?' style="'+d+'"':"")+'><div class="fc-content">'+(this.isRTL?i+" "+c:c+" "+i)+"</div>"+(l?'<div class="fc-resizer fc-start-resizer" />':"")+(a?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},renderSegRow:function(e,n){function i(e){for(;o<e;)d=(m[r-1]||[])[o],d?d.attr("rowspan",parseInt(d.attr("rowspan")||1,10)+1):(d=t("<td/>"),l.append(d)),v[r][o]=d,m[r][o]=d,o++}var r,s,o,l,a,u,d,c=this.colCnt,h=this.buildSegLevels(n),f=Math.max(1,h.length),g=t("<tbody/>"),p=[],v=[],m=[];for(r=0;r<f;r++){if(s=h[r],o=0,l=t("<tr/>"),p.push([]),v.push([]),m.push([]),s)for(a=0;a<s.length;a++){for(u=s[a],i(u.leftCol),d=t('<td class="fc-event-container"/>').append(u.el),u.leftCol!=u.rightCol?d.attr("colspan",u.rightCol-u.leftCol+1):m[r][o]=d;o<=u.rightCol;)v[r][o]=d,p[r][o]=u,o++;l.append(d)}i(c),this.bookendCells(l),g.append(l)}return{row:e,tbodyEl:g,cellMatrix:v,segMatrix:p,segLevels:h,segs:n}},buildSegLevels:function(t){var e,n,i,r=[];for(this.sortEventSegs(t),e=0;e<t.length;e++){for(n=t[e],i=0;i<r.length&&Lt(n,r[i]);i++);n.level=i,(r[i]||(r[i]=[])).push(n)}for(i=0;i<r.length;i++)r[i].sort(Bt);return r},groupSegRows:function(t){var e,n=[];for(e=0;e<this.rowCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].row].push(t[e]);return n}}),me.mixin({segPopover:null,popoverSegs:null,removeSegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(t){var e,n,i=this.rowStructs||[];for(e=0;e<i.length;e++)this.unlimitRow(e),n=!!t&&("number"==typeof t?t:this.computeRowLevelLimit(e)),n!==!1&&this.limitRow(e,n)},computeRowLevelLimit:function(e){function n(e,n){s=Math.max(s,t(n).outerHeight())}var i,r,s,o=this.rowEls.eq(e),l=o.height(),a=this.rowStructs[e].tbodyEl.children();for(i=0;i<a.length;i++)if(r=a.eq(i).removeClass("fc-limited"),s=0,r.find("> td > :first-child").each(n),r.position().top+s>l)return i;return!1},limitRow:function(e,n){function i(i){for(;D<i;)u=S.getCellSegs(e,D,n),u.length&&(h=s[n-1][D],y=S.renderMoreLink(e,D,u),m=t("<div/>").append(y),h.append(m),E.push(m[0])),D++}var r,s,o,l,a,u,d,c,h,f,g,p,v,m,y,S=this,w=this.rowStructs[e],E=[],D=0;if(n&&n<w.segLevels.length){for(r=w.segLevels[n-1],s=w.cellMatrix,o=w.tbodyEl.children().slice(n).addClass("fc-limited").get(),l=0;l<r.length;l++){for(a=r[l],i(a.leftCol),c=[],d=0;D<=a.rightCol;)u=this.getCellSegs(e,D,n),c.push(u),d+=u.length,D++;if(d){for(h=s[n-1][a.leftCol],f=h.attr("rowspan")||1,g=[],p=0;p<c.length;p++)v=t('<td class="fc-more-cell"/>').attr("rowspan",f),u=c[p],y=this.renderMoreLink(e,a.leftCol+p,[a].concat(u)),m=t("<div/>").append(y),v.append(m),g.push(v[0]),E.push(v[0]);h.addClass("fc-limited").after(t(g)),o.push(h[0])}}i(this.colCnt),w.moreEls=t(E),w.limitedEls=t(o)}},unlimitRow:function(t){var e=this.rowStructs[t];e.moreEls&&(e.moreEls.remove(),e.moreEls=null),e.limitedEls&&(e.limitedEls.removeClass("fc-limited"),e.limitedEls=null)},renderMoreLink:function(e,n,i){var r=this,s=this.view;return t('<a class="fc-more"/>').text(this.getMoreLinkText(i.length)).on("click",function(o){var l=s.opt("eventLimitClick"),a=r.getCellDate(e,n),u=t(this),d=r.getCellEl(e,n),c=r.getCellSegs(e,n),h=r.resliceDaySegs(c,a),f=r.resliceDaySegs(i,a);"function"==typeof l&&(l=s.trigger("eventLimitClick",null,{date:a,dayEl:d,moreEl:u,segs:h,hiddenSegs:f},o)),"popover"===l?r.showSegPopover(e,n,u,h):"string"==typeof l&&s.calendar.zoomTo(a,l)})},showSegPopover:function(t,e,n,i){var r,s,o=this,l=this.view,a=n.parent();r=1==this.rowCnt?l.el:this.rowEls.eq(t),s={className:"fc-more-popover",content:this.renderSegPopoverContent(t,e,i),parentEl:this.view.el,top:r.offset().top,autoHide:!0,viewportConstrain:l.opt("popoverViewportConstrain"),hide:function(){o.segPopover.removeElement(),o.segPopover=null,o.popoverSegs=null}},this.isRTL?s.right=a.offset().left+a.outerWidth()+1:s.left=a.offset().left-1,this.segPopover=new de(s),this.segPopover.show(),this.bindSegHandlersToEl(this.segPopover.el)},renderSegPopoverContent:function(e,n,i){var r,s=this.view,o=s.opt("theme"),l=this.getCellDate(e,n).format(s.opt("dayPopoverFormat")),a=t('<div class="fc-header '+s.widgetHeaderClass+'"><span class="fc-close '+(o?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+tt(l)+'</span><div class="fc-clear"/></div><div class="fc-body '+s.widgetContentClass+'"><div class="fc-event-container"></div></div>'),u=a.find(".fc-event-container");for(i=this.renderFgSegEls(i,!0),this.popoverSegs=i,r=0;r<i.length;r++)this.prepareHits(),i[r].hit=this.getCellHit(e,n),this.releaseHits(),u.append(i[r].el);return a},resliceDaySegs:function(e,n){var i=t.map(e,function(t){return t.event}),r=n.clone(),s=r.clone().add(1,"days"),o={start:r,end:s};return e=this.eventsToSegs(i,function(t){var e=F(t,o);return e?[e]:[]}),this.sortEventSegs(e),e},getMoreLinkText:function(t){var e=this.view.opt("eventLimitText");return"function"==typeof e?e(t):"+"+t+" "+e},getCellSegs:function(t,e,n){for(var i,r=this.rowStructs[t].segMatrix,s=n||0,o=[];s<r.length;)i=r[s][e],i&&o.push(i),s++;return o}});var ye=jt.TimeGrid=pe.extend(ve,{slotDuration:null,snapDuration:null,snapsPerSlot:null,minTime:null,maxTime:null,labelFormat:null,labelInterval:null,colEls:null,slatContainerEl:null,slatEls:null,nowIndicatorEls:null,colCoordCache:null,slatCoordCache:null,constructor:function(){pe.apply(this,arguments),this.processOptions()},renderDates:function(){this.el.html(this.renderHtml()),this.colEls=this.el.find(".fc-day"),this.slatContainerEl=this.el.find(".fc-slats"),this.slatEls=this.slatContainerEl.find("tr"),this.colCoordCache=new ce({els:this.colEls,isHorizontal:!0}),this.slatCoordCache=new ce({els:this.slatEls,isVertical:!0}),this.renderContentSkeleton()},renderHtml:function(){return'<div class="fc-bg"><table>'+this.renderBgTrHtml(0)+'</table></div><div class="fc-slats"><table>'+this.renderSlatRowHtml()+"</table></div>"},renderSlatRowHtml:function(){for(var t,n,i,r=this.view,s=this.isRTL,o="",l=e.duration(+this.minTime);l<this.maxTime;)t=this.start.clone().time(l),n=ot(_(l,this.labelInterval)),i='<td class="fc-axis fc-time '+r.widgetContentClass+'" '+r.axisStyleAttr()+">"+(n?"<span>"+tt(t.format(this.labelFormat))+"</span>":"")+"</td>",o+='<tr data-time="'+t.format("HH:mm:ss")+'"'+(n?"":' class="fc-minor"')+">"+(s?"":i)+'<td class="'+r.widgetContentClass+'"/>'+(s?i:"")+"</tr>",l.add(this.slotDuration);return o},processOptions:function(){var n,i=this.view,r=i.opt("slotDuration"),s=i.opt("snapDuration");r=e.duration(r),s=s?e.duration(s):r,this.slotDuration=r,this.snapDuration=s,this.snapsPerSlot=r/s,this.minResizeDuration=s,this.minTime=e.duration(i.opt("minTime")),this.maxTime=e.duration(i.opt("maxTime")),n=i.opt("slotLabelFormat"),t.isArray(n)&&(n=n[n.length-1]),this.labelFormat=n||i.opt("smallTimeFormat"),n=i.opt("slotLabelInterval"),this.labelInterval=n?e.duration(n):this.computeLabelInterval(r)},computeLabelInterval:function(t){var n,i,r;for(n=Ne.length-1;n>=0;n--)if(i=e.duration(Ne[n]),r=_(i,t),ot(r)&&r>1)return i;return e.duration(t)},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},prepareHits:function(){this.colCoordCache.build(),this.slatCoordCache.build()},releaseHits:function(){this.colCoordCache.clear()},queryHit:function(t,e){var n=this.snapsPerSlot,i=this.colCoordCache,r=this.slatCoordCache;if(i.isLeftInBounds(t)&&r.isTopInBounds(e)){var s=i.getHorizontalIndex(t),o=r.getVerticalIndex(e);if(null!=s&&null!=o){var l=r.getTopOffset(o),a=r.getHeight(o),u=(e-l)/a,d=Math.floor(u*n),c=o*n+d,h=l+d/n*a,f=l+(d+1)/n*a;return{col:s,snap:c,component:this,left:i.getLeftOffset(s),right:i.getRightOffset(s),top:h,bottom:f}}}},getHitSpan:function(t){var e,n=this.getCellDate(0,t.col),i=this.computeSnapTime(t.snap);return n.time(i),e=n.clone().add(this.snapDuration),{start:n,end:e}},getHitEl:function(t){return this.colEls.eq(t.col)},rangeUpdated:function(){this.updateDayTable()},computeSnapTime:function(t){return e.duration(this.minTime+this.snapDuration*t)},spanToSegs:function(t){var e,n=this.sliceRangeByTimes(t);for(e=0;e<n.length;e++)this.isRTL?n[e].col=this.daysPerRow-1-n[e].dayIndex:n[e].col=n[e].dayIndex;return n},sliceRangeByTimes:function(t){var e,n,i,r,s=[];for(n=0;n<this.daysPerRow;n++)i=this.dayDates[n].clone(),r={start:i.clone().time(this.minTime),end:i.clone().time(this.maxTime)},e=F(t,r),e&&(e.dayIndex=n,s.push(e));return s},updateSize:function(t){this.slatCoordCache.build(),t&&this.updateSegVerticals([].concat(this.fgSegs||[],this.bgSegs||[],this.businessSegs||[]))},getTotalSlatHeight:function(){return this.slatContainerEl.outerHeight()},computeDateTop:function(t,n){return this.computeTimeTop(e.duration(t-n.clone().stripTime()))},computeTimeTop:function(t){var e,n,i=this.slatEls.length,r=(t-this.minTime)/this.slotDuration;return r=Math.max(0,r),r=Math.min(i,r),e=Math.floor(r),e=Math.min(e,i-1),n=r-e,this.slatCoordCache.getTopPosition(e)+this.slatCoordCache.getHeight(e)*n},renderDrag:function(t,e){return e?this.renderEventLocationHelper(t,e):void this.renderHighlight(this.eventToSpan(t))},unrenderDrag:function(){this.unrenderHelper(),this.unrenderHighlight()},renderEventResize:function(t,e){return this.renderEventLocationHelper(t,e)},unrenderEventResize:function(){this.unrenderHelper()},renderHelper:function(t,e){return this.renderHelperSegs(this.eventToSegs(t),e)},unrenderHelper:function(){this.unrenderHelperSegs()},renderBusinessHours:function(){this.renderBusinessSegs(this.buildBusinessHourSegs())},unrenderBusinessHours:function(){this.unrenderBusinessSegs()},getNowIndicatorUnit:function(){return"minute"},renderNowIndicator:function(e){var n,i=this.spanToSegs({start:e,end:e}),r=this.computeDateTop(e,e),s=[];for(n=0;n<i.length;n++)s.push(t('<div class="fc-now-indicator fc-now-indicator-line"></div>').css("top",r).appendTo(this.colContainerEls.eq(i[n].col))[0]);i.length>0&&s.push(t('<div class="fc-now-indicator fc-now-indicator-arrow"></div>').css("top",r).appendTo(this.el.find(".fc-content-skeleton"))[0]),this.nowIndicatorEls=t(s)},unrenderNowIndicator:function(){this.nowIndicatorEls&&(this.nowIndicatorEls.remove(),this.nowIndicatorEls=null)},renderSelection:function(t){this.view.opt("selectHelper")?this.renderEventLocationHelper(t):this.renderHighlight(t)},unrenderSelection:function(){this.unrenderHelper(),this.unrenderHighlight()},renderHighlight:function(t){this.renderHighlightSegs(this.spanToSegs(t))},unrenderHighlight:function(){this.unrenderHighlightSegs()}});ye.mixin({colContainerEls:null,fgContainerEls:null,bgContainerEls:null,helperContainerEls:null,highlightContainerEls:null,businessContainerEls:null,fgSegs:null,bgSegs:null,helperSegs:null,highlightSegs:null,businessSegs:null,renderContentSkeleton:function(){var e,n,i="";for(e=0;e<this.colCnt;e++)i+='<td><div class="fc-content-col"><div class="fc-event-container fc-helper-container"></div><div class="fc-event-container"></div><div class="fc-highlight-container"></div><div class="fc-bgevent-container"></div><div class="fc-business-container"></div></div></td>';n=t('<div class="fc-content-skeleton"><table><tr>'+i+"</tr></table></div>"),this.colContainerEls=n.find(".fc-content-col"),this.helperContainerEls=n.find(".fc-helper-container"),this.fgContainerEls=n.find(".fc-event-container:not(.fc-helper-container)"),this.bgContainerEls=n.find(".fc-bgevent-container"),this.highlightContainerEls=n.find(".fc-highlight-container"),this.businessContainerEls=n.find(".fc-business-container"),this.bookendCells(n.find("tr")),this.el.append(n)},renderFgSegs:function(t){return t=this.renderFgSegsIntoContainers(t,this.fgContainerEls),this.fgSegs=t,t},unrenderFgSegs:function(){this.unrenderNamedSegs("fgSegs")},renderHelperSegs:function(e,n){var i,r,s,o=[];for(e=this.renderFgSegsIntoContainers(e,this.helperContainerEls),i=0;i<e.length;i++)r=e[i],n&&n.col===r.col&&(s=n.el,r.el.css({left:s.css("left"),right:s.css("right"),"margin-left":s.css("margin-left"),"margin-right":s.css("margin-right")})),o.push(r.el[0]);return this.helperSegs=e,t(o)},unrenderHelperSegs:function(){this.unrenderNamedSegs("helperSegs")},renderBgSegs:function(t){return t=this.renderFillSegEls("bgEvent",t),this.updateSegVerticals(t),this.attachSegsByCol(this.groupSegsByCol(t),this.bgContainerEls),this.bgSegs=t,t},unrenderBgSegs:function(){this.unrenderNamedSegs("bgSegs")},renderHighlightSegs:function(t){t=this.renderFillSegEls("highlight",t),this.updateSegVerticals(t),this.attachSegsByCol(this.groupSegsByCol(t),this.highlightContainerEls),this.highlightSegs=t},unrenderHighlightSegs:function(){this.unrenderNamedSegs("highlightSegs")},renderBusinessSegs:function(t){t=this.renderFillSegEls("businessHours",t),this.updateSegVerticals(t),this.attachSegsByCol(this.groupSegsByCol(t),this.businessContainerEls),this.businessSegs=t},unrenderBusinessSegs:function(){this.unrenderNamedSegs("businessSegs")},groupSegsByCol:function(t){var e,n=[];for(e=0;e<this.colCnt;e++)n.push([]);for(e=0;e<t.length;e++)n[t[e].col].push(t[e]);return n},attachSegsByCol:function(t,e){var n,i,r;for(n=0;n<this.colCnt;n++)for(i=t[n],r=0;r<i.length;r++)e.eq(n).append(i[r].el)},unrenderNamedSegs:function(t){var e,n=this[t];if(n){for(e=0;e<n.length;e++)n[e].el.remove();this[t]=null}},renderFgSegsIntoContainers:function(t,e){var n,i;for(t=this.renderFgSegEls(t),n=this.groupSegsByCol(t),i=0;i<this.colCnt;i++)this.updateFgSegCoords(n[i]);return this.attachSegsByCol(n,e),t},fgSegHtml:function(t,e){var n,i,r,s=this.view,o=t.event,l=s.isEventDraggable(o),a=!e&&t.isStart&&s.isEventResizableFromStart(o),u=!e&&t.isEnd&&s.isEventResizableFromEnd(o),d=this.getSegClasses(t,l,a||u),c=nt(this.getSegSkinCss(t));return d.unshift("fc-time-grid-event","fc-v-event"),s.isMultiDayEvent(o)?(t.isStart||t.isEnd)&&(n=this.getEventTimeText(t),i=this.getEventTimeText(t,"LT"),r=this.getEventTimeText(t,null,!1)):(n=this.getEventTimeText(o),i=this.getEventTimeText(o,"LT"),r=this.getEventTimeText(o,null,!1)),'<a class="'+d.join(" ")+'"'+(o.url?' href="'+tt(o.url)+'"':"")+(c?' style="'+c+'"':"")+'><div class="fc-content">'+(n?'<div class="fc-time" data-start="'+tt(r)+'" data-full="'+tt(i)+'"><span>'+tt(n)+"</span></div>":"")+(o.title?'<div class="fc-title">'+tt(o.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(u?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},updateSegVerticals:function(t){this.computeSegVerticals(t),this.assignSegVerticals(t)},computeSegVerticals:function(t){var e,n;for(e=0;e<t.length;e++)n=t[e],n.top=this.computeDateTop(n.start,n.start),n.bottom=this.computeDateTop(n.end,n.start)},assignSegVerticals:function(t){var e,n;for(e=0;e<t.length;e++)n=t[e],n.el.css(this.generateSegVerticalCss(n))},generateSegVerticalCss:function(t){return{top:t.top,bottom:-t.bottom}},updateFgSegCoords:function(t){this.computeSegVerticals(t),this.computeFgSegHorizontals(t),this.assignSegVerticals(t),this.assignFgSegHorizontals(t)},computeFgSegHorizontals:function(t){var e,n,i;if(this.sortEventSegs(t),e=zt(t),Ft(e),n=e[0]){for(i=0;i<n.length;i++)Nt(n[i]);for(i=0;i<n.length;i++)this.computeFgSegForwardBack(n[i],0,0)}},computeFgSegForwardBack:function(t,e,n){var i,r=t.forwardSegs;if(void 0===t.forwardCoord)for(r.length?(this.sortForwardSegs(r),this.computeFgSegForwardBack(r[0],e+1,n),t.forwardCoord=r[0].backwardCoord):t.forwardCoord=1,t.backwardCoord=t.forwardCoord-(t.forwardCoord-n)/(e+1),i=0;i<r.length;i++)this.computeFgSegForwardBack(r[i],0,t.forwardCoord)},sortForwardSegs:function(t){t.sort(lt(this,"compareForwardSegs"))},compareForwardSegs:function(t,e){return e.forwardPressure-t.forwardPressure||(t.backwardCoord||0)-(e.backwardCoord||0)||this.compareEventSegs(t,e)},assignFgSegHorizontals:function(t){var e,n;for(e=0;e<t.length;e++)n=t[e],n.el.css(this.generateFgSegHorizontalCss(n)),n.bottom-n.top<30&&n.el.addClass("fc-short")},generateFgSegHorizontalCss:function(t){var e,n,i=this.view.opt("slotEventOverlap"),r=t.backwardCoord,s=t.forwardCoord,o=this.generateSegVerticalCss(t);return i&&(s=Math.min(1,r+2*(s-r))),this.isRTL?(e=1-s,n=r):(e=r,n=1-s),o.zIndex=t.level+1,o.left=100*e+"%",o.right=100*n+"%",i&&t.forwardPressure&&(o[this.isRTL?"marginLeft":"marginRight"]=20),o}});var Se=jt.View=wt.extend(le,ae,{type:null,name:null,title:null,calendar:null,options:null,el:null,displaying:null,isSkeletonRendered:!1,isEventsRendered:!1,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isRTL:!1,isSelected:!1,selectedEvent:null,eventOrderSpecs:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,isNowIndicatorRendered:null,initialNowDate:null,initialNowQueriedMs:null,nowIndicatorTimeoutID:null,nowIndicatorIntervalID:null,constructor:function(t,n,i,r){this.calendar=t,this.type=this.name=n,this.options=i,this.intervalDuration=r||e.duration(1,"day"),this.nextDayThreshold=e.duration(this.opt("nextDayThreshold")),this.initThemingProps(),this.initHiddenDays(),this.isRTL=this.opt("isRTL"),this.eventOrderSpecs=M(this.opt("eventOrder")),this.initialize()},initialize:function(){},opt:function(t){return this.options[t]},trigger:function(t,e){var n=this.calendar;return n.trigger.apply(n,[t,e||this].concat(Array.prototype.slice.call(arguments,2),[this]))},setDate:function(t){this.setRange(this.computeRange(t))},setRange:function(e){t.extend(this,e),this.updateTitle()},computeRange:function(t){var e,n,i=O(this.intervalDuration),r=t.clone().startOf(i),s=r.clone().add(this.intervalDuration);return/year|month|week|day/.test(i)?(r.stripTime(),s.stripTime()):(r.hasTime()||(r=this.calendar.time(0)),s.hasTime()||(s=this.calendar.time(0))),e=r.clone(),e=this.skipHiddenDays(e),n=s.clone(),n=this.skipHiddenDays(n,-1,!0),{intervalUnit:i,intervalStart:r,intervalEnd:s,start:e,end:n}},computePrevDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(t){return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(t,e){return this.intervalDuration.as("days")<=1&&this.isHiddenDay(t)&&(t=this.skipHiddenDays(t,e),t.startOf("day")),t},updateTitle:function(){this.title=this.computeTitle()},computeTitle:function(){return this.formatRange({start:this.calendar.applyTimezone(this.intervalStart),end:this.calendar.applyTimezone(this.intervalEnd)},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return"year"==this.intervalUnit?"YYYY":"month"==this.intervalUnit?this.opt("monthYearFormat"):this.intervalDuration.as("days")>1?"ll":"LL"},formatRange:function(t,e,n){var i=t.end;return i.hasTime()||(i=i.clone().subtract(1)),pt(t.start,i,e,n,this.opt("isRTL"))},getAllDayHtml:function(){return this.opt("allDayHtml")||tt(this.opt("allDayText"))},buildGotoAnchorHtml:function(e,n,i){var r,s,o,l;return t.isPlainObject(e)?(r=e.date,s=e.type,o=e.forceOff):r=e,r=jt.moment(r),l={date:r.format("YYYY-MM-DD"),type:s||"day"},"string"==typeof n&&(i=n,n=null),n=n?" "+it(n):"",i=i||"",!o&&this.opt("navLinks")?"<a"+n+' data-goto="'+tt((l))+'">'+i+"</a>":"<span"+n+">"+i+"</span>"},setElement:function(t){this.el=t,this.bindGlobalHandlers()},removeElement:function(){this.clear(),this.isSkeletonRendered&&(this.unrenderSkeleton(),this.isSkeletonRendered=!1),this.unbindGlobalHandlers(),this.el.remove()},display:function(t,e){var n=this,i=null;return null!=e&&this.displaying&&(i=this.queryScroll()),this.calendar.freezeContentHeight(),ut(this.clear(),function(){return n.displaying=ut(n.displayView(t),function(){null!=e?n.setScroll(e):n.forceScroll(n.computeInitialScroll(i)),n.calendar.unfreezeContentHeight(),n.triggerRender()})})},clear:function(){var e=this,n=this.displaying;return n?ut(n,function(){return e.displaying=null,e.clearEvents(),e.clearView()}):t.when()},displayView:function(t){this.isSkeletonRendered||(this.renderSkeleton(),this.isSkeletonRendered=!0),t&&this.setDate(t),this.render&&this.render(),this.renderDates(),this.updateSize(),this.renderBusinessHours(),this.startNowIndicator()},clearView:function(){this.unselect(),this.stopNowIndicator(),this.triggerUnrender(),this.unrenderBusinessHours(),this.unrenderDates(),this.destroy&&this.destroy()},renderSkeleton:function(){},unrenderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},triggerRender:function(){this.trigger("viewRender",this,this,this.el)},triggerUnrender:function(){this.trigger("viewDestroy",this,this,this.el)},bindGlobalHandlers:function(){this.listenTo(t(document),"mousedown",this.handleDocumentMousedown),this.listenTo(t(document),"touchstart",this.processUnselect)},unbindGlobalHandlers:function(){this.stopListeningTo(t(document))},initThemingProps:function(){var t=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=t+"-widget-header",this.widgetContentClass=t+"-widget-content",this.highlightStateClass=t+"-state-highlight"},renderBusinessHours:function(){},unrenderBusinessHours:function(){},startNowIndicator:function(){var t,n,i,r=this;this.opt("nowIndicator")&&(t=this.getNowIndicatorUnit(),t&&(n=lt(this,"updateNowIndicator"),this.initialNowDate=this.calendar.getNow(),this.initialNowQueriedMs=+new Date,this.renderNowIndicator(this.initialNowDate),this.isNowIndicatorRendered=!0,i=this.initialNowDate.clone().startOf(t).add(1,t)-this.initialNowDate,this.nowIndicatorTimeoutID=setTimeout(function(){r.nowIndicatorTimeoutID=null,n(),i=+e.duration(1,t),i=Math.max(100,i),r.nowIndicatorIntervalID=setInterval(n,i)},i)))},updateNowIndicator:function(){this.isNowIndicatorRendered&&(this.unrenderNowIndicator(),this.renderNowIndicator(this.initialNowDate.clone().add(new Date-this.initialNowQueriedMs)))},stopNowIndicator:function(){this.isNowIndicatorRendered&&(this.nowIndicatorTimeoutID&&(clearTimeout(this.nowIndicatorTimeoutID),this.nowIndicatorTimeoutID=null),this.nowIndicatorIntervalID&&(clearTimeout(this.nowIndicatorIntervalID),this.nowIndicatorIntervalID=null),this.unrenderNowIndicator(),this.isNowIndicatorRendered=!1)},getNowIndicatorUnit:function(){},renderNowIndicator:function(t){},unrenderNowIndicator:function(){},updateSize:function(t){var e;t&&(e=this.queryScroll()),this.updateHeight(t),this.updateWidth(t),this.updateNowIndicator(),t&&this.setScroll(e)},updateWidth:function(t){},updateHeight:function(t){var e=this.calendar;this.setHeight(e.getSuggestedViewHeight(),e.isHeightAuto())},setHeight:function(t,e){},computeInitialScroll:function(t){return 0},queryScroll:function(){},setScroll:function(t){},forceScroll:function(t){var e=this;this.setScroll(t),setTimeout(function(){e.setScroll(t)},0)},displayEvents:function(t){var e=this.queryScroll();this.clearEvents(),this.renderEvents(t),this.isEventsRendered=!0,this.setScroll(e),this.triggerEventRender()},clearEvents:function(){var t;this.isEventsRendered&&(t=this.queryScroll(),this.triggerEventUnrender(),this.destroyEvents&&this.destroyEvents(),this.unrenderEvents(),this.setScroll(t),this.isEventsRendered=!1)},renderEvents:function(t){},unrenderEvents:function(){},triggerEventRender:function(){this.renderedEventSegEach(function(t){this.trigger("eventAfterRender",t.event,t.event,t.el)}),this.trigger("eventAfterAllRender")},triggerEventUnrender:function(){this.renderedEventSegEach(function(t){this.trigger("eventDestroy",t.event,t.event,t.el)})},resolveEventEl:function(e,n){var i=this.trigger("eventRender",e,e,n);return i===!1?n=null:i&&i!==!0&&(n=t(i)),n},showEvent:function(t){this.renderedEventSegEach(function(t){t.el.css("visibility","")},t)},hideEvent:function(t){this.renderedEventSegEach(function(t){t.el.css("visibility","hidden")},t)},renderedEventSegEach:function(t,e){var n,i=this.getEventSegs();for(n=0;n<i.length;n++)e&&i[n].event._id!==e._id||i[n].el&&t.call(this,i[n])},getEventSegs:function(){return[]},isEventDraggable:function(t){return this.isEventStartEditable(t)},isEventStartEditable:function(t){return J(t.startEditable,(t.source||{}).startEditable,this.opt("eventStartEditable"),this.isEventGenerallyEditable(t))},isEventGenerallyEditable:function(t){return J(t.editable,(t.source||{}).editable,this.opt("editable"))},reportEventDrop:function(t,e,n,i,r){
var s=this.calendar,o=s.mutateEvent(t,e,n),l=function(){o.undo(),s.reportEventChange()};this.triggerEventDrop(t,o.dateDelta,l,i,r),s.reportEventChange()},triggerEventDrop:function(t,e,n,i,r){this.trigger("eventDrop",i[0],t,e,n,r,{})},reportExternalDrop:function(e,n,i,r,s){var o,l,a=e.eventProps;a&&(o=t.extend({},a,n),l=this.calendar.renderEvent(o,e.stick)[0]),this.triggerExternalDrop(l,n,i,r,s)},triggerExternalDrop:function(t,e,n,i,r){this.trigger("drop",n[0],e.start,i,r),t&&this.trigger("eventReceive",null,t)},renderDrag:function(t,e){},unrenderDrag:function(){},isEventResizableFromStart:function(t){return this.opt("eventResizableFromStart")&&this.isEventResizable(t)},isEventResizableFromEnd:function(t){return this.isEventResizable(t)},isEventResizable:function(t){var e=t.source||{};return J(t.durationEditable,e.durationEditable,this.opt("eventDurationEditable"),t.editable,e.editable,this.opt("editable"))},reportEventResize:function(t,e,n,i,r){var s=this.calendar,o=s.mutateEvent(t,e,n),l=function(){o.undo(),s.reportEventChange()};this.triggerEventResize(t,o.durationDelta,l,i,r),s.reportEventChange()},triggerEventResize:function(t,e,n,i,r){this.trigger("eventResize",i[0],t,e,n,r,{})},select:function(t,e){this.unselect(e),this.renderSelection(t),this.reportSelection(t,e)},renderSelection:function(t){},reportSelection:function(t,e){this.isSelected=!0,this.triggerSelect(t,e)},triggerSelect:function(t,e){this.trigger("select",null,this.calendar.applyTimezone(t.start),this.calendar.applyTimezone(t.end),e)},unselect:function(t){this.isSelected&&(this.isSelected=!1,this.destroySelection&&this.destroySelection(),this.unrenderSelection(),this.trigger("unselect",null,t))},unrenderSelection:function(){},selectEvent:function(t){this.selectedEvent&&this.selectedEvent===t||(this.unselectEvent(),this.renderedEventSegEach(function(t){t.el.addClass("fc-selected")},t),this.selectedEvent=t)},unselectEvent:function(){this.selectedEvent&&(this.renderedEventSegEach(function(t){t.el.removeClass("fc-selected")},this.selectedEvent),this.selectedEvent=null)},isEventSelected:function(t){return this.selectedEvent&&this.selectedEvent._id===t._id},handleDocumentMousedown:function(t){S(t)&&this.processUnselect(t)},processUnselect:function(t){this.processRangeUnselect(t),this.processEventUnselect(t)},processRangeUnselect:function(e){var n;this.isSelected&&this.opt("unselectAuto")&&(n=this.opt("unselectCancel"),n&&t(e.target).closest(n).length||this.unselect(e))},processEventUnselect:function(e){this.selectedEvent&&(t(e.target).closest(".fc-selected").length||this.unselectEvent())},triggerDayClick:function(t,e,n){this.trigger("dayClick",e,this.calendar.applyTimezone(t.start),n)},initHiddenDays:function(){var e,n=this.opt("hiddenDays")||[],i=[],r=0;for(this.opt("weekends")===!1&&n.push(0,6),e=0;e<7;e++)(i[e]=t.inArray(e,n)!==-1)||r++;if(!r)throw"invalid hiddenDays";this.isHiddenDayHash=i},isHiddenDay:function(t){return e.isMoment(t)&&(t=t.day()),this.isHiddenDayHash[t]},skipHiddenDays:function(t,e,n){var i=t.clone();for(e=e||1;this.isHiddenDayHash[(i.day()+(n?e:0)+7)%7];)i.add(e,"days");return i},computeDayRange:function(t){var e,n=t.start.clone().stripTime(),i=t.end,r=null;return i&&(r=i.clone().stripTime(),e=+i.time(),e&&e>=this.nextDayThreshold&&r.add(1,"days")),(!i||r<=n)&&(r=n.clone().add(1,"days")),{start:n,end:r}},isMultiDayEvent:function(t){var e=this.computeDayRange(t);return e.end.diff(e.start,"days")>1}}),we=jt.Scroller=wt.extend({el:null,scrollEl:null,overflowX:null,overflowY:null,constructor:function(t){t=t||{},this.overflowX=t.overflowX||t.overflow||"auto",this.overflowY=t.overflowY||t.overflow||"auto"},render:function(){this.el=this.renderEl(),this.applyOverflow()},renderEl:function(){return this.scrollEl=t('<div class="fc-scroller"></div>')},clear:function(){this.setHeight("auto"),this.applyOverflow()},destroy:function(){this.el.remove()},applyOverflow:function(){this.scrollEl.css({"overflow-x":this.overflowX,"overflow-y":this.overflowY})},lockOverflow:function(t){var e=this.overflowX,n=this.overflowY;t=t||this.getScrollbarWidths(),"auto"===e&&(e=t.top||t.bottom||this.scrollEl[0].scrollWidth-1>this.scrollEl[0].clientWidth?"scroll":"hidden"),"auto"===n&&(n=t.left||t.right||this.scrollEl[0].scrollHeight-1>this.scrollEl[0].clientHeight?"scroll":"hidden"),this.scrollEl.css({"overflow-x":e,"overflow-y":n})},setHeight:function(t){this.scrollEl.height(t)},getScrollTop:function(){return this.scrollEl.scrollTop()},setScrollTop:function(t){this.scrollEl.scrollTop(t)},getClientWidth:function(){return this.scrollEl[0].clientWidth},getClientHeight:function(){return this.scrollEl[0].clientHeight},getScrollbarWidths:function(){return p(this.scrollEl)}}),Ee=jt.Calendar=wt.extend({dirDefaults:null,localeDefaults:null,overrides:null,dynamicOverrides:null,options:null,viewSpecCache:null,view:null,header:null,loadingLevel:0,constructor:Ot,initialize:function(){},populateOptionsHash:function(){var t,e,i,r;t=J(this.dynamicOverrides.locale,this.overrides.locale),e=De[t],e||(t=Ee.defaults.locale,e=De[t]||{}),i=J(this.dynamicOverrides.isRTL,this.overrides.isRTL,e.isRTL,Ee.defaults.isRTL),r=i?Ee.rtlDefaults:{},this.dirDefaults=r,this.localeDefaults=e,this.options=n([Ee.defaults,r,e,this.overrides,this.dynamicOverrides]),Vt(this.options)},getViewSpec:function(t){var e=this.viewSpecCache;return e[t]||(e[t]=this.buildViewSpec(t))},getUnitViewSpec:function(e){var n,i,r;if(t.inArray(e,Xt)!=-1)for(n=this.header.getViewsWithButtons(),t.each(jt.views,function(t){n.push(t)}),i=0;i<n.length;i++)if(r=this.getViewSpec(n[i]),r&&r.singleUnit==e)return r},buildViewSpec:function(t){for(var i,r,s,o,l=this.overrides.views||{},a=[],u=[],d=[],c=t;c;)i=Ut[c],r=l[c],c=null,"function"==typeof i&&(i={class:i}),i&&(a.unshift(i),u.unshift(i.defaults||{}),s=s||i.duration,c=c||i.type),r&&(d.unshift(r),s=s||r.duration,c=c||r.type);return i=q(a),i.type=t,!!i.class&&(s&&(s=e.duration(s),s.valueOf()&&(i.duration=s,o=O(s),1===s.as(o)&&(i.singleUnit=o,d.unshift(l[o]||{})))),i.defaults=n(u),i.overrides=n(d),this.buildViewSpecOptions(i),this.buildViewSpecButtonText(i,t),i)},buildViewSpecOptions:function(t){t.options=n([Ee.defaults,t.defaults,this.dirDefaults,this.localeDefaults,this.overrides,t.overrides,this.dynamicOverrides]),Vt(t.options)},buildViewSpecButtonText:function(t,e){function n(n){var i=n.buttonText||{};return i[e]||(t.buttonTextKey?i[t.buttonTextKey]:null)||(t.singleUnit?i[t.singleUnit]:null)}t.buttonTextOverride=n(this.dynamicOverrides)||n(this.overrides)||t.overrides.buttonText,t.buttonTextDefault=n(this.localeDefaults)||n(this.dirDefaults)||t.defaults.buttonText||n(Ee.defaults)||(t.duration?this.humanizeDuration(t.duration):null)||e},instantiateView:function(t){var e=this.getViewSpec(t);return new e.class(this,t,e.options,e.duration)},isValidViewType:function(t){return Boolean(this.getViewSpec(t))},pushLoading:function(){this.loadingLevel++||this.trigger("loading",null,!0,this.view)},popLoading:function(){--this.loadingLevel||this.trigger("loading",null,!1,this.view)},buildSelectSpan:function(t,e){var n,i=this.moment(t).stripZone();return n=e?this.moment(e).stripZone():i.hasTime()?i.clone().add(this.defaultTimedEventDuration):i.clone().add(this.defaultAllDayEventDuration),{start:i,end:n}}});Ee.mixin(le),Ee.mixin({optionHandlers:null,bindOption:function(t,e){this.bindOptions([t],e)},bindOptions:function(t,e){var n,i={func:e,names:t};for(n=0;n<t.length;n++)this.registerOptionHandlerObj(t[n],i);this.triggerOptionHandlerObj(i)},registerOptionHandlerObj:function(t,e){(this.optionHandlers[t]||(this.optionHandlers[t]=[])).push(e)},triggerOptionHandlers:function(t){var e,n=this.optionHandlers[t]||[];for(e=0;e<n.length;e++)this.triggerOptionHandlerObj(n[e])},triggerOptionHandlerObj:function(t){var e,n=t.names,i=[];for(e=0;e<n.length;e++)i.push(this.options[n[e]]);t.func.apply(this,i)}}),Ee.defaults={titleRangeSeparator:" – ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",scrollTime:"06:00:00",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},allDayText:"all-day",theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventOrder:"title",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3},Ee.englishDefaults={dayPopoverFormat:"dddd, MMMM D"},Ee.rtlDefaults={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}};var De=jt.locales={};jt.datepickerLocale=function(e,n,i){var r=De[e]||(De[e]={});r.isRTL=i.isRTL,r.weekNumberTitle=i.weekHeader,t.each(be,function(t,e){r[t]=e(i)}),t.datepicker&&(t.datepicker.regional[n]=t.datepicker.regional[e]=i,t.datepicker.regional.en=t.datepicker.regional[""],t.datepicker.setDefaults(i))},jt.locale=function(e,i){var r,s;r=De[e]||(De[e]={}),i&&(r=De[e]=n([r,i])),s=Pt(e),t.each(Ce,function(t,e){null==r[t]&&(r[t]=e(s,r))}),Ee.defaults.locale=e};var be={buttonText:function(t){return{prev:et(t.prevText),next:et(t.nextText),today:et(t.currentText)}},monthYearFormat:function(t){return t.showMonthAfterYear?"YYYY["+t.yearSuffix+"] MMMM":"MMMM YYYY["+t.yearSuffix+"]"}},Ce={dayOfMonthFormat:function(t,e){var n=t.longDateFormat("l");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),e.isRTL?n+=" ddd":n="ddd "+n,n},mediumTimeFormat:function(t){return t.longDateFormat("LT").replace(/\s*a$/i,"a")},smallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(t){return t.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},hourFormat:function(t){return t.longDateFormat("LT").replace(":mm","").replace(/(\Wmm)$/,"").replace(/\s*a$/i,"a")},noMeridiemTimeFormat:function(t){return t.longDateFormat("LT").replace(/\s*a$/i,"")}},He={smallDayDateFormat:function(t){return t.isRTL?"D dd":"dd D"},weekFormat:function(t){return t.isRTL?"w[ "+t.weekNumberTitle+"]":"["+t.weekNumberTitle+" ]w"},smallWeekFormat:function(t){return t.isRTL?"w["+t.weekNumberTitle+"]":"["+t.weekNumberTitle+"]w"}};jt.locale("en",Ee.englishDefaults),jt.sourceNormalizers=[],jt.sourceFetchers=[];var Te={dataType:"json",cache:!1},xe=1;Ee.prototype.normalizeEvent=function(t){},Ee.prototype.spanContainsSpan=function(t,e){var n=t.start.clone().stripZone(),i=this.getEventEnd(t).stripZone();return e.start>=n&&e.end<=i},Ee.prototype.getPeerEvents=function(t,e){var n,i,r=this.getEventCache(),s=[];for(n=0;n<r.length;n++)i=r[n],e&&e._id===i._id||s.push(i);return s},Ee.prototype.isEventSpanAllowed=function(t,e){var n=e.source||{},i=J(e.constraint,n.constraint,this.options.eventConstraint),r=J(e.overlap,n.overlap,this.options.eventOverlap);return this.isSpanAllowed(t,i,r,e)&&(!this.options.eventAllow||this.options.eventAllow(t,e)!==!1)},Ee.prototype.isExternalSpanAllowed=function(e,n,i){var r,s;return i&&(r=t.extend({},i,n),s=this.expandEvent(this.buildEventFromInput(r))[0]),s?this.isEventSpanAllowed(e,s):this.isSelectionSpanAllowed(e)},Ee.prototype.isSelectionSpanAllowed=function(t){return this.isSpanAllowed(t,this.options.selectConstraint,this.options.selectOverlap)&&(!this.options.selectAllow||this.options.selectAllow(t)!==!1)},Ee.prototype.isSpanAllowed=function(t,e,n,i){var r,s,o,l,a,u;if(null!=e&&(r=this.constraintToEvents(e))){for(s=!1,l=0;l<r.length;l++)if(this.spanContainsSpan(r[l],t)){s=!0;break}if(!s)return!1}for(o=this.getPeerEvents(t,i),l=0;l<o.length;l++)if(a=o[l],this.eventIntersectsRange(a,t)){if(n===!1)return!1;if("function"==typeof n&&!n(a,i))return!1;if(i){if(u=J(a.overlap,(a.source||{}).overlap),u===!1)return!1;if("function"==typeof u&&!u(i,a))return!1}}return!0},Ee.prototype.constraintToEvents=function(t){return"businessHours"===t?this.getCurrentBusinessHourEvents():"object"==typeof t?null!=t.start?this.expandEvent(this.buildEventFromInput(t)):null:this.clientEvents(t)},Ee.prototype.eventIntersectsRange=function(t,e){var n=t.start.clone().stripZone(),i=this.getEventEnd(t).stripZone();return e.start<i&&e.end>n};var Re={id:"_fcBusinessHours",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"};Ee.prototype.getCurrentBusinessHourEvents=function(t){return this.computeBusinessHourEvents(t,this.options.businessHours)},Ee.prototype.computeBusinessHourEvents=function(e,n){return n===!0?this.expandBusinessHourEvents(e,[{}]):t.isPlainObject(n)?this.expandBusinessHourEvents(e,[n]):t.isArray(n)?this.expandBusinessHourEvents(e,n,!0):[]},Ee.prototype.expandBusinessHourEvents=function(e,n,i){var r,s,o=this.getView(),l=[];for(r=0;r<n.length;r++)s=n[r],i&&!s.dow||(s=t.extend({},Re,s),e&&(s.start=null,s.end=null),l.push.apply(l,this.expandEvent(this.buildEventFromInput(s),o.start,o.end)));return l};var Ie=jt.BasicView=Se.extend({scroller:null,dayGridClass:me,dayGrid:null,dayNumbersVisible:!1,colWeekNumbersVisible:!1,cellWeekNumbersVisible:!1,weekNumberWidth:null,headContainerEl:null,headRowEl:null,initialize:function(){this.dayGrid=this.instantiateDayGrid(),this.scroller=new we({overflowX:"hidden",overflowY:"auto"})},instantiateDayGrid:function(){var t=this.dayGridClass.extend(ke);return new t(this)},setRange:function(t){Se.prototype.setRange.call(this,t),this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit),this.dayGrid.setRange(t)},computeRange:function(t){var e=Se.prototype.computeRange.call(this,t);return/year|month/.test(e.intervalUnit)&&(e.start.startOf("week"),e.start=this.skipHiddenDays(e.start),e.end.weekday()&&(e.end.add(1,"week").startOf("week"),e.end=this.skipHiddenDays(e.end,-1,!0))),e},renderDates:function(){this.dayNumbersVisible=this.dayGrid.rowCnt>1,this.opt("weekNumbers")&&(this.opt("weekNumbersWithinDays")?(this.cellWeekNumbersVisible=!0,this.colWeekNumbersVisible=!1):(this.cellWeekNumbersVisible=!1,this.colWeekNumbersVisible=!0)),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.cellWeekNumbersVisible||this.colWeekNumbersVisible,this.el.addClass("fc-basic-view").html(this.renderSkeletonHtml()),this.renderHead(),this.scroller.render();var e=this.scroller.el.addClass("fc-day-grid-container"),n=t('<div class="fc-day-grid" />').appendTo(e);this.el.find(".fc-body > tr > td").append(e),this.dayGrid.setElement(n),this.dayGrid.renderDates(this.hasRigidRows())},renderHead:function(){this.headContainerEl=this.el.find(".fc-head-container").html(this.dayGrid.renderHeadHtml()),this.headRowEl=this.headContainerEl.find(".fc-row")},unrenderDates:function(){this.dayGrid.unrenderDates(),this.dayGrid.removeElement(),this.scroller.destroy()},renderBusinessHours:function(){this.dayGrid.renderBusinessHours()},unrenderBusinessHours:function(){this.dayGrid.unrenderBusinessHours()},renderSkeletonHtml:function(){return'<table><thead class="fc-head"><tr><td class="fc-head-container '+this.widgetHeaderClass+'"></td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'"></td></tr></tbody></table>'},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var t=this.opt("eventLimit");return t&&"number"!=typeof t},updateWidth:function(){this.colWeekNumbersVisible&&(this.weekNumberWidth=u(this.el.find(".fc-week-number")))},setHeight:function(t,e){var n,s,o=this.opt("eventLimit");this.scroller.clear(),r(this.headRowEl),this.dayGrid.removeSegPopover(),o&&"number"==typeof o&&this.dayGrid.limitRows(o),n=this.computeScrollerHeight(t),this.setGridHeight(n,e),o&&"number"!=typeof o&&this.dayGrid.limitRows(o),e||(this.scroller.setHeight(n),s=this.scroller.getScrollbarWidths(),(s.left||s.right)&&(i(this.headRowEl,s),n=this.computeScrollerHeight(t),this.scroller.setHeight(n)),this.scroller.lockOverflow(s))},computeScrollerHeight:function(t){return t-d(this.el,this.scroller.el)},setGridHeight:function(t,e){e?a(this.dayGrid.rowEls):l(this.dayGrid.rowEls,t,!0)},queryScroll:function(){return this.scroller.getScrollTop()},setScroll:function(t){this.scroller.setScrollTop(t)},prepareHits:function(){this.dayGrid.prepareHits()},releaseHits:function(){this.dayGrid.releaseHits()},queryHit:function(t,e){return this.dayGrid.queryHit(t,e)},getHitSpan:function(t){return this.dayGrid.getHitSpan(t)},getHitEl:function(t){return this.dayGrid.getHitEl(t)},renderEvents:function(t){this.dayGrid.renderEvents(t),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},unrenderEvents:function(){this.dayGrid.unrenderEvents()},renderDrag:function(t,e){return this.dayGrid.renderDrag(t,e)},unrenderDrag:function(){this.dayGrid.unrenderDrag()},renderSelection:function(t){this.dayGrid.renderSelection(t)},unrenderSelection:function(){this.dayGrid.unrenderSelection()}}),ke={renderHeadIntroHtml:function(){var t=this.view;return t.colWeekNumbersVisible?'<th class="fc-week-number '+t.widgetHeaderClass+'" '+t.weekNumberStyleAttr()+"><span>"+tt(t.opt("weekNumberTitle"))+"</span></th>":""},renderNumberIntroHtml:function(t){var e=this.view,n=this.getCellDate(t,0);return e.colWeekNumbersVisible?'<td class="fc-week-number" '+e.weekNumberStyleAttr()+">"+e.buildGotoAnchorHtml({date:n,type:"week",forceOff:1===this.colCnt},n.format("w"))+"</td>":""},renderBgIntroHtml:function(){var t=this.view;return t.colWeekNumbersVisible?'<td class="fc-week-number '+t.widgetContentClass+'" '+t.weekNumberStyleAttr()+"></td>":""},renderIntroHtml:function(){var t=this.view;return t.colWeekNumbersVisible?'<td class="fc-week-number" '+t.weekNumberStyleAttr()+"></td>":""}},Me=jt.MonthView=Ie.extend({computeRange:function(t){var e,n=Ie.prototype.computeRange.call(this,t);return this.isFixedWeeks()&&(e=Math.ceil(n.end.diff(n.start,"weeks",!0)),n.end.add(6-e,"weeks")),n},setGridHeight:function(t,e){e&&(t*=this.rowCnt/6),l(this.dayGrid.rowEls,t,!e)},isFixedWeeks:function(){return this.opt("fixedWeekCount")}});Ut.basic={class:Ie},Ut.basicDay={type:"basic",duration:{days:1}},Ut.basicWeek={type:"basic",duration:{weeks:1}},Ut.month={class:Me,duration:{months:1},defaults:{fixedWeekCount:!0}};var Le=jt.AgendaView=Se.extend({scroller:null,timeGridClass:ye,timeGrid:null,dayGridClass:me,dayGrid:null,axisWidth:null,headContainerEl:null,noScrollRowEls:null,bottomRuleEl:null,initialize:function(){this.timeGrid=this.instantiateTimeGrid(),this.opt("allDaySlot")&&(this.dayGrid=this.instantiateDayGrid()),this.scroller=new we({overflowX:"hidden",overflowY:"auto"})},instantiateTimeGrid:function(){var t=this.timeGridClass.extend(Be);return new t(this)},instantiateDayGrid:function(){var t=this.dayGridClass.extend(ze);return new t(this)},setRange:function(t){Se.prototype.setRange.call(this,t),this.timeGrid.setRange(t),this.dayGrid&&this.dayGrid.setRange(t)},renderDates:function(){this.el.addClass("fc-agenda-view").html(this.renderSkeletonHtml()),this.renderHead(),this.scroller.render();var e=this.scroller.el.addClass("fc-time-grid-container"),n=t('<div class="fc-time-grid" />').appendTo(e);this.el.find(".fc-body > tr > td").append(e),this.timeGrid.setElement(n),this.timeGrid.renderDates(),this.bottomRuleEl=t('<hr class="fc-divider '+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el),this.dayGrid&&(this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight()),this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},renderHead:function(){this.headContainerEl=this.el.find(".fc-head-container").html(this.timeGrid.renderHeadHtml())},unrenderDates:function(){this.timeGrid.unrenderDates(),this.timeGrid.removeElement(),this.dayGrid&&(this.dayGrid.unrenderDates(),this.dayGrid.removeElement()),this.scroller.destroy()},renderSkeletonHtml:function(){return'<table><thead class="fc-head"><tr><td class="fc-head-container '+this.widgetHeaderClass+'"></td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="fc-divider '+this.widgetHeaderClass+'"/>':"")+"</td></tr></tbody></table>"},axisStyleAttr:function(){return null!==this.axisWidth?'style="width:'+this.axisWidth+'px"':""},renderBusinessHours:function(){this.timeGrid.renderBusinessHours(),this.dayGrid&&this.dayGrid.renderBusinessHours()},unrenderBusinessHours:function(){this.timeGrid.unrenderBusinessHours(),this.dayGrid&&this.dayGrid.unrenderBusinessHours()},getNowIndicatorUnit:function(){return this.timeGrid.getNowIndicatorUnit()},renderNowIndicator:function(t){this.timeGrid.renderNowIndicator(t)},unrenderNowIndicator:function(){this.timeGrid.unrenderNowIndicator()},updateSize:function(t){this.timeGrid.updateSize(t),Se.prototype.updateSize.call(this,t)},updateWidth:function(){this.axisWidth=u(this.el.find(".fc-axis"))},setHeight:function(t,e){var n,s,o;this.bottomRuleEl.hide(),this.scroller.clear(),r(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.removeSegPopover(),n=this.opt("eventLimit"),n&&"number"!=typeof n&&(n=Fe),n&&this.dayGrid.limitRows(n)),e||(s=this.computeScrollerHeight(t),this.scroller.setHeight(s),o=this.scroller.getScrollbarWidths(),(o.left||o.right)&&(i(this.noScrollRowEls,o),s=this.computeScrollerHeight(t),this.scroller.setHeight(s)),this.scroller.lockOverflow(o),this.timeGrid.getTotalSlatHeight()<s&&this.bottomRuleEl.show())},computeScrollerHeight:function(t){return t-d(this.el,this.scroller.el)},computeInitialScroll:function(){var t=e.duration(this.opt("scrollTime")),n=this.timeGrid.computeTimeTop(t);return n=Math.ceil(n),n&&n++,n},queryScroll:function(){return this.scroller.getScrollTop()},setScroll:function(t){this.scroller.setScrollTop(t)},prepareHits:function(){this.timeGrid.prepareHits(),this.dayGrid&&this.dayGrid.prepareHits()},releaseHits:function(){this.timeGrid.releaseHits(),this.dayGrid&&this.dayGrid.releaseHits()},queryHit:function(t,e){var n=this.timeGrid.queryHit(t,e);return!n&&this.dayGrid&&(n=this.dayGrid.queryHit(t,e)),n},getHitSpan:function(t){return t.component.getHitSpan(t)},getHitEl:function(t){return t.component.getHitEl(t)},renderEvents:function(t){var e,n,i=[],r=[],s=[];for(n=0;n<t.length;n++)t[n].allDay?i.push(t[n]):r.push(t[n]);e=this.timeGrid.renderEvents(r),this.dayGrid&&(s=this.dayGrid.renderEvents(i)),this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},unrenderEvents:function(){this.timeGrid.unrenderEvents(),this.dayGrid&&this.dayGrid.unrenderEvents()},renderDrag:function(t,e){return t.start.hasTime()?this.timeGrid.renderDrag(t,e):this.dayGrid?this.dayGrid.renderDrag(t,e):void 0},unrenderDrag:function(){this.timeGrid.unrenderDrag(),this.dayGrid&&this.dayGrid.unrenderDrag()},renderSelection:function(t){t.start.hasTime()||t.end.hasTime()?this.timeGrid.renderSelection(t):this.dayGrid&&this.dayGrid.renderSelection(t)},unrenderSelection:function(){this.timeGrid.unrenderSelection(),this.dayGrid&&this.dayGrid.unrenderSelection()}}),Be={renderHeadIntroHtml:function(){var t,e=this.view;return e.opt("weekNumbers")?(t=this.start.format(e.opt("smallWeekFormat")),'<th class="fc-axis fc-week-number '+e.widgetHeaderClass+'" '+e.axisStyleAttr()+">"+e.buildGotoAnchorHtml({date:this.start,type:"week",forceOff:this.colCnt>1},tt(t))+"</th>"):'<th class="fc-axis '+e.widgetHeaderClass+'" '+e.axisStyleAttr()+"></th>"},renderBgIntroHtml:function(){var t=this.view;return'<td class="fc-axis '+t.widgetContentClass+'" '+t.axisStyleAttr()+"></td>"},renderIntroHtml:function(){var t=this.view;return'<td class="fc-axis" '+t.axisStyleAttr()+"></td>"}},ze={renderBgIntroHtml:function(){var t=this.view;return'<td class="fc-axis '+t.widgetContentClass+'" '+t.axisStyleAttr()+"><span>"+t.getAllDayHtml()+"</span></td>"},renderIntroHtml:function(){var t=this.view;return'<td class="fc-axis" '+t.axisStyleAttr()+"></td>"}},Fe=5,Ne=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];Ut.agenda={class:Le,defaults:{allDaySlot:!0,slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0}},Ut.agendaDay={type:"agenda",duration:{days:1}},Ut.agendaWeek={type:"agenda",duration:{weeks:1}};var Ge=Se.extend({grid:null,scroller:null,initialize:function(){this.grid=new Ae(this),this.scroller=new we({overflowX:"hidden",overflowY:"auto"})},setRange:function(t){Se.prototype.setRange.call(this,t),this.grid.setRange(t)},renderSkeleton:function(){this.el.addClass("fc-list-view "+this.widgetContentClass),this.scroller.render(),this.scroller.el.appendTo(this.el),this.grid.setElement(this.scroller.scrollEl)},unrenderSkeleton:function(){this.scroller.destroy()},setHeight:function(t,e){this.scroller.setHeight(this.computeScrollerHeight(t))},computeScrollerHeight:function(t){return t-d(this.el,this.scroller.el)},renderEvents:function(t){this.grid.renderEvents(t)},unrenderEvents:function(){this.grid.unrenderEvents()},isEventResizable:function(t){return!1},isEventDraggable:function(t){return!1}}),Ae=pe.extend({segSelector:".fc-list-item",hasDayInteractions:!1,spanToSegs:function(t){for(var e,n=this.view,i=n.start.clone().time(0),r=0,s=[];i<n.end;)if(e=F(t,{start:i,end:i.clone().add(1,"day")}),e&&(e.dayIndex=r,s.push(e)),i.add(1,"day"),r++,e&&!e.isEnd&&t.end.hasTime()&&t.end<i.clone().add(this.view.nextDayThreshold)){e.end=t.end.clone(),e.isEnd=!0;break}return s},computeEventTimeFormat:function(){return this.view.opt("mediumTimeFormat")},handleSegClick:function(e,n){var i;pe.prototype.handleSegClick.apply(this,arguments),t(n.target).closest("a[href]").length||(i=e.event.url,i&&!n.isDefaultPrevented()&&(window.location.href=i))},renderFgSegs:function(t){return t=this.renderFgSegEls(t),t.length?this.renderSegList(t):this.renderEmptyMessage(),t},renderEmptyMessage:function(){this.el.html('<div class="fc-list-empty-wrap2"><div class="fc-list-empty-wrap1"><div class="fc-list-empty">'+tt(this.view.opt("noEventsMessage"))+"</div></div></div>")},renderSegList:function(e){var n,i,r,s=this.groupSegsByDay(e),o=t('<table class="fc-list-table"><tbody/></table>'),l=o.find("tbody");for(n=0;n<s.length;n++)if(i=s[n])for(l.append(this.dayHeaderHtml(this.view.start.clone().add(n,"days"))),this.sortEventSegs(i),r=0;r<i.length;r++)l.append(i[r].el);this.el.empty().append(o)},groupSegsByDay:function(t){var e,n,i=[];for(e=0;e<t.length;e++)n=t[e],(i[n.dayIndex]||(i[n.dayIndex]=[])).push(n);return i},dayHeaderHtml:function(t){var e=this.view,n=e.opt("listDayFormat"),i=e.opt("listDayAltFormat");return'<tr class="fc-list-heading" data-date="'+t.format("YYYY-MM-DD")+'"><td class="'+e.widgetHeaderClass+'" colspan="3">'+(n?e.buildGotoAnchorHtml(t,{class:"fc-list-heading-main"},tt(t.format(n))):"")+(i?e.buildGotoAnchorHtml(t,{class:"fc-list-heading-alt"},tt(t.format(i))):"")+"</td></tr>"},fgSegHtml:function(t){var e,n=this.view,i=["fc-list-item"].concat(this.getSegCustomClasses(t)),r=this.getSegBackgroundColor(t),s=t.event,o=s.url;return e=s.allDay?n.getAllDayHtml():n.isMultiDayEvent(s)?t.isStart||t.isEnd?tt(this.getEventTimeText(t)):n.getAllDayHtml():tt(this.getEventTimeText(s)),o&&i.push("fc-has-url"),'<tr class="'+i.join(" ")+'">'+(this.displayEventTime?'<td class="fc-list-item-time '+n.widgetContentClass+'">'+(e||"")+"</td>":"")+'<td class="fc-list-item-marker '+n.widgetContentClass+'"><span class="fc-event-dot"'+(r?' style="background-color:'+r+'"':"")+'></span></td><td class="fc-list-item-title '+n.widgetContentClass+'"><a'+(o?' href="'+tt(o)+'"':"")+">"+tt(t.event.title||"")+"</a></td></tr>"}});return Ut.list={class:Ge,buttonTextKey:"list",defaults:{buttonText:"list",listDayFormat:"LL",noEventsMessage:"No events to display"}},Ut.listDay={type:"list",duration:{days:1},defaults:{listDayFormat:"dddd"}},Ut.listWeek={type:"list",duration:{weeks:1},defaults:{listDayFormat:"dddd",listDayAltFormat:"LL"}},Ut.listMonth={type:"list",duration:{month:1},defaults:{listDayAltFormat:"dddd"}},Ut.listYear={type:"list",duration:{year:1},defaults:{listDayAltFormat:"dddd"}},jt});
|
import snarkdown from "snarkdown";
/**
* Adapted from: https://github.com/developit/snarkdown/issues/70#issuecomment-626863373
*
* @param {string} markdown
*/
export default function safeMarkdown(markdown) {
const html = snarkdown(markdown);
const doc = new DOMParser().parseFromString(
`<!DOCTYPE html><html><body><div>${html}</div></body></html>`,
"text/html"
);
doc.normalize();
sanitize(doc.body);
const elem = doc.body.removeChild(doc.querySelector("body > div"));
elem.className = "snarkdown";
return /** @type {HTMLElement} */ (elem);
}
/**
* @param {HTMLElement} node
*/
function sanitize(node) {
if (node.nodeType === 3) {
return;
}
if (
node.nodeType !== 1 ||
/^(script|iframe|object|embed|svg)$/i.test(node.tagName)
) {
return node.remove();
}
for (let i = node.attributes.length; i--; ) {
const name = node.attributes[i].name;
if (
!/^(class|id|name|href|src|alt|align|valign|(on[a-z]+))$/i.test(
name
)
) {
node.attributes.removeNamedItem(name);
}
}
for (let i = node.childNodes.length; i--; ) {
// @ts-ignore
sanitize(node.childNodes[i]);
}
}
|
#
# Advent of Code 2020 - Day 3 Part 1
# 3 Dec 2020 Brian Green
#
# Problem:
# From your starting position at the top-left, check the position that is right 3 and down 1.
# Then, check the position that is right 3 and down 1 from there, and so on until you go past the bottom of the map.
#
import os
class Aoc03:
def __init__(self):
self.open = '.'
self.tree = '#'
self.x_offset = 3
self.y_offset = 1
"""
test_data = ["..##.......",
"#...#...#..",
".#....#..#.",
"..#.#...#.#",
".#...##..#.",
"..#.##.....",
".#.#.#....#",
".#........#",
"#.##...#...",
"#...##....#",
".#..#...#.#"]
"""
file_name = "data" + os.sep + "brian_aoc03.dat"
with open(file_name) as data_file:
data_set = data_file.readlines()
# self.data = test_data
self.data = data_set
self.x_max = len(self.data[0].strip())
self.y_max = len(self.data)
def run_it(self):
# print(self.x_max)
# print(self.y_max)
x = 0
total_trees = 0
for y in range(0, self.y_max, self.y_offset):
location = self.data[y][x]
if location == self.tree:
total_trees += 1
# print(f"{x}, {y} {self.data[y][x]}")
x += self.x_offset
x %= self.x_max
print(f"Total trees: {total_trees}")
if __name__ == "__main__":
solve_it = Aoc03()
solve_it.run_it()
|
;
$(function() {
$('body').on('click','.wh-variants a',function() {
$('input[name=art_id]').val($(this).data('art_id'));
calc_price();
});
$('body').on('click','.wh-attributes a, .wh-attributes button',function() {
$(this).parent().addClass('uk-active').siblings().removeClass('uk-active');
calc_price();
});
function calc_price () {
if ($('.wh-variants .uk-active a').length) {
price = $('.wh-variants .uk-active a').data('price');
} else {
price = $('#wh_art_price').data('price');
}
$('input.wh_attribute').remove();
$('.wh-attributes .uk-active a, .wh-attributes .uk-card-primary').each(function() {
price = parseFloat(price) + parseFloat($(this).data('price'));
$('#wh_form_detail').append('<input type="hidden" name="wh_attr[]" value="'+$(this).data('attr_id')+'" class="wh_attribute">');
});
$('.product_price').html(parseFloat(price).toFixed(2));
}
if ($('#wh_art_price').length) {
calc_price();
}
// +/- Buttons
$('label.switch_count').click(function() {
var for_id = $(this).attr('for');
var cur_val = $('input#'+for_id).val();
var new_val = eval(cur_val + $(this).data('value'));
if (new_val < 1) {
new_val = 1;
}
$('input#'+for_id).val(new_val);
});
}); |
/*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
// @flow
export {
styled,
withStyle,
withWrapper,
useStyletron,
createThemedStyled,
createThemedWithStyle,
createThemedUseStyletron,
ThemeProvider,
ThemeConsumer,
} from './styles/index.js';
export {
createTheme,
createDarkTheme,
createLightTheme,
lightThemePrimitives,
darkThemePrimitives,
darkThemeOverrides,
DarkTheme,
DarkThemeMove,
LightTheme,
LightThemeMove,
} from './themes/index.js';
export {default as LocaleProvider} from './locale/index.js';
export {default as BaseProvider} from './helpers/base-provider.js';
export {getOverrides, mergeOverrides} from './helpers/overrides.js';
export type {PrimitivesT} from './themes/types.js';
export type {ThemeT} from './styles/types.js';
|
"""
innovation_sweet_spots.getters.crunchbase
Module for easy access to downloaded CB data
"""
import pandas as pd
from innovation_sweet_spots.getters.path_utils import CB_PATH
def get_crunchbase_category_groups():
"""Table with company categories (also called 'industries') and broader 'category groups'"""
return pd.read_csv(CB_PATH / "crunchbase_category_groups.csv")
def get_crunchbase_orgs():
"""Loads and deduplicates the main Crunchbase organisations table"""
return pd.read_csv(CB_PATH / "crunchbase_organizations.csv").drop_duplicates()
def get_crunchbase_organizations_categories():
"""Table with companies and their categories"""
return pd.read_csv(CB_PATH / "crunchbase_organizations_categories.csv")
def get_crunchbase_funding_rounds():
"""Table with investment rounds (NB: one round can have several investments)"""
return pd.read_csv(CB_PATH / "crunchbase_funding_rounds.csv")
def get_crunchbase_investments():
"""Table with investments"""
return pd.read_csv(CB_PATH / "crunchbase_investments.csv")
def get_crunchbase_investors():
"""Table with investors"""
return pd.read_csv(CB_PATH / "crunchbase_investors.csv")
|
var nodePath = require("path");
var fs = require("fs");
exports.check = function(marko, markoCompiler, expect, snapshot, done) {
require("marko/compiler").configure({
writeToDisk: true
});
var compiledPath;
var templatePath = nodePath.join(__dirname, "template.marko");
compiledPath = nodePath.join(__dirname, "template.marko.js");
var template = marko.load(templatePath);
expect(fs.existsSync(compiledPath)).to.equal(true);
snapshot(template.renderSync({ name: "Frank" }).toString());
done();
};
|
angular.module("ovh-api-services").service("OvhApiIpLoadBalancingVrackV6", function ($resource, $cacheFactory) {
"use strict";
var cache = $cacheFactory("OvhApiIpLoadBalancingVrackV6");
var queryCache = $cacheFactory("OvhApiIpLoadBalancingVrackV6Query");
var interceptor = {
response: function (response) {
cache.removeAll();
queryCache.removeAll();
return response.resource;
}
};
var ipLoadBalancingVrack = $resource("/ipLoadbalancing/:serviceName/vrack/network/:vrackNetworkId", {
serviceName: "@serviceName",
vrackNetworkId: "@vrackNetworkId"
}, {
query: { method: "GET", isArray: true, cache: queryCache },
get: { method: "GET", cache: cache },
post: { method: "POST", interceptor: interceptor },
put: { method: "PUT", interceptor: interceptor },
"delete": { method: "DELETE", interceptor: interceptor },
getCreationRules: {
cache: cache,
method: "GET",
url: "/ipLoadbalancing/:serviceName/vrack/networkCreationRules"
},
getStatus: {
cache: cache,
method: "GET",
url: "/ipLoadbalancing/:serviceName/vrack/status"
},
updateFarmId: {
interceptor: interceptor,
method: "POST",
url: "/ipLoadbalancing/:serviceName/vrack/network/:vrackNetworkId/updateFarmId "
}
});
ipLoadBalancingVrack.resetCache = function () {
cache.removeAll();
};
ipLoadBalancingVrack.resetQueryCache = function () {
queryCache.removeAll();
};
return ipLoadBalancingVrack;
});
|
"""This module contains API-related exceptions."""
class APIError(Exception):
"""An exception denoting generic API errors.
This error is raised when the API returns invalid
response data, like invalid JSON.
"""
pass
class EmptyResponseError(APIError):
"""An exception denoting an empty API response.
This error is raised when the API response content
is empty, or it contains an empty JSON object.
"""
pass
|
//global var
//var for form errors
//we need a var which is as function to retrive input from search term.
var searchTerm =function () { var searchTerm = document.querySelector('#search-button').value };
//begin the fetch
//step one we need to fetch the data (Fetch is the call){
// 'url' + searchTerm + :='api key'
// promise 1 which orignizing incomming
// .then function (current-weather) {
//return current-weather.json();
// promise 2 which loads the data
// .then function (current-weather) {
//console.log(current-weather.data[0]);
//nested fetch for 5 day 3hr forcaste begins
// 'url' + searchTerm + :='api key'
// promise 1 which orignizing incomming
// .then function (fiveday) {
//return fiveday.json();
// promise 2 which loads the data
// .then function (fiveday) {
//console.log(fiveday.data[0]);
// to git appropreate response to the correct ontainer
// var the correcto element name = documents.querySelector ('#idname", "3")
// create functino of the storage and recall.
//going to need a var for conversion of timiture.
//going to meed a for loop for uv ray indexed |
import React from 'react';
import cx from 'classnames';
const TESTING_SVG = (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 50 50">
<path d="M 18.5 2 C 17.1 2 16 3.1 16 4.5 C 16 5.7 16.9 6.70625 18 6.90625 L 18 40.90625 C 18 44.80625 21.1 47.90625 25 47.90625 C 28.9 47.90625 32 44.80625 32 40.90625 L 32 6.90625 C 33.1 6.70625 34 5.7 34 4.5 C 34 3.1 32.9 2 31.5 2 L 18.5 2 z M 18.5 4 L 31.5 4 C 31.8 4 32 4.2 32 4.5 C 32 4.8 31.8 5 31.5 5 L 31 5 L 30 5 L 23 5 L 23 7 L 30 7 L 30 13 L 20 13 L 20 7 L 21 7 L 21 5 L 20 5 L 19 5 L 18.5 5 C 18.2 5 18 4.8 18 4.5 C 18 4.2 18.2 4 18.5 4 z M 26 21 C 27.1 21 28 21.9 28 23 C 28 24.1 27.1 25 26 25 C 24.9 25 24 24.1 24 23 C 24 21.9 24.9 21 26 21 z M 23.5 31 C 24.3 31 25 31.7 25 32.5 C 25 33.3 24.3 34 23.5 34 C 22.7 34 22 33.3 22 32.5 C 22 31.7 22.7 31 23.5 31 z" overflow="visible"></path>
</svg>
);
class Testing extends React.Component {
render() {
const props = this.props;
let description;
switch (props.testing) {
case 'mocha':
description = (
<div>
<strong><a href="https://mochajs.org/" target="_blank">Mocha</a></strong> — Simple, flexible, fun javascript test framework. <strong><a href="http://chaijs.com/" target="_blank">Chai</a></strong> — A BDD / TDD assertion library. <strong><a href="http://sinonjs.org/" target="_blank">Sinon</a></strong> — Test spies, stubs and mocks.
</div>
);
break;
case 'jasmine':
description = (
<div>
<strong><a href="http://jasmine.github.io/edge/introduction.html" target="_blank">Jasmine</a></strong> — A BDD framework for testing JavaScript code. It does not depend on any other JavaScript frameworks.
</div>
);
break;
default:
description = <div className="placeholder"> </div>;
}
let note;
if (props.testing === 'mocha') {
note = (
<div>
<strong>Note: </strong>
<span>Mocha comes bundled with <a href="http://chaijs.com/" target="_blank">Chai</a> and <a href="http://sinonjs.org/" target="_blank">Sinon</a> for complete testing experience.</span>
</div>
);
} else {
note = <div className="placeholder"> </div>;
}
const mochaRadio = (
<label className="radio-inline">
<img className="btn-logo" src="/img/svg/mocha.svg" alt="Mocha"/>
<input type="radio" name="testingRadios" value="mocha" onChange={props.handleChange} checked={props.testing === 'mocha'}/>
<span>Mocha</span>
</label>
);
const jasmineRadio = props.jsFramework === 'angularjs' ? (
<label className="radio-inline">
<img className="btn-logo" src="/img/svg/jasmine.svg" alt="Jasmine"/>
<input type="radio" name="testingRadios" value="jasmine" onChange={props.handleChange} checked={props.testing === 'jasmine'}/>
<span>Jasmine</span>
</label>
) : (
<label className="radio-inline hint--top hint--rounded" data-hint="Coming soon">
<img className="btn-logo disabled" src="/img/svg/jasmine.svg" alt="Jasmine"/>
<input type="radio" name="testingRadios" value="jasmine" onChange={props.handleChange} checked={props.testing === 'jasmine'} disabled/>
<span>Jasmine</span>
</label>
);
const validationError = props.testingValidationError ? (
<div className="text-danger"><i className="fa fa-warning"></i> {props.testingValidationError}</div>
) : null;
if (props.testingValidationError) {
if (props.disableAutoScroll) {
$(this.refs.testing).velocity('scroll', { duration: 0 });
} else {
$(this.refs.testing).velocity('scroll');
}
}
return (
<div ref="testing" className={cx('zoomInBackwards panel', props.testing)}>
<div className="panel-heading">
<h6>{TESTING_SVG}{!props.testing || props.testing === 'none' ? 'Unit Testing' : props.testing}</h6>
</div>
<div className="panel-body">
{description}
<div className="radio-group">
<label className="radio-inline">
<img className="btn-logo" src="/img/svg/none.png" alt="None"/>
<input type="radio" name="testingRadios" value="none" onChange={props.handleChange} checked={props.testing === 'none'}/>
<span>None</span>
</label>
{mochaRadio}
{jasmineRadio}
</div>
{validationError}
{note}
</div>
</div>
);
}
}
export default Testing;
|
#!/usr/bin/python
import os
from mininet.log import setLogLevel, info #, error
from mininet.net import Mininet
from mininet.node import OVSController
from mininet.topo import Topo
from mininet.link import TCLink
from mininet.cli import CLI
import time
from debug_utils import *
from net_utils import *
def run_masters(m_l):
run(m_l, ['./run.sh m{}'.format(i) for i in range(len(m_l))])
log(DEBUG, "done")
class MyTopo(Topo):
def __init__(self):
Topo.__init__(self)
m0 = self.addHost('m0')
w0 = self.addHost('w0')
m1 = self.addHost('m1')
w1 = self.addHost('w1')
d = self.addHost('d')
c0 = self.addHost('c0')
c1 = self.addHost('c1')
sw0 = self.addSwitch('sw0')
cluster_link_opts = dict(bw=1000, delay='0.1ms', loss=0, max_queue_size=1000, use_htb=True)
edge_link_opts = dict(bw=1000, delay='1ms', loss=0, max_queue_size=1000, use_htb=True)
self.addLink(m0, sw0, **cluster_link_opts)
self.addLink(w0, sw0, **cluster_link_opts)
self.addLink(m1, sw0, **cluster_link_opts)
self.addLink(w1, sw0, **cluster_link_opts)
self.addLink(d, sw0, **cluster_link_opts)
self.addLink(c0, sw0, **edge_link_opts)
self.addLink(c1, sw0, **edge_link_opts)
if __name__ == '__main__':
setLogLevel('info')
net = Mininet(topo=MyTopo(), link=TCLink, controller=OVSController)
m0, m1 = net.getNodeByName('m0', 'm1')
m0.setIP(ip='10.0.0.0', prefixLen=32)
m1.setIP(ip='10.0.0.1', prefixLen=32)
m0.setMAC(mac='00:00:00:00:00:00')
m1.setMAC(mac='00:00:00:00:00:01')
w0, w1 = net.getNodeByName('w0', 'w1')
w0.setIP(ip='10.0.1.0', prefixLen=32)
w1.setIP(ip='10.0.1.1', prefixLen=32)
w0.setMAC(mac='00:00:00:00:01:00')
w1.setMAC(mac='00:00:00:00:01:01')
d = net.getNodeByName('d')
d.setIP(ip='10.0.3.0', prefixLen=32)
d.setMAC(mac='00:00:00:00:03:00')
c0, c1 = net.getNodeByName('c0', 'c1')
c0.setIP(ip='10.0.2.0', prefixLen=32)
c1.setIP(ip='10.0.2.1', prefixLen=32)
c0.setMAC(mac='00:00:00:00:02:00')
c1.setMAC(mac='00:00:00:00:02:01')
## To fix "network is unreachable"
m0.setDefaultRoute(intf='m0-eth0')
m1.setDefaultRoute(intf='m1-eth0')
w0.setDefaultRoute(intf='w0-eth0')
w1.setDefaultRoute(intf='w1-eth0')
d.setDefaultRoute(intf='d-eth0')
c0.setDefaultRoute(intf='c0-eth0')
c1.setDefaultRoute(intf='c1-eth0')
net.start()
run_dashboard_server(d)
run_workers([w0, w1])
run_masters([m0, m1])
CLI(net)
net.stop()
|
const express = require("express");
const api = require("./api/api");
const db = require("./databaseConnection");
const app = express();
// Setup common middlewares
app.use(express.json());
// Load database
db.connectDB();
// Register api
app.use("/api", api);
module.exports = app;
|
import { gridSize } from './globals.js';
let snake = kontra.Sprite({
x: 160,
y: 160,
width: gridSize,
height: gridSize,
// snake velocity. moves one grid length every frame in either the x or y direction
dx: gridSize,
dy: 0,
// keep track of all grids the snake body occupies
cells: [],
// keep track of moves
queue: [],
// length of the snake. grows when eating an apple
maxCells: 4,
update() {
let move = this.queue.shift();
if (move) {
this.dx = move.dx;
this.dy = move.dy;
}
this.advance();
let canvas = kontra.getCanvas();
// wrap snake position horizontally on edge of screen
if (this.x < 0) {
this.x = canvas.width - gridSize;
} else if (this.x >= canvas.width) {
this.x = 0;
}
// wrap snake position vertically on edge of screen
if (this.y < 0) {
this.y = canvas.height - gridSize;
} else if (this.y >= canvas.height) {
this.y = 0;
}
// keep track of where snake has been. front of the array is always the head
this.cells.unshift({ x: this.x, y: this.y });
// remove cells as we move away from them
if (this.cells.length > this.maxCells) {
this.cells.pop();
}
},
render() {
this.context.fillStyle = 'green';
snake.cells.forEach((cell, index) => {
// drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
this.context.fillRect(cell.x - this.x, cell.y - this.y, gridSize - 1, gridSize - 1);
});
}
});
// prevent snake from backtracking on itself by checking that it's
// not already moving on the same axis (pressing left while moving
// left won't do anything, and pressing right while moving left
// shouldn't let you collide with your own body)
kontra.onKey('arrowleft', () => {
if (snake.dx === 0) {
// queue the move so we also don't change directions before an
// update and still can run into ourselves
snake.queue.push({
dx: -gridSize,
dy: 0
});
}
});
kontra.onKey('arrowup', () => {
if (snake.dy === 0) {
snake.queue.push({
dy: -gridSize,
dx: 0
});
}
});
kontra.onKey('arrowright', () => {
snake.queue.push({
dx: gridSize,
dy: 0
});
});
kontra.onKey('arrowdown', () => {
if (snake.dy === 0) {
snake.queue.push({
dy: gridSize,
dx: 0
});
}
});
export default snake;
|
L.Control.Attribution = L.Control.extend({
options: {
position: 'bottomright',
prefix: 'Powered by <a href="http://leaflet.cloudmade.com">Leaflet</a>'
},
initialize: function (options) {
L.Util.setOptions(this, options);
this._attributions = {};
},
onAdd: function (map) {
this._container = L.DomUtil.create('div', 'leaflet-control-attribution');
L.DomEvent.disableClickPropagation(this._container);
map
.on('layeradd', this._onLayerAdd, this)
.on('layerremove', this._onLayerRemove, this);
this._update();
return this._container;
},
onRemove: function (map) {
map
.off('layeradd', this._onLayerAdd)
.off('layerremove', this._onLayerRemove);
},
setPrefix: function (prefix) {
this.options.prefix = prefix;
this._update();
},
addAttribution: function (text) {
if (!text) { return; }
if (!this._attributions[text]) {
this._attributions[text] = 0;
}
this._attributions[text]++;
this._update();
},
removeAttribution: function (text) {
if (!text) { return; }
this._attributions[text]--;
this._update();
},
_update: function () {
if (!this._map) { return; }
var attribs = [];
for (var i in this._attributions) {
if (this._attributions.hasOwnProperty(i) && this._attributions[i]) {
attribs.push(i);
}
}
var prefixAndAttribs = [];
if (this.options.prefix) {
prefixAndAttribs.push(this.options.prefix);
}
if (attribs.length) {
prefixAndAttribs.push(attribs.join(', '));
}
this._container.innerHTML = prefixAndAttribs.join(' — ');
},
_onLayerAdd: function (e) {
if (e.layer.getAttribution) {
this.addAttribution(e.layer.getAttribution());
}
},
_onLayerRemove: function (e) {
if (e.layer.getAttribution) {
this.removeAttribution(e.layer.getAttribution());
}
}
});
L.Map.mergeOptions({
attributionControl: true
});
L.Map.addInitHook(function () {
if (this.options.attributionControl) {
this.attributionControl = (new L.Control.Attribution()).addTo(this);
}
}); |
import sys
import math
sys.path.append("..")
from common import *
def parse(data):
d = data[:-1].split("contain")
return (d[0].strip(),[c.strip() for c in d[1].split(",")])
data = fnl(parse);
graph = {}
for n in data:
graph[n[0][:-4].strip()] = [e.split(" ",1)[1][:-4].strip() for e in n[1]]
p(graph)
graph["other"] = []
def rec_count(graph,node,visited=[]):
p = []
for n in graph:
for b in graph[n]:
if(b == node):
p.append(n)
break
for n in p:
if not (n in visited):
rec_count(graph,n,visited)
visited.append(n)
return visited
o = rec_count(graph,"shiny gold")
print(len(o))
o.append("shiny gold")
# VIZ
ng = {}
for p in o:
ng[p] = [n for n in graph[p] if n in o]
drawGraph("part1",ng) |
import React, { PureComponent , Suspense}from 'react';
import PropTypes from 'prop-types';
import Spinner from '../Spinner'
const ThumbImage = React.lazy(() => import('../ThumbImage'))
class GnomeModal extends PureComponent {
render () {
const { active, gnome, closeModal } = this.props;
const modalClassname = `modal ${active ? 'is-active' : ''}`;
return (
<div className={modalClassname}>
<div className="modal-background" onClick={closeModal} />
<div className="modal-content">
<div className="box">
<article className="media">
<div className="media-left">
<figure className="image is-128x128">
<Suspense fallback={<Spinner />}>
<ThumbImage src={gnome.thumbnail} />
</Suspense>
</figure>
</div>
<div className="content">
<strong>{gnome.name}</strong>
<br />
{`Age: ${gnome.age} years`}
<br />
{`Weight: ${gnome.weight} kg`}
<br />
{`Height: ${gnome.height} cm`}
<br />
{`Hair color: ${gnome.hair_color}`}
<br />
Professions:
<ul>{gnome.professions.map((p, i) => <li key={`profession_${i}`}>{p}</li>)}</ul>
Friends:
{gnome.friends.length === 0 ? ' none' : ''}
<ul>{gnome.friends.map((f, i) => <li key={`friend_${i}`}>{f}</li>)}</ul>
</div>
</article>
</div>
</div>
<button type="button" aria-label="close" className="modal-close is-large" onClick={closeModal} />
</div>
);
}
}
GnomeModal.propTypes = {
gnome: PropTypes.objectOf(PropTypes.any),
closeModal: PropTypes.func,
active: PropTypes.bool.isRequired,
};
GnomeModal.defaultProps = {
closeModal: () => {},
};
export default GnomeModal;
|
import * as TYPE from "./checkType"
// 全局log变量
let isShowGlobalLog = true;
// 设置模块开关(建议默认模块code>=1000)
let moduleArr = [
{
name: `login`,
code: 1000,
isShowLog: true
}
];
// 设置样式(暂时设置文字颜色)
let styleArr = {
red: `color:#f5576c`,
blue: `color:#005bea`,
green: `color:#00e3ae`,
gray: `color:#485563`,
pink: `color:#fe5196`
};
// 设置console的类
class Console {
constructor(...dataArr) {
// 定义默认数据
this.data=[]
}
// 检测全局log开关
checkGloabal(code, fn) {
// 全局log显隐
if (isShowGlobalLog) {
// 默认为显示模块log
if (code === 0) {
// 打印log(回调)
fn();
} else {
// 模块显隐log
if (this.checkModule(code)) {
// 打印log(回调)
fn();
} else {
return false;
}
}
} else {
return false;
}
}
// 获取当前模块log开关
checkModule(code) {
// 设置开关
let isShowLog = false;
// 遍历模块
moduleArr.forEach((item, index) => {
if (item.code === code) {
// 获取当前模块开关
isShowLog = item.isShowLog;
}
});
return isShowLog;
}
test(...data){
console.log(data).apply()
}
// 接收数据
log(...dataArr) {
this.test()
return this
}
// 处理数据
toString(){
this.data.forEach((item,index)=>{
if(TYPE.isArray||TYPE.isObj){
item=JSON.stringify(value)
}
return item
})
console.log(...this.data)
}
// 根据数据类型设置打印形式
checkData(value, style) {
if (typeof value === `string`) {
console.log(`%c${value}`, styleArr[style]);
} else {
console.log(`%c${JSON.stringify(value)}`, styleArr[style]);
}
}
// 带有样式的log
logStyle(code = 0, style = `red`, ...dataArr) {
this.checkGloabal(code, () => {
if (dataArr.length === 1) {
this.checkData(dataArr[0], style);
} else {
console.group("style log >>>>>>>>>>");
dataArr.forEach((item, idnex) => {
this.checkData(item, style);
});
console.groupEnd();
}
});
return this
}
}
// 创建一个示例
export let dsxConsole = new Console();
// 设置log方法
export let Log = (...dataArr) => {
dsxConsole.log(...dataArr);
// 链式调用
return dsxConsole
};
// 设置带有样式的log方法
export let LogStyle = (...dataArr) => {
dsxConsole.logStyle(...dataArr);
// 链式调用
return dsxConsole
};
|
/**
* Copyright 2016 Frédéric Massart
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
} from 'react-native';
import Energy from './Energy';
function Charges(props) {
let charges = [];
for (let i = 0; i < props.count; i++) {
charges.push((
<Energy key={i} style={styles.charge}></Energy>
));
}
return (
<View style={[styles.root, props.style]}>
{charges}
</View>
)
}
Charges.propTypes = {
count: React.PropTypes.number.isRequired
}
const styles = StyleSheet.create({
root: {
flex: 1,
flexDirection: 'row',
alignItems: 'stretch'
},
charge: {
marginLeft: 5,
},
});
export default Charges;
|
(function(){if(window.JCClock)return;function i(i){if(typeof BX!="undefined")BX.onCustomEvent("onJCClockInit",[i]);this.config=i;this.config.AmPmMode=BX.isAmPmMode();this.config.AmPm="";this.deltaHour=0;this.MESS=this.config.MESS;this.bCreated=false}i.prototype={Create:function(i){this.bCreated=true;this.pInput=document.getElementById(this.config.inputId);this.pIcon=document.getElementById(this.config.iconId);if(i&&(i=document.getElementById(i))){this.bInline=true;this.oDiv=i;this.oDiv.className="bx-clock-div bx-clock-div-inline"+(this.config.AmPmMode?"_am_pm":"");this.oDiv.style.position="relative"}else{var t=150;if(typeof this.config["zIndex"]!="undefined"){t=parseInt(this.config["zIndex"]);if(t<=0)t=150}this.oDiv=BX(this.config.inputId+"_div");if(this.oDiv)BX.cleanNode(this.oDiv,true);this.oDiv=BX.create("DIV",{props:{className:"bx-clock-div",id:this.config.inputId+"_div"},style:{zIndex:t}});document.body.appendChild(this.oDiv)}var e=BX.create("DIV",{props:{className:"bxc-clock-cont bxc-iconkit-c"}});this.arrowsContDiv=BX.create("DIV",{props:{className:"bxc-arrows-cont h0 m0"}});this.MACDiv=this.arrowsContDiv.appendChild(BX.create("DIV",{props:{className:"bxc-mouse-control-cont"}}));this.arrowsContDiv.appendChild(BX.create("IMG",{props:{src:"/bitrix/images/1.gif",className:"bxc-min-arr-cont bxc-iconkit-a"}}));this.arrowsContDiv.appendChild(BX.create("IMG",{props:{src:"/bitrix/images/1.gif",className:"bxc-hour-arr-cont bxc-iconkit-a"}}));e.appendChild(this.arrowsContDiv);this.oDiv.appendChild(e);this.CreateControls();this.InitMouseArrowControl()},CreateControls:function(){this.ControlsCont=BX.create("DIV",{props:{className:"bxc-controls-cont"}});var i,t=[],e=[],n=this;if(this.config.AmPmMode){for(i=0;i<12;i++)t.push(this.Hour2Str(i,true))}else{for(i=0;i<24;i++)t.push(this.Int2Str(i))}for(i=0;i<60;i+=this.config.step)e[i]=this.Int2Str(i);var o=this.CreateSelect(t,1,this.MESS.Hours);this.hourSelect=o.pSelect;var s=this.CreateSelect(e,this.config.step,this.MESS.Minutes);this.minSelect=s.pSelect;this.hourSelect.onchange=function(){if(!this.value||isNaN(this.value))this.value=0;n.SetTime(this.value,n.curMin,true)};this.minSelect.onchange=function(){if(!this.value||isNaN(this.value))this.value=0;n.SetTime(n.curHour,this.value,true)};this.minSelect.onfocus=function(){n.lastArrow="min"};this.hourSelect.onfocus=function(){n.lastArrow="hour"};if(!this.bInline){var r=BX.create("INPUT",{props:{type:"button",value:this.MESS.Insert}});r.onclick=function(){n.Submit()};var h=BX.create("IMG",{props:{src:"/bitrix/images/1.gif",className:"bxc-close bxc-iconkit-c",title:this.MESS.Close}});h.onclick=function(){n.Close()}}var a=BX.create("SPAN",{props:{className:"double-dot"}});a.innerHTML=":";o.pWnd.style.marginLeft="11px";this.ControlsCont.appendChild(o.pWnd);this.ControlsCont.appendChild(a);this.ControlsCont.appendChild(s.pWnd);if(this.config.AmPmMode){this.AmPm=BX.create("SPAN",{props:{className:"bxc-am-pm",title:"a.m."}});this.AmPm.innerHTML="am";this.AmPm.onclick=function(){if(this.title=="a.m."){this.title="p.m.";this.innerHTML="pm";n.config.AmPm=" pm"}else{this.title="a.m.";this.innerHTML="am";n.config.AmPm=" am"}n.SetTime(n.curHour,n.curMin,true)};this.ControlsCont.appendChild(this.AmPm)}if(!this.bInline){this.ControlsCont.appendChild(r);this.ControlsCont.appendChild(h);this.pTitle=this.ControlsCont.appendChild(BX.create("DIV",{props:{className:"bxc-title"}}));this.pTitle.onmousedown=function(i){jsFloatDiv.StartDrag(i,n.oDiv);n.bRecalculateCoordinates=true}}this.oDiv.appendChild(this.ControlsCont)},CalculateCoordinates:function(){var t=BX.pos(this.oDiv);this.top=t.top;this.left=t.left;this.centerX=t.left+(this.bInline?i.getOption("centerXInline",55):i.getOption("centerX",55));this.centerY=t.top+(this.bInline?i.getOption("centerYInline",55):i.getOption("centerY",71));var e=this,n=i.getOption("minuteLength",32),o=i.getOption("hourLength",25),s=this.centerX,r=this.centerY,h,a,c,u,l,f,d,m,p,C,M=i.getOption("inaccuracy",8);this.arHourCoords=[];this.bJumpByMinArrow30=false;for(h=0;h<12;h++){a=h*30*Math.PI/180;c=Math.round(o*Math.sin(a));u=Math.round(o*Math.cos(a));l=s+c;f=r-u;d=Math.round(16*Math.sin(a));m=Math.round(16*Math.cos(a));p=s+d;C=r-m;this.arHourCoords[h]={x:l,y:f,x_min:l-M,x_max:l+M,y_min:f-M,y_max:f+M,x_min1:p-M,x_max1:p+M,y_min1:C-M,y_max1:C+M}}this.arMinCoords={};for(h=0;h<12;h++){a=h*30*Math.PI/180;c=Math.round(n*Math.sin(a));u=Math.round(n*Math.cos(a));l=s+c;f=r-u;d=Math.round(18*Math.sin(a));m=Math.round(18*Math.cos(a));p=s+d;C=r-m;this.arMinCoords[h*5]={x:l,y:f,x_min:l-M,x_max:l+M,y_min:f-M,y_max:f+M,x_min1:p-M,x_max1:p+M,y_min1:C-M,y_max1:C+M}}this.bRecalculateCoordinates=false},Show:function(i){if(!this.bCreated)this.Create(i);this.lastArrow="min";var t=this.pInput.value.toString();if(t.indexOf(":")==-1){if(this.config.initTime.length<=0||this.config.initTime.indexOf(":")==-1)t=(new Date).getHours()+":"+(new Date).getMinutes();else t=this.config.initTime}var e=t.split(":");e[1]=e[1].split(" ");if(e[1][1]!=undefined){e[0]=parseInt(e[0],10);if(e[1][1]=="pm"&&e[0]<12)e[0]=e[0]+12;else if(e[1][1]=="am"&&e[0]==12)e[0]=0;e[1]=e[1][0]}this.SetTime(parseInt(e[0],10)||0,parseInt(e[1],10)||0);if(this.bInline){this.oDiv.style.display="block"}else{var n=this.pIcon||this.pInput;var o=this.AlignToPos(BX.pos(n));this.top=o.top;this.left=o.left;jsFloatDiv.Show(this.oDiv,this.left,this.top);this.oDiv.style.display="block";jsFloatDiv.AdjustShadow(this.oDiv)}var s=this;setTimeout(function(){s.CalculateCoordinates()},20);window["_bxc_onmousedown"+this.config.inputId]=function(i){s.CheckClick(i)};window["_bxc_onkeypress"+this.config.inputId]=function(i){s.OnKeyDown(i)};setTimeout(function(){BX.bind(document,"mousedown",window["_bxc_onmousedown"+s.config.inputId])},10);BX.bind(document,"keypress",window["_bxc_onkeypress"+this.config.inputId])},AlignToPos:function(t){var e=i.getOption("popupHeight",170),n=t.left,o=t.top-e,s=BX.GetWindowScrollPos();if(s.scrollTop>o||o<0)o=t.top+20;return{left:n,top:o}},Close:function(){if(this.bInline)return;BX.unbind(document,"mousedown",window["_bxc_onmousedown"+this.config.inputId]);BX.unbind(document,"keypress",window["_bxc_onkeypress"+this.config.inputId]);jsFloatDiv.Close(this.oDiv);this.oDiv.style.display="none"},Submit:function(){var i=this.config.AmPmMode?this.config.AmPm:"";this.pInput.value=this.Hour2Str(this.curHour,this.config.AmPmMode)+":"+this.Int2Str(this.curMin)+i;BX.fireEvent(this.pInput,"change");if(!this.bInline)this.Close()},SetTime:function(i,t,e,n){i=parseInt(i,10);if(this.config.AmPmMode){if(i>=12){if(i>12)i=i-12;if(this.config.AmPm=="")this.config.AmPm=" pm"}else if(this.config.AmPm==""){this.config.AmPm=" am"}if(i<1||i>12){i=12;this.config.AmPm=" am"}}else if(i<0||i>23)i=0;t=parseInt(t,10);var o=this.config.step;if(Math.round(t/o)!=t/o)t=Math.round(t/o)*o;if(t<0||t>59)t=0;if(!n)this.deltaHour=i>=12?12:0;this.curMin=t;this.curHour=i;if(this.pTitle)this.pTitle.innerHTML=this.Hour2Str(i,this.config.AmPmMode)+":"+this.Int2Str(t);this.SetTimeAn(i,t);if(!e)this.SetTimeDig(i,t);if(this.bInline)this.Submit()},SetTimeAnH:function(i,t){if(i==0){if(this.curHour<12&&this.curHour>6)this.deltaHour=12;if(this.curHour<24&&this.curHour>18)this.deltaHour=0}if(this.curHour==0&&i==11){i=23;this.deltaHour=12}else if(this.curHour==12&&i==11){i=11;this.deltaHour=0}else{i+=this.deltaHour}this.SetTime(i,t,false,true)},SetTimeAnM:function(i,t){t=parseInt(t,10);var e=this.config.step;if(Math.round(t/e)!=t/e)t=Math.round(t/e)*e;if(t<0||t>59)t=0;if(t==30){this.bJumpByMinArrow30=true}else if(this.bJumpByMinArrow30&&t==0){if(this.curMin>30&&this.curMin<59){this.bJumpByMinArrow30=false;this.SetTime(++i,t);return}if(this.curMin>0&&this.curMin<30){this.bJumpByMinArrow30=false;if(i==0)i=24;this.SetTime(--i,t);return}}this.SetTime(i,t)},SetTimeAn:function(i,t){i=parseInt(i,10);if(isNaN(i))i=0;t=parseInt(t,10);if(isNaN(t))t=0;if(i>=12)i-=12;var e="bxc-arrows-cont";if(i*5==t)e+=" hideh hm"+i;else e+=" h"+i+" m"+t;this.arrowsContDiv.className=e},CreateSelect:function(i,t,e){var n=!!this.config.AmPmMode;var o=BX.create("INPUT",{props:{type:"text",className:"bxc-cus-sel",size:"1",title:e}});var s=function(i){o._bxmousedown=false;if(window.bxinterval)clearTimeout(window.bxinterval)};var r=function(t){if(!o._bxmousedown){s();return}var e=parseInt(o.value,10);if(isNaN(e))e=0;e=e+t;if(e>=i.length)e=0;else if(e<0)e=i.length-1;if(typeof i[e]=="undefined"){e-=t;o.value=e-(t>0?1:-1);r(t);return}else{if(o.value=="11"&&i[e]=="00"||o.value=="01"&&i[e]=="00"&&n){o.value="12"}else if(o.value=="12"&&i[e]=="00"){o.value="01"}else o.value=i[e];o.onchange()}if(window.bxinterval)clearTimeout(window.bxinterval);window.bxinterval=setTimeout(function(){r(t)},100)};var h=function(i){if(window.bxinterval)s();o._bxmousedown=true;BX.bind(document,"mouseup",s);r(i);if(window.bxinterval)clearTimeout(window.bxinterval);window.bxinterval=setTimeout(function(){r(i)},800)};o.onkeydown=function(i){if(!i)i=window.event;if(!i)return;if(i.keyCode==38){h(t);s()}else if(i.keyCode==40){h(-t);s()}};var a=BX.create("TABLE",{props:{className:"bxc-cus-sel-tbl"}}),c=a.insertRow(-1),u=c.insertCell(-1);u.rowSpan=2;u.appendChild(o);u=c.insertCell(-1);u.appendChild(BX.create("IMG",{props:{src:"/bitrix/images/1.gif",className:"bxc-slide-up bxc-iconkit-c"}}));u.title=this.MESS.Up;u.className="bxc-pointer";u.onmousedown=function(){h(t)};u=a.insertRow(-1).insertCell(-1);u.appendChild(BX.create("IMG",{props:{src:"/bitrix/images/1.gif",className:"bxc-slide-down bxc-iconkit-c"}}));u.title=this.MESS.Down;u.className="bxc-pointer";u.onmousedown=function(){h(-t)};return{pSelect:o,pWnd:a}},SetTimeDig:function(i,t){this.hourSelect.value=this.Hour2Str(i,this.config.AmPmMode);this.minSelect.value=this.Int2Str(t);if(this.config.AmPmMode){if(this.config.AmPm==" pm"){this.AmPm.title="p.m.";this.AmPm.innerHTML="pm"}else{this.AmPm.title="a.m.";this.AmPm.innerHTML="am"}}if(this.bInline)this.Submit()},InitMouseArrowControl:function(){var i=this;this.MACDiv.onmousedown=function(t){i.MACMouseDown(t)};this.MACDiv.ondrag=BX.False;this.MACDiv.onselectstart=BX.False;this.MACDiv.style.MozUserSelect="none"},MACMouseDown:function(i){if(this.bRecalculateCoordinates)this.CalculateCoordinates();if(!i)i=window.event;var t=this,e,n=BX.GetWindowSize(),o=i.clientX+n.scrollLeft,s=i.clientY+n.scrollTop;this.ddMode=false;e=this.arMinCoords[this.curMin];if(o>e.x_min&&o<e.x_max&&s>e.y_min&&s<e.y_max||o>e.x_min1&&o<e.x_max1&&s>e.y_min1&&s<e.y_max1){this.ddMode="min";this.lastArrow="min"}if(!this.ddMode){e=this.arHourCoords[this.curHour>=12?this.curHour-12:this.curHour];if(o>e.x_min&&o<e.x_max&&s>e.y_min&&s<e.y_max||o>e.x_min1&&o<e.x_max1&&s>e.y_min1&&s<e.y_max1){this.ddMode="hour";this.lastArrow="hour"}}if(this.ddMode===false){var r,h,a=1e3,c=0;if(this.lastArrow=="hour"){for(r=0;r<12;r++){h=this.GetDistance(this.arHourCoords[r].x,this.arHourCoords[r].y,o,s);if(h<=a){a=h;c=r}}this.SetTimeAnH(c,this.curMin)}else if(this.lastArrow=="min"){for(r=0;r<12;r++){h=this.GetDistance(this.arMinCoords[r*5].x,this.arMinCoords[r*5].y,o,s);if(h<=a){a=h;c=r}}this.SetTimeAnM(this.curHour,c*5)}return}this.ControlsCont.style.zIndex="145";this.MACDiv.onmousemove=function(i){t.MACMouseMove(i)};this.MACDiv.onmouseup=function(i){t.MACMouseUp(i)}},MACMouseMove:function(i){if(!this.ddMode){this.StopDD();return}if(!i)i=window.event;var t,e,n=1e3,o=0,s=BX.GetWindowSize(),r=i.clientX+s.scrollLeft,h=i.clientY+s.scrollTop;if(this.ddMode=="hour"){for(t=0;t<12;t++){e=this.GetDistance(this.arHourCoords[t].x,this.arHourCoords[t].y,r,h);if(e<=n){n=e;o=t}}this.SetTimeAnH(o,this.curMin)}else if(this.ddMode=="min"){for(t=0;t<12;t++){e=this.GetDistance(this.arMinCoords[t*5].x,this.arMinCoords[t*5].y,r,h);if(e<=n){n=e;o=t}}this.SetTimeAnM(this.curHour,o*5)}},GetDistance:function(i,t,e,n){return Math.round(Math.sqrt(Math.pow(i-e,2)+Math.pow(t-n,2)))},MACMouseUp:function(i){this.StopDD()},StopDD:function(){this.ddMode=false;this.ControlsCont.style.zIndex="156";this.MACDiv.onmousemove=null;this.MACDiv.onmouseup=null;return false},Int2Str:function(i){i=parseInt(i,10);if(isNaN(i))i=0;return i<10?"0"+i.toString():i.toString()},Hour2Str:function(i,t){i=parseInt(i,10);if(isNaN(i))i=0;return i<10&&!t?"0"+i.toString():i.toString()},CheckClick:function(i){if(this.bRecalculateCoordinates||this.bInline)return;if(!i)i=window.event;if(!i)return;var t;if(i.target)t=i.target;else if(i.srcElement)t=i.srcElement;if(t.nodeType==3)t=t.parentNode;if(t!=this.oDiv&&!BX.findParent(t,{attribute:{id:this.oDiv.id}}))this.Close()},OnKeyDown:function(i){if(!i)i=window.event;if(!i)return;if(i.keyCode==27)this.Close()}};i.options={};i.setOptions=function(t){if(!t||typeof t!="object")return;for(var e in t)i.options[e]=t[e]};i.getOption=function(t,e){if(typeof i.options[t]!="undefined")return i.options[t];else return e};window.JCClock=i})();
//# sourceMappingURL=clock.map.js |
var ToolsetCommon = ToolsetCommon || {};
/**
* Bootstrao Grid module.
*
* Provides a Grid button on selected editors that allows inserting a Bootstrap grid HTML structure.
*
* @since 2.3.3
*/
ToolsetCommon.BootstrapCssComponentsGrids = function( $ ) {
var self = this;
/**
* Init the Bootstrap grid dialog.
*
* @return selc;
*
* @since 2.3.3
*/
self.initDialogs = function() {
if ( ! $( '#js-toolset-bootstrap-grid-dialog-container' ).length ) {
$( 'body' ).append( '<div id="js-toolset-bootstrap-grid-dialog-container" class="toolset-shortcode-gui-dialog-container"></div>' );
}
self.bootstrapGridDialog = $( "#js-toolset-bootstrap-grid-dialog-container" )
.html( Toolset_CssComponent_Grids.dialog.content )
.dialog({
autoOpen: false,
modal: true,
title: Toolset_CssComponent_Grids.dialog.title,
minWidth: 550,
draggable: false,
resizable: false,
position: {
my: "center top+50",
at: "center top",
of: window,
collision: "none"
},
show: {
effect: "blind",
duration: 800
},
create: function( event, ui ) {
},
open: function( event, ui ) {
$( 'body' ).addClass( 'modal-open' );
self.restoreBootstrapGridDialogOptions();
},
close: function( event, ui ) {
$( 'body' ).removeClass( 'modal-open' );
},
buttons: [
{
class: 'button-secondary toolset-shortcode-gui-dialog-button-close',
text: Toolset_CssComponent_Grids.dialog.cancel,
click: function () {
$( this ).dialog( "close" );
}
},
{
class: 'toolset-shortcode-gui-dialog-button-align-right button-primary',
text: Toolset_CssComponent_Grids.dialog.insert,
click: function () {
self.insertBootstrapGrid();
}
}
]
});
return self;
};
/**
* Open the Bootstrap grid dialog.
*
* @since 2.3.3
*/
$( document ).on( 'click', '.js-toolset-bootstrap-grid-in-toolbar', function( e ) {
e.preventDefault();
window.wpcfActiveEditor = $( this ).data( 'editor' );
self.bootstrapGridDialog.dialog( 'open' );
});
/**
* Insert the bootstrap grid into the relevant editor.
*
* @since 2.3.3
*
* @todo Check how to integrate the highlighting in the icl_insert mechanism
*/
self.insertBootstrapGrid = function() {
var $grid = self.getBootstrapGrid();
self.bootstrapGridDialog.dialog( 'close' );
window.icl_editor.insert( $grid );
};
/**
* Restore the bootstrap grid dialog to defaults on close.
*
* @since 2.3.3
*/
self.restoreBootstrapGridDialogOptions = function() {
var $defaultGridType = $( document ).find( 'ul.js-toolset-bootstrap-grid-type figure' ).first(),
$defaultRadio = $defaultGridType.closest( 'li' ).find( 'input[name="grid_type"]' );
$( document )
.find( 'ul.js-toolset-bootstrap-grid-type figure' )
.each( function () {
$( this ).removeClass( 'selected' );
});
$defaultGridType.addClass( 'selected' );
$defaultRadio.trigger( 'click' );
};
/**
* Get the bootstrap grid given the dialog settings.
*
* @return string Grid HTML structure.
*
* @since 2.3.2
*/
self.getBootstrapGrid = function() {
var output = '';
output += '<div class="row">\n';
switch( $( 'input[name="grid_type"]:checked' ).val() ) {
case 'two-even':
output += '\t<div class="col-sm-6">Cell 1</div>\n';
output += '\t<div class="col-sm-6">Cell 2</div>\n';
break;
case 'two-uneven':
output += '\t<div class="col-sm-8">Cell 1</div>\n';
output += '\t<div class="col-sm-4">Cell 2</div>\n';
break;
case 'three-even':
output += '\t<div class="col-sm-4">Cell 1</div>\n';
output += '\t<div class="col-sm-4">Cell 2</div>\n';
output += '\t<div class="col-sm-4">Cell 3</div>\n';
break;
case 'three-uneven':
output += '\t<div class="col-sm-3">Cell 1</div>\n';
output += '\t<div class="col-sm-6">Cell 2</div>\n';
output += '\t<div class="col-sm-3">Cell 3</div>\n';
break;
case 'four-even':
output += '\t<div class="col-sm-3">Cell 1</div>\n';
output += '\t<div class="col-sm-3">Cell 2</div>\n';
output += '\t<div class="col-sm-3">Cell 3</div>\n';
output += '\t<div class="col-sm-3">Cell 4</div>\n';
break;
case 'six-even':
output += '\t<div class="col-sm-2">Cell 1</div>\n';
output += '\t<div class="col-sm-2">Cell 2</div>\n';
output += '\t<div class="col-sm-2">Cell 3</div>\n';
output += '\t<div class="col-sm-2">Cell 4</div>\n';
output += '\t<div class="col-sm-2">Cell 5</div>\n';
output += '\t<div class="col-sm-2">Cell 6</div>\n';
break;
default:
output += '\t<div class="col-sm-6">Cell 1</div>\n';
output += '\t<div class="col-sm-6">Cell 2</div>\n';
}
output += '</div>';
return output;
};
/**
* Manage the Bootstrap dialog options interaction.
*
* @since 2.3.3
*/
$( document ).on( 'click', '.js-toolset-bootstrap-grid-type figure', function( e ) {
var $figure = $( this ),
$radio = $figure.closest( 'li' ).find( 'input[name="grid_type"]' );
$( document )
.find( 'ul.js-toolset-bootstrap-grid-type figure' )
.each( function () {
$( this ).removeClass( 'selected' );
});
$figure.addClass( 'selected' );
$radio.trigger( 'click' );
});
/**
* Add the Bootstrap grid button to selected editors.
*
* @param string The ID of the editor being initialized.
* @return self;
*
* @since 2.3.3
* @since 3.1.0 Avoid guessing the associated toolbar by setting a classname js-toolset-editor-toolbar
* and a data-target attribute with the ID of the editor.
*/
self.maybe_add_editor_button = function( editorId ) {
var editor = $( '#' + editorId ),
button = '<button class="button button-secondary js-toolset-bootstrap-grid-in-toolbar" data-editor="' + editorId + '"><i class="icon-bootstrap-original-logo ont-icon-18"></i>' + Toolset_CssComponent_Grids.button.label + '</button>',
appendGridButtonIfMissing = function( toolbarList, toolbarButton ) {
if ( toolbarList.find( '.js-toolset-bootstrap-grid-in-toolbar' ).length === 0 ) {
toolbarList.append( toolbarButton );
}
},
toolbarListCandidate = $( '.js-toolset-editor-toolbar[data-target="' + editorId + '"]' );
if ( toolbarListCandidate.length > 0 ) {
var toolbarButton = $( button );
appendGridButtonIfMissing( toolbarListCandidate, toolbarButton );
return;
}
switch ( editorId ) {
case 'wpv_filter_meta_html_content':
// Views Filter Editor
var toolbarButton = $( '<li>' + button + '</li>' ),
toolbarList = editor
.closest( '.js-code-editor' )
.find( '.js-code-editor-toolbar > ul.js-wpv-filter-edit-toolbar' );
appendGridButtonIfMissing( toolbarList, toolbarButton );
break;
case 'wpv_layout_meta_html_content':
case 'wpv_content':
// Views Loop Output Editor and Filter and Loop Output Integration Editor
var toolbarButton = $( '<li>' + button + '</li>' ),
toolbarList = editor
.closest( '.js-code-editor' )
.find( '.js-code-editor-toolbar > ul' );
appendGridButtonIfMissing( toolbarList, toolbarButton );
break;
case 'visual-editor-html-editor':
// Layouts visual editor cell HTML
var toolbarButton = $( '<li>' + button + '</li>' ),
toolbarList = editor
.closest( '#js-visual-editor-codemirror' )
.find( '.js-code-editor-toolbar > ul' );
appendGridButtonIfMissing( toolbarList, toolbarButton );
break;
case 'cred_association_form_content':
// Forms association forms editor
// To remove once Forms 2.1 has been released
var toolbarButton = $( button ),
toolbarList = editor
.closest( '#association_form_content' )
.find( '.js-cred-content-editor-toolbar' );
appendGridButtonIfMissing( toolbarList, toolbarButton );
break;
case 'content':
// Forms main editors
// To remove once Forms 2.1 has been released
if (
$( 'body' ).hasClass( 'post-type-cred-form' )
|| $( 'body' ).hasClass( 'post-type-cred-user-form' )
) {
var toolbarButton = $( button ),
toolbarList = editor
.closest( '.wp-editor-wrap' )
.find( '.wp-media-buttons' );
if ( toolbarList.length > 0 ) {
appendGridButtonIfMissing( toolbarList, toolbarButton );
}
}
break;
default:
// Views inline CT editors
// Layouts CT cells editors
if ( editorId.indexOf( 'wpv-ct-inline-editor-' ) === 0 ) {
var toolbarButton = $( '<li>' + button + '</li>' ),
toolbarList = editor
.closest( '.js-wpv-ct-inline-edit' )
.find( '.js-code-editor-toolbar > ul' );
appendGridButtonIfMissing( toolbarList, toolbarButton );
}
break;
}
return self;
};
/**
* Init the Bootstrap grid hooks.
*
* @return self;
*
* @since 2.3.3
*/
self.initHooks = function() {
Toolset.hooks.addAction( 'toolset_text_editor_CodeMirror_init', function( editorId ) {
if ( editorId ) {
self.maybe_add_editor_button( editorId );
}
});
Toolset.hooks.addAction( 'toolset_text_editor_CodeMirror_init_only_buttons', function( editorId ) {
if ( editorId ) {
self.maybe_add_editor_button( editorId );
}
});
return self;
};
/**
* Init this module.
*
* @since 2.3.3
*/
self.init = function() {
self.initDialogs()
.initHooks();
};
self.init();
};
jQuery( document ).ready( function( $ ) {
new ToolsetCommon.BootstrapCssComponentsGrids( $ );
}); |
import numpy as np
from matplotlib import cm
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import open3d as o3d
def plot_pcd(ax, pcd, color=None, cmap='viridis', size=4, alpha=0.9, azim=60, elev=0):
if color is None:
color = pcd[:, 0]
vmin = -2
vmax = 1.5
else:
vmin = 0
vmax = 1
ax.view_init(azim=azim, elev=elev)
ax.scatter(pcd[:, 0], pcd[:, 1], pcd[:, 2], c=color, s=size, cmap=cmap, vmin=vmin, vmax=vmax, alpha=alpha)
lims = np.array([ax.get_xlim3d(), ax.get_ylim3d(), ax.get_zlim3d()])
min_lim = min(pcd.min() * 0.9, lims.min())
max_lim = max(pcd.max() * 0.9, lims.max())
for axis in 'xyz':
getattr(ax, 'set_{}lim'.format(axis))((min_lim, max_lim))
ax.set_axis_off()
def plot_matches(ax, mpts1, mpts2, color=None, cmap='viridis', size=4, alpha=0.9, azim=60, elev=0):
if color is None:
color = np.arange(mpts1.shape[0]) / (mpts1.shape[0] - 1)
if cmap is not None:
cmap = cm.get_cmap(cmap)
color = cmap(color)
ax.view_init(azim=azim, elev=elev)
for k in range(mpts1.shape[0]):
ptp = np.array([mpts1[k], mpts2[k]])
ax.plot(ptp[:, 0], ptp[:, 1], ptp[:, 2], color=color[k], marker='o', markersize=12)
def plot_gmm(ax, mix, mu, cov, color=None, cmap='viridis', azim=60, elev=0, numWires=15, wireframe=True):
if color is None:
color = np.arange(mix.shape[0]) / (mix.shape[0] - 1)
if cmap is not None:
cmap = cm.get_cmap(cmap)
color = cmap(color)
u = np.linspace(0.0, 2.0 * np.pi, numWires)
v = np.linspace(0.0, np.pi, numWires)
X = np.outer(np.cos(u), np.sin(v))
Y = np.outer(np.sin(u), np.sin(v))
Z = np.outer(np.ones_like(u), np.cos(v))
XYZ = np.stack([X.flatten(), Y.flatten(), Z.flatten()])
alpha = mix / mix.max()
ax.view_init(azim=azim, elev=elev)
for k in range(mix.shape[0]):
# find the rotation matrix and radii of the axes
U, s, V = np.linalg.svd(cov[k])
x, y, z = V.T @ (np.sqrt(s)[:, None] * XYZ) + mu[k][:, None]
x = x.reshape(numWires, numWires)
y = y.reshape(numWires, numWires)
z = z.reshape(numWires, numWires)
if wireframe:
ax.plot_wireframe(x, y, z, rstride=1, cstride=1, color=color[k], alpha=alpha[k])
else:
ax.plot_surface(x, y, z, rstride=1, cstride=1, color=color[k], alpha=alpha[k])
def visualize(inputs):
for i in range(len(inputs)):
inputs[i] = inputs[i].detach().cpu().numpy()
p1, gamma1, pi1, mu1, sigma1, p2, gamma2, pi2, mu2, sigma2, \
p1_trans, init_r_err, init_t_err, init_rmse, r_err, t_err, rmse = inputs
fig = plt.figure(figsize=(8, 8))
title = 'Rotation error {:.2f}\nTranslation error {:.4f}\nRMSE {:.4f}'
ax = fig.add_subplot(221, projection='3d')
plot_pcd(ax, p1, cmap='Reds')
plot_pcd(ax, p2, cmap='Blues')
ax.set_title(title.format(init_r_err, init_t_err, init_rmse))
ax = fig.add_subplot(222, projection='3d')
plot_pcd(ax, p1_trans, cmap='Reds')
plot_pcd(ax, p2, cmap='Blues')
ax.set_title(title.format(r_err, t_err, rmse))
ax = fig.add_subplot(223, projection='3d')
color1 = np.argmax(gamma1, axis=1) / (gamma1.shape[1] - 1)
plot_pcd(ax, p1, color1)
plot_gmm(ax, pi1, mu1, sigma1)
ax.set_title('Source GMM')
ax = fig.add_subplot(224, projection='3d')
color2 = np.argmax(gamma2, axis=1) / (gamma2.shape[1] - 1)
plot_pcd(ax, p2, color2)
plot_gmm(ax, pi2, mu2, sigma2)
ax.set_title('Target GMM')
plt.tight_layout()
return fig
def get_pts(pcd):
points = np.asarray(pcd.points)
X = []
Y = []
Z = []
for pt in range(points.shape[0]):
X.append(points[pt][0])
Y.append(points[pt][1])
Z.append(points[pt][2])
return np.asarray(X), np.asarray(Y), np.asarray(Z)
def set_axes_equal(ax):
x_limits = ax.get_xlim3d()
y_limits = ax.get_ylim3d()
z_limits = ax.get_zlim3d()
x_range = abs(x_limits[1] - x_limits[0])
x_middle = np.mean(x_limits)
y_range = abs(y_limits[1] - y_limits[0])
y_middle = np.mean(y_limits)
z_range = abs(z_limits[1] - z_limits[0])
z_middle = np.mean(z_limits)
plot_radius = 0.5*max([x_range, y_range, z_range])
ax.set_xlim3d([x_middle - plot_radius, x_middle + plot_radius])
ax.set_ylim3d([y_middle - plot_radius, y_middle + plot_radius])
ax.set_zlim3d([z_middle - plot_radius, z_middle + plot_radius])
def plot_grid_pcd(points_list, shape = [2,6], save_path = 'visulization', title = None):
plt.subplots_adjust(top=1,bottom=0,left=0,right=1,hspace=0,wspace=0)
plt.margins(0,0)
fig = plt.figure()
fig.tight_layout()
num = shape[0] * shape[1]
for i in range(shape[0]):
for j in range(shape[1]):
num = i * shape[1] + j
points = points_list[num]
ax = fig.add_subplot(shape[0],shape[1],num+1, projection='3d')
ax.set_aspect('equal')
pcd = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(points))
X, Y, Z = get_pts(pcd)
t = Z
ax.scatter(X, Y, Z, c=t, cmap='jet', marker='o', s=0.5, linewidths=0)
ax.grid(False)
ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
set_axes_equal(ax)
plt.axis('off')
plt.title('R_err:{}'.format(title))
plt.savefig(save_path, format='png', dpi=600)
plt.close()
def aligned_plot_grid_pcd(points_a, points_b, a, b, save_path = 'aligned_visulization.png', title = None):
# from IPython import embed
# embed()
fig = plt.figure()
points = points_a
ax = fig.add_subplot(111, projection='3d')
pcda = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(points))
X, Y, Z = get_pts(pcda)
pcda = np.asarray(pcda.points)
t = Z
ax.scatter(X, Y, Z, c=t, cmap='jet', marker='o', s=0.5, linewidths=0)
# ax.grid(False)
# ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
# ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
# ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
# set_axes_equal(ax)
points = points_b
pcdb = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(points))
X, Y, Z = get_pts(pcdb)
pcdb = np.asarray(pcdb.points)
t = Z
X = [i+4 for i in X]
ax.scatter(X, Y, Z, c=t, cmap='jet', marker='o', s=0.5, linewidths=0)
ax.grid(False)
ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
# set_axes_equal(ax)
for u, v in enumerate(zip(a,b)):
i, j = v
X = [pcda[i][0], pcdb[j][0]+4]
Y = [pcda[i][1], pcdb[j][1]]
Z = [pcda[i][2], pcdb[j][2]]
ax.plot(X,Y,Z, c = 'r', linestyle='-', alpha=0.5)
if u > 20:
break
plt.axis('off')
plt.title('Aligned exmaple'.format(title))
plt.savefig(save_path, format='png', dpi=600)
plt.close()
def analyseDis(dis, bin = 25,savename = 'ICP.png'):
dis = np.sqrt((dis * dis).sum(axis = 1))
step = 0.25 / bin
dis = dis / step
dis[dis > bin] = bin
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import FuncFormatter
plt.xlabel('Bins')
plt.ylabel('Probability')
fig= plt.figure(figsize=(8, 4),dpi=100)
n, bins, patches = plt.hist(dis, 50, density=True, facecolor='g', alpha=0.5, label = 'Contrained')
n, bins, patches = plt.hist(dis, 50, density=True, facecolor='r', alpha=0.5, label = 'Sigmoid')
n, bins, patches = plt.hist(dis, 50, density=True, facecolor='b', alpha=0.5, label = 'Sine')
plt.legend()
plt.legend(loc='upper left')
plt.savefig(savename)
return
def getDis(filename):
import h5py
f = h5py.File(filename, 'r')
data = np.array(f['results'][:].astype('float32'))
f.close()
return data[:,:3,3]
def analyseDises(dises, bin = 25,savename = 'DIS.png'):
for i, dis in enumerate(dises):
dis = np.sqrt((dis * dis).sum(axis = 1))
step = 0.25 / bin
dis = dis / step
dis[dis > bin] = bin
dises[i] = dis
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import FuncFormatter
fig= plt.figure(figsize=(8, 4),dpi=100)
plt.xlabel('Bins')
plt.ylabel('Probability')
n, bins, patches = plt.hist(dises[0], 50, density=True, facecolor='g', alpha=0.5, label = 'Uncontrained')
n, bins, patches = plt.hist(dises[1], 50, density=True, facecolor='r', alpha=0.5, label = 'Sigmoid')
n, bins, patches = plt.hist(dises[2], 50, density=True, facecolor='b', alpha=0.5, label = 'Sine')
plt.legend()
#plt.legend(loc='upper left')
plt.savefig(savename)
# from IPython import embed
# embed()
return
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2016 DeNA Co., Ltd.
*
* 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.
*/
/// <reference path="base.js"/>
/// <reference path="event_dispatcher.js"/>
/// <reference path="tick_event.js"/>
/// <reference path="tick_listener.js"/>
/// <reference path="user_agent.js"/>
/**
* A singleton class that provides a tick.
* @extends {createjs.EventDispatcher}
* @constructor
*/
createjs.Ticker = function() {
createjs.EventDispatcher.call(this);
};
createjs.inherits('Ticker', createjs.Ticker, createjs.EventDispatcher);
/**
* The global instance of the createjs.Ticker object.
* @type {createjs.Ticker}
* @private
*/
createjs.Ticker.instance_ = null;
/**
* Represents the mode that the Ticker object uses the requestAnimationFrame API
* with synchronization to the target frame-rate.
* @const {string}
*/
createjs.Ticker.RAF_SYNCHED = 'synched';
/**
* Represents the mode that the Ticker object uses the requestAnimationFrame API
* without synchronization to the target frame-rate.
* @const {string}
*/
createjs.Ticker.RAF = 'raf';
/**
* The mode representing the Ticker object uses the setTimeout API.
* @const {string}
*/
createjs.Ticker.TIMEOUT = 'timeout';
/**
* The mode representing the Ticker object chooses the best API for it.
* @const {string}
*/
createjs.Ticker.AUTO = 'auto';
/**
* The requestAnimationFrame() method used by the createjs.Ticker object.
* @const {Function}
*/
createjs.Ticker.requestAnimationFrame =
createjs.global['requestAnimationFrame'] ||
createjs.global['webkitRequestAnimationFrame'];
/**
* The cancelAnimationFrame() method used by the createjs.Ticker object.
* @const {Function}
*/
createjs.Ticker.cancelAnimationFrame =
createjs.global['cancelAnimationFrame'] ||
createjs.global['webkitCancelAnimationFrame'];
/**
* The maximum number of times to measure animation intervals.
* @const {number}
*/
createjs.Ticker.RETRY = 10;
/**
* Whether this ticker is not running now.
* @type {boolean}
* @protected
*/
createjs.Ticker.prototype.paused_ = false;
/**
* Whether this ticker has been initialized. (This does not mean the ticker is
* currently running or not.)
* @type {boolean}
* @protected
*/
createjs.Ticker.prototype.initialized_ = false;
/**
* The time when this ticker starts dispatching tick events.
* @type {number}
* @protected
*/
createjs.Ticker.prototype.startTime_ = 0;
/**
* The total period of time that this ticker stops dispatching tick events.
* @type {number}
* @protected
*/
createjs.Ticker.prototype.pausedTime_ = 0;
/**
* The interrupt interval for calling the 'tick_()' method repeatedly in
* milliseconds.
* @type {number}
* @protected
*/
createjs.Ticker.prototype.interval_ = 50;
/**
* The last time when this ticker has dispatched tick events.
* @type {number}
* @protected
*/
createjs.Ticker.prototype.lastTime_ = 0;
/**
* The list of times when this ticker has dispatched tick events.
* @type {createjs.Ticker.PerformanceCounter}
* @protected
*/
createjs.Ticker.prototype.times_ = null;
/**
* Stores the timeout or requestAnimationFrame id.
* @type {number}
* @protected
*/
createjs.Ticker.prototype.timerId_ = 0;
/**
* True if currently using requestAnimationFrame, false if using setTimeout.
* @type {boolean}
* @protected
*/
createjs.Ticker.prototype.useRAF_ = false;
/**
* The listeners which listens tick events. This ticker adds createjs.Stage
* objects and createjs.Tween objects to update them without dispatching 'tick'
* events. (There is some overhead for the createjs.EventDispatcher class to
* dispatch a 'tick' event.)
* @type {createjs.Ticker.ListenerList}
* @private
*/
createjs.Ticker.prototype.tickListeners_ = null;
/**
* The 'tick' event used by this ticker.
* @type {createjs.TickEvent}
* @private
*/
createjs.Ticker.prototype.tickEvent_ = null;
/**
* The remaining number of times to measure animation intervals.
* @type {number}
* @private
*/
createjs.Ticker.prototype.retry_ = createjs.Ticker.RETRY;
/**
* The timestamp used in measuring the interval of the requestAnimationFrame()
* API.
* @type {number}
* @private
*/
createjs.Ticker.prototype.timestamp_ = 0;
/**
* The inner class that encapsulates a list of createjs.TickListener objects.
* @param {createjs.TickListener} listener
* @constructor
*/
createjs.Ticker.ListenerList = function(listener) {
/// <param type="createjs.TickListener" name="listener"/>
/**
* The listeners added to this list.
* @type {Array.<createjs.TickListener>}
* @private
*/
this.listeners_ = [listener];
/**
* The clone of the listener list. This clone is used for adding listeners and
* for removing them while a ticker is dispatching a 'tick' event to the
* listeners in this list.
* @type {Array.<createjs.TickListener>}
* @private
*/
this.clone_ = null;
/**
* Whether this list is locked.
* @type {boolean}
* @private
*/
this.locked_ = false;
};
/**
* Retrieves the editable items of this list.
* @return {Array.<createjs.TickListener>}
* @private
* @const
*/
createjs.Ticker.ListenerList.prototype.getListeners_ = function() {
/// <returns type="Array" elementType="createjs.TickListener"/>
if (!this.locked_) {
return this.listeners_;
}
if (!this.clone_) {
this.clone_ = this.listeners_.slice();
}
return this.clone_;
};
/**
* Locks this list for iteration.
* @return {Array.<createjs.TickListener>}
* @private
* @const
*/
createjs.Ticker.ListenerList.prototype.lock_ = function() {
/// <returns type="Array" elementType="createjs.TickListener"/>
this.locked_ = true;
return this.listeners_;
};
/**
* Unlocks this list.
* @private
* @const
*/
createjs.Ticker.ListenerList.prototype.unlock_ = function() {
this.locked_ = false;
if (this.clone_) {
this.listeners_ = this.clone_;
this.clone_ = null;
}
};
/**
* Removes all listeners from this list.
* @private
* @const
*/
createjs.Ticker.ListenerList.prototype.removeAllListeners_ = function() {
if (!this.locked_) {
this.listeners_ = [];
} else {
this.clone_ = [];
}
};
/**
* A class that calculates the performance of CreateJS-Lite. This class collects
* timestamps (used by the global ticker) and calculates FPS values.
* @constructor
*/
createjs.Ticker.PerformanceCounter = function() {
/**
* The current index to the ring buffer.
* @type {number}
*/
this.offset_ = 0;
/**
* The ring buffer that stores timestamps.
* @type {Float64Array}
*/
this.values_ = new Float64Array(64);
};
/**
* The size of the ring buffer. (This size must be a power of two.)
* @const {number}
* @private
*/
createjs.Ticker.PerformanceCounter.SIZE = 64;
/**
* The bit-mask that maps an index to an ring-buffer index.
* @const {number}
* @private
*/
createjs.Ticker.PerformanceCounter.MASK =
createjs.Ticker.PerformanceCounter.SIZE - 1;
/**
* Adds a value to this object.
* @param {number} value
* @const
*/
createjs.Ticker.PerformanceCounter.prototype.addValue = function(value) {
/// <param type="number" name="value"/>
var offset = this.offset_ & createjs.Ticker.PerformanceCounter.MASK;
this.values_[offset] = value;
++this.offset_;
};
/**
* Returns the average of the values stored in this object.
* @return {number}
* @const
*/
createjs.Ticker.PerformanceCounter.prototype.getAverage = function() {
/// <returns type="number"/>
if (!this.offset_) {
return 0;
}
var total = 0;
var size = createjs.min(this.offset_,
createjs.Ticker.PerformanceCounter.SIZE);
for (var i = 0; i < size; ++i) {
total += this.values_[i]
}
return total / size;
};
/**
* Returns the frames per second.
* @return {number}
* @const
*/
createjs.Ticker.PerformanceCounter.prototype.getFPS = function() {
/// <returns type="number"/>
var size = createjs.min(this.offset_,
createjs.Ticker.PerformanceCounter.SIZE);
var head = (this.offset_ - size) & createjs.Ticker.PerformanceCounter.MASK;
var tail = (this.offset_ - 1) & createjs.Ticker.PerformanceCounter.MASK;
return 1000 * size / (this.values_[tail] - this.values_[head]);
};
/**
* Returns the instance of the createjs.Ticker object.
* @return {createjs.Ticker}
*/
createjs.Ticker.getInstance_ = function() {
/// <returns type="createjs.Ticker"/>
if (!createjs.Ticker.instance_) {
createjs.Ticker.instance_ = new createjs.Ticker();
}
return createjs.Ticker.instance_;
};
/**
* Returns the instance of the createjs.Ticker object.
* @param {number} delta
* @param {boolean} paused
* @param {number} time
* @param {number} runTime
* @return {createjs.TickEvent}
*/
createjs.Ticker.getEvent_ = function(delta, paused, time, runTime) {
/// <param type="number" name="delta"/>
/// <param type="boolean" name="paused"/>
/// <param type="number" name="time"/>
/// <param type="number" name="runTime"/>
/// <returns type="createjs.TickEvent"/>
var ticker = createjs.Ticker.getInstance_();
if (!ticker.tickEvent_) {
ticker.tickEvent_ = new createjs.TickEvent(
'tick', false, false, delta, paused, time, runTime);
} else {
ticker.tickEvent_.reset(delta, paused, time, runTime);
}
return ticker.tickEvent_;
};
/**
* Called when the browser sends a system tick event. This method is called
* either by a requestAnimationFrame() callback or by a setTimeout() callback.
* @param {number} timestamp
* @private
*/
createjs.Ticker.tick_ = function(timestamp) {
/// <param type="number" name="timestamp"/>
// Initialize the ticker timers lazily. Chrome does not use a monotonic timer
// to generate timestamps provided to requestAnimationFrame() callbacks, i.e.
// this timestamp value is incomparable with other timestamp values on Chrome.
var ticker = createjs.Ticker.getInstance_();
if (!ticker.startTime_) {
ticker.startTime_ = timestamp;
ticker.lastTime_ = timestamp;
}
var elapsedTime = timestamp - ticker.lastTime_;
var paused = ticker.paused_;
if (paused) {
ticker.pausedTime_ += elapsedTime;
} else {
var time = timestamp - ticker.startTime_;
var runTime = time - ticker.pausedTime_;
var tickListeners = ticker.tickListeners_;
if (tickListeners) {
var listeners = ticker.tickListeners_.lock_();
var length = listeners.length;
for (var i = 0; i < length; ++i) {
var listener = listeners[i];
listener.handleTick(runTime);
}
tickListeners.unlock_();
}
if (ticker.hasListener('tick')) {
var event = createjs.Ticker.getEvent_(elapsedTime, paused, time, runTime);
ticker.dispatchRawEvent(event);
}
}
// Update the ticker time when we finish updating all listeners. (Tweens use
// this value to update themselves, i.e. this ticker must update this value
// after it updates all its listeners.)
ticker.lastTime_ = timestamp;
if (!ticker.times_) {
ticker.times_ = new createjs.Ticker.PerformanceCounter();
}
ticker.times_.addValue(timestamp);
};
/**
* A callback function for the window.requestAnimationFrame() method. This
* function sends a tick event only when it takes at least |ticker.internal_|
* milliseconds since the last time when it sends the event.
* @param {number} timestamp
* @private
*/
createjs.Ticker.handleSynchronizedRAF_ = function(timestamp) {
/// <param type="number" name="timestamp"/>
var ticker = createjs.Ticker.getInstance_();
ticker.timerId_ = createjs.Ticker.requestAnimationFrame.call(
createjs.global, createjs.Ticker.handleSynchronizedRAF_);
var elapsed = timestamp - ticker.lastTime_;
// Some browsers truncates the given timestamp to ms (e.g. 33.3 ms -> 33 ms)
// and it prevents calling the 'tick_()' method at its expected frequency if
// the interval is not an integer. To work around such truncated timestamps,
// this method compares with 'ticker.interval_ - 1' instead of comparing with
// 'ticker.interval_'.
if (elapsed >= ticker.interval_ - 1) {
createjs.Ticker.tick_(timestamp);
}
};
/**
* A callback function for the window.setInterval() method.
* @private
*/
createjs.Ticker.handleInterval_ = function() {
var ticker = createjs.Ticker.getInstance_();
var timestamp = Date.now();
createjs.Ticker.tick_(timestamp);
};
/**
* Stops the global ticker.
* @param {createjs.Ticker} ticker
* @private
*/
createjs.Ticker.stopTick_ = function(ticker) {
/// <param type="createjs.Ticker" name="ticker"/>
if (ticker.timerId_) {
if (ticker.useRAF_) {
if (createjs.Ticker.cancelAnimationFrame) {
createjs.Ticker.cancelAnimationFrame.call(
createjs.global, ticker.timerId_);
}
} else {
createjs.global.clearInterval(ticker.timerId_);
}
ticker.timerId_ = 0;
}
};
/**
* Starts the global ticker.
* @private
*/
createjs.Ticker.setupTick_ = function() {
var ticker = createjs.Ticker.getInstance_();
createjs.Ticker.stopTick_(ticker);
// There are lots of browser issues and it is not so trivial to choose a tick
// method for a game to render its frames at 60 fps as listed in the following
// table.
// +---------+------------------------+---------+---------+
// | Browser | OS | timeout | synched |
// +---------+------------------------+---------+---------+
// | WebView | Android 4.0 or 4.1 | OK | N/A |
// | | Android 4.2 | (3) | OK |
// | | Android 4.3 | OK | OK |
// | | Android 4.4 or later | OK | (1) |
// +---------+------------------------+---------+---------+
// | Chrome | Android | OK | (1) |
// | | Win | (2) | OK |
// | | Mac | (2) | OK |
// +---------+------------------------+---------+---------+
// | Safari | iOS | OK | OK |
// | | Mac | OK | OK |
// +---------+------------------------+---------+---------+
// | IE11 | Win | OK | OK |
// +---------+------------------------+---------+---------+
// | Edge | Win | OK | OK |
// +---------+------------------------+---------+---------+
// (1) The requestAnimationFrame() method does not guarantee calling its
// callbacks at 60 fps.
// (2) Chrome skips frames rendered by setInterval() callbacks
// <http://crbug.com/436021>.
// (3) An eval() call clears setInterval() callbacks on Android 4.2
// <http://stackoverflow.com/questions/17617608>.
var mode = /** @type {string} */ (createjs.Ticker.exports['timingMode']);
if (mode != createjs.Ticker.TIMEOUT) {
if (createjs.Ticker.requestAnimationFrame) {
var callback = createjs.Ticker.handleSynchronizedRAF_;
ticker.timerId_ =
createjs.Ticker.requestAnimationFrame.call(createjs.global, callback);
ticker.useRAF_ = true;
return;
}
}
ticker.useRAF_ = false;
ticker.timerId_ = createjs.global.setInterval(
createjs.Ticker.handleInterval_,
ticker.interval_);
};
/**
* Stops the global ticker and removes all listeners.
* @param {boolean=} opt_destroy
*/
createjs.Ticker.reset = function(opt_destroy) {
/// <param type="boolean" optional="true" name="opt_destroy"/>
var ticker = createjs.Ticker.getInstance_();
ticker.removeAllListeners();
ticker.tickListeners_ = null;
if (opt_destroy) {
createjs.Ticker.stopTick_(ticker);
}
};
/**
* Kicks the global ticker. This method explicitly calls the setInterval()
* callback added by the ticker if it uses the setInterval() method. (This is a
* workaround for Android Chrome, which does not call setInterval() callbacks
* while it dispatches touch events.)
*/
createjs.Ticker.kick = function() {
var ticker = createjs.Ticker.getInstance_();
if (!ticker.useRAF_ && ticker.timerId_) {
var timestamp = Date.now();
var elapsed = timestamp - ticker.lastTime_;
if (elapsed >= ticker.interval_ - 1) {
createjs.Ticker.tick_(timestamp);
}
}
};
/**
* Sets the tick interval (in milliseconds).
* @param {number} interval
*/
createjs.Ticker.setInterval = function(interval) {
/// <param type="number" name="value"/>
var ticker = createjs.Ticker.getInstance_();
ticker.interval_ = interval;
if (ticker.initialized_) {
createjs.Ticker.setupTick_();
}
};
/**
* Returns the current tick interval.
* @return {number}
*/
createjs.Ticker.getInterval = function() {
/// <returns type="number"/>
var ticker = createjs.Ticker.getInstance_();
return ticker.interval_;
};
/**
* Sets the target frame-rate in frames per second (FPS).
* @param {number} value
* @param {boolean=} opt_noClip
*/
createjs.Ticker.setFPS = function(value, opt_noClip) {
/// <param type="number" name="value"/>
/// <param type="number" optional="true" name="opt_noClip"/>
// Round up the input FPS so it becomes a divisor of 60.
value = 60 / createjs.truncate(60 / value);
createjs.Ticker.setInterval(createjs.truncate(1000 / value));
};
/**
* Returns the target frame-rate in frames per second (FPS).
* @return {number}
*/
createjs.Ticker.getFPS = function() {
/// <returns type="number"/>
var ticker = createjs.Ticker.getInstance_();
return 1000 / ticker.interval_;
};
/**
* Returns the time elapsed since the last tick in frames.
* @return {number}
*/
createjs.Ticker.getFrames = function() {
/// <returns type="number"/>
return 1;
};
/**
* Returns the average time spent within a tick.
* @param {number=} opt_ticks
* @return {number}
*/
createjs.Ticker.getMeasuredTickTime = function(opt_ticks) {
/// <param type="number" optional="true" name="opt_ticks"/>
/// <returns type="number"/>
return 0;
};
/**
* Returns the actual frames per second.
* @param {number=} opt_ticks
* @return {number}
*/
createjs.Ticker.getMeasuredFPS = function(opt_ticks) {
/// <param type="number" optional="true" name="opt_ticks"/>
/// <returns type="number"/>
var ticker = createjs.Ticker.getInstance_();
if (!ticker.times_) {
return 0;
}
return ticker.times_.getFPS();
};
/**
* Starts the Ticker object or stops it.
* @param {boolean} value
*/
createjs.Ticker.setPaused = function(value) {
/// <param type="boolean" name="value"/>
var ticker = createjs.Ticker.getInstance_();
ticker.paused_ = value;
};
/**
* Returns whether the Ticker object is paused.
* @return {boolean}
*/
createjs.Ticker.getPaused = function() {
/// <returns type="boolean"/>
var ticker = createjs.Ticker.getInstance_();
return ticker.paused_;
};
/**
* Returns the last time when this object dispatches a tick event.
* @return {number}
*/
createjs.Ticker.getRunTime = function() {
/// <returns type="number"/>
var ticker = createjs.Ticker.getInstance_();
return ticker.lastTime_ - ticker.startTime_ - ticker.pausedTime_;
};
/**
* Returns the last tick time.
* @param {boolean=} opt_runTime
* @returns {number}
*/
createjs.Ticker.getEventTime = function(opt_runTime) {
/// <param type="boolean" optional="true" name="opt_runTime"/>
/// <returns type="number"/>
var ticker = createjs.Ticker.getInstance_();
var time = ticker.lastTime_;
if (!!opt_runTime) {
time -= ticker.pausedTime_;
}
return time;
};
/**
* Returns the number of ticks that have been broadcast by Ticker.
* @param {boolean} pauseable
* @return {number}
*/
createjs.Ticker.getTicks = function(pauseable) {
/// <param type="boolean" name="pausable"/>
/// <returns type="number"/>
return 0;
};
/**
* Adds an event listener.
* @param {string} type
* @param {Function|Object} listener
* @param {boolean=} opt_useCapture
* @return {Function|Object}
*/
createjs.Ticker.addListener = function(type, listener, opt_useCapture) {
/// <param type="string" name="type"/>
/// <param type="Function" name="listener"/>
/// <param type="boolean" optional="true" name="opt_useCapture"/>
/// <returns type="Function"/>
createjs.assert(type == 'tick');
var ticker = createjs.Ticker.getInstance_();
if (!ticker.initialized_) {
ticker.initialized_ = true;
createjs.Ticker.setupTick_();
}
if (listener.handleTick) {
var listeners = ticker.tickListeners_;
if (!listeners) {
ticker.tickListeners_ = new createjs.Ticker.ListenerList(
/** @type {createjs.TickListener} */ (listener));
} else {
var list = listeners.getListeners_();
for (var i = list.length - 1; i >= 0; --i) {
if (list[i] === listener) {
return listener;
}
}
list.push(listener);
}
return listener;
}
return ticker.on(type, listener);
};
/**
* Removes the specified event listener.
* @param {string} type
* @param {Function|Object} listener
* @param {boolean=} opt_useCapture
*/
createjs.Ticker.removeListener = function(type, listener, opt_useCapture) {
/// <param type="string" name="type"/>
/// <param type="Function" name="listener"/>
/// <param type="boolean" optional="true" name="opt_useCapture"/>
createjs.assert(type == 'tick');
if (!listener) {
return;
}
var ticker = createjs.Ticker.getInstance_();
if (listener.handleTick) {
var listeners = ticker.tickListeners_;
if (listeners) {
var list = listeners.getListeners_();
for (var i = list.length - 1; i >= 0; --i) {
if (list[i] === listener) {
list.splice(i, 1);
return;
}
}
}
return;
}
ticker.off(type, listener);
};
/**
* Removes all listeners for the specified type, or all listeners of all types.
* @param {string=} opt_type
*/
createjs.Ticker.removeAllListeners = function(opt_type) {
/// <param type="string" optional="true" name="type"/>
createjs.assert(opt_type == null || opt_type == 'tick');
var ticker = createjs.Ticker.getInstance_();
var listeners = ticker.tickListeners_;
if (listeners) {
listeners.removeAllListeners_();
}
ticker.removeAllListeners(opt_type || '');
};
/**
* Dispatches the specified event to all listeners.
* @param {Object|string|Event} event
* @param {Object=} opt_target
* @return {boolean}
*/
createjs.Ticker.dispatch = function(event, opt_target) {
/// <param name="event"/>
/// <param type="Object" optional="true" name="opt_target"/>
/// <returns type="boolean"/>
var ticker = createjs.Ticker.getInstance_();
return ticker.dispatch(event, opt_target || null);
};
/**
* Returns whether there is at least one listener for the specified event type.
* @param {string} type
* @return {boolean}
*/
createjs.Ticker.hasListener = function(type) {
/// <param name="event"/>
/// <returns type="boolean"/>
createjs.assert(type == 'tick');
var ticker = createjs.Ticker.getInstance_();
return ticker.hasListener(type);
};
/**
* A table of exported functions.
* @type {Object.<string,Function|string>}
* @const
*/
createjs.Ticker.exports = createjs.exportStatic('createjs.Ticker', {
'reset': createjs.Ticker.reset,
'setInterval': createjs.Ticker.setInterval,
'getInterval': createjs.Ticker.getInterval,
'setFPS': createjs.Ticker.setFPS,
'getFPS': createjs.Ticker.getFPS,
'getMeasuredTickTime': createjs.Ticker.getMeasuredTickTime,
'getMeasuredFPS': createjs.Ticker.getMeasuredFPS,
'setPaused': createjs.Ticker.setPaused,
'getPaused': createjs.Ticker.getPaused,
'getTime': createjs.Ticker.getEventTime,
'getEventTime': createjs.Ticker.getEventTime,
'getTicks': createjs.Ticker.getTicks,
'addEventListener': createjs.Ticker.addListener,
'removeEventListener': createjs.Ticker.removeListener,
'removeAllEventListeners': createjs.Ticker.removeAllListeners,
'dispatchEvent': createjs.Ticker.dispatch,
'hasEventListener': createjs.Ticker.hasListener,
'timingMode': createjs.Ticker.RAF_SYNCHED
});
|
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2008 Google, Inc. All Rights Reserved
/**
* @fileoverview Wrapper around {@link goog.ui.Dialog}, to provide
* dialogs that are smarter about interacting with a rich text editor.
*
*/
goog.provide('goog.ui.editor.AbstractDialog');
goog.provide('goog.ui.editor.AbstractDialog.Builder');
goog.provide('goog.ui.editor.AbstractDialog.EventType');
goog.require('goog.dom');
goog.require('goog.dom.classes');
goog.require('goog.events.EventTarget');
goog.require('goog.ui.Dialog');
goog.require('goog.ui.Dialog.ButtonSet');
goog.require('goog.ui.Dialog.DefaultButtonKeys');
goog.require('goog.ui.Dialog.Event');
goog.require('goog.ui.Dialog.EventType');
// *** Public interface ***************************************************** //
/**
* Creates an object that represents a dialog box.
* @param {goog.dom.DomHelper} domHelper DomHelper to be used to create the
* dialog's dom structure.
* @constructor
* @extends {goog.events.EventTarget}
*/
goog.ui.editor.AbstractDialog = function(domHelper) {
goog.events.EventTarget.call(this);
this.dom = domHelper;
};
goog.inherits(goog.ui.editor.AbstractDialog, goog.events.EventTarget);
/**
* Causes the dialog box to appear, centered on the screen. Lazily creates the
* dialog if needed.
*/
goog.ui.editor.AbstractDialog.prototype.show = function() {
// Lazily create the wrapped dialog to be shown.
if (!this.dialogInternal_) {
this.dialogInternal_ = this.createDialogControl();
this.dialogInternal_.addEventListener(goog.ui.Dialog.EventType.AFTER_HIDE,
this.handleAfterHide_, false, this);
}
this.dialogInternal_.setVisible(true);
};
/**
* Hides the dialog, causing AFTER_HIDE to fire.
*/
goog.ui.editor.AbstractDialog.prototype.hide = function() {
if (this.dialogInternal_) {
// This eventually fires the wrapped dialog's AFTER_HIDE event, calling our
// handleAfterHide_().
this.dialogInternal_.setVisible(false);
}
};
/**
* @return {boolean} Whether the dialog is open.
*/
goog.ui.editor.AbstractDialog.prototype.isOpen = function() {
return !!this.dialogInternal_ && this.dialogInternal_.isVisible();
};
/**
* Runs the handler registered on the OK button event and closes the dialog if
* that handler succeeds.
* This is useful in cases such as double-clicking an item in the dialog is
* equivalent to selecting it and clicking the default button.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.processOkAndClose = function() {
// Fake an OK event from the wrapped dialog control.
var evt = new goog.ui.Dialog.Event(goog.ui.Dialog.DefaultButtonKeys.OK, null);
if (this.handleOk(evt)) {
// handleOk calls dispatchEvent, so if any listener calls preventDefault it
// will return false and we won't hide the dialog.
this.hide();
}
};
// *** Dialog events ******************************************************** //
/**
* Event type constants for events the dialog fires.
* @enum {string}
*/
goog.ui.editor.AbstractDialog.EventType = {
// This event is fired after the dialog is hidden, no matter if it was closed
// via OK or Cancel or is being disposed without being hidden first.
AFTER_HIDE: 'afterhide',
// Either the cancel or OK events can be canceled via preventDefault or by
// returning false from their handlers to stop the dialog from closing.
CANCEL: 'cancel',
OK: 'ok'
};
// *** Inner helper class *************************************************** //
/**
* A builder class for the dialog control. All methods except build return this.
* @param {goog.ui.editor.AbstractDialog} editorDialog Editor dialog object
* that will wrap the wrapped dialog object this builder will create.
* @constructor
*/
goog.ui.editor.AbstractDialog.Builder = function(editorDialog) {
// We require the editor dialog to be passed in so that the builder can set up
// ok/cancel listeners by default, making it easier for most dialogs.
this.editorDialog_ = editorDialog;
this.wrappedDialog_ = new goog.ui.Dialog('', true, this.editorDialog_.dom);
this.buttonSet_ = new goog.ui.Dialog.ButtonSet(this.editorDialog_.dom);
this.buttonHandlers_ = {};
this.addClassName(goog.getCssName('tr-dialog'));
};
/**
* Sets the title of the dialog.
* @param {string} title Title HTML (escaped).
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.setTitle = function(title) {
this.wrappedDialog_.setTitle(title);
return this;
};
/**
* Adds an OK button to the dialog. Clicking this button will cause {@link
* handleOk} to run, subsequently dispatching an OK event.
* @param {string} opt_label The caption for the button, if not "OK".
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.addOkButton =
function(opt_label) {
var key = goog.ui.Dialog.DefaultButtonKeys.OK;
/** @desc Label for an OK button in an editor dialog. */
var MSG_EDITOR_DIALOG_OK = goog.getMsg('OK');
// True means this is the default/OK button.
this.buttonSet_.set(key, opt_label || MSG_EDITOR_DIALOG_OK, true);
this.buttonHandlers_[key] = goog.bind(this.editorDialog_.handleOk,
this.editorDialog_);
return this;
};
/**
* Adds a Cancel button to the dialog. Clicking this button will cause {@link
* handleCancel} to run, subsequently dispatching a CANCEL event.
* @param {string} opt_label The caption for the button, if not "Cancel".
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.addCancelButton =
function(opt_label) {
var key = goog.ui.Dialog.DefaultButtonKeys.CANCEL;
/** @desc Label for a cancel button in an editor dialog. */
var MSG_EDITOR_DIALOG_CANCEL = goog.getMsg('Cancel');
// False means it's not the OK button, true means it's the Cancel button.
this.buttonSet_.set(key, opt_label || MSG_EDITOR_DIALOG_CANCEL, false, true);
this.buttonHandlers_[key] = goog.bind(this.editorDialog_.handleCancel,
this.editorDialog_);
return this;
};
/**
* Adds a custom button to the dialog.
* @param {string} label The caption for the button.
* @param {function(goog.ui.Dialog.EventType):*} handler Function called when
* the button is clicked. It is recommended that this function be a method
* in the concrete subclass of AbstractDialog using this Builder, and that
* it dispatch an event (see {@link handleOk}).
* @param {string} opt_buttonId Identifier to be used to access the button when
* calling AbstractDialog.getButtonElement().
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.addButton =
function(label, handler, opt_buttonId) {
// We don't care what the key is, just that we can match the button with the
// handler function later.
var key = opt_buttonId || goog.string.createUniqueString();
this.buttonSet_.set(key, label);
this.buttonHandlers_[key] = handler;
return this;
};
/**
* Puts a CSS class on the dialog's main element.
* @param {string} className The class to add.
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.addClassName =
function(className) {
goog.dom.classes.add(this.wrappedDialog_.getDialogElement(), className);
return this;
};
/**
* Sets the content element of the dialog.
* @param {Element} contentElem An element for the main body.
* @return {goog.ui.editor.AbstractDialog.Builder} This.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.setContent =
function(contentElem) {
goog.dom.appendChild(this.wrappedDialog_.getContentElement(), contentElem);
return this;
};
/**
* Builds the wrapped dialog control. May only be called once, after which
* no more methods may be called on this builder.
* @return {goog.ui.Dialog} The wrapped dialog control.
*/
goog.ui.editor.AbstractDialog.Builder.prototype.build = function() {
if (this.buttonSet_.isEmpty()) {
// If caller didn't set any buttons, add an OK and Cancel button by default.
this.addOkButton();
this.addCancelButton();
}
this.wrappedDialog_.setButtonSet(this.buttonSet_);
var handlers = this.buttonHandlers_;
this.buttonHandlers_ = null;
this.wrappedDialog_.addEventListener(goog.ui.Dialog.EventType.SELECT,
// Listen for the SELECT event, which means a button was clicked, and
// call the handler associated with that button via the key property.
function(e) {
if (handlers[e.key]) {
return handlers[e.key](e);
}
});
// All editor dialogs are modal.
this.wrappedDialog_.setModal(true);
var dialog = this.wrappedDialog_;
this.wrappedDialog_ = null;
return dialog;
};
/**
* Editor dialog that will wrap the wrapped dialog this builder will create.
* @type {goog.ui.editor.AbstractDialog}
* @private
*/
goog.ui.editor.AbstractDialog.Builder.prototype.editorDialog_;
/**
* wrapped dialog control being built by this builder.
* @type {goog.ui.Dialog}
* @private
*/
goog.ui.editor.AbstractDialog.Builder.prototype.wrappedDialog_;
/**
* Set of buttons to be added to the wrapped dialog control.
* @type {goog.ui.Dialog.ButtonSet}
* @private
*/
goog.ui.editor.AbstractDialog.Builder.prototype.buttonSet_;
/**
* Map from keys that will be returned in the wrapped dialog SELECT events to
* handler functions to be called to handle those events.
* @type {Object}
* @private
*/
goog.ui.editor.AbstractDialog.Builder.prototype.buttonHandlers_;
// *** Protected interface ************************************************** //
/**
* The DOM helper for the parent document.
* @type {goog.dom.DomHelper}
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.dom;
/**
* Creates and returns the goog.ui.Dialog control that is being wrapped
* by this object.
* @return {goog.ui.Dialog} Created Dialog control.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.createDialogControl =
goog.abstractMethod;
/**
* Returns the HTML Button element for the OK button in this dialog.
* @return {Element} The button element if found, else null.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.getOkButtonElement = function() {
return this.getButtonElement(goog.ui.Dialog.DefaultButtonKeys.OK);
};
/**
* Returns the HTML Button element for the Cancel button in this dialog.
* @return {Element} The button element if found, else null.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.getCancelButtonElement = function() {
return this.getButtonElement(goog.ui.Dialog.DefaultButtonKeys.CANCEL);
};
/**
* Returns the HTML Button element for the button added to this dialog with
* the given button id.
* @param {string} buttonId The id of the button to get.
* @return {Element} The button element if found, else null.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.getButtonElement = function(buttonId) {
return this.dialogInternal_.getButtonSet().getButton(buttonId);
};
/**
* Creates and returns the event object to be used when dispatching the OK
* event to listeners, or returns null to prevent the dialog from closing.
* Subclasses should override this to return their own subclass of
* goog.events.Event that includes all data a plugin would need from the dialog.
* @param {goog.events.Event} e The event object dispatched by the wrapped
* dialog.
* @return {goog.events.Event} The event object to be used when dispatching the
* OK event to listeners.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.createOkEvent = goog.abstractMethod;
/**
* Handles the event dispatched by the wrapped dialog control when the user
* clicks the OK button. Attempts to create the OK event object and dispatches
* it if successful.
* @param {goog.ui.Dialog.Event} e wrapped dialog OK event object.
* @return {boolean} Whether the default action (closing the dialog) should
* still be executed. This will be false if the OK event could not be
* created to be dispatched, or if any listener to that event returs false
* or calls preventDefault.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.handleOk = function(e) {
var eventObj = this.createOkEvent(e);
if (eventObj) {
return this.dispatchEvent(eventObj);
} else {
return false;
}
};
/**
* Handles the event dispatched by the wrapped dialog control when the user
* clicks the Cancel button. Simply dispatches a CANCEL event.
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.handleCancel = function() {
this.dispatchEvent(goog.ui.editor.AbstractDialog.EventType.CANCEL);
};
/**
* Disposes of the dialog. If the dialog is open, it will be hidden and
* AFTER_HIDE will be dispatched.
* @override
* @protected
*/
goog.ui.editor.AbstractDialog.prototype.disposeInternal = function() {
if (this.dialogInternal_) {
this.hide();
this.dialogInternal_.dispose();
this.dialogInternal_ = null;
}
goog.ui.editor.AbstractDialog.superClass_.disposeInternal.call(this);
};
// *** Private implementation *********************************************** //
/**
* The wrapped dialog widget.
* @type {goog.ui.Dialog}
* @private
*/
goog.ui.editor.AbstractDialog.prototype.dialogInternal_;
/**
* Cleans up after the dialog is hidden and fires the AFTER_HIDE event. Should
* be a listener for the wrapped dialog's AFTER_HIDE event.
* @private
*/
goog.ui.editor.AbstractDialog.prototype.handleAfterHide_ = function() {
this.dispatchEvent(goog.ui.editor.AbstractDialog.EventType.AFTER_HIDE);
};
|
/**
* This class represents a dialog message overlaying a DOM element in order to
* accept / cancel discard changes. The dialog can be closed i.e the overlay disappears
* o canceled. In this last case a callback function should be called.
*/
export default class PopUpMessage {
/**
*
* @param {Object} popupMessageAttributes - Object containing popup properties.
* @param {HTMLElement} popupMessageAttributes.overlayElement - Element to overlay.
* @param {Object} popupMessageAttributes.callbacks - contains callback methods for close and cancel actions.
* @param {Object} popupMessageAttributes.strings - contains all the strings needed.
*/
constructor(popupMessageAttributes) {
/**
* Element to be overlaid when the popup appears.
*/
this.overlayElement = popupMessageAttributes.overlayElement;
this.callbacks = popupMessageAttributes.callbacks;
/**
* HTMLElement element to wrap all HTML elements inside the popupMessage.
*/
this.overlayWrapper = this.overlayElement.appendChild(document.createElement("div"));
this.overlayWrapper.setAttribute("class", "wrs_popupmessage_overlay_envolture");
/**
* HTMLElement to display the popup message, close button and cancel button.
*/
this.message = this.overlayWrapper.appendChild(document.createElement("div"));
this.message.id = "wrs_popupmessage"
this.message.setAttribute("class", "wrs_popupmessage_panel");
this.message.innerHTML = popupMessageAttributes.strings.message;
/**
* HTML element overlaying the overlayElement.
*/
var overlay = this.overlayWrapper.appendChild(document.createElement("div"));
overlay.setAttribute("class", "wrs_popupmessage_overlay");
// We create a overlay that close popup message on click in there
overlay.addEventListener("click", this.cancelAction.bind(this));
/**
* HTML element containing cancel and close buttons.
*/
this.buttonArea = this.message.appendChild(document.createElement('div'));
this.buttonArea.setAttribute("class", "wrs_popupmessage_button_area");
this.buttonArea.id = 'wrs_popup_button_area';
// Close button arguments.
var buttonSubmitArguments = {
class: "wrs_button_accept",
innerHTML: popupMessageAttributes.strings.submitString,
id: 'wrs_popup_accept_button'
};
/**
* Close button arguments.
*/
this.closeButton = this.createButton(buttonSubmitArguments, this.closeAction.bind(this));
this.buttonArea.appendChild(this.closeButton);
// Cancel button arguments.
var buttonCancelArguments = {
class: "wrs_button_cancel",
innerHTML: popupMessageAttributes.strings.cancelString,
id: 'wrs_popup_cancel_button'
};
/**
* Cancel button.
*/
this.cancelButton = this.createButton(buttonCancelArguments, this.cancelAction.bind(this));
this.buttonArea.appendChild(this.cancelButton);
}
/**
* This method create a button with arguments and return button dom object
* @param {Object} parameters - An object containing id, class and innerHTML button text.
* @param {string} parameters.id - button id.
* @param {string} parameters.class - button class name.
* @param {string} parameters.innerHTML - button innerHTML text.
* @param {object} callback- callback method to call on click event.
* @returns {HTMLElement} HTML button.
*/
createButton(parameters, callback) {
var element = {};
element = document.createElement("button");
element.setAttribute("id", parameters.id);
element.setAttribute("class", parameters.class);
element.innerHTML = parameters.innerHTML;
element.addEventListener("click", callback);
return element;
}
/**
* Shows the popupmessage containing a message, and two buttons
* to cancel the action or close the modal dialog.
*/
show() {
if (this.overlayWrapper.style.display != 'block') {
// Clear focus with blur for prevent press any key.
document.activeElement.blur();
// For works with Safari
window.focus();
this.overlayWrapper.style.display = 'block';
}
else {
this.overlayWrapper.style.display = 'none';
_wrs_modalWindow.focus();
}
}
/**
* This method cancels the popupMessage: the dialog disappears revealing the overlaid element.
* A callback method is called (if defined). For example a method to focus the overlaid element.
*/
cancelAction() {
this.overlayWrapper.style.display = 'none';
if (typeof this.callbacks.cancelCallback !== 'undefined') {
this.callbacks.cancelCallback();
}
}
/**
* This method closes the popupMessage: the dialog disappears and the close callback is called.
* For example to close the overlaid element.
*/
closeAction() {
this.cancelAction();
if (typeof this.callbacks.closeCallback !== 'undefined') {
this.callbacks.closeCallback();
}
}
} |
# Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
import logging
def prepare_redisgraph_benchmark_go_command(
executable_path: str,
server_private_ip: object,
server_plaintext_port: object,
benchmark_config: object,
results_file: object,
is_remote: bool = False,
):
"""
Prepares redisgraph-benchmark-go command parameters
:param executable_path:
:param server_private_ip:
:param server_plaintext_port:
:param benchmark_config:
:param results_file:
:param is_remote:
:return: string containing the required command to run the benchmark given the configurations
"""
queries_str = [executable_path]
for k in benchmark_config["parameters"]:
if "graph" in k:
if is_remote:
graph_key = "'{}'".format(k["graph"])
else:
graph_key = k["graph"]
queries_str.extend(["-graph-key", graph_key])
elif "clients" in k:
queries_str.extend(["-c", "{}".format(k["clients"])])
elif "requests" in k:
queries_str.extend(["-n", "{}".format(k["requests"])])
elif "rps" in k:
queries_str.extend(["-rps", "{}".format(k["rps"])])
elif "queries" in k:
for kk in k["queries"]:
if is_remote:
query = "'{}'".format(kk["q"])
else:
query = kk["q"]
queries_str.extend(["-query", query])
if "ratio" in kk:
queries_str.extend(["-query-ratio", "{}".format(kk["ratio"])])
else:
if "threads" not in k and "connections" not in k:
for kk in k.keys():
queries_str.extend(["-{}".format(kk), str(k[kk])])
queries_str.extend(["-h", "{}".format(server_private_ip)])
queries_str.extend(["-p", "{}".format(server_plaintext_port)])
queries_str.extend(["-json-out-file", "{}".format(results_file)])
logging.info(
"Running the benchmark with the following parameters: {}".format(
" ".join(queries_str)
)
)
command_str = " ".join(queries_str)
return queries_str, command_str
|
export default () => {
return <div>FB Messenger</div>;
};
|
import CacheService from '@services/cache.service';
import EventService from '@services/event.service';
import BaseStringService from '@services/base-string.service';
import AppStrings from '@services/app.strings';
angular
.module('at.lib.services', [])
.service('AppStrings', AppStrings)
.service('BaseStringService', BaseStringService)
.service('CacheService', CacheService)
.service('EventService', EventService);
|
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const DEBUG = false;
const cellsTemplate = [
"links",
"id",
"name",
"elo",
"opponent",
"last online",
"online",
];
class Player {
constructor(json) {
var _a, _b, _c;
let data = json.data;
this.id = parseInt(data.id);
this.name = (_a = data === null || data === void 0 ? void 0 : data.attributes) === null || _a === void 0 ? void 0 : _a["user-name"];
this.ELO = (_b = data === null || data === void 0 ? void 0 : data.attributes) === null || _b === void 0 ? void 0 : _b.elo;
this.rank = (_c = data === null || data === void 0 ? void 0 : data.attributes) === null || _c === void 0 ? void 0 : _c.rank;
this.lastOnline = 0;
}
fillName(json) {
var _a, _b, _c, _d;
let data = json.data;
this.id = parseInt(data.id);
this.name = (_a = data === null || data === void 0 ? void 0 : data.attributes) === null || _a === void 0 ? void 0 : _a["user-name"];
this.ELO = (_b = data === null || data === void 0 ? void 0 : data.attributes) === null || _b === void 0 ? void 0 : _b.elo;
this.rank = (_c = data === null || data === void 0 ? void 0 : data.attributes) === null || _c === void 0 ? void 0 : _c.rank;
this.lastOnline = Date.parse((_d = data === null || data === void 0 ? void 0 : data.attributes) === null || _d === void 0 ? void 0 : _d["last-online"]);
}
fillOnlineInfo(json) {
var _a;
let users = json.OnlineUses.filter((onlinePlayer) => onlinePlayer.Id === this.id.toString());
if (users.length > 0) {
this.online = true;
this.device = users[0].Device;
this.name = users[0].UserName;
this.ELO = Math.floor(users[0].ELO);
}
else {
this.online = false;
this.device = undefined;
}
let rooms = json.Rooms.filter((room) => {
let roomplayers = room.Players;
for (let i = 0; i < roomplayers.length; i++) {
if (roomplayers[i].Id === this.id.toString()) {
return true;
}
}
return false;
});
if (rooms.length > 0) {
let room = rooms[0];
room.Players.forEach((roomplayer) => {
if (roomplayer.Id !== this.id.toString()) {
this.opponent = roomplayer.UserName;
this.opponentELO = roomplayer.ELO;
this.opponentid = roomplayer.Id;
}
});
this.ranked = (_a = room === null || room === void 0 ? void 0 : room.Match) === null || _a === void 0 ? void 0 : _a.Ranked;
}
else {
this.opponent = undefined;
this.opponentELO = undefined;
this.opponentid = undefined;
this.ranked = undefined;
}
}
}
let players = [];
function updateCountdown(countdown) {
let element = document.getElementById("countdown");
element.innerHTML = countdown.toString();
}
function updateInfo(info) {
let element = document.getElementById("info");
element.innerHTML = info.toString();
}
function init() {
return __awaiter(this, void 0, void 0, function* () {
updateCountdown("");
});
}
function sortPlayersTable() {
$("#players").trigger("updateCache");
$("#players").trigger("appendCache");
$("#players").trigger("update");
}
function loadPlayersData() {
return __awaiter(this, void 0, void 0, function* () {
let online_promise = new Promise(() => { });
if (window.location.protocol === "https:") {
online_promise = fetch("https://api.codetabs.com/v1/proxy/?quest=http://elevenlogcollector-env.js6z6tixhb.us-west-2.elasticbeanstalk.com/ElevenServerLiteSnapshot");
}
else if (window.location.protocol === "http:") {
online_promise = fetch("http://elevenlogcollector-env.js6z6tixhb.us-west-2.elasticbeanstalk.com/ElevenServerLiteSnapshot");
}
else {
console.error(`Unsupported protocol: ${window.location.protocol}`);
}
try {
let online_response = yield online_promise;
let json = yield online_response.json();
players = [];
json.OnlineUses.forEach((onlineUser) => {
let player = new Player({
data: {
id: onlineUser.Id,
name: onlineUser.UserName,
ELO: onlineUser.ELO,
},
});
players.push(player);
});
for (let id = 0; id < players.length; id++) {
players[id].fillOnlineInfo(json);
}
renderPlayersData(players);
}
catch (err) {
console.error(err);
updateCountdown(`Error: Failed to fetch live snapshot. ${err}`);
}
});
}
function renderPlayerData(player) {
let table = document.getElementById("players");
let tbody = table.tBodies[0];
let playerRowId = [...tbody.rows].findIndex((row) => row.getAttribute("id") === `player-${player.id.toString()}`);
let row = tbody.rows[playerRowId];
$(document).on("click", `tr#player-${player.id.toString()} .matchupButton`, function () {
$(`tr#player-${player.id.toString()}`).addClass("online");
});
row.cells[0].innerHTML = `<a title="statistics" href="https://11-stats.com/stats/${player.id}/statistics" target="_blank">📈</a><a style="display:none" class="matchupButton" href="#">⚔️</a><span class="matchupResult"> </span>`;
row.cells[1].innerHTML = `<a href="https://www.elevenvr.net/eleven/${player.id}" target="_blank">${player.id}</a>`;
row.cells[1].classList.add("id");
row.cells[2].innerHTML =
player.name === undefined
? "⌛"
: `<a title="ETT website" href="https://www.elevenvr.net/eleven/${player.id}" target="_blank">${player.name}</a>`;
row.cells[3].innerHTML =
player.ELO === undefined
? "⌛"
: `${player.ELO}${player.rank <= 1000 && player.rank > 0
? " (#" + player.rank.toString() + ")"
: ""}`;
let opponent_str = "";
if (player.opponent !== undefined) {
opponent_str = `<a href="https://www.elevenvr.net/eleven/${player.opponentid}" target='_blank'>${player.opponent}</a> <span class="${player.ranked ? "ranked" : "unranked"}">(${player.opponentELO})<span><a title="matchup" href="https://www.elevenvr.net/matchup/${player.id}/${player.opponentid}" target='_blank'>⚔️</a>`;
}
opponent_str += `<a title="scoreboard" class="scoreboard" href="https://cristy94.github.io/eleven-vr-scoreboard/?user=${player.id}&rowsReversed=0&home-offset=0&away-offset=0" target='_blank'>🔍</a>`;
row.cells[4].innerHTML = opponent_str;
function getTimeDifferenceString(current, previous) {
var msPerMinute = 60 * 1000;
var msPerHour = msPerMinute * 60;
var msPerDay = msPerHour * 24;
var msPerMonth = msPerDay * 30;
var msPerYear = msPerDay * 365;
var elapsed = current - previous;
if (elapsed < msPerMinute) {
return Math.round(elapsed / 1000) + " seconds ago";
}
else if (elapsed < msPerHour) {
return Math.round(elapsed / msPerMinute) + " minutes ago";
}
else if (elapsed < msPerDay) {
return Math.round(elapsed / msPerHour) + " hours ago";
}
else if (elapsed < msPerMonth) {
return "approximately " + Math.round(elapsed / msPerDay) + " days ago";
}
else if (elapsed < msPerYear) {
return ("approximately " + Math.round(elapsed / msPerMonth) + " months ago");
}
else {
return "approximately " + Math.round(elapsed / msPerYear) + " years ago";
}
}
var options = {
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
timeZoneName: "short",
};
row.cells[5].innerHTML =
player.online === undefined
? "⌛"
: `${player.online === true
? player.device
: "<span class='hidden'>" +
player.lastOnline +
"###</span><span title='" +
getTimeDifferenceString(Date.now(), player.lastOnline) +
"'>" +
new Date(player.lastOnline).toLocaleString(undefined, options) +
"</span>"}`;
row.cells[5].setAttribute("data-timestamp", player.lastOnline.toString());
row.cells[5].classList.add("last-online");
row.cells[6].innerHTML =
player.online === undefined
? "⌛"
: `${player.online === true ? "✔️" : "❌"}`;
}
function renderPlayersData(players) {
let shouldCreateRows = true;
let table = document.getElementById("players");
let tbody = table.tBodies[0];
while (tbody.rows.length > 0) {
tbody.deleteRow(0);
}
let row;
if (shouldCreateRows) {
for (let player of players) {
row = tbody.insertRow(-1);
for (let cellId = 0; cellId < cellsTemplate.length; cellId++) {
row.insertCell();
row.setAttribute("id", `player-${player.id.toString()}`);
}
row.cells[6].classList.add("hidden");
}
}
for (let playerId = 0; playerId < players.length; playerId++) {
let player = players[playerId];
renderPlayerData(player);
}
}
function preLoading() {
updateCountdown(`Loading...`);
}
function postLoading() {
updateCountdown(`Loaded.`);
function groupBy(list, keyGetter) {
const map = new Map();
list.forEach((item) => {
const key = keyGetter(item);
const collection = map.get(key);
if (!collection) {
map.set(key, [item]);
}
else {
collection.push(item);
}
});
return map;
}
const grouped = groupBy(players, (player) => player.device);
const sorted_keys = Array.from(grouped.keys()).sort((a, b) => grouped.get(b).length - grouped.get(a).length);
let deviceStr = "";
for (let key of sorted_keys) {
deviceStr += `${key}: ${grouped.get(key).length} <br /> `;
}
updateInfo(`<br /> Total Players: ${players.length} <br /><br /> ${deviceStr} <br />`);
sortPlayersTable();
}
function loadAndRender() {
return __awaiter(this, void 0, void 0, function* () {
preLoading();
let playersOld = [];
for (let player of players) {
playersOld.push(Object.assign({}, player));
}
yield loadPlayersData();
postLoading();
});
}
const refreshInterval = DEBUG ? 10 : 60 * 10;
let seconds = refreshInterval;
function countdownTimerCallback() {
updateCountdown(`Updating in ${seconds} seconds`);
if (seconds == 1) {
seconds = refreshInterval;
}
else {
seconds -= 1;
}
}
function main() {
return __awaiter(this, void 0, void 0, function* () {
$.tablesorter.addParser({
id: "rangesort",
is: function (_) {
return false;
},
format: function (s, _table) {
return s.split("###")[0];
},
type: "numeric",
parsed: false,
});
$("#players").tablesorter({
sortInitialOrder: "desc",
sortList: [
[6, 0],
[3, 1],
],
headers: {
0: { sorter: false, parser: false },
1: { sorter: "digit", sortInitialOrder: "asc" },
2: { sorter: "string", sortInitialOrder: "asc" },
3: { sorter: "string", sortInitialOrder: "desc" },
4: { sorter: false, parser: false },
5: { sorter: "string", sortInitialOrder: "desc" },
},
});
yield loadAndRender();
setInterval(loadAndRender, refreshInterval * 1000);
setInterval(countdownTimerCallback, 1000);
});
}
(() => __awaiter(void 0, void 0, void 0, function* () {
yield init();
yield main();
}))();
//# sourceMappingURL=index.js.map |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from typing import List, Optional, Dict
from nltk.translate.ribes_score import sentence_ribes as sent_ribes
from vizseq.scorers import register_scorer, VizSeqScorer, VizSeqScore
def _get_sent_ribes(
hypothesis: List[str], references: List[List[str]],
extra_args: Optional[Dict[str, str]] = None,
) -> List[float]:
joined_ref = list(zip(*references))
scores = []
for r, h in zip(joined_ref, hypothesis):
try:
cur = sent_ribes([rr.split() for rr in r], h.split())
scores.append(cur)
except ZeroDivisionError:
scores.append(0.)
return scores
@register_scorer('ribes', 'RIBES')
class RIBESScorer(VizSeqScorer):
def score(
self, hypothesis: List[str], references: List[List[str]],
tags: Optional[List[List[str]]] = None
) -> VizSeqScore:
return self._score_multiprocess_averaged(
hypothesis, references, tags, sent_score_func=_get_sent_ribes
)
|
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import util
from telemetry.page import page as page_module
from telemetry.page.actions import navigate
from telemetry.unittest import tab_test_case
class NavigateActionTest(tab_test_case.TabTestCase):
def CreatePageFromUnittestDataDir(self, filename):
self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
return page_module.Page(
self._browser.http_server.UrlOf(filename),
None # In this test, we don't need a page set.
)
def testNavigateAction(self):
self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
page = self.CreatePageFromUnittestDataDir('blank.html')
i = navigate.NavigateAction()
i.RunAction(page, self._tab, None)
self.assertEquals(
self._tab.EvaluateJavaScript('document.location.pathname;'),
'/blank.html')
|
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
(function (global, factory) {
if ((typeof module === "undefined" ? "undefined" : _typeof(module)) === "object" && _typeof(module.exports) === "object") {
module.exports = factory(); // common.js
} else if (typeof define === 'function') {
define(function () {
return factory();
}); //amd规范 ,require.js
} else {
global.EasyWebSocket = factory(); //浏览器环境
}
})(typeof window !== "undefined" ? window : global, function () {
'use strict';
var EasyWebSocket = function () {
/**
* @description: 初始化实例属性,保存参数
* @param {Object} opt 参数配置
* @param {String} opt.url ws的接口
* @param {Function} opt.msgCb 服务器信息的回调传数据给函数
* @param {String} [opt.name='default'] 可选值 用于区分ws
* @param {Boolean} [opt.debug=false] 可选值 是否开启调试模式
* @param {Number} [opt.failNum=3] 可选值 连接失败后重连的次数
* @param {Number} [opt.delayConnectTime=3000] 可选值 重连的延时时间
* @param {String} [opt.cmd="ping"] 可选值 ping值(心跳命令)
* @param {String} [opt.serverType="deamon"] 可选值 websocket服务类型
* @param {Function} [opt.fail=null] 可选值 websocket连接失败的回调
* @param {Function} [opt.success=null] 可选值 websocket连接成功的回调
*/
function EasyWebSocket(opt) {
var _this = this;
_classCallCheck(this, EasyWebSocket);
var defaultOpt = {
msgCb: function msgCb(evet) {
if (_this.opt.debug) {
console.log('接收服务器消息的回调:', evet.data);
}
},
name: 'default',
debug: false,
reconnect: true,
failNum: 3,
delayConnectTime: 3000,
pingTime: 2000,
pongTime: 3000,
cmd: false,
serverType: "deamon",
fail: null,
success: null
};
this.opt = Object.assign({}, defaultOpt, opt);
this.ws = null; // websocket对象
this.connectNum = 0; // 已重连的次数
this.status = null; // websocket的状态
this.timer = null; //定时器
this.message = null; //连接成功后发送的消息
}
_createClass(EasyWebSocket, [{
key: "connect",
value: function connect(data) {
var _this2 = this;
//保存发送的消息,在断线重连的时候发送。
data && (this.message = data);
this.ws = new WebSocket(this.opt.url);
this.ws.onopen = function (e) {
// 连接 websocket 成功
// 重置已重连次数
_this2.resetConnectNum();
_this2.status = 'open';
if (_this2.opt.cmd) {
//是否开启心跳检测
_this2.heartCheck(_this2.opt.cmd);
}
if (_this2.opt.debug) {
console.log(_this2.opt.name + "\u8FDE\u63A5\u5230" + e.currentTarget.url + "\u6210\u529F!");
}
//连接成功
_this2.opt.success && _this2.opt.success(_this2.opt.index);
if (data !== undefined) {
_this2.sendMessage(data);
}
};
this.ws.onmessage = function (evet) {
if (_this2.opt.cmd) {
//开启心跳
var pingData = void 0;
switch (_this2.opt.serverType) {
case "deamon":
pingData = JSON.parse(evet.data).message;
break;
case "normal":
pingData = evet.data;
break;
default:
pingData = evet.data;
break;
}
if (pingData === "pong") {
_this2.pingPong = 'pong'; // 服务器端返回pong,修改pingPong的状态
}
}
return _this2.opt.msgCb(evet);
};
this.ws.onerror = function (e) {
return _this2.errorHandle(e);
};
this.ws.onclose = function (err) {
return _this2.closeHandle(err);
};
}
}, {
key: "resetConnectNum",
value: function resetConnectNum() {
// 重置已重连的次数为0
this.connectNum = 0;
}
}, {
key: "onMessage",
value: function onMessage(callback) {
// 自定义 接受消息函数
this.opt.msgCb = callback;
}
}, {
key: "sendMessage",
value: function sendMessage(data) {
if (this.opt.debug) {
console.log(this.opt.name + "\u53D1\u9001\u6D88\u606F\u7ED9\u670D\u52A1\u5668:", data);
}
var _data = (typeof data === "undefined" ? "undefined" : _typeof(data)) === "object" ? JSON.stringify(data) : data;
if (this.ws.readyState === 1) {
// 当为OPEN时
this.ws.send(_data);
}
}
}, {
key: "closeHandle",
value: function closeHandle() {
var _this3 = this;
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'err';
this.connectNum++;
if (this.opt.debug) {
console.warn(this.opt.name + "\u65AD\u5F00\uFF0C" + this.opt.delayConnectTime + "ms\u540E\u91CD\u8FDEwebsocket,\u5C1D\u8BD5\u8FDE\u63A5\u7B2C" + this.connectNum + "\u6B21\u3002");
}
if (this.status !== 'close') {
if (this.connectNum < this.opt.failNum || this.opt.failNum === -1) {
this.timer = setTimeout(function () {
if (_this3.opt.cmd) {
if (_this3.pingInterval !== undefined && _this3.pongInterval !== undefined) {
// 清除定时器
clearInterval(_this3.pingInterval);
clearInterval(_this3.pongInterval);
}
}
//清除计时器
clearTimeout(_this3.timer);
//关闭websocket连接
_this3.ws.close();
_this3.connect(_this3.message); // 重连
}, this.opt.delayConnectTime);
} else {
if (this.opt.debug) {
console.error(this.opt.name + "\u65AD\u5F00\uFF0C\u91CD\u8FDEwebsocket\u5931\u8D25\uFF01");
}
if (this.opt.cmd) {
if (this.pingInterval !== undefined && this.pongInterval !== undefined) {
// 清除定时器
clearInterval(this.pingInterval);
clearInterval(this.pongInterval);
}
}
this.opt.fail && this.opt.fail(this.opt.index);
}
} else {
if (this.opt.debug) {
console.warn(this.opt.name + "websocket\u624B\u52A8\u5173\u95ED\uFF01");
}
if (this.opt.cmd) {
if (this.pingInterval !== undefined && this.pongInterval !== undefined) {
// 清除定时器
clearInterval(this.pingInterval);
clearInterval(this.pongInterval);
}
}
}
}
}, {
key: "errorHandle",
value: function errorHandle() {
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'err';
// 错误处理
if (this.opt.debug) {
console.warn(this.opt.name + "\u8FDE\u63A5\u9519\u8BEF\uFF01");
}
}
}, {
key: "closeMyself",
// 手动关闭WebSocket
value: function closeMyself() {
if (this.opt.debug) {
console.warn("\u5173\u95ED" + this.opt.name);
}
this.status = 'close';
return this.ws.close();
}
}, {
key: "heartCheck",
value: function heartCheck(cmd) {
var _this4 = this;
// 心跳机制的时间可以自己与后端约定
this.pingPong = 'ping'; // ws的心跳机制状态值
this.pingInterval = setInterval(function () {
if (_this4.ws.readyState === 1) {
// 检查ws为链接状态 才可发送
if (typeof cmd !== "string") {
cmd = JSON.stringify(cmd);
}
_this4.ws.send(cmd); // 客户端发送ping
}
}, this.opt.pingTime);
this.pongInterval = setInterval(function () {
if (_this4.pingPong === 'ping') {
_this4.closeHandle('pingPong没有改变为pong!'); // 没有返回pong 重启webSocket
} else {
if (_this4.opt.debug) {
console.log('返回pong');
}
_this4.pingPong = 'ping'; // 重置为ping 若下一次 ping 发送失败 或者pong返回失败(pingPong不会改成pong),将重启.
}
}, this.opt.pongTime);
}
}]);
return EasyWebSocket;
}();
return EasyWebSocket;
});
|
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Sales Invoice Review", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Sales Invoice Review
() => frappe.tests.make('Sales Invoice Review', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});
|
/*
* MultiSelect v0.9.12
* Copyright (c) 2012 Louis Cuny
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/
!function ($) {
"use strict";
/* MULTISELECT CLASS DEFINITION
* ====================== */
var MultiSelect = function (element, options) {
this.options = options;
this.$element = $(element);
this.$container = $('<div/>', { 'class': "ms-container" });
this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });
this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
this.$selectionUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
this.scrollTo = 0;
this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';
};
MultiSelect.prototype = {
constructor: MultiSelect,
init: function(){
var that = this,
ms = this.$element;
if (ms.next('.ms-container').length === 0){
ms.css({ position: 'absolute', left: '-9999px' });
ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');
this.$container.attr('id', 'ms-'+ms.attr('id'));
this.$container.addClass(that.options.cssClass);
ms.find('option').each(function(){
that.generateLisFromOption(this);
});
this.$selectionUl.find('.ms-optgroup-label').hide();
if (that.options.selectableHeader){
that.$selectableContainer.append(that.options.selectableHeader);
}
that.$selectableContainer.append(that.$selectableUl);
if (that.options.selectableFooter){
that.$selectableContainer.append(that.options.selectableFooter);
}
if (that.options.selectionHeader){
that.$selectionContainer.append(that.options.selectionHeader);
}
that.$selectionContainer.append(that.$selectionUl);
if (that.options.selectionFooter){
that.$selectionContainer.append(that.options.selectionFooter);
}
that.$container.append(that.$selectableContainer);
that.$container.append(that.$selectionContainer);
ms.after(that.$container);
that.activeMouse(that.$selectableUl);
that.activeKeyboard(that.$selectableUl);
var action = that.options.dblClick ? 'dblclick' : 'click';
that.$selectableUl.on(action, '.ms-elem-selectable', function(){
that.select($(this).data('ms-value'));
});
that.$selectionUl.on(action, '.ms-elem-selection', function(){
that.deselect($(this).data('ms-value'));
});
that.activeMouse(that.$selectionUl);
that.activeKeyboard(that.$selectionUl);
ms.on('focus', function(){
that.$selectableUl.focus();
});
}
var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
that.select(selectedValues, 'init');
if (typeof that.options.afterInit === 'function') {
that.options.afterInit.call(this, this.$container);
}
},
'generateLisFromOption' : function(option, index, $container){
var that = this,
ms = that.$element,
attributes = "",
$option = $(option);
for (var cpt = 0; cpt < option.attributes.length; cpt++){
var attr = option.attributes[cpt];
if(attr.name !== 'value' && attr.name !== 'disabled'){
attributes += attr.name+'="'+attr.value+'" ';
}
}
var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),
selectedLi = selectableLi.clone(),
value = $option.val(),
elementId = that.sanitize(value);
selectableLi
.data('ms-value', value)
.addClass('ms-elem-selectable')
.attr('id', elementId+'-selectable');
selectedLi
.data('ms-value', value)
.addClass('ms-elem-selection')
.attr('id', elementId+'-selection')
.hide();
if ($option.prop('disabled') || ms.prop('disabled')){
selectedLi.addClass(that.options.disabledClass);
selectableLi.addClass(that.options.disabledClass);
}
var $optgroup = $option.parent('optgroup');
if ($optgroup.length > 0){
var optgroupLabel = $optgroup.attr('label'),
optgroupId = that.sanitize(optgroupLabel),
$selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),
$selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);
if ($selectableOptgroup.length === 0){
var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
$selectableOptgroup = $(optgroupContainerTpl);
$selectionOptgroup = $(optgroupContainerTpl);
$selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
$selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);
$selectableOptgroup.append($(optgroupTpl));
$selectionOptgroup.append($(optgroupTpl));
if (that.options.selectableOptgroup){
$selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val();}).get();
that.select(values);
});
$selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val();}).get();
that.deselect(values);
});
}
that.$selectableUl.append($selectableOptgroup);
that.$selectionUl.append($selectionOptgroup);
}
index = index === undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
selectableLi.insertAt(index, $selectableOptgroup.children());
selectedLi.insertAt(index, $selectionOptgroup.children());
} else {
index = index === undefined ? that.$selectableUl.children().length : index;
selectableLi.insertAt(index, that.$selectableUl);
selectedLi.insertAt(index, that.$selectionUl);
}
},
'addOption' : function(options){
var that = this;
if (options.value !== undefined && options.value !== null){
options = [options];
}
$.each(options, function(index, option){
if (option.value !== undefined && option.value !== null &&
that.$element.find("option[value='"+option.value+"']").length === 0){
var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
$container = option.nested === undefined ? that.$element : $("optgroup[label='"+option.nested+"']"),
index = parseInt((typeof option.index === 'undefined' ? $container.children().length : option.index));
if (option.optionClass) {
$option.addClass(option.optionClass);
}
if (option.disabled) {
$option.prop('disabled', true);
}
$option.insertAt(index, $container);
that.generateLisFromOption($option.get(0), index, option.nested);
}
});
},
'escapeHTML' : function(text){
return $("<div>").text(text).html();
},
'activeKeyboard' : function($list){
var that = this;
$list.on('focus', function(){
$(this).addClass('ms-focus');
})
.on('blur', function(){
$(this).removeClass('ms-focus');
})
.on('keydown', function(e){
switch (e.which) {
case 40:
case 38:
e.preventDefault();
e.stopPropagation();
that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
return;
case 37:
case 39:
e.preventDefault();
e.stopPropagation();
that.switchList($list);
return;
case 9:
if(that.$element.is('[tabindex]')){
e.preventDefault();
var tabindex = parseInt(that.$element.attr('tabindex'), 10);
tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
$('[tabindex="'+(tabindex)+'"]').focus();
return;
}else{
if(e.shiftKey){
that.$element.trigger('focus');
}
}
}
if($.inArray(e.which, that.options.keySelect) > -1){
e.preventDefault();
e.stopPropagation();
that.selectHighlighted($list);
return;
}
});
},
'moveHighlight': function($list, direction){
var $elems = $list.find(this.elemsSelector),
$currElem = $elems.filter('.ms-hover'),
$nextElem = null,
elemHeight = $elems.first().outerHeight(),
containerHeight = $list.height(),
containerSelector = '#'+this.$container.prop('id');
$elems.removeClass('ms-hover');
if (direction === 1){ // DOWN
$nextElem = $currElem.nextAll(this.elemsSelector).first();
if ($nextElem.length === 0){
var $optgroupUl = $currElem.parent();
if ($optgroupUl.hasClass('ms-optgroup')){
var $optgroupLi = $optgroupUl.parent(),
$nextOptgroupLi = $optgroupLi.next(':visible');
if ($nextOptgroupLi.length > 0){
$nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
} else {
$nextElem = $elems.first();
}
} else {
$nextElem = $elems.first();
}
}
} else if (direction === -1){ // UP
$nextElem = $currElem.prevAll(this.elemsSelector).first();
if ($nextElem.length === 0){
var $optgroupUl = $currElem.parent();
if ($optgroupUl.hasClass('ms-optgroup')){
var $optgroupLi = $optgroupUl.parent(),
$prevOptgroupLi = $optgroupLi.prev(':visible');
if ($prevOptgroupLi.length > 0){
$nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
} else {
$nextElem = $elems.last();
}
} else {
$nextElem = $elems.last();
}
}
}
if ($nextElem.length > 0){
$nextElem.addClass('ms-hover');
var scrollTo = $list.scrollTop() + $nextElem.position().top -
containerHeight / 2 + elemHeight / 2;
$list.scrollTop(scrollTo);
}
},
'selectHighlighted' : function($list){
var $elems = $list.find(this.elemsSelector),
$highlightedElem = $elems.filter('.ms-hover').first();
if ($highlightedElem.length > 0){
if ($list.parent().hasClass('ms-selectable')){
this.select($highlightedElem.data('ms-value'));
} else {
this.deselect($highlightedElem.data('ms-value'));
}
$elems.removeClass('ms-hover');
}
},
'switchList' : function($list){
$list.blur();
this.$container.find(this.elemsSelector).removeClass('ms-hover');
if ($list.parent().hasClass('ms-selectable')){
this.$selectionUl.focus();
} else {
this.$selectableUl.focus();
}
},
'activeMouse' : function($list){
var that = this;
this.$container.on('mouseenter', that.elemsSelector, function(){
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
$(this).addClass('ms-hover');
});
this.$container.on('mouseleave', that.elemsSelector, function () {
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
});
},
'refresh' : function() {
this.destroy();
this.$element.multiSelect(this.options);
},
'destroy' : function(){
$("#ms-"+this.$element.attr("id")).remove();
this.$element.off('focus');
this.$element.css('position', '').css('left', '');
this.$element.removeData('multiselect');
},
'select' : function(value, method){
if (typeof value === 'string'){ value = [value]; }
var that = this,
ms = this.$element,
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
if (method === 'init'){
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
}
if (selectables.length > 0){
selectables.addClass('ms-selected').hide();
selections.addClass('ms-selected').show();
options.prop('selected', true);
that.$container.find(that.elemsSelector).removeClass('ms-hover');
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
if (selectableOptgroups.length > 0){
selectableOptgroups.each(function(){
var selectablesLi = $(this).find('.ms-elem-selectable');
if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
$(this).find('.ms-optgroup-label').hide();
}
});
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
selectionOptgroups.each(function(){
var selectionsLi = $(this).find('.ms-elem-selection');
if (selectionsLi.filter('.ms-selected').length > 0){
$(this).find('.ms-optgroup-label').show();
}
});
} else {
if (that.options.keepOrder && method !== 'init'){
var selectionLiLast = that.$selectionUl.find('.ms-selected');
if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
selections.insertAfter(selectionLiLast.last());
}
}
}
if (method !== 'init'){
ms.trigger('change');
if (typeof that.options.afterSelect === 'function') {
that.options.afterSelect.call(this, value);
}
}
}
},
'deselect' : function(value){
if (typeof value === 'string'){ value = [value]; }
var that = this,
ms = this.$element,
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
if (selections.length > 0){
selectables.removeClass('ms-selected').show();
selections.removeClass('ms-selected').hide();
options.prop('selected', false);
that.$container.find(that.elemsSelector).removeClass('ms-hover');
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
if (selectableOptgroups.length > 0){
selectableOptgroups.each(function(){
var selectablesLi = $(this).find('.ms-elem-selectable');
if (selectablesLi.filter(':not(.ms-selected)').length > 0){
$(this).find('.ms-optgroup-label').show();
}
});
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
selectionOptgroups.each(function(){
var selectionsLi = $(this).find('.ms-elem-selection');
if (selectionsLi.filter('.ms-selected').length === 0){
$(this).find('.ms-optgroup-label').hide();
}
});
}
ms.trigger('change');
if (typeof that.options.afterDeselect === 'function') {
that.options.afterDeselect.call(this, value);
}
}
},
'select_all' : function(){
var ms = this.$element,
values = ms.val();
ms.find('option:not(":disabled")').prop('selected', true);
this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
this.$selectionUl.find('.ms-optgroup-label').show();
this.$selectableUl.find('.ms-optgroup-label').hide();
this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
this.$selectionUl.focus();
ms.trigger('change');
if (typeof this.options.afterSelect === 'function') {
var selectedValues = $.grep(ms.val(), function(item){
return $.inArray(item, values) < 0;
});
this.options.afterSelect.call(this, selectedValues);
}
},
'deselect_all' : function(){
var ms = this.$element,
values = ms.val();
ms.find('option').prop('selected', false);
this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
this.$selectionUl.find('.ms-optgroup-label').hide();
this.$selectableUl.find('.ms-optgroup-label').show();
this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
this.$selectableUl.focus();
ms.trigger('change');
if (typeof this.options.afterDeselect === 'function') {
this.options.afterDeselect.call(this, values);
}
},
sanitize: function(value){
var hash = 0, i, character;
if (value.length == 0) return hash;
var ls = 0;
for (i = 0, ls = value.length; i < ls; i++) {
character = value.charCodeAt(i);
hash = ((hash<<5)-hash)+character;
hash |= 0; // Convert to 32bit integer
}
return hash;
}
};
/* MULTISELECT PLUGIN DEFINITION
* ======================= */
$.fn.multiSelect = function () {
var option = arguments[0],
args = arguments;
return this.each(function () {
var $this = $(this),
data = $this.data('multiselect'),
options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
if (typeof option === 'string'){
data[option](args[1]);
} else {
data.init();
}
});
};
$.fn.multiSelect.defaults = {
keySelect: [32],
selectableOptgroup: false,
disabledClass : 'disabled',
dblClick : false,
keepOrder: false,
cssClass: ''
};
$.fn.multiSelect.Constructor = MultiSelect;
$.fn.insertAt = function(index, $parent) {
return this.each(function() {
if (index === 0) {
$parent.prepend(this);
} else {
$parent.children().eq(index - 1).after(this);
}
});
};
}(window.jQuery);
|
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @remove-on-eject-end
'use strict';
const fs = require('fs');
const path = require('path');
const resolve = require('resolve');
const webpack = require('webpack');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
const getClientEnvironment = require('./env');
const paths = require('./paths');
const ManifestPlugin = require('webpack-manifest-plugin');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin-alt');
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
// @remove-on-eject-begin
const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
// @remove-on-eject-end
// Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier.
const publicPath = '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
const publicUrl = '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);
// style files regexes
const cssRegex = /\.css$/;
const cssModuleRegex = /\.module\.css$/;
const sassRegex = /\.(scss|sass)$/;
const sassModuleRegex = /\.module\.(scss|sass)$/;
// common function to get style loaders
const getStyleLoaders = (cssOptions, preProcessor) => {
const loaders = [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: cssOptions,
},
{
// Options for PostCSS as we reference these options twice
// Adds vendor prefixing based on your specified browser support in
// package.json
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
config: paths.postcssConfigFile,
},
},
];
if (preProcessor) {
loaders.push(require.resolve(preProcessor));
}
return loaders;
};
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
mode: 'development',
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebook/create-react-app/issues/343
devtool: 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
entry: [
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
require.resolve('react-dev-utils/webpackHotDevClient'),
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
],
output: {
// Add /* filename */ comments to generated require()s in the output.
pathinfo: true,
// This does not produce a real file. It's just the virtual path that is
// served by WebpackDevServer in development. This is the JS bundle
// containing code from all our entry points, and the Webpack runtime.
filename: 'static/js/bundle.js',
// There are also additional JS chunk files if you use code splitting.
chunkFilename: 'static/js/[name].chunk.js',
// This is the URL that app is served from. We use "/" in development.
publicPath: publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
optimization: {
// Automatically split vendor and commons
// https://twitter.com/wSokra/status/969633336732905474
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
splitChunks: {
chunks: 'all',
name: false,
},
// Keep the runtime chunk seperated to enable long term caching
// https://twitter.com/wSokra/status/969679223278505985
runtimeChunk: true,
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253
modules: ['node_modules'].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebook/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: paths.moduleFileExtensions
.map(ext => `.${ext}`)
.filter(ext => useTypeScript || !ext.includes('ts')),
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding
// guards against forgotten dependencies and such.
PnpWebpackPlugin,
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
resolveLoader: {
plugins: [
// Also related to Plug'n'Play, but this time it tells Webpack to load its loaders
// from the current package.
PnpWebpackPlugin.moduleLoader(module),
],
},
module: {
strictExportPresence: true,
rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|mjs|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
// @remove-on-eject-begin
baseConfig: {
extends: [require.resolve('eslint-config-react-app')],
settings: { react: { version: '999.999.999' } },
},
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process application JS with Babel.
// The preset includes JSX, Flow, and some ESnext features.
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve(
'babel-preset-react-app/webpack-overrides'
),
// @remove-on-eject-begin
babelrc: false,
configFile: false,
presets: [require.resolve('babel-preset-react-app')],
// Make sure we have a unique cache identifier, erring on the
// side of caution.
// We remove this when the user ejects because the default
// is sane and uses Babel options. Instead of options, we use
// the react-scripts and babel-preset-react-app versions.
cacheIdentifier: getCacheIdentifier('development', [
'babel-plugin-named-asset-import',
'babel-preset-react-app',
'react-dev-utils',
'react-scripts',
]),
// @remove-on-eject-end
plugins: [
[
require.resolve('babel-plugin-named-asset-import'),
{
loaderMap: {
svg: {
ReactComponent: '@svgr/webpack?-prettier,-svgo![path]',
},
},
},
],
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// Don't waste time on Gzipping the cache
cacheCompression: false,
},
},
// Process any JS outside of the app with Babel.
// Unlike the application JS, we only compile the standard ES features.
{
test: /\.(js|mjs)$/,
exclude: /@babel(?:\/|\\{1,2})runtime/,
loader: require.resolve('babel-loader'),
options: {
babelrc: false,
configFile: false,
compact: false,
presets: [
[
require.resolve('babel-preset-react-app/dependencies'),
{ helpers: true },
],
],
cacheDirectory: true,
// Don't waste time on Gzipping the cache
cacheCompression: false,
// @remove-on-eject-begin
cacheIdentifier: getCacheIdentifier('development', [
'babel-plugin-named-asset-import',
'babel-preset-react-app',
'react-dev-utils',
'react-scripts',
]),
// @remove-on-eject-end
// If an error happens in a package, it's possible to be
// because it was compiled. Thus, we don't want the browser
// debugger to show the original code. Instead, the code
// being evaluated would be much more helpful.
sourceMaps: false,
},
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use a plugin to extract that CSS to a file, but
// in development "style" loader enables hot editing of CSS.
// By default we support CSS Modules with the extension .module.css
{
test: cssRegex,
exclude: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
}),
},
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
// using the extension .module.css
{
test: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
}),
},
// Opt-in support for SASS (using .scss or .sass extensions).
// Chains the sass-loader with the css-loader and the style-loader
// to immediately apply all styles to the DOM.
// By default we support SASS Modules with the
// extensions .module.scss or .module.sass
{
test: sassRegex,
exclude: sassModuleRegex,
use: getStyleLoaders({ importLoaders: 2 }, 'sass-loader'),
},
// Adds support for CSS Modules, but using SASS
// using the extension .module.scss or .module.sass
{
test: sassModuleRegex,
use: getStyleLoaders(
{
importLoaders: 2,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
},
'sass-loader'
),
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
],
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
plugins: [
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
}),
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In development, this will be an empty string.
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
// This gives some necessary context to module not found errors, such as
// the requesting resource.
new ModuleNotFoundPlugin(paths.appPath),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(env.stringified),
// This is necessary to emit hot updates (currently CSS only):
new webpack.HotModuleReplacementPlugin(),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebook/create-react-app/issues/240
new CaseSensitivePathsPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebook/create-react-app/issues/186
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
publicPath: publicPath,
}),
// TypeScript type checking
useTypeScript &&
new ForkTsCheckerWebpackPlugin({
typescript: resolve.sync('typescript', {
basedir: paths.appNodeModules,
}),
async: false,
checkSyntacticErrors: true,
tsconfig: paths.appTsConfig,
watch: paths.appSrc,
silent: true,
formatter: typescriptFormatter,
}),
].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
performance: false,
};
|
/**
* Wallet
*
* Author: Taslim Oseni <[email protected]>
**/
const request = require('../helper/request');
class Wallets {
constructor (config = {}) {
this.config = config;
}
/**
* Create Wallet
*
* Create a wallet
* @param {String} data.account_id Account ID of the investment account
* @param {String} data.currency_code Currency code
*/
createWallet(data) {
return request.perform(this.config, {
method: "POST",
endpoint: "/wallets",
data: data
});
}
/**
* Get Wallet
*
* Get/List all wallets
*/
getWallets() {
return request.perform(this.config, {
method: "GET",
endpoint: "/wallets"
});
}
/**
* Transfer from Wallet
*
* Transfer from wallet
* @param {String} wallet_id The wallet_id of the investment account
* @param {String} data.product_code Destination product code
* @param {String} data.amount Amount is in lowest currency (e.g kobo)
*/
transferFromWallet(wallet_id, data) {
return request.perform(this.config, {
method: "POST",
endpoint: "/wallets/" +wallet_id +"/transfer",
data: data
});
}
}
module.exports = Wallets |
/**
* Version 2.0
*
* Written by Micael Sjölund, ESN (http://www.esn.me)
*
* Creates a growing container that automatically fills its content via ajax requests, when the user scrolls to the
* bottom of the container. More info: http://pushingtheweb.com/2010/09/endless-scroller-jquery-plugin/
*
* Requires jStorage (), if the useCache option is set to true. WARNING: Somewhat experimental. See below for more info.
*
*
* Usage:
* .autobrowse(options)
* options Map of property-value options which controls plugin behaviour.
* .autobrowse(command)
* command String command that can be sent to the plugin.
*
*
* * COMMANDS
* * "flush" Clears the plugin cache
*
*
* * OPTIONS
* * url Callback to render url from offset argument.
* Example: function (offset) { return "http://mydomain.com/OFFSET/20".replace(/OFFSET/, offset) }
* * template Callback to render markup from json response.
* Example: function (response) { var markup=''; for (var i=0; i<response.length; i++) { markup+='<img src="'+response[i]+'" />' } return markup; }
* * itemsReturned Callback that is run on ajax json response to determine how many items was returned
*
* * OPTIONAL OPTIONS
* * loader Element, jQuery object or markup to indicate to the user that the site is waiting for more items.
* * offset Item offset for first ajax call to url, if you have already rendered items on the page
* * max Maximum number of items to be retrieved by the plugin (can also be used to tell the plugin how many
* items there are in total on the server, so that no unneccesary requests are made.
* * complete Callback that is run when the element has been updated with new content. This is run before the
* response is stored (if using useCache), making it is possible to manipulate the response here before
* it is stored.
* * sensitivity Number of pixels before end of element that the plugin will start fetching more items.
* * postData If you want to do a POST request instead of a GET request, supply this argument, either as a
* function or an object. If not set, a GET request will be made.
* * useCache If true, the plugin will use browser storage to keep the state between page loads. If the user
* clicks away from the page and then goes back, all items fetched will be rendered again, and the
* user will see the same view as when he left the page. Requires http://www.jstorage.info/.
* WARNING: This doesn't work with original jStorage. A modified version is
* available on http://github.com/msjolund/jquery-esn-autobrowse. jStorage also
* requires jquery-json: http://code.google.com/p/jquery-json/. Default: false
* * expiration How long to keep cache, in hours. Default: 24
* * stopFunction a function that will return true if it is necessary to stop autoscrolling
* * onError a function that will be executed on error (HTTP response 500, etc.)
*
*/
(function( $ ){
jQuery.fn.autobrowse = function (options)
{
var defaults = {
url: function (offset) { return "/"; },
template: function (response) { return ""; },
offset: 0,
max: null,
loader: '<div class="loader"></div>',
itemsReturned: function (response) { return response.length },
complete: function (response) {},
finished: function (response) {},
useCache: false,
expiration: 24,
sensitivity: 0,
postData: null,
stopFunction: function () {},
onError: function () {}
};
// flush cache command
if (typeof options == "string" && options == "flush")
{
jQuery.jStorage.flush();
return this;
}
options = jQuery.extend(defaults, options);
// allow non-dynamic url
if (typeof options.url == "string")
{
var url = options.url;
options.url = function (offset) { return url; }
}
var getDataLength = function (data)
{
var length = 0;
for (var i = 0; i < data.length; i++)
length += options.itemsReturned(data[i]);
return length;
};
return this.each( function ()
{
var localData, obj = jQuery(this);
var currentOffset = options.offset;
var loading = false;
var scrollTopUpdateTimer = null;
var stopping = false;
var _stopPlugin = function (handler)
{
jQuery(window).unbind("scroll", handler);
options.finished.call(obj);
};
var scrollCallback = function ()
{
var scrollTop = jQuery(window).scrollTop();
var objBottom = obj.height() + obj.offset().top;
var winHeight = window.innerHeight ? window.innerHeight : $(window).height();
var winBtmPos = scrollTop + winHeight;
if (scrollTopUpdateTimer)
clearTimeout(scrollTopUpdateTimer);
if (options.useCache) {
scrollTopUpdateTimer = setTimeout(function () { jQuery.jStorage.set("autobrowseScrollTop", scrollTop); }, 200);
}
if (objBottom < winBtmPos + options.sensitivity && !loading)
{
var loader = jQuery(options.loader);
loader.appendTo(obj);
loading = true;
var ajaxCallback = function (response) {
if (options.itemsReturned(response) > 0)
{
// Create the markup and append it to the container
try { var markup = options.template(response); }
catch (e) { console.error(e) } // ignore for now
var newElements = jQuery(markup);
newElements.appendTo(obj);
// Call user onComplete callback
options.complete.call(obj, response, newElements);
// Store in local cache if option is set, and everything fetched fitted into the storage
if (options.useCache && getDataLength(localData) + options.offset == currentOffset)
{
localData.push(response);
if (!jQuery.jStorage.set("autobrowseStorage", localData))
// Storage failed, remove last pushed response
localData.pop();
}
// Update offsets
currentOffset += options.itemsReturned(response);
if (options.useCache)
{
jQuery.jStorage.set("autobrowseOffset", currentOffset);
}
}
loader.remove();
// Check if these were the last items to fetch from the server, if so, stop listening
if (options.itemsReturned(response) == 0 || (options.max != null && currentOffset >= options.max) || options.stopFunction(response) === true)
{
_stopPlugin(scrollCallback)
stopping = true;
}
loading = false;
if (!stopping) {
scrollCallback();
}
};
if (options.postData)
{
var data = null;
if (typeof options.postData == "function")
{
data = options.postData();
}
else
{
data = options.postData;
}
jQuery.post(options.url(currentOffset), data, ajaxCallback, "json").error(options.onError);
}
else
{
jQuery.getJSON(options.url(currentOffset), ajaxCallback).error(options.onError);
}
}
};
var _startPlugin = function()
{
if (options.useCache)
var autobrowseScrollTop = jQuery.jStorage.get("autobrowseScrollTop");
if (autobrowseScrollTop)
jQuery(window).scrollTop(autobrowseScrollTop);
jQuery(window).scroll(scrollCallback);
scrollCallback();
};
if (options.useCache)
{
if (jQuery.jStorage.get("autobrowseStorageKey") != options.url(0,0))
{
// flush cache if wrong page
jQuery.jStorage.flush();
}
else if (jQuery.jStorage.get("autobrowseExpiration") && jQuery.jStorage.get("autobrowseExpiration") < (new Date()).getTime())
{
// flush cache if it's expired
jQuery.jStorage.flush();
}
localData= jQuery.jStorage.get("autobrowseStorage");
if (localData)
{
// for each stored ajax response
for (var i = 0; i < localData.length; i++)
{
var markup = options.template(localData[i]);
jQuery(markup).appendTo(obj);
currentOffset += options.itemsReturned(localData[i]);
options.complete.call(obj, localData[i]);
}
_startPlugin();
}
else
{
localData = [];
jQuery.jStorage.get("autobrowseStorageKey")
jQuery.jStorage.set("autobrowseExpiration", (new Date()).getTime()+options.expiration*60*60*1000);
jQuery.jStorage.set("autobrowseOffset", currentOffset);
jQuery.jStorage.set("autobrowseStorageKey", options.url(0, 0));
jQuery.jStorage.set("autobrowseStorage", localData);
jQuery.jStorage.set("autobrowseScrollTop", 0);
_startPlugin();
}
}
else
{
_startPlugin();
}
});
};
})( jQuery ); |
import { any, string } from 'prop-types'
import React, { PureComponent } from 'react'
import { NotificationContainer } from 'react-notifications'
export class App extends PureComponent {
render() {
const { year, children } = this.props
return (
<div>
<NotificationContainer />
<div className="main-app">
<p>{`The year is ${year}`}</p>
{children}
</div>
</div>
)
}
}
App.propTypes = {
year: string,
children: any
}
|
export default function (state = {}, action){
switch(action.type){
case "SET_USER":
return {
...state,
userData: action.payload
}
default:
return state
}
} |
import React, { useState, useEffect } from "react";
import {
Form,
Input,
Button,
Select,
Card,
Typography,
notification,
Row,
Col,
} from "antd";
import PropTypes from "prop-types";
import { withRouter } from "react-router-dom";
import { connect } from "react-redux";
import { addMovie } from "../../../actions/movieActions";
import genres from "./genres";
import popCornImage from "../../../assets/img/popcorn.jpg";
const config = require("../../../config.json");
const { Option } = Select;
const { TextArea } = Input;
const { Title } = Typography;
const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 16 },
};
const tailLayout = {
wrapperCol: { offset: 8, span: 16 },
};
const AddMovie = (props) => {
const [errors, setErrors] = useState({});
const [flag, setFlag] = useState(false);
const [selectedImage, setSelectedImage] = useState({});
const { goBack } = props;
useEffect(() => {
if (props.errors !== errors) {
setErrors(props.errors);
}
}, [props.errors, errors, props.auth, props.history]);
const responseMessage = (errorText) => {
notification["error"]({
message: "Failed to add movie!",
description: errorText,
});
};
const onChange = (event) => {
setSelectedImage(event.target.files[0]);
};
const onSubmit = async (values) => {
setFlag(true);
const formData = new FormData();
formData.append("file", selectedImage);
formData.append("upload_preset", config.upload_preset);
await fetch(config.cloudinary_api, {
method: "POST",
body: formData,
})
.then((response) => response.json())
.then((data) => {
const movieInfo = {
title: values["title"],
genre: values["genre"],
description: values["description"],
trailerUrl: values["trailerUrl"],
imageUrl: data.secure_url,
};
props.addMovie(movieInfo);
});
setTimeout(() => {
goBack();
}, 2000);
};
return (
<Row>
<Col span={12} className="gutter-row">
<div align="left" className="add">
<Card
title={<Title level={3}>Add Movie</Title>}
bordered={true}
style={{
width: "auto",
marginBottom: -3,
borderRadius: "16px",
boxShadow: "5px 8px 24px 5px rgba(208, 216, 243, 0.6)",
}}
>
{errors.message && flag ? responseMessage(errors.message) : null}
<div align="center">
<Form
{...layout}
style={{ margin: 20, width: 600 }}
name="nest-messages"
onFinish={onSubmit}
>
<Form.Item
name="title"
label="Title"
style={{ marginBottom: 20 }}
rules={[
{
required: true,
},
]}
>
<Input />
</Form.Item>
<Form.Item
name="genre"
label="Genre"
style={{ marginBottom: 20 }}
rules={[
{
required: true,
},
]}
>
<Select
showSearch
// onChange={onGenreChange}
allowClear
placeholder="Please select a genre"
optionFilterProp="children"
filterOption={(input, option) =>
option.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
}
filterSort={(optionA, optionB) =>
optionA.children
.toLowerCase()
.localeCompare(optionB.children.toLowerCase())
}
>
{genres.map((g) => {
return <Option value={g}>{g}</Option>;
})}
</Select>
</Form.Item>
<Form.Item
name="description"
label="Description"
style={{ marginBottom: 20 }}
rules={[
{
required: true,
},
]}
>
<TextArea
placeholder="Movie Description"
autoSize={{ minRows: 3, maxRows: 5 }}
/>
</Form.Item>
<Form.Item
name="trailerUrl"
label="Trailer Link"
style={{ marginBottom: 20 }}
rules={[
{
required: true,
},
]}
>
<Input />
</Form.Item>
<Form.Item
name="imageUrl"
label="Image"
style={{ marginBottom: 20 }}
rules={[
{
required: true,
},
]}
>
<input type="file" onChange={(event) => onChange(event)} />
</Form.Item>
<Form.Item {...tailLayout}>
<Button
type="primary"
htmlType="submit"
style={{ width: 200 }}
>
Add
</Button>
</Form.Item>
</Form>
</div>
</Card>
</div>
</Col>
<Col span={12} className="gutter-row">
<div align="center">
<img
alt="example"
src={popCornImage}
style={{
height: 425,
width: 810,
marginRight: -50,
marginTop: -24,
}}
/>
</div>
</Col>
</Row>
);
};
AddMovie.propTypes = {
addMovie: PropTypes.func.isRequired,
auth: PropTypes.object.isRequired,
errors: PropTypes.object.isRequired,
};
const mapStateToProps = (state) => ({
auth: state.auth,
errors: state.errors,
});
export default connect(mapStateToProps, { addMovie })(withRouter(AddMovie));
|
var through = require('through')
var match = require('./match')
var serialize = require('stream-serializer')()
var recycle = require('cycle').retrocycle
var EventEmitter = require('events').EventEmitter
function repler (dest) {
var emitter = new EventEmitter()
var history = emitter.history = []
var position = emitter.position = 0
emitter.createStream = function () {
var s = serialize(through(function (data) {
console.log(data)
if('undefined' !== typeof data.output) {
emitter.emit('result', data)
} else {
emitter.emit('match', data)
}
}))
function queue (data) { s.queue(data) }
emitter.on('query', queue)
s.once('close', function () {
emitter.removeListener('query', queue)
})
return s
}
emitter.suggest = function (v) {
emitter.emit('query', {suggest: v})
return this
}
emitter.eval = function (v) {
if(history[0] !== v) history.unshift(v)
emitter.position = 0
emitter.emit('query', {eval: v})
return this
}
emitter.forward = function () {
if(emitter.position > 0)
emitter.emit('update', history[--emitter.position])
return this
}
emitter.back = function () {
if(history.length > emitter.position + 1)
emitter.emit('update', history[++emitter.position])
}
return emitter
}
module.exports = repler
|
# -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage,
# (C) 2020 MinIO, Inc.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# A Chain credentials provider, provides a way of chaining multiple providers
# together and will pick the first available using priority order of the
# 'providers' list
from minio import Minio
from minio.credentials import Chain, Credentials, EnvAWS, EnvMinio, IAMProvider
client = Minio('s3.amazonaws.com',
credentials=Credentials(
provider=Chain(
providers=[
IAMProvider(),
EnvAWS(),
EnvMinio()
]
)
))
|
export default {
"language": "english",
"version": 1.0,
"location": "Location",
"professional_experience": "Professional Experience",
"education": "Education",
"hobbies": "Personal Practices",
"personal_info": "Personal Information",
"mobile": "Mobile" ,
"email": "E-mail",
"linkedin": "Linkedin",
"id": "ID",
"git": "Git",
"skills": "Skills",
"expert": "Expert",
"advanced": "Advanced",
"intermediate": "Intermediate",
"basic": "Basic",
"beginner": "Beginner",
"soft_skills": "Soft Skills",
"languages": "Languages",
"from": "from"
} |
import FilterEnum from "./FilterEnum"
import withFieldRelates from "./_withFieldRelates"
export default withFieldRelates(FilterEnum); |
const Path = require ( 'path' );
const s_Fs = require ( 'st_ini_fs' );
const { arht } = require ( 'st_ini_arht' );
const arr_names = Object.getOwnPropertyNames ( s_Fs );
arr_names.map ( item => arht.before ( s_Fs[item], module ) );
const funcExamp = require ( '../../index' );
arht.before ( funcExamp ,module);
// MODE for behavior
// funcExamp.mode.log = true;
// funcExamp.mode.deb = true;
// funcExamp.mode.debLog = true;
funcExamp.mode.logFs = true;
// funcExamp.mode.stack = true;
funcExamp.preset = { if_basename: true };
funcExamp ();
debugger
|
import TimePicker from './TimePicker'
export default TimePicker
|
from typing import Dict, Optional
from qcodes import IPInstrument
from qcodes.utils import validators as vals
from qcodes.instrument.channel import InstrumentChannel, ChannelList
class MC_channel(InstrumentChannel):
def __init__(self, parent: "RC_SPDT", name: str, channel_letter: str):
"""
Args:
parent: The instrument the channel is a part of
name: the name of the channel
channel_letter: channel letter ['a', 'b', 'c' or 'd'])
"""
super().__init__(parent, name)
self.channel_letter = channel_letter.upper()
_chanlist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
self.channel_number = _chanlist.index(channel_letter)
self.add_parameter('switch',
label='switch',
set_cmd=self._set_switch,
get_cmd=self._get_switch,
vals=vals.Ints(1, 2)
)
def _set_switch(self, switch: int) -> None:
self.write('SET{}={}'.format(self.channel_letter, switch-1))
def _get_switch(self) -> int:
val = int(self.ask('SWPORT?'))
# select out bit in return number
# corisponding to channel switch configuration
# LSB corrisponds to Chan A etc
ret = (val >> self.channel_number) & 1
return ret+1
class RC_SPDT(IPInstrument):
"""
Mini-Circuits SPDT RF switch
Args:
name: the name of the instrument
address: ip address ie "10.0.0.1"
port: port to connect to default Telnet:23
"""
def __init__(self, name: str, address: str, port: int = 23):
super().__init__(name, address, port)
self.flush_connection()
channels = ChannelList(self, "Channels", MC_channel,
snapshotable=False)
_chanlist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
_max_channel_number = int(self.IDN()['model'][3])
_chanlist = _chanlist[0:_max_channel_number]
for c in _chanlist:
channel = MC_channel(self, f'channel_{c}', c)
channels.append(channel)
self.add_submodule(f'channel_{c}', channel)
channels.lock()
self.add_submodule('channels', channels)
self.connect_message()
def ask(self, cmd: str) -> str:
ret = self.ask_raw(cmd)
ret = ret.strip()
return ret
def get_idn(self) -> Dict[str, Optional[str]]:
fw = self.ask('FIRMWARE?')
MN = self.ask('MN?')
SN = self.ask('SN?')
id_dict: Dict[str, Optional[str]] = {
'firmware': fw,
'model': MN[3:],
'serial': SN[3:],
'vendor': 'Mini-Circuits'
}
return id_dict
|
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F # torch functions
import torch.optim as optim # torch optimization
class LeNet(nn.Module):
def __init__(self):
super(LeNet, self).__init__()
# convolutional layers
self.conv1 = nn.Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1)) # 1 image, 6 output channels, 5x5 convolution
self.conv2 = nn.Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))
# hidden layers
self.fc1 = nn.Linear(16 * 5 * 5, 120) # layer 1 activation
self.fc2 = nn.Linear(120, 84)
self.fc3 = nn.Linear(84, 10)
def forward(self, x):
"""
forward must be overwritten in torch model class
"""
# conv layers
x = F.max_pool2d(F.relu(self.conv1(x)), (2, 2)) # add pooling layer
x = F.max_pool2d(F.relu(self.conv2(x)), (2, 2))
x = x.view(-1, self.num_flat_features(x)) # view manipulates shape
# fully connected layers
x = F.relu(self.fc1(x))
x = F.relu(self.fc2(x))
x = self.fc3(x)
return x
def num_flat_features(self, x):
size = x.size()[1:]
num_features = 1
for s in size:
num_features *= s
return num_features
if __name__ == "__main__":
net = LeNet()
print(net)
params = list(net.parameters())
print(len(params))
print('conv1 weight\n', params[0].size()) # conv1's .weight
_input = Variable(torch.randn(1, 1, 32, 32)) # create input vector
out = net(_input) # run the input vector through the network
print('out\n', out)
net.zero_grad()
out.backward(torch.randn(1, 10))
output = net(_input)
target = Variable(torch.arange(1, 11)) # a dummy target, for example
criterion = nn.MSELoss()
loss = criterion(output, target) # loss function docs: http://pytorch.org/docs/master/nn.html
print('loss\n', loss)
print(loss.grad_fn)
print(loss.grad_fn) # MSELoss
print(loss.grad_fn.next_functions[0][0]) # Linear
print(loss.grad_fn.next_functions[0][0].next_functions[0][0]) # ReLU
net.zero_grad() # zeroes the gradient buffers of all parameters
print('conv1.bias.grad before backward propagation')
print(net.conv1.bias.grad)
loss.backward()
print('conv1.bias.grad after backward')
print(net.conv1.bias.grad)
# gradient descent
learning_rate = 0.01
for f in net.parameters(): # this
f.data.sub_(f.grad.data * learning_rate)
params = list(net.parameters())
print(len(params))
print('conv1 weight\n', params[0].size()) # conv1's .weight
# create your optimizer
optimizer = optim.SGD(net.parameters(), lr=0.01)
# in your training loop:
for i in range(10):
optimizer.zero_grad() # zero the gradient buffers
output = net(_input)
loss = criterion(output, target) # mse loss
loss.backward() # back propagate
optimizer.step() # do the update
|
const { join } = require('path');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); // 友好的错误提示
const WebpackBuildNotifierPlugin = require('webpack-build-notifier'); // webpack 弹窗提示
const setTitle = require('node-bash-title'); // 设置小黑板窗口title
const setIterm2Badge = require('set-iterm2-badge'); // 小黑板水印
const CopyPlugin = require('copy-webpack-plugin'); // copy文件插件
setTitle('🍊开发环境配置');
setIterm2Badge('8081');
module.exports = {
devServer: {
contentBase: join(__dirname, '../dist'),
hot: true,
quiet: true // 配合FriendlyErrorsWebpackPlugin
},
plugins: [
new CopyPlugin([
{
from: join(__dirname, '../', 'src/client/views/layouts/layout.html'),
to: '../views/layouts/layout.html'
}
]),
new CopyPlugin([
{
from: join(__dirname, '../', 'src/client/components'),
to: '../components'
}
], {
ignore: ['*.js', '*.css', '.DS_Store']
}),
new WebpackBuildNotifierPlugin({
title: "My Project Webpack Build",
logo: join(__dirname, '../dogs.png'),
suppressSuccess: true
}),
new FriendlyErrorsWebpackPlugin({
compilationSuccessInfo: { // 启动成功
messages: ['You application is running here http://localhost:8081'],
notes: ['编译成功啦~']
}
})
]
} |
var TestData = require('./config/test_data');
Feature('Error message is displayed when trying to use an expired link');
Scenario('@smoke @expiredlinks I try to reset my password with an expired reset password link', (I) => {
I.amOnPage('/passwordReset?action=start&token=invalidtoken&code=somecode');
I.waitForText('Your link has expired, or has already been used', 180, 'h1');
I.see('For security, your link is only valid for 48 hours.');
}).retry(TestData.SCENARIO_RETRY_LIMIT); |
from flask import Flask, request, render_template
import jageocoder
jageocoder.init()
app = Flask(__name__)
@app.route("/")
def index():
return render_template('index.html', q='', result=None)
@app.route("/search", methods=['POST', 'GET'])
def search():
query = request.args.get('q') or None
if query:
results = jageocoder.searchNode(query, best_only=True)
else:
results = None
return render_template('index.html', q=query, results=results)
|
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var Icon = require('../Icon-399ca71f.js');
var React = require('react');
require('@carbon/icon-helpers');
require('prop-types');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var _path;
var FaceNeutralFilled16 = /*#__PURE__*/React__default['default'].forwardRef(function FaceNeutralFilled16(_ref, ref) {
var children = _ref.children,
rest = Icon._objectWithoutProperties(_ref, ["children"]);
return /*#__PURE__*/React__default['default'].createElement(Icon.Icon, Icon._extends({
width: 16,
height: 16,
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor",
ref: ref
}, rest), _path || (_path = /*#__PURE__*/React__default['default'].createElement("path", {
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2ZM9,13.5A2.5,2.5,0,1,1,11.5,16,2.5,2.5,0,0,1,9,13.5ZM22,22H10V20H22Zm-1.5-6A2.5,2.5,0,1,1,23,13.5,2.5,2.5,0,0,1,20.5,16Z"
})), children);
});
module.exports = FaceNeutralFilled16;
|
""" implement the TimedeltaIndex """
from datetime import timedelta
import numpy as np
from pandas.core.dtypes.common import (
_TD_DTYPE,
is_integer,
is_float,
is_bool_dtype,
is_list_like,
is_scalar,
is_timedelta64_dtype,
is_timedelta64_ns_dtype,
pandas_dtype,
_ensure_int64)
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.generic import ABCSeries
from pandas.core.common import _maybe_box, _values_from_object
from pandas.core.indexes.base import Index
from pandas.core.indexes.numeric import Int64Index
import pandas.compat as compat
from pandas.compat import u
from pandas.tseries.frequencies import to_offset
from pandas.core.algorithms import checked_add_with_arr
from pandas.core.base import _shared_docs
from pandas.core.indexes.base import _index_shared_docs
import pandas.core.common as com
import pandas.core.dtypes.concat as _concat
from pandas.util._decorators import Appender, Substitution, deprecate_kwarg
from pandas.core.indexes.datetimelike import TimelikeOps, DatetimeIndexOpsMixin
from pandas.core.tools.timedeltas import (
to_timedelta, _coerce_scalar_to_timedelta_type)
from pandas.tseries.offsets import Tick, DateOffset
from pandas._libs import (lib, index as libindex, tslib as libts,
join as libjoin, Timedelta, NaT, iNaT)
from pandas._libs.tslibs.timedeltas import array_to_timedelta64
from pandas._libs.tslibs.fields import get_timedelta_field
def _field_accessor(name, alias, docstring=None):
def f(self):
values = self.asi8
result = get_timedelta_field(values, alias)
if self.hasnans:
result = self._maybe_mask_results(result, convert='float64')
return Index(result, name=self.name)
f.__name__ = name
f.__doc__ = docstring
return property(f)
def _td_index_cmp(opname, cls, nat_result=False):
"""
Wrap comparison operations to convert timedelta-like to timedelta64
"""
def wrapper(self, other):
msg = "cannot compare a TimedeltaIndex with type {0}"
func = getattr(super(TimedeltaIndex, self), opname)
if _is_convertible_to_td(other) or other is NaT:
try:
other = _to_m8(other)
except ValueError:
# failed to parse as timedelta
raise TypeError(msg.format(type(other)))
result = func(other)
if isna(other):
result.fill(nat_result)
else:
if not is_list_like(other):
raise TypeError(msg.format(type(other)))
other = TimedeltaIndex(other).values
result = func(other)
result = _values_from_object(result)
if isinstance(other, Index):
o_mask = other.values.view('i8') == iNaT
else:
o_mask = other.view('i8') == iNaT
if o_mask.any():
result[o_mask] = nat_result
if self.hasnans:
result[self._isnan] = nat_result
# support of bool dtype indexers
if is_bool_dtype(result):
return result
return Index(result)
return compat.set_function_name(wrapper, opname, cls)
class TimedeltaIndex(DatetimeIndexOpsMixin, TimelikeOps, Int64Index):
"""
Immutable ndarray of timedelta64 data, represented internally as int64, and
which can be boxed to timedelta objects
Parameters
----------
data : array-like (1-dimensional), optional
Optional timedelta-like data to construct index with
unit: unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional
which is an integer/float number
freq: a frequency for the index, optional
copy : bool
Make a copy of input ndarray
start : starting value, timedelta-like, optional
If data is None, start is used as the start point in generating regular
timedelta data.
periods : int, optional, > 0
Number of periods to generate, if generating index. Takes precedence
over end argument
end : end time, timedelta-like, optional
If periods is none, generated index will extend to first conforming
time on or just past end argument
closed : string or None, default None
Make the interval closed with respect to the given frequency to
the 'left', 'right', or both sides (None)
name : object
Name to be stored in the index
Notes
-----
To learn more about the frequency strings, please see `this link
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
See Also
---------
Index : The base pandas Index type
Timedelta : Represents a duration between two dates or times.
DatetimeIndex : Index of datetime64 data
PeriodIndex : Index of Period data
Attributes
----------
days
seconds
microseconds
nanoseconds
components
inferred_freq
Methods
-------
to_pytimedelta
to_series
round
floor
ceil
to_frame
"""
_typ = 'timedeltaindex'
_join_precedence = 10
def _join_i8_wrapper(joinf, **kwargs):
return DatetimeIndexOpsMixin._join_i8_wrapper(
joinf, dtype='m8[ns]', **kwargs)
_inner_indexer = _join_i8_wrapper(libjoin.inner_join_indexer_int64)
_outer_indexer = _join_i8_wrapper(libjoin.outer_join_indexer_int64)
_left_indexer = _join_i8_wrapper(libjoin.left_join_indexer_int64)
_left_indexer_unique = _join_i8_wrapper(
libjoin.left_join_indexer_unique_int64, with_indexers=False)
_arrmap = None
# define my properties & methods for delegation
_other_ops = []
_bool_ops = []
_object_ops = ['freq']
_field_ops = ['days', 'seconds', 'microseconds', 'nanoseconds']
_datetimelike_ops = _field_ops + _object_ops + _bool_ops
_datetimelike_methods = ["to_pytimedelta", "total_seconds",
"round", "floor", "ceil"]
@classmethod
def _add_comparison_methods(cls):
""" add in comparison methods """
cls.__eq__ = _td_index_cmp('__eq__', cls)
cls.__ne__ = _td_index_cmp('__ne__', cls, nat_result=True)
cls.__lt__ = _td_index_cmp('__lt__', cls)
cls.__gt__ = _td_index_cmp('__gt__', cls)
cls.__le__ = _td_index_cmp('__le__', cls)
cls.__ge__ = _td_index_cmp('__ge__', cls)
_engine_type = libindex.TimedeltaEngine
_comparables = ['name', 'freq']
_attributes = ['name', 'freq']
_is_numeric_dtype = True
_infer_as_myclass = True
freq = None
def __new__(cls, data=None, unit=None,
freq=None, start=None, end=None, periods=None,
copy=False, name=None,
closed=None, verify_integrity=True, **kwargs):
if isinstance(data, TimedeltaIndex) and freq is None and name is None:
if copy:
return data.copy()
else:
return data._shallow_copy()
freq_infer = False
if not isinstance(freq, DateOffset):
# if a passed freq is None, don't infer automatically
if freq != 'infer':
freq = to_offset(freq)
else:
freq_infer = True
freq = None
if periods is not None:
if is_float(periods):
periods = int(periods)
elif not is_integer(periods):
msg = 'periods must be a number, got {periods}'
raise TypeError(msg.format(periods=periods))
if data is None and freq is None:
raise ValueError("Must provide freq argument if no data is "
"supplied")
if data is None:
return cls._generate(start, end, periods, name, freq,
closed=closed)
if unit is not None:
data = to_timedelta(data, unit=unit, box=False)
if not isinstance(data, (np.ndarray, Index, ABCSeries)):
if is_scalar(data):
raise ValueError('TimedeltaIndex() must be called with a '
'collection of some kind, %s was passed'
% repr(data))
# convert if not already
if getattr(data, 'dtype', None) != _TD_DTYPE:
data = to_timedelta(data, unit=unit, box=False)
elif copy:
data = np.array(data, copy=True)
# check that we are matching freqs
if verify_integrity and len(data) > 0:
if freq is not None and not freq_infer:
index = cls._simple_new(data, name=name)
inferred = index.inferred_freq
if inferred != freq.freqstr:
on_freq = cls._generate(
index[0], None, len(index), name, freq)
if not np.array_equal(index.asi8, on_freq.asi8):
raise ValueError('Inferred frequency {0} from passed '
'timedeltas does not conform to '
'passed frequency {1}'
.format(inferred, freq.freqstr))
index.freq = freq
return index
if freq_infer:
index = cls._simple_new(data, name=name)
inferred = index.inferred_freq
if inferred:
index.freq = to_offset(inferred)
return index
return cls._simple_new(data, name=name, freq=freq)
@classmethod
def _generate(cls, start, end, periods, name, offset, closed=None):
if com._count_not_none(start, end, periods) != 2:
raise ValueError('Of the three parameters: start, end, and '
'periods, exactly two must be specified')
if start is not None:
start = Timedelta(start)
if end is not None:
end = Timedelta(end)
left_closed = False
right_closed = False
if start is None and end is None:
if closed is not None:
raise ValueError("Closed has to be None if not both of start"
"and end are defined")
if closed is None:
left_closed = True
right_closed = True
elif closed == "left":
left_closed = True
elif closed == "right":
right_closed = True
else:
raise ValueError("Closed has to be either 'left', 'right' or None")
index = _generate_regular_range(start, end, periods, offset)
index = cls._simple_new(index, name=name, freq=offset)
if not left_closed:
index = index[1:]
if not right_closed:
index = index[:-1]
return index
@property
def _box_func(self):
return lambda x: Timedelta(x, unit='ns')
@classmethod
def _simple_new(cls, values, name=None, freq=None, **kwargs):
values = np.array(values, copy=False)
if values.dtype == np.object_:
values = array_to_timedelta64(values)
if values.dtype != _TD_DTYPE:
values = _ensure_int64(values).view(_TD_DTYPE)
result = object.__new__(cls)
result._data = values
result.name = name
result.freq = freq
result._reset_identity()
return result
@property
def _formatter_func(self):
from pandas.io.formats.format import _get_format_timedelta64
return _get_format_timedelta64(self, box=True)
def __setstate__(self, state):
"""Necessary for making this object picklable"""
if isinstance(state, dict):
super(TimedeltaIndex, self).__setstate__(state)
else:
raise Exception("invalid pickle state")
_unpickle_compat = __setstate__
def _maybe_update_attributes(self, attrs):
""" Update Index attributes (e.g. freq) depending on op """
freq = attrs.get('freq', None)
if freq is not None:
# no need to infer if freq is None
attrs['freq'] = 'infer'
return attrs
def _add_delta(self, delta):
if isinstance(delta, (Tick, timedelta, np.timedelta64)):
new_values = self._add_delta_td(delta)
name = self.name
elif isinstance(delta, TimedeltaIndex):
new_values = self._add_delta_tdi(delta)
# update name when delta is index
name = com._maybe_match_name(self, delta)
else:
raise ValueError("cannot add the type {0} to a TimedeltaIndex"
.format(type(delta)))
result = TimedeltaIndex(new_values, freq='infer', name=name)
return result
def _evaluate_with_timedelta_like(self, other, op, opstr):
# allow division by a timedelta
if opstr in ['__div__', '__truediv__', '__floordiv__']:
if _is_convertible_to_td(other):
other = Timedelta(other)
if isna(other):
raise NotImplementedError(
"division by pd.NaT not implemented")
i8 = self.asi8
if opstr in ['__floordiv__']:
result = i8 // other.value
else:
result = op(i8, float(other.value))
result = self._maybe_mask_results(result, convert='float64')
return Index(result, name=self.name, copy=False)
return NotImplemented
def _add_datelike(self, other):
# adding a timedeltaindex to a datetimelike
from pandas import Timestamp, DatetimeIndex
if other is NaT:
result = self._nat_new(box=False)
else:
other = Timestamp(other)
i8 = self.asi8
result = checked_add_with_arr(i8, other.value,
arr_mask=self._isnan)
result = self._maybe_mask_results(result, fill_value=iNaT)
return DatetimeIndex(result, name=self.name, copy=False)
def _sub_datelike(self, other):
from pandas import DatetimeIndex
if other is NaT:
result = self._nat_new(box=False)
else:
raise TypeError("cannot subtract a datelike from a TimedeltaIndex")
return DatetimeIndex(result, name=self.name, copy=False)
def _format_native_types(self, na_rep=u('NaT'),
date_format=None, **kwargs):
from pandas.io.formats.format import Timedelta64Formatter
return Timedelta64Formatter(values=self,
nat_rep=na_rep,
justify='all').get_result()
days = _field_accessor("days", "days",
" Number of days for each element. ")
seconds = _field_accessor("seconds", "seconds",
" Number of seconds (>= 0 and less than 1 day) "
"for each element. ")
microseconds = _field_accessor("microseconds", "microseconds",
"\nNumber of microseconds (>= 0 and less "
"than 1 second) for each\nelement. ")
nanoseconds = _field_accessor("nanoseconds", "nanoseconds",
"\nNumber of nanoseconds (>= 0 and less "
"than 1 microsecond) for each\nelement.\n")
@property
def components(self):
"""
Return a dataframe of the components (days, hours, minutes,
seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas.
Returns
-------
a DataFrame
"""
from pandas import DataFrame
columns = ['days', 'hours', 'minutes', 'seconds',
'milliseconds', 'microseconds', 'nanoseconds']
hasnans = self.hasnans
if hasnans:
def f(x):
if isna(x):
return [np.nan] * len(columns)
return x.components
else:
def f(x):
return x.components
result = DataFrame([f(x) for x in self])
result.columns = columns
if not hasnans:
result = result.astype('int64')
return result
def total_seconds(self):
"""
Total duration of each element expressed in seconds.
"""
return Index(self._maybe_mask_results(1e-9 * self.asi8),
name=self.name)
def to_pytimedelta(self):
"""
Return TimedeltaIndex as object ndarray of datetime.timedelta objects
Returns
-------
datetimes : ndarray
"""
return libts.ints_to_pytimedelta(self.asi8)
@Appender(_index_shared_docs['astype'])
def astype(self, dtype, copy=True):
dtype = pandas_dtype(dtype)
if is_timedelta64_dtype(dtype) and not is_timedelta64_ns_dtype(dtype):
# return an index (essentially this is division)
result = self.values.astype(dtype, copy=copy)
if self.hasnans:
values = self._maybe_mask_results(result, convert='float64')
return Index(values, name=self.name)
return Index(result.astype('i8'), name=self.name)
return super(TimedeltaIndex, self).astype(dtype, copy=copy)
def union(self, other):
"""
Specialized union for TimedeltaIndex objects. If combine
overlapping ranges with the same DateOffset, will be much
faster than Index.union
Parameters
----------
other : TimedeltaIndex or array-like
Returns
-------
y : Index or TimedeltaIndex
"""
self._assert_can_do_setop(other)
if not isinstance(other, TimedeltaIndex):
try:
other = TimedeltaIndex(other)
except (TypeError, ValueError):
pass
this, other = self, other
if this._can_fast_union(other):
return this._fast_union(other)
else:
result = Index.union(this, other)
if isinstance(result, TimedeltaIndex):
if result.freq is None:
result.freq = to_offset(result.inferred_freq)
return result
def join(self, other, how='left', level=None, return_indexers=False,
sort=False):
"""
See Index.join
"""
if _is_convertible_to_index(other):
try:
other = TimedeltaIndex(other)
except (TypeError, ValueError):
pass
return Index.join(self, other, how=how, level=level,
return_indexers=return_indexers,
sort=sort)
def _wrap_joined_index(self, joined, other):
name = self.name if self.name == other.name else None
if (isinstance(other, TimedeltaIndex) and self.freq == other.freq and
self._can_fast_union(other)):
joined = self._shallow_copy(joined, name=name)
return joined
else:
return self._simple_new(joined, name)
def _can_fast_union(self, other):
if not isinstance(other, TimedeltaIndex):
return False
freq = self.freq
if freq is None or freq != other.freq:
return False
if not self.is_monotonic or not other.is_monotonic:
return False
if len(self) == 0 or len(other) == 0:
return True
# to make our life easier, "sort" the two ranges
if self[0] <= other[0]:
left, right = self, other
else:
left, right = other, self
right_start = right[0]
left_end = left[-1]
# Only need to "adjoin", not overlap
return (right_start == left_end + freq) or right_start in left
def _fast_union(self, other):
if len(other) == 0:
return self.view(type(self))
if len(self) == 0:
return other.view(type(self))
# to make our life easier, "sort" the two ranges
if self[0] <= other[0]:
left, right = self, other
else:
left, right = other, self
left_end = left[-1]
right_end = right[-1]
# concatenate
if left_end < right_end:
loc = right.searchsorted(left_end, side='right')
right_chunk = right.values[loc:]
dates = _concat._concat_compat((left.values, right_chunk))
return self._shallow_copy(dates)
else:
return left
def _wrap_union_result(self, other, result):
name = self.name if self.name == other.name else None
return self._simple_new(result, name=name, freq=None)
def intersection(self, other):
"""
Specialized intersection for TimedeltaIndex objects. May be much faster
than Index.intersection
Parameters
----------
other : TimedeltaIndex or array-like
Returns
-------
y : Index or TimedeltaIndex
"""
self._assert_can_do_setop(other)
if not isinstance(other, TimedeltaIndex):
try:
other = TimedeltaIndex(other)
except (TypeError, ValueError):
pass
result = Index.intersection(self, other)
return result
if len(self) == 0:
return self
if len(other) == 0:
return other
# to make our life easier, "sort" the two ranges
if self[0] <= other[0]:
left, right = self, other
else:
left, right = other, self
end = min(left[-1], right[-1])
start = right[0]
if end < start:
return type(self)(data=[])
else:
lslice = slice(*left.slice_locs(start, end))
left_chunk = left.values[lslice]
return self._shallow_copy(left_chunk)
def _maybe_promote(self, other):
if other.inferred_type == 'timedelta':
other = TimedeltaIndex(other)
return self, other
def get_value(self, series, key):
"""
Fast lookup of value from 1-dimensional ndarray. Only use this if you
know what you're doing
"""
if _is_convertible_to_td(key):
key = Timedelta(key)
return self.get_value_maybe_box(series, key)
try:
return _maybe_box(self, Index.get_value(self, series, key),
series, key)
except KeyError:
try:
loc = self._get_string_slice(key)
return series[loc]
except (TypeError, ValueError, KeyError):
pass
try:
return self.get_value_maybe_box(series, key)
except (TypeError, ValueError, KeyError):
raise KeyError(key)
def get_value_maybe_box(self, series, key):
if not isinstance(key, Timedelta):
key = Timedelta(key)
values = self._engine.get_value(_values_from_object(series), key)
return _maybe_box(self, values, series, key)
def get_loc(self, key, method=None, tolerance=None):
"""
Get integer location for requested label
Returns
-------
loc : int
"""
if is_list_like(key):
raise TypeError
if isna(key):
key = NaT
if tolerance is not None:
# try converting tolerance now, so errors don't get swallowed by
# the try/except clauses below
tolerance = self._convert_tolerance(tolerance, np.asarray(key))
if _is_convertible_to_td(key):
key = Timedelta(key)
return Index.get_loc(self, key, method, tolerance)
try:
return Index.get_loc(self, key, method, tolerance)
except (KeyError, ValueError, TypeError):
try:
return self._get_string_slice(key)
except (TypeError, KeyError, ValueError):
pass
try:
stamp = Timedelta(key)
return Index.get_loc(self, stamp, method, tolerance)
except (KeyError, ValueError):
raise KeyError(key)
def _maybe_cast_slice_bound(self, label, side, kind):
"""
If label is a string, cast it to timedelta according to resolution.
Parameters
----------
label : object
side : {'left', 'right'}
kind : {'ix', 'loc', 'getitem'}
Returns
-------
label : object
"""
assert kind in ['ix', 'loc', 'getitem', None]
if isinstance(label, compat.string_types):
parsed = _coerce_scalar_to_timedelta_type(label, box=True)
lbound = parsed.round(parsed.resolution)
if side == 'left':
return lbound
else:
return (lbound + to_offset(parsed.resolution) -
Timedelta(1, 'ns'))
elif is_integer(label) or is_float(label):
self._invalid_indexer('slice', label)
return label
def _get_string_slice(self, key, use_lhs=True, use_rhs=True):
freq = getattr(self, 'freqstr',
getattr(self, 'inferred_freq', None))
if is_integer(key) or is_float(key) or key is NaT:
self._invalid_indexer('slice', key)
loc = self._partial_td_slice(key, freq, use_lhs=use_lhs,
use_rhs=use_rhs)
return loc
def _partial_td_slice(self, key, freq, use_lhs=True, use_rhs=True):
# given a key, try to figure out a location for a partial slice
if not isinstance(key, compat.string_types):
return key
raise NotImplementedError
# TODO(wesm): dead code
# parsed = _coerce_scalar_to_timedelta_type(key, box=True)
# is_monotonic = self.is_monotonic
# # figure out the resolution of the passed td
# # and round to it
# # t1 = parsed.round(reso)
# t2 = t1 + to_offset(parsed.resolution) - Timedelta(1, 'ns')
# stamps = self.asi8
# if is_monotonic:
# # we are out of range
# if (len(stamps) and ((use_lhs and t1.value < stamps[0] and
# t2.value < stamps[0]) or
# ((use_rhs and t1.value > stamps[-1] and
# t2.value > stamps[-1])))):
# raise KeyError
# # a monotonic (sorted) series can be sliced
# left = (stamps.searchsorted(t1.value, side='left')
# if use_lhs else None)
# right = (stamps.searchsorted(t2.value, side='right')
# if use_rhs else None)
# return slice(left, right)
# lhs_mask = (stamps >= t1.value) if use_lhs else True
# rhs_mask = (stamps <= t2.value) if use_rhs else True
# # try to find a the dates
# return (lhs_mask & rhs_mask).nonzero()[0]
@Substitution(klass='TimedeltaIndex')
@Appender(_shared_docs['searchsorted'])
@deprecate_kwarg(old_arg_name='key', new_arg_name='value')
def searchsorted(self, value, side='left', sorter=None):
if isinstance(value, (np.ndarray, Index)):
value = np.array(value, dtype=_TD_DTYPE, copy=False)
else:
value = _to_m8(value)
return self.values.searchsorted(value, side=side, sorter=sorter)
def is_type_compatible(self, typ):
return typ == self.inferred_type or typ == 'timedelta'
@property
def inferred_type(self):
return 'timedelta64'
@property
def dtype(self):
return _TD_DTYPE
@property
def is_all_dates(self):
return True
def insert(self, loc, item):
"""
Make new Index inserting new item at location
Parameters
----------
loc : int
item : object
if not either a Python datetime or a numpy integer-like, returned
Index dtype will be object rather than datetime.
Returns
-------
new_index : Index
"""
# try to convert if possible
if _is_convertible_to_td(item):
try:
item = Timedelta(item)
except Exception:
pass
elif is_scalar(item) and isna(item):
# GH 18295
item = self._na_value
freq = None
if isinstance(item, Timedelta) or (is_scalar(item) and isna(item)):
# check freq can be preserved on edge cases
if self.freq is not None:
if ((loc == 0 or loc == -len(self)) and
item + self.freq == self[0]):
freq = self.freq
elif (loc == len(self)) and item - self.freq == self[-1]:
freq = self.freq
item = _to_m8(item)
try:
new_tds = np.concatenate((self[:loc].asi8, [item.view(np.int64)],
self[loc:].asi8))
return TimedeltaIndex(new_tds, name=self.name, freq=freq)
except (AttributeError, TypeError):
# fall back to object index
if isinstance(item, compat.string_types):
return self.astype(object).insert(loc, item)
raise TypeError(
"cannot insert TimedeltaIndex with incompatible label")
def delete(self, loc):
"""
Make a new DatetimeIndex with passed location(s) deleted.
Parameters
----------
loc: int, slice or array of ints
Indicate which sub-arrays to remove.
Returns
-------
new_index : TimedeltaIndex
"""
new_tds = np.delete(self.asi8, loc)
freq = 'infer'
if is_integer(loc):
if loc in (0, -len(self), -1, len(self) - 1):
freq = self.freq
else:
if is_list_like(loc):
loc = lib.maybe_indices_to_slice(
_ensure_int64(np.array(loc)), len(self))
if isinstance(loc, slice) and loc.step in (1, None):
if (loc.start in (0, None) or loc.stop in (len(self), None)):
freq = self.freq
return TimedeltaIndex(new_tds, name=self.name, freq=freq)
TimedeltaIndex._add_comparison_methods()
TimedeltaIndex._add_numeric_methods()
TimedeltaIndex._add_logical_methods_disabled()
TimedeltaIndex._add_datetimelike_methods()
def _is_convertible_to_index(other):
"""
return a boolean whether I can attempt conversion to a TimedeltaIndex
"""
if isinstance(other, TimedeltaIndex):
return True
elif (len(other) > 0 and
other.inferred_type not in ('floating', 'mixed-integer', 'integer',
'mixed-integer-float', 'mixed')):
return True
return False
def _is_convertible_to_td(key):
return isinstance(key, (DateOffset, timedelta, Timedelta,
np.timedelta64, compat.string_types))
def _to_m8(key):
"""
Timedelta-like => dt64
"""
if not isinstance(key, Timedelta):
# this also converts strings
key = Timedelta(key)
# return an type that can be compared
return np.int64(key.value).view(_TD_DTYPE)
def _generate_regular_range(start, end, periods, offset):
stride = offset.nanos
if periods is None:
b = Timedelta(start).value
e = Timedelta(end).value
e += stride - e % stride
elif start is not None:
b = Timedelta(start).value
e = b + periods * stride
elif end is not None:
e = Timedelta(end).value + stride
b = e - periods * stride
else:
raise ValueError("at least 'start' or 'end' should be specified "
"if a 'period' is given.")
data = np.arange(b, e, stride, dtype=np.int64)
data = TimedeltaIndex._simple_new(data, None)
return data
def timedelta_range(start=None, end=None, periods=None, freq='D',
name=None, closed=None):
"""
Return a fixed frequency TimedeltaIndex, with day as the default
frequency
Parameters
----------
start : string or timedelta-like, default None
Left bound for generating timedeltas
end : string or timedelta-like, default None
Right bound for generating timedeltas
periods : integer, default None
Number of periods to generate
freq : string or DateOffset, default 'D' (calendar daily)
Frequency strings can have multiples, e.g. '5H'
name : string, default None
Name of the resulting TimedeltaIndex
closed : string, default None
Make the interval closed with respect to the given frequency to
the 'left', 'right', or both sides (None)
Returns
-------
rng : TimedeltaIndex
Notes
-----
Of the three parameters: ``start``, ``end``, and ``periods``, exactly two
must be specified.
To learn more about the frequency strings, please see `this link
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
Examples
--------
>>> pd.timedelta_range(start='1 day', periods=4)
TimedeltaIndex(['1 days', '2 days', '3 days', '4 days'],
dtype='timedelta64[ns]', freq='D')
The ``closed`` parameter specifies which endpoint is included. The default
behavior is to include both endpoints.
>>> pd.timedelta_range(start='1 day', periods=4, closed='right')
TimedeltaIndex(['2 days', '3 days', '4 days'],
dtype='timedelta64[ns]', freq='D')
The ``freq`` parameter specifies the frequency of the TimedeltaIndex.
Only fixed frequencies can be passed, non-fixed frequencies such as
'M' (month end) will raise.
>>> pd.timedelta_range(start='1 day', end='2 days', freq='6H')
TimedeltaIndex(['1 days 00:00:00', '1 days 06:00:00', '1 days 12:00:00',
'1 days 18:00:00', '2 days 00:00:00'],
dtype='timedelta64[ns]', freq='6H')
"""
return TimedeltaIndex(start=start, end=end, periods=periods,
freq=freq, name=name, closed=closed)
|
import React, { Component } from 'react';
class List extends Component {
constructor(props) {
super(props)
this.state = { }
}
render() {
return (
<div>
<h1>List</h1>
<p>ID: { this.state.id }</p>
</div>
);
}
componentDidMount() {
// this.props.match 对象有 3 部分:
// - patch:自己定义的路由规则,可以清楚的看到是可以产地id参数的。
// - url: 真实的访问路径,这上面可以清楚的看到传递过来的参数是什么。
// - params:传递过来的参数,key和value值
console.log(this.props.match)
let tempId = this.props.match.params.id
this.setState({ id: tempId })
}
}
export default List; |
module.exports = function (babel) {
var asyncFunctionVisitor = {
CallExpression: function (path) {
if (path.parent.type !== 'AwaitExpression') {
path.replaceWith(babel.types.awaitExpression(path.node))
}
},
TaggedTemplateExpression: function (path) {
if (path.parent.type !== 'AwaitExpression') {
path.replaceWith(babel.types.awaitExpression(path.node))
}
},
Function: function (path) {
path.skip()
}
};
return {
visitor: {
Function: function (path) {
if (path.node.async) {
path.traverse(asyncFunctionVisitor)
}
}
}
}
}; |
"""Test suite for the sbflip package."""
|
"""Makes a .joblib file containing the trained model
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import numpy as np
import logging
import tensorflow as tf
from tensorflow.python.platform import app, flags
from cleverhans.utils import set_log_level, to_categorical, safe_zip
from cleverhans.utils_tf import model_eval
from cleverhans import serial
from cleverhans.dataset import CIFAR10, Factory
from cleverhans.model_zoo.madry_lab_challenges.cifar10_model import make_wresnet
FLAGS = flags.FLAGS
def main(argv):
model_file = tf.train.latest_checkpoint(FLAGS.checkpoint_dir)
if model_file is None:
print("No model found")
sys.exit()
set_log_level(logging.DEBUG)
sess = tf.Session()
with sess.as_default():
model = make_wresnet()
saver = tf.train.Saver()
# Restore the checkpoint
saver.restore(sess, model_file)
SCOPE = "cifar10_challenge"
model2 = make_wresnet(scope=SCOPE)
assert len(model.get_vars()) == len(model2.get_vars())
found = [False] * len(model2.get_vars())
for var1 in model.get_vars():
var1_found = False
var2_name = SCOPE + "/" + var1.name
for idx, var2 in enumerate(model2.get_vars()):
if var2.name == var2_name:
var1_found = True
found[idx] = True
sess.run(tf.assign(var2, var1))
break
assert var1_found, var1.name
assert all(found)
model2.dataset_factory = Factory(CIFAR10, {"max_val": 255})
serial.save("model.joblib", model2)
if __name__ == "__main__":
cifar10_root = os.environ["CIFAR10_CHALLENGE_DIR"]
default_ckpt_dir = os.path.join(cifar10_root, "models/model_0")
flags.DEFINE_string(
"checkpoint_dir", default_ckpt_dir, "Checkpoint directory to load"
)
app.run(main)
|
"""
"""
import os
from csv import reader
from pickle import load, dump
from dmim_analysis.analysis import analyze_compound_targeted
from dmim_analysis.plots import atd_with_fit
with open('combined_cal.pickle', 'rb') as pf:
cal = load(pf)
with open('D:/DMIM_HT/analysis/replicates/rerun_p2r3.csv', 'r') as f:
rdr = reader(f)
for name_adduct, well_loc, mz, ccs_rep1 in rdr:
mz, ccs_rep1 = float(mz), float(ccs_rep1)
print('analyzing {} ...'.format(name_adduct), end=' ')
f_rxn = 'D:/DMIM_HT/data/20191210/DHR20191210_p722_{}_pos.raw'.format(well_loc)
try:
cmpd = analyze_compound_targeted(name_adduct, mz, f_rxn, 0, 1, 0.1, cal)
except KeyboardInterrupt:
print('\n! EXITING !')
exit()
except Exception as e:
print(e)
cmpd = None
if cmpd:
p_err = 100. * (cmpd['ccs'] - ccs_rep1) / ccs_rep1
print('CCS: {:.2f} <-> rep1 CCS: {:.2f} ({:+.1f} %) ...'.format(cmpd['ccs'], ccs_rep1, p_err), end=' ')
save_name = name_adduct.replace(' ', '_')
prefix = 'compounds_p2/'
with open(os.path.join(prefix, '{}.pickle'.format(save_name)), 'wb') as pf:
dump(cmpd, pf)
atd_with_fit(name_adduct, mz, cmpd['ccs'], cmpd['meta']['atd_fit_params'], cmpd['meta']['atd'],
cmpd['meta']['lc_fit_params'], cmpd['meta']['lc'], 0.1, prefix)
print('ok')
else:
print('failed')
|
/* Copyright (C) 2016 NooBaa */
import ko from 'knockout';
import MessageRowViewModel from './message-row';
export default class MessageListViewModel {
rows = ko.observableArray();
onState(messages, selected) {
let lastRowTimestamp = -1;
const rows = messages
.map((message, i) => {
const row = this.rows()[i] || new MessageRowViewModel();
row.onState(message, selected, lastRowTimestamp);
lastRowTimestamp = message.action.timestamp;
return row;
});
this.rows(rows);
}
onAfterRender(nodes) {
const elms = nodes.filter(node => node.nodeType === Node.ELEMENT_NODE);
const lastElm = elms[elms.length - 1];
lastElm.scrollIntoView();
}
}
|
import {displayMainContent} from './blogPostsView';
import {renderReadButton} from './blogReadButtonView';
import {renderAddPostModalWindow} from '../addPostModalWindowView';
import {deletePost, addAbilityToDeleteAllPosts, getPostList} from '../model/serverRequests';
import '../newPostController';
import '../myJQueryModalPlugin/main';
initialize();
/* eslint-disable */
function initialize() {
const postList = getPostList();
render(postList);
addFilterByAuthorField();
addFilterByTitleField();
addEditAbility();
clearAddNewPostWindowOnOpen();
addAbilityToDeleteAllPosts();
}
function render(postList) {
const contentEl = document.getElementById('content');
displayMainContent(contentEl, postList);
renderReadButton(contentEl);
renderAddPostModalWindow();
addDeleteButtonListener();
}
function addFilterByAuthorField() {
const searchByAuthorField = document.getElementsByClassName('blog__search')[0];
const newEvent = new Event('input');
if (searchByAuthorField) {
searchByAuthorField.addEventListener('input', onSearchByAuthorFieldInput, false);
searchByAuthorField.value = localStorage.getItem('filterByAuthor');
searchByAuthorField.dispatchEvent(newEvent);
}
}
function addFilterByTitleField() {
const searchByTitleField = document.getElementsByClassName('blog__search')[1];
if (searchByTitleField) {
searchByTitleField.addEventListener('input', onSearchByTitleFieldInput, false);
}
}
function onSearchByAuthorFieldInput(event) {
const blogNodes = document.getElementsByClassName('blog__item');
const blogs = Object.assign([], blogNodes);
blogs.forEach((blog) => {
const nameAuthor = blog.querySelector('.blog__post-name').textContent;
blog.hidden = isValueOutOfFilter(event.currentTarget.value, nameAuthor);
});
localStorage.setItem('filterByAuthor', event.currentTarget.value);
}
function onSearchByTitleFieldInput(event) {
const blogNodes = document.getElementsByClassName('blog__item');
const blogs = Object.assign([], blogNodes);
blogs.forEach((blog) => {
const nameTitle = blog.querySelector('.blog__post-article-header').textContent;
blog.hidden = isValueOutOfFilter(event.currentTarget.value, nameTitle);
});
}
function isValueOutOfFilter(inputValue, nameTitle) {
const regex = RegExp(`${inputValue}`, 'gi');
return !regex.test(nameTitle);
}
function addDeleteButtonListener() {
const deleteButton = $('.blog__post-delete-button');
deleteButton.on('click', (event) => {
const clickedDeleteButtonForCurrentPost = event.currentTarget;
const postElement = $(clickedDeleteButtonForCurrentPost).parents(".blog__item");
$('body').modalWindowPlugin({
quantity: 2,
type: 'info',
message: 'Are you realy want to delete this post?',
onOkButtonClick: function () {
deletePost(postElement);
}
});
});
}
function addEditAbility() {
const editButton = $('.blog__post-edit-button');
editButton.on('click', function () {
setTimeout(function () {
const currentElement = JSON.parse(localStorage.getItem('selectedPost'));
$('#img').attr('disabled', true)
.val(currentElement.img);
$('#title').attr('disabled', true)
.val(currentElement.title);
$('#author').attr('disabled', true)
.val(currentElement.author);
$('#date').attr('disabled', true)
.val(currentElement.date);
$('#text').val(currentElement.text);
$('#quote').attr('disabled', true)
.val(currentElement.quote);
}, 10);
});
}
function clearAddNewPostWindowOnOpen() {
$('.header-ideas__add-post-button').on('click', function () {
$('#img').attr('disabled', false)
.val('');
$('#title').attr('disabled', false)
.val('');
$('#author').attr('disabled', false)
.val('');
$('#date').attr('disabled', false)
.val('');
$('#text').val('');
$('#quote').attr('disabled', false)
.val('');
localStorage.setItem('selectedPost', '');
});}
/* eslint-enable */
|
import json
from collections import defaultdict
from functools import partial
from pathlib import Path
from typing import DefaultDict, Dict, List, Optional, Tuple
import clr
import System
from System.IO import FileNotFoundException
from System.Reflection import Assembly, ConstructorInfo, EventInfo, FieldInfo, MethodInfo, ParameterInfo, PropertyInfo
from .logging import logger
from .model import BaseType, Class, Constructor, Delegate, Enum, EnumField, Event, EventType, Interface, Method, Namespace, Parameter, Property, SystemType, VarType, WrappedType, ItemProperty
from .options import options
from .util import make_python_name, rm_tree, strip_path_str, time_function, time_it
@time_function(log_func=logger.info)
def make(target_assembly_name: str):
target_assembly_obj: Assembly = clr.AddReference(target_assembly_name)
namespace_dict: DefaultDict[str, List[System.Type]] = defaultdict(list)
namespaces: Dict[str, Namespace] = {}
with time_it('Parsing Assemblies', log_func=logger.info):
types_found = _create_namespace_dict(target_assembly_obj, namespace_dict)
logger.info(f'Processing {types_found} Types in {len(namespace_dict)} Namespaces')
for namespace_name, type_objs in namespace_dict.items():
if namespace_name not in namespaces:
namespaces[namespace_name] = Namespace(namespace_name)
namespace: Namespace = namespaces[namespace_name]
for type_obj in type_objs:
_process_system_type_obj(namespace, type_obj)
with time_it('Writing Stub Package', log_func=logger.info):
stub_dir = options.output_dir / f'{target_assembly_name}-stubs'
if options.overwrite or not stub_dir.exists():
logger.info(f'Writing to Directory: {stub_dir}')
stub_dir.mkdir(parents=True, exist_ok=True)
assembly_name_type = target_assembly_obj.GetName()
version = assembly_name_type.Version
culture = 'neutral'
if (culture_info := assembly_name_type.CultureInfo) is not None and (culture_name := culture_info.Name) != '':
culture = culture_name
public_key_token = ''.join(hex(b).lstrip('0x') for b in assembly_name_type.GetPublicKeyToken())
logger.info(f'Writing: setup.cfg')
setup_file = stub_dir / 'setup.cfg'
setup_file.write_text('\n'.join([
f'[metadata]',
f'name = {target_assembly_name}-stubs',
f'version = {version}',
f'description = Stubs Package for {target_assembly_name}',
f'long_description = file: README.md, LICENSE',
f'keywords = pythonnet, stubs, {target_assembly_name}',
f'license = MIT License',
f'culture = {culture}',
f'public_key_token = {public_key_token}',
f'classifiers =',
f' Development Status :: 5 - Production/Stable',
f' Intended Audience :: Developers',
f' License :: OSI Approved :: MIT License',
f' Programming Language :: Python :: 3',
f' Programming Language :: Python :: 3.8',
f' Topic :: Software Development :: Build Tools',
f' Topic :: Software Development :: Documentation',
f' Topic :: Utilities',
f'',
f'[options]',
f'packages = find:',
f'install_requires =',
f' pythonnet==2.5.2',
f'python_requires = >=3.8',
f'',
]))
logger.info(f'Writing: pyproject.toml')
pyproject_file = stub_dir / 'pyproject.toml'
pyproject_file.write_text('\n'.join([
f'[build-system]',
f'requires = ["setuptools", "wheel"]',
f'build-backend = "setuptools.build_meta"',
]))
logger.info(f'Writing: README.md')
readme_file = stub_dir / 'README.md'
readme_file.write_text('\n'.join([
f'# {target_assembly_name}-stubs',
f'Stubs Package for {target_assembly_name}',
f'',
]))
logger.info(f'Writing: LICENSE')
license_file = stub_dir / 'LICENSE'
license_file.write_text('\n'.join([
f'MIT License',
f'',
f'Copyright (c) 2021 Ryan Smith',
f'',
f'Permission is hereby granted, free of charge, to any person obtaining a copy',
f'of this software and associated documentation files (the "Software"), to deal',
f'in the Software without restriction, including without limitation the rights',
f'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell',
f'copies of the Software, and to permit persons to whom the Software is',
f'furnished to do so, subject to the following conditions:',
f'',
f'The above copyright notice and this permission notice shall be included in all',
f'copies or substantial portions of the Software.',
f'',
f'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR',
f'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,',
f'FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE',
f'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER',
f'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,',
f'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE',
f'SOFTWARE.',
f'',
]))
logger.info(f'Writing: MANIFEST.in')
manifest_file = stub_dir / 'MANIFEST.in'
manifest_file.write_text('\n'.join(set(f'include {n.split(".")[0]}-stubs/*.pyi' for n in namespaces)) + '\n')
logger.info(f'Writing: Stub Files')
for namespace_name, namespace in namespaces.items():
parent_dir: Path = stub_dir
init_file: Path = parent_dir / '__init__.pyi'
for n in namespace_name.split('.'):
namespace_dir: Path = parent_dir / strip_path_str(f'{n}-stubs' if parent_dir == stub_dir else n)
namespace_dir.mkdir(parents=True, exist_ok=True)
init_file = namespace_dir / '__init__.pyi'
init_file.touch(exist_ok=True)
parent_dir = namespace_dir
logger.debug(f'Writing: Stub File \'{init_file}\'')
init_file.write_text('\n'.join(namespace.to_lines()))
else:
logger.info('No Files Written')
if options.json: # TODO - Make this generate less files
json_dir: Path = Path('logs') / target_assembly_name
logger.info(f'Exporting Json Files: {json_dir}')
json_dir.mkdir(parents=True, exist_ok=True)
for namespace_name, type_objs in namespace_dict.items():
json_file = json_dir / f'{namespace_name}.json'
try:
with json_file.open('w') as file:
logger.debug(f'Writing: {json_file.name}')
json.dump(list(map(lambda t: t.FullName, type_objs)), file, indent=2)
except OSError as e:
logger.warning(e)
@time_function(log_func=logger.info)
def group(assembly_names: List[str]):
namespace_dict: DefaultDict[str, List[System.Type]] = defaultdict(list)
namespaces: Dict[str, Namespace] = {}
with time_it('Parsing Assemblies', log_func=logger.info):
types_found = 0
for assembly_name in assembly_names:
logger.info(f'Adding Assembly \'{assembly_name}\' to Namespaces')
assembly_obj: Assembly = clr.AddReference(assembly_name)
types_found += _create_namespace_dict(assembly_obj, namespace_dict)
logger.info(f'Processing {types_found} Types in {len(namespace_dict)} Namespaces')
for namespace_name, type_objs in namespace_dict.items():
if namespace_name not in namespaces:
namespaces[namespace_name] = Namespace(namespace_name)
namespace: Namespace = namespaces[namespace_name]
for type_obj in type_objs:
_process_system_type_obj(namespace, type_obj)
with time_it('Writing Grouped Stubs', log_func=logger.info):
stub_dir = options.output_dir / 'Grouped Stubs'
if stub_dir.exists():
rm_tree(stub_dir)
logger.info(f'Writing to Directory: {stub_dir}')
stub_dir.mkdir(parents=True, exist_ok=True)
logger.info(f'Writing: Stub Files')
for namespace_name, namespace in namespaces.items():
parent_dir: Path = stub_dir
init_file: Path = parent_dir / '__init__.pyi'
for n in namespace_name.split('.'):
namespace_dir: Path = parent_dir / strip_path_str(f'{n}-stubs' if parent_dir == stub_dir else n)
namespace_dir.mkdir(parents=True, exist_ok=True)
init_file = namespace_dir / '__init__.pyi'
init_file.touch(exist_ok=True)
parent_dir = namespace_dir
logger.debug(f'Writing: Stub File \'{init_file}\'')
init_file.write_text('\n'.join(namespace.to_lines()))
def _create_namespace_dict(assembly_obj: Assembly, namespace_dict: DefaultDict[str, List[System.Type]]) -> int:
assemblies: List[Assembly] = [assembly_obj]
for parent_name_obj in assembly_obj.GetReferencedAssemblies():
try:
assemblies.append(Assembly.Load(parent_name_obj))
except FileNotFoundException:
logger.warning(f'Could not find Dependency: {parent_name_obj.Name}')
types_found = 0
for assembly_obj in assemblies:
for type in assembly_obj.GetTypes():
if type.Namespace is None or type.IsNested:
continue
logger.debug(f'Found Type \'{type.FullName}\' in Namespace \'{type.Namespace}\'')
namespace_dict[type.Namespace].append(type)
types_found += 1
return types_found
def _process_system_type_obj(namespace: Namespace, system_type_obj: System.Type):
if system_type_obj.IsValueType:
if system_type_obj.IsEnum:
enum = _process_enum(namespace, system_type_obj)
namespace.enums[enum.name].add(enum)
return
struct = _process_class(namespace, system_type_obj)
namespace.structs[struct.name].add(struct)
return
if system_type_obj.IsInterface:
interface = _process_interface(namespace, system_type_obj)
namespace.interfaces[interface.name].add(interface)
return
if (system_type_obj.IsSubclassOf(System.Delegate) or system_type_obj.IsSubclassOf(System.MulticastDelegate)) and system_type_obj not in [System.Type.GetType('System.Delegate'), System.Type.GetType('System.MulticastDelegate')]:
delegate = _process_delegate(namespace, system_type_obj)
namespace.delegates[delegate.name].add(delegate)
if system_type_obj.IsClass:
clazz = _process_class(namespace, system_type_obj)
namespace.classes[clazz.name].add(clazz)
return
def _process_class(namespace: Namespace, class_type_obj: System.Type) -> Class:
logger.debug(f'Processing Class: {class_type_obj}')
clazz = Class(make_python_name(class_type_obj.Name))
clazz.abstract = class_type_obj.IsAbstract
generic_arg_type: System.Type
for generic_arg_type in class_type_obj.GetGenericArguments():
clazz.generic_args.append(_get_var_type(namespace, generic_arg_type))
if clazz.abstract and len(clazz.generic_args) > 0:
namespace.py_imports.add('typing.Protocol')
elif len(clazz.generic_args) > 0:
namespace.py_imports.add('typing.Generic')
elif clazz.abstract:
namespace.py_imports.add('abc.ABC')
if class_type_obj.BaseType is not None:
clazz.super_type = _get_type(namespace, class_type_obj.BaseType)
interface_type_obj: System.Type
for interface_type_obj in class_type_obj.GetInterfaces():
clazz.interfaces.append(_get_type(namespace, interface_type_obj))
field_info: FieldInfo
for field_info in class_type_obj.GetFields():
if field_info.DeclaringType == class_type_obj:
getter, setter = _process_field(namespace, field_info)
clazz.fields.append(getter)
if setter is not None:
clazz.fields.append(setter)
clazz.fields.sort(key=lambda p: p.name)
constructor_info: ConstructorInfo
constructor_list = [c for c in class_type_obj.GetConstructors()]
overload = len(constructor_list) > 1
for constructor_info in constructor_list:
if constructor_info.DeclaringType == class_type_obj:
clazz.constructors.append(_process_constructor(namespace, constructor_info, overload))
property_info: PropertyInfo
for property_info in class_type_obj.GetProperties():
if property_info.DeclaringType == class_type_obj:
getter, setter = _process_property(namespace, property_info)
if getter is not None:
clazz.properties.append(getter)
if setter is not None:
clazz.properties.append(setter)
clazz.properties.sort(key=lambda p: p.name)
method_info: MethodInfo
method_dict = defaultdict(list)
for method_info in class_type_obj.GetMethods():
method_dict[method_info.Name].append(method_info)
for method_list in method_dict.values():
overload = len(method_list) > 1
for method_info in method_list:
if method_info.DeclaringType == class_type_obj:
clazz.methods.append(_process_method(namespace, method_info, overload))
clazz.methods.sort(key=lambda m: m.name)
event_info: EventInfo
for event_info in class_type_obj.GetEvents():
if event_info.DeclaringType == class_type_obj:
clazz.events.append(_process_event(namespace, event_info))
clazz.events.sort(key=lambda e: e.name)
nested_type_obj: System.Type
for nested_type_obj in class_type_obj.GetNestedTypes():
if nested_type_obj.IsValueType:
if nested_type_obj.IsEnum:
clazz.sub_enums.append(_process_enum(namespace, nested_type_obj))
continue
clazz.sub_structs.append(_process_class(namespace, nested_type_obj))
continue
if nested_type_obj.IsInterface:
clazz.sub_interfaces.append(_process_interface(namespace, nested_type_obj))
continue
if nested_type_obj.IsClass:
clazz.sub_classes.append(_process_class(namespace, nested_type_obj))
continue
return clazz
def _process_interface(namespace: Namespace, interface_type_obj: System.Type) -> Interface:
logger.debug(f'Processing Interface: {interface_type_obj}')
namespace.py_imports.add('typing.Protocol')
interface = Interface(make_python_name(interface_type_obj.Name))
generic_arg_type: System.Type
for generic_arg_type in interface_type_obj.GetGenericArguments():
interface.generic_args.append(_get_var_type(namespace, generic_arg_type))
super_class_type_obj: System.Type
for super_class_type_obj in interface_type_obj.GetInterfaces():
interface.super_classes.append(_get_type(namespace, super_class_type_obj))
property_info: PropertyInfo
for property_info in interface_type_obj.GetProperties():
if property_info.DeclaringType == interface_type_obj:
getter, setter = _process_property(namespace, property_info)
if getter is not None:
interface.properties.append(getter)
if setter is not None:
interface.properties.append(setter)
interface.properties.sort(key=lambda p: p.name)
method_info: MethodInfo
method_dict = defaultdict(list)
for method_info in interface_type_obj.GetMethods():
method_dict[method_info.Name].append(method_info)
for method_list in method_dict.values():
overload = len(method_list) > 1
for method_info in method_list:
if method_info.DeclaringType == interface_type_obj:
interface.methods.append(_process_method(namespace, method_info, overload))
interface.methods.sort(key=lambda m: m.name)
event_info: EventInfo
for event_info in interface_type_obj.GetEvents():
if event_info.DeclaringType == interface_type_obj:
interface.events.append(_process_event(namespace, event_info))
interface.events.sort(key=lambda e: e.name)
return interface
def _process_enum(namespace: Namespace, enum_type_obj: System.Type) -> Enum:
logger.debug(f'Processing Enum: {enum_type_obj}')
namespace.net_imports.add('System.Enum')
enum = Enum(make_python_name(enum_type_obj.Name))
enum_type = _get_type(namespace, enum_type_obj.GetEnumUnderlyingType())
try:
field_name: str
for field_name, field_value in zip(enum_type_obj.GetEnumNames(), enum_type_obj.GetEnumValues()):
enum.fields.append(EnumField(name=field_name, type=enum_type, value=field_value, doc_string=''))
except System.NotSupportedException:
field_info: FieldInfo
for field_info in enum_type_obj.GetFields():
enum.fields.append(EnumField(name=field_info.Name, type=enum_type, value='...', doc_string=''))
enum.fields.sort(key=lambda f: f.value)
return enum
def _process_delegate(namespace: Namespace, delegate_type_obj: System.Type) -> Delegate:
logger.debug(f'Processing Delegate: {delegate_type_obj}')
namespace.py_imports.add('typing.Callable')
delegate = Delegate(make_python_name(delegate_type_obj.Name))
invoke_method = delegate_type_obj.GetMethod('Invoke')
parameter_info: ParameterInfo
for parameter_info in invoke_method.GetParameters():
delegate.input_types.append(_get_type(namespace, parameter_info.ParameterType))
if invoke_method.ReturnType is not None:
delegate.return_type = _get_type(namespace, invoke_method.ReturnType)
return delegate
def _process_field(namespace: Namespace, field_info: FieldInfo) -> Tuple[Property, Optional[Property]]:
logger.debug(f'Processing Field: {field_info}')
field_name = make_python_name(field_info.Name)
field_type = _get_type(namespace, field_info.FieldType)
field_static = field_info.IsStatic
getter = Property(name=field_name,
type=field_type,
setter=False,
static=field_static,
doc_string='')
setter = None
if not (field_info.IsInitOnly or field_info.IsLiteral):
setter = Property(name=field_name,
type=field_type,
setter=True,
static=field_static,
doc_string='')
return getter, setter
def _process_constructor(namespace: Namespace, constructor_info: ConstructorInfo, overload: bool) -> Constructor:
logger.debug(f'Processing Constructor: {constructor_info}')
if overload:
namespace.py_imports.add('typing.overload')
parameters = [_get_parameter(namespace, parameter_info) for parameter_info in constructor_info.GetParameters()]
return Constructor(parameters=parameters,
overload=overload,
doc_string='')
def _process_property(namespace: Namespace, property_info: PropertyInfo) -> Tuple[Optional[Property], Optional[Property]]:
logger.debug(f'Processing Property: {property_info}')
name = make_python_name(property_info.Name)
property_type = _get_type(namespace, property_info.PropertyType)
getter, setter = None, None
if name == 'Item':
if (get_method := property_info.GetGetMethod()) is not None:
if len(parameters := list(get_method.GetParameters())) != 0:
parameter = _get_parameter(namespace, parameters[0])
getter = ItemProperty(key_type=parameter.type, value_type=property_type, setter=False, doc_string='')
else:
getter = Property(name=name, type=property_type, setter=False, static=get_method.IsStatic, doc_string='')
if (set_method := property_info.GetSetMethod()) is not None:
if len(parameters := list(set_method.GetParameters())) != 0:
parameter = _get_parameter(namespace, parameters[0])
setter = ItemProperty(key_type=parameter.type, value_type=property_type, setter=True, doc_string='')
else:
setter = Property(name=name, type=property_type, setter=True, static=set_method.IsStatic, doc_string='')
else:
if (get_method := property_info.GetGetMethod()) is not None:
getter = Property(name=name, type=property_type, setter=False, static=get_method.IsStatic, doc_string='')
if (set_method := property_info.GetSetMethod()) is not None:
setter = Property(name=name, type=property_type, setter=True, static=set_method.IsStatic, doc_string='')
return getter, setter
def _process_method(namespace: Namespace, method_info: MethodInfo, overload: bool) -> Method:
logger.debug(f'Processing Method: {method_info}')
if overload:
namespace.py_imports.add('typing.overload')
# TODO - IsAbstract, IsVirtual, IsGenericMethod, IsGenericMethodDefinition
name = make_python_name(method_info.Name)
return_types = [_get_type(namespace, method_info.ReturnType)]
static = method_info.IsStatic
parameters = []
for parameter_info in method_info.GetParameters():
parameter = _get_parameter(namespace, parameter_info)
parameters.append(parameter)
if parameter.is_out:
return_types.append(parameter.type)
if len(return_types) > 1:
namespace.py_imports.add('typing.Tuple')
return Method(name=name,
parameters=tuple(parameters),
return_types=tuple(return_types),
static=static,
overload=overload,
doc_string='')
def _process_event(namespace: Namespace, event_info: EventInfo) -> Event:
logger.debug(f'Processing Event: {event_info}')
if 'EventType' not in namespace.sys_types:
namespace.py_imports.add('typing.Generic')
namespace.special_types['EventType'] = EventType()
if 'T' not in namespace.var_types:
namespace.py_imports.add('typing.TypeVar')
namespace.var_types['T'] = VarType(name='T')
name = make_python_name(event_info.Name)
type = _get_type(namespace, event_info.EventHandlerType)
return Event(name=name, type=type, doc_string='')
def _get_parameter(namespace: Namespace, parameter_info: ParameterInfo) -> Parameter:
name = make_python_name(parameter_info.Name)
type = _get_type(namespace, parameter_info.ParameterType)
try:
default = parameter_info.RawDefaultValue if parameter_info.HasDefaultValue else None
except System.FormatException:
default = None
is_out = parameter_info.IsOut or type.is_ref
return Parameter(name=name, type=type, default=default, is_out=is_out, doc_string='')
def _get_type(namespace: Namespace, type_obj: System.Type, parent_type: System.Type = None) -> BaseType:
name = make_python_name(type_obj.ToString())
import_name = name[:name.index('+')] if '+' in name else name
name = name.replace('+', '.').split('.')[-1]
base = name
inner = tuple(_get_type(namespace, p, parent_type=parent_type) for p in type_obj.GetGenericArguments())
if name in _system_type_dict:
base = _system_type_dict[name](namespace)
elif type_obj.IsGenericParameter:
base = _get_var_type(namespace, type_obj, type_obj == parent_type)
else:
namespace.net_imports.add(import_name)
new_type = WrappedType(base=base, inner=inner)
new_type.is_ref = type_obj.IsByRef
new_type.is_pointer = type_obj.IsPointer
# If the type should be wrapped
if System.Nullable.GetUnderlyingType(type_obj) is not None:
namespace.py_imports.add('typing.Optional')
nullable_type = _get_system_type('NullableType', 'System.Nullable', 'Union[Optional, Nullable]', namespace)
return WrappedType(base=nullable_type, inner=(new_type,))
if type_obj.IsArray:
namespace.py_imports.add('typing.List')
array_type = _get_system_type('ArrayType', 'System.Array', 'Union[List, Array]', namespace)
return WrappedType(base=array_type, inner=(new_type,))
return new_type
def _get_system_type(name: str, system_name: str, value: str, namespace: Namespace) -> SystemType:
if system_name not in namespace.sys_types:
namespace.net_imports.add(system_name)
namespace.py_imports.add('typing.Union')
namespace.sys_types[system_name] = SystemType(name=name, value=value)
return namespace.sys_types[system_name]
def _get_var_type(namespace: Namespace, type_var: System.Type, force_unbounded: bool = False) -> VarType:
name: str = make_python_name(type_var.Name)
if name not in namespace.var_types: # TODO - This will miss TypeVars that have bound if the name is the same as a previous TypeVar
namespace.py_imports.add('typing.TypeVar')
bounds = tuple() if force_unbounded else tuple(_get_type(namespace, p, parent_type=type_var) for p in type_var.GetGenericParameterConstraints())
namespace.var_types[name] = VarType(name=name, bounds=bounds) # TODO - Handle duplicate names better, Handle Multiple Bounds Better
return namespace.var_types[name]
_system_type_dict = {
'Boolean': partial(_get_system_type, 'BooleanType', 'System.Boolean', 'Union[bool, Boolean]'),
'SByte': partial(_get_system_type, 'SByteType', 'System.SByte', 'Union[int, SByte]'),
'Int16': partial(_get_system_type, 'ShortType', 'System.Int16', 'Union[int, Int16]'),
'Int32': partial(_get_system_type, 'IntType', 'System.Int32', 'Union[int, Int32]'),
'Int64': partial(_get_system_type, 'LongType', 'System.Int64', 'Union[int, Int64]'),
'Byte': partial(_get_system_type, 'ByteType', 'System.Byte', 'Union[int, Byte]'),
'UInt16': partial(_get_system_type, 'UShortType', 'System.UInt16', 'Union[int, UInt16]'),
'UInt32': partial(_get_system_type, 'UIntType', 'System.UInt32', 'Union[int, UInt32]'),
'UInt64': partial(_get_system_type, 'ULongType', 'System.UInt64', 'Union[int, UInt64]'),
'IntPtr': partial(_get_system_type, 'NIntType', 'System.IntPtr', 'Union[int, IntPtr]'),
'UIntPtr': partial(_get_system_type, 'NUIntType', 'System.UIntPtr', 'Union[int, UIntPtr]'),
'Single': partial(_get_system_type, 'FloatType', 'System.Single', 'Union[float, Single]'),
'Double': partial(_get_system_type, 'DoubleType', 'System.Double', 'Union[float, Double]'),
'Decimal': partial(_get_system_type, 'DecimalType', 'System.Decimal', 'Union[float, Decimal]'),
'Char': partial(_get_system_type, 'CharType', 'System.Char', 'Union[str, Char]'),
'String': partial(_get_system_type, 'StringType', 'System.String', 'Union[str, String]'),
'Object': partial(_get_system_type, 'ObjectType', 'System.Object', 'Object'),
'Type': partial(_get_system_type, 'TypeType', 'System.Type', 'Union[type, Type]'),
'Void': partial(_get_system_type, 'VoidType', 'System.Void', 'Union[None, Void]'),
}
|
#!/bin/python
EMISSION_SPEED_FACTOR = 19
DIFFICULTY_TARGET = 240 # seconds
MONEY_SUPPLY = 88888888000000000
GENESIS_BLOCK_REWARD = 8800000000000000
FINAL_SUBSIDY = 4000000000
COIN_EMISSION_MONTH_INTERVAL = 6 #months
COIN_EMISSION_HEIGHT_INTERVAL = int(COIN_EMISSION_MONTH_INTERVAL * 30.4375 * 24 * 3600 / DIFFICULTY_TARGET)
HEIGHT_PER_YEAR = int((12*30.4375*24*3600)/DIFFICULTY_TARGET)
PEAK_COIN_EMISSION_YEAR = 4
PEAK_COIN_EMISSION_HEIGHT = HEIGHT_PER_YEAR * PEAK_COIN_EMISSION_YEAR
def get_block_reward(height, coins_already_generated):
if height < (PEAK_COIN_EMISSION_HEIGHT + COIN_EMISSION_HEIGHT_INTERVAL):
interval_num = height/COIN_EMISSION_HEIGHT_INTERVAL
money_supply_pct = 0.1888 + interval_num*(0.023 + interval_num*0.0032)
cal_block_reward = (MONEY_SUPPLY * money_supply_pct)/(2**EMISSION_SPEED_FACTOR)
else:
cal_block_reward = (MONEY_SUPPLY - coins_already_generated)/(2**EMISSION_SPEED_FACTOR)
return cal_block_reward
def calculate_emssion_speed(print_by_year = False):
coins_already_generated = 0
height = 0
total_time = 0
block_reward = 0
cal_block_reward = 0
count = 0
round_factor = 10000000
print "Height\t\tB.Reward\tCoin Emitted\tEmission(%)\tDays\tYears"
f.write("Height\tB.Reward\tCoin Emitted\tEmission(%)\tDays\tYears\n")
while coins_already_generated < MONEY_SUPPLY - FINAL_SUBSIDY:
emission_speed_change_happened = False
if height % COIN_EMISSION_HEIGHT_INTERVAL == 0:
cal_block_reward = get_block_reward(height, coins_already_generated)
emission_speed_change_happened = True
count += 1
if height == 0:
block_reward = GENESIS_BLOCK_REWARD
else:
block_reward = int(cal_block_reward) / round_factor * round_factor
if block_reward < FINAL_SUBSIDY:
if MONEY_SUPPLY > coins_already_generated:
block_reward = FINAL_SUBSIDY
else:
block_reward = FINAL_SUBSIDY/2
coins_already_generated += block_reward
total_time += DIFFICULTY_TARGET
if emission_speed_change_happened and (count % 2 if print_by_year else True):
print format(height, '07'), "\t", '{0:.10f}'.format(block_reward/1000000000.0), "\t", coins_already_generated/1000000000.0, "\t", str(round(coins_already_generated*100.0/MONEY_SUPPLY, 2)), "\t\t", format(int(total_time/(60*60*24.0)), '04'), "\t", total_time/(60*60*24)/365.25
f.write(format(height, '07') + "\t" + '{0:.8f}'.format(block_reward/1000000000.0) + "\t" + str(coins_already_generated/1000000000.0) + "\t" + '%05.2f'%(coins_already_generated*100.0/MONEY_SUPPLY) + "\t" + format(int(total_time/(60*60*24.0)), '04') + "\t" + str(round(total_time/(60*60*24)/365.25, 2)) + "\n")
height += 1
print format(height, '07'), "\t", '{0:.10f}'.format(block_reward/1000000000.0), "\t", coins_already_generated/1000000000.0, "\t", str(round(coins_already_generated*100.0/MONEY_SUPPLY, 2)), "\t\t", format(int(total_time/(60*60*24.0)), '04'), "\t", total_time/(60*60*24)/365.
f.write(format(height, '07') + "\t" + '{0:.8f}'.format(block_reward/1000000000.0) + "\t" + str(coins_already_generated/1000000000.0) + "\t" + '{0:.2f}'.format(round(coins_already_generated*100.0/MONEY_SUPPLY, 2)) + "\t" + format(int(total_time/(60*60*24.0)), '04') + "\t" + str(round(total_time/(60*60*24)/365.25, 2)) + "\n")
if __name__ == "__main__":
f = open("sumokoin_camel_emmission.txt", "w")
calculate_emssion_speed()
if COIN_EMISSION_MONTH_INTERVAL == 6:
print "\n\n\n"
f.write("\n\n\n")
calculate_emssion_speed(True)
f.close() |
# Copyright 2015-present MongoDB, Inc.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Test MongoClient's mongos load balancing using a mock."""
import sys
import threading
sys.path[0:0] = [""]
from pymongo.errors import AutoReconnect, InvalidOperation
from pymongo.server_selectors import writable_server_selector
from pymongo.topology_description import TOPOLOGY_TYPE
from test import unittest, client_context, MockClientTest
from test.pymongo_mocks import MockClient
from test.utils import connected, wait_until
@client_context.require_connection
@client_context.require_no_load_balancer
def setUpModule():
pass
class SimpleOp(threading.Thread):
def __init__(self, client):
super(SimpleOp, self).__init__()
self.client = client
self.passed = False
def run(self):
self.client.db.command('ping')
self.passed = True # No exception raised.
def do_simple_op(client, nthreads):
threads = [SimpleOp(client) for _ in range(nthreads)]
for t in threads:
t.start()
for t in threads:
t.join()
for t in threads:
assert t.passed
def writable_addresses(topology):
return set(server.description.address for server in
topology.select_servers(writable_server_selector))
class TestMongosLoadBalancing(MockClientTest):
def mock_client(self, **kwargs):
mock_client = MockClient(
standalones=[],
members=[],
mongoses=['a:1', 'b:2', 'c:3'],
host='a:1,b:2,c:3',
connect=False,
**kwargs)
self.addCleanup(mock_client.close)
# Latencies in seconds.
mock_client.mock_rtts['a:1'] = 0.020
mock_client.mock_rtts['b:2'] = 0.025
mock_client.mock_rtts['c:3'] = 0.045
return mock_client
def test_lazy_connect(self):
# While connected() ensures we can trigger connection from the main
# thread and wait for the monitors, this test triggers connection from
# several threads at once to check for data races.
nthreads = 10
client = self.mock_client()
self.assertEqual(0, len(client.nodes))
# Trigger initial connection.
do_simple_op(client, nthreads)
wait_until(lambda: len(client.nodes) == 3, 'connect to all mongoses')
def test_failover(self):
nthreads = 10
client = connected(self.mock_client(localThresholdMS=0.001))
wait_until(lambda: len(client.nodes) == 3, 'connect to all mongoses')
# Our chosen mongos goes down.
client.kill_host('a:1')
# Trigger failover to higher-latency nodes. AutoReconnect should be
# raised at most once in each thread.
passed = []
def f():
try:
client.db.command('ping')
except AutoReconnect:
# Second attempt succeeds.
client.db.command('ping')
passed.append(True)
threads = [threading.Thread(target=f) for _ in range(nthreads)]
for t in threads:
t.start()
for t in threads:
t.join()
self.assertEqual(nthreads, len(passed))
# Down host removed from list.
self.assertEqual(2, len(client.nodes))
def test_local_threshold(self):
client = connected(self.mock_client(localThresholdMS=30))
self.assertEqual(30, client.local_threshold_ms)
wait_until(lambda: len(client.nodes) == 3, 'connect to all mongoses')
topology = client._topology
# All are within a 30-ms latency window, see self.mock_client().
self.assertEqual(set([('a', 1), ('b', 2), ('c', 3)]),
writable_addresses(topology))
# No error
client.admin.command('ping')
client = connected(self.mock_client(localThresholdMS=0))
self.assertEqual(0, client.local_threshold_ms)
# No error
client.db.command('ping')
# Our chosen mongos goes down.
client.kill_host('%s:%s' % next(iter(client.nodes)))
try:
client.db.command('ping')
except:
pass
# We eventually connect to a new mongos.
def connect_to_new_mongos():
try:
return client.db.command('ping')
except AutoReconnect:
pass
wait_until(connect_to_new_mongos, 'connect to a new mongos')
def test_load_balancing(self):
# Although the server selection JSON tests already prove that
# select_servers works for sharded topologies, here we do an end-to-end
# test of discovering servers' round trip times and configuring
# localThresholdMS.
client = connected(self.mock_client())
wait_until(lambda: len(client.nodes) == 3, 'connect to all mongoses')
# Prohibited for topology type Sharded.
with self.assertRaises(InvalidOperation):
client.address
topology = client._topology
self.assertEqual(TOPOLOGY_TYPE.Sharded,
topology.description.topology_type)
# a and b are within the 15-ms latency window, see self.mock_client().
self.assertEqual(set([('a', 1), ('b', 2)]),
writable_addresses(topology))
client.mock_rtts['a:1'] = 0.045
# Discover only b is within latency window.
wait_until(lambda: set([('b', 2)]) == writable_addresses(topology),
'discover server "a" is too far')
if __name__ == "__main__":
unittest.main()
|
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.pt');
goog.require('Blockly.Msg');
Blockly.Msg.ADD_COMMENT = "Adicionar Comentário";
Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
Blockly.Msg.CHANGE_VALUE_TITLE = "Alterar valor:";
Blockly.Msg.CLEAN_UP = "Limpar Blocos";
Blockly.Msg.COLLAPSE_ALL = "Ocultar Blocos";
Blockly.Msg.COLLAPSE_BLOCK = "Ocultar Bloco";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "cor 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "cor 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
Blockly.Msg.COLOUR_BLEND_RATIO = "proporção";
Blockly.Msg.COLOUR_BLEND_TITLE = "misturar";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Mistura duas cores com a proporção indicada (0.0 - 1.0).";
Blockly.Msg.COLOUR_PICKER_HELPURL = "http://pt.wikipedia.org/wiki/Cor";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Escolha uma cor da paleta de cores.";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
Blockly.Msg.COLOUR_RANDOM_TITLE = "cor aleatória";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Escolha uma cor aleatoriamente.";
Blockly.Msg.COLOUR_RGB_BLUE = "azul";
Blockly.Msg.COLOUR_RGB_GREEN = "verde";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html";
Blockly.Msg.COLOUR_RGB_RED = "vermelho";
Blockly.Msg.COLOUR_RGB_TITLE = "pinte com";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Cria uma cor de acordo com a quantidade especificada de vermelho, verde e azul. Todos os valores devem estar entre 0 e 100.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "sair do ciclo";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "continuar com a próxima iteração do ciclo";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Sair do ciclo que está contido.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Ignorar o resto deste ciclo, e continuar com a próxima iteração.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Atenção: Este bloco só pode ser usado dentro de um ciclo.";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
Blockly.Msg.CONTROLS_FOREACH_TITLE = "para cada item %1 na lista %2";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Para cada item numa lista, define a variável \"%1\" para o item e então faz algumas instruções.";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
Blockly.Msg.CONTROLS_FOR_TITLE = "contar com %1 de %2 até %3 de %3 em %4";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Faz com que a variável \"%1\" assuma os valores desde o número inicial até ao número final, contando de acordo com o intervalo especificado e executa os blocos especificados.";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Acrescente uma condição ao bloco se.";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Acrescente uma condição de excepação final para o bloco se.";
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Acrescente, remova ou reordene secções para reconfigurar este bloco se.";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "senão";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "senão se";
Blockly.Msg.CONTROLS_IF_MSG_IF = "se";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Se um valor é verdadeiro, então realize alguns passos.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Se um valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, realize o segundo bloco de instruções";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Se o primeiro valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, se o segundo valor é verdadeiro, realize o segundo bloco de instruções.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Se o primeiro valor é verdadeiro, então realize o primeiro bloco de instruções. Senão, se o segundo valor é verdadeiro, realize o segundo bloco de instruções. Se nenhum dos blocos for verdadeiro, realize o último bloco de instruções.";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "http://pt.wikipedia.org/wiki/Estrutura_de_repeti%C3%A7%C3%A3o#Repeti.C3.A7.C3.A3o_com_vari.C3.A1vel_de_controle";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "faça";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "repetir %1 vez";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Faça algumas instruções várias vezes.";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "repetir até";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "repetir enquanto";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Enquanto um valor for falso, então faça algumas instruções.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Enquanto um valor for verdadeiro, então faça algumas instruções.";
Blockly.Msg.DELETE_ALL_BLOCKS = "Eliminar todos os %1 blocos?";
Blockly.Msg.DELETE_BLOCK = "Eliminar Bloco";
Blockly.Msg.DELETE_VARIABLE = "Eliminar a variável '%1'";
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Eliminar %1 utilizações da variável '%2'?";
Blockly.Msg.DELETE_X_BLOCKS = "Eliminar %1 Blocos";
Blockly.Msg.DISABLE_BLOCK = "Desativar Bloco";
Blockly.Msg.DUPLICATE_BLOCK = "Duplicar";
Blockly.Msg.ENABLE_BLOCK = "Ativar Bloco";
Blockly.Msg.EXPAND_ALL = "Expandir Blocos";
Blockly.Msg.EXPAND_BLOCK = "Expandir Bloco";
Blockly.Msg.EXTERNAL_INPUTS = "Entradas Externas";
Blockly.Msg.HELP = "Ajuda";
Blockly.Msg.INLINE_INPUTS = "Entradas Em Linhas";
Blockly.Msg.IOS_CANCEL = "Cancel"; // untranslated
Blockly.Msg.IOS_ERROR = "Error"; // untranslated
Blockly.Msg.IOS_OK = "OK"; // untranslated
Blockly.Msg.IOS_PROCEDURES_ADD_INPUT = "+ Add Input"; // untranslated
Blockly.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS = "Allow statements"; // untranslated
Blockly.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR = "This function has duplicate inputs."; // untranslated
Blockly.Msg.IOS_PROCEDURES_INPUTS = "INPUTS"; // untranslated
Blockly.Msg.IOS_VARIABLES_ADD_BUTTON = "Add"; // untranslated
Blockly.Msg.IOS_VARIABLES_ADD_VARIABLE = "+ Add Variable"; // untranslated
Blockly.Msg.IOS_VARIABLES_DELETE_BUTTON = "Delete"; // untranslated
Blockly.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR = "You can't use an empty variable name."; // untranslated
Blockly.Msg.IOS_VARIABLES_RENAME_BUTTON = "Rename"; // untranslated
Blockly.Msg.IOS_VARIABLES_VARIABLE_NAME = "Variable name"; // untranslated
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "criar lista vazia";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Retorna uma lista, de tamanho 0, contendo nenhum registo";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "lista";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Acrescente, remova ou reordene as seções para reconfigurar este bloco lista.";
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "criar lista com";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Acrescenta um item à lista.";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Cria uma lista com qualquer número de itens.";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "primeiro";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# a partir do final";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#";
Blockly.Msg.LISTS_GET_INDEX_GET = "obter";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "obter e remover";
Blockly.Msg.LISTS_GET_INDEX_LAST = "último";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "aleatório";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "remover";
Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Retorna o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM = "Retorna o item na posição especificada da lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Retorna o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Retorna um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Remove e retorna o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM = "Remove e retorna o item na posição especificada de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Remove e retorna o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Remove e retorna um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Remove o primeiro item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM = "Remove o item de uma posição especifica da lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Remove o último item de uma lista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Remove um item aleatório de uma lista.";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "até #, a partir do final";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "até #";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "para o último";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "obtem sublista da primeira lista";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "obtem sublista de # a partir do final";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "obtem sublista de #";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Cria uma cópia da porção especificada de uma lista.";
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP = "%1 é o último item.";
Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP = "%1 é o primeiro item.";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "encontre a primeira ocorrência do item";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
Blockly.Msg.LISTS_INDEX_OF_LAST = "encontre a última ocorrência do item";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Retorna a posição da primeira/última ocorrência do item na lista. Retorna %1 se o item não for encontrado.";
Blockly.Msg.LISTS_INLIST = "na lista";
Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 está vazia";
Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Retona verdadeiro se a lista estiver vazia.";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
Blockly.Msg.LISTS_LENGTH_TITLE = "tamanho de %1";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Retorna o tamanho de uma lista.";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_REPEAT_TITLE = "criar lista com o item %1 repetido %2 vezes";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Cria uma lista constituída por um dado valor repetido o número de vezes especificado.";
Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Reverse a copy of a list."; // untranslated
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "como";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "inserir em";
Blockly.Msg.LISTS_SET_INDEX_SET = "definir";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Insere o item no início da lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM = "Insere o item numa posição especificada numa lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Insere o item no final da lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Insere o item numa posição aleatória de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Define o primeiro item de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM = "Define o item na posição especificada de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Define o último item de uma lista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Define um item aleatório de uma lista.";
Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascendente";
Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descendente";
Blockly.Msg.LISTS_SORT_TITLE = "ordenar %1 %2 %3";
Blockly.Msg.LISTS_SORT_TOOLTIP = "Ordenar uma cópia de uma lista.";
Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alfabética, ignorar maiúsculas/minúsculas";
Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numérica";
Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alfabética";
Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "fazer lista a partir de texto";
Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "fazer texto a partir da lista";
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Juntar uma lista de textos num único texto, separado por um delimitador.";
Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Dividir o texto numa lista de textos, separando-o em cada delimitador.";
Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "com delimitador";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "falso";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Retorna verdadeiro ou falso.";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "verdadeiro";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "http://pt.wikipedia.org/wiki/Inequa%C3%A7%C3%A3o";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Retorna verdadeiro se ambas as entradas forem iguais entre si.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Retorna verdadeiro se a primeira entrada for maior que a segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Retorna verdadeiro se a primeira entrada for maior ou igual à segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Retorna verdadeiro se a primeira entrada for menor que a segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Retorna verdadeiro se a primeira entrada for menor ou igual à segunda entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Retorna verdadeiro se ambas as entradas forem diferentes entre si.";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
Blockly.Msg.LOGIC_NEGATE_TITLE = "não %1";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Retorna verdadeiro se a entrada for falsa. Retorna falso se a entrada for verdadeira.";
Blockly.Msg.LOGIC_NULL = "nulo";
Blockly.Msg.LOGIC_NULL_HELPURL = "http://en.wikipedia.org/wiki/Nullable_type";
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Retorna nulo.";
Blockly.Msg.LOGIC_OPERATION_AND = "e";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
Blockly.Msg.LOGIC_OPERATION_OR = "ou";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Retorna verdadeiro se ambas as entradas forem verdadeiras.";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Retorna verdadeiro se pelo menos uma das estradas for verdadeira.";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "teste";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "http://en.wikipedia.org/wiki/%3F:";
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "se falso";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "se verdadeiro";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Avalia a condição em \"teste\". Se a condição for verdadeira retorna o valor \"se verdadeiro\", senão retorna o valor \"se falso\".";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+";
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "http://pt.wikipedia.org/wiki/Aritm%C3%A9tica";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Retorna a soma de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Retorna o quociente da divisão de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Retorna a diferença de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Retorna o produto de dois números.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Retorna o primeiro número elevado à potência do segundo número.";
Blockly.Msg.MATH_CHANGE_HELPURL = "http://pt.wikipedia.org/wiki/Adi%C3%A7%C3%A3o";
Blockly.Msg.MATH_CHANGE_TITLE = "alterar %1 por %2";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Soma um número à variável \"%1\".";
Blockly.Msg.MATH_CONSTANT_HELPURL = "http://pt.wikipedia.org/wiki/Anexo:Lista_de_constantes_matem%C3%A1ticas";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Retorna uma das constantes comuns: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), ou ∞ (infinito).";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
Blockly.Msg.MATH_CONSTRAIN_TITLE = "restringe %1 inferior %2 superior %3";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Restringe um número entre os limites especificados (inclusive).";
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷";
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "é divisível por";
Blockly.Msg.MATH_IS_EVEN = "é par";
Blockly.Msg.MATH_IS_NEGATIVE = "é negativo";
Blockly.Msg.MATH_IS_ODD = "é impar";
Blockly.Msg.MATH_IS_POSITIVE = "é positivo";
Blockly.Msg.MATH_IS_PRIME = "é primo";
Blockly.Msg.MATH_IS_TOOLTIP = "Verifica se um número é par, impar, primo, inteiro, positivo, negativo, ou se é divisível por outro número. Retorna verdadeiro ou falso.";
Blockly.Msg.MATH_IS_WHOLE = "é inteiro";
Blockly.Msg.MATH_MODULO_HELPURL = "http://pt.wikipedia.org/wiki/Opera%C3%A7%C3%A3o_m%C3%B3dulo";
Blockly.Msg.MATH_MODULO_TITLE = "resto da divisão de %1 ÷ %2";
Blockly.Msg.MATH_MODULO_TOOLTIP = "Retorna o resto da divisão de dois números.";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×";
Blockly.Msg.MATH_NUMBER_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "Um número.";
Blockly.Msg.MATH_ONLIST_HELPURL = ""; // untranslated
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "média de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "maior de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "mediana de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "menor de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "moda de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "item aleatório de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "desvio padrão de uma lista";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "soma da lista";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Retorna a média aritmética dos valores números da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Retorna o maior número da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Retorna a mediana da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Retorna o menor número da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Retorna a lista de item(ns) mais comum(ns) da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Retorna um elemento aleatório da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Retorna o desvio padrão dos números da lista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Retorna a soma de todos os números da lista.";
Blockly.Msg.MATH_POWER_SYMBOL = "^";
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero_aleat%C3%B3rio";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "fração aleatória";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Insere uma fração aleatória entre 0.0 (inclusive) e 1.0 (exclusive).";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "http://pt.wikipedia.org/wiki/N%C3%BAmero_aleat%C3%B3rio";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "inteiro aleatório entre %1 e %2";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Retorna um número inteiro entre os dois limites especificados, inclusive.";
Blockly.Msg.MATH_ROUND_HELPURL = "http://pt.wikipedia.org/wiki/Arredondamento";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "arredonda";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "arredonda para baixo";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "arredonda para cima";
Blockly.Msg.MATH_ROUND_TOOLTIP = "Arredonda um número para cima ou para baixo.";
Blockly.Msg.MATH_SINGLE_HELPURL = "http://pt.wikipedia.org/wiki/Raiz_quadrada";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "absoluto";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "raíz quadrada";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Retorna o valor absoluto de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Retorna o número e elevado à potência de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Retorna o logarítmo natural de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Retorna o logarítmo em base 10 de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Retorna o oposto de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Retorna 10 elevado à potência de um número.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Retorna a raiz quadrada de um número.";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
Blockly.Msg.MATH_TRIG_ACOS = "acos";
Blockly.Msg.MATH_TRIG_ASIN = "asin";
Blockly.Msg.MATH_TRIG_ATAN = "atan";
Blockly.Msg.MATH_TRIG_COS = "cos";
Blockly.Msg.MATH_TRIG_HELPURL = "http://pt.wikipedia.org/wiki/Fun%C3%A7%C3%A3o_trigonom%C3%A9trica";
Blockly.Msg.MATH_TRIG_SIN = "sin";
Blockly.Msg.MATH_TRIG_TAN = "tan";
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Retorna o arco cosseno de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Retorna o arco seno de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Retorna o arco tangente de um número.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Retorna o cosseno de um grau (não radiano).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Retorna o seno de um grau (não radiano).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Retorna a tangente de um grau (não radiano).";
Blockly.Msg.NEW_VARIABLE = "Criar variável…";
Blockly.Msg.NEW_VARIABLE_TITLE = "Nome da nova variável:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "permitir declarações";
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "com:";
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://pt.wikipedia.org/wiki/Sub-rotina";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Executa a função \"%1\".";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://pt.wikipedia.org/wiki/Sub-rotina";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Executa a função \"%1\" e usa o seu retorno.";
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "com:";
Blockly.Msg.PROCEDURES_CREATE_DO = "Criar \"%1\"";
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Descreva esta função...";
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "faz algo";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "para";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Cria uma função que não tem retorno.";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "retorna";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Cria uma função que possui um valor de retorno.";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Atenção: Esta função tem parâmetros duplicados.";
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Destacar definição da função";
Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "se o valor é verdadeiro, então retorna um segundo valor.";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Atenção: Este bloco só pode ser utilizado dentro da definição de uma função.";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "nome da entrada:";
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Adicionar uma entrada para a função.";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entradas";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Adicionar, remover ou reordenar as entradas para esta função.";
Blockly.Msg.REDO = "Refazer";
Blockly.Msg.REMOVE_COMMENT = "Remover Comentário";
Blockly.Msg.RENAME_VARIABLE = "Renomear variável...";
Blockly.Msg.RENAME_VARIABLE_TITLE = "Renomear todas as variáveis '%1' para:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "acrescentar texto";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_APPEND_TO = "para";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Acrescentar um pedaço de texto à variável \"%1\".";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "para minúsculas";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "para Iniciais Maiúsculas";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "para MAIÚSCULAS";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Retorna uma cópia do texto em formato diferente.";
Blockly.Msg.TEXT_CHARAT_FIRST = "obter primeira letra";
Blockly.Msg.TEXT_CHARAT_FROM_END = "obter letra nº a partir do final";
Blockly.Msg.TEXT_CHARAT_FROM_START = "obter letra nº";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "no texto";
Blockly.Msg.TEXT_CHARAT_LAST = "obter última letra";
Blockly.Msg.TEXT_CHARAT_RANDOM = "obter letra aleatória";
Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Retorna a letra na posição especificada.";
Blockly.Msg.TEXT_COUNT_HELPURL = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
Blockly.Msg.TEXT_COUNT_MESSAGE0 = "count %1 in %2"; // untranslated
Blockly.Msg.TEXT_COUNT_TOOLTIP = "Count how many times some text occurs within some other text."; // untranslated
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Acrescentar um item ao texto.";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "unir";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Acrescenta, remove ou reordena seções para reconfigurar este bloco de texto.";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "até letra nº a partir do final";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "até letra nº";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "até última letra";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "no texto";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "obter subsequência a partir da primeira letra";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "obter subsequência de tamanho # a partir do final";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "obter subsequência de tamanho #";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Retorna a parte especificada do texto.";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "no texto";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "primeira ocorrência do texto";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "última ocorrência do texto";
Blockly.Msg.TEXT_INDEXOF_TAIL = ""; // untranslated
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Retorna a posição da primeira/última ocorrência do primeiro texto no segundo texto. Retorna %1 se o texto não for encontrado.";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 está vazio";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Retorna verdadeiro se o texto fornecido estiver vazio.";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "criar texto com";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Criar um pedaço de texto juntando qualquer número de itens.";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_LENGTH_TITLE = "tamanho de %1";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Devolve o número de letras (incluindo espaços) do texto fornecido.";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
Blockly.Msg.TEXT_PRINT_TITLE = "imprime %1";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Imprime o texto, número ou outro valor especificado.";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Pede ao utilizador um número.";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Pede ao utilizador um texto.";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "pede um número com a mensagem";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "Pede um texto com a mensagem";
Blockly.Msg.TEXT_REPLACE_HELPURL = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
Blockly.Msg.TEXT_REPLACE_MESSAGE0 = "replace %1 with %2 in %3"; // untranslated
Blockly.Msg.TEXT_REPLACE_TOOLTIP = "Replace all occurances of some text within some other text."; // untranslated
Blockly.Msg.TEXT_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
Blockly.Msg.TEXT_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
Blockly.Msg.TEXT_REVERSE_TOOLTIP = "Reverses the order of the characters in the text."; // untranslated
Blockly.Msg.TEXT_TEXT_HELPURL = "http://pt.wikipedia.org/wiki/Cadeia_de_caracteres";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "Uma letra, palavra ou linha de texto.";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "remover espaços de ambos os lados";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "remover espaços à esquerda de";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "remover espaços à direita";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Retorna uma cópia do texto com os espaços removidos de uma ou ambas as extremidades.";
Blockly.Msg.TODAY = "Hoje";
Blockly.Msg.UNDO = "Anular";
Blockly.Msg.VARIABLES_DEFAULT_NAME = "item";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Criar \"definir %1\"";
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Retorna o valor desta variável.";
Blockly.Msg.VARIABLES_SET = "definir %1 para %2";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Criar \"obter %1\"";
Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Define esta variável para o valor inserido.";
Blockly.Msg.VARIABLE_ALREADY_EXISTS = "Já existe uma variável com o nome de '%1'.";
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
Blockly.Msg.MATH_HUE = "230";
Blockly.Msg.LOOPS_HUE = "120";
Blockly.Msg.LISTS_HUE = "260";
Blockly.Msg.LOGIC_HUE = "210";
Blockly.Msg.VARIABLES_HUE = "330";
Blockly.Msg.TEXTS_HUE = "160";
Blockly.Msg.PROCEDURES_HUE = "290";
Blockly.Msg.COLOUR_HUE = "20"; |
// Bulma CSS for light weight CSS. One can any css framework
import 'bulma/css/bulma.min.css';
import './resources/css/util.scss';
import './resources/css/global.css';
export default class Client {
}
|
// @flow
var fs = require('fs');
import * as src from '../../../index';
import UnmutableCompatible from './UnmutableCompatible-testutil';
let files = {
butLast: [],
// chunkBy: [],
// chunk: [],
clear: [],
clone: [],
// concat: [],
count: [],
// deal: [],
// defaults: [],
// deleteAll: [],
deleteIn: [['def', 'ghi']],
delete: ['abc'],
doIf: [() => true, _ => _, _ => _],
entries: [],
// entriesReverse: [],
entryArray: [],
equals: [123],
every: [_ => _],
filter: [_ => _],
filterNot: [_ => _],
findEntry: [_ => _],
findIndex: [_ => _],
find: [_ => _],
findKey: [_ => _],
// findLastEntry: [],
// findLastIndex: [],
// findLast: [],
// findLastKey: [],
first: [],
// flatMap: [],
// flatten: [],
forEach: [_ => _],
getIn: [['def', 'ghi']],
get: ['abc'],
// groupBy: [],
// hashCode: [],
hasIn: [['def', 'ghi']],
has: ['abc'],
identity: [],
includes: [123],
indexOf: [123],
// insert: [],
// interpose: [],
isEmpty: [],
isNotEmpty: [],
// join: [],
keyArray: [],
// keyBy: [],
keyOf: [123],
keys: [],
// lastIndexOf: [],
last: [],
// lastKeyOf: [],
log: [],
map: [_ => _],
maxBy: [_ => _],
max: [],
// mergeDeepIn: [],
// mergeDeep: [],
// mergeDeepWith: [],
// mergeIn: [],
// merge: [],
// mergeWith: [],
minBy: [_ => _],
min: [],
// move: [],
notEquals: [123],
// omit: [],
// pick: [['abc']],
// pivot: [],
// pop: [],
// push: [],
reduce: [_ => _, {}],
// reduceRight: [],
// rename: [],
rest: [],
// reverse: [],
// rotate: [],
setIn: [['def', 'ghi'], 789],
set: ['abc', 789],
// setSize: [],
// shallowEquals: [123],
shallowToJS: [],
// shift: [],
size: [],
// skip: [],
// skipLast: [],
// skipUntil: [],
// skipWhile: [],
// slice: [],
some: [_ => _],
// sortBy: [],
// sort: [],
// splice: [],
// strictEquals: [],
// swap: [],
// take: [],
// takeLast: [],
// takeUntil: [],
// takeWhile: [],
// toArray: [],
// toIndexed: [],
// toJS: [],
toJSON: [],
// toKeyed: [],
toObject: [],
// uniqueBy: [],
// unique: [],
// unit: [],
// unshift: [],
updateIn: [['def', 'ghi'], _ => _],
// updateInto: [],
update: ['abc', _ => _],
valueArray: [],
values: [],
// zipAll: [],
// zip: [],
// zipWith: []
};
let value = new UnmutableCompatible({
abc: 123,
def: {
ghi: 456
}
});
Object.keys(files).forEach((file) => {
test(`Unmutable Compatible should be able to call ${file}`, () => {
let fn = src[file](...files[file]);
let passed = true;
try {
fn(value);
} catch(e) {
console.log(`Error running Unmutable Compatible ${file}:`, e.message);
passed = false;
}
expect(passed).toBe(true);
});
});
|
!function(){"use strict";function e(e){e.put("selectbox.html",'<div tabindex="{{ vm.instance }}" class="sb-container" id="{{ vm.formatInstance(vm.instance) }}"> <a href="" class="sb-toggle" ng-click="vm.toggle()" ng-class="{\'sb-toggle-active\': vm.active}"> {{ vm.selected[vm.labelKey] || vm.value || \'Select\' }} </a> <ul class="sb-dropdown" ng-show="vm.active"> <li class="sb-item" ng-repeat="option in vm.options track by $index" ng-class="{\'sb-item-active\': option === vm.selected,\'sb-item-focus\': $index === vm.focus}"> <a href="" class="sb-item-handle" ng-click="vm.change(option)" title="{{ option[vm.labelKey] || option }}"> {{ option[vm.labelKey] || option }} </a> </li> <li class="sb-item sb-empty" ng-if="vm.options.length === 0">the list is empty</li> </ul></div>'),e.put("selectbox-multi.html",'<div tabindex="{{ vm.instance }}" class="sb-container sb-container-multi" id="{{ vm.formatInstance(vm.instance) }}"> <a href="" class="sb-toggle" ng-click="vm.toggle()" ng-class="{\'sb-toggle-active\': vm.active}"> {{ vm.title }}{{ vm.values.length ? (\': \' + vm.values.length) : \'\' }} </a> <ul class="sb-dropdown" ng-show="vm.active"> <li class="sb-item" ng-repeat="option in vm.options track by $index" ng-class="{\'sb-item-active\': vm.contains(vm.values, option[vm.idKey]),\'sb-item-focus\': $index === vm.focus}"> <a href="" class="sb-item-handle" ng-click="vm.change(option)" title="{{ option[vm.labelKey] || option }}"> {{ option[vm.labelKey] || option }} </a> </li> <li class="sb-item sb-empty" ng-if="vm.options.length === 0">the list is empty</li> </ul></div>')}function t(){function e(e,t,n,o,i){function c(){if(d.options.length)if(d.options[0][d.idKey]){for(var e=0;e<d.options.length;e+=1)if(d.options[e][d.idKey]===d.value){d.selected=d.options[e];break}}else d.selected=d.value}function l(){return i.formatInstance(d.instance)}function s(){d.active=!d.active,o(function(){d.active?v():f()})}function a(e){d.value=e[d.idKey]||e,c(),angular.isDefined(d.onChange)&&d.onChange({value:d.value})}function u(e){var t=i.getId(e.target.parentNode);l()!==t&&s()}function r(e){var t=0,n=d.options.length-1;return 13===e.keyCode?void o(function(){d.change(d.options[d.focus])}):void((40===e.keyCode||38===e.keyCode)&&o(function(){d.focus=i.getFocus(d.focus,t,n,e.keyCode),i.updateScrollPosition(d.focus,m)}))}function v(){n.bind("click",u),t.on("keydown",r)}function f(){d.focus=0,n.unbind("click",u),t.off("keydown",r)}var d=this,m=t[0].querySelector(".sb-dropdown"),g=i.getDefaults();d.instance=i.getInstance(),d.active=g.active,d.focus=g.focus,d.idKey=d.idKey||g.idKey,d.labelKey=d.labelKey||g.labelKey,c(),d.formatInstance=l,d.toggle=s,d.change=a,e.$on("$destroy",f)}return e.$inject=["$scope","$element","$document","$timeout","Selectbox"],{restrict:"E",templateUrl:"selectbox.html",scope:{},controller:e,controllerAs:"vm",bindToController:{options:"=",value:"=",idKey:"@",labelKey:"@",onChange:"&"}}}function n(){function e(e,t,n,o,i){function c(){return i.formatInstance(d.instance)}function l(){d.active=!d.active,o(function(){d.active?v():f()})}function s(e){var t=e[d.idKey],n=d.values.indexOf(t);-1===n?d.values.push(t):d.values.splice(n,1),angular.isDefined(d.onChange)&&d.onChange({values:d.values})}function a(e,t){return-1!==e.indexOf(t)}function u(e){var t=i.getId(e.target.parentNode),n=!t&&e.target.classList.contains("sb-item-handle");c()===t||n||l()}function r(e){var t=0,n=d.options.length-1;return-1!==[32,13].indexOf(e.keyCode)?void o(function(){13===e.keyCode&&f(),32===e.keyCode&&d.change(d.options[d.focus])}):void((40===e.keyCode||38===e.keyCode)&&o(function(){d.focus=i.getFocus(d.focus,t,n,e.keyCode),i.updateScrollPosition(d.focus,m)}))}function v(){n.bind("click",u),t.on("keydown",r)}function f(){d.focus=g.focus,d.active=g.active,n.unbind("click",u),t.off("keydown",r)}var d=this,m=t[0].querySelector(".sb-dropdown"),g=i.getDefaults();d.instance=i.getInstance(),d.title=d.title||"Select",d.active=g.active,d.focus=g.focus,d.idKey=d.idKey||g.idKey,d.labelKey=d.labelKey||g.labelKey,d.formatInstance=c,d.toggle=l,d.change=s,d.contains=a,e.$on("$destroy",f)}return e.$inject=["$scope","$element","$document","$timeout","Selectbox"],{restrict:"E",templateUrl:"selectbox-multi.html",scope:{},controller:e,controllerAs:"vm",bindToController:{title:"@",options:"=",values:"=",idKey:"@",labelKey:"@",onChange:"&"}}}function o(){function e(){return l+=1}function t(){return angular.copy(s)}function n(e){return"sb-"+e}function o(e,t,n,o){return 40===o&&(e=e>=n?t:e+1),38===o&&(e=t>=e?n:e-1),e}function i(e,t){var n=t.querySelector(".sb-item-focus"),o=n.offsetHeight*e;o>=t.offsetHeight?t.scrollTop=o:o<=t.scrollTop&&(t.scrollTop=0)}function c(e){return"function"!=typeof e.getAttribute?null:e.getAttribute("id")}var l=0,s={active:!1,focus:0,idKey:"id",labelKey:"label"};return{getInstance:e,getDefaults:t,formatInstance:n,getFocus:o,updateScrollPosition:i,getId:c}}angular.module("angularSelectbox",[]).run(e).directive("selectbox",t).directive("selectboxMulti",n).factory("Selectbox",o),e.$inject=["$templateCache"]}(); |
import users from "~/api/users.js";
import {
SET_USERS,
ADD_USER,
REMOVE_USER
} from "~/store/mutation-types";
const store = {
namespaced: true,
state: {
users: [],
usersMeta: {
current_page: 1,
from: 1,
last_page: 1,
per_page: 10,
to: 1,
total: 0
},
},
mutations: {
[SET_USERS](state, response) {
state.users = response.data;
state.usersMeta = response.meta;
},
[ADD_USER](state, user){
state.users.push(user);
},
[REMOVE_USER](state, id) {
state.users = state.users.filter(user => id !== user.id);
}
},
actions: {
get(_, id) {
return users
.get(id)
.then(response => {
return response.data;
})
.catch(error => {
return Promise.reject(error);
});
},
getAll({ commit }, params) {
return users
.getAll(params)
.then(response => {
commit(SET_USERS, response);
return response;
})
.catch(error => {
return Promise.reject(error);
});
},
store({ commit }, data) {
return users
.store(data)
.then(response => {
commit(ADD_USER, response);
return response;
})
.catch(({ response }) => {
return Promise.reject(response.data);
});
},
update(_, user) {
return users
.update(user)
.then(response => {
return response.data;
})
.catch(error => {
return Promise.reject(error);
});
},
destroy({ commit }, id) {
return users
.destroy(id)
.then(response => {
commit(REMOVE_USER, id);
return response.data;
})
.catch(error => {
return Promise.reject(error);
});
}
}
};
export default store;
|
import { useEffect, useState } from "react";
import io from "socket.io-client";
import ChatList from "./ChatPage/ChatList";
import withStyles from "@mui/styles/withStyles";
const URL = process.env.NODE_ENV === 'production'
? `https://${window.location.host}`
: 'http://localhost:5000';
const socket = io.connect(URL);
const styles = () => ({
wrapper: {
height: '100%',
width: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center'
},
chatList: {
display: 'flex',
minWidth: 400,
maxWidth: 600,
width: '100%',
justifyContent: 'center',
alignItems: 'top',
maxHeight: 700,
overflowY: 'auto',
margin: '20px 0',
backgroundColor: '#9AACBC'
}
});
const ChatPage = (props) => {
const { classes, user } = props;
const [rows, setRows] = useState([]);
const [message, setMessage] = useState('');
useEffect(() => {
const callback = (chats) => setRows(chats);
socket.on('load', callback);
socket.emit('load');
return () => socket.off('load', callback);
}, []);
useEffect(() => {
const callback = (chat) => { setRows([...rows, chat]) };
socket.on('push', callback);
return () => socket.off('push', callback);
}, [rows]);
const chatMessageChangeHandler = (e) => {
const { target: { value } } = e;
setMessage(value);
};
const chatMessageKeyDown = (e) => {
const { shiftKey, keyCode } = e;
if (!shiftKey & keyCode === 13) {
e.preventDefault();
submitChatHandler();
};
};
const submitChatHandler = () => {
const { _id, name, image } = user;
const data = {
message,
sender: { _id, name, image }
};
if (message === '') return;
socket.emit("push", data);
setMessage('');
};
const listProps = { user, rows };
return (
<div className={classes.wrapper}>
<div className={classes.chatList} >
<ChatList {...listProps} />
</div>
<div>
<div>
<textarea
value={message}
onChange={chatMessageChangeHandler}
onKeyDown={chatMessageKeyDown} />
</div>
<div>
<button onClick={submitChatHandler}>보내기</button>
</div>
</div>
</div>
);
};
export default withStyles(styles)(ChatPage); |
from flask import Blueprint, render_template, request, url_for
from .models import Words
from . import db
from datetime import tzinfo, timedelta, datetime
from sqlalchemy import desc
views = Blueprint('views', __name__)
@views.route('/', methods=['GET', 'POST'])
def index():
words = Words.query.order_by(desc(Words.added)).all()
return render_template('home.html', words=words)
@views.route('/add', methods=['GET', 'POST'])
def addWord():
if request.method == 'POST':
word = request.form.get('word')
meaning = request.form.get('meaning')
note = request.form.get('note')
NewWord = Words(word=word, meaning=meaning, note=note, added=datetime.now())
db.session.add(NewWord)
db.session.commit()
print(datetime.now().strftime("%Y-%m-%d %I:%M %p"))
return render_template('add.html')
|
(function(factory){if(typeof define==="function"&&define.amd){define("inputmask",["inputmask.dependencyLib"],factory);}else if(typeof exports==="object"){module.exports=factory(require("./inputmask.dependencyLib"));}else{factory(window.dependencyLib||jQuery);}}
(function($){var ua=navigator.userAgent,mobile=/mobile/i.test(ua),iemobile=/iemobile/i.test(ua),iphone=/iphone/i.test(ua)&&!iemobile,android=/android/i.test(ua)&&!iemobile;function Inputmask(alias,options){if(!(this instanceof Inputmask)){return new Inputmask(alias,options);}
if($.isPlainObject(alias)){options=alias;}else{options=options||{};options.alias=alias;}
this.el=undefined;this.opts=$.extend(true,{},this.defaults,options);this.maskset=undefined;this.noMasksCache=options&&options.definitions!==undefined;this.userOptions=options||{};this.events={};this.dataAttribute="data-inputmask";this.isRTL=this.opts.numericInput;resolveAlias(this.opts.alias,options,this.opts);}
Inputmask.prototype={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},alternatormarker:"|",escapeChar:"\\",mask:null,oncomplete:$.noop,onincomplete:$.noop,oncleared:$.noop,repeat:0,greedy:true,autoUnmask:false,removeMaskOnSubmit:false,clearMaskOnLostFocus:true,insertMode:true,clearIncomplete:false,aliases:{},alias:null,onKeyDown:$.noop,onBeforeMask:null,onBeforePaste:function(pastedValue,opts){return $.isFunction(opts.onBeforeMask)?opts.onBeforeMask(pastedValue,opts):pastedValue;},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:true,showMaskOnHover:true,onKeyValidation:$.noop,skipOptionalPartCharacter:" ",showTooltip:false,tooltip:undefined,numericInput:false,rightAlign:false,undoOnEscape:true,radixPoint:"",radixPointDefinitionSymbol:undefined,groupSeparator:"",keepStatic:null,positionCaretOnTab:true,tabThrough:false,supportsInputType:["text","tel","password"],definitions:{"9":{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},"a":{validator:"[A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",cardinality:1,definitionSymbol:"*"},"*":{validator:"[0-9A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",cardinality:1}},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],isComplete:null,canClearPosition:$.noop,postValidation:null,staticDefinitionSymbol:undefined,jitMasking:false,nullable:true,inputEventOnly:false,noValuePatching:false,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:false,androidHack:false},masksCache:{},mask:function(elems){var that=this;function importAttributeOptions(npt,opts,userOptions,dataAttribute){var attrOptions=npt.getAttribute(dataAttribute),option,dataoptions,optionData,p;function importOption(option,optionData){optionData=optionData!==undefined?optionData:npt.getAttribute(dataAttribute+"-"+option);if(optionData!==null){if(typeof optionData==="string"){if(option.indexOf("on")===0)optionData=window[optionData];else if(optionData==="false")optionData=false;else if(optionData==="true")optionData=true;}
userOptions[option]=optionData;}}
if(attrOptions&&attrOptions!==""){attrOptions=attrOptions.replace(new RegExp("'","g"),'"');dataoptions=JSON.parse("{"+attrOptions+"}");}
if(dataoptions){optionData=undefined;for(p in dataoptions){if(p.toLowerCase()==="alias"){optionData=dataoptions[p];break;}}}
importOption("alias",optionData);if(userOptions.alias){resolveAlias(userOptions.alias,userOptions,opts);}
for(option in opts){if(dataoptions){optionData=undefined;for(p in dataoptions){if(p.toLowerCase()===option.toLowerCase()){optionData=dataoptions[p];break;}}}
importOption(option,optionData);}
$.extend(true,opts,userOptions);return opts;}
if(typeof elems==="string"){elems=document.getElementById(elems)||document.querySelectorAll(elems);}
elems=elems.nodeName?[elems]:elems;$.each(elems,function(ndx,el){var scopedOpts=$.extend(true,{},that.opts);importAttributeOptions(el,scopedOpts,$.extend(true,{},that.userOptions),that.dataAttribute);var maskset=generateMaskSet(scopedOpts,that.noMasksCache);if(maskset!==undefined){if(el.inputmask!==undefined){el.inputmask.remove();}
el.inputmask=new Inputmask();el.inputmask.opts=scopedOpts;el.inputmask.noMasksCache=that.noMasksCache;el.inputmask.userOptions=$.extend(true,{},that.userOptions);el.inputmask.el=el;el.inputmask.maskset=maskset;$.data(el,"_inputmask_opts",scopedOpts);maskScope.call(el.inputmask,{"action":"mask"});}});return elems&&elems[0]?(elems[0].inputmask||this):this;},option:function(options,noremask){if(typeof options==="string"){return this.opts[options];}else if(typeof options==="object"){$.extend(this.userOptions,options);if(this.el&&noremask!==true){this.mask(this.el);}
return this;}},unmaskedvalue:function(value){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"unmaskedvalue","value":value});},remove:function(){return maskScope.call(this,{"action":"remove"});},getemptymask:function(){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"getemptymask"});},hasMaskedValue:function(){return!this.opts.autoUnmask;},isComplete:function(){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"isComplete"});},getmetadata:function(){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"getmetadata"});},isValid:function(value){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"isValid","value":value});},format:function(value,metadata){this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache);return maskScope.call(this,{"action":"format","value":value,"metadata":metadata});},analyseMask:function(mask,opts){var tokenizer=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,escaped=false,currentToken=new MaskToken(),match,m,openenings=[],maskTokens=[],openingToken,currentOpeningToken,alternator,lastMatch,groupToken;function MaskToken(isGroup,isOptional,isQuantifier,isAlternator){this.matches=[];this.isGroup=isGroup||false;this.isOptional=isOptional||false;this.isQuantifier=isQuantifier||false;this.isAlternator=isAlternator||false;this.quantifier={min:1,max:1};}
function insertTestDefinition(mtoken,element,position){var maskdef=opts.definitions[element];position=position!==undefined?position:mtoken.matches.length;var prevMatch=mtoken.matches[position-1];if(maskdef&&!escaped){maskdef.placeholder=$.isFunction(maskdef.placeholder)?maskdef.placeholder(opts):maskdef.placeholder;var prevalidators=maskdef.prevalidator,prevalidatorsL=prevalidators?prevalidators.length:0;for(var i=1;i<maskdef.cardinality;i++){var prevalidator=prevalidatorsL>=i?prevalidators[i-1]:[],validator=prevalidator.validator,cardinality=prevalidator.cardinality;mtoken.matches.splice(position++,0,{fn:validator?typeof validator==="string"?new RegExp(validator):new function(){this.test=validator;}:new RegExp("."),cardinality:cardinality?cardinality:1,optionality:mtoken.isOptional,newBlockMarker:prevMatch===undefined||prevMatch.def!==(maskdef.definitionSymbol||element),casing:maskdef.casing,def:maskdef.definitionSymbol||element,placeholder:maskdef.placeholder,nativeDef:element});prevMatch=mtoken.matches[position-1];}
mtoken.matches.splice(position++,0,{fn:maskdef.validator?typeof maskdef.validator=="string"?new RegExp(maskdef.validator):new function(){this.test=maskdef.validator;}:new RegExp("."),cardinality:maskdef.cardinality,optionality:mtoken.isOptional,newBlockMarker:prevMatch===undefined||prevMatch.def!==(maskdef.definitionSymbol||element),casing:maskdef.casing,def:maskdef.definitionSymbol||element,placeholder:maskdef.placeholder,nativeDef:element});}else{mtoken.matches.splice(position++,0,{fn:null,cardinality:0,optionality:mtoken.isOptional,newBlockMarker:prevMatch===undefined||prevMatch.def!==element,casing:null,def:opts.staticDefinitionSymbol||element,placeholder:opts.staticDefinitionSymbol!==undefined?element:undefined,nativeDef:element});escaped=false;}}
function verifyGroupMarker(lastMatch,isOpenGroup){if(lastMatch&&lastMatch.isGroup){lastMatch.isGroup=false;insertTestDefinition(lastMatch,opts.groupmarker.start,0);if(isOpenGroup!==true){insertTestDefinition(lastMatch,opts.groupmarker.end);}}}
function maskCurrentToken(m,currentToken,lastMatch,extraCondition){if(currentToken.matches.length>0&&(extraCondition===undefined||extraCondition)){lastMatch=currentToken.matches[currentToken.matches.length-1];verifyGroupMarker(lastMatch);}
insertTestDefinition(currentToken,m);}
function defaultCase(){if(openenings.length>0){currentOpeningToken=openenings[openenings.length-1];maskCurrentToken(m,currentOpeningToken,lastMatch,!currentOpeningToken.isAlternator);if(currentOpeningToken.isAlternator){alternator=openenings.pop();for(var mndx=0;mndx<alternator.matches.length;mndx++){alternator.matches[mndx].isGroup=false;}
if(openenings.length>0){currentOpeningToken=openenings[openenings.length-1];currentOpeningToken.matches.push(alternator);}else{currentToken.matches.push(alternator);}}}else{maskCurrentToken(m,currentToken,lastMatch);}}
function reverseTokens(maskToken){function reverseStatic(st){if(st===opts.optionalmarker.start)st=opts.optionalmarker.end;else if(st===opts.optionalmarker.end)st=opts.optionalmarker.start;else if(st===opts.groupmarker.start)st=opts.groupmarker.end;else if(st===opts.groupmarker.end)st=opts.groupmarker.start;return st;}
maskToken.matches=maskToken.matches.reverse();for(var match in maskToken.matches){var intMatch=parseInt(match);if(maskToken.matches[match].isQuantifier&&maskToken.matches[intMatch+1]&&maskToken.matches[intMatch+1].isGroup){var qt=maskToken.matches[match];maskToken.matches.splice(match,1);maskToken.matches.splice(intMatch+1,0,qt);}
if(maskToken.matches[match].matches!==undefined){maskToken.matches[match]=reverseTokens(maskToken.matches[match]);}else{maskToken.matches[match]=reverseStatic(maskToken.matches[match]);}}
return maskToken;}
while(match=tokenizer.exec(mask)){m=match[0];if(escaped){defaultCase();continue;}
switch(m.charAt(0)){case opts.escapeChar:escaped=true;break;case opts.optionalmarker.end:case opts.groupmarker.end:openingToken=openenings.pop();if(openingToken!==undefined){if(openenings.length>0){currentOpeningToken=openenings[openenings.length-1];currentOpeningToken.matches.push(openingToken);if(currentOpeningToken.isAlternator){alternator=openenings.pop();for(var mndx=0;mndx<alternator.matches.length;mndx++){alternator.matches[mndx].isGroup=false;}
if(openenings.length>0){currentOpeningToken=openenings[openenings.length-1];currentOpeningToken.matches.push(alternator);}else{currentToken.matches.push(alternator);}}}else{currentToken.matches.push(openingToken);}}else defaultCase();break;case opts.optionalmarker.start:verifyGroupMarker(currentToken.matches[currentToken.matches.length-1]);openenings.push(new MaskToken(false,true));break;case opts.groupmarker.start:verifyGroupMarker(currentToken.matches[currentToken.matches.length-1]);openenings.push(new MaskToken(true));break;case opts.quantifiermarker.start:var quantifier=new MaskToken(false,false,true);m=m.replace(/[{}]/g,"");var mq=m.split(","),mq0=isNaN(mq[0])?mq[0]:parseInt(mq[0]),mq1=mq.length===1?mq0:(isNaN(mq[1])?mq[1]:parseInt(mq[1]));if(mq1==="*"||mq1==="+"){mq0=mq1==="*"?0:1;}
quantifier.quantifier={min:mq0,max:mq1};if(openenings.length>0){var matches=openenings[openenings.length-1].matches;match=matches.pop();if(!match.isGroup){groupToken=new MaskToken(true);groupToken.matches.push(match);match=groupToken;}
matches.push(match);matches.push(quantifier);}else{match=currentToken.matches.pop();if(!match.isGroup){groupToken=new MaskToken(true);groupToken.matches.push(match);match=groupToken;}
currentToken.matches.push(match);currentToken.matches.push(quantifier);}
break;case opts.alternatormarker:if(openenings.length>0){currentOpeningToken=openenings[openenings.length-1];lastMatch=currentOpeningToken.matches.pop();}else{lastMatch=currentToken.matches.pop();}
if(lastMatch.isAlternator){openenings.push(lastMatch);}else{alternator=new MaskToken(false,false,false,true);alternator.matches.push(lastMatch);openenings.push(alternator);}
break;default:defaultCase();}}
while(openenings.length>0){openingToken=openenings.pop();verifyGroupMarker(openingToken,true);currentToken.matches.push(openingToken);}
if(currentToken.matches.length>0){lastMatch=currentToken.matches[currentToken.matches.length-1];verifyGroupMarker(lastMatch);maskTokens.push(currentToken);}
if(opts.numericInput){reverseTokens(maskTokens[0]);}
return maskTokens;},};Inputmask.extendDefaults=function(options){$.extend(true,Inputmask.prototype.defaults,options);};Inputmask.extendDefinitions=function(definition){$.extend(true,Inputmask.prototype.defaults.definitions,definition);};Inputmask.extendAliases=function(alias){$.extend(true,Inputmask.prototype.defaults.aliases,alias);};Inputmask.format=function(value,options,metadata){return Inputmask(options).format(value,metadata);};Inputmask.unmask=function(value,options){return Inputmask(options).unmaskedvalue(value);};Inputmask.isValid=function(value,options){return Inputmask(options).isValid(value);};Inputmask.remove=function(elems){$.each(elems,function(ndx,el){if(el.inputmask)el.inputmask.remove();});};Inputmask.escapeRegex=function(str){var specials=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return str.replace(new RegExp("(\\"+specials.join("|\\")+")","gim"),"\\$1");};Inputmask.keyCode={ALT:18,BACKSPACE:8,BACKSPACE_SAFARI:127,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91,X:88};function resolveAlias(aliasStr,options,opts){var aliasDefinition=opts.aliases[aliasStr];if(aliasDefinition){if(aliasDefinition.alias)resolveAlias(aliasDefinition.alias,undefined,opts);$.extend(true,opts,aliasDefinition);$.extend(true,opts,options);return true;}else
if(opts.mask===null){opts.mask=aliasStr;}
return false;}
function generateMaskSet(opts,nocache){function generateMask(mask,metadata,opts){if(mask===null||mask===""){return undefined;}else{if(mask.length===1&&opts.greedy===false&&opts.repeat!==0){opts.placeholder="";}
if(opts.repeat>0||opts.repeat==="*"||opts.repeat==="+"){var repeatStart=opts.repeat==="*"?0:(opts.repeat==="+"?1:opts.repeat);mask=opts.groupmarker.start+mask+opts.groupmarker.end+opts.quantifiermarker.start+repeatStart+","+opts.repeat+opts.quantifiermarker.end;}
var masksetDefinition;if(Inputmask.prototype.masksCache[mask]===undefined||nocache===true){masksetDefinition={"mask":mask,"maskToken":Inputmask.prototype.analyseMask(mask,opts),"validPositions":{},"_buffer":undefined,"buffer":undefined,"tests":{},"metadata":metadata,maskLength:undefined};if(nocache!==true){Inputmask.prototype.masksCache[opts.numericInput?mask.split("").reverse().join(""):mask]=masksetDefinition;masksetDefinition=$.extend(true,{},Inputmask.prototype.masksCache[opts.numericInput?mask.split("").reverse().join(""):mask]);}}else masksetDefinition=$.extend(true,{},Inputmask.prototype.masksCache[opts.numericInput?mask.split("").reverse().join(""):mask]);return masksetDefinition;}}
var ms;if($.isFunction(opts.mask)){opts.mask=opts.mask(opts);}
if($.isArray(opts.mask)){if(opts.mask.length>1){opts.keepStatic=opts.keepStatic===null?true:opts.keepStatic;var altMask=opts.groupmarker.start;$.each(opts.numericInput?opts.mask.reverse():opts.mask,function(ndx,msk){if(altMask.length>1){altMask+=opts.groupmarker.end+opts.alternatormarker+opts.groupmarker.start;}
if(msk.mask!==undefined&&!$.isFunction(msk.mask)){altMask+=msk.mask;}else{altMask+=msk;}});altMask+=opts.groupmarker.end;return generateMask(altMask,opts.mask,opts);}else opts.mask=opts.mask.pop();}
if(opts.mask){if(opts.mask.mask!==undefined&&!$.isFunction(opts.mask.mask)){ms=generateMask(opts.mask.mask,opts.mask,opts);}else{ms=generateMask(opts.mask,opts.mask,opts);}}
return ms;};function maskScope(actionObj,maskset,opts){maskset=maskset||this.maskset;opts=opts||this.opts;var el=this.el,isRTL=this.isRTL,undoValue,$el,skipKeyPressEvent=false,skipInputEvent=false,composition=false,ignorable=false,maxLength,mouseEnter=false,colorMask;function getMaskTemplate(baseOnInput,minimalPos,includeMode){minimalPos=minimalPos||0;var maskTemplate=[],ndxIntlzr,pos=0,test,testPos,lvp=getLastValidPosition();maxLength=el!==undefined?el.maxLength:undefined;if(maxLength===-1)maxLength=undefined;do{if(baseOnInput===true&&getMaskSet().validPositions[pos]){testPos=getMaskSet().validPositions[pos];test=testPos.match;ndxIntlzr=testPos.locator.slice();maskTemplate.push(includeMode===true?testPos.input:includeMode===false?test.nativeDef:getPlaceholder(pos,test));}else{testPos=getTestTemplate(pos,ndxIntlzr,pos-1);test=testPos.match;ndxIntlzr=testPos.locator.slice();if(opts.jitMasking===false||pos<lvp||(Number.isFinite(opts.jitMasking)&&opts.jitMasking>pos)){maskTemplate.push(includeMode===false?test.nativeDef:getPlaceholder(pos,test));}}
pos++;}while((maxLength===undefined||pos<maxLength)&&(test.fn!==null||test.def!=="")||minimalPos>pos);if(maskTemplate[maskTemplate.length-1]===""){maskTemplate.pop();}
getMaskSet().maskLength=pos+1;return maskTemplate;}
function getMaskSet(){return maskset;}
function resetMaskSet(soft){var maskset=getMaskSet();maskset.buffer=undefined;if(soft!==true){maskset._buffer=undefined;maskset.validPositions={};maskset.p=0;}}
function getLastValidPosition(closestTo,strict,validPositions){var before=-1,after=-1,valids=validPositions||getMaskSet().validPositions;if(closestTo===undefined)closestTo=-1;for(var posNdx in valids){var psNdx=parseInt(posNdx);if(valids[psNdx]&&(strict||valids[psNdx].match.fn!==null)){if(psNdx<=closestTo)before=psNdx;if(psNdx>=closestTo)after=psNdx;}}
return(before!==-1&&(closestTo-before)>1)||after<closestTo?before:after;}
function stripValidPositions(start,end,nocheck,strict){function IsEnclosedStatic(pos){var posMatch=getMaskSet().validPositions[pos];if(posMatch!==undefined&&posMatch.match.fn===null){var prevMatch=getMaskSet().validPositions[pos-1],nextMatch=getMaskSet().validPositions[pos+1];return prevMatch!==undefined&&nextMatch!==undefined;}
return false;}
var i,startPos=start,positionsClone=$.extend(true,{},getMaskSet().validPositions),needsValidation=false;getMaskSet().p=start;for(i=end-1;i>=startPos;i--){if(getMaskSet().validPositions[i]!==undefined){if(nocheck===true||((getMaskSet().validPositions[i].match.optionality||!IsEnclosedStatic(i))&&opts.canClearPosition(getMaskSet(),i,getLastValidPosition(),strict,opts)!==false)){delete getMaskSet().validPositions[i];}}}
resetMaskSet(true);for(i=startPos+1;i<=getLastValidPosition();){while(getMaskSet().validPositions[startPos]!==undefined)startPos++;var s=getMaskSet().validPositions[startPos];if(i<startPos)i=startPos+1;if((getMaskSet().validPositions[i]!==undefined||!isMask(i))&&s===undefined){var t=getTestTemplate(i);if(needsValidation===false&&positionsClone[startPos]&&positionsClone[startPos].match.def===t.match.def){getMaskSet().validPositions[startPos]=$.extend(true,{},positionsClone[startPos]);getMaskSet().validPositions[startPos].input=t.input;delete getMaskSet().validPositions[i];i++;}else if(positionCanMatchDefinition(startPos,t.match.def)){if(isValid(startPos,t.input||getPlaceholder(i),true)!==false){delete getMaskSet().validPositions[i];i++;needsValidation=true;}}else if(!isMask(i)){i++;startPos--;}
startPos++;}else i++;}
resetMaskSet(true);}
function determineTestTemplate(tests,guessNextBest){var testPos,testPositions=tests,lvp=getLastValidPosition(),lvTest=getMaskSet().validPositions[lvp]||getTests(0)[0],lvTestAltArr=(lvTest.alternation!==undefined)?lvTest.locator[lvTest.alternation].toString().split(","):[];for(var ndx=0;ndx<testPositions.length;ndx++){testPos=testPositions[ndx];if(testPos.match&&(((opts.greedy&&testPos.match.optionalQuantifier!==true)||(testPos.match.optionality===false||testPos.match.newBlockMarker===false)&&testPos.match.optionalQuantifier!==true)&&((lvTest.alternation===undefined||lvTest.alternation!==testPos.alternation)||(testPos.locator[lvTest.alternation]!==undefined&&checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","),lvTestAltArr))))){if(guessNextBest!==true||(testPos.match.fn===null&&!/[0-9a-bA-Z]/.test(testPos.match.def)))
break;}}
return testPos;}
function getTestTemplate(pos,ndxIntlzr,tstPs){return getMaskSet().validPositions[pos]||determineTestTemplate(getTests(pos,ndxIntlzr?ndxIntlzr.slice():ndxIntlzr,tstPs));}
function getTest(pos){if(getMaskSet().validPositions[pos]){return getMaskSet().validPositions[pos];}
return getTests(pos)[0];}
function positionCanMatchDefinition(pos,def){var valid=false,tests=getTests(pos);for(var tndx=0;tndx<tests.length;tndx++){if(tests[tndx].match&&tests[tndx].match.def===def){valid=true;break;}}
return valid;}
function getTests(pos,ndxIntlzr,tstPs){var maskTokens=getMaskSet().maskToken,testPos=ndxIntlzr?tstPs:0,ndxInitializer=ndxIntlzr?ndxIntlzr.slice():[0],matches=[],insertStop=false,latestMatch,cacheDependency=ndxIntlzr?ndxIntlzr.join(""):"";function resolveTestFromToken(maskToken,ndxInitializer,loopNdx,quantifierRecurse){function handleMatch(match,loopNdx,quantifierRecurse){function isFirstMatch(latestMatch,tokenGroup){var firstMatch=$.inArray(latestMatch,tokenGroup.matches)===0;if(!firstMatch){$.each(tokenGroup.matches,function(ndx,match){if(match.isQuantifier===true){firstMatch=isFirstMatch(latestMatch,tokenGroup.matches[ndx-1]);if(firstMatch)return false;}});}
return firstMatch;}
function resolveNdxInitializer(pos,alternateNdx,targetAlternation){var bestMatch,indexPos;if(getMaskSet().tests[pos]||getMaskSet().validPositions[pos]){$.each(getMaskSet().tests[pos]||[getMaskSet().validPositions[pos]],function(ndx,lmnt){var alternation=targetAlternation!==undefined?targetAlternation:lmnt.alternation,ndxPos=lmnt.locator[alternation]!==undefined?lmnt.locator[alternation].toString().indexOf(alternateNdx):-1;if((indexPos===undefined||ndxPos<indexPos)&&ndxPos!==-1){bestMatch=lmnt;indexPos=ndxPos;}});}
return bestMatch?bestMatch.locator.slice((targetAlternation!==undefined?targetAlternation:bestMatch.alternation)+1):targetAlternation!==undefined?resolveNdxInitializer(pos,alternateNdx):undefined;}
function staticCanMatchDefinition(source,target){if(source.match.fn===null&&target.match.fn!==null){return target.match.fn.test(source.match.def,getMaskSet(),pos,false,opts,false);}
return false;}
if(testPos>10000){throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+getMaskSet().mask;}
if(testPos===pos&&match.matches===undefined){matches.push({"match":match,"locator":loopNdx.reverse(),"cd":cacheDependency});return true;}else if(match.matches!==undefined){if(match.isGroup&&quantifierRecurse!==match){match=handleMatch(maskToken.matches[$.inArray(match,maskToken.matches)+1],loopNdx);if(match)return true;}else if(match.isOptional){var optionalToken=match;match=resolveTestFromToken(match,ndxInitializer,loopNdx,quantifierRecurse);if(match){latestMatch=matches[matches.length-1].match;if(isFirstMatch(latestMatch,optionalToken)){insertStop=true;testPos=pos;}else return true;}}else if(match.isAlternator){var alternateToken=match,malternateMatches=[],maltMatches,currentMatches=matches.slice(),loopNdxCnt=loopNdx.length;var altIndex=ndxInitializer.length>0?ndxInitializer.shift():-1;if(altIndex===-1||typeof altIndex==="string"){var currentPos=testPos,ndxInitializerClone=ndxInitializer.slice(),altIndexArr=[],amndx;if(typeof altIndex=="string"){altIndexArr=altIndex.split(",");}else{for(amndx=0;amndx<alternateToken.matches.length;amndx++){altIndexArr.push(amndx);}}
for(var ndx=0;ndx<altIndexArr.length;ndx++){amndx=parseInt(altIndexArr[ndx]);matches=[];ndxInitializer=resolveNdxInitializer(testPos,amndx,loopNdxCnt)||ndxInitializerClone.slice();match=handleMatch(alternateToken.matches[amndx]||maskToken.matches[amndx],[amndx].concat(loopNdx),quantifierRecurse)||match;if(match!==true&&match!==undefined&&(altIndexArr[altIndexArr.length-1]<alternateToken.matches.length)){var ntndx=$.inArray(match,maskToken.matches)+1;if(maskToken.matches.length>ntndx){match=handleMatch(maskToken.matches[ntndx],[ntndx].concat(loopNdx.slice(1,loopNdx.length)),quantifierRecurse);if(match){altIndexArr.push(ntndx.toString());$.each(matches,function(ndx,lmnt){lmnt.alternation=loopNdx.length-1;});}}}
maltMatches=matches.slice();testPos=currentPos;matches=[];for(var ndx1=0;ndx1<maltMatches.length;ndx1++){var altMatch=maltMatches[ndx1],hasMatch=false;altMatch.alternation=altMatch.alternation||loopNdxCnt;for(var ndx2=0;ndx2<malternateMatches.length;ndx2++){var altMatch2=malternateMatches[ndx2];if(typeof altIndex!=="string"||$.inArray(altMatch.locator[altMatch.alternation].toString(),altIndexArr)!==-1){if(altMatch.match.def===altMatch2.match.def||staticCanMatchDefinition(altMatch,altMatch2)){hasMatch=altMatch.match.nativeDef===altMatch2.match.nativeDef;if(altMatch.alternation==altMatch2.alternation&&altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation])===-1){altMatch2.locator[altMatch2.alternation]=altMatch2.locator[altMatch2.alternation]+","+altMatch.locator[altMatch.alternation];altMatch2.alternation=altMatch.alternation;if(altMatch.match.fn==null){altMatch2.na=altMatch2.na||altMatch.locator[altMatch.alternation].toString();if(altMatch2.na.indexOf(altMatch.locator[altMatch.alternation])===-1)
altMatch2.na=altMatch2.na+","+altMatch.locator[altMatch.alternation];}}
break;}}}
if(!hasMatch){malternateMatches.push(altMatch);}}}
if(typeof altIndex=="string"){malternateMatches=$.map(malternateMatches,function(lmnt,ndx){if(isFinite(ndx)){var mamatch,alternation=lmnt.alternation,altLocArr=lmnt.locator[alternation].toString().split(",");lmnt.locator[alternation]=undefined;lmnt.alternation=undefined;for(var alndx=0;alndx<altLocArr.length;alndx++){mamatch=$.inArray(altLocArr[alndx],altIndexArr)!==-1;if(mamatch){if(lmnt.locator[alternation]!==undefined){lmnt.locator[alternation]+=",";lmnt.locator[alternation]+=altLocArr[alndx];}else lmnt.locator[alternation]=parseInt(altLocArr[alndx]);lmnt.alternation=alternation;}}
if(lmnt.locator[alternation]!==undefined)return lmnt;}});}
matches=currentMatches.concat(malternateMatches);testPos=pos;insertStop=matches.length>0;ndxInitializer=ndxInitializerClone.slice();}else{match=handleMatch(alternateToken.matches[altIndex]||maskToken.matches[altIndex],[altIndex].concat(loopNdx),quantifierRecurse);}
if(match)return true;}else if(match.isQuantifier&&quantifierRecurse!==maskToken.matches[$.inArray(match,maskToken.matches)-1]){var qt=match;for(var qndx=(ndxInitializer.length>0)?ndxInitializer.shift():0;(qndx<(isNaN(qt.quantifier.max)?qndx+1:qt.quantifier.max))&&testPos<=pos;qndx++){var tokenGroup=maskToken.matches[$.inArray(qt,maskToken.matches)-1];match=handleMatch(tokenGroup,[qndx].concat(loopNdx),tokenGroup);if(match){latestMatch=matches[matches.length-1].match;latestMatch.optionalQuantifier=qndx>(qt.quantifier.min-1);if(isFirstMatch(latestMatch,tokenGroup)){if(qndx>(qt.quantifier.min-1)){insertStop=true;testPos=pos;break;}else return true;}else{return true;}}}}else{match=resolveTestFromToken(match,ndxInitializer,loopNdx,quantifierRecurse);if(match)return true;}}
else
testPos++;}
for(var tndx=(ndxInitializer.length>0?ndxInitializer.shift():0);tndx<maskToken.matches.length;tndx++){if(maskToken.matches[tndx].isQuantifier!==true){var match=handleMatch(maskToken.matches[tndx],[tndx].concat(loopNdx),quantifierRecurse);if(match&&testPos===pos){return match;}else if(testPos>pos){break;}}}}
function mergeLocators(tests){var locator=[];if(!$.isArray(tests))tests=[tests];if(tests.length>0){if(tests[0].alternation===undefined){locator=determineTestTemplate(tests.slice()).locator.slice();if(locator.length===0)locator=tests[0].locator.slice();}
else{$.each(tests,function(ndx,tst){if(tst.def!==""){if(locator.length===0)locator=tst.locator.slice();else{for(var i=0;i<locator.length;i++){if(tst.locator[i]&&locator[i].toString().indexOf(tst.locator[i])===-1){locator[i]+=","+tst.locator[i];}}}}});}}
return locator;}
function filterTests(tests){if(opts.keepStatic&&pos>0){if(tests.length>1+(tests[tests.length-1].match.def===""?1:0)){if(tests[0].match.optionality!==true&&tests[0].match.optionalQuantifier!==true&&tests[0].match.fn===null&&!/[0-9a-bA-Z]/.test(tests[0].match.def)){return[determineTestTemplate(tests)];}}}
return tests;}
if(pos>-1){if(ndxIntlzr===undefined){var previousPos=pos-1,test;while((test=getMaskSet().validPositions[previousPos]||getMaskSet().tests[previousPos])===undefined&&previousPos>-1){previousPos--;}
if(test!==undefined&&previousPos>-1){ndxInitializer=mergeLocators(test);cacheDependency=ndxInitializer.join("");testPos=previousPos;}}
if(getMaskSet().tests[pos]&&getMaskSet().tests[pos][0].cd===cacheDependency){return filterTests(getMaskSet().tests[pos]);}
for(var mtndx=ndxInitializer.shift();mtndx<maskTokens.length;mtndx++){var match=resolveTestFromToken(maskTokens[mtndx],ndxInitializer,[mtndx]);if((match&&testPos===pos)||testPos>pos){break;}}}
if(matches.length===0||insertStop){matches.push({match:{fn:null,cardinality:0,optionality:true,casing:null,def:"",placeholder:""},locator:[],cd:cacheDependency});}
if(ndxIntlzr!==undefined&&getMaskSet().tests[pos]){return filterTests($.extend(true,[],matches));}
getMaskSet().tests[pos]=$.extend(true,[],matches);return filterTests(getMaskSet().tests[pos]);}
function getBufferTemplate(){if(getMaskSet()._buffer===undefined){getMaskSet()._buffer=getMaskTemplate(false,1);if(getMaskSet().buffer===undefined){getMaskSet()._buffer.slice();}}
return getMaskSet()._buffer;}
function getBuffer(noCache){if(getMaskSet().buffer===undefined||noCache===true){getMaskSet().buffer=getMaskTemplate(true,getLastValidPosition(),true);}
return getMaskSet().buffer;}
function refreshFromBuffer(start,end,buffer){var i;if(start===true){resetMaskSet();start=0;end=buffer.length;}else{for(i=start;i<end;i++){delete getMaskSet().validPositions[i];}}
for(i=start;i<end;i++){resetMaskSet(true);if(buffer[i]!==opts.skipOptionalPartCharacter){isValid(i,buffer[i],true,true);}}}
function casing(elem,test,pos){switch(opts.casing||test.casing){case "upper":elem=elem.toUpperCase();break;case "lower":elem=elem.toLowerCase();break;case "title":var posBefore=getMaskSet().validPositions[pos-1];if(pos===0||posBefore&&posBefore.input===String.fromCharCode(Inputmask.keyCode.SPACE)){elem=elem.toUpperCase();}else{elem=elem.toLowerCase();}
break;}
return elem;}
function checkAlternationMatch(altArr1,altArr2){var altArrC=opts.greedy?altArr2:altArr2.slice(0,1),isMatch=false;for(var alndx=0;alndx<altArr1.length;alndx++){if($.inArray(altArr1[alndx],altArrC)!==-1){isMatch=true;break;}}
return isMatch;}
function isValid(pos,c,strict,fromSetValid,fromAlternate){function isSelection(posObj){var selection=isRTL?(posObj.begin-posObj.end)>1||((posObj.begin-posObj.end)===1&&opts.insertMode):(posObj.end-posObj.begin)>1||((posObj.end-posObj.begin)===1&&opts.insertMode);return selection&&posObj.begin===0&&posObj.end===getMaskSet().maskLength?"full":selection;}
strict=strict===true;var maskPos=pos;if(pos.begin!==undefined){maskPos=isRTL&&!isSelection(pos)?pos.end:pos.begin;}
function _isValid(position,c,strict){var rslt=false;$.each(getTests(position),function(ndx,tst){var test=tst.match,loopend=c?1:0,chrs="";for(var i=test.cardinality;i>loopend;i--){chrs+=getBufferElement(position-(i-1));}
if(c){chrs+=c;}
getBuffer(true);rslt=test.fn!=null?test.fn.test(chrs,getMaskSet(),position,strict,opts,isSelection(pos)):(c===test.def||c===opts.skipOptionalPartCharacter)&&test.def!==""?{c:test.placeholder||test.def,pos:position}:false;if(rslt!==false){var elem=rslt.c!==undefined?rslt.c:c;elem=(elem===opts.skipOptionalPartCharacter&&test.fn===null)?(test.placeholder||test.def):elem;var validatedPos=position,possibleModifiedBuffer=getBuffer();if(rslt.remove!==undefined){if(!$.isArray(rslt.remove))rslt.remove=[rslt.remove];$.each(rslt.remove.sort(function(a,b){return b-a;}),function(ndx,lmnt){stripValidPositions(lmnt,lmnt+1,true);});}
if(rslt.insert!==undefined){if(!$.isArray(rslt.insert))rslt.insert=[rslt.insert];$.each(rslt.insert.sort(function(a,b){return a-b;}),function(ndx,lmnt){isValid(lmnt.pos,lmnt.c,true,fromSetValid);});}
if(rslt.refreshFromBuffer){var refresh=rslt.refreshFromBuffer;strict=true;refreshFromBuffer(refresh===true?refresh:refresh.start,refresh.end,possibleModifiedBuffer);if(rslt.pos===undefined&&rslt.c===undefined){rslt.pos=getLastValidPosition();return false;}
validatedPos=rslt.pos!==undefined?rslt.pos:position;if(validatedPos!==position){rslt=$.extend(rslt,isValid(validatedPos,elem,true,fromSetValid));return false;}}else if(rslt!==true&&rslt.pos!==undefined&&rslt.pos!==position){validatedPos=rslt.pos;refreshFromBuffer(position,validatedPos,getBuffer().slice());if(validatedPos!==position){rslt=$.extend(rslt,isValid(validatedPos,elem,true));return false;}}
if(rslt!==true&&rslt.pos===undefined&&rslt.c===undefined){return false;}
if(ndx>0){resetMaskSet(true);}
if(!setValidPosition(validatedPos,$.extend({},tst,{"input":casing(elem,test,validatedPos)}),fromSetValid,isSelection(pos))){rslt=false;}
return false;}});return rslt;}
function alternate(pos,c,strict){var validPsClone=$.extend(true,{},getMaskSet().validPositions),lastAlt,alternation,isValidRslt=false,altPos,prevAltPos,i,validPos,lAltPos=getLastValidPosition(),altNdxs,decisionPos;prevAltPos=getMaskSet().validPositions[lAltPos];for(;lAltPos>=0;lAltPos--){altPos=getMaskSet().validPositions[lAltPos];if(altPos&&altPos.alternation!==undefined){lastAlt=lAltPos;alternation=getMaskSet().validPositions[lastAlt].alternation;if(prevAltPos.locator[altPos.alternation]!==altPos.locator[altPos.alternation]){break;}
prevAltPos=altPos;}}
if(alternation!==undefined){decisionPos=parseInt(lastAlt);var decisionTaker=prevAltPos.locator[prevAltPos.alternation||alternation]!==undefined?prevAltPos.locator[prevAltPos.alternation||alternation]:altNdxs[0];if(decisionTaker.length>0){decisionTaker=decisionTaker.split(",")[0];}
var possibilityPos=getMaskSet().validPositions[decisionPos],prevPos=getMaskSet().validPositions[decisionPos-1];$.each(getTests(decisionPos,prevPos?prevPos.locator:undefined,decisionPos-1),function(ndx,test){altNdxs=test.locator[alternation]?test.locator[alternation].toString().split(","):[];for(var mndx=0;mndx<altNdxs.length;mndx++){var validInputs=[],staticInputsBeforePos=0,staticInputsBeforePosAlternate=0,verifyValidInput=false;if(decisionTaker<altNdxs[mndx]&&(test.na===undefined||$.inArray(altNdxs[mndx],test.na.split(","))===-1)){getMaskSet().validPositions[decisionPos]=$.extend(true,{},test);var possibilities=getMaskSet().validPositions[decisionPos].locator;getMaskSet().validPositions[decisionPos].locator[alternation]=parseInt(altNdxs[mndx]);if(test.match.fn==null){if(possibilityPos.input!==test.match.def){verifyValidInput=true;if(possibilityPos.generatedInput!==true){validInputs.push(possibilityPos.input);}}
staticInputsBeforePosAlternate++;getMaskSet().validPositions[decisionPos].generatedInput=!/[0-9a-bA-Z]/.test(test.match.def);getMaskSet().validPositions[decisionPos].input=test.match.def;}else{getMaskSet().validPositions[decisionPos].input=possibilityPos.input;}
for(i=decisionPos+1;i<getLastValidPosition(undefined,true)+1;i++){validPos=getMaskSet().validPositions[i];if(validPos&&validPos.generatedInput!==true&&/[0-9a-bA-Z]/.test(validPos.input)){validInputs.push(validPos.input);}else if(i<pos)staticInputsBeforePos++;delete getMaskSet().validPositions[i];}
if(verifyValidInput&&validInputs[0]===test.match.def){validInputs.shift();}
resetMaskSet(true);isValidRslt=true;while(validInputs.length>0){var input=validInputs.shift();if(input!==opts.skipOptionalPartCharacter){if(!(isValidRslt=isValid(getLastValidPosition(undefined,true)+1,input,false,fromSetValid,true))){break;}}}
if(isValidRslt){getMaskSet().validPositions[decisionPos].locator=possibilities;var targetLvp=getLastValidPosition(pos)+1;for(i=decisionPos+1;i<getLastValidPosition()+1;i++){validPos=getMaskSet().validPositions[i];if((validPos===undefined||validPos.match.fn==null)&&i<(pos+(staticInputsBeforePosAlternate-staticInputsBeforePos))){staticInputsBeforePosAlternate++;}}
pos=pos+(staticInputsBeforePosAlternate-staticInputsBeforePos);isValidRslt=isValid(pos>targetLvp?targetLvp:pos,c,strict,fromSetValid,true);}
if(!isValidRslt){resetMaskSet();getMaskSet().validPositions=$.extend(true,{},validPsClone);}else return false;}}});}
return isValidRslt;}
function trackbackAlternations(originalPos,newPos){var vp=getMaskSet().validPositions[newPos];if(vp){var targetLocator=vp.locator,tll=targetLocator.length;for(var ps=originalPos;ps<newPos;ps++){if(getMaskSet().validPositions[ps]===undefined&&!isMask(ps,true)){var tests=getTests(ps),bestMatch=tests[0],equality=-1;$.each(tests,function(ndx,tst){for(var i=0;i<tll;i++){if(tst.locator[i]!==undefined&&checkAlternationMatch(tst.locator[i].toString().split(","),targetLocator[i].toString().split(","))){if(equality<i){equality=i;bestMatch=tst;}}else break;}});setValidPosition(ps,$.extend({},bestMatch,{"input":bestMatch.match.placeholder||bestMatch.match.def}),true);}}}}
function setValidPosition(pos,validTest,fromSetValid,isSelection){if(isSelection||(opts.insertMode&&getMaskSet().validPositions[pos]!==undefined&&fromSetValid===undefined)){var positionsClone=$.extend(true,{},getMaskSet().validPositions),lvp=getLastValidPosition(undefined,true),i;for(i=pos;i<=lvp;i++){delete getMaskSet().validPositions[i];}
getMaskSet().validPositions[pos]=$.extend(true,{},validTest);var valid=true,j,vps=getMaskSet().validPositions,needsValidation=false,initialLength=getMaskSet().maskLength;for(i=(j=pos);i<=lvp;i++){var t=positionsClone[i];if(t!==undefined){var posMatch=j;while(posMatch<getMaskSet().maskLength&&((t.match.fn==null&&vps[i]&&(vps[i].match.optionalQuantifier===true||vps[i].match.optionality===true))||t.match.fn!=null)){posMatch++;if(needsValidation===false&&positionsClone[posMatch]&&positionsClone[posMatch].match.def===t.match.def){getMaskSet().validPositions[posMatch]=$.extend(true,{},positionsClone[posMatch]);getMaskSet().validPositions[posMatch].input=t.input;fillMissingNonMask(posMatch);j=posMatch;valid=true;}else if(positionCanMatchDefinition(posMatch,t.match.def)){var result=isValid(posMatch,t.input,true,true);valid=result!==false;j=(result.caret||result.insert)?getLastValidPosition():posMatch;needsValidation=true;}else{valid=t.generatedInput===true;}
if(getMaskSet().maskLength<initialLength)getMaskSet().maskLength=initialLength;if(valid)break;}}
if(!valid)break;}
if(!valid){getMaskSet().validPositions=$.extend(true,{},positionsClone);resetMaskSet(true);return false;}}
else
getMaskSet().validPositions[pos]=$.extend(true,{},validTest);;resetMaskSet(true);return true;}
function fillMissingNonMask(maskPos){for(var pndx=maskPos-1;pndx>-1;pndx--){if(getMaskSet().validPositions[pndx])break;}
var testTemplate,testsFromPos;for(pndx++;pndx<maskPos;pndx++){if(getMaskSet().validPositions[pndx]===undefined&&(opts.jitMasking===false||opts.jitMasking>pndx)){testsFromPos=getTests(pndx,getTestTemplate(pndx-1).locator,pndx-1).slice();if(testsFromPos[testsFromPos.length-1].match.def==="")testsFromPos.pop();testTemplate=determineTestTemplate(testsFromPos);if(testTemplate&&(testTemplate.match.def===opts.radixPointDefinitionSymbol||!isMask(pndx,true)||($.inArray(opts.radixPoint,getBuffer())<pndx&&testTemplate.match.fn&&testTemplate.match.fn.test(getPlaceholder(pndx),getMaskSet(),pndx,false,opts)))){result=_isValid(pndx,testTemplate.match.placeholder||(testTemplate.match.fn==null?testTemplate.match.def:(getPlaceholder(pndx)!==""?getPlaceholder(pndx):getBuffer()[pndx])),true);if(result!==false){getMaskSet().validPositions[result.pos||pndx].generatedInput=true;}}}}}
var result=false,positionsClone=$.extend(true,{},getMaskSet().validPositions);fillMissingNonMask(maskPos);if(isSelection(pos)){handleRemove(undefined,Inputmask.keyCode.DELETE,pos);maskPos=getMaskSet().p;}
if(maskPos<getMaskSet().maskLength){result=_isValid(maskPos,c,strict);if((!strict||fromSetValid===true)&&result===false){var currentPosValid=getMaskSet().validPositions[maskPos];if(currentPosValid&¤tPosValid.match.fn===null&&(currentPosValid.match.def===c||c===opts.skipOptionalPartCharacter)){result={"caret":seekNext(maskPos)};}else if((opts.insertMode||getMaskSet().validPositions[seekNext(maskPos)]===undefined)&&!isMask(maskPos,true)){var testsFromPos=getTests(maskPos).slice();if(testsFromPos[testsFromPos.length-1].match.def==="")testsFromPos.pop();var staticChar=determineTestTemplate(testsFromPos,true);if(staticChar&&staticChar.match.fn===null){staticChar=staticChar.match.placeholder||staticChar.match.def;_isValid(maskPos,staticChar,strict);getMaskSet().validPositions[maskPos].generatedInput=true;}
for(var nPos=maskPos+1,snPos=seekNext(maskPos);nPos<=snPos;nPos++){result=_isValid(nPos,c,strict);if(result!==false){trackbackAlternations(maskPos,result.pos!==undefined?result.pos:nPos);maskPos=nPos;break;}}}}}
if(result===false&&opts.keepStatic&&!strict&&fromAlternate!==true){result=alternate(maskPos,c,strict);}
if(result===true){result={"pos":maskPos};}
if($.isFunction(opts.postValidation)&&result!==false&&!strict&&fromSetValid!==true){result=opts.postValidation(getBuffer(true),result,opts)?result:false;}
if(result.pos===undefined){result.pos=maskPos;}
if(result===false){resetMaskSet(true);getMaskSet().validPositions=$.extend(true,{},positionsClone);}
return result;}
function isMask(pos,strict){var test;if(strict){test=getTestTemplate(pos).match;if(test.def==="")test=getTest(pos).match;}else test=getTest(pos).match;if(test.fn!=null){return test.fn;}else if(strict!==true&&pos>-1){var tests=getTests(pos);return tests.length>1+(tests[tests.length-1].match.def===""?1:0);}
return false;}
function seekNext(pos,newBlock){var maskL=getMaskSet().maskLength;if(pos>=maskL)return maskL;var position=pos;while(++position<maskL&&((newBlock===true&&(getTest(position).match.newBlockMarker!==true||!isMask(position)))||(newBlock!==true&&!isMask(position)))){}
return position;}
function seekPrevious(pos,newBlock){var position=pos,tests;if(position<=0)return 0;while(--position>0&&((newBlock===true&&getTest(position).match.newBlockMarker!==true)||(newBlock!==true&&!isMask(position)&&(tests=getTests(position),tests.length<2||(tests.length===2&&tests[1].match.def===""))))){}
return position;}
function getBufferElement(position){return getMaskSet().validPositions[position]===undefined?getPlaceholder(position):getMaskSet().validPositions[position].input;}
function writeBuffer(input,buffer,caretPos,event,triggerInputEvent){if(event&&$.isFunction(opts.onBeforeWrite)){var result=opts.onBeforeWrite(event,buffer,caretPos,opts);if(result){if(result.refreshFromBuffer){var refresh=result.refreshFromBuffer;refreshFromBuffer(refresh===true?refresh:refresh.start,refresh.end,result.buffer||buffer);buffer=getBuffer(true);}
if(caretPos!==undefined)caretPos=result.caret!==undefined?result.caret:caretPos;}}
input.inputmask._valueSet(buffer.join(""));if(caretPos!==undefined&&(event===undefined||event.type!=="blur")){caret(input,caretPos);}else renderColorMask(input,buffer,caretPos);if(triggerInputEvent===true){skipInputEvent=true;$(input).trigger("input");}}
function getPlaceholder(pos,test){test=test||getTest(pos).match;if(test.placeholder!==undefined){return test.placeholder;}else if(test.fn===null){if(pos>-1&&getMaskSet().validPositions[pos]===undefined){var tests=getTests(pos),staticAlternations=[],prevTest;if(tests.length>1+(tests[tests.length-1].match.def===""?1:0)){for(var i=0;i<tests.length;i++){if(tests[i].match.optionality!==true&&tests[i].match.optionalQuantifier!==true&&(tests[i].match.fn===null||(prevTest===undefined||tests[i].match.fn.test(prevTest.match.def,getMaskSet(),pos,true,opts)!==false))){staticAlternations.push(tests[i]);if(tests[i].match.fn===null)prevTest=tests[i];if(staticAlternations.length>1){if(/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)){return opts.placeholder.charAt(pos%opts.placeholder.length);}}}}}}
return test.def;}
return opts.placeholder.charAt(pos%opts.placeholder.length);}
function checkVal(input,writeOut,strict,nptvl,initiatingEvent,stickyCaret){var inputValue=nptvl.slice(),charCodes="",initialNdx=0,result=undefined;function isTemplateMatch(){var isMatch=false;var charCodeNdx=getBufferTemplate().slice(initialNdx,seekNext(initialNdx)).join("").indexOf(charCodes);if(charCodeNdx!==-1&&!isMask(initialNdx)){isMatch=true;var bufferTemplateArr=getBufferTemplate().slice(initialNdx,initialNdx+charCodeNdx);for(var i=0;i<bufferTemplateArr.length;i++){if(bufferTemplateArr[i]!==" "){isMatch=false;break;}}}
return isMatch;}
resetMaskSet();getMaskSet().p=seekNext(-1);if(!strict){if(opts.autoUnmask!==true){var staticInput=getBufferTemplate().slice(0,seekNext(-1)).join(""),matches=inputValue.join("").match(new RegExp("^"+Inputmask.escapeRegex(staticInput),"g"));if(matches&&matches.length>0){inputValue.splice(0,matches.length*staticInput.length);initialNdx=seekNext(initialNdx);}}else{initialNdx=seekNext(initialNdx);}}
$.each(inputValue,function(ndx,charCode){if(charCode!==undefined){var keypress=new $.Event("keypress");keypress.which=charCode.charCodeAt(0);charCodes+=charCode;var lvp=getLastValidPosition(undefined,true),lvTest=getMaskSet().validPositions[lvp],nextTest=getTestTemplate(lvp+1,lvTest?lvTest.locator.slice():undefined,lvp);if(!isTemplateMatch()||strict||opts.autoUnmask){var pos=strict?ndx:(nextTest.match.fn==null&&nextTest.match.optionality&&(lvp+1)<getMaskSet().p?lvp+1:getMaskSet().p);result=EventHandlers.keypressEvent.call(input,keypress,true,false,strict,pos);initialNdx=pos+1;charCodes="";}else{result=EventHandlers.keypressEvent.call(input,keypress,true,false,true,lvp+1);}
if(!strict&&$.isFunction(opts.onBeforeWrite)){result=opts.onBeforeWrite(keypress,getBuffer(),result.forwardPosition,opts);if(result&&result.refreshFromBuffer){var refresh=result.refreshFromBuffer;refreshFromBuffer(refresh===true?refresh:refresh.start,refresh.end,result.buffer);resetMaskSet(true);if(result.caret){getMaskSet().p=result.caret;}}}}});if(writeOut){var caretPos=undefined,lvp=getLastValidPosition();if(document.activeElement===input&&(initiatingEvent||result)){caretPos=caret(input).begin;if(initiatingEvent&&result===false)caretPos=seekNext(getLastValidPosition(caretPos));if(result&&stickyCaret!==true&&(caretPos<lvp+1||lvp===-1))
caretPos=(opts.numericInput&&result.caret===undefined)?seekPrevious(result.forwardPosition):result.forwardPosition;}
writeBuffer(input,getBuffer(),caretPos,initiatingEvent||new $.Event("checkval"));}}
function unmaskedvalue(input){if(input&&input.inputmask===undefined){return input.value;}
var umValue=[],vps=getMaskSet().validPositions;for(var pndx in vps){if(vps[pndx].match&&vps[pndx].match.fn!=null){umValue.push(vps[pndx].input);}}
var unmaskedValue=umValue.length===0?"":(isRTL?umValue.reverse():umValue).join("");if($.isFunction(opts.onUnMask)){var bufferValue=(isRTL?getBuffer().slice().reverse():getBuffer()).join("");unmaskedValue=(opts.onUnMask(bufferValue,unmaskedValue,opts)||unmaskedValue);}
return unmaskedValue;}
function caret(input,begin,end,notranslate){function translatePosition(pos){if(notranslate!==true&&isRTL&&typeof pos==="number"&&(!opts.greedy||opts.placeholder!=="")){var bffrLght=getBuffer().join("").length;pos=bffrLght-pos;}
return pos;}
var range;if(typeof begin==="number"){begin=translatePosition(begin);end=translatePosition(end);end=(typeof end=="number")?end:begin;var scrollCalc=parseInt(((input.ownerDocument.defaultView||window).getComputedStyle?(input.ownerDocument.defaultView||window).getComputedStyle(input,null):input.currentStyle).fontSize)*end;input.scrollLeft=scrollCalc>input.scrollWidth?scrollCalc:0;if(!mobile&&opts.insertMode===false&&begin===end)end++;if(input.setSelectionRange){input.selectionStart=begin;input.selectionEnd=end;}else if(window.getSelection){range=document.createRange();if(input.firstChild===undefined||input.firstChild===null){var textNode=document.createTextNode("");input.appendChild(textNode);}
range.setStart(input.firstChild,begin<input.inputmask._valueGet().length?begin:input.inputmask._valueGet().length);range.setEnd(input.firstChild,end<input.inputmask._valueGet().length?end:input.inputmask._valueGet().length);range.collapse(true);var sel=window.getSelection();sel.removeAllRanges();sel.addRange(range);}else if(input.createTextRange){range=input.createTextRange();range.collapse(true);range.moveEnd("character",end);range.moveStart("character",begin);range.select();}
renderColorMask(input,undefined,{begin:begin,end:end});}else{if(input.setSelectionRange){begin=input.selectionStart;end=input.selectionEnd;}else if(window.getSelection){range=window.getSelection().getRangeAt(0);if(range.commonAncestorContainer.parentNode===input||range.commonAncestorContainer===input){begin=range.startOffset;end=range.endOffset;}}else if(document.selection&&document.selection.createRange){range=document.selection.createRange();begin=0-range.duplicate().moveStart("character",-input.inputmask._valueGet().length);end=begin+range.text.length;}
return{"begin":translatePosition(begin),"end":translatePosition(end)};}}
function determineLastRequiredPosition(returnDefinition){var buffer=getBuffer(),bl=buffer.length,pos,lvp=getLastValidPosition(),positions={},lvTest=getMaskSet().validPositions[lvp],ndxIntlzr=lvTest!==undefined?lvTest.locator.slice():undefined,testPos;for(pos=lvp+1;pos<buffer.length;pos++){testPos=getTestTemplate(pos,ndxIntlzr,pos-1);ndxIntlzr=testPos.locator.slice();positions[pos]=$.extend(true,{},testPos);}
var lvTestAlt=lvTest&&lvTest.alternation!==undefined?lvTest.locator[lvTest.alternation]:undefined;for(pos=bl-1;pos>lvp;pos--){testPos=positions[pos];if((testPos.match.optionality||testPos.match.optionalQuantifier||(lvTestAlt&&((lvTestAlt!==positions[pos].locator[lvTest.alternation]&&testPos.match.fn!=null)||(testPos.match.fn===null&&testPos.locator[lvTest.alternation]&&checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","),lvTestAlt.toString().split(","))&&getTests(pos)[0].def!==""))))&&buffer[pos]===getPlaceholder(pos,testPos.match)){bl--;}else break;}
return returnDefinition?{"l":bl,"def":positions[bl]?positions[bl].match:undefined}:bl;}
function clearOptionalTail(buffer){var rl=determineLastRequiredPosition(),lmib=buffer.length-1;for(;lmib>rl;lmib--){if(isMask(lmib))break;}
buffer.splice(rl,lmib+1-rl);return buffer;}
function isComplete(buffer){if($.isFunction(opts.isComplete))return opts.isComplete(buffer,opts);if(opts.repeat==="*")return undefined;var complete=false,lrp=determineLastRequiredPosition(true),aml=seekPrevious(lrp.l);if(lrp.def===undefined||lrp.def.newBlockMarker||lrp.def.optionality||lrp.def.optionalQuantifier){complete=true;for(var i=0;i<=aml;i++){var test=getTestTemplate(i).match;if((test.fn!==null&&getMaskSet().validPositions[i]===undefined&&test.optionality!==true&&test.optionalQuantifier!==true)||(test.fn===null&&buffer[i]!==getPlaceholder(i,test))){complete=false;break;}}}
return complete;}
function patchValueProperty(npt){var valueGet;var valueSet;function patchValhook(type){if($.valHooks&&($.valHooks[type]===undefined||$.valHooks[type].inputmaskpatch!==true)){var valhookGet=$.valHooks[type]&&$.valHooks[type].get?$.valHooks[type].get:function(elem){return elem.value;};var valhookSet=$.valHooks[type]&&$.valHooks[type].set?$.valHooks[type].set:function(elem,value){elem.value=value;return elem;};$.valHooks[type]={get:function(elem){if(elem.inputmask){if(elem.inputmask.opts.autoUnmask){return elem.inputmask.unmaskedvalue();}else{var result=valhookGet(elem);return getLastValidPosition(undefined,undefined,elem.inputmask.maskset.validPositions)!==-1||opts.nullable!==true?result:"";}}else return valhookGet(elem);},set:function(elem,value){var $elem=$(elem),result;result=valhookSet(elem,value);if(elem.inputmask){$elem.trigger("setvalue");}
return result;},inputmaskpatch:true};}}
function getter(){if(this.inputmask){return this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():(getLastValidPosition()!==-1||opts.nullable!==true?(document.activeElement===this&&opts.clearMaskOnLostFocus?(isRTL?clearOptionalTail(getBuffer().slice()).reverse():clearOptionalTail(getBuffer().slice())).join(""):valueGet.call(this)):"");}else return valueGet.call(this);}
function setter(value){valueSet.call(this,value);if(this.inputmask){$(this).trigger("setvalue");}}
function installNativeValueSetFallback(npt){EventRuler.on(npt,"mouseenter",function(event){var $input=$(this),input=this,value=input.inputmask._valueGet();if(value!==getBuffer().join("")){$input.trigger("setvalue");}});}
if(!npt.inputmask.__valueGet){if(opts.noValuePatching!==true){if(Object.getOwnPropertyDescriptor){if(typeof Object.getPrototypeOf!=="function"){Object.getPrototypeOf=typeof "test".__proto__==="object"?function(object){return object.__proto__;}:function(object){return object.constructor.prototype;};}
var valueProperty=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt),"value"):undefined;if(valueProperty&&valueProperty.get&&valueProperty.set){valueGet=valueProperty.get;valueSet=valueProperty.set;Object.defineProperty(npt,"value",{get:getter,set:setter,configurable:true});}else if(npt.tagName!=="INPUT"){valueGet=function(){return this.textContent;};valueSet=function(value){this.textContent=value;};Object.defineProperty(npt,"value",{get:getter,set:setter,configurable:true});}}else if(document.__lookupGetter__&&npt.__lookupGetter__("value")){valueGet=npt.__lookupGetter__("value");valueSet=npt.__lookupSetter__("value");npt.__defineGetter__("value",getter);npt.__defineSetter__("value",setter);}
npt.inputmask.__valueGet=valueGet;npt.inputmask.__valueSet=valueSet;}
npt.inputmask._valueGet=function(overruleRTL){return isRTL&&overruleRTL!==true?valueGet.call(this.el).split("").reverse().join(""):valueGet.call(this.el);};npt.inputmask._valueSet=function(value,overruleRTL){valueSet.call(this.el,(value===null||value===undefined)?"":((overruleRTL!==true&&isRTL)?value.split("").reverse().join(""):value));};if(valueGet===undefined){valueGet=function(){return this.value;};valueSet=function(value){this.value=value;};patchValhook(npt.type);installNativeValueSetFallback(npt);}}}
function handleRemove(input,k,pos,strict){function generalize(){if(opts.keepStatic){var validInputs=[],lastAlt=getLastValidPosition(-1,true),positionsClone=$.extend(true,{},getMaskSet().validPositions),prevAltPos=getMaskSet().validPositions[lastAlt];for(;lastAlt>=0;lastAlt--){var altPos=getMaskSet().validPositions[lastAlt];if(altPos){if(altPos.generatedInput!==true&&/[0-9a-bA-Z]/.test(altPos.input)){validInputs.push(altPos.input);}
delete getMaskSet().validPositions[lastAlt];if(altPos.alternation!==undefined&&altPos.locator[altPos.alternation]!==prevAltPos.locator[altPos.alternation]){break;}
prevAltPos=altPos;}}
if(lastAlt>-1){getMaskSet().p=seekNext(getLastValidPosition(-1,true));while(validInputs.length>0){var keypress=new $.Event("keypress");keypress.which=validInputs.pop().charCodeAt(0);EventHandlers.keypressEvent.call(input,keypress,true,false,false,getMaskSet().p);}}else getMaskSet().validPositions=$.extend(true,{},positionsClone);}}
if(opts.numericInput||isRTL){if(k===Inputmask.keyCode.BACKSPACE){k=Inputmask.keyCode.DELETE;}else if(k===Inputmask.keyCode.DELETE){k=Inputmask.keyCode.BACKSPACE;}
if(isRTL){var pend=pos.end;pos.end=pos.begin;pos.begin=pend;}}
if(k===Inputmask.keyCode.BACKSPACE&&(pos.end-pos.begin<1||opts.insertMode===false)){pos.begin=seekPrevious(pos.begin);if(getMaskSet().validPositions[pos.begin]!==undefined&&(getMaskSet().validPositions[pos.begin].input===opts.groupSeparator||getMaskSet().validPositions[pos.begin].input===opts.radixPoint)){pos.begin--;}}else if(k===Inputmask.keyCode.DELETE&&pos.begin===pos.end){pos.end=isMask(pos.end,true)?pos.end+1:seekNext(pos.end)+1;if(getMaskSet().validPositions[pos.begin]!==undefined&&(getMaskSet().validPositions[pos.begin].input===opts.groupSeparator||getMaskSet().validPositions[pos.begin].input===opts.radixPoint)){pos.end++;}}
stripValidPositions(pos.begin,pos.end,false,strict);if(strict!==true){generalize();}
var lvp=getLastValidPosition(pos.begin,true);if(lvp<pos.begin){getMaskSet().p=seekNext(lvp);}else if(strict!==true){getMaskSet().p=pos.begin;}}
var EventRuler={on:function(input,eventName,eventHandler){var ev=function(e){if(this.inputmask===undefined&&this.nodeName!=="FORM"){var imOpts=$.data(this,"_inputmask_opts");if(imOpts)(new Inputmask(imOpts)).mask(this);else EventRuler.off(this);}else if(e.type!=="setvalue"&&(this.disabled||(this.readOnly&&!(e.type==="keydown"&&(e.ctrlKey&&e.keyCode===67)||(opts.tabThrough===false&&e.keyCode===Inputmask.keyCode.TAB))))){e.preventDefault();}else{switch(e.type){case "input":if(skipInputEvent===true){skipInputEvent=false;return e.preventDefault();}
break;case "keydown":skipKeyPressEvent=false;skipInputEvent=false;break;case "keypress":if(skipKeyPressEvent===true){return e.preventDefault();}
skipKeyPressEvent=true;break;case "click":if(iemobile||iphone){var that=this,args=arguments;setTimeout(function(){eventHandler.apply(that,args);},0);return false;}
break;}
var returnVal=eventHandler.apply(this,arguments);if(returnVal===false){e.preventDefault();e.stopPropagation();}
return returnVal;}};input.inputmask.events[eventName]=input.inputmask.events[eventName]||[];input.inputmask.events[eventName].push(ev);if($.inArray(eventName,["submit","reset"])!==-1){if(input.form!=null)$(input.form).on(eventName,ev);}else{$(input).on(eventName,ev);}},off:function(input,event){if(input.inputmask&&input.inputmask.events){var events;if(event){events=[];events[event]=input.inputmask.events[event];}else{events=input.inputmask.events;}
$.each(events,function(eventName,evArr){while(evArr.length>0){var ev=evArr.pop();if($.inArray(eventName,["submit","reset"])!==-1){if(input.form!=null)$(input.form).off(eventName,ev);}else{$(input).off(eventName,ev);}}
delete input.inputmask.events[eventName];});}}};var EventHandlers={keydownEvent:function(e){function isInputEventSupported(eventName){var el=document.createElement("input"),evName="on"+eventName,isSupported=(evName in el);if(!isSupported){el.setAttribute(evName,"return;");isSupported=typeof el[evName]=="function";}
el=null;return isSupported;}
var input=this,$input=$(input),k=e.keyCode,pos=caret(input);if(k===Inputmask.keyCode.BACKSPACE||k===Inputmask.keyCode.DELETE||(iphone&&k===Inputmask.keyCode.BACKSPACE_SAFARI)||(e.ctrlKey&&k===Inputmask.keyCode.X&&!isInputEventSupported("cut"))){e.preventDefault();handleRemove(input,k,pos);writeBuffer(input,getBuffer(true),getMaskSet().p,e,input.inputmask._valueGet()!==getBuffer().join(""));if(input.inputmask._valueGet()===getBufferTemplate().join("")){$input.trigger("cleared");}else if(isComplete(getBuffer())===true){$input.trigger("complete");}
if(opts.showTooltip){input.title=opts.tooltip||getMaskSet().mask;}}else if(k===Inputmask.keyCode.END||k===Inputmask.keyCode.PAGE_DOWN){e.preventDefault();var caretPos=seekNext(getLastValidPosition());if(!opts.insertMode&&caretPos===getMaskSet().maskLength&&!e.shiftKey)caretPos--;caret(input,e.shiftKey?pos.begin:caretPos,caretPos,true);}else if((k===Inputmask.keyCode.HOME&&!e.shiftKey)||k===Inputmask.keyCode.PAGE_UP){e.preventDefault();caret(input,0,e.shiftKey?pos.begin:0,true);}else if(((opts.undoOnEscape&&k===Inputmask.keyCode.ESCAPE)||(k===90&&e.ctrlKey))&&e.altKey!==true){checkVal(input,true,false,undoValue.split(""));$input.trigger("click");}else if(k===Inputmask.keyCode.INSERT&&!(e.shiftKey||e.ctrlKey)){opts.insertMode=!opts.insertMode;caret(input,!opts.insertMode&&pos.begin===getMaskSet().maskLength?pos.begin-1:pos.begin);}else if(opts.tabThrough===true&&k===Inputmask.keyCode.TAB){if(e.shiftKey===true){if(getTest(pos.begin).match.fn===null){pos.begin=seekNext(pos.begin);}
pos.end=seekPrevious(pos.begin,true);pos.begin=seekPrevious(pos.end,true);}else{pos.begin=seekNext(pos.begin,true);pos.end=seekNext(pos.begin,true);if(pos.end<getMaskSet().maskLength)pos.end--;}
if(pos.begin<getMaskSet().maskLength){e.preventDefault();caret(input,pos.begin,pos.end);}}else if(!e.shiftKey){if(opts.insertMode===false){if(k===Inputmask.keyCode.RIGHT){setTimeout(function(){var caretPos=caret(input);caret(input,caretPos.begin);},0);}else if(k===Inputmask.keyCode.LEFT){setTimeout(function(){var caretPos=caret(input);caret(input,isRTL?caretPos.begin+1:caretPos.begin-1);},0);}}}
opts.onKeyDown.call(this,e,getBuffer(),caret(input).begin,opts);ignorable=$.inArray(k,opts.ignorables)!==-1;},keypressEvent:function(e,checkval,writeOut,strict,ndx){var input=this,$input=$(input),k=e.which||e.charCode||e.keyCode;if(checkval!==true&&(!(e.ctrlKey&&e.altKey)&&(e.ctrlKey||e.metaKey||ignorable))){if(k===Inputmask.keyCode.ENTER&&undoValue!==getBuffer().join("")){undoValue=getBuffer().join("");setTimeout(function(){$input.trigger("change");},0);}
return true;}else{if(k){if(k===46&&e.shiftKey===false&&opts.radixPoint===",")k=44;var pos=checkval?{begin:ndx,end:ndx}:caret(input),forwardPosition,c=String.fromCharCode(k);getMaskSet().writeOutBuffer=true;var valResult=isValid(pos,c,strict);if(valResult!==false){resetMaskSet(true);forwardPosition=valResult.caret!==undefined?valResult.caret:checkval?valResult.pos+1:seekNext(valResult.pos);getMaskSet().p=forwardPosition;}
if(writeOut!==false){var self=this;setTimeout(function(){opts.onKeyValidation.call(self,k,valResult,opts);},0);if(getMaskSet().writeOutBuffer&&valResult!==false){var buffer=getBuffer();writeBuffer(input,buffer,(opts.numericInput&&valResult.caret===undefined)?seekPrevious(forwardPosition):forwardPosition,e,checkval!==true);if(checkval!==true){setTimeout(function(){if(isComplete(buffer)===true)$input.trigger("complete");},0);}}}
if(opts.showTooltip){input.title=opts.tooltip||getMaskSet().mask;}
e.preventDefault();if(checkval){valResult.forwardPosition=forwardPosition;return valResult;}}}},pasteEvent:function(e){var input=this,ev=e.originalEvent||e,$input=$(input),inputValue=input.inputmask._valueGet(true),caretPos=caret(input),tempValue;if(isRTL){tempValue=caretPos.end;caretPos.end=caretPos.begin;caretPos.begin=tempValue;}
var valueBeforeCaret=inputValue.substr(0,caretPos.begin),valueAfterCaret=inputValue.substr(caretPos.end,inputValue.length);if(valueBeforeCaret===(isRTL?getBufferTemplate().reverse():getBufferTemplate()).slice(0,caretPos.begin).join(""))valueBeforeCaret="";if(valueAfterCaret===(isRTL?getBufferTemplate().reverse():getBufferTemplate()).slice(caretPos.end).join(""))valueAfterCaret="";if(isRTL){tempValue=valueBeforeCaret;valueBeforeCaret=valueAfterCaret;valueAfterCaret=tempValue;}
if(window.clipboardData&&window.clipboardData.getData){inputValue=valueBeforeCaret+window.clipboardData.getData("Text")+valueAfterCaret;}else if(ev.clipboardData&&ev.clipboardData.getData){inputValue=valueBeforeCaret+ev.clipboardData.getData("text/plain")+valueAfterCaret;}else return true;var pasteValue=inputValue;if($.isFunction(opts.onBeforePaste)){pasteValue=opts.onBeforePaste(inputValue,opts);if(pasteValue===false){return e.preventDefault();}
if(!pasteValue){pasteValue=inputValue;}}
checkVal(input,false,false,isRTL?pasteValue.split("").reverse():pasteValue.toString().split(""));writeBuffer(input,getBuffer(),seekNext(getLastValidPosition()),e,undoValue!==getBuffer().join(""));if(isComplete(getBuffer())===true){$input.trigger("complete");}
return e.preventDefault();},inputFallBackEvent:function(e){var input=this,inputValue=input.inputmask._valueGet();if(getBuffer().join("")!==inputValue){var caretPos=caret(input);inputValue=inputValue.replace(new RegExp("("+Inputmask.escapeRegex(getBufferTemplate().join(""))+")*"),"");if(iemobile){var inputChar=inputValue.replace(getBuffer().join(""),"");if(inputChar.length===1){var keypress=new $.Event("keypress");keypress.which=inputChar.charCodeAt(0);EventHandlers.keypressEvent.call(input,keypress,true,true,false,getMaskSet().validPositions[caretPos.begin-1]?caretPos.begin:caretPos.begin-1);return false;}}
if(caretPos.begin>inputValue.length){caret(input,inputValue.length);caretPos=caret(input);}
if((getBuffer().length-inputValue.length)===1&&inputValue.charAt(caretPos.begin)!==getBuffer()[caretPos.begin]&&inputValue.charAt(caretPos.begin+1)!==getBuffer()[caretPos.begin]&&!isMask(caretPos.begin)){e.keyCode=Inputmask.keyCode.BACKSPACE;EventHandlers.keydownEvent.call(input,e);}else{var lvp=getLastValidPosition()+1;var bufferTemplate=getBufferTemplate().join("");while(inputValue.match(Inputmask.escapeRegex(bufferTemplate)+"$")===null){bufferTemplate=bufferTemplate.slice(1);}
inputValue=inputValue.replace(bufferTemplate,"");inputValue=inputValue.split("");checkVal(input,true,false,inputValue,e,caretPos.begin<lvp);if(isComplete(getBuffer())===true){$(input).trigger("complete");}}
e.preventDefault();}},setValueEvent:function(e){var input=this,value=input.inputmask._valueGet();checkVal(input,true,false,($.isFunction(opts.onBeforeMask)?(opts.onBeforeMask(value,opts)||value):value).split(""));undoValue=getBuffer().join("");if((opts.clearMaskOnLostFocus||opts.clearIncomplete)&&input.inputmask._valueGet()===getBufferTemplate().join("")){input.inputmask._valueSet("");}},focusEvent:function(e){var input=this,nptValue=input.inputmask._valueGet();if(opts.showMaskOnFocus&&(!opts.showMaskOnHover||(opts.showMaskOnHover&&nptValue===""))){if(input.inputmask._valueGet()!==getBuffer().join("")){writeBuffer(input,getBuffer(),seekNext(getLastValidPosition()));}else if(mouseEnter===false){caret(input,seekNext(getLastValidPosition()));}}
if(opts.positionCaretOnTab===true){setTimeout(function(){EventHandlers.clickEvent.apply(this,[e]);},0);}
undoValue=getBuffer().join("");},mouseleaveEvent:function(e){var input=this;mouseEnter=false;if(opts.clearMaskOnLostFocus&&document.activeElement!==input){var buffer=getBuffer().slice(),nptValue=input.inputmask._valueGet();if(nptValue!==input.getAttribute("placeholder")&&nptValue!==""){if(getLastValidPosition()===-1&&nptValue===getBufferTemplate().join("")){buffer=[];}else{clearOptionalTail(buffer);}
writeBuffer(input,buffer);}}},clickEvent:function(e){function doRadixFocus(clickPos){if(opts.radixPoint!==""){var vps=getMaskSet().validPositions;if(vps[clickPos]===undefined||(vps[clickPos].input===getPlaceholder(clickPos))){if(clickPos<seekNext(-1))return true;var radixPos=$.inArray(opts.radixPoint,getBuffer());if(radixPos!==-1){for(var vp in vps){if(radixPos<vp&&vps[vp].input!==getPlaceholder(vp)){return false;}}
return true;}}}
return false;}
var input=this;setTimeout(function(){if(document.activeElement===input){var selectedCaret=caret(input);if(selectedCaret.begin===selectedCaret.end){switch(opts.positionCaretOnClick){case "none":break;case "radixFocus":if(doRadixFocus(selectedCaret.begin)){var radixPos=$.inArray(opts.radixPoint,getBuffer().join(""));caret(input,opts.numericInput?seekNext(radixPos):radixPos);break;}
default:var clickPosition=selectedCaret.begin,lvclickPosition=getLastValidPosition(clickPosition,true),lastPosition=seekNext(lvclickPosition);if(clickPosition<lastPosition){caret(input,!isMask(clickPosition)&&!isMask(clickPosition-1)?seekNext(clickPosition):clickPosition);}else{var placeholder=getPlaceholder(lastPosition);if((placeholder!==""&&getBuffer()[lastPosition]!==placeholder&&getTest(lastPosition).match.optionalQuantifier!==true)||(!isMask(lastPosition)&&getTest(lastPosition).match.def===placeholder)){lastPosition=seekNext(lastPosition);}
caret(input,lastPosition);}
break;}}}},0);},dblclickEvent:function(e){var input=this;setTimeout(function(){caret(input,0,seekNext(getLastValidPosition()));},0);},cutEvent:function(e){var input=this,$input=$(input),pos=caret(input),ev=e.originalEvent||e;var clipboardData=window.clipboardData||ev.clipboardData,clipData=isRTL?getBuffer().slice(pos.end,pos.begin):getBuffer().slice(pos.begin,pos.end);clipboardData.setData("text",isRTL?clipData.reverse().join(""):clipData.join(""));if(document.execCommand)document.execCommand("copy");handleRemove(input,Inputmask.keyCode.DELETE,pos);writeBuffer(input,getBuffer(),getMaskSet().p,e,undoValue!==getBuffer().join(""));if(input.inputmask._valueGet()===getBufferTemplate().join("")){$input.trigger("cleared");}
if(opts.showTooltip){input.title=opts.tooltip||getMaskSet().mask;}},blurEvent:function(e){var $input=$(this),input=this;if(input.inputmask){var nptValue=input.inputmask._valueGet(),buffer=getBuffer().slice();if(undoValue!==buffer.join("")){setTimeout(function(){$input.trigger("change");undoValue=buffer.join("");},0);}
if(nptValue!==""){if(opts.clearMaskOnLostFocus){if(getLastValidPosition()===-1&&nptValue===getBufferTemplate().join("")){buffer=[];}else{clearOptionalTail(buffer);}}
if(isComplete(buffer)===false){setTimeout(function(){$input.trigger("incomplete");},0);if(opts.clearIncomplete){resetMaskSet();if(opts.clearMaskOnLostFocus){buffer=[];}else{buffer=getBufferTemplate().slice();}}}
writeBuffer(input,buffer,undefined,e);}}},mouseenterEvent:function(e){var input=this;mouseEnter=true;if(document.activeElement!==input&&opts.showMaskOnHover){if(input.inputmask._valueGet()!==getBuffer().join("")){writeBuffer(input,getBuffer());}}},submitEvent:function(e){if(undoValue!==getBuffer().join("")){$el.trigger("change");}
if(opts.clearMaskOnLostFocus&&getLastValidPosition()===-1&&el.inputmask._valueGet&&el.inputmask._valueGet()===getBufferTemplate().join("")){el.inputmask._valueSet("");}
if(opts.removeMaskOnSubmit){el.inputmask._valueSet(el.inputmask.unmaskedvalue(),true);setTimeout(function(){writeBuffer(el,getBuffer());},0);}},resetEvent:function(e){setTimeout(function(){$el.trigger("setvalue");},0);}};function initializeColorMask(input){function findCaretPos(clientx){var e=document.createElement('span'),caretPos;for(var style in computedStyle){if(isNaN(style)&&style.indexOf("font")!==-1){e.style[style]=computedStyle[style];}}
e.style.textTransform=computedStyle.textTransform;e.style.letterSpacing=computedStyle.letterSpacing;e.style.position="absolute";e.style.height="auto";e.style.width="auto";e.style.visibility="hidden";e.style.whiteSpace="nowrap";document.body.appendChild(e);var inputText=input.inputmask._valueGet(),previousWidth=0,itl;for(caretPos=0,itl=inputText.length;caretPos<=itl;caretPos++){e.innerHTML+=inputText.charAt(caretPos)||"_";if(e.offsetWidth>=clientx){var offset1=(clientx-previousWidth);var offset2=e.offsetWidth-clientx;e.innerHTML=inputText.charAt(caretPos);offset1-=(e.offsetWidth/3);caretPos=offset1<offset2?caretPos-1:caretPos;break;}
previousWidth=e.offsetWidth;}
document.body.removeChild(e);return caretPos;}
function position(){colorMask.style.position="absolute";colorMask.style.top=offset.top+"px";colorMask.style.left=offset.left+"px";colorMask.style.width=parseInt(input.offsetWidth)-parseInt(computedStyle.paddingLeft)-parseInt(computedStyle.paddingRight)-parseInt(computedStyle.borderLeftWidth)-parseInt(computedStyle.borderRightWidth)+"px";colorMask.style.height=parseInt(input.offsetHeight)-parseInt(computedStyle.paddingTop)-parseInt(computedStyle.paddingBottom)-parseInt(computedStyle.borderTopWidth)-parseInt(computedStyle.borderBottomWidth)+"px";colorMask.style.lineHeight=colorMask.style.height;colorMask.style.zIndex=isNaN(computedStyle.zIndex)?-1:computedStyle.zIndex-1;colorMask.style.webkitAppearance="textfield";colorMask.style.mozAppearance="textfield";colorMask.style.Appearance="textfield";}
var offset=$(input).position(),computedStyle=(input.ownerDocument.defaultView||window).getComputedStyle(input,null),parentNode=input.parentNode;colorMask=document.createElement("div");document.body.appendChild(colorMask);for(var style in computedStyle){if(isNaN(style)&&style!=="cssText"&&style.indexOf("webkit")==-1){colorMask.style[style]=computedStyle[style];}}
input.style.backgroundColor="transparent";input.style.color="transparent";input.style.webkitAppearance="caret";input.style.mozAppearance="caret";input.style.Appearance="caret";position();$(window).on("resize",function(e){offset=$(input).position();computedStyle=(input.ownerDocument.defaultView||window).getComputedStyle(input,null);position();});$(input).on("click",function(e){caret(input,findCaretPos(e.clientX));return EventHandlers.clickEvent.call(this,[e]);});$(input).on("keydown",function(e){if(!e.shiftKey&&opts.insertMode!==false){setTimeout(function(){renderColorMask(input);},0);}});}
function renderColorMask(input,buffer,caretPos){function handleStatic(){if(!static&&(test.fn===null||testPos.input===undefined)){static=true;maskTemplate+="<span class='im-static''>"}else if(static&&(test.fn!==null&&testPos.input!==undefined)){static=false;maskTemplate+="</span>"}}
if(colorMask!==undefined){buffer=buffer||getBuffer();if(caretPos===undefined){caretPos=caret(input);}else if(caretPos.begin===undefined){caretPos={begin:caretPos,end:caretPos};}
var maskTemplate="",static=false;if(buffer!=""){var ndxIntlzr,pos=0,test,testPos,lvp=getLastValidPosition();do{if(pos===caretPos.begin&&document.activeElement===input){maskTemplate+="<span class='im-caret' style='border-right-width: 1px;border-right-style: solid;'></span>";}
if(getMaskSet().validPositions[pos]){testPos=getMaskSet().validPositions[pos];test=testPos.match;ndxIntlzr=testPos.locator.slice();handleStatic();maskTemplate+=testPos.input;}else{testPos=getTestTemplate(pos,ndxIntlzr,pos-1);test=testPos.match;ndxIntlzr=testPos.locator.slice();if(opts.jitMasking===false||pos<lvp||(Number.isFinite(opts.jitMasking)&&opts.jitMasking>pos)){handleStatic();maskTemplate+=getPlaceholder(pos,test);}}
pos++;}while((maxLength===undefined||pos<maxLength)&&(test.fn!==null||test.def!=="")||lvp>pos);}
colorMask.innerHTML=maskTemplate;}}
function mask(elem){function isElementTypeSupported(input,opts){var elementType=input.getAttribute("type");var isSupported=(input.tagName==="INPUT"&&$.inArray(elementType,opts.supportsInputType)!==-1)||input.isContentEditable||input.tagName==="TEXTAREA";if(!isSupported&&input.tagName==="INPUT"){var el=document.createElement("input");el.setAttribute("type",elementType);isSupported=el.type==="text";el=null;}
return isSupported;}
if(isElementTypeSupported(elem,opts)){el=elem;$el=$(el);if(opts.showTooltip){el.title=opts.tooltip||getMaskSet().mask;}
if(el.dir==="rtl"||opts.rightAlign){el.style.textAlign="right";}
if(el.dir==="rtl"||opts.numericInput){el.dir="ltr";el.removeAttribute("dir");el.inputmask.isRTL=true;isRTL=true;}
if(opts.colorMask===true){initializeColorMask(el);}
if(android){if(el.hasOwnProperty("inputmode")){el.inputmode=opts.inputmode;el.setAttribute("inputmode",opts.inputmode);}
if(opts.androidHack==="rtfm"){if(opts.colorMask!==true){initializeColorMask(el);}
el.type="password";}}
EventRuler.off(el);patchValueProperty(el);EventRuler.on(el,"submit",EventHandlers.submitEvent);EventRuler.on(el,"reset",EventHandlers.resetEvent);EventRuler.on(el,"mouseenter",EventHandlers.mouseenterEvent);EventRuler.on(el,"blur",EventHandlers.blurEvent);EventRuler.on(el,"focus",EventHandlers.focusEvent);EventRuler.on(el,"mouseleave",EventHandlers.mouseleaveEvent);if(opts.colorMask!==true)
EventRuler.on(el,"click",EventHandlers.clickEvent);EventRuler.on(el,"dblclick",EventHandlers.dblclickEvent);EventRuler.on(el,"paste",EventHandlers.pasteEvent);EventRuler.on(el,"dragdrop",EventHandlers.pasteEvent);EventRuler.on(el,"drop",EventHandlers.pasteEvent);EventRuler.on(el,"cut",EventHandlers.cutEvent);EventRuler.on(el,"complete",opts.oncomplete);EventRuler.on(el,"incomplete",opts.onincomplete);EventRuler.on(el,"cleared",opts.oncleared);if(opts.inputEventOnly!==true){EventRuler.on(el,"keydown",EventHandlers.keydownEvent);EventRuler.on(el,"keypress",EventHandlers.keypressEvent);}
EventRuler.on(el,"compositionstart",$.noop);EventRuler.on(el,"compositionupdate",$.noop);EventRuler.on(el,"compositionend",$.noop);EventRuler.on(el,"keyup",$.noop);EventRuler.on(el,"input",EventHandlers.inputFallBackEvent);EventRuler.on(el,"setvalue",EventHandlers.setValueEvent);getBufferTemplate();if(el.inputmask._valueGet()!==""||opts.clearMaskOnLostFocus===false||document.activeElement===el){var initialValue=$.isFunction(opts.onBeforeMask)?(opts.onBeforeMask(el.inputmask._valueGet(),opts)||el.inputmask._valueGet()):el.inputmask._valueGet();checkVal(el,true,false,initialValue.split(""));var buffer=getBuffer().slice();undoValue=buffer.join("");if(isComplete(buffer)===false){if(opts.clearIncomplete){resetMaskSet();}}
if(opts.clearMaskOnLostFocus&&document.activeElement!==el){if(getLastValidPosition()===-1){buffer=[];}else{clearOptionalTail(buffer);}}
writeBuffer(el,buffer);if(document.activeElement===el){caret(el,seekNext(getLastValidPosition()));}}}}
var valueBuffer;if(actionObj!==undefined){switch(actionObj.action){case "isComplete":el=actionObj.el;return isComplete(getBuffer());case "unmaskedvalue":if(el===undefined||actionObj.value!==undefined){valueBuffer=actionObj.value;valueBuffer=($.isFunction(opts.onBeforeMask)?(opts.onBeforeMask(valueBuffer,opts)||valueBuffer):valueBuffer).split("");checkVal(undefined,false,false,isRTL?valueBuffer.reverse():valueBuffer);if($.isFunction(opts.onBeforeWrite))opts.onBeforeWrite(undefined,getBuffer(),0,opts);}
return unmaskedvalue(el);case "mask":mask(el);break;case "format":valueBuffer=($.isFunction(opts.onBeforeMask)?(opts.onBeforeMask(actionObj.value,opts)||actionObj.value):actionObj.value).split("");checkVal(undefined,false,false,isRTL?valueBuffer.reverse():valueBuffer);if($.isFunction(opts.onBeforeWrite))opts.onBeforeWrite(undefined,getBuffer(),0,opts);if(actionObj.metadata){return{value:isRTL?getBuffer().slice().reverse().join(""):getBuffer().join(""),metadata:maskScope.call(this,{"action":"getmetadata"},maskset,opts)};}
return isRTL?getBuffer().slice().reverse().join(""):getBuffer().join("");case "isValid":if(actionObj.value){valueBuffer=actionObj.value.split("");checkVal(undefined,false,true,isRTL?valueBuffer.reverse():valueBuffer);}else{actionObj.value=getBuffer().join("");}
var buffer=getBuffer();var rl=determineLastRequiredPosition(),lmib=buffer.length-1;for(;lmib>rl;lmib--){if(isMask(lmib))break;}
buffer.splice(rl,lmib+1-rl);return isComplete(buffer)&&actionObj.value===getBuffer().join("");case "getemptymask":return getBufferTemplate().join("");case "remove":if(el){$el=$(el);el.inputmask._valueSet(unmaskedvalue(el));EventRuler.off(el);var valueProperty;if(Object.getOwnPropertyDescriptor&&Object.getPrototypeOf){valueProperty=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el),"value");if(valueProperty){if(el.inputmask.__valueGet){Object.defineProperty(el,"value",{get:el.inputmask.__valueGet,set:el.inputmask.__valueSet,configurable:true});}}}else if(document.__lookupGetter__&&el.__lookupGetter__("value")){if(el.inputmask.__valueGet){el.__defineGetter__("value",el.inputmask.__valueGet);el.__defineSetter__("value",el.inputmask.__valueSet);}}
el.inputmask=undefined;}
return el;break;case "getmetadata":if($.isArray(maskset.metadata)){var maskTarget=getMaskTemplate(true,0,false).join("");$.each(maskset.metadata,function(ndx,mtdt){if(mtdt.mask===maskTarget){maskTarget=mtdt;return false;}});return maskTarget;}
return maskset.metadata;}}}
window.Inputmask=Inputmask;return Inputmask;})); |
(function() {
// CommonJS require()
function require(p){
var path = require.resolve(p)
, mod = require.modules[path];
if (!mod) throw new Error('failed to require "' + p + '"');
if (!mod.exports) {
mod.exports = {};
mod.call(mod.exports, mod, mod.exports, require.relative(path));
}
return mod.exports;
}
require.modules = {};
require.resolve = function (path){
var orig = path
, reg = path + '.js'
, index = path + '/index.js';
return require.modules[reg] && reg
|| require.modules[index] && index
|| orig;
};
require.register = function (path, fn){
require.modules[path] = fn;
};
require.relative = function (parent) {
return function(p){
if ('.' != p.charAt(0)) return require(p);
var path = parent.split('/')
, segs = p.split('/');
path.pop();
for (var i = 0; i < segs.length; i++) {
var seg = segs[i];
if ('..' == seg) path.pop();
else if ('.' != seg) path.push(seg);
}
return require(path.join('/'));
};
};
require.register("compiler.js", function(module, exports, require){
/*!
* Jade - Compiler
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var nodes = require('./nodes')
, filters = require('./filters')
, doctypes = require('./doctypes')
, selfClosing = require('./self-closing')
, utils = require('./utils');
if (!Object.keys) {
Object.keys = function(obj){
var arr = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
arr.push(key);
}
}
return arr;
}
}
if (!String.prototype.trimLeft) {
String.prototype.trimLeft = function(){
return this.replace(/^\s+/, '');
}
}
/**
* Initialize `Compiler` with the given `node`.
*
* @param {Node} node
* @param {Object} options
* @api public
*/
var Compiler = module.exports = function Compiler(node, options) {
this.options = options = options || {};
this.node = node;
this.hasCompiledDoctype = false;
this.hasCompiledTag = false;
this.pp = options.pretty || false;
this.debug = false !== options.compileDebug;
this.indents = 0;
this.parentIndents = 0;
if (options.doctype) this.setDoctype(options.doctype);
};
/**
* Compiler prototype.
*/
Compiler.prototype = {
/**
* Compile parse tree to JavaScript.
*
* @api public
*/
compile: function(){
this.buf = ['var interp;'];
if (this.pp) this.buf.push("var __indent = [];");
this.lastBufferedIdx = -1;
this.visit(this.node);
return this.buf.join('\n');
},
/**
* Sets the default doctype `name`. Sets terse mode to `true` when
* html 5 is used, causing self-closing tags to end with ">" vs "/>",
* and boolean attributes are not mirrored.
*
* @param {string} name
* @api public
*/
setDoctype: function(name){
var doctype = doctypes[(name || 'default').toLowerCase()];
doctype = doctype || '<!DOCTYPE ' + name + '>';
this.doctype = doctype;
this.terse = '5' == name || 'html' == name;
this.xml = 0 == this.doctype.indexOf('<?xml');
},
/**
* Buffer the given `str` optionally escaped.
*
* @param {String} str
* @param {Boolean} esc
* @api public
*/
buffer: function(str, esc){
if (esc) str = utils.escape(str);
if (this.lastBufferedIdx == this.buf.length) {
this.lastBuffered += str;
this.buf[this.lastBufferedIdx - 1] = "buf.push('" + this.lastBuffered + "');"
} else {
this.buf.push("buf.push('" + str + "');");
this.lastBuffered = str;
this.lastBufferedIdx = this.buf.length;
}
},
/**
* Buffer an indent based on the current `indent`
* property and an additional `offset`.
*
* @param {Number} offset
* @param {Boolean} newline
* @api public
*/
prettyIndent: function(offset, newline){
offset = offset || 0;
newline = newline ? '\\n' : '';
this.buffer(newline + Array(this.indents + offset).join(' '));
if (this.parentIndents)
this.buf.push("buf.push.apply(buf, __indent);");
},
/**
* Visit `node`.
*
* @param {Node} node
* @api public
*/
visit: function(node){
var debug = this.debug;
if (debug) {
this.buf.push('__jade.unshift({ lineno: ' + node.line
+ ', filename: ' + (node.filename
? '"' + node.filename + '"'
: '__jade[0].filename')
+ ' });');
}
// Massive hack to fix our context
// stack for - else[ if] etc
if (false === node.debug && this.debug) {
this.buf.pop();
this.buf.pop();
}
this.visitNode(node);
if (debug) this.buf.push('__jade.shift();');
},
/**
* Visit `node`.
*
* @param {Node} node
* @api public
*/
visitNode: function(node){
var name = node.constructor.name
|| node.constructor.toString().match(/function ([^(\s]+)()/)[1];
return this['visit' + name](node);
},
/**
* Visit case `node`.
*
* @param {Literal} node
* @api public
*/
visitCase: function(node){
var _ = this.withinCase;
this.withinCase = true;
this.buf.push('switch (' + node.expr + '){');
this.visit(node.block);
this.buf.push('}');
this.withinCase = _;
},
/**
* Visit when `node`.
*
* @param {Literal} node
* @api public
*/
visitWhen: function(node){
if ('default' == node.expr) {
this.buf.push('default:');
} else {
this.buf.push('case ' + node.expr + ':');
}
this.visit(node.block);
this.buf.push(' break;');
},
/**
* Visit literal `node`.
*
* @param {Literal} node
* @api public
*/
visitLiteral: function(node){
var str = node.str.replace(/\n/g, '\\\\n');
this.buffer(str);
},
/**
* Visit all nodes in `block`.
*
* @param {Block} block
* @api public
*/
visitBlock: function(block){
var len = block.nodes.length
, escape = this.escape
, pp = this.pp
// Pretty print multi-line text
if (pp && len > 1 && !escape && block.nodes[0].isText && block.nodes[1].isText)
this.prettyIndent(1, true);
for (var i = 0; i < len; ++i) {
// Pretty print text
if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText)
this.prettyIndent(1, false);
this.visit(block.nodes[i]);
// Multiple text nodes are separated by newlines
if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText)
this.buffer('\\n');
}
},
/**
* Visit `doctype`. Sets terse mode to `true` when html 5
* is used, causing self-closing tags to end with ">" vs "/>",
* and boolean attributes are not mirrored.
*
* @param {Doctype} doctype
* @api public
*/
visitDoctype: function(doctype){
if (doctype && (doctype.val || !this.doctype)) {
this.setDoctype(doctype.val || 'default');
}
if (this.doctype) this.buffer(this.doctype);
this.hasCompiledDoctype = true;
},
/**
* Visit `mixin`, generating a function that
* may be called within the template.
*
* @param {Mixin} mixin
* @api public
*/
visitMixin: function(mixin){
var name = mixin.name.replace(/-/g, '_') + '_mixin'
, args = mixin.args || '';
if (mixin.call) {
if (this.pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');")
if (mixin.block) {
if (args) {
this.buf.push(name + '(' + args + ', function(){');
} else {
this.buf.push(name + '(function(){');
}
this.buf.push('var buf = [];');
this.visit(mixin.block);
this.buf.push('return buf.join("");');
this.buf.push('}());\n');
} else {
this.buf.push(name + '(' + args + ');');
}
if (this.pp) this.buf.push("__indent.pop();")
} else {
args = args
? args.split(/ *, */).concat('content').join(', ')
: 'content';
this.buf.push('var ' + name + ' = function(' + args + '){');
if (this.pp) this.parentIndents++;
this.visit(mixin.block);
if (this.pp) this.parentIndents--;
this.buf.push('}');
}
},
/**
* Visit `tag` buffering tag markup, generating
* attributes, visiting the `tag`'s code and block.
*
* @param {Tag} tag
* @api public
*/
visitTag: function(tag){
this.indents++;
var name = tag.name;
if (!this.hasCompiledTag) {
if (!this.hasCompiledDoctype && 'html' == name) {
this.visitDoctype();
}
this.hasCompiledTag = true;
}
// pretty print
if (this.pp && !tag.isInline()) {
this.prettyIndent(0, true);
}
if (~selfClosing.indexOf(name) && !this.xml) {
this.buffer('<' + name);
this.visitAttributes(tag.attrs);
this.terse
? this.buffer('>')
: this.buffer('/>');
} else {
// Optimize attributes buffering
if (tag.attrs.length) {
this.buffer('<' + name);
if (tag.attrs.length) this.visitAttributes(tag.attrs);
this.buffer('>');
} else {
this.buffer('<' + name + '>');
}
if (tag.code) this.visitCode(tag.code);
this.escape = 'pre' == tag.name;
this.visit(tag.block);
// pretty print
if (this.pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline()) {
this.prettyIndent(0, true);
}
this.buffer('</' + name + '>');
}
this.indents--;
},
/**
* Visit `filter`, throwing when the filter does not exist.
*
* @param {Filter} filter
* @api public
*/
visitFilter: function(filter){
var fn = filters[filter.name];
// unknown filter
if (!fn) {
if (filter.isASTFilter) {
throw new Error('unknown ast filter "' + filter.name + ':"');
} else {
throw new Error('unknown filter ":' + filter.name + '"');
}
}
if (filter.isASTFilter) {
this.buf.push(fn(filter.block, this, filter.attrs));
} else {
var text = filter.block.nodes.map(function(node){ return node.val }).join('\n');
filter.attrs = filter.attrs || {};
filter.attrs.filename = this.options.filename;
this.buffer(utils.text(fn(text, filter.attrs)));
}
},
/**
* Visit `text` node.
*
* @param {Text} text
* @api public
*/
visitText: function(text){
text = utils.text(text.val);
if (this.escape) text = escape(text);
this.buffer(text);
},
/**
* Visit a `comment`, only buffering when the buffer flag is set.
*
* @param {Comment} comment
* @api public
*/
visitComment: function(comment){
if (!comment.buffer) return;
if (this.pp) this.prettyIndent(1, true);
this.buffer('<!--' + utils.escape(comment.val) + '-->');
},
/**
* Visit a `BlockComment`.
*
* @param {Comment} comment
* @api public
*/
visitBlockComment: function(comment){
if (!comment.buffer) return;
if (0 == comment.val.trim().indexOf('if')) {
this.buffer('<!--[' + comment.val.trim() + ']>');
this.visit(comment.block);
this.buffer('<![endif]-->');
} else {
this.buffer('<!--' + comment.val);
this.visit(comment.block);
this.buffer('-->');
}
},
/**
* Visit `code`, respecting buffer / escape flags.
* If the code is followed by a block, wrap it in
* a self-calling function.
*
* @param {Code} code
* @api public
*/
visitCode: function(code){
// Wrap code blocks with {}.
// we only wrap unbuffered code blocks ATM
// since they are usually flow control
// Buffer code
if (code.buffer) {
var val = code.val.trimLeft();
this.buf.push('var __val__ = ' + val);
val = 'null == __val__ ? "" : __val__';
if (code.escape) val = 'escape(' + val + ')';
this.buf.push("buf.push(" + val + ");");
} else {
this.buf.push(code.val);
}
// Block support
if (code.block) {
if (!code.buffer) this.buf.push('{');
this.visit(code.block);
if (!code.buffer) this.buf.push('}');
}
},
/**
* Visit `each` block.
*
* @param {Each} each
* @api public
*/
visitEach: function(each){
this.buf.push(''
+ '// iterate ' + each.obj + '\n'
+ ';(function(){\n'
+ ' if (\'number\' == typeof ' + each.obj + '.length) {\n'
+ ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n'
+ ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
this.visit(each.block);
this.buf.push(''
+ ' }\n'
+ ' } else {\n'
+ ' for (var ' + each.key + ' in ' + each.obj + ') {\n'
+ ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){'
+ ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
this.visit(each.block);
this.buf.push(' }\n');
this.buf.push(' }\n }\n}).call(this);\n');
},
/**
* Visit `attrs`.
*
* @param {Array} attrs
* @api public
*/
visitAttributes: function(attrs){
var buf = []
, classes = []
, escaped = {};
if (this.terse) buf.push('terse: true');
attrs.forEach(function(attr){
escaped[attr.name] = attr.escaped;
if (attr.name == 'class') {
classes.push('(' + attr.val + ')');
} else {
var pair = "'" + attr.name + "':(" + attr.val + ')';
buf.push(pair);
}
});
if (classes.length) {
classes = classes.join(" + ' ' + ");
buf.push("class: " + classes);
}
buf = buf.join(', ').replace('class:', '"class":');
this.buf.push("buf.push(attrs({ " + buf + " }, " + JSON.stringify(escaped) + "));");
}
};
/**
* Escape the given string of `html`.
*
* @param {String} html
* @return {String}
* @api private
*/
function escape(html){
return String(html)
.replace(/&(?!\w+;)/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
}); // module: compiler.js
require.register("doctypes.js", function(module, exports, require){
/*!
* Jade - doctypes
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
module.exports = {
'5': '<!DOCTYPE html>'
, 'xml': '<?xml version="1.0" encoding="utf-8" ?>'
, 'default': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
, 'transitional': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
, 'strict': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
, 'frameset': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'
, '1.1': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
, 'basic': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'
, 'mobile': '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'
};
}); // module: doctypes.js
require.register("filters.js", function(module, exports, require){
/*!
* Jade - filters
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
module.exports = {
/**
* Wrap text with CDATA block.
*/
cdata: function(str){
return '<![CDATA[\\n' + str + '\\n]]>';
},
/**
* Transform sass to css, wrapped in style tags.
*/
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},
/**
* Transform stylus to css, wrapped in style tags.
*/
stylus: function(str, options){
var ret;
str = str.replace(/\\n/g, '\n');
var stylus = require('stylus');
stylus(str, options).render(function(err, css){
if (err) throw err;
ret = css.replace(/\n/g, '\\n');
});
return '<style type="text/css">' + ret + '</style>';
},
/**
* Transform less to css, wrapped in style tags.
*/
less: function(str){
var ret;
str = str.replace(/\\n/g, '\n');
require('less').render(str, function(err, css){
if (err) throw err;
ret = '<style type="text/css">' + css.replace(/\n/g, '\\n') + '</style>';
});
return ret;
},
/**
* Transform markdown to html.
*/
markdown: function(str){
var md;
// support markdown / discount
try {
md = require('markdown');
} catch (err){
try {
md = require('discount');
} catch (err) {
try {
md = require('markdown-js');
} catch (err) {
try {
md = require('marked');
} catch (err) {
throw new
Error('Cannot find markdown library, install markdown, discount, or marked.');
}
}
}
}
str = str.replace(/\\n/g, '\n');
return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
},
/**
* Transform coffeescript to javascript.
*/
coffeescript: function(str){
str = str.replace(/\\n/g, '\n');
var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
return '<script type="text/javascript">\\n' + js + '</script>';
}
};
}); // module: filters.js
require.register("inline-tags.js", function(module, exports, require){
/*!
* Jade - inline tags
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
module.exports = [
'a'
, 'abbr'
, 'acronym'
, 'b'
, 'br'
, 'code'
, 'em'
, 'font'
, 'i'
, 'img'
, 'ins'
, 'kbd'
, 'map'
, 'samp'
, 'small'
, 'span'
, 'strong'
, 'sub'
, 'sup'
];
}); // module: inline-tags.js
require.register("jade.js", function(module, exports, require){
/*!
* Jade
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Parser = require('./parser')
, Lexer = require('./lexer')
, Compiler = require('./compiler')
, runtime = require('./runtime')
/**
* Library version.
*/
exports.version = '0.25.0';
/**
* Expose self closing tags.
*/
exports.selfClosing = require('./self-closing');
/**
* Default supported doctypes.
*/
exports.doctypes = require('./doctypes');
/**
* Text filters.
*/
exports.filters = require('./filters');
/**
* Utilities.
*/
exports.utils = require('./utils');
/**
* Expose `Compiler`.
*/
exports.Compiler = Compiler;
/**
* Expose `Parser`.
*/
exports.Parser = Parser;
/**
* Expose `Lexer`.
*/
exports.Lexer = Lexer;
/**
* Nodes.
*/
exports.nodes = require('./nodes');
/**
* Jade runtime helpers.
*/
exports.runtime = runtime;
/**
* Template function cache.
*/
exports.cache = {};
/**
* Parse the given `str` of jade and return a function body.
*
* @param {String} str
* @param {Object} options
* @return {String}
* @api private
*/
function parse(str, options){
try {
// Parse
var parser = new Parser(str, options.filename, options);
// Compile
var compiler = new (options.compiler || Compiler)(parser.parse(), options)
, js = compiler.compile();
// Debug compiler
if (options.debug) {
console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' '));
}
return ''
+ 'var buf = [];\n'
+ (options.self
? 'var self = locals || {};\n' + js
: 'with (locals || {}) {\n' + js + '\n}\n')
+ 'return buf.join("");';
} catch (err) {
parser = parser.context();
runtime.rethrow(err, parser.filename, parser.lexer.lineno);
}
}
/**
* Compile a `Function` representation of the given jade `str`.
*
* Options:
*
* - `compileDebug` when `false` debugging code is stripped from the compiled template
* - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()`
* for use with the Jade client-side runtime.js
*
* @param {String} str
* @param {Options} options
* @return {Function}
* @api public
*/
exports.compile = function(str, options){
var options = options || {}
, client = options.client
, filename = options.filename
? JSON.stringify(options.filename)
: 'undefined'
, fn;
if (options.compileDebug !== false) {
fn = [
'var __jade = [{ lineno: 1, filename: ' + filename + ' }];'
, 'try {'
, parse(String(str), options)
, '} catch (err) {'
, ' rethrow(err, __jade[0].filename, __jade[0].lineno);'
, '}'
].join('\n');
} else {
fn = parse(String(str), options);
}
if (client) {
fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn;
}
fn = new Function('locals, attrs, escape, rethrow', fn);
if (client) return fn;
return function(locals){
return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow);
};
};
/**
* Render the given `str` of jade and invoke
* the callback `fn(err, str)`.
*
* Options:
*
* - `cache` enable template caching
* - `filename` filename required for `include` / `extends` and caching
*
* @param {String} str
* @param {Object|Function} options or fn
* @param {Function} fn
* @api public
*/
exports.render = function(str, options, fn){
// swap args
if ('function' == typeof options) {
fn = options, options = {};
}
// cache requires .filename
if (options.cache && !options.filename) {
return fn(new Error('the "filename" option is required for caching'));
}
try {
var path = options.filename;
var tmpl = options.cache
? exports.cache[path] || (exports.cache[path] = exports.compile(str, options))
: exports.compile(str, options);
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
};
/**
* Render a Jade file at the given `path` and callback `fn(err, str)`.
*
* @param {String} path
* @param {Object|Function} options or callback
* @param {Function} fn
* @api public
*/
exports.renderFile = function(path, options, fn){
var key = path + ':string';
if ('function' == typeof options) {
fn = options, options = {};
}
try {
options.filename = path;
var str = options.cache
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'))
: fs.readFileSync(path, 'utf8');
exports.render(str, options, fn);
} catch (err) {
fn(err);
}
};
/**
* Express support.
*/
exports.__express = exports.renderFile;
}); // module: jade.js
require.register("lexer.js", function(module, exports, require){
/*!
* Jade - Lexer
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Initialize `Lexer` with the given `str`.
*
* Options:
*
* - `colons` allow colons for attr delimiters
*
* @param {String} str
* @param {Object} options
* @api private
*/
var Lexer = module.exports = function Lexer(str, options) {
options = options || {};
this.input = str.replace(/\r\n|\r/g, '\n');
this.colons = options.colons;
this.deferredTokens = [];
this.lastIndents = 0;
this.lineno = 1;
this.stash = [];
this.indentStack = [];
this.indentRe = null;
this.pipeless = false;
};
/**
* Lexer prototype.
*/
Lexer.prototype = {
/**
* Construct a token with the given `type` and `val`.
*
* @param {String} type
* @param {String} val
* @return {Object}
* @api private
*/
tok: function(type, val){
return {
type: type
, line: this.lineno
, val: val
}
},
/**
* Consume the given `len` of input.
*
* @param {Number} len
* @api private
*/
consume: function(len){
this.input = this.input.substr(len);
},
/**
* Scan for `type` with the given `regexp`.
*
* @param {String} type
* @param {RegExp} regexp
* @return {Object}
* @api private
*/
scan: function(regexp, type){
var captures;
if (captures = regexp.exec(this.input)) {
this.consume(captures[0].length);
return this.tok(type, captures[1]);
}
},
/**
* Defer the given `tok`.
*
* @param {Object} tok
* @api private
*/
defer: function(tok){
this.deferredTokens.push(tok);
},
/**
* Lookahead `n` tokens.
*
* @param {Number} n
* @return {Object}
* @api private
*/
lookahead: function(n){
var fetch = n - this.stash.length;
while (fetch-- > 0) this.stash.push(this.next());
return this.stash[--n];
},
/**
* Return the indexOf `start` / `end` delimiters.
*
* @param {String} start
* @param {String} end
* @return {Number}
* @api private
*/
indexOfDelimiters: function(start, end){
var str = this.input
, nstart = 0
, nend = 0
, pos = 0;
for (var i = 0, len = str.length; i < len; ++i) {
if (start == str.charAt(i)) {
++nstart;
} else if (end == str.charAt(i)) {
if (++nend == nstart) {
pos = i;
break;
}
}
}
return pos;
},
/**
* Stashed token.
*/
stashed: function() {
return this.stash.length
&& this.stash.shift();
},
/**
* Deferred token.
*/
deferred: function() {
return this.deferredTokens.length
&& this.deferredTokens.shift();
},
/**
* end-of-source.
*/
eos: function() {
if (this.input.length) return;
if (this.indentStack.length) {
this.indentStack.shift();
return this.tok('outdent');
} else {
return this.tok('eos');
}
},
/**
* Blank line.
*/
blank: function() {
var captures;
if (captures = /^\n *\n/.exec(this.input)) {
this.consume(captures[0].length - 1);
if (this.pipeless) return this.tok('text', '');
return this.next();
}
},
/**
* Comment.
*/
comment: function() {
var captures;
if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('comment', captures[2]);
tok.buffer = '-' != captures[1];
return tok;
}
},
/**
* Tag.
*/
tag: function() {
var captures;
if (captures = /^(\w[-:\w]*)/.exec(this.input)) {
this.consume(captures[0].length);
var tok, name = captures[1];
if (':' == name[name.length - 1]) {
name = name.slice(0, -1);
tok = this.tok('tag', name);
this.defer(this.tok(':'));
while (' ' == this.input[0]) this.input = this.input.substr(1);
} else {
tok = this.tok('tag', name);
}
return tok;
}
},
/**
* Filter.
*/
filter: function() {
return this.scan(/^:(\w+)/, 'filter');
},
/**
* Doctype.
*/
doctype: function() {
return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype');
},
/**
* Id.
*/
id: function() {
return this.scan(/^#([\w-]+)/, 'id');
},
/**
* Class.
*/
className: function() {
return this.scan(/^\.([\w-]+)/, 'class');
},
/**
* Text.
*/
text: function() {
return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text');
},
/**
* Extends.
*/
"extends": function() {
return this.scan(/^extends? +([^\n]+)/, 'extends');
},
/**
* Block prepend.
*/
prepend: function() {
var captures;
if (captures = /^prepend +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = 'prepend'
, name = captures[1]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Block append.
*/
append: function() {
var captures;
if (captures = /^append +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = 'append'
, name = captures[1]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Block.
*/
block: function() {
var captures;
if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = captures[1] || 'replace'
, name = captures[2]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Yield.
*/
yield: function() {
return this.scan(/^yield */, 'yield');
},
/**
* Include.
*/
include: function() {
return this.scan(/^include +([^\n]+)/, 'include');
},
/**
* Case.
*/
"case": function() {
return this.scan(/^case +([^\n]+)/, 'case');
},
/**
* When.
*/
when: function() {
return this.scan(/^when +([^:\n]+)/, 'when');
},
/**
* Default.
*/
"default": function() {
return this.scan(/^default */, 'default');
},
/**
* Assignment.
*/
assignment: function() {
var captures;
if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) {
this.consume(captures[0].length);
var name = captures[1]
, val = captures[2];
return this.tok('code', 'var ' + name + ' = (' + val + ');');
}
},
/**
* Call mixin.
*/
call: function() {
var captures;
if (captures = /^\+([-\w]+)(?: *\((.*)\))?/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('call', captures[1]);
tok.args = captures[2];
return tok;
}
},
/**
* Mixin.
*/
mixin: function(){
var captures;
if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('mixin', captures[1]);
tok.args = captures[2];
return tok;
}
},
/**
* Conditional.
*/
conditional: function() {
var captures;
if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) {
this.consume(captures[0].length);
var type = captures[1]
, js = captures[2];
switch (type) {
case 'if': js = 'if (' + js + ')'; break;
case 'unless': js = 'if (!(' + js + '))'; break;
case 'else if': js = 'else if (' + js + ')'; break;
case 'else': js = 'else'; break;
}
return this.tok('code', js);
}
},
/**
* While.
*/
"while": function() {
var captures;
if (captures = /^while +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
return this.tok('code', 'while (' + captures[1] + ')');
}
},
/**
* Each.
*/
each: function() {
var captures;
if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('each', captures[1]);
tok.key = captures[2] || '$index';
tok.code = captures[3];
return tok;
}
},
/**
* Code.
*/
code: function() {
var captures;
if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var flags = captures[1];
captures[1] = captures[2];
var tok = this.tok('code', captures[1]);
tok.escape = flags[0] === '=';
tok.buffer = flags[0] === '=' || flags[1] === '=';
return tok;
}
},
/**
* Attributes.
*/
attrs: function() {
if ('(' == this.input.charAt(0)) {
var index = this.indexOfDelimiters('(', ')')
, str = this.input.substr(1, index-1)
, tok = this.tok('attrs')
, len = str.length
, colons = this.colons
, states = ['key']
, escapedAttr
, key = ''
, val = ''
, quote
, c
, p;
function state(){
return states[states.length - 1];
}
function interpolate(attr) {
return attr.replace(/#\{([^}]+)\}/g, function(_, expr){
return quote + " + (" + expr + ") + " + quote;
});
}
this.consume(index + 1);
tok.attrs = {};
tok.escaped = {};
function parse(c) {
var real = c;
// TODO: remove when people fix ":"
if (colons && ':' == c) c = '=';
switch (c) {
case ',':
case '\n':
switch (state()) {
case 'expr':
case 'array':
case 'string':
case 'object':
val += c;
break;
default:
states.push('key');
val = val.trim();
key = key.trim();
if ('' == key) return;
key = key.replace(/^['"]|['"]$/g, '').replace('!', '');
tok.escaped[key] = escapedAttr;
tok.attrs[key] = '' == val
? true
: interpolate(val);
key = val = '';
}
break;
case '=':
switch (state()) {
case 'key char':
key += real;
break;
case 'val':
case 'expr':
case 'array':
case 'string':
case 'object':
val += real;
break;
default:
escapedAttr = '!' != p;
states.push('val');
}
break;
case '(':
if ('val' == state()
|| 'expr' == state()) states.push('expr');
val += c;
break;
case ')':
if ('expr' == state()
|| 'val' == state()) states.pop();
val += c;
break;
case '{':
if ('val' == state()) states.push('object');
val += c;
break;
case '}':
if ('object' == state()) states.pop();
val += c;
break;
case '[':
if ('val' == state()) states.push('array');
val += c;
break;
case ']':
if ('array' == state()) states.pop();
val += c;
break;
case '"':
case "'":
switch (state()) {
case 'key':
states.push('key char');
break;
case 'key char':
states.pop();
break;
case 'string':
if (c == quote) states.pop();
val += c;
break;
default:
states.push('string');
val += c;
quote = c;
}
break;
case '':
break;
default:
switch (state()) {
case 'key':
case 'key char':
key += c;
break;
default:
val += c;
}
}
p = c;
}
for (var i = 0; i < len; ++i) {
parse(str.charAt(i));
}
parse(',');
return tok;
}
},
/**
* Indent | Outdent | Newline.
*/
indent: function() {
var captures, re;
// established regexp
if (this.indentRe) {
captures = this.indentRe.exec(this.input);
// determine regexp
} else {
// tabs
re = /^\n(\t*) */;
captures = re.exec(this.input);
// spaces
if (captures && !captures[1].length) {
re = /^\n( *)/;
captures = re.exec(this.input);
}
// established
if (captures && captures[1].length) this.indentRe = re;
}
if (captures) {
var tok
, indents = captures[1].length;
++this.lineno;
this.consume(indents + 1);
if (' ' == this.input[0] || '\t' == this.input[0]) {
throw new Error('Invalid indentation, you can use tabs or spaces but not both');
}
// blank line
if ('\n' == this.input[0]) return this.tok('newline');
// outdent
if (this.indentStack.length && indents < this.indentStack[0]) {
while (this.indentStack.length && this.indentStack[0] > indents) {
this.stash.push(this.tok('outdent'));
this.indentStack.shift();
}
tok = this.stash.pop();
// indent
} else if (indents && indents != this.indentStack[0]) {
this.indentStack.unshift(indents);
tok = this.tok('indent', indents);
// newline
} else {
tok = this.tok('newline');
}
return tok;
}
},
/**
* Pipe-less text consumed only when
* pipeless is true;
*/
pipelessText: function() {
if (this.pipeless) {
if ('\n' == this.input[0]) return;
var i = this.input.indexOf('\n');
if (-1 == i) i = this.input.length;
var str = this.input.substr(0, i);
this.consume(str.length);
return this.tok('text', str);
}
},
/**
* ':'
*/
colon: function() {
return this.scan(/^: */, ':');
},
/**
* Return the next token object, or those
* previously stashed by lookahead.
*
* @return {Object}
* @api private
*/
advance: function(){
return this.stashed()
|| this.next();
},
/**
* Return the next token object.
*
* @return {Object}
* @api private
*/
next: function() {
return this.deferred()
|| this.blank()
|| this.eos()
|| this.pipelessText()
|| this.yield()
|| this.doctype()
|| this["case"]()
|| this.when()
|| this["default"]()
|| this["extends"]()
|| this.append()
|| this.prepend()
|| this.block()
|| this.include()
|| this.mixin()
|| this.call()
|| this.conditional()
|| this.each()
|| this["while"]()
|| this.assignment()
|| this.tag()
|| this.filter()
|| this.code()
|| this.id()
|| this.className()
|| this.attrs()
|| this.indent()
|| this.comment()
|| this.colon()
|| this.text();
}
};
}); // module: lexer.js
require.register("nodes/block-comment.js", function(module, exports, require){
/*!
* Jade - nodes - BlockComment
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `BlockComment` with the given `block`.
*
* @param {String} val
* @param {Block} block
* @param {Boolean} buffer
* @api public
*/
var BlockComment = module.exports = function BlockComment(val, block, buffer) {
this.block = block;
this.val = val;
this.buffer = buffer;
};
/**
* Inherit from `Node`.
*/
BlockComment.prototype = new Node;
BlockComment.prototype.constructor = BlockComment;
}); // module: nodes/block-comment.js
require.register("nodes/block.js", function(module, exports, require){
/*!
* Jade - nodes - Block
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a new `Block` with an optional `node`.
*
* @param {Node} node
* @api public
*/
var Block = module.exports = function Block(node){
this.nodes = [];
if (node) this.push(node);
};
/**
* Inherit from `Node`.
*/
Block.prototype = new Node;
Block.prototype.constructor = Block;
/**
* Block flag.
*/
Block.prototype.isBlock = true;
/**
* Replace the nodes in `other` with the nodes
* in `this` block.
*
* @param {Block} other
* @api private
*/
Block.prototype.replace = function(other){
other.nodes = this.nodes;
};
/**
* Pust the given `node`.
*
* @param {Node} node
* @return {Number}
* @api public
*/
Block.prototype.push = function(node){
return this.nodes.push(node);
};
/**
* Check if this block is empty.
*
* @return {Boolean}
* @api public
*/
Block.prototype.isEmpty = function(){
return 0 == this.nodes.length;
};
/**
* Unshift the given `node`.
*
* @param {Node} node
* @return {Number}
* @api public
*/
Block.prototype.unshift = function(node){
return this.nodes.unshift(node);
};
/**
* Return the "last" block, or the first `yield` node.
*
* @return {Block}
* @api private
*/
Block.prototype.includeBlock = function(){
var ret = this
, node;
for (var i = 0, len = this.nodes.length; i < len; ++i) {
node = this.nodes[i];
if (node.yield) return node;
else if (node.textOnly) continue;
else if (node.includeBlock) ret = node.includeBlock();
else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
}
return ret;
};
/**
* Return a clone of this block.
*
* @return {Block}
* @api private
*/
Block.prototype.clone = function(){
var clone = new Block;
for (var i = 0, len = this.nodes.length; i < len; ++i) {
clone.push(this.nodes[i].clone());
}
return clone;
};
}); // module: nodes/block.js
require.register("nodes/case.js", function(module, exports, require){
/*!
* Jade - nodes - Case
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a new `Case` with `expr`.
*
* @param {String} expr
* @api public
*/
var Case = exports = module.exports = function Case(expr, block){
this.expr = expr;
this.block = block;
};
/**
* Inherit from `Node`.
*/
Case.prototype = new Node;
Case.prototype.constructor = Case;
var When = exports.When = function When(expr, block){
this.expr = expr;
this.block = block;
this.debug = false;
};
/**
* Inherit from `Node`.
*/
When.prototype = new Node;
When.prototype.constructor = When;
}); // module: nodes/case.js
require.register("nodes/code.js", function(module, exports, require){
/*!
* Jade - nodes - Code
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Code` node with the given code `val`.
* Code may also be optionally buffered and escaped.
*
* @param {String} val
* @param {Boolean} buffer
* @param {Boolean} escape
* @api public
*/
var Code = module.exports = function Code(val, buffer, escape) {
this.val = val;
this.buffer = buffer;
this.escape = escape;
if (val.match(/^ *else/)) this.debug = false;
};
/**
* Inherit from `Node`.
*/
Code.prototype = new Node;
Code.prototype.constructor = Code;
}); // module: nodes/code.js
require.register("nodes/comment.js", function(module, exports, require){
/*!
* Jade - nodes - Comment
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Comment` with the given `val`, optionally `buffer`,
* otherwise the comment may render in the output.
*
* @param {String} val
* @param {Boolean} buffer
* @api public
*/
var Comment = module.exports = function Comment(val, buffer) {
this.val = val;
this.buffer = buffer;
};
/**
* Inherit from `Node`.
*/
Comment.prototype = new Node;
Comment.prototype.constructor = Comment;
}); // module: nodes/comment.js
require.register("nodes/doctype.js", function(module, exports, require){
/*!
* Jade - nodes - Doctype
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Doctype` with the given `val`.
*
* @param {String} val
* @api public
*/
var Doctype = module.exports = function Doctype(val) {
this.val = val;
};
/**
* Inherit from `Node`.
*/
Doctype.prototype = new Node;
Doctype.prototype.constructor = Doctype;
}); // module: nodes/doctype.js
require.register("nodes/each.js", function(module, exports, require){
/*!
* Jade - nodes - Each
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize an `Each` node, representing iteration
*
* @param {String} obj
* @param {String} val
* @param {String} key
* @param {Block} block
* @api public
*/
var Each = module.exports = function Each(obj, val, key, block) {
this.obj = obj;
this.val = val;
this.key = key;
this.block = block;
};
/**
* Inherit from `Node`.
*/
Each.prototype = new Node;
Each.prototype.constructor = Each;
}); // module: nodes/each.js
require.register("nodes/filter.js", function(module, exports, require){
/*!
* Jade - nodes - Filter
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node')
, Block = require('./block');
/**
* Initialize a `Filter` node with the given
* filter `name` and `block`.
*
* @param {String} name
* @param {Block|Node} block
* @api public
*/
var Filter = module.exports = function Filter(name, block, attrs) {
this.name = name;
this.block = block;
this.attrs = attrs;
this.isASTFilter = !block.nodes.every(function(node){ return node.isText });
};
/**
* Inherit from `Node`.
*/
Filter.prototype = new Node;
Filter.prototype.constructor = Filter;
}); // module: nodes/filter.js
require.register("nodes/index.js", function(module, exports, require){
/*!
* Jade - nodes
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
exports.Node = require('./node');
exports.Tag = require('./tag');
exports.Code = require('./code');
exports.Each = require('./each');
exports.Case = require('./case');
exports.Text = require('./text');
exports.Block = require('./block');
exports.Mixin = require('./mixin');
exports.Filter = require('./filter');
exports.Comment = require('./comment');
exports.Literal = require('./literal');
exports.BlockComment = require('./block-comment');
exports.Doctype = require('./doctype');
}); // module: nodes/index.js
require.register("nodes/literal.js", function(module, exports, require){
/*!
* Jade - nodes - Literal
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Literal` node with the given `str.
*
* @param {String} str
* @api public
*/
var Literal = module.exports = function Literal(str) {
this.str = str
.replace(/\\/g, "\\\\")
.replace(/\n|\r\n/g, "\\n")
.replace(/'/g, "\\'");
};
/**
* Inherit from `Node`.
*/
Literal.prototype = new Node;
Literal.prototype.constructor = Literal;
}); // module: nodes/literal.js
require.register("nodes/mixin.js", function(module, exports, require){
/*!
* Jade - nodes - Mixin
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a new `Mixin` with `name` and `block`.
*
* @param {String} name
* @param {String} args
* @param {Block} block
* @api public
*/
var Mixin = module.exports = function Mixin(name, args, block, call){
this.name = name;
this.args = args;
this.block = block;
this.call = call;
};
/**
* Inherit from `Node`.
*/
Mixin.prototype = new Node;
Mixin.prototype.constructor = Mixin;
}); // module: nodes/mixin.js
require.register("nodes/node.js", function(module, exports, require){
/*!
* Jade - nodes - Node
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Initialize a `Node`.
*
* @api public
*/
var Node = module.exports = function Node(){};
/**
* Clone this node (return itself)
*
* @return {Node}
* @api private
*/
Node.prototype.clone = function(){
return this;
};
}); // module: nodes/node.js
require.register("nodes/tag.js", function(module, exports, require){
/*!
* Jade - nodes - Tag
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node'),
Block = require('./block'),
inlineTags = require('../inline-tags');
/**
* Initialize a `Tag` node with the given tag `name` and optional `block`.
*
* @param {String} name
* @param {Block} block
* @api public
*/
var Tag = module.exports = function Tag(name, block) {
this.name = name;
this.attrs = [];
this.block = block || new Block;
};
/**
* Inherit from `Node`.
*/
Tag.prototype = new Node;
Tag.prototype.constructor = Tag;
/**
* Clone this tag.
*
* @return {Tag}
* @api private
*/
Tag.prototype.clone = function(){
var clone = new Tag(this.name, this.block.clone());
clone.line = this.line;
clone.attrs = this.attrs;
clone.textOnly = this.textOnly;
return clone;
};
/**
* Set attribute `name` to `val`, keep in mind these become
* part of a raw js object literal, so to quote a value you must
* '"quote me"', otherwise or example 'user.name' is literal JavaScript.
*
* @param {String} name
* @param {String} val
* @param {Boolean} escaped
* @return {Tag} for chaining
* @api public
*/
Tag.prototype.setAttribute = function(name, val, escaped){
this.attrs.push({ name: name, val: val, escaped: escaped });
return this;
};
/**
* Remove attribute `name` when present.
*
* @param {String} name
* @api public
*/
Tag.prototype.removeAttribute = function(name){
for (var i = 0, len = this.attrs.length; i < len; ++i) {
if (this.attrs[i] && this.attrs[i].name == name) {
delete this.attrs[i];
}
}
};
/**
* Get attribute value by `name`.
*
* @param {String} name
* @return {String}
* @api public
*/
Tag.prototype.getAttribute = function(name){
for (var i = 0, len = this.attrs.length; i < len; ++i) {
if (this.attrs[i] && this.attrs[i].name == name) {
return this.attrs[i].val;
}
}
};
/**
* Check if this tag is an inline tag.
*
* @return {Boolean}
* @api private
*/
Tag.prototype.isInline = function(){
return ~inlineTags.indexOf(this.name);
};
/**
* Check if this tag's contents can be inlined. Used for pretty printing.
*
* @return {Boolean}
* @api private
*/
Tag.prototype.canInline = function(){
var nodes = this.block.nodes;
function isInline(node){
// Recurse if the node is a block
if (node.isBlock) return node.nodes.every(isInline);
return node.isText || (node.isInline && node.isInline());
}
// Empty tag
if (!nodes.length) return true;
// Text-only or inline-only tag
if (1 == nodes.length) return isInline(nodes[0]);
// Multi-line inline-only tag
if (this.block.nodes.every(isInline)) {
for (var i = 1, len = nodes.length; i < len; ++i) {
if (nodes[i-1].isText && nodes[i].isText)
return false;
}
return true;
}
// Mixed tag
return false;
};
}); // module: nodes/tag.js
require.register("nodes/text.js", function(module, exports, require){
/*!
* Jade - nodes - Text
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Text` node with optional `line`.
*
* @param {String} line
* @api public
*/
var Text = module.exports = function Text(line) {
this.val = '';
if ('string' == typeof line) this.val = line;
};
/**
* Inherit from `Node`.
*/
Text.prototype = new Node;
Text.prototype.constructor = Text;
/**
* Flag as text.
*/
Text.prototype.isText = true;
}); // module: nodes/text.js
require.register("parser.js", function(module, exports, require){
/*!
* Jade - Parser
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Lexer = require('./lexer')
, nodes = require('./nodes');
/**
* Initialize `Parser` with the given input `str` and `filename`.
*
* @param {String} str
* @param {String} filename
* @param {Object} options
* @api public
*/
var Parser = exports = module.exports = function Parser(str, filename, options){
this.input = str;
this.lexer = new Lexer(str, options);
this.filename = filename;
this.blocks = {};
this.mixins = {};
this.options = options;
this.contexts = [this];
};
/**
* Tags that may not contain tags.
*/
var textOnly = exports.textOnly = ['script', 'style'];
/**
* Parser prototype.
*/
Parser.prototype = {
/**
* Push `parser` onto the context stack,
* or pop and return a `Parser`.
*/
context: function(parser){
if (parser) {
this.contexts.push(parser);
} else {
return this.contexts.pop();
}
},
/**
* Return the next token object.
*
* @return {Object}
* @api private
*/
advance: function(){
return this.lexer.advance();
},
/**
* Skip `n` tokens.
*
* @param {Number} n
* @api private
*/
skip: function(n){
while (n--) this.advance();
},
/**
* Single token lookahead.
*
* @return {Object}
* @api private
*/
peek: function() {
return this.lookahead(1);
},
/**
* Return lexer lineno.
*
* @return {Number}
* @api private
*/
line: function() {
return this.lexer.lineno;
},
/**
* `n` token lookahead.
*
* @param {Number} n
* @return {Object}
* @api private
*/
lookahead: function(n){
return this.lexer.lookahead(n);
},
/**
* Parse input returning a string of js for evaluation.
*
* @return {String}
* @api public
*/
parse: function(){
var block = new nodes.Block, parser;
block.line = this.line();
while ('eos' != this.peek().type) {
if ('newline' == this.peek().type) {
this.advance();
} else {
block.push(this.parseExpr());
}
}
if (parser = this.extending) {
this.context(parser);
var ast = parser.parse();
this.context();
return ast;
}
return block;
},
/**
* Expect the given type, or throw an exception.
*
* @param {String} type
* @api private
*/
expect: function(type){
if (this.peek().type === type) {
return this.advance();
} else {
throw new Error('expected "' + type + '", but got "' + this.peek().type + '"');
}
},
/**
* Accept the given `type`.
*
* @param {String} type
* @api private
*/
accept: function(type){
if (this.peek().type === type) {
return this.advance();
}
},
/**
* tag
* | doctype
* | mixin
* | include
* | filter
* | comment
* | text
* | each
* | code
* | yield
* | id
* | class
*/
parseExpr: function(){
switch (this.peek().type) {
case 'tag':
return this.parseTag();
case 'mixin':
return this.parseMixin();
case 'block':
return this.parseBlock();
case 'case':
return this.parseCase();
case 'when':
return this.parseWhen();
case 'default':
return this.parseDefault();
case 'extends':
return this.parseExtends();
case 'include':
return this.parseInclude();
case 'doctype':
return this.parseDoctype();
case 'filter':
return this.parseFilter();
case 'comment':
return this.parseComment();
case 'text':
return this.parseText();
case 'each':
return this.parseEach();
case 'code':
return this.parseCode();
case 'call':
return this.parseCall();
case 'yield':
this.advance();
var block = new nodes.Block;
block.yield = true;
return block;
case 'id':
case 'class':
var tok = this.advance();
this.lexer.defer(this.lexer.tok('tag', 'div'));
this.lexer.defer(tok);
return this.parseExpr();
default:
throw new Error('unexpected token "' + this.peek().type + '"');
}
},
/**
* Text
*/
parseText: function(){
var tok = this.expect('text')
, node = new nodes.Text(tok.val);
node.line = this.line();
return node;
},
/**
* ':' expr
* | block
*/
parseBlockExpansion: function(){
if (':' == this.peek().type) {
this.advance();
return new nodes.Block(this.parseExpr());
} else {
return this.block();
}
},
/**
* case
*/
parseCase: function(){
var val = this.expect('case').val
, node = new nodes.Case(val);
node.line = this.line();
node.block = this.block();
return node;
},
/**
* when
*/
parseWhen: function(){
var val = this.expect('when').val
return new nodes.Case.When(val, this.parseBlockExpansion());
},
/**
* default
*/
parseDefault: function(){
this.expect('default');
return new nodes.Case.When('default', this.parseBlockExpansion());
},
/**
* code
*/
parseCode: function(){
var tok = this.expect('code')
, node = new nodes.Code(tok.val, tok.buffer, tok.escape)
, block
, i = 1;
node.line = this.line();
while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i;
block = 'indent' == this.lookahead(i).type;
if (block) {
this.skip(i-1);
node.block = this.block();
}
return node;
},
/**
* comment
*/
parseComment: function(){
var tok = this.expect('comment')
, node;
if ('indent' == this.peek().type) {
node = new nodes.BlockComment(tok.val, this.block(), tok.buffer);
} else {
node = new nodes.Comment(tok.val, tok.buffer);
}
node.line = this.line();
return node;
},
/**
* doctype
*/
parseDoctype: function(){
var tok = this.expect('doctype')
, node = new nodes.Doctype(tok.val);
node.line = this.line();
return node;
},
/**
* filter attrs? text-block
*/
parseFilter: function(){
var block
, tok = this.expect('filter')
, attrs = this.accept('attrs');
this.lexer.pipeless = true;
block = this.parseTextBlock();
this.lexer.pipeless = false;
var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
node.line = this.line();
return node;
},
/**
* tag ':' attrs? block
*/
parseASTFilter: function(){
var block
, tok = this.expect('tag')
, attrs = this.accept('attrs');
this.expect(':');
block = this.block();
var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
node.line = this.line();
return node;
},
/**
* each block
*/
parseEach: function(){
var tok = this.expect('each')
, node = new nodes.Each(tok.code, tok.val, tok.key);
node.line = this.line();
node.block = this.block();
return node;
},
/**
* 'extends' name
*/
parseExtends: function(){
var path = require('path')
, fs = require('fs')
, dirname = path.dirname
, basename = path.basename
, join = path.join;
if (!this.filename)
throw new Error('the "filename" option is required to extend templates');
var path = this.expect('extends').val.trim()
, dir = dirname(this.filename);
var path = join(dir, path + '.jade')
, str = fs.readFileSync(path, 'utf8')
, parser = new Parser(str, path, this.options);
parser.blocks = this.blocks;
parser.contexts = this.contexts;
this.extending = parser;
// TODO: null node
return new nodes.Literal('');
},
/**
* 'block' name block
*/
parseBlock: function(){
var block = this.expect('block')
, mode = block.mode
, name = block.val.trim();
block = 'indent' == this.peek().type
? this.block()
: new nodes.Block(new nodes.Literal(''));
var prev = this.blocks[name];
if (prev) {
switch (prev.mode) {
case 'append':
block.nodes = block.nodes.concat(prev.nodes);
prev = block;
break;
case 'prepend':
block.nodes = prev.nodes.concat(block.nodes);
prev = block;
break;
}
}
block.mode = mode;
return this.blocks[name] = prev || block;
},
/**
* include block?
*/
parseInclude: function(){
var path = require('path')
, fs = require('fs')
, dirname = path.dirname
, basename = path.basename
, join = path.join;
var path = this.expect('include').val.trim()
, dir = dirname(this.filename);
if (!this.filename)
throw new Error('the "filename" option is required to use includes');
// no extension
if (!~basename(path).indexOf('.')) {
path += '.jade';
}
// non-jade
if ('.jade' != path.substr(-5)) {
var path = join(dir, path)
, str = fs.readFileSync(path, 'utf8');
return new nodes.Literal(str);
}
var path = join(dir, path)
, str = fs.readFileSync(path, 'utf8')
, parser = new Parser(str, path, this.options);
this.context(parser);
var ast = parser.parse();
this.context();
ast.filename = path;
if ('indent' == this.peek().type) {
ast.includeBlock().push(this.block());
}
return ast;
},
/**
* call ident block
*/
parseCall: function(){
var tok = this.expect('call')
, name = tok.val
, args = tok.args
, mixin = this.mixins[name];
var block = 'indent' == this.peek().type
? this.block()
: null;
return new nodes.Mixin(name, args, block, true);
},
/**
* mixin block
*/
parseMixin: function(){
var tok = this.expect('mixin')
, name = tok.val
, args = tok.args
, mixin;
// definition
if ('indent' == this.peek().type) {
mixin = new nodes.Mixin(name, args, this.block(), false);
this.mixins[name] = mixin;
return mixin;
// call
} else {
return new nodes.Mixin(name, args, null, true);
}
},
/**
* indent (text | newline)* outdent
*/
parseTextBlock: function(){
var block = new nodes.Block;
block.line = this.line();
var spaces = this.expect('indent').val;
if (null == this._spaces) this._spaces = spaces;
var indent = Array(spaces - this._spaces + 1).join(' ');
while ('outdent' != this.peek().type) {
switch (this.peek().type) {
case 'newline':
this.advance();
break;
case 'indent':
this.parseTextBlock().nodes.forEach(function(node){
block.push(node);
});
break;
default:
var text = new nodes.Text(indent + this.advance().val);
text.line = this.line();
block.push(text);
}
}
if (spaces == this._spaces) this._spaces = null;
this.expect('outdent');
return block;
},
/**
* indent expr* outdent
*/
block: function(){
var block = new nodes.Block;
block.line = this.line();
this.expect('indent');
while ('outdent' != this.peek().type) {
if ('newline' == this.peek().type) {
this.advance();
} else {
block.push(this.parseExpr());
}
}
this.expect('outdent');
return block;
},
/**
* tag (attrs | class | id)* (text | code | ':')? newline* block?
*/
parseTag: function(){
// ast-filter look-ahead
var i = 2;
if ('attrs' == this.lookahead(i).type) ++i;
if (':' == this.lookahead(i).type) {
if ('indent' == this.lookahead(++i).type) {
return this.parseASTFilter();
}
}
var name = this.advance().val
, tag = new nodes.Tag(name)
, dot;
tag.line = this.line();
// (attrs | class | id)*
out:
while (true) {
switch (this.peek().type) {
case 'id':
case 'class':
var tok = this.advance();
tag.setAttribute(tok.type, "'" + tok.val + "'");
continue;
case 'attrs':
var tok = this.advance()
, obj = tok.attrs
, escaped = tok.escaped
, names = Object.keys(obj);
for (var i = 0, len = names.length; i < len; ++i) {
var name = names[i]
, val = obj[name];
tag.setAttribute(name, val, escaped[name]);
}
continue;
default:
break out;
}
}
// check immediate '.'
if ('.' == this.peek().val) {
dot = tag.textOnly = true;
this.advance();
}
// (text | code | ':')?
switch (this.peek().type) {
case 'text':
tag.block.push(this.parseText());
break;
case 'code':
tag.code = this.parseCode();
break;
case ':':
this.advance();
tag.block = new nodes.Block;
tag.block.push(this.parseExpr());
break;
}
// newline*
while ('newline' == this.peek().type) this.advance();
tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name);
// script special-case
if ('script' == tag.name) {
var type = tag.getAttribute('type');
if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) {
tag.textOnly = false;
}
}
// block?
if ('indent' == this.peek().type) {
if (tag.textOnly) {
this.lexer.pipeless = true;
tag.block = this.parseTextBlock();
this.lexer.pipeless = false;
} else {
var block = this.block();
if (tag.block) {
for (var i = 0, len = block.nodes.length; i < len; ++i) {
tag.block.push(block.nodes[i]);
}
} else {
tag.block = block;
}
}
}
return tag;
}
};
}); // module: parser.js
require.register("runtime.js", function(module, exports, require){
/*!
* Jade - runtime
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Lame Array.isArray() polyfill for now.
*/
if (!Array.isArray) {
Array.isArray = function(arr){
return '[object Array]' == Object.prototype.toString.call(arr);
};
}
/**
* Lame Object.keys() polyfill for now.
*/
if (!Object.keys) {
Object.keys = function(obj){
var arr = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
arr.push(key);
}
}
return arr;
}
}
/**
* Render the given attributes object.
*
* @param {Object} obj
* @param {Object} escaped
* @return {String}
* @api private
*/
exports.attrs = function attrs(obj, escaped){
var buf = []
, terse = obj.terse;
delete obj.terse;
var keys = Object.keys(obj)
, len = keys.length;
if (len) {
buf.push('');
for (var i = 0; i < len; ++i) {
var key = keys[i]
, val = obj[key];
if ('boolean' == typeof val || null == val) {
if (val) {
terse
? buf.push(key)
: buf.push(key + '="' + key + '"');
}
} else if (0 == key.indexOf('data') && 'string' != typeof val) {
buf.push(key + "='" + JSON.stringify(val) + "'");
} else if ('class' == key && Array.isArray(val)) {
buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
} else if (escaped[key]) {
buf.push(key + '="' + exports.escape(val) + '"');
} else {
buf.push(key + '="' + val + '"');
}
}
}
return buf.join(' ');
};
/**
* Escape the given string of `html`.
*
* @param {String} html
* @return {String}
* @api private
*/
exports.escape = function escape(html){
return String(html)
.replace(/&(?!\w+;)/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
/**
* Re-throw the given `err` in context to the
* the jade in `filename` at the given `lineno`.
*
* @param {Error} err
* @param {String} filename
* @param {String} lineno
* @api private
*/
exports.rethrow = function rethrow(err, filename, lineno){
if (!filename) throw err;
var context = 3
, str = require('fs').readFileSync(filename, 'utf8')
, lines = str.split('\n')
, start = Math.max(lineno - context, 0)
, end = Math.min(lines.length, lineno + context);
// Error context
var context = lines.slice(start, end).map(function(line, i){
var curr = i + start + 1;
return (curr == lineno ? ' > ' : ' ')
+ curr
+ '| '
+ line;
}).join('\n');
// Alter exception message
err.path = filename;
err.message = (filename || 'Jade') + ':' + lineno
+ '\n' + context + '\n\n' + err.message;
throw err;
};
}); // module: runtime.js
require.register("self-closing.js", function(module, exports, require){
/*!
* Jade - self closing tags
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
module.exports = [
'meta'
, 'img'
, 'link'
, 'input'
, 'source'
, 'area'
, 'base'
, 'col'
, 'br'
, 'hr'
];
}); // module: self-closing.js
require.register("utils.js", function(module, exports, require){
/*!
* Jade - utils
* Copyright(c) 2010 TJ Holowaychuk <[email protected]>
* MIT Licensed
*/
/**
* Convert interpolation in the given string to JavaScript.
*
* @param {String} str
* @return {String}
* @api private
*/
var interpolate = exports.interpolate = function(str){
return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
return escape
? str
: "' + "
+ ('!' == flag ? '' : 'escape')
+ "((interp = " + code.replace(/\\'/g, "'")
+ ") == null ? '' : interp) + '";
});
};
/**
* Escape single quotes in `str`.
*
* @param {String} str
* @return {String}
* @api private
*/
var escape = exports.escape = function(str) {
return str.replace(/'/g, "\\'");
};
/**
* Interpolate, and escape the given `str`.
*
* @param {String} str
* @return {String}
* @api private
*/
exports.text = function(str){
return interpolate(escape(str));
};
}); // module: utils.js
window.jade = require("jade");
})();
|
/*
Reverse a linked list
*/
function Node(val) {
this.val = val;
this.next = null;
}
function LinkedList() {
this.head = null;
this.tail = null;
}
const reverseLL = head => {
let curr = head;
let prev = null;
let tempNext = null;
while(curr) {
tempNext = curr.next;
curr.next = prev;
prev = curr;
curr = tempNext;
}
return prev;
}
// 1 => 2 => 3
// want to be 3 => 2 => 1
const node1 = new Node(1);
const node2 = new Node(2);
const node3 = new Node(3);
node1.next = node2;
node2.next = node3;
console.log(node1);
const ll = new LinkedList();
ll.head = node1;
ll.tail = node3;
console.log(ll);
console.log(reverseLL(node1)); |
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Helper | get-random', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
test('it renders', async function(assert) {
this.set('inputValue', '1234');
await render(hbs`{{get-random inputValue}}`);
assert.equal(this.element.textContent.trim(), '1234');
});
});
|
(function(){
angular
.module('chatty', ['ui.router', 'ngCookies', 'firebase'])
.config(config)
function config($stateProvider, $locationProvider){
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
})
$stateProvider
.state('chat', {
url: '/',
controller: 'RoomsCtrl',
templateUrl: 'templates/chat.html'
});
}
})(); |
import isPowerOfTwo from "./solution.js";
test("example 1", () => {
expect(isPowerOfTwo(1)).toBe(true);
});
test("example 2", () => {
expect(isPowerOfTwo(16)).toBe(true);
});
test("example 3", () => {
expect(isPowerOfTwo(218)).toBe(false);
});
test("example 4", () => {
expect(isPowerOfTwo(-16)).toBe(false);
});
|
import lark
from lark import Lark, Tree
from lark.lexer import Token
from lark.visitors import Interpreter
grammar = """
start : (decl)+
decl : variable_decl | function_decl | class_decl | interface_decl
variable_decl : variable ";"
variable : type IDENT
type : TYPE | IDENT | type "[]"
function_decl : type IDENT "("formals")" stmt_block | "void" IDENT "("formals")" stmt_block
formals : variable (","variable)* |
class_decl : "class" IDENT ("extends" IDENT)? ("implements" IDENT (","IDENT)*)? "{"(field)*"}"
field : variable_decl | function_decl
interface_decl : "interface" IDENT "{"(prototype)*"}"
prototype : type IDENT "(" formals ")" ";" | "void" IDENT "(" formals ")" ";"
stmt_block : "{" (variable_decl)* (stmt)* "}"
stmt : (expr)? ";" | if_stmt | while_stmt | for_stmt | break_stmt | return_stmt | print_stmt -> print | stmt_block
if_stmt : "if" "(" expr ")" stmt ("else" stmt)?
while_stmt : "while" "(" expr ")" stmt
for_stmt : "for" "(" (expr)? ";" expr ";" (expr)? ")" stmt
return_stmt : "return" (expr)? ";"
break_stmt : "break" ";"
print_stmt : "Print" "(" expr (","expr)* ")" ";" -> print
expr : l_value "=" expr -> ass | expr8
expr8 : expr8 "||" expr1 -> or_bool | expr1
expr1 : expr1 "&&" expr2 -> and_bool | expr2
expr2 : expr2 "==" expr3 -> eq | expr2 "!=" expr3 -> ne | expr3
expr3 : expr3 "<" expr4 -> lt | expr3 "<=" expr4 -> le | expr3 ">" expr4 -> gt | expr3 ">=" expr4 -> ge | expr4
expr4 : expr4 "+" expr5 -> add | expr4 "-" expr5 -> sub | expr5
expr5 : expr5 "*" expr6 -> mul | expr5 "/" expr6 -> div | expr5 "%" expr6 -> mod | expr6
expr6 : "-" expr6 -> neg | "!" expr6 -> not_expr | expr7
expr7 : constant | "ReadInteger" "(" ")" -> read_integer | "ReadLine" "(" ")" -> read_line | "new" IDENT -> class_inst | "NewArray" "(" expr "," type ")" -> new_array | "(" expr ")" | l_value -> val | call
l_value : IDENT -> var_addr | expr7 "." IDENT -> var_access | expr7 "[" expr "]" -> subscript
call : IDENT "(" actuals ")" | expr7 "." IDENT "(" actuals ")" -> method
actuals : expr (","expr)* |
constant : INT -> const_int | DOUBLE -> const_double | DOUBLE_SCI -> const_double | BOOL -> const_bool | STRING -> const_str | "null" -> null
DOUBLE.2 : /(\\d)+\\.(\\d)*/
DOUBLE_SCI.3 : /(\\d)+\\.(\\d)*[Ee][+-]?(\\d)+/
INT: /0[xX][a-fA-F0-9]+/ | /[0-9]+/
BOOL : /((true)|(false))(xabc1235ll)*/
TYPE : "int" | "double" | "bool" | "string"
STRING : /"[^"\\n]*"/
IDENT : /(?!((true)|(false)|(void)|(int)|(double)|(bool)|(string)|(class)|(interface)|(null)|(extends)|(implements)|(for)|(while)|(if)|(else)|(return)|(break)|(new)|(NewArray)|(Print)|(ReadInteger)|(ReadLine))([^_a-zA-Z0-9]|$))[a-zA-Z][_a-zA-Z0-9]*/
INLINE_COMMENT : "//" /[^\\n]*/ "\\n"
MULTILINE_COMMENT : "/*" /(\\n|.)*?/ "*/"
%import common.WS -> WHITESPACE
%ignore WHITESPACE
%ignore INLINE_COMMENT
%ignore MULTILINE_COMMENT
"""
class Type:
def __init__(self, name=None, meta=None, dimension=0):
self.name = name
self.dimension = dimension
self._meta = meta
def reset(self):
self.name = None
self.dimension = 0
self._meta = None
def __eq__(self, other):
if self.name == other.name and self.dimension == other.dimension:
return True
return False
def __str__(self):
return 'Name: {}\tDimension: {}'.format(self.name, self.dimension)
class ClassType:
def __init__(self, name, parent=None):
self.name = name
self.parent = parent
self.children = []
self.variables = []
self.functions = []
class_type_objects.append(self)
def print_functions(self):
l = []
for function in self.functions:
l.append(function.exact_name)
return
def find_var_index(self, ident):
counter = 0
for var in self.variables:
if var[0] == ident:
return counter
else:
counter += 1
return -1
def find_var_type(self, ident):
return self.variables[self.find_var_index(ident)][1]
def find_function(self, name):
for func in self.functions:
if func.name == name:
return func
raise Exception("function not found")
def find_function_index(self, name):
counter = 0
for func in self.functions:
if func.name == name:
return counter
counter += 1
raise Exception("function not found")
class Function:
def __init__(self, name=None, exact_name=None):
self.name = name
self.return_type = Type()
"""formals is list of [variable_name , variable_type] maybe name part will be deleted in future"""
self.formals = []
"""this name is scope of function which will be it's label in mips code"""
self.exact_name = exact_name
def set_return_type(self, return_type: Type):
self.return_type = return_type
return self
def set_formals(self, formals):
self.formals = formals
return self
def find_formal(self, name: str):
counter = 0
for formal in self.formals:
if formal[0] == name:
return formal, counter
counter += 1
raise ChildProcessError("We're doomed")
class SymbolTableObject:
def __init__(self, scope=None, name=None, parent_scope=None, attribute=None):
if attribute is None:
attribute = []
self.scope = scope
self.name = name
self.parent_scope = parent_scope
self.type = Type()
self.attribute = attribute
symbol_table_objects.append(self)
def __str__(self):
return self.name + ': ' + str(self.type.name) + ' ' + str(self.type.dimension)
def __repr__(self):
return self.__str__()
symbol_table_objects = []
class_type_objects = []
function_objects = []
""" symbol table is a hashmap with keys of (scope,name)
scope convension is something like directories; for example see below:
Class Tank:
double val;
function f1(int a , int b, int c):
double a = 5;
scopes are in the following way:
root/__class__Tank
root/__class__Tank/val
root/__class__Tank/f1/a
root/__class__Tank/f1/b
root/__class__Tank/f1/c
root/__class__Tank/f1/_local/{a number!}/a
"""
symbol_table = {}
"""class table is a hashmap of (class name) to classType object index in class_type_objects
"""
class_table = {}
"""function table is a hashmap for static functions(the functions which are not in any classes) of (function name) to
function index in function_objects
"""
function_table = {}
stack = ['root']
parent_classes = []
def init():
function_objects.append(
Function(name='itod', exact_name='root/itod').set_return_type(
Type('double')
).set_formals(
[['ival', Type('int')]]
)
)
function_table['itod'] = 0
function_objects.append(
Function(name='dtoi_', exact_name='root/dtoi_').set_return_type(
Type('int')
).set_formals(
[['dval', Type('double')]]
)
)
function_table['dtoi_'] = 1
function_objects.append(
Function(name='itob', exact_name='root/itob').set_return_type(
Type('bool')
).set_formals(
[['ival', Type('int')]]
)
)
function_table['itob'] = 2
function_objects.append(
Function(name='btoi', exact_name='root/btoi').set_return_type(
Type('int')
).set_formals(
[['bval', Type('bool')]]
)
)
function_table['btoi'] = 3
function_objects.append(
Function(name='ceil__', exact_name='root/ceil__').set_return_type(
Type('int')
).set_formals(
[['dval', Type('double')]]
)
)
function_table['ceil__'] = 4
function_objects.append(
Function(name='ReadChar__', exact_name='root/ReadChar__').set_return_type(
Type('int')
).set_formals(
[]
)
)
function_table['ReadChar__'] = 5
# function_objects.append(
# Function(name='print_double__', exact_name='root/print_double__').set_return_type(
# Type('void')
# ).set_formals(
# [['x', Type('double')]]
# )
# )
#
# function_table['print_double__'] = 5
init()
class SymbolTableMaker(Interpreter):
symbol_table_obj_counter = 0
class_counter = 0
static_function_counter = len(function_table)
"""block stmt counter is a counter just for block statements during building symbol table and it differentiate
different block statements scopes. for more details see example below:
int a;
int b;
{
int a;
int c;
{
int d;
}
}
{
P a;
}
scopes are in the following order:
root/a
root/b
root/1/a
root/1/c
root/2/d
root/3/a
"""
block_stmt_counter = 0
def decl(self, tree):
for declaration in tree.children:
if declaration.data == 'variable_decl':
self.visit(declaration)
elif declaration.data == 'function_decl':
self.visit(declaration)
pass
elif declaration.data == 'class_decl':
self.visit(declaration)
pass
def function_decl(self, tree):
class_type_object = tree._meta
if len(tree.children) == 4:
ident = tree.children[1]
formals = tree.children[2]
stmt_block = tree.children[3]
else:
ident = tree.children[0]
formals = tree.children[1]
stmt_block = tree.children[2]
symbol_table_object = SymbolTableObject(scope=stack[-1], name=ident)
symbol_table[(stack[-1], ident.value,)] = self.symbol_table_obj_counter
self.symbol_table_obj_counter += 1
# print(stack[-1] + "/" + ident.value)
function = Function(name=ident.value, exact_name=stack[-1] + "/" + ident.value)
if type(tree.children[0]) == lark.tree.Tree:
object_type = tree.children[0]
object_type._meta = symbol_table_object
self.visit(object_type)
function.return_type = symbol_table_object.type
else:
symbol_table_object.type.name = 'void'
function.return_type.name = 'void'
if class_type_object:
this = Tree(data='variable',
children=[Tree(data='type', children=[Token(type_='TYPE', value=class_type_object.name)]),
Token(type_='IDENT', value='this')])
temp = formals.children.copy()
formals.children = [this] + temp
stack.append(stack[-1] + "/" + ident)
formals._meta = function
self.visit(formals)
stack.append(stack[-1] + "/_local")
self.visit(stmt_block)
stack.pop() # pop _local
stack.pop() # pop formals
if class_type_object:
# temp = function.formals.copy()
# function.formals = [['__this__', Type(name=class_type_object.name)]] + temp
class_type_object.functions.append(function)
pass
else:
function_table[function.name] = self.static_function_counter
function_objects.append(function)
self.static_function_counter += 1
def formals(self, tree):
function = tree._meta
if tree.children:
for variable in tree.children:
variable._meta = function
self.visit(variable)
def stmt_block(self, tree):
stack.append(stack[-1] + "/" + str(self.block_stmt_counter))
self.block_stmt_counter += 1
for child in tree.children:
if child.data == 'variable_decl':
self.visit(child)
else:
self.visit(child)
stack.pop()
def stmt(self, tree):
child = tree.children[0]
if child.data == 'if_stmt':
self.visit(child)
if child.data == 'while_stmt':
self.visit(child)
if child.data == 'for_stmt':
self.visit(child)
if child.data == 'stmt_block':
self.visit(child)
def if_stmt(self, tree):
stmt = tree.children[1]
self.visit(stmt)
if len(tree.children) == 3:
else_stmt = tree.children[2]
self.visit(else_stmt)
def while_stmt(self, tree):
stmt = tree.children[1]
self.visit(stmt)
def for_stmt(self, tree):
stmt = tree.children[-1]
self.visit(stmt)
def class_decl(self, tree):
ident = tree.children[0]
class_type_object = ClassType(name=ident)
class_table[ident.value] = self.class_counter
self.class_counter += 1
symbol_table_object = SymbolTableObject(scope=stack[-1], name=ident)
symbol_table[(stack[-1], ident.value,)] = self.symbol_table_obj_counter
self.symbol_table_obj_counter += 1
if len(tree.children) > 1:
if type(tree.children[1]) == lark.lexer.Token:
stack.append(stack[-1] + "/__class__" + ident)
for field in tree.children[2:]:
field._meta = class_type_object
self.visit(field)
stack.pop()
else:
stack.append(stack[-1] + "/__class__" + ident)
for field in tree.children[1:]:
field._meta = class_type_object
self.visit(field)
stack.pop()
def field(self, tree):
tree.children[0]._meta = tree._meta
self.visit(tree.children[0])
def variable_decl(self, tree):
tree.children[0]._meta = tree._meta
self.visit(tree.children[0])
def variable(self, tree):
object_type = tree.children[0]
name = tree.children[1].value
symbol_table_object = SymbolTableObject(scope=stack[-1], name=name)
symbol_table[(stack[-1], name,)] = self.symbol_table_obj_counter
self.symbol_table_obj_counter += 1
object_type._meta = symbol_table_object
self.visit(object_type)
if type(tree._meta) == ClassType:
class_type_object = tree._meta
class_type_object.variables.append([name, symbol_table_object.type])
if type(tree._meta) == Function:
function = tree._meta
function.formals.append([name, symbol_table_object.type])
def type(self, tree):
if type(tree.children[0]) == lark.lexer.Token:
symbol_table_object = tree._meta
symbol_table_object.type.name = tree.children[0].value
else:
symbol_table_object = tree._meta
symbol_table_object.type.dimension += 1
tree.children[0]._meta = tree._meta
self.visit(tree.children[0])
class ClassTreeSetter(Interpreter):
def decl(self, tree):
for declaration in tree.children:
if declaration.data == 'class_decl':
self.visit(declaration)
def class_decl(self, tree):
ident = tree.children[0]
if type(tree.children[1]) == lark.lexer.Token:
parent_name = tree.children[1].value
parent = class_type_objects[class_table[parent_name]]
parent.children.append(ident.value)
else:
parent_classes.append(ident.value)
def set_inheritance_tree(parent_class: ClassType):
if parent_class.children:
for child in parent_class.children:
child_class = class_type_objects[class_table[child]]
child_class.variables = parent_class.variables + child_class.variables
child_functions = child_class.functions.copy()
child_class.functions = parent_class.functions.copy()
parent_class_function_names = set()
for func in parent_class.functions:
parent_class_function_names.add(func.name)
for func in child_functions:
for i in range(len(child_class.functions)):
if child_class.functions[i].name == func.name:
child_class.functions[i] = func
for func in child_functions:
if func.name not in parent_class_function_names:
child_class.functions.append(func)
set_inheritance_tree(child_class)
def set_inheritance():
for class_name in parent_classes:
class_object = class_type_objects[class_table[class_name]]
set_inheritance_tree(class_object)
class ImplicitThis(Interpreter):
def decl(self, tree):
for child in tree.children:
if child.data == 'class_decl':
self.visit(child)
def class_decl(self, tree):
for child in tree.children:
if type(child) != lark.lexer.Token:
child._meta = tree.children[0].value
self.visit(child)
def field(self, tree):
if tree.children[0].data == 'function_decl':
tree.children[0]._meta = tree._meta
self.visit(tree.children[0])
def function_decl(self, tree):
tree.children[-1]._meta = tree._meta
self.visit(tree.children[-1])
def stmt_block(self, tree):
for child in tree.children:
if child.data != 'variable_decl':
child._meta = tree._meta
self.visit(child)
def stmt(self, tree):
for child in tree.children:
if child.data != 'break_stmt':
child._meta = tree._meta
self.visit(child)
def if_stmt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def while_stmt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def for_stmt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def return_stmt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def print(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr(self, tree):
tree.children[-1]._meta = tree._meta
self.visit(tree.children[-1])
def expr1(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr2(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr3(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr4(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr5(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr6(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr7(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def expr8(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def call(self, tree):
if len(tree.children) == 2:
name = tree._meta
fun_name = tree.children[0].value
exists = False
for fun in class_type_objects[class_table[name]].functions:
if fun.name == fun_name:
exists = True
if exists:
copy = tree.children.copy()
this = Tree(data='val', children=[Tree(data='var_addr', children=[Token(type_='IDENT', value='this')])])
tree.children = [this] + copy
tree.data = 'method'
def ass(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def or_bool(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def and_bool(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def eq(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def ne(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def lt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def le(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def gt(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def ge(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def add(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def sub(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def mul(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def div(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def mod(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def neg(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def not_expr(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def new_array(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def l_value(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def val(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
def var_access(self, tree):
tree.children[0]._meta = tree._meta
self.visit(tree.children[0])
def subscript(self, tree):
for child in tree.children:
child._meta = tree._meta
self.visit(child)
text = """
int[][][] c;
int d;
class Ostad extends Emp{
void daneshjoo(){
}
}
class Person{
double name;
int a;
string l;
int mmd(){
int c;
}
}
class Emp extends Person {
int lks;
int fight(){}
int mmd(){}
}
void cal(int number, double mmd) {
int c;
{
int d;
}
c = number;
}
double stone(){
double f;
}
int main() {
int a;
int b;
a = ReadInteger();
b = ReadInteger();
Print(a);
Print(b);
}
"""
class_text = """
class Person {
string name;
int age;
void setName(string new_name) {
name = new_name;
}
void setAge(int new_age) {
age = new_age;
}
void print() {
Print("Name: ", name, " Age: ", age);
}
}
int main() {
Person p;
string name;
int age;
name = ReadLine();
age = ReadInteger();
p = new Person;
p.setName(name);
p.setAge(age);
p.print();
}
"""
if __name__ == '__main__':
parser = Lark(grammar, parser="lalr")
parse_tree = parser.parse(text)
ImplicitThis().visit(parse_tree)
# SymbolTableMaker().visit(parse_tree)
# ClassTreeSetter().visit(parse_tree)
# print(symbol_table)
# set_inheritance()
# for x in class_type_objects[0].functions:
# print(x.exact_name)
# class_type_objects[1].print_functions()
# print('****************************')
|
import React from "react";
import styled from "styled-components";
export const ConfigColor = {
greyBlack: "#353535",
greyVeryClear: "#828c99",
greyClear: "#dfe7ef",
red: "#f44336",
activeRed: "#d32f2f"
};
export const Container = styled.div`
width: ${prop => prop.width};
display: flex;
`;
const Color = styled.div`
font-family: "Inconsolata", monospace;
padding: 1em;
background-color: ${prop => prop.color};
display: flex;
`;
export const ShowColor = () => (
<Container>
{Object.keys(ConfigColor).map((key, index) => (
<Color key={index} color={ConfigColor[key]}>
{ConfigColor[key]}
</Color>
))}
</Container>
);
export const Image = styled.img`
cursor: ${prop => prop.link};
height: ${prop => prop.height};
border-radius: ${prop => prop.radius};
box-shadow: ${prop => prop.shadow};
float: ${prop => prop.floated};
vertical-align: ${prop => prop.verticalAlign};
`;
export const Span = styled.span`
float: ${prop => prop.floated};
`;
export const SpanToolTip = styled.div`
display: inline-block;
color: green;
margin-left: 5px;
`;
export const ContainerApp = styled.div`
width: 80%;
margin: 0 auto;
padding: 2em 0;
`;
export const FlexContainer = styled.div`
display: flex;
flex-direction: ${prop => prop.direction};
`;
export const FlexInline = styled.div`
display: inline-flex;
`;
export const FlexChildrenName = styled.span`
align-self: center;
margin: 0 10px;
cursor: pointer;
`;
export const ContainerStatic = styled.div`
width: 100%;
padding: 75px;
margin-top: 60px;
text-align: center;
color: white;
background-color: ${props => props.color};
`;
export const ContainerViewer = styled.div`
margin: 15px 0;
padding: 50px;
border: 2 solid ${ConfigColor.greyClear};
border-radius: 4px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.23);
`;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.