text
stringlengths
7
3.69M
/* CLRS Chapter 2 Problem 2-2, p. 40 */ const bubbleSort = (A) => { for (let i = 0; i < A.length; i++) { for (let j = A.length - 1; j >= i + 1; j--) { if (A[j] < A[j - 1]) { [A[j], A[j - 1]] = [A[j - 1], A[j]]; } } } } module.exports = { bubbleSort }
import React, {Fragment} from 'react'; import {createStackNavigator} from '@react-navigation/stack'; import {createDrawerNavigator} from '@react-navigation/drawer'; import DrawerContent from './components/DrawerContent'; import Header from './components/Header'; import Login from './screens/signup/Login'; import Signup from './screens/signup/Signup'; import AddAccount from './screens/connect/AddAccount'; import Connect from './screens/connect/Connect'; import OTP from './screens/connect/OTP'; import Result from './screens/connect/Result'; import PhoneNumber from './screens/connect/PhoneNumber'; import Bill from './screens/connect/Bill'; import BillPayment from './screens/connect/BillPayment'; import BillAccountType from './screens/paymentAccountType/BillAccountType'; import CreditVisa from './screens/paymentAccountType/CreditVisa'; import Checking from './screens/paymentAccountType/Checking'; import ChooseDate from './screens/connect/ChooseDate'; import ChooseAmount from './screens/connect/ChooseAmount'; import InputAmount from './screens/connect/InputAmount'; import {connect} from 'react-redux'; import Payment1 from './screens/payment/Payment1'; import Payment2 from './screens/payment/Payment2'; import Payment3 from './screens/payment/Payment3'; import PaymentReview from './screens/payment/PaymentReview'; import BillLoginPopup from './components/BillLoginPopup'; const HomeStackNav = createStackNavigator(); function HomeScreen() { return ( <HomeStackNav.Navigator headerMode="screen" screenOptions={{ header: ({scene, navigation}) => ( <Header scene={scene} navigation={navigation} /> ), }}> <HomeStackNav.Screen name="Bill" component={Bill} /> <HomeStackNav.Screen name="AddAccount" component={AddAccount} /> <HomeStackNav.Screen name="Connect" component={Connect} /> <HomeStackNav.Screen name="OTP" component={OTP} /> <HomeStackNav.Screen name="Result" component={Result} /> <HomeStackNav.Screen name="PhoneNumber" component={PhoneNumber} /> <HomeStackNav.Screen name="Payment1" component={Payment1} /> <HomeStackNav.Screen name="Payment2" component={Payment2} /> <HomeStackNav.Screen name="Payment3" component={Payment3} /> <HomeStackNav.Screen name="PaymentReview" component={PaymentReview} /> {/* <HomeStackNav.Screen name="Bill" component={Bill} /> */} <HomeStackNav.Screen name="BillPayment" component={BillPayment} /> <HomeStackNav.Screen name="BillAccountType" component={BillAccountType} /> <HomeStackNav.Screen name="ChooseDate" component={ChooseDate} /> <HomeStackNav.Screen name="ChooseAmount" component={ChooseAmount} /> <HomeStackNav.Screen name="BillLoginPopup" component={BillLoginPopup} /> <HomeStackNav.Screen name="InputAmount" component={InputAmount} /> <HomeStackNav.Screen name="CreditVisa" component={CreditVisa} /> <HomeStackNav.Screen name="Checking" component={Checking} /> </HomeStackNav.Navigator> ); } const MainDrawer = createDrawerNavigator(); function Main() { return ( <MainDrawer.Navigator drawerContent={() => <DrawerContent />}> <MainDrawer.Screen name="Home" component={HomeScreen} /> </MainDrawer.Navigator> ); } const AppStackNav = createStackNavigator(); function NavigationScreens({token}) { return ( <AppStackNav.Navigator screenOptions={{ headerShown: false, }}> {token ? ( <AppStackNav.Screen name="Main" component={Main} /> ) : ( <Fragment> <AppStackNav.Screen name="Login" component={Login} /> <AppStackNav.Screen name="Signup" component={Signup} /> </Fragment> )} </AppStackNav.Navigator> ); } function mapStateToProps(state) { return {token: state.auth.token}; } export default connect(mapStateToProps)(NavigationScreens);
var request = require('request'); const { database } = require('./database') //Get list of Repositories async function getRepositoriesAPI(data,patToken){ return new Promise((resolve,reject)=>{ try{ var options = { 'method': 'GET', 'url': `https://dev.azure.com/${data.organization}/${data.project}/_apis/git/repositories?api-version=5.1`, 'headers': { 'Authorization': "Basic " + Buffer.from(patToken+":"+patToken).toString("base64") } }; request(options, async function (error, response) { if (!error && response.statusCode == 200){ resolve((JSON.parse(response.body)).value[0].id) }else{ console.log("Error in get Repositories List API: ",JSON.parse(response.body)) reject({"Error": JSON.parse(response.body)}) } }); }catch(error) { //Error occurred in try-catch block console.log(error) reject({"Error": "Error occurred in try catch!!!"}) } }) } //Create Project of given org-name,project-name,project-description,etc async function pushCodeToAzureRepo(data,projectId,patToken){ return new Promise((resolve,reject)=>{ try{ var options = { 'method': 'POST', 'url': `https://dev.azure.com/${data.organization}/${data.project}/_apis/git/repositories/${projectId}/importRequests?api-version=6.0-preview.1`, 'headers': { 'Authorization': "Basic " + Buffer.from(patToken+":"+patToken).toString("base64"), 'Content-Type': 'application/json' }, body: JSON.stringify({ "parameters":{ "gitSource":{ "url": "https://mahimaAuto@dev.azure.com/mahimaAuto/Publicrepo/_git/Publicrepo" } }}) }; request(options, async function (error, response) { if (!error && response.statusCode == 201){ resolve({"Success": "Code pushed to Azure Repos successfully..!!!"}) }else{ console.log("Error in code pushed to repository API: ",JSON.parse(response.body)) reject({"Error": JSON.parse(response.body)}) } }); }catch(error) { //Error occurred in try-catch block console.log(error) reject({"Error": "Error occurred in try catch!!!"}) } }) } //Push code of given url into the repository of created project. async function pushCodeToRepository(reqData,patToken) { return new Promise(async (resolve,reject)=>{ try{ await getRepositoriesAPI(reqData,patToken).then(async projectId=>{ await pushCodeToAzureRepo(reqData,projectId,patToken).then(async resultant=>{ //Push Code query = `UPDATE [dbo].[devOpsStarter] SET status = 'Import Code To Repository Succeeded.' WHERE processId ='${reqData.processId}'` databaseResponse = await database(query) resolve(resultant) }).catch(error=>{ //Error while push the code on Azure Repos. reject(error) }) }).catch(error=>{ //Error while getting repositories list. reject(error) }) }catch(error) { //Error occurred in try-catch block console.log(error) reject({"Error": "Error occurred in try catch!!!"}) } }) } module.exports = {pushCodeToRepository}
/* 🤖 this file was generated by svg-to-ts*/ export const EOSIconsCropPortrait = { name: 'crop_portrait', data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7V5h10v14z"/></svg>` };
var Long = require('long'); var NBT = require('../dist/PowerNBT'); var assert = require('assert'); describe('NBT.NBTTagInt', function(){ describe('constructor', function(){ it('should be equal 0' , function(){ assert.equal(0, new NBT.NBTTagInt()); assert.equal(0, new NBT.NBTTagInt(undefined)); assert.equal(0, new NBT.NBTTagInt(null)); assert.equal(0, new NBT.NBTTagInt(0)); assert.equal(0, new NBT.NBTTagInt("")); assert.equal(0, new NBT.NBTTagInt("0")); }); it('should have name' , function(){ assert.equal("name", new NBT.NBTTagInt(0, "name").name); assert.equal("", new NBT.NBTTagInt(0, "").name); assert.equal("", new NBT.NBTTagInt(0).name); }); it('should have value' , function(){ assert.equal(1, new NBT.NBTTagInt(1)); }); }); describe('#type', function(){ it('should be equal TAG_INT' , function(){ assert.equal(NBT.Type.TAG_INT, new NBT.NBTTagInt().type); }); }); describe('#setValue', function(){ var tag = new NBT.NBTTagInt(); it('should change numeric value' , function(){ tag.setValue(20); assert.equal(20, tag); }); it('should change string value' , function(){ tag.setValue("-20"); assert.equal(-20, tag); tag.setValue("0x3a"); assert.equal(58, tag); }); it('should change tag value' , function(){ tag.setValue(new NBT.NBTTagInt(15)); assert.equal(15, tag); }); it('should apply max value', function(){ tag.setValue(NBT.NBTTagInt.MAX_VALUE); assert.equal(NBT.NBTTagInt.MAX_VALUE, tag); }); it('should apply min value', function(){ tag.setValue(NBT.NBTTagInt.MIN_VALUE); assert.equal(NBT.NBTTagInt.MIN_VALUE, tag); }); it('should apply overflow', function(){ tag.setValue(NBT.NBTTagInt.MAX_VALUE+1); assert.equal(NBT.NBTTagInt.MIN_VALUE, tag); tag.setValue(NBT.NBTTagInt.MIN_VALUE-1); assert.equal(NBT.NBTTagInt.MAX_VALUE, tag); }); }); describe('#clone', function(){ var a = new NBT.NBTTagInt(123); var b = a.clone(); it('should not return this', function(){ assert.notEqual(a, b); }); it('should return it instance', function(){ assert.ok(b instanceof NBT.NBTTagInt); }); it('clone should be equal to this as number', function(){ assert.equal(a.valueOf(), b.valueOf()); }); it('clone should be equal to this as string', function(){ assert.equal(a.toString(), b.toString()); }); }); });
var j$ = jQuery.noConflict(); j$(document).ready(function(){ var screenWidth = j$(window).width(); // if window width is smaller than 800 remove the autoplay attribute // from the video if (screenWidth < 800){ j$('#videoBackground').removeAttr('autoplay'); } else { j$('#videoBackground').attr('autoplay'); } var submitIcon = j$('.searchbox-icon'); var inputBox = j$('.searchbox-input'); var searchBox = j$('.searchbox'); var isOpen = false; submitIcon.click(function(){ if(isOpen == false){ searchBox.addClass('searchbox-open'); inputBox.focus(); isOpen = true; } else { searchBox.removeClass('searchbox-open'); inputBox.focusout(); isOpen = false; } }); submitIcon.mouseup(function(){ return false; }); searchBox.mouseup(function(){ return false; }); j$(document).mouseup(function(){ if(isOpen == true){ j$('.searchbox-icon').css('display','block'); submitIcon.click(); } }); j$(".servicesBox").click(function(){ j$(this).toggleClass("overlay").find("p").toggle("fast", "linear").css("cursor", "default"); }); if (j$(window).width() < 1024) { j$(".execBios").click(function(){ j$(this).find(".bioBlurb").toggle("fast", "linear"); j$(this).mouseleave(function(){ j$(".bioBlurb").hide("slow"); }); }); } /* j$("#bizDevLink").click(function(){ j$("#bizDev").toggle("fast", "linear"); j$("#location").hide(); }); j$("#hrLink").click(function(){ j$("#humanResources").toggle("fast", "linear"); j$("#location").hide(); }); j$("#csoLink").click(function(){ j$("#corpSupportOffice").toggle("fast", "linear"); j$("#location").hide(); }); */ //When ever the modal is shown the below code will execute. j$(".modal").on("shown.bs.modal", function() { var urlReplace = "#" + j$(this).attr('id'); history.pushState(null, null, urlReplace); }); // This code gets executed when the back button is clicked, hide any/open modals. j$(window).on('popstate', function() { j$(".modal").modal('hide'); }); /* j$("#hrLink").click(function (e){ j$("#mySidenav").css("width", "380px"); j$("body").after( "<div class='modal-backdrop fade side in'></div>" ); j$("html").addClass("modall"); }); j$("#mySidenav .close").click(function (){ j$(this).parent().css("width", "0"); j$(".modal-backdrop").remove(); }); j$(".modall").click(function(e){ alert("fooadf"); }); */ /* j$(".smoothScroll").on('click', function(event) { // Make sure this.hash has a value before overriding default behavior if (this.hash !== "") { // Prevent default anchor click behavior event.preventDefault(); // Store hash var hash = this.hash; // Using jQuery's animate() method to add smooth page scroll // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area j$('html, body').animate({ scrollTop: j$(hash).offset().top - 205 }, 800, function(){ // Add hash (#) to URL when done scrolling (default click behavior) window.location.hash = hash; }); } // End if }); */ j$('.smoothScroll').click(function(event) { var target; var navOffset; // Store hash (#) target = this.hash; // Store navbar height (if the navbar position is fixed) // You must add these attributes to the <body> tag : data-spy="scroll" data-target="#navbar" data-offset="50" navOffset = 205; // Prevent default anchor click behavior event.preventDefault(); // Using jQuery's animate() method to add smooth page scroll // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area (the speed of the animation) return j$('html, body').animate({ scrollTop: j$(this.hash).offset().top - navOffset }, 800, function() { return window.history.pushState(null, null, target); }); }); }); function buttonUp(){ var inputVal = j$('.searchbox-input').val(); inputVal = j$.trim(inputVal).length; if( inputVal !== 0){ j$('.searchbox-icon').css('display','none'); } else { j$('.searchbox-input').val(''); j$('.searchbox-icon').css('display','block'); } } /* function openNav() { document.getElementById("mySidenav").style.width = "380px"; //document.getElementById("main").style.marginLeft = "250px"; } function closeNav() { document.getElementById("mySidenav").style.width = "0"; //document.getElementById("main").style.marginLeft = "0"; } */ j$("#bizDevLink").click(function (e){ j$("#BizDevWrapper").toggle('slide', {direction: 'right'}, 500); j$("body").addClass("modall").after( "<div class='modal-backdrop fade side in'></div>" ); e.stopPropagation(); }); j$(document).click(function(){ j$("#BizDevWrapper").hide('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#BizDevWrapper").click(function(e){ e.stopPropagation(); }); j$("#BizDevWrapper .close").click(function (){ //j$(this).parent().css("width", "0"); //j$(this).parent().slideToggle(); j$(this).parent().toggle('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#hrLink").click(function (e){ j$("#HRWrapper").toggle('slide', {direction: 'right'}, 500); j$("body").addClass("modall").after( "<div class='modal-backdrop fade side in'></div>" ); e.stopPropagation(); }); j$(document).click(function(){ j$("#HRWrapper").hide('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#HRWrapper").click(function(e){ e.stopPropagation(); }); j$("#HRWrapper .close").click(function (){ //j$(this).parent().css("width", "0"); //j$(this).parent().slideToggle(); j$(this).parent().toggle('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#csoLink").click(function (e){ j$("#CSOWrapper").toggle('slide', {direction: 'right'}, 500); j$("body").addClass("modall").after( "<div class='modal-backdrop fade side in'></div>" ); e.stopPropagation(); }); j$(document).click(function(){ j$("#CSOWrapper").hide('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#CSOWrapper").click(function(e){ e.stopPropagation(); }); j$("#CSOWrapper .close").click(function (){ //j$(this).parent().css("width", "0"); //j$(this).parent().slideToggle(); j$(this).parent().toggle('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#locationsLink").click(function (e){ j$("#LocationsWrapper").toggle('slide', {direction: 'right'}, 500); j$("body").addClass("modall").after( "<div class='modal-backdrop fade side in'></div>" ); e.stopPropagation(); }); j$(document).click(function(){ j$("#LocationsWrapper").hide('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$("#LocationsWrapper").click(function(e){ e.stopPropagation(); }); j$("#LocationsWrapper .close").click(function (){ //j$(this).parent().css("width", "0"); //j$(this).parent().slideToggle(); j$(this).parent().toggle('slide', {direction: 'right'}, 500); j$(".modal-backdrop.side").remove(); }); j$(".execBios").hover(function(){ j$(".btnLearnMore").css("visibility", "hidden"); }, function(){ j$(".btnLearnMore").css("visibility", "visible"); });
'use strict'; // Development specific configuration // ================================== module.exports = { // MongoDB connection options mongo: { uri: 'mongodb://localhost/luttetubebackend-dev' }, seedDB: true, SESSION_SECRET: "luttetubebackend-secret", FACEBOOK_ID: 'app-id', FACEBOOK_SECRET: 'secret', TWITTER_ID: 'app-id', TWITTER_SECRET: 'secret', GOOGLE_ID: '594035240990-sd43k0rdjr624v6bmnltkv3r1pi0ah8f.apps.googleusercontent.com', GOOGLE_SECRET: 'TVJ9uIIn87x_LJLA65wVuZT3', // Control debug level for modules using visionmedia/debug DEBUG: '' };
const Store = require('electron-store') const questionParameters = {records: {}, startTime: null, endTime: null, correctAnswer: "", class: ""} const defaultArray = [questionParameters] const defaultSettings = {serialNumber: '', channelId: 'AA'} class DataStore extends Store { constructor (settings) { super(settings) this.settings = this.get('settings') || defaultSettings this.questions = this.get('questions') || defaultArray this.id = this.questions.length - 1 this.question = this.questions[this.id] } getSettings() { return this.settings } setSettings(settings) { this.settings = settings return this.settings } saveSettings() { this.set('settings', this.settings) return this.settings } saveQuestion() { this.questions[this.id] = this.question this.set('questions', this.questions) // console.log("len: ", this.questions.length) return this.question } loadQuestion (id = -1) { this.saveQuestion() this.questions = this.get('questions') || defaultArray if (this.questions.length > id && id > -1) { this.question = this.questions[id] this.id = id return this.question } this.id = this.questions.length - 1 this.question = this.questions[this.id] return this.question } newQuestion () { this.saveQuestion() this.id = this.questions.length this.question = questionParameters this.questions = [ ...this.questions, questionParameters] this.questions[this.id].startTime = Date.now() this.questions[this.id].records = {} this.question = this.questions[this.id] // console.log("len: ", this.questions.length) return this.saveQuestion() } updateQuestion (field, value) { this.question[field] = value return this.question } deleteQuestion () { // this.questions = this.questions.filter(r => r !== question) if (this.questions.length > 1) { this.questions.splice(this.id, 1) this.id = this.questions.length - 1 this.question = this.questions[this.id] this.set('questions', this.questions) } else { this.questions = defaultArray this.id = 0 this.question = this.questions[this.id] this.questions[this.id].startTime = Date.now(); this.set('questions', this.questions) } return this.question } getQuestion () { return this.question } getQuestionId () { return this.id } getRecords () { return this.question.records } getRecordsByField (field, value) { var match = [] for (var key in this.question.records) { var record = this.question.records[key] if(record[record.length - 1][field] !== null && record[record.length - 1][field] === value) { match = [ ...match, record] } } return match } getRecordsByTimeStamp () { var records = [] for (var key in this.question.records) { var clicker = this.question.records[key] var i = 0 clicker.forEach(record => { records = [ ...records, { ...record, 'LastAnswer': i > 0 ? clicker[i - 1].Answer : ''}] // records.push(record) i++ }) } records.sort(function(a,b){return a.TimeStamp > b.TimeStamp ? 1 : -1}) return records } sortRecordsByField (field) { function compareValues(key, order='asc') { return function(a, b) { if(!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) { // property doesn't exist on either object return 0; } const varA = (typeof a[key] === 'string') ? a[key].toUpperCase() : a[key]; const varB = (typeof b[key] === 'string') ? b[key].toUpperCase() : b[key]; let comparison = 0; if (varA > varB) { comparison = 1; } else if (varA < varB) { comparison = -1; } return ( (order == 'desc') ? (comparison * -1) : comparison ); }; } this.question.records.sort(compareValues(field)) return this.question } replaceRecord (field, value, newRecord) { var match = [] var i = 0 this.question.records.forEach(record => { if(record[field] !== null && record[field] === value) { match = [ ...match, record] this.question.records.splice(i, 1) } i = i + 1 }); this.question.records = [ ...this.question.records, newRecord] return match } addRecord (record) { var prevRecord = null const recordDict = {'TimeStamp': record.TimeStamp, 'ClickerID' : record.ClickerID, 'Answer': record.Answer} try { prevRecord = this.question.records[record.ClickerID][this.question.records[record.ClickerID].length - 1] this.question.records[record.ClickerID].push(recordDict) } catch { this.question.records[record.ClickerID] = [recordDict] } return prevRecord } updateRecord (field, value, newRecord) { var match = 0 var i = 0 this.question.records.forEach(record => { if(record[field] !== null && record[field] === value) { this.question.records[i] = newRecord match = match + 1 } i = i + 1 }); return this.question.records } } module.exports = DataStore
import React from 'react' import fmcol1 from '../static/mainPage/封面/banner 上/cover_n.png' import fmcol2 from '../static/mainPage/封面/banner 上/cober_n1.png' import fmcol3 from '../static/mainPage/封面/banner 上/cover6.png' import fmcol4 from '../static/mainPage/封面/banner 上/cover_n3.png' import fmcol5 from '../static/mainPage/封面/banner 上/adv.png' import fm2col1 from '../static/mainPage/封面/banner 下/cover5.png' import fm2col2 from '../static/mainPage/封面/banner 下/cover4.png' import fm2col3 from '../static/mainPage/封面/banner 下/cover1.png' import fm2col4 from '../static/mainPage/封面/banner 下/cover2.png' import fm2col5 from '../static/mainPage/封面/banner 下/cover3.png' import fmtouxiang from '../static/mainPage/nav/头像.png' import zhibo from '../static/mainPage/container/直播.png' import douzi1 from '../static/mainPage/container/豆子1.png' import douzi2 from '../static/mainPage/container/豆子2.png' import yonghuming from '../static/mainPage/container/用户名.png' import fmbofang from '../static/mainPage/container/播放.png' import qiehuanzuo from '../static/mainPage/container/切换左.png' import qiehuanyou from '../static/mainPage/container/切换.png' import '../css/mainPage/fengmian.scss' class Fengmian extends React.Component{ render() { return( <div id={'Mfengmian'}> <div className={'Mfmrow1'}> <div className={'Mfmcol1'}> <img className={'Mfmrow1top'} src={fmcol1} alt={'fgsfg'}/> <div> <img id={'Mfmtouxiang'} src={fmtouxiang} alt={'kjhkj'}/> <h4>正在直播<img src={zhibo} alt={'hsdfdas'}/></h4> </div> </div> <div className={'Mfmcol2'}> <img className={'Mfmrow1top'} src={fmcol2} alt={'ifdsa'}/> <p>P站美图精选第十二期</p> <p id={'Mfmcol2p'}><img src={yonghuming} alt={'hasdfha'}/>用户名</p> <h4>热门文章</h4> </div> <div className={'Mfmcol3'}> <div id={'Mdouzi'}> <img className={'douzi'} src={douzi1} alt={'asfadsfafds'}/> <img className={'douzi'} src={douzi2} alt={'asfadsfafds'}/> <img className={'douzi'} src={douzi2} alt={'asfadsfafds'}/> <img className={'douzi'} src={douzi2} alt={'asfadsfafds'}/> <img className={'douzi'} src={douzi2} alt={'asfadsfafds'}/> </div> </div> <div className={'Mfmcol4'}> <img className={'Mfmrow1top'} src={fmcol4} alt={'22'}/> <p>东方入眠抄 #6</p> <div id={'Mfmcol4img'}> <img src={qiehuanzuo} alt={'dd'}/> <img id={'Mfmbofang'} src={fmbofang} alt={'dd'}/> <img src={qiehuanyou} alt={'ddd'}/> </div> <h4>音乐</h4> </div> <div className={'Mfmcol5'}> </div> </div> <div className={'Mfmrow2'}> <img src={fm2col1} alt={'ss'}/> <img src={fm2col2} alt={'ss'}/> <img src={fm2col3} alt={'ss'}/> <img src={fm2col4} alt={'ss'}/> <img src={fm2col5} alt={'ss'}/> </div> </div> ); } } export default Fengmian
import { api, LightningElement, wire } from 'lwc'; import getProducts from '@salesforce/apex/GS_ProductMatchesController.getMatches'; import LABEL_Products_To_Combine from '@salesforce/label/c.GS_Products_to_combine' export default class GS_ProductsMatchesList extends LightningElement { @api recordId; products = []; show = false; label = { LABEL_Products_To_Combine } @wire(getProducts, {productId: '$recordId'}) loadProducts(result) { this.products = result.data; if (this.products) { if (this.products.length > 0) { this.show = true; } } } }
/* Description: A Madhav array has the following property: a[0] = a[1] + a[2] = a[3] + a[4] + a[5] = a[6] + a[7] + a[8] + a[9] = ... Complete the function/method that returns true if the given array is a Madhav array, otherwise it returns false. Edge cases: An array of length 0 or 1 should not be considered a Madhav array as there is nothing to compare. */ function isMadhavArray(arr) { if (arr.length <= 2) return false; let i = 1; let counter = 2; while (i < arr.length) { let sum = 0; for (let j = 1; j <= counter; j++, i++) { let num = arr[i]; sum += num; } if (sum !== arr[0]) return false; counter++; } return true; }
enyo.kind({ name: "HermesFileSystem", kind: "enyo.Component", debug: false, events: { onLoginFailed: "" }, create: function() { if (this.debug) this.log(); this.inherited(arguments); this.config = {}; }, isOk: function() { return !!this.config.origin; }, setConfig: function(inConfig) { var self = this; if (this.debug) this.log("config:", this.config, "+", inConfig); this.config = ares.extend(this.config, inConfig); if (this.debug) this.log("=> config:", this.config); }, getConfig: function() { return this.config; }, //* @private _requestDic: { 'GET': {verb: 'GET', handleAs: "text"}, // text means no processing/no transformations, provided the charset is not understandable by the browser. 'PROPFIND': {verb: 'GET', handleAs: "json"}, 'PUT': {verb: 'POST', handleAs: "json"}, 'MKCOL': {verb: 'POST', handleAs: "json"}, 'COPY': {verb: 'POST', handleAs: "json"}, 'MOVE': {verb: 'POST', handleAs: "json"}, 'DELETE': {verb: 'POST', handleAs: "json"} }, //* @private _request: function(inMethod, inNodeId, inParams) { if (this.debug) this.log(inMethod, inNodeId, inParams); if (!this.config.origin) { throw "Service URL not yet defined"; } var url = this.config.origin + this.config.pathname + '/id/' + (inNodeId ? inNodeId : "" ); var method = this._requestDic[inMethod].verb; if (this.debug) this.log(inMethod+"/"+method+": '"+url+"'"); if (this.debug) this.log("params=", inParams); var options = { url: url, method: method, handleAs: this._requestDic[inMethod].handleAs, postBody: inParams && inParams.postBody, contentType: inParams && inParams.contentType, headers: { 'x-http-method-override': inMethod } }; if (inMethod === 'GET') { options.mimeType = 'text/plain; charset=x-user-defined'; } var req = new enyo.Ajax(options); if (inParams && inParams.postBody) { delete inParams.postBody; } req.response(function(inSender, inValue){ if (this.debug) this.log("inValue=", inValue); var node = this.xhrResponse.headers['x-ares-node']; if (this.debug) this.log("x-ares-node:", node); return inValue; }).error(function(inSender, inResponse) { this.error("status="+ inResponse); if (inResponse === 0 && this.notifyFailure) { this.notifyFailure(); } return inResponse ; // for the daisy chain }); return req.go(inParams); }, authorize: function(inAuth, next) { var count = 1; if (inAuth && inAuth.headers && inAuth.headers.authorization) { enyo.bind(this, _authorize)(); } function _authenticate() { if (this.debug) this.log("authenticate(): count:", count); if (count--) { if (this.debug) this.log("authenticate(): authorization:", inAuth.headers.authorization); // POST the Authorization // header/token/credential in a web-form. new enyo.Ajax({ url: this.config.origin + this.config.pathname + '/', method: 'POST', handleAs: 'text' }) .response(this, _authorize) .error(this, _authFailure) .go({ authorization: inAuth.headers.authorization }); } } function _authorize() { // GET the Authorization. This step expects // that the Authorization credentials are // passed as a Cookie set during the // _authenticate() step. if (this.debug) this.log("authorize():"); new enyo.Ajax({ url: this.config.origin + this.config.pathname + '/', method: 'GET' }) .response(this, _authSuccess) .error(this, _authenticate) .go(); } function _authSuccess(inXhr, inValue) { if (this.debug) this.log("authSuccess(): inValue:", inValue); next(null, inValue); } function _authFailure(inXhr, inError) { if (this.debug) this.log("authFailure(): inError:", inError, ", body:", (inXhr.xhrResponse ? inXhr.xhrResponse.body : undefined)); self.doLoginFailed({id: this.config.id}); next(new Error(inError)); } }, propfind: function(inNodeId, inDepth) { return this._request("PROPFIND", inNodeId, {depth: inDepth} /*inParams*/) .response(function(inSender, inValue) { if (this.debug) this.log(inValue); return inValue; }); }, listFiles: function(inFolderId, depth) { return this.propfind(inFolderId, depth) .response(function(inSender, inValue) { return inValue.children; }); }, getFile: function(inFileId) { return this._request("GET", inFileId, null /*inParams*/) .response(function(inSender, inValue) { return { content: inValue }; }); }, putFile: function(inFileId, inContent) { var formData = new enyo.FormData() ; var file = new enyo.Blob([inContent || ''], {type: "application/octet-stream"}); if (this.debug) this.log("file:", file); // ['/path','.'] resolves to '/path', so using '.' // keeps the file name encoded in inFileId formData.append('file', file, '.' /*filename*/); if (enyo.platform.firefox) { // FormData#append() lacks the third parameter // 'filename', so emulate it using a list of // 'filename'fields of the same size os the // number of files. This only works if the // other end of the tip is implemented on // server-side. // http://stackoverflow.com/questions/6664967/how-to-give-a-blob-uploaded-as-formdata-a-file-name formData.append('filename', "." ); } return this._request("PUT", inFileId, {postBody: formData} /*inParams*/); }, createFile: function(inFolderId, inName, inContent) { var formData = new enyo.FormData() ; var file = new enyo.Blob([inContent || ''], {type: "application/octet-stream"}); if (this.debug) this.log("file:", file, "filename:", inName); formData.append('file', file, inName /*filename*/); if (enyo.platform.firefox) { // FormData#append() lacks the third parameter // 'filename', so emulate it using a list of // 'filename'fields of the same size os the // number of files. This only works if the // other end of the tip is implemented on // server-side. // http://stackoverflow.com/questions/6664967/how-to-give-a-blob-uploaded-as-formdata-a-file-name formData.append('filename', inName ); } return this._request("PUT", inFolderId, {postBody: formData} /*inParams*/); }, createFiles: function(inFolderId, inData) { return this._request("PUT", inFolderId, {postBody: inData.content, contentType: inData.ctype} /*inParams*/); }, createFolder: function(inFolderId, inName) { var newFolder = inFolderId + "/" + inName; return this._request("MKCOL", inFolderId, {name: inName} /*inParams*/) .response(function(inSender, inResponse) { if (this.debug) this.log(inResponse); return inResponse; }); }, remove: function(inNodeId) { return this._request("DELETE", inNodeId, null /*inParams*/); }, rename: function(inNodeId, inNewName) { return this._request("MOVE", inNodeId, {name: inNewName} /*inParams*/); }, copy: function(inNodeId, inNewName) { return this._request("COPY", inNodeId, {name: inNewName} /*inParams*/); }, exportAs: function(inNodeId, inDepth) { return this._request("GET", inNodeId, {depth: inDepth, format: "base64"} /*inParams*/) .response(function(inSender, inValue) { if (this.debug) this.log(inValue); return inValue; }); } });
const express = require('express'); const router = express.Router(); const track = require('../service/track'); // GET /tracks/search?query={query}&before={before}&count={count} router.get('/search', (req, res) => { const before = parseInt(req.query.before) || Number.MAX_SAFE_INTEGER; const count = parseInt(req.query.count) || 10; const query = req.query.query; if(query === null || query === '') { res.status(412).json({}); return; } track.findQueryAll(query, before, count) .then((data) => { res.status(200).json(data); return; }) .catch((e) => { res.status(500).json({}); return; }); }); // POST /tracks/:id/like router.post('/:id/like', (req, res) => { const trackId = parseInt(req.params.id); const userId = parseInt(req.session.userId); if(trackId === null || trackId === '') { res.status(412).json({}); return; } track.addLike(trackId, userId) .then((data) => { if(data === null) { res.status(404).json({}); return; } res.status(204).json({}); return; }) .catch((e) => { res.status(500).json({}); return;}); }); // POST /tracks/:id/unlike router.post('/:id/unlike', (req, res) => { const trackId = parseInt(req.params.id); const userId = req.session.userId; if(trackId === null || trackId === '') { res.status(412).json({}); return; } track.deleteLike(trackId, userId) .then((data) => { if(data === null) { res.status(404).json({}); return; } res.status(204).json({}); return; }) .catch((e) => { res.status(500).json({}); return; }); }); module.exports = router;
/* -- Modules -- */ // Essential var eventEmmiter = require('events').EventEmitter; var util = require("util"); var fs = require('fs'); var path = require('path'); var os = require('os'); // SMTP Mail Handling var SMTPServer = require('smtp-server').SMTPServer; var Processor = require('./processor'); var Attachment = require('./attachment'); // Utilities var async = require('async'); var _ = require('lodash'); // ID Generation var crypto = require('crypto'); var shortId = require('shortid'); /* -- ------- -- */ // /* -------------- Module Human description -------------- */ /* Incoming module will map all incoming connection to the specified port (SMTP - 25 Unless stated otherwise) and provide raw and processed data (in form of an object) through an event based API. Mails have three different states and events (connection, stream, mail) which can be programmed to do almost all the functions a mail server would require. There will be additions to functions of each in this module in each version but they will mostly be opt-in additions rather than opt-out. */ /* -------------- ------------------------ -------------- */ // // ** OLD DATA -> REQUIRES UPDATE /* * Performance (Lightweight server - Tier 1 Connection - 0.5GB RAM) ---------------- * Inbound Mail (Gmail to Server): 3-4 seconds * Inbound Mail (Hotmail to Server): 2-3 seconds * Inbound Mail (Google Apps Mail to Server): 2-3 seconds * Inbound Mail (Server to Server): TO BE TESTED - estimate: 3-4 seconds Note: Includes parsing time ---------------- */ /* Start the SMTP server. */ var Incoming = function (environment) { this.environment = environment; eventEmmiter.call(this); } util.inherits(Incoming, eventEmmiter); Incoming.prototype.listen = function (port, databaseConnection, Spamc) { var _this = this; var ProcessMail = Processor(this, databaseConnection, Spamc); var ServerConfig = { size: 20971520, // MAX 20MB Message banner: "Galleon MailServer <" + (_this.environment.domain || 'galleon.email') + ">", name: (_this.environment.domain), disabledCommands: ["AUTH"], // INCOMING SMTP is open to all without AUTH logger: false, // Disable Debug logs /* Add option for this in config */ onData: function (stream, session, callback) { // Create a new connection eID session.eID = shortId.generate() + '&&' + crypto.createHash('md5').update(session.id || "NONE").digest('hex'); session.path = undefined; _this.environment.modulator.launch('incoming-connection', session, function (error, _session, _block) { if (_this.environment.verbose) console.log("CONNECTION MODULES LAUNCHED".green, arguments); if (_.isObject(_session)) session = _session; // Ignore email if requested by 'incoming-connection' modules // Otherwise Process Stream if (_block === true) { _this.emit('blocked', session); callback({ responseCode: 451, message: "Request Blocked" }); } else { _this.emit('connection', session); /* Add FS EXISTS Check */ // Tell Processor to Store RAW if env path is set session.store = _.has(_this.environment, 'paths.raw'); // Set Connection path session.path = (_.has(_this.environment, 'paths.raw')) ? path.resolve(_this.environment.paths.raw, session.eID) : path.resolve(os.tmpdir(), session.eID); ProcessMail(stream, session, callback); } }); } }; if ((_this.environment.ssl.use) && (_this.environment.ssl.incoming) && (_this.environment.ssl.incoming.key) && (_this.environment.ssl.incoming.cert)) { try { ServerConfig.key = fs.readFileSync(_this.environment.ssl.incoming.key, 'utf8'); ServerConfig.cert = fs.readFileSync(_this.environment.ssl.incoming.cert, 'utf8'); ServerConfig.ca = fs.readFileSync(_this.environment.ssl.incoming.ca, 'utf8'); if (_this.environment.verbose) console.log("USING KEY", _this.environment.ssl.incoming); } catch (e) { if (_this.environment.verbose) console.log("FAILED TO START INCOMING SSL\nFALLING BACK."); ServerConfig.key = null; ServerConfig.cert = null; ServerConfig.ca = null; } } var server = new SMTPServer(ServerConfig); server.listen(port, null, function () { if (_this.environment.verbose) console.log("SMTP SERVER LISTENING ON PORT", port); }); server.on('error', function (error) { if (_this.environment.verbose) console.log('SMTP-SERVER-ERROR::%s', error.message); }) _this.emit("ready", server); }; Incoming.prototype.attach = function (databaseConnection, eID, attachments) { if ((!this.environment.paths) || (!this.environment.paths.attachments)) return; Attachment.save(this.environment.paths.attachments, databaseConnection, eID, attachments); } module.exports = Incoming;
// @flow // This file builds a "symbol"-tree from a JavaScript file. import { type ArrowFunctionExpression, type CommentBlock, type ClassMethod, type FunctionExpression, type FunctionDeclaration, type InterfaceDeclaration, type Node, type VariableDeclaration, type VariableDeclarator, isArrowFunctionExpression, isAssignmentPattern, isExpressionStatement, isClassDeclaration, isClassExpression, isClassMethod, isIdentifer, isMemberExpression, isFunctionDeclaration, SourceLocation, isScope, isClassProperty, isFunctionExpression, isExportDefaultDeclaration, isExportNamedDeclaration, isCallExpression, isRestElement, isVariableDeclarator, isObjectExpression, isAssignmentExpression, isReturnStatement, } from "@babel/types"; import * as parser from "@babel/parser"; import traverse, {type NodePath} from "@babel/traverse"; import type { DocType, Param, Return, } from "@webdoc/types"; import extract from "./extract"; import {type Doc} from "@webdoc/types"; import {parserLogger, tag} from "./Logger"; // Resolve the initialization literal for the variable function resolveInit(node: VariableDeclarator): Node { // Example: const ClassName = exports.ClassName = class ClassName {} if (isAssignmentExpression(node.init)) { return resolveInit(node.init); } return node.init; } // Resolve the returned symbol for a function expression with a body function resolveReturn(callee: FunctionExpression | ArrowFunctionExpression): ?string { // Example: function () { const Symbol = class {}; return Symbol; } if (callee.body && callee.body.body) { const body = callee.body.body; const lastStatement = body[body.length - 1]; if (isReturnStatement(lastStatement) && lastStatement.argument && lastStatement.argument.name) { return lastStatement.argument.name; } } } // Ignore symbol when building doc-tree export const PASS_THROUGH = 1 << 0; // Any members must be ignored and not be included in the doc-tree. These are usually skipped // in the AST as well. (For example, properties/variables initialized to some value) export const OBLIGATE_LEAF = 1 << 1; // Symbol is "virtual" & created by the generator for its own purpose. These symbols are not // reported to the SymbolParser! export const VIRTUAL = 1 << 2; // Symbol is a interim format that holds the context+comment of a documentation. export type Symbol = { node: ?Node, name: string, flags: number, path: string[], comment: string, parent: ?Symbol, children: Symbol[], loc: SourceLocation, doc?: ?Doc, options?: any, meta: { access?: string, dataType?: string, extends?: string, implements?: string, params?: Param[], returns?: Return[], scope?: string, type?: DocType } }; function isPassThrough(symbol: Symbol): boolean { return symbol.flags & PASS_THROUGH; } function isObligateLeaf(symbol: Symbol): boolean { return symbol.flags & OBLIGATE_LEAF; } function isVirtual(symbol: Symbol): boolean { return symbol.flags & VIRTUAL; } // Exported for testing in test/build-symbol-tree.test.js export const SymbolUtils = { // Adds "symbol" as a child to "parent", possibly merging it with an existing symbol. The // returned symbol need not be the same as "symbol". addChild(doc: Symbol, scope: Symbol): Symbol { const {children} = scope; let index = -1; // Replace symbols when it has the same location but a different node. This occurs // when the Node for a comment is found (the symbol being replaced was headless). for (let i = 0; i < scope.children.length; i++) { const child = children[i]; if (SymbolUtils.areEqualLoc(child, doc)) { children[i] = doc; index = i; break; } if (child.name && child.name === doc.name) { return SymbolUtils.coalescePair(child, doc); } } // Coalesce Symbols when they refer to the same Node with different names if (index === -1 && doc.node && !isVirtual(doc)) { for (let i = 0; i < scope.children.length; i++) { const child = children[i]; if (child === doc) { parserLogger.error(tag.PartialParser, "Same partial doc being added twice"); } if (child.node === doc.node) { child.comment += `\n\n${doc.comment}`; child.children.push(...doc.children); return child; } } } // Append if new child symbol if (index === -1) { children.push(doc); } // if (!isVirtual(doc)) { doc.parent = scope; doc.path = [...scope.path, doc.name]; // } else { // doc.parent = scope; // doc.path = [...scope.path]; // } return doc; }, // Coalesce "pair" into "symbol" because they refer to the same symbol (by name) coalescePair(symbol: Symbol, pair: Symbol): Symbol { const children = symbol.children; const comment = symbol.comment; const flags = symbol.flags; symbol.children.push(...pair.children); Object.assign(symbol, pair); symbol.comment = comment || pair.comment; symbol.children = children; symbol.flags = symbol.flags ? symbol.flags | pair.flags : pair.flags; symbol.meta = Object.assign(symbol.meta, pair.meta); // Horizontal transfer of children for (let i = 0; i < pair.children.length; i++) { pair.children[i].parent = symbol; } return symbol; }, areEqualLoc(doc1: Symbol, doc2: Symbol): boolean { return doc1.loc.start && doc2.loc.start && doc1.loc.start.line === doc2.loc.start.line; }, hasLoc(sym: Symbol): boolean { return typeof sym.loc.start !== "undefined" && sym.loc.start !== null; }, commentIndex(comments: CommentBlock): number { for (let i = comments.length - 1; i >= 0; i--) { if (comments[i].value.startsWith("*") || comments[i].value.startsWith("!")) { return i; } } // Just try the leading comment return comments.length - 1; }, createModuleSymbol(): Symbol { return { node: null, name: "File", flags: 0, path: [], comment: "", parent: null, children: [], loc: {start: 0, end: 0}, }; }, createHeadlessSymbol(comment: string, loc: SourceLocation, scope: Symbol): Symbol { return { node: null, name: "", flags: 0, path: [...scope.path, ""], comment, parent: scope, children: [], loc: loc || {}, }; }, }; const babelPlugins = [ "asyncGenerators", "bigInt", "classPrivateMethods", "classPrivateProperties", "classProperties", "doExpressions", "dynamicImport", "exportDefaultFrom", "flow", "flowComments", "functionBind", "functionSent", "importMeta", "jsx", "logicalAssignment", "nullishCoalescingOperator", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "optionalChaining", "throwExpressions", ]; // These vistiors kind of "fix" the leadingComments by moving them in front of the intended // AST node. const extraVistors = { // Move comments before variable-declaration to infront of the declared identifer if // there are no inline comments. VariableDeclaration(nodePath: NodePath): void { const node: VariableDeclaration = (nodePath.node : any); if (node.leadingComments && node.declarations && node.declarations.length && !node.declarations[0].leadingComments ) { node.declarations[0].leadingComments = node.leadingComments; node.leadingComments = []; } }, }; // Parses the file and returns a tree of symbols export default function buildSymbolTree(file: string, fileName?: string): Symbol { const module: Symbol = SymbolUtils.createModuleSymbol(); let ast; try { ast = parser.parse(file, { plugins: [...babelPlugins], sourceType: "module", errorRecovery: true, }); } catch (e) { console.error("Babel couldn't parse file in @webdoc/parser/parse.js#partial"); throw e; } const ancestorStack: Symbol[] = [module]; traverse(ast, { enter(nodePath: NodePath) { const node = nodePath.node; if (extraVistors.hasOwnProperty(node.type)) { // eslint-disable-line no-prototype-builtins extraVistors[node.type](nodePath); } // Make exports transparent if (node.leadingComments && (isExportNamedDeclaration(node) || isExportDefaultDeclaration(node)) && node.declaration) { const declaration = nodePath.node.declaration; declaration.leadingComments = declaration.leadingComments || []; declaration.leadingComments.push(...node.leadingComments); // Prevent ghost docs node.leadingComments = []; } const scope = ancestorStack[ancestorStack.length - 1]; let idoc; try { idoc = captureSymbols(nodePath.node, scope); } catch (e) { console.error(ancestorStack); console.log(node); console.error(ancestorStack.map((symbol) => symbol.name + `@{${symbol.comment}}[${symbol.node ? symbol.node.type : "Headless"}]`)); throw e; } if (idoc) { if (!isVirtual(idoc) && !idoc.node) { console.log(node); console.log(idoc); throw new Error("WTF"); } ancestorStack.push(idoc); } }, exit(nodePath: NodePath) { const currentPardoc = ancestorStack[ancestorStack.length - 1]; if (currentPardoc && currentPardoc.node === nodePath.node) { ancestorStack.pop(); // Delete PASS_THROUGH flagged partial-docs & lift up their children. if (isVirtual(currentPardoc)) { const parentPardoc: Symbol = (currentPardoc.parent: any); parentPardoc.children.splice(parentPardoc.children.indexOf(currentPardoc), 1); // parentPardoc.children.push(...currentPardoc.children); for (let i = 0; i < currentPardoc.children.length; i++) { SymbolUtils.addChild(currentPardoc.children[i], parentPardoc); // currentPardoc.children[i].parent = parentPardoc; } } } }, }); // The only ancestor left should be the module-symbol. if (ancestorStack.length > 1) { console.error(ancestorStack); console.error(ancestorStack.map((symbol) => symbol.name + `@{${symbol.comment}}[${symbol.node ? symbol.node.type : "Headless"}]`)); throw new Error("@webdoc/parser failed to correctly finish the symbol-tree."); } return module; } // Finds all the documented symbols (including headless documentation blocks) near this node. function captureSymbols(node: Node, parent: Symbol): ?Symbol { let name = ""; let flags = 0; let init; let initComment; let isInit = false; let nodeSymbol: ?Symbol = {meta: {}}; let nodeDocIndex; if (isClassMethod(node) && node.kind === "method") { // classMethod() {} name = node.key.name; nodeSymbol.meta.access = node.access; nodeSymbol.meta.scope = node.static ? "static" : "instance"; nodeSymbol.meta.type = "MethodDoc"; } else if (isClassProperty(node) || (isClassMethod(node) && (node.kind === "get" || node.kind === "set"))) { // classProperty = "value"; // get classProperty() { return "value"; } name = node.key.name; nodeSymbol.meta.access = node.access; nodeSymbol.meta.scope = node.static ? "static" : "instance"; nodeSymbol.meta.type = "PropertyDoc"; } else if (isClassDeclaration(node) || isClassExpression(node)) { // class ClassName {} name = node.id ? node.id.name : ""; nodeSymbol.meta.type = "ClassDoc"; } else if (isFunctionDeclaration(node)) { // function functionName() name = node.id ? node.id.name : ""; nodeSymbol.meta.type = "FunctionDoc"; } else if ( isVariableDeclarator(node) || (isExpressionStatement(node) && isMemberExpression(node.expression.left)) ) { if (isExpressionStatement(node)) { name = node.expression.left.property.name; } else if (isVariableDeclarator(node)) { name = node.id.name; } init = isExpressionStatement(node) && isMemberExpression(node.expression.left) ? node.expression.right : resolveInit(node); if (isClassExpression(init) || isFunctionExpression(init) || (isCallExpression(init) && (isFunctionExpression(init.callee) || isArrowFunctionExpression(init.callee)))) { flags |= PASS_THROUGH | VIRTUAL; isInit = true; } else if (!isObjectExpression(init)) { flags |= OBLIGATE_LEAF; } } else if (parent && isVirtual(parent) && isCallExpression(node) && (isFunctionExpression(node.callee) || isArrowFunctionExpression(node.callee))) { flags |= VIRTUAL; const callee = node.callee; const returnedSymbol = resolveReturn(callee); if (returnedSymbol) { isInit = true; initComment = parent.comment || " "; name = returnedSymbol; } } if (initComment || (node.leadingComments && node.leadingComments.length > 0)) { if (!initComment) { nodeDocIndex = SymbolUtils.commentIndex(node.leadingComments); } const nodeDoc = typeof nodeDocIndex === "number" ? node.leadingComments[nodeDocIndex] : null; const comment = initComment || extract(nodeDoc) || ""; const leadingComments = node.leadingComments || []; // Does user want to document as a property? Then remove PASS_THROUGH flag if ((flags & VIRTUAL) && comment.indexOf("@property") !== -1) { flags &= ~VIRTUAL; } if (comment && ((flags & VIRTUAL) === 0)) { nodeSymbol = Object.assign({ node, name, flags, path: [...parent.path, name], comment, parent: parent, children: [], loc: nodeDoc ? nodeDoc.loc : {}, }, nodeSymbol); nodeSymbol = SymbolUtils.addChild(nodeSymbol, parent); } else if (comment && isInit) { nodeSymbol = Object.assign({ node, name: "", flags, comment: "", path: [...parent.path], parent: parent, children: [{ node: init, name, flags: 0, comment, parent: parent, children: [], path: [...parent.path, name], loc: nodeDoc ? nodeDoc.loc : {}, options: { object: node.expression ? node.expression.left.object.name : undefined, }, meta: {}, }], loc: nodeDoc ? nodeDoc.loc : {}, virtual: true, }, nodeSymbol); nodeSymbol = SymbolUtils.addChild(nodeSymbol, parent); } else { nodeSymbol = null; } for (let i = 0; i < leadingComments.length; i++) { if (i === nodeDocIndex) { continue; } const comment = extract(leadingComments[i]); if (!comment) { continue; } SymbolUtils.addChild( SymbolUtils.createHeadlessSymbol(comment, leadingComments[i].loc, parent), parent); } } else if (isScope(node) && name) { // Create a "virtual" doc so that documented children can be added. @prune will delete it // in the prune doctree-mod. nodeSymbol = Object.assign({ node, name, flags, path: [...parent.path, name], comment: "", parent: parent, children: [], loc: node.loc, }, nodeSymbol); nodeSymbol = SymbolUtils.addChild(nodeSymbol, parent); } else { nodeSymbol = undefined; } const innerComments = node.innerComments; const trailingComments = node.trailingComments; if (nodeSymbol && innerComments) { innerComments.forEach((comment) => { const doc = extract(comment); if (doc) { // $FlowFixMe SymbolUtils.addChild( SymbolUtils.createHeadlessSymbol(doc, comment.loc, nodeSymbol), nodeSymbol); } }); } if (trailingComments) { // trailing comments re-occur if they "lead" a node afterward. SymbolUtils.addChild will // replace. trailingComments.forEach((comment) => { const doc = extract(comment); if (doc) { const tsym = SymbolUtils.createHeadlessSymbol(doc, comment.loc, parent); SymbolUtils.addChild(tsym, parent); } }); } return nodeSymbol; } // Extract all the parameter-data from the method/function AST node function extractParams(node: ClassMethod | FunctionDeclaration | FunctionExpression): Param[] { if (!node.params) { return []; } const params: Param[] = []; for (let i = 0; i < node.params.length; i++) { const paramNode = node.params[i]; // TODO: Infer types if (isIdentifer(paramNode)) { params.push({ identifer: paramNode.name, optional: paramNode.optional || false, }); } else if (isRestElement(paramNode)) { params.push({ identifer: paramNode.argument.name, optional: paramNode.optional || false, variadic: true, }); } else if (isAssignmentPattern(paramNode)) { params.push({ identifer: paramNode.left.name, optional: paramNode.optional || false, default: paramNode.right.raw, }); } else if (isObjectExpression(paramNode)) { // TODO: Find a way to document {x, y, z} parameters // e.g. function ({x, y, z}), you would need to give the object pattern an anonymous like // "", " ", " ", " " or using &zwnj; because it is truly invisible console.error("Object patterns as parameters can't be documented"); } else { console.error("Parameter node couldn't be parsed"); } } return params; }
"use strict"; /*global alert: true, ODSA */ (function ($) { $(document).ready(function () { var arr_size = 10, initData, inputData, jsavArr, jsavInputPos, exercise, task; // settings for the AV var settings = new JSAV.utils.Settings($(".jsavsettings")); // create a JSAV instance var jsav = new JSAV($(".avcontainer"), {settings: settings}); jsav.recorded(); // setup used for hashing. changing the probe and hashfunction functions, this // exercise should be easily modifiable to other collision resolution methods // and hashfunctions var Setup = { probe: function (i) { return i; }, hashfunction: function (val) { return val % arr_size; } }; // end setup function randomizeData() { var initValues = JSAV.utils.rand.numKey(7, 8), // some randomization on size initArr = [], randMod, randVal, inspos, i, j, valVals, deletions = [], input = []; initArr.length = arr_size; // insert initial data to the hashtable while (initValues > 0) { randMod = JSAV.utils.rand.numKey(0, arr_size - 1); // the index we target valVals = JSAV.utils.rand.numKey(2, 4); // how many values with that modulo inspos = randMod; i = 0; for (j = 0; j < valVals; j++) { while (initArr[inspos]) { // find the right position to insert the value i++; inspos = Setup.hashfunction(randMod + Setup.probe(i)); } // randomize the value for the given mod randMod randVal = JSAV.utils.rand.numKey(10, 99) * 10 + randMod; while (initArr.indexOf(randVal) !== -1) { // make sure not to have duplicates randVal = JSAV.utils.rand.numKey(10, 99) * 10 + randMod; } initArr[inspos] = randVal; initValues--; } deletions.push(initArr[inspos]); // add the last item with this module to the list of items to be deleted } for (i = 0; i < deletions.length; i++) { // add the deletions to the required operations input.push(["delete", deletions[i]]); } // add some insertions input.push(["insert", JSAV.utils.rand.numKey(10, 99) * 10 + Setup.hashfunction(deletions[0])]); input.push(["insert", JSAV.utils.rand.numKey(10, 99) * 10 + Setup.hashfunction(deletions[1])]); input.push(["insert", deletions[1] + JSAV.utils.rand.numKey(0, 29)]); // check which values have not been deleted from the hashtable already var values = $.map(initArr, function (item) { return (deletions.indexOf(item) !== -1) ? null : item; }); // .. and delete all the initial values still in hashtable for (i = 0; i < values.length; i++) { input.push(["delete", values[i]]); } // .. and finish with a couple of random inserts input.push(["insert", JSAV.utils.rand.numKey(100, 999)]); input.push(["insert", JSAV.utils.rand.numKey(100, 999)]); // return the data return {array: initArr, input: input }; } function init() { if (jsavArr) { // remove existing array and variables jsavArr.clear(); task.element.remove(); jsavInputPos.element.remove(); } jsav.end(); jsav.displayInit(); // remove old animation initData = randomizeData(); // Log inital state of the exercise var exInitData = {}; exInitData.gen_array = initData.array; exInitData.gen_input = initData.input; ODSA.AV.logExerciseInit(exInitData); inputData = initData.input; task = jsav.label((inputData[0][0] === "delete" ? "Delete key ":"Insert key ") + inputData[0][1]); jsavArr = jsav.ds.array(initData.array, {indexed: true}); jsavInputPos = jsav.variable(0); jsavArr.click(clickHandler); return [jsavArr, jsavInputPos]; } function fixState(modelStructures) { var inputPos = modelStructures[1], modelArr = modelStructures[0], size = modelArr.size(); jsavInputPos.value(inputPos.value()); for (var i = 0; i < size; i++) { var val = modelArr.value(i), bgColor = modelArr.css(i, "background-color"); if (jsavArr.css(i, "background-color") !== bgColor) { // fix background color jsavArr.css(i, {"background-color": bgColor}); } if (val !== jsavArr.value(i)) { // fix values jsavArr.value(i, val); } } updateStepTask(); } function model(modeljsav) { var modelArr = modeljsav.ds.array(initData.array, {indexed: true}), inputPos = modeljsav.variable(0); modeljsav.displayInit(); for (var i = 0, l = inputData.length; i < l; i++) { var inputElem = inputData[i], val = inputElem[1], probeIndex = 0, pos = Setup.hashfunction(val + Setup.probe(probeIndex)); modelArr.highlight(pos); modeljsav.umsg((inputElem[0] === "delete" ? "Deleting key " : "Inserting key ") + val + ". We start by inspecting index " + pos + "."); if (inputElem[0] === "delete") { while (modelArr.value(pos) !== val && modelArr.value(pos) !== "") { modeljsav.stepOption("grade", true); modeljsav.step(); probeIndex++; pos = Setup.hashfunction(val + Setup.probe(probeIndex)); modeljsav.umsg("Since it is not " + inputElem[1] + ", continue to index " + pos + "."); modelArr.highlight(pos); } if (probeIndex > 0) { modeljsav.step(); } modeljsav.umsg("Found the key we are looking for. Delete and mark it with a tombstone."); modelArr.value(pos, "[del]"); } else { // insert while (modelArr.value(pos) !== "[del]" && modelArr.value(pos) !== "") { probeIndex++; pos = Setup.hashfunction(val + Setup.probe(probeIndex)); modeljsav.umsg("Since it is taken, continue to " + pos); modelArr.highlight(pos); modeljsav.step(); } if (modelArr.value(pos) === "") { modeljsav.umsg("The index is empty, so we insert the key."); } else { // has value [del] modeljsav.umsg("The index contains a tombstone, so we insert the key."); } modelArr.value(pos, val); } inputPos.value(i + 1); modelArr.unhighlight(); modeljsav.stepOption("grade", true); modeljsav.step(); } return [modelArr, inputPos]; } exercise = jsav.exercise(model, init, { compare: [{css: "background-color"}, {}], controls: $('.jsavexercisecontrols'), fix: fixState }); exercise.reset(); function updateStepTask() { var pos = jsavInputPos.value(); if (pos < inputData.length) { task.text((inputData[pos][0] === "delete" ? "Delete key ":"Insert key ") + inputData[pos][1]); } else { task.text("No more input"); } } function clickHandler(index) { var pos = jsavInputPos.value(), input = inputData[pos]; if (input[0] === "delete") { if (jsavArr.value(index) !== input[1]) { jsavArr.highlight(index); } else { jsavArr.unhighlight(true); jsavArr.value(index, "[del]"); jsavInputPos.value(pos + 1); } } else { jsavArr.value(index, input[1]); jsavInputPos.value(pos + 1); } updateStepTask(); exercise.gradeableStep(); } function about() { alert("Hashing Proficiency Exercise\nWritten by Ville Karavirta\nCreated as part of the OpenDSA hypertextbook project\nFor more information, see http://opendsa.org.\nSource and development history available at\nhttps://github.com/cashaffer/OpenDSA\nCompiled with JSAV library version " + JSAV.version()); } $(function () { $("#about").click(about); }); }); }(jQuery));
import { call, put, all } from 'redux-saga/effects'; import { templateActions } from 'ducks'; export function* getSomething(action) { try { yield put(templateActions.receiveSomthing(action.response)); } catch (e) {} }
export const data = { name: 'Achievement', bg: '/img/bg/bg-wood.jpg', image: '/img/brand/sunrise.png', icons: ['/img/brand/react.png', '/img/brand/hybris.png', '/img/brand/aem.png'], title: 'Project in focus: <a href="http://sunrise.ch" target="_blank">Sunrise.ch</a>', text: 'React App :: Hybris rest Api :: Adobe Experience Manager' }; export default data;
'use strict'; const express = require('express'); const router = express.Router(); const productsSchema = require('../models/products-schema.js'); const Model = require('../models/model.js'); const ProductsModel = new Model(productsSchema); /** * This route gives you a list of all products * @route GET /products * @group products * @returns {object} 200 - An array of products objects */ router.get('/', (req, res, next) => { console.log('attempting to get products'); next(); }, async (req, res) => { let results = await ProductsModel.readByQuery({}); res.send(results); }); /** * This route creates a new product * @route POST /products * @group products * @returns {object} 201 - The new product object */ router.post('/', async (req, res) => { let newProduct = await ProductsModel.create(req.body); res.status(201); res.send(newProduct); }); /** * This route updates a product * @route PUT /products/:id * @group products * @param {number} id.params.required - id of the field you want to update * @returns {object} 200 - The updated product object */ router.put('/:id', async (req, res) => { let updatedRecord = await ProductsModel.update(req.params.id, req.body); res.status(200); res.send(updatedRecord) }); /** * This route deletes a product * @route DELETE /products/:id * @group products * @param {number} id.params.required - id of the field you want to delete * @returns {object} 200 - HTML tags with a success message */ router.delete('/:id', async (req, res) => { let deletedRecord = await ProductsModel.delete(req.params.id); res.status(200); res.send(`<h3>successfully deleted product ${req.params.id}</h3>`); }); module.exports = router;
angular.module('myApp').directive('tmbDropdown', function() { return { restrict: 'AE', templateUrl: 'tmbDropdown.tmpl.html', controller: function($scope) { console.log('hello'); $scope.items = [{ text: 'thing a', style: { 'background-image': 'url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M26.67%209.38c-.779.35-1.63.58-2.51.69.9-.54%201.6-1.4%201.92-2.42-.85.5-1.78.87-2.78%201.06-.8-.85-1.94-1.38-3.19-1.38-2.42%200-4.379%201.96-4.379%204.38%200%20.34.04.68.11%201-3.64-.18-6.86-1.93-9.02-4.57-.38.65-.59%201.4-.59%202.2%200%201.52.77%202.86%201.95%203.64-.72-.02-1.39-.22-1.98-.55v.06c0%202.12%201.51%203.89%203.51%204.29-.37.1-.75.149-1.15.149-.28%200-.56-.029-.82-.08.56%201.74%202.17%203%204.09%203.041-1.5%201.17-3.39%201.869-5.44%201.869-.35%200-.7-.02-1.04-.06%201.94%201.239%204.24%201.97%206.71%201.97%208.049%200%2012.45-6.67%2012.45-12.45l-.01-.57c.839-.619%201.579-1.389%202.169-2.269z%22%2F%3E%3C%2Fsvg%3E")', 'background-color': 'red', }, active: true, }, { text: 'thing b', style: { 'background-image': 'url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M22.439%2010.95h4v-4.95h-4c-3.311%200-6%202.92-6%206.5v2.5h-4v4.97h4v12.03h5v-12.03h5v-4.97h-5v-2.55c0-.86.532-1.5%201-1.5z%22%2F%3E%3C%2Fsvg%3E")', 'background-color': 'green', }, }]; $scope.isVisable = false; $scope.click = function(item) { $scope.setItemActive(item); }; $scope.setItemActive = function (soonToBeActiveItem) { ($scope.getActiveItem()).active = false; soonToBeActiveItem.active = true; $scope.isVisable = false; }; $scope.getActiveItem = function () { var activeItem; $scope.items.forEach(function (eachItem) { if (eachItem.active) { activeItem = eachItem; } }); return activeItem; } $scope.toggleDropdownState = function () { $scope.isVisable = !$scope.isVisable; }; } }; });
import React, { Component } from 'react'; import Head from 'next/head'; import Link from 'next/link'; import styled from 'styled-components'; import { AddCircle, FingerPrint } from 'grommet-icons'; import { Grommet, Responsive, Box, Heading, Text, Anchor } from 'grommet'; import { WidthCappedContainer } from './WidthCappedContainer'; import { name, repository } from '../package.json'; const FlexNav = styled.nav` display: flex; `; const PlainAnchor = styled.a` cursor: pointer; text-decoration: none; `; const UnderlinedAnchor = styled(Anchor)` text-decoration: underline; `; const BoldAnchor = styled(PlainAnchor)` font-weight: bold; text-decoration: underline; `; class Layout extends Component { state = { responsiveState: 'wide', sourceCodeUrl: repository, } async componentWillMount() { if (this.state.sourceCodeUrl !== repository) return; let sourceCodeUrl; // rendering server-side? if (process && process.env.NOW_URL) { const [, appId] = process.env.NOW_URL.match(/([a-z0-9]+)\.now/); sourceCodeUrl = `//${name}-${appId}.now.sh/_src`; } else { const res = await fetch('/code-url'); sourceCodeUrl = await res.json(); } if (!sourceCodeUrl) return; this.setState({ sourceCodeUrl }); } componentDidMount() { window.scrollTo(0, 0); } onResponsiveChange = (responsiveState) => { this.setState({ responsiveState }); } render() { const { title, children } = this.props; const { responsiveState, sourceCodeUrl } = this.state; return ([ <Head key='Head'> <title>{ title || 'Immutable Pastebin' }</title> </Head>, <Grommet key='Grommet' theme={{ global: { colors: { brand: '#69B8D6' } } }}> <Responsive onChange={this.onResponsiveChange}> <header> <Box background={{ dark: true, image: '#69B8D6' }} direction='row' justify='end' align='center' pad={{ horizontal: 'large' }} > <WidthCappedContainer justify={responsiveState === 'wide' ? 'space-between' : 'center'} direction='row'> {responsiveState === 'wide' && <Heading> <Link href='/'> <PlainAnchor> Pastebin </PlainAnchor> </Link> </Heading>} <FlexNav> <Box align='center' direction='row'> <Box align='start' direction='row' pad='small' margin={{ right: 'medium' }}> <Box margin={{ right: 'small' }}> <Link href='/create'> <BoldAnchor> Create </BoldAnchor> </Link> </Box> <AddCircle /> </Box> <Box align='start' direction='row' pad='small'> <Box margin={{ right: 'small' }}> <Link href='/verify'> <BoldAnchor> Verify </BoldAnchor> </Link> </Box> <FingerPrint /> </Box> </Box> </FlexNav> </WidthCappedContainer> </Box> </header> </Responsive> <main> <Box pad='large' margin={{ bottom: 'medium' }}> <WidthCappedContainer> { children } </WidthCappedContainer> </Box> </main> <footer> <Box background='#444444' direction='column' justify='start' margin='none' > <Box direction='row' align='start' pad={{ vertical: 'medium' }} justify='between' margin={{ horizontal: 'large' }} > <WidthCappedContainer size='xlarge' direction='row' justify='space-between'> <Text margin='none'> © 2017 Luke Plaster.&nbsp; MIT Licensed. </Text> {responsiveState === 'wide' ? ( <Text margin='none'> <UnderlinedAnchor href={sourceCodeUrl} target='_blank'> Source Code </UnderlinedAnchor> </Text>) : null} </WidthCappedContainer> </Box> </Box> </footer> </Grommet>, ]); } } export default Layout;
export function render(ctx, dx, dy, scale) { const { width, height } = ctx.canvas; ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, width, height); ctx.setTransform(scale, 0, 0, scale, dx, dy); fillBox(10, 10, 20, "red"); fillBox(40, 40, 100, "blue"); fillBox(300, 70, 150, "green"); fillBox(120, 300, 200, "orange"); fillBox(400, 350, 60, "purple"); function fillBox(dx, dy, size, color) { ctx.fillStyle = color; ctx.fillRect(dx, dy, size, size); } }
import React, {Component} from 'react'; import TextField from 'material-ui/TextField'; import Context from './Context'; import LeafNode from './LeafNode'; import {Card, CardText} from 'material-ui/Card'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import ContentAdd from 'material-ui/svg-icons/content/add'; import ContentClear from 'material-ui/svg-icons/content/clear'; // ParentNode needs to know: // whether "text" exists aka whether it was generated as a result of a choice prior // children and their types class ParentNode extends Component { constructor(props) { super(props); this.handleChoiceChange = this.handleChoiceChange.bind(this); this.handleCreateChoice = this.handleCreateChoice.bind(this); this.handleDeleteChoice = this.handleDeleteChoice.bind(this); this.handleDeleteParent = this.handleDeleteParent.bind(this); this.handleDeleteTree = this.handleDeleteTree.bind(this); } handleChoiceChange(event, newValue) { this.props.onChoiceChange(newValue, this.props.path, this.props.articleNum, this.props.treeNum); } handleCreateChoice() { this.props.onCreateChoice(this.props.path, this.props.articleNum, this.props.treeNum); } handleDeleteChoice() { this.props.onDeleteChoice(this.props.path, this.props.articleNum, this.props.treeNum); } handleDeleteParent() { this.props.onDeleteParent(this.props.path, this.props.articleNum, this.props.treeNum); } handleDeleteTree() { this.props.onDeleteTree(this.props.articleNum, this.props.treeNum); } render() { const content = this.props.content; const text = content.text; const prompt = content.context.prompt; const path = this.props.path; const moreThanOneChoice = this.props.numChoices > 1; // TODO: it would be better if key was not dependent on order, but rather // each node created and saved its on unique key upon 'will mount' // but may be overkill for this project const children = content.choices.map((child, order) => { if (child.choices) { // TODO: for some reason when you indent before <ParentNode the node no longer is returned... return <ParentNode onPromptChange={this.props.onPromptChange} onChoiceChange={this.props.onChoiceChange} onCreateChoice={this.props.onCreateChoice} onDeleteChoice={this.props.onDeleteChoice} onDeleteParent={this.props.onDeleteParent} key={path.concat(order)} path={path.concat(order)} content={child} articleNum={this.props.articleNum} treeNum={this.props.treeNum} numChoices={this.props.content.choices.length} onBranch={this.props.onBranch} />; } return <LeafNode onChoiceChange={this.props.onChoiceChange} onDeleteChoice={this.props.onDeleteChoice} key={path.concat(order)} path={path.concat(order)} content={child} articleNum={this.props.articleNum} treeNum={this.props.treeNum} numChoices={this.props.content.choices.length} onBranch={this.props.onBranch} />; }); return ( <div className="parent-node-wrapper"> {!this.props.isRoot && <Card> <div className="parent-close-button"> {moreThanOneChoice && <FloatingActionButton mini={true} onTouchTap={this.handleDeleteChoice} style={{"margin": "4px"}} > <ContentClear /> </FloatingActionButton>} </div> <CardText> <TextField value={text} floatingLabelText="Choice" multiLine={true} onChange={this.handleChoiceChange} /> </CardText> </Card> } <div> {!this.props.isRoot && <div className="delete-parent-button"> <FloatingActionButton mini={true} onTouchTap={this.handleDeleteParent} style={{"margin": "4px"}} > <ContentClear /> </FloatingActionButton> </div>} {this.props.isRoot && this.props.numTrees > 1 && <div className="delete-parent-button"> <FloatingActionButton mini={true} onTouchTap={this.handleDeleteTree} style={{"margin": "4px"}} > <ContentClear /> </FloatingActionButton> </div>} <div className="tree-level-wrapper"> <Context onPromptChange={this.props.onPromptChange} path={path} prompt={prompt} articleNum={this.props.articleNum} treeNum={this.props.treeNum} /> {children} <div className="create-child"> <FloatingActionButton onTouchTap={this.handleCreateChoice} style={{"marginTop": "10px"}} > <ContentAdd /> </FloatingActionButton> </div> </div> </div> </div> ); } } export default ParentNode;
{ "meta": { "tours": { "1": 1, "2": 5, "3": 3, "4": 7 }, "cached": true, "leading": [ [ { "event": "global.space", "action": "next-slide" } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38615/CouVWhPq2EBtEQsp.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38619/8YjbPoxLWe5QPYB9.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38623/sE3LiBLAimuGUgvt.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38627/9kuZ0hAE7sLSNrSq.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38631/W17MrbbTd4IaTKjc.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38635/CTXbRXVaELi237H2.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38639/8llxAaYAKVDLY3sG.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38616/SHu2rbaFs9StPVHn.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38620/4k8PWo4fINYiWPkQ.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38624/mJYxYPpxOgUFgZTM.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38628/RgdASfjMtRJcUCvQ.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38632/wrPa1DTFoIPIN73y.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38636/pmbUWkiwuxJsz14D.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38640/VTGtNnbwK3UQWOHp.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer_start.mp3" ] }, { "event": "timeout", "delay": 40000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/60.mp3" ] }, { "event": "timeout", "delay": 80000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/20.mp3" ] }, { "event": "timeout", "delay": 89000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/10.mp3" ] }, { "event": "timeout", "delay": 105000, "action": "next-slide" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38617/DF14JTj6aQqBiQdo.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38618/DvM0y8Ix4Oh8T4c6.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38621/3PRYWqxtu5ZtKIUW.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38622/HoYrkxMPTTt2FRrR.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38625/63xQfqetbrJEzgXb.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38626/ktQUjVTzCNRF1gIi.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38629/v2NazfsHWwzHvabp.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38630/KLT3RlAqybiG8Tmp.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38633/cjlHPqUXaWRHvc3X.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38634/RdyNffyTQAorv7js.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38637/MKy173Ovr2COJC9f.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38638/uBMP8V0ws6BDSmwh.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38641/0aWDv43rBGxlWPGu.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38642/YiECiatc14TVPTx5.mp3" ] } ], [], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38643/zEBRmveuaTZ1iX8r.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38647/2VtwiqmMyAokath9.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38651/WSWucZB5SqRsbsJZ.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38655/Tna9jfqbwe61nEj1.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38659/HURB7FSZtmkeHX4X.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38663/oTMeKwbBeCaPCn7N.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38667/KovCn9Ou1eLyUw7j.mp3" ] }, { "event": "audioend", "action": "start-timer" }, { "event": "start-timer", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer-25.mp3" ] }, { "event": "end-timer", "action": "delay-action", "params": [ 3000, [ "next-slide" ] ] } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38644/zQtGhJWX08EenYw4.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38648/cPFd5tnUfh9mBXu4.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38652/YghawOs7CDuleAC0.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38656/IA2gliu81bn1oZjc.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38660/t3tTeg4JJGZQJ26Y.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38664/pdlGRzFPJjZQgSFi.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38668/9LxQuz87VmvSKrhF.mp3" ] }, { "event": "audioend", "action": "delay-action", "params": [ 2000, [ "next-slide" ] ] } ], [ { "event": "start", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer_start.mp3" ] }, { "event": "timeout", "delay": 40000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/60.mp3" ] }, { "event": "timeout", "delay": 80000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/20.mp3" ] }, { "event": "timeout", "delay": 89000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/10.mp3" ] }, { "event": "timeout", "delay": 105000, "action": "next-slide" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38645/Zky4H75G9l6BrOsx.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38646/oguwvkhWu1dcEdhq.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38649/tzNgMsFa1j8zbvbi.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38650/4sH15hmUzlsWv5RB.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38653/Cxbzu3d6LFK6nlIl.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38654/99dIOVWU2ZMVed0i.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38657/24c9HEXXJyjPFfmK.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38658/d5MbRPDDuMCXDoSM.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38661/gb2EcsJ5JJSKsapW.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38662/LvkgLWxyki2mlKze.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38665/CZ08gFJGjI0yrzfl.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38666/BryuE3qf8QnpZOvV.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38669/nq021hV0zp1LUyJu.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38670/ooaz7yza2bU09faO.mp3" ] } ], [], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38671/SuZJMFlfTPCOLYam.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38674/gSSbpiBRiicHh95l.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38677/NpviuTLojW8AeZOt.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38682/DDWuNQXPdZO9rb95.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38685/9Xrga67V0O16tZXt.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38688/rK4nwn2wgedAh54Q.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38691/xA2KDuVEAwbechz9.mp3" ] }, { "event": "start", "action": "space" } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "space" }, { "event": "start", "action": "start-timer" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "start", "action": "space" }, { "event": "timeout", "delay": 14285.714285714286, "action": "space" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38672/hjQFErD4wP4nLT3X.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38673/FMelGPADcynelO3D.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38675/hqgepTHR0wSCMnGw.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38676/pwEGD6MQwIOnvOah.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38679/CNdWNrlcVjuCXSfR.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38680/NfIjViYZMFJfyfcn.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38683/JU4xYsDMdh0uAULR.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38684/iy8Knr3KVaTHn7Mj.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38686/Xig8bWS8WUbf4FTu.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38687/DezYWzPsn72eWzP2.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38689/nI4hVV7nsmgM8ShC.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38690/a6CRxGyskVXmf1F7.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38692/kowtVwd8XOB3wLAc.mp3" ], "after": [ { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38693/K1XatSrVaFOXP529.mp3" ] }, { "event": "timeout", "delay": 10000, "action": "space" } ] }, { "event": "audioend", "once": true, "action": "space" } ], [], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "videoend", "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38694/6HZyJWUxYKr5MY9y.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38697/QNWI2OTMLm5mTbi2.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38700/3rA1PjuOppwZcB8Y.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38703/Py8SeR8LnCaWmfDk.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38706/GoVt13A0IckmahKp.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38709/qTOFSM2kcdUq2vsk.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38712/ciWfycyaZ9NAbn2y.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer_start.mp3" ] }, { "event": "timeout", "delay": 30000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/20.mp3" ] }, { "event": "timeout", "delay": 39000, "action": "audio", "params": [ "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/leading/timer/10.mp3" ] }, { "event": "timeout", "delay": 55000, "action": "next-slide" } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [ { "event": "start", "action": "play-animation" }, { "event": "space", "action": "next-slide" } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38695/7uw8cTOUhCFTLuqv.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38696/X2P90AvciLkAk7WZ.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38698/GH12G5JJmdE3O1vr.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38699/nC7A51NYhyqmNLmG.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38701/Aozai4CGRjrgD9w5.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38702/uUuYaiiLbsRgZOSr.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38704/l4pWP94W1wm2ghHx.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38705/Db0C8bbIwxxCabSQ.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38707/GnHU7jotkO0Q0YUn.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38708/KHvUIhot0fkDwsWQ.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38710/pezQRWf4G7xU3Hce.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38711/74E8mHqMAAUihMdw.mp3" ] } ], [ { "event": "start", "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38713/gzWwZrAo2Njkqcjf.mp3" ] }, { "event": "audioend", "action": "space" }, { "event": "space", "once": true, "action": "audio", "params": [ "https://mozgo-qiuz-materials.s3.amazonaws.com/38714/NTJ1jUuImd1W8woR.mp3" ] } ], [ { "event": "global.space", "registerAfter": 5000, "action": "next-slide" } ], [] ], "gameBackground": "https://mozgo-qiuz-materials.s3.amazonaws.com/38739/Hmt9ICL0GzNAMI6s.png", "gameStrongFont": "#F8CA00;", "gameType": "Тематическая", "gameTopic": "Знакомства", "questionsCount": { "1": 7, "2": 7, "3": 7, "4": 7 }, "questionTimer": 25, "blitzTimer": 100, "blitzTimerMedia": "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/100.mp3", "party_game_type": "default" }, "slides": [ { "id": "123689cd-1b44-4163-86ad-5a8bfffcded2", "type": "video-slide", "properties": { "background": "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/start.png" }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "36ab78fa-f3a9-4412-9379-d3eb8bf84740", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38716/doY3BYVSRHkVqqj6.mp4" }, "settings": { "type": "click_play", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "bf6959b9-c271-4bdb-acf1-312455e3f355", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38720/JghUEXzlOM4crZf1.mp4" }, "settings": { "type": "click_play", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "6a71660b-ac60-4a3f-acd5-9e4a081ed57f", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38721/obGUBevqU8tA3rc6.mp4" }, "settings": { "type": "click_play", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "1_question_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38722/CcZSoKHj4xwA1AS0.mp4" }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "6f912ed5-eecf-4677-af23-35416356fd6a", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "12649-question", "type": "question", "properties": { "text": { "text": "*В&nbsp;тесноте и&nbsp;неполной темноте колыхающейся кареты Наташа в&nbsp;первый раз живо представила себе то, что ожидает ее&nbsp;там, на&nbsp;бале, в&nbsp;освещенных залах, –&nbsp;музыка, цветы, танцы, государь, вся блестящая молодежь Петербурга.*\n\nКакая **фамилия** у&nbsp;девушки? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "question" }, "tour": 1, "slide": 1, "hasTimer": true }, { "id": "12647-question", "type": "question", "properties": { "text": { "text": "Министерство сельского хозяйства и&nbsp;продовольствия Канады описало 91&nbsp;аромат, который может присутствовать в&nbsp;этом **продукте**. Ароматы делятся на&nbsp;13&nbsp;подвидов, среди них есть ванильные, фруктовые, цветочные, пряные, кондитерские, древесные. Какому канадскому **продукту** принадлежат ароматы? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "question" }, "tour": 1, "slide": 2, "hasTimer": true }, { "id": "12368-question", "type": "question", "properties": { "text": { "text": "В&nbsp;XIX веке технология требовала длительной выдержки, поэтому в&nbsp;ходе этого распространенного ныне **действия** непоседливым детям нередко давали опиумное успокоительное. Что за&nbsp;**действие**? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 104, "answer_font": 162 }, "type": "question" }, "tour": 1, "slide": 3, "hasTimer": true }, { "id": "10352-question", "type": "question", "properties": { "text": { "text": "Нильс Бор был одним из&nbsp;самых известных датских ученых в&nbsp;мире, и&nbsp;соотечественники постоянно заваливали его подарками. Дальше всех пошла знаменитая **компания** с&nbsp;его родины. Она подарила Нильсу дом с&nbsp;краном, по&nbsp;которому поступала пенная продукция. Какая **компания**? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "question" }, "tour": 1, "slide": 4, "hasTimer": true }, { "id": "12670-question", "type": "question", "properties": { "text": { "text": "У&nbsp;страховых компаний по&nbsp;всему миру популярна услуга защиты от&nbsp;**существ**, которые вводят в&nbsp;ступор миллионы людей. Очевидцы рассказывают, что переезжали жить на&nbsp;**их** транспортное средство и&nbsp;видели следы **их** деятельности на&nbsp;фермерских угодьях. От&nbsp;**кого** страхуют компании? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "question" }, "tour": 1, "slide": 5, "hasTimer": true }, { "id": "12637-question", "type": "question", "properties": { "text": { "text": "Психолог из&nbsp;Британии Сатоси Канадзава подсчитал, что с&nbsp;каждыми дополнительными 15&nbsp;баллами в&nbsp;показателе IQ&nbsp;это **желание** женщины снижается на&nbsp;25%. В&nbsp;целом из&nbsp;этого факта можно сделать вывод, что с&nbsp;течением времени человечество глупеет. О&nbsp;каком **желании** речь? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "question" }, "tour": 1, "slide": 6, "hasTimer": true }, { "id": "12671-question", "type": "question", "properties": { "text": { "text": "Один лысеющий мужчина сделал себе креативную татуировку в&nbsp;виде **работника**, использующего специальное оборудование. Судя по&nbsp;тому, что мужчина все же&nbsp;имеет свои волосы, **герою** тату придется работать еще какое-то время. **Кто** изображен на&nbsp;татуировке? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "question" }, "tour": 1, "slide": 7, "hasTimer": true }, { "id": "1_repeat_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38723/cHE6xKoWdjnbIzNQ.mp4" }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "9ec174e8-0788-4cb5-8773-b2f687590920", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "12649-repeat", "type": "question", "properties": { "text": { "text": "*В&nbsp;тесноте и&nbsp;неполной темноте колыхающейся кареты Наташа в&nbsp;первый раз живо представила себе то, что ожидает ее&nbsp;там, на&nbsp;бале, в&nbsp;освещенных залах, –&nbsp;музыка, цветы, танцы, государь, вся блестящая молодежь Петербурга.*\n\nКакая **фамилия** у&nbsp;девушки? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "repeat" }, "tour": 1, "slide": 1, "hasTimer": false }, { "id": "12647-repeat", "type": "question", "properties": { "text": { "text": "Министерство сельского хозяйства и&nbsp;продовольствия Канады описало 91&nbsp;аромат, который может присутствовать в&nbsp;этом **продукте**. Ароматы делятся на&nbsp;13&nbsp;подвидов, среди них есть ванильные, фруктовые, цветочные, пряные, кондитерские, древесные. Какому канадскому **продукту** принадлежат ароматы? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "repeat" }, "tour": 1, "slide": 2, "hasTimer": false }, { "id": "12368-repeat", "type": "question", "properties": { "text": { "text": "В&nbsp;XIX веке технология требовала длительной выдержки, поэтому в&nbsp;ходе этого распространенного ныне **действия** непоседливым детям нередко давали опиумное успокоительное. Что за&nbsp;**действие**? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 104, "answer_font": 162 }, "type": "repeat" }, "tour": 1, "slide": 3, "hasTimer": false }, { "id": "10352-repeat", "type": "question", "properties": { "text": { "text": "Нильс Бор был одним из&nbsp;самых известных датских ученых в&nbsp;мире, и&nbsp;соотечественники постоянно заваливали его подарками. Дальше всех пошла знаменитая **компания** с&nbsp;его родины. Она подарила Нильсу дом с&nbsp;краном, по&nbsp;которому поступала пенная продукция. Какая **компания**? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "repeat" }, "tour": 1, "slide": 4, "hasTimer": false }, { "id": "12670-repeat", "type": "question", "properties": { "text": { "text": "У&nbsp;страховых компаний по&nbsp;всему миру популярна услуга защиты от&nbsp;**существ**, которые вводят в&nbsp;ступор миллионы людей. Очевидцы рассказывают, что переезжали жить на&nbsp;**их** транспортное средство и&nbsp;видели следы **их** деятельности на&nbsp;фермерских угодьях. От&nbsp;**кого** страхуют компании? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "repeat" }, "tour": 1, "slide": 5, "hasTimer": false }, { "id": "12637-repeat", "type": "question", "properties": { "text": { "text": "Психолог из&nbsp;Британии Сатоси Канадзава подсчитал, что с&nbsp;каждыми дополнительными 15&nbsp;баллами в&nbsp;показателе IQ&nbsp;это **желание** женщины снижается на&nbsp;25%. В&nbsp;целом из&nbsp;этого факта можно сделать вывод, что с&nbsp;течением времени человечество глупеет. О&nbsp;каком **желании** речь? " }, "markup": { "left_font": 84, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "repeat" }, "tour": 1, "slide": 6, "hasTimer": false }, { "id": "12671-repeat", "type": "question", "properties": { "text": { "text": "Один лысеющий мужчина сделал себе креативную татуировку в&nbsp;виде **работника**, использующего специальное оборудование. Судя по&nbsp;тому, что мужчина все же&nbsp;имеет свои волосы, **герою** тату придется работать еще какое-то время. **Кто** изображен на&nbsp;татуировке? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 88, "answer_font": 162 }, "type": "repeat" }, "tour": 1, "slide": 7, "hasTimer": false }, { "id": "timer-1", "type": "slide-timer", "properties": { "seconds": 100, "sound": "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/100.mp3" }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "1_answer_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38724/4JuL9QorOrZGvyAr.mp4" }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "2f4ba0eb-967f-481b-a12c-17b049c0d9b5", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 1, "slide": 0, "hasTimer": false }, { "id": "12649-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "На&nbsp;бал собирается героиня романа «Война и&nbsp;мир» " }, "textAnswer": { "text": "Наташа Ростова " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37460/lM3FCmAIh33Jn3zB.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 1, "slide": 1, "hasTimer": false }, { "id": "12647-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Министерство сельского хозяйства и&nbsp;продовольствия Канады описало 91&nbsp;аромат, который может присутствовать " }, "textAnswer": { "text": "в&nbsp;кленовом сиропе " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37363/awxZNNHkKZyXWPZl.jpg", "markup": { "left_font": 72, "left_width": 835, "answer_font": 162, "right_width": 835 }, "type": "answer" }, "tour": 1, "slide": 2, "hasTimer": false }, { "id": "12368-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "В&nbsp;XIX веке непоседливым детям давали опиумное успокоительное во&nbsp;время " }, "textAnswer": { "text": "фотографирования " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37414/O2BoophPhUDM5jrG.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 72, "answer_font": 182 }, "type": "answer" }, "tour": 1, "slide": 3, "hasTimer": false }, { "id": "10352-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Датчанин Нильс Бор получил дом с&nbsp;краном, из&nbsp;которого текло пиво компании " }, "textAnswer": { "text": "Carlsberg " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/28961/QJvrjtW4bxNozIqn.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 76, "answer_font": 186 }, "type": "answer" }, "tour": 1, "slide": 4, "hasTimer": false }, { "id": "12670-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "У&nbsp;страховых компаний популярна услуга защиты от" }, "textAnswer": { "text": "инопланетян " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37497/f9gZfOP5LhDR6FFU.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 84, "answer_font": 186 }, "type": "answer" }, "tour": 1, "slide": 5, "hasTimer": false }, { "id": "12637-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Психолог подсчитал, что с&nbsp;каждыми дополнительными 15&nbsp;баллами IQ&nbsp;у&nbsp;женщины снижается желание " }, "textAnswer": { "text": "иметь детей " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37312/4hNbggAYGnGy2d1d.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 60, "answer_font": 186 }, "type": "answer" }, "tour": 1, "slide": 6, "hasTimer": false }, { "id": "12671-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Мужчина сделал татуировку на&nbsp;своей лысеющей голове в&nbsp;виде " }, "textAnswer": { "text": "газонокосильщика " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37498/bbOqUzocCHyA1ll3.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 72, "answer_font": 186 }, "type": "answer" }, "tour": 1, "slide": 7, "hasTimer": false }, { "id": "f088401e-8a3c-4690-a959-f97f48e60d78", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38725/EfprrMtvDlfJNXdo.mp4" }, "settings": { "type": "3_seconds_skip", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "2_question_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38726/uUWMZZSVnzTluqaU.mp4" }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "86cda5d2-5a3a-4c0b-9ae4-6650429274fc", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "12653-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "С&nbsp;чем борется подразделение, имеющее такую нашивку? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37420/emUUWAFE354BIGTX.jpg", "type": "question", "markup": { "left_font": 92, "left_width": 670, "answer_font": 90, "right_width": 1000 } }, "tour": 2, "slide": 1, "hasTimer": true }, { "id": "12635-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какая достопримечательность? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37310/oB722InucsnMtRXO.jpg", "type": "question", "markup": { "left_width": 670, "right_width": 1000, "left_font": 60, "answer_font": 90 } }, "tour": 2, "slide": 2, "hasTimer": true }, { "id": "12534-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Обложка альбома какого исполнителя? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/36988/EmZOCTFvpMD2z6xP.jpg", "type": "question", "markup": { "left_font": 92, "left_width": 670, "answer_font": 90, "right_width": 1000 } }, "tour": 2, "slide": 3, "hasTimer": true }, { "id": "12654-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Фрагмент какой картины?\n\n(+1 балл за&nbsp;фамилию художника) " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37447/kZXKyRQr85Xo5fDs.jpg", "type": "question", "markup": { "left_width": 670, "right_width": 1000, "left_font": 68, "answer_font": 90 } }, "tour": 2, "slide": 4, "hasTimer": true }, { "id": "12672-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какую страну представили в&nbsp;виде человека? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37499/SCx9gAwERMLrgqTK.jpg", "type": "question", "markup": { "left_width": 670, "right_width": 1000, "left_font": 100, "answer_font": 90 } }, "tour": 2, "slide": 5, "hasTimer": true }, { "id": "12203-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Скриншот статьи на&nbsp;«Википедии» о&nbsp;каком человеке? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/35222/z4bJfMPhnjnh1FZe.jpg", "type": "question", "markup": { "left_width": 670, "right_width": 1000, "left_font": 76, "answer_font": 90 } }, "tour": 2, "slide": 6, "hasTimer": true }, { "id": "12630-question", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какому празднику посвящен плакат студии Артемия Лебедева? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37300/9mxBlZxnrwRQ5wqt.jpg", "type": "question", "markup": { "left_width": 670, "right_width": 1000, "left_font": 80, "answer_font": 90 } }, "tour": 2, "slide": 7, "hasTimer": true }, { "id": "2_repeat_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38727/BTUUO3mohnQNJbpB.mp4" }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "8b568917-c0a8-4910-8edb-8666c89908a5", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "12653-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "С&nbsp;чем борется подразделение, имеющее такую нашивку? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37420/emUUWAFE354BIGTX.jpg", "markup": { "left_font": 92, "left_width": 670, "answer_font": 90, "right_width": 1000 }, "type": "repeat" }, "tour": 2, "slide": 1, "hasTimer": false }, { "id": "12635-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какая достопримечательность? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37310/oB722InucsnMtRXO.jpg", "markup": { "left_width": 670, "right_width": 1000, "left_font": 60, "answer_font": 90 }, "type": "repeat" }, "tour": 2, "slide": 2, "hasTimer": false }, { "id": "12534-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Обложка альбома какого исполнителя? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/36988/EmZOCTFvpMD2z6xP.jpg", "markup": { "left_font": 92, "left_width": 670, "answer_font": 90, "right_width": 1000 }, "type": "repeat" }, "tour": 2, "slide": 3, "hasTimer": false }, { "id": "12654-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Фрагмент какой картины?\n\n(+1 балл за&nbsp;фамилию художника) " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37447/kZXKyRQr85Xo5fDs.jpg", "markup": { "left_width": 670, "right_width": 1000, "left_font": 68, "answer_font": 90 }, "type": "repeat" }, "tour": 2, "slide": 4, "hasTimer": false }, { "id": "12672-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какую страну представили в&nbsp;виде человека? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37499/SCx9gAwERMLrgqTK.jpg", "markup": { "left_width": 670, "right_width": 1000, "left_font": 100, "answer_font": 90 }, "type": "repeat" }, "tour": 2, "slide": 5, "hasTimer": false }, { "id": "12203-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Скриншот статьи на&nbsp;«Википедии» о&nbsp;каком человеке? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/35222/z4bJfMPhnjnh1FZe.jpg", "markup": { "left_width": 670, "right_width": 1000, "left_font": 76, "answer_font": 90 }, "type": "repeat" }, "tour": 2, "slide": 6, "hasTimer": false }, { "id": "12630-repeat", "type": "text-and-two-image-answer", "properties": { "half": true, "answer": "", "text": { "text": "Какому празднику посвящен плакат студии Артемия Лебедева? " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37300/9mxBlZxnrwRQ5wqt.jpg", "markup": { "left_width": 670, "right_width": 1000, "left_font": 80, "answer_font": 90 }, "type": "repeat" }, "tour": 2, "slide": 7, "hasTimer": false }, { "id": "timer-2", "type": "slide-timer", "properties": { "seconds": 100, "sound": "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/100.mp3" }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "2_answer_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38728/ZGyxYJwMEsYsOhkU.mp4" }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "9fcf7738-c500-45a5-b815-6fa239571ad1", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 2, "slide": 0, "hasTimer": false }, { "id": "12653-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Нашивка принадлежит американскому сотруднику Управления по&nbsp;борьбе " }, "textAnswer": { "text": "с&nbsp;наркотиками " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37420/emUUWAFE354BIGTX.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/37439/XJv6Wd9lSqYSC0mX.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 76, "answer_font": 182 }, "type": "answer" }, "tour": 2, "slide": 1, "hasTimer": false }, { "id": "12635-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "На&nbsp;фото запечатлено катание на&nbsp;замерзшем " }, "textAnswer": { "text": "Ниагарском водопаде " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37310/oB722InucsnMtRXO.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/37311/oHj0B5wLeRxuFUft.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 76, "answer_font": 170 }, "type": "answer" }, "tour": 2, "slide": 2, "hasTimer": false }, { "id": "12534-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Обложка альбома «2004» рэпера " }, "textAnswer": { "text": "Скриптонита " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/36988/EmZOCTFvpMD2z6xP.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/36706/2m6XYkFx2J2Bc8Jg.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 2, "slide": 3, "hasTimer": false }, { "id": "12654-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Фрагмент картины " }, "textAnswer": { "text": "«Грачи прилетели» Алексея Саврасова " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37447/kZXKyRQr85Xo5fDs.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/37448/iEVdTGmGvuA5mcTa.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 98 }, "type": "answer" }, "tour": 2, "slide": 4, "hasTimer": false }, { "id": "12672-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Очеловечили " }, "textAnswer": { "text": "Новую Зеландию " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37499/SCx9gAwERMLrgqTK.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/37500/xhKayVwYXaSPdDtj.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 2, "slide": 5, "hasTimer": false }, { "id": "12203-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Скриншот статьи про " }, "textAnswer": { "text": "Елизавету II" }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/35222/z4bJfMPhnjnh1FZe.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/35226/UrqVTHWwayH6DZCO.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 2, "slide": 6, "hasTimer": false }, { "id": "12630-answer", "type": "media-switch-in-answer", "properties": { "half": true, "answer": "", "text": { "text": "Плакат посвящен " }, "textAnswer": { "text": "1&nbsp;апреля " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37300/9mxBlZxnrwRQ5wqt.jpg", "secondImage": "https://mozgo-qiuz-materials.s3.amazonaws.com/37301/dwWNmty40VoUW7as.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 2, "slide": 7, "hasTimer": false }, { "id": "bd7fd8bf-a7ed-4d0f-918c-0b994eefaa16", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38729/cQ1dLURFwhLmfBZ0.mp4" }, "settings": { "type": "3_seconds_skip", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "3_question_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38730/8dda42C2hHSn4mKG.mp4" }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "b01cc7aa-0c1b-40d4-b8f8-4b3fcc72ccde", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "12665-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Исполнитель " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37472/KhteONv8bMYlCEkb.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 1, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12644-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Какая группа исполняет кавер? " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37329/3gUgKmvOlJ8ItljQ.mp3", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 90 }, "type": "question" }, "tour": 3, "slide": 2, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12638-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Трейлер какого фильма? " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37321/S5dvgnEnEYpB9di8.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 3, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12688-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Исполнитель\n**[минус]** " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37506/sbvVxMQc1v5V0zfo.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 4, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12663-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Автор слов " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37476/DMr12UI1cynOmyML.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 5, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12634-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Телепередача\n**[reverse]** " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37313/Ogaze9nCPZJYahhg.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 6, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12666-question", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Группа " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37481/J5sgshW5CBWOEVJe.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "question" }, "tour": 3, "slide": 7, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "3_repeat_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38731/Vu1hhyJAif5zCF9n.mp4" }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "1dbe75da-4ca5-4e88-aa04-d9d15dc77f00", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "12665-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Исполнитель " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37473/HZoc7HdUnyHyrMbf.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 1, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12644-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Какая группа исполняет кавер? " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37330/8Frsq4VQGEEShebT.mp3", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 90 }, "type": "repeat" }, "tour": 3, "slide": 2, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12638-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Трейлер какого фильма? " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37322/tq4auVJab9O2cXog.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 3, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12688-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Исполнитель\n**[минус]** " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37507/Pj0UHC6GcBMEONV6.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 4, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12663-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Автор слов " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37477/ZlSEVotp8i4g2DSH.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 5, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12634-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Телепередача\n**[reverse]** " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37314/epGfCJO2qgWF1goX.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 6, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "12666-repeat", "type": "text-and-sounds", "properties": { "answer": "", "icon": true, "autoplay": true, "half": false, "text": { "text": "Группа " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37482/tGMZPAO75TdW0uCf.mp3", "markup": { "left_font": 152, "left_width": 835, "answer_font": 90, "right_width": 835 }, "type": "repeat" }, "tour": 3, "slide": 7, "hasTimer": true, "hasSound": false, "hasRepeat": false }, { "id": "3_answer_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38732/FJmnhoq55LMIbAi2.mp4" }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "8aa879b3-3d68-434f-ad31-f4c1b80e8536", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 3, "slide": 0, "hasTimer": false }, { "id": "12665-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Исполнитель " }, "textAnswer": { "text": "Nicki Minaj " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37474/n3p1dg0zpSzV3OD2.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37484/LvAn8z6DjR54Tc82.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 178 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 1, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12644-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Кавер исполняет группа " }, "textAnswer": { "text": "Korn " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37331/43EL19pfCgJj0iQA.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37333/jwnDwaz8rBNqyktI.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 186 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 2, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12638-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Трейлер фильма " }, "textAnswer": { "text": "Аритмия " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37324/iupa1FOY9A1sdFKQ.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37325/wMykKUUmdfaG731s.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 186 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 3, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12688-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Исполнитель " }, "textAnswer": { "text": "Ray Charles " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37508/GyelP3LbyPRTe0RI.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37510/GyH6y67y9v3kxW15.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 170 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 4, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12663-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Автор слов " }, "textAnswer": { "text": "Анна Ахматова " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37478/sE9S7hnlMWHwuczB.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37485/wosPOBJwiXs7Y4Ax.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 182 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 5, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12634-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Телепередача " }, "textAnswer": { "text": "Угадай мелодию " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37315/rynj60YxPFXm32b8.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37316/3iPltFFlAaOZxCDk.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 174 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 6, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "12666-answer", "type": "text-and-sounds", "properties": { "half": true, "icon": true, "autoplay": true, "answer": "", "text": { "text": "Группа " }, "textAnswer": { "text": "Мираж " }, "sounds": "https://mozgo-qiuz-materials.s3.amazonaws.com/37483/ALMuGnAL38RryM7x.mp3", "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37486/8taAHOoVVKYN93Gi.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 182 }, "type": "answer", "question_growth": true }, "tour": 3, "slide": 7, "hasTimer": false, "hasSound": true, "hasRepeat": false }, { "id": "ac8982e7-5a5f-4574-9909-1c66b7494f85", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38733/KNrgw9kyYHqrQaYN.mp4" }, "settings": { "type": "3_seconds_skip", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "4_question_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38734/2uR3j0SAaxDrvwbz.mp4" }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "b1ad8e26-6ae6-47c6-899f-73470edb997b", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38735/lBJPRyFdPme3NMw4.mp4" }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "15adedbd-33be-4762-bfb6-2f52f083725f", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "12648-question", "type": "question", "properties": { "text": { "text": "Кто написал рассказ \n«Судьба человека»? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 132, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 1, "hasTimer": true }, { "id": "12640-question", "type": "question", "properties": { "text": { "text": "В&nbsp;каком штате родился Форрест Гамп? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 128, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 2, "hasTimer": true }, { "id": "12687-question", "type": "question", "properties": { "text": { "text": "*Кларнет, саксофон, тромбон, дудук.*\n\nКакой музыкальный инструмент не&nbsp;относится к&nbsp;деревянным? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 104, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 3, "hasTimer": true }, { "id": "8916-question", "type": "question", "properties": { "text": { "text": "Какая самая южная по&nbsp;расположению страна выигрывала Чемпионат \nмира по&nbsp;футболу? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 124, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 4, "hasTimer": true }, { "id": "12669-question", "type": "question", "properties": { "text": { "text": "Какое событие произошло 5&nbsp;мая 1821 года? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 128, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 5, "hasTimer": true }, { "id": "12668-question", "type": "question", "properties": { "text": { "text": "К&nbsp;какому классу относятся китообразные? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 128, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 6, "hasTimer": true }, { "id": "8915-question", "type": "question", "properties": { "text": { "text": "Персонажей какого фильма зовут Ник, Стив, Тони и&nbsp;Брюс? " }, "markup": { "left_width": 835, "right_width": 835, "left_font": 120, "answer_font": 162 }, "type": "question" }, "tour": 4, "slide": 7, "hasTimer": true }, { "id": "timer-4", "type": "slide-timer", "properties": { "seconds": 50, "sound": "https://d2e4swo881ck2r.cloudfront.net/mozgo-party/50.mp3" }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "4_answer_before", "type": "video-slide", "settings": { "type": "click_play", "properties": { "link": null } }, "properties": { "out": false, "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38736/XREd6cia9AURY8Rm.mp4" }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "65f31472-b21a-4fff-83d5-99f1677a42af", "type": "tour", "properties": { "out": false, "videoStart": false }, "tour": 4, "slide": 0, "hasTimer": false }, { "id": "12648-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Рассказ «Судьба человека» написал " }, "textAnswer": { "text": "Михаил Шолохов " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37336/dLudwdw47iky1iV1.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 182 }, "type": "answer" }, "tour": 4, "slide": 1, "hasTimer": false }, { "id": "12640-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Форрест Гамп родился в&nbsp;штате " }, "textAnswer": { "text": "Алабама " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37327/RQHGbPfvufyptdRG.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 84, "answer_font": 186 }, "type": "answer" }, "tour": 4, "slide": 2, "hasTimer": false }, { "id": "12687-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "К&nbsp;деревянным духовым инструментам не&nbsp;относится " }, "textAnswer": { "text": "тромбон " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37503/B1MLCIzNiEca4Yxf.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 68, "answer_font": 186 }, "type": "answer" }, "tour": 4, "slide": 3, "hasTimer": false }, { "id": "8916-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Самой южной сборной, выигравшей Чемпионат мира по&nbsp;футболу, была " }, "textAnswer": { "text": "Аргентина " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37323/YL6KfC1tZ1hkExWZ.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 76, "answer_font": 186 }, "type": "answer" }, "tour": 4, "slide": 4, "hasTimer": false }, { "id": "12669-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "5&nbsp;мая 1821 года случилась " }, "textAnswer": { "text": "смерть Наполеона Бонапарта " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37495/uVvQvr0VR5gsV3N6.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 130 }, "type": "answer" }, "tour": 4, "slide": 5, "hasTimer": false }, { "id": "12668-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Китообразные относятся к&nbsp;классу " }, "textAnswer": { "text": "млекопитающие " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37496/FXraLhkFXHYezqE1.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 80, "answer_font": 186 }, "type": "answer" }, "tour": 4, "slide": 6, "hasTimer": false }, { "id": "8915-answer", "type": "media-switch-in-answer-with-question-s-v-g", "properties": { "half": false, "answer": "", "text": { "text": "Ник, Стив, Тони и&nbsp;Брюс –&nbsp;имена персонажей фильма " }, "textAnswer": { "text": "Мстители " }, "image": "https://mozgo-qiuz-materials.s3.amazonaws.com/37319/VJ28pbTq43jWsuen.jpg", "markup": { "left_width": 835, "right_width": 835, "left_font": 64, "answer_font": 186 }, "type": "answer" }, "tour": 4, "slide": 7, "hasTimer": false }, { "id": "427f216d-a8e0-45da-a3ad-1ea8b1cd0041", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38737/PJCRXwCUUFffNnK2.mp4" }, "settings": { "type": "click_play", "properties": { "link": null } }, "tour": 0, "slide": 0, "hasTimer": false }, { "id": "a8d3b118-ae55-4058-af77-50c4f9e3fa02", "type": "video-slide", "properties": { "videoStart": "https://mozgo-qiuz-materials.s3.amazonaws.com/38738/peY1bayilOojG84d.mp4" }, "settings": { "type": "link", "properties": { "link": "party.mozgo.com" } }, "tour": 0, "slide": 0, "hasTimer": false } ], "audio": null }
$(function () { var couponid = +getSearch()['couponid']; $.ajax({ type: 'get', url: "http://" + ip + ":9090/api/getcouponproduct", data: { couponid: couponid }, success: function (info) { console.log(info); $('.mmb_main ul').html(template('tpl1', info)) $('.modal ul').html(template('tpl2', info)) } }) //点击显示模态框 $('.mmb_main ul').on('click', 'li', function () { $('.modal').removeClass('dsn'); //获取img高度赋值给box var height = $('.modal').find('img').height(); var allheight = $('.modal').find('ul').height(); //获取总个数 var num = Math.ceil(allheight / height); $('.modal .img').height(height); //显示第几张 //获取当前的id var id = $(this).data('id'); $('.img ul').css('top', -id * height + 'px') //轮播图效果右键功能 $('.right').on('click', function () { if(id>=num){ return }; $('.img ul').css('top', -(id++ )* height + 'px'); }) //轮播图左键的功能 $('.left').on('click', function () { if(id<=0){ return }; $('.img ul').css('top', -(--id )* height + 'px'); }) }) //点击模态框消失 $(".close").on('click', function () { $('.modal').addClass('dsn'); }) })
function attachGradientEvents() { const gradient = document.getElementById('gradient-box'); const result = document.getElementById('result'); gradient.addEventListener('mousemove', onMove); gradient.addEventListener('mouseout', gradientOut) function onMove(ev) { let perceantage = Math.floor(ev.offsetX / (ev.target.clientWidth - 1) * 100); result.textContent = `${perceantage}%` } function gradientOut(ev) { result.textContent = ''; } }
const wrap = require('co-express') const express = require('express') const apiRouter = express.Router() const ensureLoggedIn = global.rootRequire('app/auth/helpers/ensureLoggedIn.js') const Poll = global.rootRequire('db/models/poll.js') apiRouter.get('/', ensureLoggedIn(), wrap(function * (req, res, next) { const queryResult = yield (Poll.find({ author: req.user.id }).exec()) if (queryResult === null) { yield Promise.reject(new Error('There is no poll for the current user.')) } else { res.status(200).json(queryResult) } })) module.exports = apiRouter
/** * Created by Ziv on 2017/2/2. */ /** * 构造HTML语句 * @constructor */ function HTMLGen() { ['a', 'b', 'p', 'body', 'div', 'span', 'title'].forEach(function (tag) { HTMLGen.prototype[tag] = function (content) { return '<' +tag+ '>' +content+ '</' +tag+ '>' }; }); HTMLGen.prototype.comment = function (content) { return '<!--' + content + '-->'; } } var g = new HTMLGen(); var paragraph = g.p('Hello, World!'); var block = g.div(paragraph); // The following are now true console.log(paragraph === '<p>Hello, World!</p>'); console.log(block === '<div><p>Hello, World!</p></div>');
import "../../Styles/HomePageStyle/Information.css" import React from 'react'; const Information = () => { return ( <div className="Information"> <div className="NetworkInformation"> <a href={'https://www.google.com/maps'}>Rastrea mi pedido</a> <p>PBX: 57 (2) 386 5770</p> <span>Siguenos en <img src={"https://es-la.facebook.com/"} alt="Facebook"></img><img src={"https://www.instagram.com/?hl=es/"} alt="Instagram"></img></span> </div> <div className="Loginbtn"> <button>Inciar Sesion</button> </div> </div> ); }; export default Information;
var userModel = require('../models/UserModel'); var Task = function (task) { this.task = task.task; this.status = task.status; this.created_at = new Date(); }; Task.getUserBy = async function getUserBy(data, result) { var user = await userModel.getUserBy(data); result(user); } Task.getUserMaxCode = async function getUserMaxCode(data, result) { var user = await userModel.getUserMaxCode(data); result(user); } Task.insertUserBy = async function insertUserBy(data, result) { var user = await userModel.insertUserBy(data); result(user); } Task.updateUserByCode = async function updateUserByCode(data, result) { var user = await userModel.updateUserByCode(data); result(user); } Task.deleteUserByCode = async function deleteUserByCode(data, result) { var user = await userModel.deleteUserByCode(data); result(user); } Task.getUserByCode = async function getUserByCode(data, result) { var user = await userModel.getUserByCode(data); result(user); } // Task.getUserLoginBy = async function getUserLoginBy(data, result) { // var user = await userModel.getUserLoginBy(data); // result(user); // } module.exports = Task;
//axios部份 const api = 'https://raw.githubusercontent.com/hexschool/js-training/main/travelApi.json'; //重新塞入innerHTML的ul部份 const elTicketCardArea = document.querySelector('.ticketCard-area'); //console.log(axios); 驗證是否有讀取到axios.js //addTicketCard部分 const eladdTicketForm = document.querySelector('.addTicket-form'); const elTicketName = document.querySelector('#ticketName'); const elTicketImgUrl = document.querySelector('#ticketImgUrl'); const elTicketRegion = document.querySelector('#ticketRegion'); const elTicketPrice = document.querySelector('#ticketPrice'); const elTicketNum = document.querySelector('#ticketNum'); const elTicketRate = document.querySelector('#ticketRate'); const elTicketDescription = document.querySelector('#ticketDescription'); const elAddTicketBtn = document.querySelector('.addTicket-btn'); //搜尋筆數部份 const elRegionSearch = document.querySelector('.regionSearch'); const elSearchResultText = document.querySelector('#searchResult-text'); let myData = [];//宣告主要陣列資料空陣列 //初始化函式抓api的data帶進myData部份 function init() { axios.get(api) .then((res) => { //console.log(res.data.data); //驗證是否回傳 myData = res.data.data; //console.log(myData); //驗證是否回傳 render(myData) renderC3(myData) }); } //渲染套票部份 function render(myData) { let str = ''; myData.forEach((item) => { str += `<li class="ticketCard"> <div class="ticketCard-img"> <a href="#"> <img src="${item.imgUrl}" alt=""> </a> <div class="ticketCard-region">${item.area}</div> <div class="ticketCard-rank">10</div> </div> <div class="ticketCard-content"> <div> <h3> <a href="#" class="ticketCard-name">${item.name}</a> </h3> <p class="ticketCard-description"> ${item.description} </p> </div> <div class="ticketCard-info"> <p class="ticketCard-num"> <span><i class="fas fa-exclamation-circle"></i></span> 剩下最後 <span id="ticketCard-num"> ${item.group} </span> 組 </p> <p class="ticketCard-price"> TWD <span id="ticketCard-price">$${item.price}</span> </p> </div> </div> </li>` }) elTicketCardArea.innerHTML = str;//elTicketCardArea塞入組合字串 }; //新增套票部份 elAddTicketBtn.addEventListener('click', function (e) { e.preventDefault();//取消預設動作 if ( elTicketName.value !== "" &&//套票名稱 elTicketImgUrl.value !== "" &&//圖片網址 elTicketRegion.value !== "" &&//景點地區 elTicketDescription.value !== "" &&//景點描述 parseInt(elTicketRate.value) > 0 &&//型別數字//推薦星級 parseInt(elTicketRate.value) <= 10 &&//型別數字//推薦星級 parseInt(elTicketNum.value) > 0 &&//型別數字//剩餘數量 parseInt(elTicketPrice.value) > 0 &&//型別數字//套票價錢 elTicketDescription.value.length <= 100//景點描述字數 ) { myData.push({//新增物件進myData陣列後方 id: Date.now(), name: elTicketName.value, imgUrl: elTicketImgUrl.value, area: elTicketRegion.value, description: elTicketDescription.value, group: parseInt(elTicketNum.value), price: parseInt(elTicketPrice.value), rate: parseInt(elTicketRate.value), }); render(myData);//執行渲染套票重帶一次myData eladdTicketForm.reset();//新增完畢form就reset清空 } else if (parseInt(elTicketPrice.value) < 0) { alert('價錢請大於0');//跳出警告窗 } else if (parseInt(elTicketNum.value) <= 0) { alert('剩餘組數不可輸入小於0');//跳出警告窗 } else if (parseInt(elTicketRate.value) <= 1 || parseInt(elTicketRate.value) > 10) { alert('推薦星級區間是 1-10 星');//跳出警告窗 } else if (elTicketDescription.value.length > 100) { alert('不可超過100字');//跳出警告窗 } else { alert('所有欄位必填');//跳出警告窗 } }); //搜尋筆數部份 elRegionSearch.addEventListener('change', function (e) {//elRegionSearch如果change就執行 e.preventDefault();//取消預設動作 let filterAry = [];//宣告空陣列 if (elRegionSearch.value !== '') {//如果elRegionSearch.value不等於空字串 filterAry = myData.filter((item) => item.area === elRegionSearch.value);//myData的area等於elRegionSearch.value時,另組成filterAry陣列 render(filterAry);//重新渲染帶入參數 //console.log(filterAry); renderC3(filterAry);//重新渲染帶入參數 //myDataLength = filterAry.length//搜尋'全部地區'部份才不會出錯,因為沒有一個地區叫'全部地區' elSearchResultText.textContent = `本次搜尋共 ${filterAry.length} 筆資料`;//執行elSearchResultText文字替換 } else { render(myData);//重新渲染帶入參數 renderC3(myData)//重新渲染帶入參數 elSearchResultText.textContent = `本次搜尋共 ${myData.length} 筆資料`;//執行elSearchResultText文字替換 } }) init()//執行初始化函式 function renderC3(myData) {//利用搜尋筆數部份下拉選單change時,就重新渲染 let totalObj = {}; myData.forEach((item, index) => { if (totalObj[item.area] === undefined) {//物件totalObj的屬性area為undefined時 totalObj[item.area] = 1;//物件totalObj的屬性area=1 } else { totalObj[item.area] += 1;//物件totalObj的屬性area+1(計算同組數量) } //console.log(totalObj); }) let newData = [];//做成c3 donut格式 [[]] 陣列包陣列 let areaNum = Object.keys(totalObj);//撈出key(物件屬性)做成陣列 才能跑forEach areaNum.forEach((item, index) => {//areaNum陣列跑forEach let ary = [];//做成c3 donut格式 [[]] 陣列包陣列 ary.push(item); ary.push(totalObj[item]); newData.push(ary); console.log(newData); }) let options = { percentageInnerCutout: 10 }; let chart = c3.generate({ bindto: "#chart", data: { columns: newData, type: 'donut', colors: { 台北: '#26C0C7', 台中: '#5151D3', 高雄: '#E68618' } }, donut: { title: "套票地區比重", width: 15,//更改圓弧的寬度 } }); } //表單驗證Validate.js const constraints = { "套票名稱": { presence: { message: "是必填欄位" }, }, "圖片網址": { presence: { message: "是必填欄位" }, url: { schemes: ["http", "https"], message: "必須是正確的網址" } }, "景點地區": { presence: { message: "是必填欄位" }, }, "套票金額": { presence: { message: "是必填欄位" }, numericality: { greaterThan: 0, message: "必須大於 0" } }, "套票組數": { presence: { message: "是必填欄位" }, numericality: { greaterThan: 0, message: "必須大於 0" } }, "套票星級": { presence: { message: "是必填欄位" }, numericality: { greaterThanOrEqualTo: 1, lessThanOrEqualTo: 10, message: "必須符合 1-10 的區間" } }, "套票描述": { presence: { message: "是必填欄位" }, }, } const form = document.querySelector("#addTicket-form"); const inputs = document.querySelectorAll("input[type=text],input[type=number],select,textarea"); inputs.forEach((item) => { item.addEventListener("change", function () { document.querySelector(`[data-message=${item.name}]`).textContent = '';; let errors = validate(form, constraints); //console.log(errors) //呈現在畫面上 if (errors) { Object.keys(errors).forEach(function (keys) { //console.log(keys); document.querySelector(`[data-message=${keys}]`).textContent = errors[keys] }) } }); });
(function () { 'use strict'; angular .module('app') .factory('UserService', UserService); UserService.$inject = ['$http']; function UserService($http) { var service = {}; service.authorize = authorize; service.register = register; service.update = update; service.get = get; return service; function authorize(userEmail, userPassword) { return $http.post('/user/authorize', {email: userEmail, password: userPassword}).then(handleSuccess, handleError('Authorization failed')); } function register(userEmail, userName, userPassword) { return $http.post('/user/register', {email: userEmail, name: userName, password: userPassword}).then(handleSuccess, function(data) { var respMsg; if(data.data.exception == 'javax.validation.ConstraintViolationException') { respMsg = 'Nieprawidłowe hasło. Poprawne hasło to przynajmniej jedna duża, jedna mała litera, jedna liczba oraz jeden znak specjalny (!@#$%^&*)'; } else { respMsg = data.data.message; } return { success: false, message: respMsg } }); } function update(userEmail, userName, userPassword) { return $http.put('/user/update', {email: userEmail, name: userName, password: userPassword}).then(handleSuccess, function(data) { return { success: false, message: data.data.message } }); } function get(userEmail) { return $http.get('/user/get/'+userEmail+'/').then(handleSuccess, handleError('User not found')); } function handleSuccess(res) { return res.data; } function handleError(data) { return function () { return { success: false, message: data }; }; } } })();
require('dotenv').config(); var request = require('request'); const credentials = require('../../utils/Credentials') const authentication = require('../../utils/access_token') const { reject } = require('promise'); const Parallel = require('async-parallel') var roleAssignment; //Array storing the getRoleAssignmentDataFromApi API data //Get Role Assignments Data of a particular subscription from API (PrincipalId,Scope,etc.) async function getRoleAssignmentDataFromApi(req){ try{ var token = req.headers.authorization return new Promise((resolve,reject)=>{ var options = { 'method': 'GET', 'url': `https://management.azure.com/subscriptions/${req.params.subscriptionId}/providers/Microsoft.Authorization/roleAssignments?api-version=2015-07-01`, 'headers': { 'Authorization': `${token}` } } request(options, async function (error, response) { if (!error && response.statusCode === 200){ resolve(JSON.parse(response.body)) }else{ reject({"status":JSON.parse(response.body)}) } }); }) }catch(error) { console.log(error) res.status(404).send({"status": "Error occurred..!!! Please try again."}) } } //Get User Data with user's PrincipalId from Graph API (DisplayName,mail,etc.) async function getUserData(principalId,token){ try{ return new Promise((resolve,reject)=>{ var options = { 'method': 'GET', 'url':`https://graph.microsoft.com/v1.0/users/${principalId}`, 'headers': { 'Authorization': `Bearer ${token}` } } request(options, async function (error, response) { if (!error && response.statusCode === 200){ resolve(JSON.parse(response.body)) }else{ resolve({"service-principal":JSON.parse(response.body)}) } }); }) }catch(error) { console.log(error) res.status(404).send({"status": "Error occurred..!!! Please try again."}) } } //Get User Data with service-principal's PrincipalId from Graph API (DisplayName,mail,etc.) async function getServicePrincipalData(principalId,token){ try{ return new Promise((resolve,reject)=>{ var options = { 'method': 'GET', 'url':`https://graph.microsoft.com/v1.0/servicePrincipals/${principalId}`, 'headers': { 'Authorization': `Bearer ${token}` } } request(options, async function (error, response) { if (!error && response.statusCode === 200){ resolve(JSON.parse(response.body)) }else{ reject({"Error":JSON.parse(response.body)}) } }); }) }catch(error) { console.log(error) res.status(404).send({"status": "Error occurred..!!! Please try again."}) } } //Get RoleAssignment and Token for Graph API async function getToken(req,a3sId){ try{ return new Promise(async (resolve,reject)=>{ await getRoleAssignmentDataFromApi(req).then(async result=>{ if(result.value && (result.value).length>0){ roleAssignment = result.value //roleAssignment await credentials.getcredentials(a3sId).then(async cred=>{ //clientId,clientSecret,tenantId await authentication.clientCredAuthenticationForMsGraphApi(cred).then(token=>{ //token resolve((token).access_token) }).catch(error=>{ reject(error) }) }).catch(error=>{ reject(error) }) }else{ //If roleAssignment.value===[] reject({"status":"No Role Assignments data found in this Subscription!! Please try again..!!!"}) } }).catch(error=>{ console.log("Error occurred: ",error) reject(error) }) }) }catch(error) { console.log(error) res.status(404).send({"status": "Error occurred..!!! Please try again."}) } } //Get Role Assignments List async function listRoleAssignment(req,res){ try{ var a3sId = req.headers.id; var resultant=[] await getToken(req,a3sId).then(async graphApiToken=>{ //token await Parallel.each(roleAssignment,(async function (element){ //forEach loop var elementRoleDefination = element.properties.roleDefinitionId.split("/").pop() var principalId = element.properties.principalId if (principalId && (elementRoleDefination === "b24988ac-6180-42a0-ab88-20f7382dd24c" || elementRoleDefination === "8e3af657-a8ff-443c-a75c-2fe8c4bcb635" || elementRoleDefination === "acdd72a7-3385-48ef-bd42-f606fba81ae7")) { await getUserData(principalId, graphApiToken).then(async userData=>{ var name, email; if(userData["service-principal"]){ //If Error occurs while hitting User's Data API => It's a Service Principle await getServicePrincipalData(principalId,graphApiToken).then(servicePrincipalData=>{ name = servicePrincipalData.displayName email = null //Service Principle don't have email ID }).catch(error=>{ //Error occurred while hitting Service Principle API console.log("Error occurred in getting servicePrincipal data: ",error) }) }else{ name = userData.displayName email = userData.mail } if(elementRoleDefination === "b24988ac-6180-42a0-ab88-20f7382dd24c"){ resultant.push({ "Role":"Contributor", "PrincipalId":principalId, "Name":name, "EmailID":email, "Scope":element.properties.scope }) }else if(elementRoleDefination === "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"){ resultant.push({ "Role":"Owner", "PrincipalId":principalId, "Name":name, "EmailID":email, "Scope":element.properties.scope }) }else if(elementRoleDefination === "acdd72a7-3385-48ef-bd42-f606fba81ae7"){ resultant.push({ "Role":"Reader", "PrincipalId":principalId, "Name":name, "EmailID":email, "Scope":element.properties.scope }) } }).catch(error=>{ //Error occurred while hitting User Data API reject(error) }) } })).then(results=>{ res.send(resultant) }).catch(error=>{ //Error occurred in Parallel.each loop console.log("Error occurred: ",error) res.status(400).send(error) }) }).catch(error=>{ //Error occurred while getting token res.status(401).send(error) }) }catch(error) { //Error occurred in try block console.log(error) res.status(404).send({"status": "Error occurred..!!! Please try again."}) } } module.exports = {listRoleAssignment}
const student = [ {id : 1 , name : 'hasib'}, {id : 2 , name : 'santo'}, {id : 3 , name : 'shiekh'}, {id : 4 , name : 'siam'}, {id : 5 , name : 'masum'} ] // let output = []; // for(let i = 0; i<student.length;i++){ // output.push(student[i].name) // } const names = student.map(s => s.name); const ids = student.map(s => s.id); const bigger = student.filter(s => s.id>3); const biggerOne = student.find(s => s.id>3); console.log(biggerOne);
/*jshint globalstrict:false, strict:false */ /*global assertEqual, assertNotEqual, assertTrue, assertMatch, fail */ //////////////////////////////////////////////////////////////////////////////// /// @brief tests for client/server side transaction invocation /// /// @file /// /// DISCLAIMER /// /// Copyright 2019 ArangoDB GmbH, Cologne, Germany /// /// 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 holder is ArangoDB GmbH, Cologne, Germany /// /// @author Simon Grätzer //////////////////////////////////////////////////////////////////////////////// const jsunity = require("jsunity"); const arangodb = require("@arangodb"); const analyzers = require("@arangodb/analyzers"); const internal = require("internal"); const ERRORS = arangodb.errors; const db = arangodb.db; const qqWithSync = `FOR doc IN UnitTestsView SEARCH ANALYZER(doc.text IN TOKENS('the quick brown', 'myText'), 'myText') OPTIONS { waitForSync : true } SORT TFIDF(doc) LIMIT 4 RETURN doc`; const qq = `FOR doc IN UnitTestsView SEARCH ANALYZER(doc.text IN TOKENS('the quick brown', 'myText'), 'myText') SORT TFIDF(doc) LIMIT 4 RETURN doc`; //////////////////////////////////////////////////////////////////////////////// /// @brief test suite //////////////////////////////////////////////////////////////////////////////// function TransactionsIResearchSuite() { 'use strict'; let c = null; let view = null; return { setUpAll: function() { analyzers.save( "myText", "text", { locale: "en.UTF-8", stopwords: [ ] }, [ "frequency", "norm", "position" ] ); }, //////////////////////////////////////////////////////////////////////////////// /// @brief set up //////////////////////////////////////////////////////////////////////////////// setUp: function () { db._drop('UnitTestsCollection'); c = db._create('UnitTestsCollection'); }, //////////////////////////////////////////////////////////////////////////////// /// @brief tear down //////////////////////////////////////////////////////////////////////////////// tearDown: function () { // we need try...catch here because at least one test drops the collection itself! try { c.unload(); c.drop(); } catch (err) { } c = null; if (view) { view.drop(); view = null; } internal.wait(0.0); }, //////////////////////////////////////////////////////////////////////////// /// @brief should honor rollbacks of inserts //////////////////////////////////////////////////////////////////////////// testRollbackInsertWithLinks1 : function () { let meta = { links: { 'UnitTestsCollection' : { fields: {text: {analyzers: [ "myText" ] } } } } }; view = db._createView("UnitTestsView", "arangosearch", {}); view.properties(meta); let links = view.properties().links; assertNotEqual(links['UnitTestsCollection'], undefined); c.save({ _key: "full", text: "the quick brown fox jumps over the lazy dog" }); c.save({ _key: "half", text: "quick fox over lazy" }); try { db._executeTransaction({ collections: {write: 'UnitTestsCollection'}, action: function() { const db = require('internal').db; c.save({ _key: "other_half", text: "the brown jumps the dog" }); c.save({ _key: "quarter", text: "quick over" }); throw "myerror"; } }); fail(); } catch (err) { assertEqual(err.errorMessage, "myerror"); } let result = db._query(qqWithSync).toArray(); assertEqual(result.length, 2); assertEqual(result[0]._key, 'half'); assertEqual(result[1]._key, 'full'); }, //////////////////////////////////////////////////////////////////////////// /// @brief should honor rollbacks of inserts //////////////////////////////////////////////////////////////////////////// testRollbackInsertWithLinks2 : function () { c.ensureIndex({type: 'hash', fields:['val'], unique: true}); let meta = { links: { 'UnitTestsCollection' : { fields: {text: {analyzers: [ "myText" ] } } } } }; view = db._createView("UnitTestsView", "arangosearch", {}); view.properties(meta); let links = view.properties().links; assertNotEqual(links['UnitTestsCollection'], undefined); db._executeTransaction({ collections: {write: 'UnitTestsCollection'}, action: function() { const db = require('internal').db; c.save({ _key: "full", text: "the quick brown fox jumps over the lazy dog", val: 1 }); c.save({ _key: "half", text: "quick fox over lazy", val: 2 }); c.save({ _key: "other_half", text: "the brown jumps the dog", val: 3 }); try { c.save({ _key: "quarter", text: "quick over", val: 3 }); fail(); } catch(err) { assertEqual(err.errorNum, ERRORS.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code); } } }); let result = db._query(qqWithSync).toArray(); assertEqual(result.length, 3); assertEqual(result[0]._key, 'half'); assertEqual(result[1]._key, 'other_half'); assertEqual(result[2]._key, 'full'); }, //////////////////////////////////////////////////////////////////////////// /// @brief should honor rollbacks of inserts //////////////////////////////////////////////////////////////////////////// testRollbackInsertWithLinks3 : function () { let meta = { links: { 'UnitTestsCollection' : { fields: {text: {analyzers: [ "myText" ] } } } } }; view = db._createView("UnitTestsView", "arangosearch", {}); view.properties(meta); let links = view.properties().links; assertNotEqual(links['UnitTestsCollection'], undefined); c.ensureIndex({type: 'hash', fields:['val'], unique: true}); db._executeTransaction({ collections: {write: 'UnitTestsCollection'}, action: function() { const db = require('internal').db; c.save({ _key: "full", text: "the quick brown fox jumps over the lazy dog", val: 1 }); c.save({ _key: "half", text: "quick fox over lazy", val: 2 }); c.save({ _key: "other_half", text: "the brown jumps the dog", val: 3 }); try { c.save({ _key: "quarter", text: "quick over", val: 3 }); fail(); } catch(err) { assertEqual(err.errorNum, ERRORS.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code); } } }); let result = db._query(qqWithSync).toArray(); assertEqual(result.length, 3); assertEqual(result[0]._key, 'half'); assertEqual(result[1]._key, 'other_half'); assertEqual(result[2]._key, 'full'); }, //////////////////////////////////////////////////////////////////////////// /// @brief should honor rollbacks of inserts //////////////////////////////////////////////////////////////////////////// testRollbackRemovalWithLinks1 : function () { c.ensureIndex({type: 'hash', fields:['val'], unique: true}); let meta = { links: { 'UnitTestsCollection' : { fields: {text: {analyzers: [ "myText" ] } } } } }; view = db._createView("UnitTestsView", "arangosearch", {}); view.properties(meta); let links = view.properties().links; assertNotEqual(links['UnitTestsCollection'], undefined); c.save({ _key: "full", text: "the quick brown fox jumps over the lazy dog", val: 1 }); c.save({ _key: "half", text: "quick fox over lazy", val: 2 }); c.save({ _key: "other_half", text: "the brown jumps the dog", val: 3 }); c.save({ _key: "quarter", text: "quick over", val: 4 }); try { db._executeTransaction({ collections: {write: 'UnitTestsCollection'}, action: function() { const db = require('internal').db; let c = db._collection('UnitTestsCollection'); c.remove("full"); c.remove("half"); c.remove("other_half"); c.remove("quarter"); throw "myerror"; } }); fail(); } catch(err) { assertEqual(err.errorMessage, "myerror"); } let result = db._query(qqWithSync).toArray(); assertEqual(result.length, 4); assertEqual(result[0]._key, 'half'); assertEqual(result[1]._key, 'quarter'); assertEqual(result[2]._key, 'other_half'); assertEqual(result[3]._key, 'full'); }, //////////////////////////////////////////////////////////////////////////// /// @brief should honor rollbacks of inserts //////////////////////////////////////////////////////////////////////////// testWaitForSyncError : function () { c.ensureIndex({type: 'hash', fields:['val'], unique: true}); let meta = { links: { 'UnitTestsCollection' : { fields: {text: {analyzers: [ "myText" ] } } } } }; view = db._createView("UnitTestsView", "arangosearch", {}); view.properties(meta); let links = view.properties().links; assertNotEqual(links['UnitTestsCollection'], undefined); c.save({ _key: "full", text: "the quick brown fox jumps over the lazy dog", val: 1 }); c.save({ _key: "half", text: "quick fox over lazy", val: 2 }); c.save({ _key: "other_half", text: "the brown jumps the dog", val: 3 }); c.save({ _key: "quarter", text: "quick over", val: 4 }); try { db._executeTransaction({ collections: {write: 'UnitTestsCollection'}, action: function() { const db = require('internal').db; let c = db._collection('UnitTestsCollection'); c.remove("full"); c.remove("half"); // it should not be possible to query with waitForSync db._query(qqWithSync); fail(); } }); fail(); } catch(err) { assertEqual(err.errorNum, ERRORS.ERROR_BAD_PARAMETER.code); } let result = db._query(qqWithSync).toArray(); assertEqual(result.length, 4); assertEqual(result[0]._key, 'half'); assertEqual(result[1]._key, 'quarter'); assertEqual(result[2]._key, 'other_half'); assertEqual(result[3]._key, 'full'); } }; } //////////////////////////////////////////////////////////////////////////////// /// @brief executes the test suite //////////////////////////////////////////////////////////////////////////////// jsunity.run(TransactionsIResearchSuite); return jsunity.done();
var app=require('./config/express_partone') //app.use(serveStatic(__dirname+'/first')); app.listen(3000, () => { console.log('server sarted on 3000') });
const express = require('express'); const morgan = require('morgan'); const bodyParser = require('body-parser'); const app = express(); const products = require('./routes/products'); const orders = require('./routes/orders'); app.use(morgan('dev')); app.use(bodyParser.urlencoded({extended: false})); app.use(bodyParser.json()); app.use('/products', products); app.use('/orders', orders); // catch 404 and forward to error handler app.use((req, res, next) => { const error = new Error("Not Found"); error.status = 404; next(error); }); // error handler app.use((error, req, res, next) => { res.status(error.status || 500); res.json({ message: error.message }); }); module.exports = app;
import React, {PureComponent} from 'react'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; export default class ManagementUserDetail extends PureComponent { render () { return ( <div> <PageHeaderLayout> 用户详情 </PageHeaderLayout> </div> ); } }
import React, { Suspense } from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import Header from './components/Header'; import './App.css'; const Home = React.lazy(() => import('./pages/Home')); const About = React.lazy(() => import('./pages/About')); const Services = React.lazy(() => import('./pages/Services')); const Article1 = React.lazy(() => import('./pages/blog/Article1')); const Article2 = React.lazy(() => import('./pages/blog/Article2')); function App() { return ( <div className="App"> <Suspense fallback={<div>Loading...</div>}> <Router> <Header /> <Switch> <Route path="/" exact component={Home} /> <Route path="/about" exact component={About} /> <Route path="/services" exact component={Services} /> <Route path="/blog/article1" exact component={Article1} /> <Route path="/blog/article2" exact component={Article2} /> </Switch> </Router> </Suspense> </div> ); } export default App;
// @flow import type { Action } from 'types/Action'; import { REQUEST, RECEIVE, CANCEL } from 'ducks/actions'; type State = { isLoading: boolean } export default (state: State = { isLoading: false }, action: Action) => { switch (action.type) { case REQUEST: return { isLoading: true }; case RECEIVE: return { isLoading: false }; case CANCEL: return { isLoading: false }; default: return state; } };
import Video from './../Model/video.mjs'; export const getDetailVideo = (data, type) => { if (type === 'movie') { return new Video(data.id, data.original_title, data.media_type, data.overview, data.poster_path); } else if (type === 'tv') { return new Video(data.id, data.original_name, data.media_type, data.overview, data.poster_path); } }; export const getListVideo = data => { return data.map(d => { if (d.media_type === 'movie') { return new Video(d.id, d.original_title, d.media_type); } else if (d.media_type === 'tv') { return new Video(d.id, d.original_name, d.media_type); } }).filter(el => el != null); }; export const getListVideoRecom = (data, type, count = 5) => { return data.map(d => { if (type === 'movie') { return new Video(d.id, d.original_title); } else if (type === 'tv') { return new Video(d.id, d.original_name); } }).filter((el, index) => index < count); };
/** * main repository * @static */ Freja.AssetManager = { models : [], views : [], _username : null, _password : null }; /** * Set to sync to make all requests synchroneous. You shouldn't use * this setting for anything but testing/debugging. * "async" | "sync" */ Freja.AssetManager.HTTP_REQUEST_TYPE = "async"; /** * If this is set to null, real PUT and DELETE http-requests will be made, * otherwise a header will be set instead, and the request tunneled through * POST. * * Both IE6 and FF1.5 are known to support the required HTTP methods, so * if theese are your target platform, you can disable tunneling. */ // Freja.AssetManager.HTTP_METHOD_TUNNEL = null; Freja.AssetManager.HTTP_METHOD_TUNNEL = "Http-Method-Equivalent"; /** * Set this url to provide remote xslt-transformation for browsers that * doesn't support it natively. */ Freja.AssetManager.XSLT_SERVICE_URL = "srvc-xslt.php"; /** * HTML displayed while waiting for stuff to happen */ Freja.AssetManager.THROBBER_HTML = "<span style='color:white;background:firebrick'>Loading ...</span>"; /** * returns an instance of the renderengine to use */ Freja.AssetManager.createRenderer = function() { // return new Freja.View.Renderer.RemoteXSLTransformer(this.XSLT_SERVICE_URL); if (Freja._aux.hasSupportForXSLT()) { return new Freja.View.Renderer.XSLTransformer(); } else { return new Freja.View.Renderer.RemoteXSLTransformer(this.XSLT_SERVICE_URL); } }; /** * Wipes all caches. This isn't something you will normally use during production, * but it's very helpful for debugging/testing */ Freja.AssetManager.clearCache = function() { this.models = []; this.views = []; }; /** * Load a model-component * @param url string */ Freja.AssetManager.getModel = function(url) { for (var i=0; i < this.models.length; i++) { if (this.models[i].url == url) { return this.models[i]; } } var m = new Freja.Model(url, Freja._aux.createQueryEngine()); var onload = Freja._aux.bind(function(document) { this.document = document; this.ready = true; Freja._aux.signal(this, "onload"); }, m); this.loadAsset(url, true).addCallbacks(onload, Freja.AssetManager.onerror); this.models.push(m); return m; }; /** * Load a view-component * @param url string */ Freja.AssetManager.getView = function(url) { for (var i=0; i < this.views.length; i++) { if (this.views[i].url == url) { return this.views[i]; } } var v = new Freja.View(url, this.createRenderer()); var onload = Freja._aux.bind(function(document) { this.document = document; this.ready = true; Freja._aux.signal(this, "onload"); }, v); this.loadAsset(url, false).addCallbacks(onload, Freja.AssetManager.onerror); this.views.push(v); return v; }; /** * Creates and opens a http-request, tunneling exotic methods if needed. */ Freja.AssetManager.openXMLHttpRequest = function(method, url) { var tunnel = null; if (Freja.AssetManager.HTTP_METHOD_TUNNEL && method != "GET" && method != "POST") { tunnel = method; method = "POST"; } var req = Freja._aux.openXMLHttpRequest(method, url, Freja.AssetManager.HTTP_REQUEST_TYPE == "async", Freja.AssetManager._username, Freja.AssetManager._password); if (tunnel) { req.setRequestHeader(Freja.AssetManager.HTTP_METHOD_TUNNEL, tunnel); } return req; }; /** * Sets username + password for Http-Authentication */ Freja.AssetManager.setCredentials = function(username, password) { this._username = username; this._password = password; }; /** * @returns Freja._aux.Deferred */ Freja.AssetManager.loadAsset = function(url, preventCaching) { var match = /^(file:\/\/.*\/)([^\/]*)$/.exec(window.location.href); if (match) { url = match[1] + url; // local } var d = Freja._aux.createDeferred(); var handler = function(transport) { try { if (transport.responseText == "") { throw new Error("Empty response."); } if (transport.responseXML.xml == "") { // The server doesn't reply with Content-Type: text/xml // this will happen if the file is loaded locally (through file://) var document = Freja._aux.loadXML(transport.responseText); } else { var document = transport.responseXML; } } catch (ex) { d.errback(ex); } if(window.document.all) { // Weird bug in IE6 when assets are loaded from local file system. // Despite the async request, the document is loaded and the onload signal is sent // before the getModel function exits (giving no chance to attach a handler to onload). // Using a 1ms timeout here fixes the problem. setTimeout(function() { d.callback(document); }, 1); } else d.callback(document); }; try { // Why using HTTP_METHOD_TUNNEL for a GET? //-- to prevent caching, since browsers won't cache a POST if (preventCaching && Freja.AssetManager.HTTP_METHOD_TUNNEL) { var req = Freja._aux.openXMLHttpRequest("POST", url, Freja.AssetManager.HTTP_REQUEST_TYPE == "async", Freja.AssetManager._username, Freja.AssetManager._password); req.setRequestHeader(Freja.AssetManager.HTTP_METHOD_TUNNEL, "GET"); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } else { var req = Freja._aux.openXMLHttpRequest("GET", url, Freja.AssetManager.HTTP_REQUEST_TYPE == "async", Freja.AssetManager._username, Freja.AssetManager._password); } // This shouldn't be nescesary, but alas it is - firefox chokes // It's probably due to an error in MochiKit, so the problem // should be fixed there. var comm = Freja._aux.sendXMLHttpRequest(req); if (Freja.AssetManager.HTTP_REQUEST_TYPE == "async") { // fixes bug #7189 (http://developer.berlios.de/bugs/?func=detailbug&group_id=6277&bug_id=7189) comm.addCallbacks(handler, function(req) { d.errback(new Error("Request failed:" + req.status)); }); } else { if (req.status == 0 || req.status == 200 || req.status == 201 || req.status == 304) { handler(req); } else { d.errback(new Error("Request failed:" + req.status)); } } } catch (ex) { d.errback(ex); } return d; }; /** * This is a default error-handler. You should provide your own. * The handler is called if an asynchronous error happens, since * this could not be caught with the usual try ... catch * * It ought to be replaced completely with Deferred */ Freja.AssetManager.onerror = function(ex) { alert("Freja.AssetManager.onerror\n" + ex.message); }; /** * Global exports */ window.getModel = Freja._aux.bind("getModel", Freja.AssetManager); window.getView = Freja._aux.bind("getView", Freja.AssetManager);
/* global app, db_Upload, db_Sub, path */ const speech = require('@google-cloud/speech'); app.post('/stt/gcs', function( req, res ) { const keyFileLocation = path.join(__dirname, '..', 'speech-to-text-sandbox-9b4c51ccdb39.json'); const client = speech.v1({ keyFilename: keyFileLocation, }); /** * TODO(developer): Uncomment the following lines before running the sample. */ // const gcsUri = 'gs://my-bucket/audio.raw'; // const encoding = 'Eencoding of the audio file, e.g. LINEAR16'; // const sampleRateHertz = 16000; // const languageCode = 'BCP-47 language code, e.g. en-US'; //const gcsUri = ''; const encoding = 'FLAC'; // const sampleRateHertz = 16000; const languageCodeUS = 'en-US'; const languageCodeFR = 'fr-CA'; var config = { enableWordTimeOffsets: true, encoding: encoding, languageCode: '', }; db_Media.getMediaById( req.body.id, function(err, media){ if(err){ throw err; } if(media.language == 'english'){ config.languageCode = languageCodeUS } if(media.language == 'french'){ config.languageCode = languageCodeFR } var audio = { uri: media.uri, }; console.log(config); console.log(audio); var request = { config: config, audio: audio, } client .longRunningRecognize(request) .then(data => { const operation = data[0]; // Get a Promise representation of the final result of the job return operation.promise(); }) .then(data => { const response = data[0]; var subContent = ""; response.results.forEach(result => { console.log(`Transcription: ${result.alternatives[0].transcript}`); subContent = subContent + result.alternatives[0].transcript; result.alternatives[0].words.forEach(wordInfo => { // NOTE: If you have a time offset exceeding 2^32 seconds, use the // wordInfo.{x}Time.seconds.high to calculate seconds. const startSecs = `${wordInfo.startTime.seconds}` + `.` + wordInfo.startTime.nanos / 100000000; const endSecs = `${wordInfo.endTime.seconds}` + `.` + wordInfo.endTime.nanos / 100000000; console.log(`Word: ${wordInfo.word}`); console.log(`\t ${startSecs} secs - ${endSecs} secs`); }); }); db_Sub.addSub({ media_id: req.body.id, // content: JSON.stringify(res, null, 2) content: subContent }, function(err, doc){ if(err){ throw err; } // update db file collection // new: bool - if true, return the modified document rather than the original. defaults to false db_Media.updateMedia(req.body.id, {transcribe: true, sub: doc._id}, {new: false}, function(err){ if(err){ console.log(err); throw err; } } ); }); // addSub // response.send(JSON.stringify(res, null, 2)); res.end('success'); }) .catch(err => { console.error('ERROR:', err); }); }); })
import React from 'react'; import { storiesOf } from '@storybook/react'; import { CTA } from '.'; const CenterDecorator = (storyFn) => ( <div style={{ display: 'flex', height: '100vh', justifyContent: 'center', alignItems: 'center', }} > {storyFn()} </div> ); storiesOf('Contact Us Form', module) .addDecorator(CenterDecorator) .add('default', () => ( <CTA title={'Want to work with k6?'} description={ 'Some custom Lorum Ipsum that no one will notice in a thousand year.' } buttonText={'Push here'} buttonUrl={'/'} /> ));
const proffys = [ { name: "Victor Menegazzo", avatar: "https://avatars0.githubusercontent.com/u/56408507?s=460&u=606162c7ee33eea57e09e4fd18caa6ffe77ae4ba&v=4", whatsapp: "8998998899", bio: "Um cara super legal e apaixonado pela História<br><br>Apaixonado pela história do Brasil.", subject: "História", cost: "200", weekday: [0], time_from: [720], time_to: [1220], }, { name: "Artur", avatar: "https://avatars0.githubusercontent.com/u/56408507?s=460&u=606162c7ee33eea57e09e4fd18caa6ffe77ae4ba&v=4", whatsapp: "8998998899", bio: "Um cara super legal e apaixonado pela História<br><br>Apaixonado pela história do Brasil.", subject: "História", cost: "200", weekday: [0], time_from: [720], time_to: [1220], }, ];
const utils = require('../utils'); let buildDeps = (json) => { let deps = [] for (let key in json) { if (key === 'npm-link-better') { continue } let version = json[key] if (isNaN(version.slice(0, 1)) === false) { key = key + '@' + version } deps.push(key) } return deps } let save = (argv) => { const deps = argv._; const packageJson = utils.cwdPackageJson(); if (!deps.length) { let throwException = true let pjson = packageJson let dependencies = pjson.dependencies if (dependencies !== undefined) { let argvInit = {} argvInit._ = buildDeps(dependencies) argvInit.init = true if (argvInit._.length > 0) { save(argvInit) throwException = false } } let devDependencies = pjson.devDependencies if (devDependencies !== undefined) { let argvInit = {} argvInit._ = buildDeps(devDependencies) argvInit.saveDev = true argvInit.init = true if (argvInit._.length > 0) { save(argvInit) throwException = false } } let optionalDependencies = pjson.optionalDependencies if (optionalDependencies !== undefined) { let argvInit = {} argvInit._ = buildDeps(optionalDependencies) argvInit.saveOptional = true argvInit.init = true if (argvInit._.length > 0) { save(argvInit) throwException = false } } let bundleDependencies = pjson.bundleDependencies if (bundleDependencies !== undefined) { let argvInit = {} argvInit._ = buildDeps(bundleDependencies) argvInit.saveBundle = true argvInit.init = true if (argvInit._.length > 0) { save(argvInit) throwException = false } } let peerDependencies = pjson.peerDependencies if (peerDependencies !== undefined) { let argvInit = {} argvInit._ = buildDeps(peerDependencies) argvInit.savePeer = true argvInit.init = true if (argvInit._.length > 0) { save(argvInit) throwException = false } } if (throwException === true) { throw new Error(`'save' needs at least 1 dependency`); } else { return } } // ----------------------- // 先試試看有沒有成功使用 if (argv.update === true) { for (const dep of deps) { //console.log(dep) // 移除檔案目錄 utils.removeDependencyPackage(dep) // 安裝 utils.npm(`install -g ${dep}`); } } // ----------------------- const dependencyTypes = ['dependencies', 'devDependencies', 'optionalDependencies', 'bundleDependencies', 'peerDependencies']; utils.linkDependency(deps, argv); const dependencyType = argv.saveDev ? 'devDependencies' : argv.saveOptional ? 'optionalDependencies' : argv.saveBundle ? 'bundleDependencies' : argv.savePeer ? 'peerDependencies' : 'dependencies'; const isInit = argv.init ? true: false; const rangeOperator = argv.saveExact ? '' : '^'; packageJson[dependencyType] = packageJson[dependencyType] || {}; const changes = []; for (const dep of deps) { let [{ name, version }] = utils.getDependencyPackageJson(dep); const override = { dependencyType, rangeOperator }; let oldVersion = packageJson[override.dependencyType][name] || null; for (const dependencyType_ of dependencyTypes) { if (!packageJson[dependencyType_]) continue; if (packageJson[dependencyType_][name]) { oldVersion = packageJson[dependencyType_][name]; delete packageJson[dependencyType_][name]; if (dependencyType === 'dependencies') { override.dependencyType = dependencyType_; } } } let newVersion if (dep.indexOf('@') > 1) { version = dep.slice(dep.indexOf('@') + 1) newVersion = packageJson[override.dependencyType][name] = version; } else { newVersion = packageJson[override.dependencyType][name] = override.rangeOperator + version; } const versionChanged = oldVersion !== newVersion; const dependencyTypeChanged = override.dependencyType !== dependencyType; if (versionChanged || dependencyTypeChanged) { changes.push({ ...override, name, versionChanged, oldVersion, newVersion, dependencyTypeChanged }); } packageJson[override.dependencyType] = utils.sortKeys(packageJson[override.dependencyType]); } if (isInit === false) { utils.modifyJson('package.json', packageJson, { backup: false }); } }; module.exports = save
module.exports = { and: { type: 'compound' }, or: { type: 'compound' }, equals: { type: 'term_level', es_clause: 'term' }, in: { type: 'term_level', es_clause: 'terms' }, range: { type: 'term_level', es_clause: 'range' }, prefix: { type: 'term_level', es_clause: 'prefix' }, wildcard: { type: 'term_level', es_clause: 'wildcard' }, exists: { type: 'term_level', es_clause: 'exists' }, regexp: { type: 'term_level', es_clause: 'regexp' }, type: { type: 'term_level', es_clause: 'type' }, ids: { type: 'term_level', es_clause: 'ids' } };
import React from 'react' import Item from './Item' // lg: >750px; // sm: <750px const datas_lg = [ { position: 'item', itemStyle: { }, imgSrc: './images/group36.png', imgBoxStyle: { width:'100%' }, title: '海量客群一站式部署', text:'开放一站式 SaaS 和私有 PaaS 平台\n轻松实现客群定制化托管运营\n按需支撑服务弹性扩展、伸缩\n引领企业步入 SaaS 智能销售新时代' }, { position: 'item', itemStyle: { }, imgSrc: './images/group37.png', imgBoxStyle: { width:'100%' }, title: '云端大数据精准分析', text:'专精于客群数据深度挖掘\n实时感知客户需求\n生成多维「用户画像」,洞察客户成长周期\n精确定位客群热点,大幅提升销售效率' }, { position: 'item', itemStyle: { }, imgSrc: './images/group38.png', imgBoxStyle: { width:'100%' }, title: '贴心机器人助手', text:'基于亿级语料深度学习\n借助 NLP 技术打造自然人机对话交互\n秒级响应智能问答\n缩减人工成本,提高响应效率' } ] const datas_sm = [ { position: 'item', itemStyle: { height:'422px', paddingTop: '50px', boxSizing: 'border-box' }, imgSrc: './images/group36.png', imgBoxStyle: { width:'100%' }, title: '海量客群一站式部署', text:'开放一站式 SaaS 和私有 PaaS 平台\n轻松实现客群定制化托管运营\n按需支撑服务弹性扩展、伸缩\n引领企业步入 SaaS 智能销售新时代' }, { position: 'item', itemStyle: { height: '455px', background: '#FFFFFF', paddingTop: '75px', boxSizing: 'border-box' }, imgSrc: './images/group37.png', imgBoxStyle: { width:'100%' }, title: '云端大数据精准分析', text:'专精于客群数据深度挖掘\n实时感知客户需求\n生成多维「用户画像」,洞察客户成长周期\n精确定位客群热点,大幅提升销售效率' }, { position: 'item', itemStyle: { height: '435px', paddingTop: '75px', boxSizing: 'border-box' }, imgSrc: './images/group38.png', imgBoxStyle: { width:'100%' }, title: '贴心机器人助手', text:'基于亿级语料深度学习\n借助 NLP 技术打造自然人机对话交互\n秒级响应智能问答\n缩减人工成本,提高响应效率' } ] const ServiceBox = (props) => { let datas; if(props.screenWidth>750){ datas = datas_lg }else { datas = datas_sm } return ( <div className={'serviceBox'}> <p className={'title'}>全栈式客群解决方案</p> <p className={'text'}>适合各类企业客群应用场景</p> <div className="techBox"> {datas.map((data)=>{ return ( <div className="itemWraper"> <Item data={data}/> </div> ) })} </div> </div> ) } export default ServiceBox;
const exporter = require(`./${process.env.EXPORTER || 'npm'}.exporter.js`) const fs = require('fs') const path = require('path'); (async () => { let res = {} try { res = await exporter() console.log('Done') } catch (err) { console.log(err) } await fs.promises.writeFile(process.env.OUTPUT_FILE || path.join(__dirname, '../report/input.json'), JSON.stringify(res), 'utf8') })()
/** * 화면 초기화 - 화면 로드시 자동 호출 됨 */ function _Initialize() { // 단위화면에서 사용될 일반 전역 변수 정의 $NC.setGlobalVar({ printOptions: [{ PRINT_INDEX: 0, PRINT_COMMENT: "거래명세서 출력" }] }); // 그리드 초기화 grdT1MasterInitialize(); grdT1DetailInitialize(); // 정산처리 버튼 설정 $("#lbl_Pop_Cd").click(showLblListPopup); // 정산처리 버튼 사용불가(조회 후 사용) // $NC.setEnable("#lbl_Pop_Cd", false); // 위탁사 버튼 설정 $("#btnQBrand_Cd").click(showBuBrandPopup); $NC.setValue("#edtQBu_Cd", $NC.G_USERINFO.BU_CD); $NC.setValue("#edtQBu_Nm", $NC.G_USERINFO.BU_NM); $("#btnQBu_Cd").click(showUserBuPopup); $("#btnQFee_Head_Cd").click(showFee_Head_CdPopup); $("#btnQFee_Base_Cd").click(showFee_Base_CdPopup); // 위탁사 버튼 설정 $("#btnQOwn_Brand_Cd").click(showOwnBranPopup); $("#btnNew").click(_New); // 그리드 행 추가 버튼 $("#btnSave").click(_Save); // 저장 버튼 // 버튼 활성화 처리 $NC.G_VAR.buttons._inquiry = "1"; $NC.G_VAR.buttons._new = "0"; $NC.G_VAR.buttons._save = "0"; $NC.G_VAR.buttons._cancel = "0"; $NC.G_VAR.buttons._delete = "0"; $NC.G_VAR.buttons._print = "0"; $NC.setInitTopButtons($NC.G_VAR.buttons); } /** * 화면 초기화 - 화면 로드시 자동 호출 됨 */ function _OnLoaded() { // 화면에 splitter 설정 $NC.setInitSplitter("#divMasterView", "h", 300); } /** * 화면 리사이즈 Offset 계산 */ function _SetResizeOffset() { $NC.G_OFFSET.nonClientHeight = $("#divConditionView").outerHeight() + $NC.G_LAYOUT.nonClientHeight; } /** * Window Resize Event - Window Size 조정시 호출 됨 */ function _OnResize(parent) { var clientWidth = parent.width() - $NC.G_LAYOUT.border1; var clientHeight = parent.height() - $NC.G_OFFSET.nonClientHeight; // Splitter 컨테이너 크기 조정 $NC.resizeContainer("#divMasterView", clientWidth, clientHeight); // Master Grid 사이즈 조정 $NC.resizeGrid("#grdT1Master", clientWidth, $("#grdT1Master").parent().height() - $NC.G_LAYOUT.header); // Detail Grid 사이즈 조정 $NC.resizeGrid("#grdT1Detail", clientWidth, $("#grdT1Detail").parent().height() - $NC.G_LAYOUT.header); // 정산월에 달력이미지 설정 $NC.setInitMonthPicker("#dtpQAdjust_Month", $NC.G_USERINFO.LOGIN_DATE); } function setUserProgramPermission() { var permission = $NC.getProgramPermission(); // 저장 $NC.setEnable("#lbl_Pop_Cd", permission.canSave && G_GRDT1MASTER.data.getLength() > 0); } /** * Condition Change Event - Input, Select Change 시 호출 됨 */ function _OnConditionChange(e, view, val) { // 조회 조건에 Object Change var id = view.prop("id").substr(4).toUpperCase(); // 브랜드 Key 입력 switch (id) { case "BU_CD": var P_QUERY_PARAMS; var O_RESULT_DATA = [ ]; if (!$NC.isNull(val)) { P_QUERY_PARAMS = { P_USER_ID: $NC.G_USERINFO.USER_ID, P_BU_CD: val }; O_RESULT_DATA = $NP.getUserBuInfo({ queryParams: P_QUERY_PARAMS }); } if (O_RESULT_DATA.length <= 1) { onUserBuPopup(O_RESULT_DATA[0]); } else { $NP.showUserBuPopup({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }, onUserBuPopup, onUserBuPopup); } return; case "OWN_BRAND_CD": var P_QUERY_PARAMS; var O_RESULT_DATA = [ ]; if (!$NC.isNull(val)) { var CUST_CD = '0000'; var BU_CD = $NC.getValue("#edtQBu_Cd"); P_QUERY_PARAMS = { P_CUST_CD: CUST_CD, P_BU_CD: BU_CD, P_OWN_BRAND_CD: val }; O_RESULT_DATA = $NP.getOwnBrandInfo({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }); } if (O_RESULT_DATA.length <= 1) { onOwnBrandPopup(O_RESULT_DATA[0]); } else { $NP.showOwnBranPopup({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }, onOwnBrandPopup, onOwnBrandPopup); } return; case "BRAND_CD": var P_QUERY_PARAMS; var O_RESULT_DATA = [ ]; if (!$NC.isNull(val)) { P_QUERY_PARAMS = { P_USER_ID: $NC.G_USERINFO.USER_ID, P_BRAND_CD: val }; O_RESULT_DATA = $NP.getUserBrandInfo({ queryParams: P_QUERY_PARAMS }); } if (O_RESULT_DATA.length <= 1) { onUserBrandPopup(O_RESULT_DATA[0]); } else { $NP.showUserBrandPopup({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }, onUserBrandPopup, onUserBrandPopup); } return; case "ADJUST_DATE1": $NC.setValueDatePicker(view, val, "검색 시작일자를 정확히 입력하십시오."); break; case "ADJUST_DATE2": $NC.setValueDatePicker(view, val, "검색 종료일자를 정확히 입력하십시오."); break; } onChangingCondition(); } /** * Inquiry Button Event - 메인 상단 조회 버튼 클릭시 호출 됨 */ function _Inquiry() { var BU_CD = $NC.getValue("#edtQBu_Cd"); if ($NC.isNull(BU_CD)) { alert("사업부를 입력하십시오."); $NC.setFocus("#edtQBu_Cd"); return; } var ADJUST_MONTH = $NC.getValue("#dtpQAdjust_Month"); if ($NC.isNull(ADJUST_MONTH)) { alert("정산월을 입력하십시오."); $NC.setFocus("#dtpQAdjust_Month"); return; } ; var ADJUST_MONTH1 = ADJUST_MONTH.replace(/\-/g, ''); var OWN_BRAND_CD = $NC.getValue("#edtQOwn_Brand_Cd", true); var FEE_BASE_CD = $NC.getValue("#cboQFee_Base_Cd", true); var FEE_HEAD_CD = $NC.getValue("#cboQFee_Head_Cd", true); // 조회시 전역 변수 값 초기화 $NC.setInitGridVar(G_GRDT1MASTER); $NC.setInitGridVar(G_GRDT1DETAIL); // 파라메터 세팅 G_GRDT1MASTER.queryParams = $NC.getParams({ P_BU_CD: BU_CD, P_BRAND_CD: OWN_BRAND_CD, P_ADJUST_MONTH: ADJUST_MONTH1, P_FEE_BASE_CD: FEE_BASE_CD, P_FEE_HEAD_CD: FEE_HEAD_CD }); // 데이터 조회 $NC.serviceCall("/LF01030E/getDataSet.do", $NC.getGridParams(G_GRDT1MASTER), onGetMasterT1); } /** * 신규 */ function _New() { var masterRowData = G_GRDT1MASTER.data.getItem(G_GRDT1MASTER.lastRow); var rowCount = G_GRDT1DETAIL.data.getLength(); if (rowCount > 0) { // 마지막 데이터가 신규 데이터일 경우 신규 데이터를 다시 만들지 않음 var rowData = G_GRDT1DETAIL.data.getItem(rowCount - 1); if (rowData.CRUD == "N") { $NC.setFocusGrid(G_GRDT1DETAIL, rowCount - 1, G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_NM"), true); return; } } var ADJUST_MONTH1 = masterRowData.ADJUST_MONTH.replace(/\-/g, ''); // 신규 데이터는 CRUD를 "N"으로 하고 데이터 입력 후 다른 Row로 이동하면 "C"로 변경 var newRowData = { ADJUST_DATE: masterRowData.ADJUST_DATE, ADJUST_NO: masterRowData.ADJUST_NO, ADJUST_MONTH: ADJUST_MONTH1, CENTER_CD: masterRowData.CENTER_CD, BU_CD: masterRowData.BU_CD, FEE_HEAD_CD: null, FEE_HEAD_NM: null, FEE_BASE_CD: null, FEE_BASE_NM: null, PAY_CHA_DIV: '1', BRAND_CD: masterRowData.BRAND_CD, FEE_QTY: null, UNIT_CNT: null, CARRIER_CD:'0', REMARK1:null, id: $NC.getGridNewRowId(), CRUD: "N" }; G_GRDT1DETAIL.data.addItem(newRowData); $NC.setGridSelectRow(G_GRDT1DETAIL, rowCount); if (rowCount === 0) { $NC.setGridDisplayRows("#grdT1Detail", rowCount + 1, G_GRDT1DETAIL.data.getLength()); } // 수정 상태로 변경 G_GRDT1DETAIL.lastRowModified = true; // 신규 데이터 생성 후 이벤트 호출 grdDetailT1OnNewRecord({ row: rowCount, rowData: newRowData }); } function grdDetailT1OnNewRecord(args) { $NC.setFocusGrid(G_GRDT1DETAIL, args.row, G_GRDT1DETAIL.view.getColumnIndex("ITEM_CD"), true); } /** * 저장 */ function _Save() { // 현재 수정모드면 if (G_GRDT1DETAIL.view.getEditorLock().isActive()) { G_GRDT1DETAIL.view.getEditorLock().commitCurrentEdit(); } // 현재 선택된 로우 Validation 체크 if (G_GRDT1DETAIL.lastRow != null) { if (!grdDetailOnBeforePost(G_GRDT1DETAIL.lastRow)) { return; } } var d_DS = [ ]; var cu_DS = [ ]; var rows = G_GRDT1DETAIL.data.getItems(); var rowCount = rows.length; for ( var row = 0; row < rowCount; row++) { var rowData = G_GRDT1DETAIL.data.getItem(row); if (rowData.CRUD !== "R") { var saveData = { P_CENTER_CD: rowData.CENTER_CD, P_ADJUST_MONTH: rowData.ADJUST_MONTH, P_ADJUST_DATE: rowData.ADJUST_DATE, P_ADJUST_NO: rowData.ADJUST_NO, P_CENTER_CD: rowData.CENTER_CD, P_BU_CD: rowData.BU_CD, P_FEE_HEAD_CD: rowData.FEE_HEAD_CD, P_FEE_HEAD_NM: rowData.FEE_HEAD_NM, P_FEE_BASE_CD: rowData.FEE_BASE_CD, P_FEE_BASE_NM: rowData.FEE_BASE_NM, P_PAY_CHA_DIV: '1', P_BRAND_CD: rowData.BRAND_CD, P_UNIT_PRICE: rowData.UNIT_PRICE, P_FEE_QTY: rowData.FEE_QTY, P_FEE_AMT: rowData.FEE_AMT, P_REMARK1:rowData.REMARK1, P_CRUD: rowData.CRUD }; if (rowData.CRUD === "D") { d_DS.push(saveData); } else { cu_DS.push(saveData); } } } var detailDS = d_DS.concat(cu_DS); $NC.serviceCall("/LF01030E/save.do", { P_DS_MASTER: $NC.toJson(detailDS), P_USER_ID: $NC.G_USERINFO.USER_ID }, onSave); } function onSave(ajaxData) { var lastKeyVal = $NC.getGridLastKeyVal(G_GRDT1MASTER, { selectKey: ["ADJUST_NO", "PAY_CHA_NM", "CLOSE_LEVEL_NM"] }); _Inquiry(); G_GRDT1MASTER.lastKeyVal = lastKeyVal; } /** * Delete Button Event - 메인 상단 삭제 버튼 클릭시 호출 됨 */ function _Delete() { } /** * Cancel Button Event - 메인 상단 취소 버튼 클릭시 호출 됨 */ function _Cancel() { } /** * Print Button Event - 메인 상단 출력 버튼 클릭시 호출 됨 * * @param printIndex * 선택한 출력물 Index */ function _Print(printIndex, printName) { var ADJUST_MONTH = $NC.getValue("#dtpQAdjust_Month"); if ($NC.isNull(ADJUST_MONTH)) { alert("정산월을 입력하십시오."); $NC.setFocus("#dtpQAdjust_Month"); return; } } /** * Print Button Event - 메인 상단 출력 버튼 클릭시 호출 됨 * * @param printIndex * 선택한 출력물 Index */ function _Print(printIndex, printName) { var BU_CD = $NC.getValue("#edtQBu_Cd", true); var INOUT_DATE1 = $NC.getValue("#dtpQInout_Date1"); if ($NC.isNull(INOUT_DATE1)) { alert("시작일자를 입력하십시오."); $NC.setFocus("#dtpQInout_Date1"); return; } var INOUT_DATE2 = $NC.getValue("#dtpQInout_Date2"); if ($NC.isNull(INOUT_DATE2)) { alert("종료일자를 입력하십시오."); $NC.setFocus("#dtpQInout_Date2"); return; } var printOptions = {}; if (printIndex == 0) { printOptions = { reportDoc: "lf/RECEIPT_LF05", queryId: "WR.RS_RECEIPT_LF05", queryParams: { P_CENTER_CD: CENTER_CD, P_BU_CD: BU_CD, P_ADJUST_MONTH1: INOUT_DATE1, P_ADJUST_MONTH2: INOUT_DATE2 } }; $NC.G_MAIN.showPrintPreview(printOptions); } } function grdT1MasterOnGetColumns() { var columns = [ ]; $NC.setGridColumn(columns, { id: "ADJUST_NO", field: "ADJUST_NO", name: "정산반호", minWidth: 80 }); $NC.setGridColumn(columns, { id: "PAY_CHA_NM", field: "PAY_CHA_NM", name: "구분", minWidth: 80 }); $NC.setGridColumn(columns, { id: "CLOSE_LEVEL_NM", field: "CLOSE_LEVEL_NM", name: "대상구분", minWidth: 80 }); $NC.setGridColumn(columns, { id: "BRAND_NM", field: "BRAND_NM", name: "위탁사명", minWidth: 80 }); $NC.setGridColumn(columns, { id: "ADJUST_DATE", field: "ADJUST_DATE", name: "일자", minWidth: 90, cssClass: "align-center", groupToggler: true, band: 0 }); $NC.setGridColumn(columns, { id: "ADJUST_MONTH", field: "ADJUST_MONTH", name: "정산월", cssClass: "align-center", minWidth: 90 }); $NC.setGridColumn(columns, { id: "ADJUST_PERIOD", field: "ADJUST_PERIOD", name: "정산기간", minWidth: 90 }); $NC.setGridColumn(columns, { id: "ADJUST_FEE_AMT", field: "ADJUST_FEE_AMT", name: "정산금액", cssClass: "align-right", minWidth: 90 }); return $NC.setGridColumnDefaultFormatter(columns); } /** * 상단그리드 초기화 */ function grdT1MasterInitialize() { var options = { frozenColumn: 1 }; // Grid Object, DataView 생성 및 초기화 $NC.setInitGridObject("#grdT1Master", { columns: grdT1MasterOnGetColumns(), queryId: "LF01030E.RS_MASTER", sortCol: "ADJUST_NO", gridOptions: options }); G_GRDT1MASTER.view.onSelectedRowsChanged.subscribe(grdT1MasterOnAfterScroll); } function grdT1MasterOnAfterScroll(e, args) { var row = args.rows[0]; if (G_GRDT1MASTER.lastRow != null) { if (row == G_GRDT1MASTER.lastRow) { e.stopImmediatePropagation(); return; } } var FEE_BASE_CD = $NC.getValue("#cboQFee_Base_Cd", true); var FEE_HEAD_CD = $NC.getValue("#cboQFee_Head_Cd", true); var rowData = G_GRDT1MASTER.data.getItem(row); var ADJUST_MONTH1 = rowData.ADJUST_MONTH.replace(/\-/g, ''); // 파라메터 세팅 G_GRDT1DETAIL.queryParams = $NC.getParams({ P_BU_CD: rowData.BU_CD, P_BRAND_CD: rowData.BRAND_CD, P_ADJUST_MONTH: ADJUST_MONTH1, P_ADJUST_DATE: rowData.ADJUST_DATE, P_ADJUST_NO: rowData.ADJUST_NO, P_FEE_BASE_CD: FEE_BASE_CD, P_FEE_HEAD_CD: FEE_HEAD_CD, P_PAY_CHA_DIV: rowData.PAY_CHA_DIV }); // 데이터 조회 $NC.serviceCall("/LF01030E/getDataSet.do", $NC.getGridParams(G_GRDT1DETAIL), onGetMasterT2); // 상단 현재로우/총건수 업데이트 $NC.setGridDisplayRows("#grdT1Master", row + 1); } function grdT1DetailOnGetColumns() { var columns = [ ]; $NC.setGridColumn(columns, { id: "ADJUST_NO", field: "ADJUST_NO", name: "정산번호", minWidth: 60 }); $NC.setGridColumn(columns, { id: "FEE_HEAD_CD", field: "FEE_HEAD_CD", name: "정산그룹코드", minWidth: 60, editor: Slick.Editors.Popup, editorOptions: { onPopup: grdDetailOnPopup, isKeyField: true }, cssClass: "align-center" }); $NC.setGridColumn(columns, { id: "FEE_HEAD_NM", field: "FEE_HEAD_NM", name: "정산항목명", minWidth: 120 }); $NC.setGridColumn(columns, { id: "FEE_BASE_CD", field: "FEE_BASE_CD", name: "정산항목", minWidth: 60, editor: Slick.Editors.Popup, editorOptions: { onPopup: grdDetailOnPopup, isKeyField: true }, cssClass: "align-center" }); $NC.setGridColumn(columns, { id: "FEE_BASE_NM", field: "FEE_BASE_NM", name: "세부항목명", minWidth: 180 }); $NC.setGridColumn(columns, { id: "UNIT_DIV_NM", field: "UNIT_DIV_NM", name: "단가기준", minWidth: 180 }); $NC.setGridColumn(columns, { id: "UNIT_PRICE", field: "UNIT_PRICE", name: "단가", minWidth: 80, cssClass: "align-right", editor: Slick.Editors.Number, editorOptions: { isKeyField: true } }); $NC.setGridColumn(columns, { id: "FEE_QTY", field: "FEE_QTY", name: "수량", minWidth: 80, cssClass: "align-right", editor: Slick.Editors.Number, editorOptions: { isKeyField: true } }); $NC.setGridColumn(columns, { id: "FEE_AMT", field: "FEE_AMT", name: "금액", minWidth: 80, cssClass: "align-right" }); $NC.setGridColumn(columns, { id: "REMARK1", field: "REMARK1", name: "비고", minWidth: 180, editor: Slick.Editors.Text }); return $NC.setGridColumnDefaultFormatter(columns); } /** * 일자별 수불내역탭의 그리드 초기값 설정 */ function grdT1DetailInitialize() { var options = { frozenColumn: 1, editable: true, autoEdit: true, }; // Grid Object, DataView 생성 및 초기화 $NC.setInitGridObject("#grdT1Detail", { columns: grdT1DetailOnGetColumns(), queryId: "LF01030E.RS_DETAIL", sortCol: "ADJUST_DATE", gridOptions: options }); G_GRDT1DETAIL.view.onSelectedRowsChanged.subscribe(grdT1DetailOnAfterScroll); G_GRDT1DETAIL.view.onDblClick.subscribe(grdT1DetailOnDblClick); G_GRDT1DETAIL.view.onBeforeEditCell.subscribe(grdT1DetailOnBeforeEditCell); G_GRDT1DETAIL.view.onCellChange.subscribe(grdT1DetailOnCellChange); } /** * 그리드의 위탁사 팝업 처리 */ function grdDetailOnPopup(e, args) { var rowData = args.item; var lastMasterData = G_GRDT1MASTER.data.getItem(G_GRDT1MASTER.lastRow); switch (args.column.field) { case "FEE_HEAD_CD": $NP.showFee_Head_CdPopup({ P_BU_CD: lastMasterData.BU_CD, P_CENTER_FUNC_DIV: rowData.CENTER_FUNC_DIV, P_FEE_HEAD_CD: rowData.FEE_HEAD_CD }, onHead1Popup, function() { $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"), true, true); }); break; case "FEE_BASE_CD": if ($NC.isNull(rowData.FEE_HEAD_CD)) { alert("정산그룹을 먼저 선택하시기 바랍니다."); $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"), true, true); return; } $NP.showFee_Base_CdPopup({ P_BU_CD: lastMasterData.BU_CD, P_FEE_HEAD_CD: rowData.FEE_HEAD_CD, P_FEE_BASE_CD: rowData.FEE_BASE_CD }, onBase1Popup, function() { $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_BASE_CD"), true, true); }); break; } } function grdT1DetailOnAfterScroll(e, args) { var row = args.rows[0]; if (G_GRDT1DETAIL.lastRow != null) { if (row == G_GRDT1DETAIL.lastRow) { e.stopImmediatePropagation(); return; } } // 상단 현재로우/총건수 업데이트 $NC.setGridDisplayRows("#grdT1Detail", row + 1); } function grdT1DetailOnBeforeEditCell(e, args) { // 수정할 수 없는 컬럼일 경우 수정 모드로 변경하지 않도록 처리 if (args.column.field !== "FEE_HEAD_CD" && args.column.field !== "FEE_BASE_CD" && args.column.field !== "UNIT_PRICE" && args.column.field !== "FEE_AMT" && args.column.field !== "FEE_QTY") { return true; } var rowData = G_GRDT1DETAIL.data.getItem(args.row); if (rowData.CRUD !== "N" && rowData.CRUD !== "C") { if (args.column.field == "FEE_HEAD_CD") { return false; } if (args.column.field == "FEE_BASE_CD") { return false; } if (args.column.field == "FEE_AMT") { return false; } if (args.column.field == "FEE_QTY") { return false; } if (args.column.field == "UNIT_PRICE") { return false; } } if (rowData) { // 신규 데이터가 아니면 코드 수정 불가 if (rowData.CRUD !== "N" && rowData.CRUD !== "C") { return false; } } return true; } /** * 그리드의 편집 셀의 값 변경시 처리 * * @param e * @param args */ function grdT1DetailOnCellChange(e, args) { var rowData = args.item; switch (G_GRDT1DETAIL.view.getColumnField(args.cell)) { case "UNIT_PRICE": rowData.UNIT_PRICE = rowData.UNIT_PRICE; rowData.FEE_QTY = 0; break; case "FEE_QTY": rowData = grdDetailOnCalc(rowData); break; case "FEE_HEAD_CD": var P_QUERY_PARAMS; var O_RESULT_DATA = [ ]; var lastMasterData = G_GRDT1MASTER.data.getItem(G_GRDT1MASTER.lastRow); if (!$NC.isNull(rowData.FEE_HEAD_CD)) { P_QUERY_PARAMS = { P_BU_CD: lastMasterData.BU_CD, P_FEE_HEAD_CD: rowData.FEE_HEAD_CD, P_CENTER_FUNC_DIV: "1" }; O_RESULT_DATA = $NP.getFee_Head_CdInfo({ queryParams: P_QUERY_PARAMS }); } if (O_RESULT_DATA.length <= 1) { onHead1Popup(O_RESULT_DATA[0]); } else { $NP.showFee_Head_CdPopup({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }, onHead1Popup, onHead1Popup); } return; case "FEE_BASE_CD": if ($NC.isNull(rowData.FEE_HEAD_CD)) { alert("정산그룹을 먼저 선택하시기 바랍니다."); rowData.FEE_HEAD_CD = ""; $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"), true, true); return; } var P_QUERY_PARAMS; var O_RESULT_DATA = [ ]; var lastMasterData = G_GRDT1MASTER.data.getItem(G_GRDT1MASTER.lastRow); if (!$NC.isNull(rowData.FEE_BASE_CD)) { P_QUERY_PARAMS = { P_BU_CD: lastMasterData.BU_CD, P_FEE_HEAD_CD: rowData.FEE_HEAD_CD, P_FEE_BASE_CD: rowData.FEE_BASE_CD }; O_RESULT_DATA = $NP.getFee_Base_CdInfo({ queryParams: P_QUERY_PARAMS }); } if (O_RESULT_DATA.length <= 1) { onBase1Popup(O_RESULT_DATA[0]); } else { $NP.showFee_Base_CdPopup({ queryParams: P_QUERY_PARAMS, queryData: O_RESULT_DATA }, onBase1Popup, onBase1Popup); } return; } if (rowData.CRUD === "R") { rowData.CRUD = "U"; } G_GRDT1DETAIL.data.updateItem(rowData.id, rowData); // 마지막 선택 Row 수정 상태로 변경 G_GRDT1DETAIL.lastRowModified = true; } /** * 상단그리드 더블 클릭 */ function grdT1DetailOnDblClick(e, args) { if (G_GRDT1DETAIL.data.getLength() == 0) { return; } var masterRowData = G_GRDT1DETAIL.data.getItem(args.row); if (masterRowData) { if (masterRowData.FEE_HEAD_CD === '100' && masterRowData.FEE_BASE_CD === '010') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01032P", PROGRAM_NM: "상세내역(출고수수료)", url: "lf/LF01032P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '200' && masterRowData.FEE_BASE_CD === '010') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01033P", PROGRAM_NM: "상세내역(추가수수료-추가송장)", url: "lf/LF01033P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '200' && masterRowData.FEE_BASE_CD === '020') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01034P", PROGRAM_NM: "상세내역(추가수수료-CS출고)", url: "lf/LF01034P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '200' && masterRowData.FEE_BASE_CD === '040') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01035P", PROGRAM_NM: "상세내역(추가수수료-박스비용)", url: "lf/LF01035P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '200' && masterRowData.FEE_BASE_CD === '030') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01036P", PROGRAM_NM: "상세내역(추가수수료-반품입고)", url: "lf/LF01036P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '200' && masterRowData.FEE_BASE_CD === '080') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01037P", PROGRAM_NM: "상세내역(추가수수료-반품출고)", url: "lf/LF01037P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '600' && masterRowData.FEE_BASE_CD === '010') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01038P", PROGRAM_NM: "상세내역(운송비지급수수료-배송수수료)", url: "lf/LF01038P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '600' && masterRowData.FEE_BASE_CD === '020') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01039P", PROGRAM_NM: "상세내역(운송비지급수수료-고객반품입고수수료)", url: "lf/LF01039P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } else if (masterRowData.FEE_HEAD_CD === '600' && masterRowData.FEE_BASE_CD === '030') { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01040P", PROGRAM_NM: "상세내역(운송비지급수수료-반품출고수수료)", url: "lf/LF01040P.html", width: 1024, height: 600, userData: { P_PROCESS_CD: "U", P_BU_CD: masterRowData.BU_CD, P_ADJUST_DATE: masterRowData.ADJUST_DATE, P_ADJUST_START_DATE: masterRowData.ADJUST_START_DATE, P_ADJUST_END_DATE: masterRowData.ADJUST_END_DATE, P_ADJUST_MONTH: masterRowData.ADJUST_MONTH, P_ADJUST_NO: masterRowData.ADJUST_NO, P_FEE_HEAD_CD: masterRowData.FEE_HEAD_CD, P_FEE_BASE_CD: masterRowData.FEE_BASE_CD, P_FEE_HEAD_NM: masterRowData.FEE_HEAD_NM, P_FEE_BASE_NM: masterRowData.FEE_BASE_NM, P_BRAND_CD: masterRowData.BRAND_CD, P_BRAND_NM: masterRowData.BRAND_NM, P_MASTER_DS: masterRowData }, onOk: function() { var lastRowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); G_GRDT1DETAIL.lastKeyVal = new Array(lastRowData.FEE_HEAD_CD, lastRowData.FEE_BASE_CD, lastRowData.UNIT_DIV_NM); } }); } } } /** * 입출고 수불내역 탭 조회 버튼 클릭후 처리 * * @param ajaxData */ function onGetMasterT1(ajaxData) { $NC.setInitGridData(G_GRDT1MASTER, ajaxData); if (G_GRDT1MASTER.data.getLength() > 0) { if ($NC.isNull(G_GRDT1MASTER.lastKeyVal)) { $NC.setGridSelectRow(G_GRDT1MASTER, 0); } else { $NC.setGridSelectRow(G_GRDT1MASTER, { selectKey: "BU_CD", selectVal: G_GRDT1MASTER.lastKeyVal }); } } else { $NC.setGridDisplayRows("#grdT1Master", 0, 0); } } /** * 일자별 수불내역 탭 조회 버튼 클릭후 처리 * * @param ajaxData */ function onGetMasterT2(ajaxData) { $NC.setInitGridData(G_GRDT1DETAIL, ajaxData); if (G_GRDT1DETAIL.data.getLength() > 0) { $NC.setGridSelectRow(G_GRDT1DETAIL, 0); } else { $NC.setGridDisplayRows("grdT1Detail", 0, 0); } } /** * 검색조건 값 변경 되었을 경우의 처리 */ function onChangingCondition() { // 입출고 수불내역 $NC.clearGridData(G_GRDT1MASTER); $NC.clearGridData(G_GRDT1DETAIL); // 버튼 활성화 처리 $NC.G_VAR.buttons._inquiry = "1"; $NC.G_VAR.buttons._new = "0"; $NC.G_VAR.buttons._save = "0"; $NC.G_VAR.buttons._cancel = "0"; $NC.G_VAR.buttons._delete = "0"; $NC.G_VAR.buttons._print = "1"; $NC.setInitTopButtons($NC.G_VAR.buttons, $NC.G_VAR.printOptions); } /** * 검색조건의 사업부 검색 팝업 클릭 */ function showUserBuPopup() { $NP.showUserBuPopup({ P_USER_ID: $NC.G_USERINFO.USER_ID, P_BRAND_CD: "%" }, onUserBuPopup, function() { $NC.setFocus("#edtQBu_Cd", true); }); } /** * 사업부 검색 결과 * * @param seletedRowData */ function onUserBuPopup(resultInfo) { if (!$NC.isNull(resultInfo)) { $NC.setValue("#edtQBu_Cd", resultInfo.BU_CD); $NC.setValue("#edtQBu_Nm", resultInfo.BU_NM); } else { $NC.setValue("#edtQBu_Cd"); $NC.setValue("#edtQBu_Nm"); $NC.setFocus("#edtQBu_Cd", true); } // 브랜드 초기화 $NC.setValue("#edtQBrand_Cd"); $NC.setValue("#edtQBrand_Nm"); onChangingCondition(); } /** * 검색조건의 브랜드 검색 팝업 클릭 */ function showBuBrandPopup() { var BU_CD = $NC.getValue("#edtQBu_Cd"); $NP.showBuBrandPopup({ P_BU_CD: BU_CD, P_BRAND_CD: "%" }, onBuBrandPopup, function() { $NC.setFocus("#edtQBrand_Cd", true); }); } /** * 정산처 팝업 클릭 */ function showLblListPopup() { $NC.G_MAIN.showProgramSubPopup({ PROGRAM_ID: "LF01031P", PROGRAM_NM: "정산내역처리 및 생성", url: "lf/LF01031P.html", width: 350, height: 300, onOk: function() { _Inquiry(); } }); } /** * 검색조건의 브랜드 검색 팝업 클릭 */ function showOwnBranPopup() { var BU_CD = $NC.getValue("#edtQBu_Cd"); var CUST_CD = '0000'; $NP.showOwnBranPopup({ P_CUST_CD: CUST_CD, P_BU_CD: BU_CD, P_OWN_BRAND_CD: '%' }, onOwnBrandPopup, function() { $NC.setFocus("#edtQOwn_Brand_Cd", true); }); } /** * 브랜드 검색 결과 * * @param seletedRowData */ function onOwnBrandPopup(resultInfo) { if (!$NC.isNull(resultInfo)) { $NC.setValue("#edtQOwn_Brand_Cd", resultInfo.OWN_BRAND_CD); $NC.setValue("#edtQOwn_Brand_Nm", resultInfo.OWN_BRAND_NM); } else { $NC.setValue("#edtQOwn_Brand_Cd"); $NC.setValue("#edtQOwn_Brand_Nm"); $NC.setFocus("#edtQOwn_Brand_Cd", true); } onChangingCondition(); } /** * 검색조건의 정산항목 검색 이미지 클릭 */ function showFee_Head_CdPopup() { $NP.showFee_Head_CdPopup({ P_BU_CD: $NC.getValue("#edtQBu_Cd"), P_CENTER_FUNC_DIV: '%', P_FEE_HEAD_CD: '%' }, onHeadPopup, function() { $NC.setFocus("#edtQFee_Head_Cd", true); }); } function onHeadPopup(resultInfo) { if (!$NC.isNull(resultInfo)) { $NC.setValue("#edtQFee_Head_Cd", resultInfo.FEE_HEAD_CD); $NC.setValue("#edtQFee_Head_Nm", resultInfo.FEE_HEAD_NM); } else { $NC.setValue("#edtQFee_Head_Cd"); $NC.setValue("#edtQFee_Head_Nm"); $NC.setFocus("#edtQFee_Head_Cd", true); } // onChangingCondition(); } /** * 검색조건의 세부코드 검색 이미지 클릭 */ function showFee_Base_CdPopup() { var FEE_HEAD_CD = $NC.getValue("#edtQFee_Head_Cd"); $NP.showFee_Base_CdPopup({ P_BU_CD: $NC.getValue("#edtQBu_Cd"), P_FEE_HEAD_CD: FEE_HEAD_CD, P_FEE_BASE_CD: "%" }, onBasePopup, function() { $NC.setFocus("#edtQFee_Base_Cd", true); }); } function onBasePopup(resultInfo) { if (!$NC.isNull(resultInfo)) { $NC.setValue("#edtQFee_Base_Cd", resultInfo.FEE_BASE_CD); $NC.setValue("#edtQFee_Base_Nm", resultInfo.FEE_BASE_NM); } else { $NC.setValue("#edtQFee_Base_Cd"); $NC.setValue("#edtQFee_Base_Nm"); $NC.setFocus("#edtQFee_Base_Cd", true); } // onChangingCondition(); } function grdDetailOnCalc(rowData) { rowData.FEE_AMT = rowData.FEE_QTY * rowData.UNIT_PRICE;// 매입단가 또는 공급단가 return rowData; } function onBase1Popup(resultInfo) { var rowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); if ($NC.isNull(rowData)) { return; } var focusCol; if (!$NC.isNull(resultInfo)) { rowData.FEE_BASE_CD = resultInfo.FEE_BASE_CD; rowData.FEE_BASE_NM = resultInfo.FEE_BASE_NM; focusCol = G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"); } else { rowData.BRAND_CD = ""; rowData.BRAND_NM = ""; focusCol = G_GRDT1DETAIL.view.getColumnIndex("FEE_BASE_CD"); } if (rowData.CRUD === "R") { rowData.CRUD = "U"; } G_GRDT1DETAIL.data.updateItem(rowData.id, rowData); // 수정 상태로 변경 G_GRDT1DETAIL.lastRowModified = true; $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, focusCol, true, true); } /** * 그리드에서 위탁사 선택/취소 했을 경우 처리 * * @param seletedRowData */ function onHead1Popup(resultInfo) { var rowData = G_GRDT1DETAIL.data.getItem(G_GRDT1DETAIL.lastRow); if ($NC.isNull(rowData)) { return; } var focusCol; if (!$NC.isNull(resultInfo)) { rowData.FEE_HEAD_CD = resultInfo.FEE_HEAD_CD; rowData.FEE_HEAD_NM = resultInfo.FEE_HEAD_NM; focusCol = G_GRDT1DETAIL.view.getColumnIndex("FEE_BASE_CD"); } else { rowData.FEE_HEAD_CD = ""; rowData.FEE_HEAD_NM = ""; focusCol = G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"); } if (rowData.CRUD === "R") { rowData.CRUD = "U"; } G_GRDT1DETAIL.data.updateItem(rowData.id, rowData); // 수정 상태로 변경 G_GRDT1DETAIL.lastRowModified = true; $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, focusCol, true, true); } /** * 그리드 입력 체크 * * @param row */ function grdDetailOnBeforePost(row) { if (!G_GRDT1DETAIL.lastRowModified) { return true; } var rowData = G_GRDT1DETAIL.data.getItem(row); if ($NC.isNull(rowData)) { return true; } // 삭제 데이터면 Return if (rowData.CRUD == "D") { return true; } // 신규일 때 키 값이 없으면 신규 취소 if (rowData.CRUD == "N") { if ($NC.isNull(rowData.FEE_BASE_CD) || $NC.isNull(rowData.FEE_HEAD_CD)) { G_GRDT1DETAIL.data.deleteItem(rowData.id); if (row > 0) { $NC.setGridSelectRow(G_GRDT1DETAIL, row - 1); } return true; } } if (rowData.CRUD != "R") { if ($NC.isNull(rowData.FEE_HEAD_CD)) { alert("정산항목을 선택하십시오."); $NC.setGridSelectRow(G_GRDT1DETAIL, row); $NC.setFocusGrid(G_GRDMASTER, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_HEAD_CD"), true); return false; } if ($NC.isNull(rowData.FEE_BASE_CD)) { alert("세부코드을 선택하십시오."); $NC.setGridSelectRow(G_GRDT1DETAIL, row); $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_BASE_CD"), true); return false; } if ($NC.isNull(rowData.UNIT_PRICE)) { alert("정산단가를 입력하십시오."); $NC.setGridSelectRow(G_GRDT1DETAIL, row); $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("UNIT_PRICE"), true); return false; } if ($NC.isNull(rowData.FEE_QTY)) { alert("정산수량을 입력하십시오."); $NC.setGridSelectRow(G_GRDT1DETAIL, row); $NC.setFocusGrid(G_GRDT1DETAIL, G_GRDT1DETAIL.lastRow, G_GRDT1DETAIL.view.getColumnIndex("FEE_QTY"), true); return false; } } if (rowData.CRUD == "N") { rowData.CRUD = "C"; G_GRDT1DETAIL.data.updateItem(rowData.id, rowData); } return true; }
import {retailId,retail} from "./_retail"; function StbNull() { } if (retailId == retail.gxgd) {// 广西广电 ===================================== StbNull.prototype = { getCardTV: function () { return guangxi.getStbNum(); }, getRegionCode: function () { return iPanel.getGlobalVar("GET_MEDIA_REGION_ID"); }, getValue: function (keyName) { var result = null; try { result = iPanel.getGlobalVar(keyName); } catch (e) { var aCookie = document.cookie.split("; "); for (var i = 0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (escape(keyName) == aCrumb[0]) { result = unescape(aCrumb[1]); break; } } } if (!result || result == "#" || result == "clearValue") { result = ""; } return result; }, setValue: function (keyName, keyValue) { if (keyValue == "") { keyValue = "clearValue"; } try { iPanel.setGlobalVar(keyName, keyValue); } catch (e) { document.cookie = escape(keyName) + "=" + escape(keyValue); } } }; } else if (retailId == retail.hnyx) {// 河南有线 ===================================== var System = window.System; StbNull.prototype = { getCardTV: function () { return System.stbID; }, getRegionCode: function () { var region = 'hnyx'; try { region = System.GetCARegionID(); } catch (e) { } return region }, getValue: function (keyName) { var g = null; if (!g) { try { g = new Global(keyName); } catch (e) { } } if (!g) { try { g = new Global2(keyName); } catch (e) { } } if (!g) { g = {value: null}; } return g.value; }, setValue: function (keyName, keyValue) { var g = null; if (!g) { try { g = new Global(keyName); } catch (e) { } } if (!g) { try { g = new Global2(keyName); } catch (e) { } } if (!g) { return; } g.value = keyValue; } }; } else if (retailId == retail.gdgd) {// 广东广电 ===================================== StbNull.prototype = { getCardTV: function () { if (!CA.icNo) { return '9695610086'; } return CA.icNo; }, getRegionCode: function () { return CA.regionCode; }, getValue: function (keyName) { return SysSetting.getEnv(keyName); }, setValue: function (keyName, keyValue) { SysSetting.setEnv(keyName, keyValue); } }; } else { StbNull.prototype = { getCardTV: function () { return '10086'; }, getRegionCode: function () { return '0'; }, getValue: function (keyName) { let result = ''; const aCookie = document.cookie.split("; "); for (let i = 0; i < aCookie.length; i++) { const aCrumb = aCookie[i].split("="); if (escape(keyName) == aCrumb[0]) { result = unescape(aCrumb[1]); break; } } return result; }, setValue: function (keyName, keyValue) { document.cookie = escape(keyName) + "=" + escape(keyValue); } }; } var stbNull = new StbNull(); export {StbNull,stbNull}
const Header = ({onAdd, showAdd}) => { console.log(onAdd) console.log(showAdd) return ( <div className="d-flex p-3 justify-content-between mb-4"> <h1 className="text-success">Task Tracker</h1> <button type="button" className={showAdd ? "btn btn-outline-danger" : "btn btn-outline-success"} onClick={onAdd}>{showAdd ? 'Close':'Add'}</button> </div> ) } export default Header
import React from "react"; import { CgMaximizeAlt, CgMinimizeAlt } from "react-icons/cg"; export default function Window({ children, title, icon, onClick, show, scroll, }) { return ( <div className={`window${show ? "" : " hide"}${scroll ? "" : " no-scroll"}`} > <div className="window-bar"> <span className="window-bar-icon">{icon}</span> <span className="window-bar-title">{title}</span> <button className="show-hide-btn" onClick={onClick}> {show ? <CgMinimizeAlt /> : <CgMaximizeAlt />} </button> </div> <div className="window-body">{children}</div> </div> ); }
import React from "react" import Layout from "../components/layout" const ContactPage = () => { return ( <Layout> <h1>Contact Me</h1> <p> You can contact me directly on my Twitter handle{" "} <a href="https://twitter.com/@tabiso" target="_blank" rel="noopener noreferrer" > @tabiso </a> </p> </Layout> ) } export default ContactPage
/* PokerAlgorithm - version two 为癞子而生 癞子可变为点数 [3-15] ll -> laizi nn -> normal ln -> laizinumber 癞子可以和其他牌搭配成各种牌型,但癞子单独出时不能当做万能牌,只能作为其本身使用。 比如说三张癞子 */ let PokerAlgorithm = require("./PokerAlgorithm"); cc.Class({ properties: { TAG: "PokerAlgorithmVT", laizi: null, }, ctor() { this.pa = new PokerAlgorithm(); }, getPA() { return this.pa; }, /* 拖选一堆牌时,给出的智能提示 cards poker对象数组 */ getSmartCards(cards) { let self = this; let cardsSplit = self.seqCards(cards); let llcards = cardsSplit.lCards, nncards = cardsSplit.nCards; let retInfo = { tb: null, cardType: null }; //不是癞子玩法 if (isValidType(self.laizi) || self.laizi <= 2 || llcards.length === 0) return this.pa.getSmartCards(cards); logd("-----getSmartCards-----" + self.laizi, self.TAG); let cardType = qf.const.LordPokerType.UNKOWNTYPE; //4个以上的不提示 //mark by Gallen if (this.pa.getCardType(c3) !== qf.const.LordPokerType.UNKOWNTYPE) return retInfo; let obj3 = self.getMaxContinuousWithLaizi(llcards, nncards, 3); //凑三个连续最大的 let c3 = obj3.tb, l3 = obj3.len; let obj2 = self.getMaxContinuousWithLaizi(llcards, nncards, 2); //凑两个连续最大的 let c2 = obj2.tb, l2 = obj2.len; let obj1 = self.getMaxContinuousWithLaizi(llcards, nncards, 1); //凑一个连续最大的 let c1 = obj1.tb, l1 = obj1.len; let sObj3 = this.pa.getSmartCards(c3); let ret3 = sObj3.tb, ltype3 = sObj3.cardType; let retInfo3 = { tb: ret3, cardType: ltype3 }; if (ltype3 === qf.const.LordPokerType.FEIJI || ltype3 === qf.const.LordPokerType.FEIJI2 || ltype3 === qf.const.LordPokerType.FEIJI1) { return retInfo3; } let sObj2 = this.pa.getSmartCards(c2); let ret2 = sObj2.tb, ltype2 = sObj2.cardType; let retInfo2 = { tb: ret2, cardType: ltype2 }; if (ltype2 === qf.const.LordPokerType.SHUNZIDUIZI) return retInfo2; let sObj1 = this.pa.getSmartCards(c1); let ret1 = sObj1.tb, ltype1 = sObj1.cardType; let retInfo1 = { tb: ret1, cardType: ltype1 }; if (ltype1 === qf.const.LordPokerType.SHUNZI) return retInfo1; /* let sObj3 = this.pa.getSmartCards(c3); let ret3 = sObj3.tb, ltype3 = sObj3.cardType; let retInfo3 = {tb: ret3, cardType: ltype3}; */ if (ltype3 === qf.const.LordPokerType.SAN || ltype3 === qf.const.LordPokerType.SANDAI1 || ltype3 === qf.const.LordPokerType.SANDAIDUIZI) { return retInfo3; } /* let sObj2 = this.pa.getSmartCards(c2); let ret2 = sObj2.tb, ltype2 = sObj2.cardType; let retInfo2 = {tb: ret2, cardType: ltype2}; */ if (ltype2 === qf.const.LordPokerType.DUIZI) return retInfo2; return retInfo; }, //根据短型数组 serialization2(tt) { let self = this; let t = self.values(tt); let ret = ""; for (let k in t) { let v = t[k]; ret = ret + this.pa._serialization(v, k); } return ret; }, //根据癞子,凑成最大连续的牌 //返回完整的 getMaxContinuousWithLaizi(llcards, nncards, height) { let self = this; let retInfo = { tb: null, len: null }; let nc = self.values(this.pa.getShortIDByLong(nncards)); let lc = self.values(this.pa.getShortIDByLong(llcards)); //炸弹特别判断 //dump(llcards) //dump(nncards) //dump(height) if (llcards.length === 3 && nncards.length === 1 && height === 4) { logd("---------软炸弹---------"); let ret = []; self.contact(ret, nncards); self.contact(ret, llcards); for (let i = 1; i < 4; i++) { ret.push(nncards[0]); } retInfo.tb = ret; retInfo.len = 1; return retInfo; } let index = [3, 3]; let tindex = [3, 3]; let lln = llcards.length; let llc = []; let lastllcards = []; let swap = () => { if (tindex[1] - tindex[0] >= index[1] - index[0]) { index[1] = tindex[1] index[0] = tindex[0]; lastllcards = self.copy(llc); } } let getMaxinOnce = (start) => { for (let i = start; i <= qf.pokerconfig.pokerA; i++) { let laizin = (height - (nc[i] || 0)); laizin = laizin < 0 ? 0 : laizin; //print(i, laizin, lln); if (lln >= laizin) { for (let j = 0; j < laizin; j++) { llc.push(i); } lln = lln - laizin; tindex[1] = i + 1; } else { //从这里断开了 swap(); return; } } swap(); } for (let z = 3; z <= qf.pokerconfig.pokerA; z++) { tindex = [z, z]; llc = []; lln = llcards.length; getMaxinOnce(z); } swap(); //dump(index); //dump(lastllcards); let ret = []; self.contact(ret, nncards); self.contact(ret, llcards); if (index[1] - index[0] === 0) { logd("======没有连续的,看看有没有2======"); let need2 = (height - (nc[qf.pokerconfig.poker2] || 0)); need2 = need2 < 0 ? 0 : need2; if (llcards.length >= need2) { for (let i = 0; i < need2; i++) { ret[ret.length - i] = qf.pokerconfig.shortIDToLong(qf.pokerconfig.poker2); } } retInfo.tb = ret; retInfo.len = 1; return retInfo; } else { for (let i in lastllcards) { let k = qf.func.checkint(i); let v = lastllcards[k]; ret[ret.length - k] = qf.pokerconfig.shortIDToLong(v); } retInfo.tb = ret; retInfo.len = index[1] - index[0]; return retInfo; } }, //看看选中中牌堆中,是否包含提示列表 /*promitTable是癞子改变后的牌 markcards 是包含癞子的牌 囧,先把变成癞子的牌promitTable,还原为原来的牌*/ getSmartCardsInPromitTable(markCards, promitTable, pokers) { let self = this; if (!self.laizi || self.laizi <= 2) return this.pa.getSmartCardsInPromitTable(markCards, promitTable); let fullcards = []; for (let i in pokers) { let v = pokers[i]; fullcards.push(self.convertCardsToValue(v.id)); } for (let i in promitTable) { let v = promitTable[i]; let r = this.pa.getSmartCardsInPromitTable(markCards, self.toRealCards(fullcards, v)) if (r) return r; } return null; }, //看看选中牌堆中,提示列表是否包含 /*promitTable是癞子改变后的牌 markcards 是包含癞子的牌 囧,先把变成癞子的牌promitTable,还原为原来的牌*/ getSmartCardsInPromitTable1(markCards, promitTable, pokers) { let self = this; if (!self.laizi || self.laizi <= 2) return this.pa.getSmartCardsInPromitTable1(markCards, promitTable); let fullcards = []; for (let i in pokers) { let v = pokers[i]; fullcards.push(self.convertCardsToValue(v.id)); } for (let i in promitTable) { let v = promitTable[i]; let r = this.pa.getSmartCardsInPromitTable1(markCards, self.toRealCards(fullcards, v)); if (r) return r; } return null; }, toRealCards(fullcards, sv) { let self = this; //dump(sv); let fullPreTable = this.pa.genPreTable(fullcards); let fb = fullPreTable.buckets, fh = fullPreTable.maxBucketHeight, fl = fullPreTable.bucketLen; let t = self.unSerialization(sv); let nln = 0; let ret = ""; for (let k in t) { let v = t[k]; if (fb[k]) { if (fb[k] >= v) { ret = ret + this.pa._serialization(v, k); fb[k] = fb[k] - v; } else { ret = ret + this.pa._serialization(fb[k], k); nln = nln + v - fb[k]; fb[k] = 0; } } else nln = nln + v; } if (fb[self.laizi] && fb[self.laizi] >= nln) { ret = ret + this.pa._serialization(nln, self.laizi); return [ret]; } return []; }, /*检查 是否大于上家牌 若上家牌为空, 也就是随便出牌,需要特别处理*/ checkCanSendCards(_nowcards, _precards, laizinumber) { let self = this; logd("======checkCanSendCards======"); /*1.先检查牌是否能出,若能出则出牌 2.再检查癞子 3.果断生成promit一次,若有结果*/ let cObj = self.seqCards(_nowcards); //分离癞子和普通牌 let llcards = cObj.lCards, nncards = cObj.nCards; let retInfo = { cardType: qf.const.LordPokerType.UNKOWNTYPE, isCanSend: false, canSendCards: null, }; let canSendObj = this.pa.checkCanSendCards(_nowcards, _precards); let rtype = canSendObj.cardType, tret = canSendObj.isCanSend; //4张牌往外抛 if (tret && _precards.length !== 4 && _nowcards.length !== 4) { retInfo.cardType = rtype; retInfo.isCanSend = tret; return retInfo; } if (_precards.length === 0) { logd("======轮到自己出牌了======"); let obj4 = self.getMaxContinuousWithLaizi(llcards, nncards, 4); //凑四个连续最大的 let c4 = obj4.tb, l4 = obj4.len; if (this.pa.getCardTypeWithFullId(c4) !== qf.const.LordPokerType.UNKOWNTYPE) { //炸弹,4带2对,4带2个 retInfo.cardType = qf.const.LordPokerType.UNKOWNTYPE; retInfo.isCanSend = true; retInfo.canSendCards = [self.serialization2(this.pa.getShortIDByLong(c4))]; return retInfo; } let obj3 = self.getMaxContinuousWithLaizi(llcards, nncards, 3); //凑三个连续最大的 let c3 = obj3.tb, l3 = obj3.len; if (this.pa.getCardTypeWithFullId(c3) !== qf.const.LordPokerType.UNKOWNTYPE) { retInfo.cardType = qf.const.LordPokerType.UNKOWNTYPE; retInfo.isCanSend = true; retInfo.canSendCards = [self.serialization2(this.pa.getShortIDByLong(c3))]; } let obj2 = self.getMaxContinuousWithLaizi(llcards, nncards, 2); //凑两个连续最大的 let c2 = obj2.tb, l2 = obj2.len; if (this.pa.getCardTypeWithFullId(c2) !== qf.const.LordPokerType.UNKOWNTYPE) { retInfo.cardType = qf.const.LordPokerType.UNKOWNTYPE; retInfo.isCanSend = true; retInfo.canSendCards = [self.serialization2(this.pa.getShortIDByLong(c2))]; } let obj1 = self.getMaxContinuousWithLaizi(llcards, nncards, 1); //凑一个连续最大的 let c1 = obj3.tb, l1 = obj1.len; if (this.pa.getCardTypeWithFullId(c1) !== qf.const.LordPokerType.UNKOWNTYPE) { retInfo.cardType = qf.const.LordPokerType.UNKOWNTYPE; retInfo.isCanSend = true; retInfo.canSendCards = [self.serialization2(this.pa.getShortIDByLong(c1))]; } return retInfo; } else { logd("======要控别人的牌======"); let cansend = self.promit(_nowcards, _precards, laizinumber); if (cansend.length !== 0) { let cObj = self.checkCanSendCards2(_nowcards, cansend); retInfo.cardType = cObj.cardType; retInfo.isCanSend = cObj.isCanSend; retInfo.canSendCards = cObj.canSendCards; return retInfo; } else return retInfo; } }, //检查大于牌第二不,出的牌跟最终结果检查 checkCanSendCards2(_nowcards, cansend) { let self = this; let retInfo = { cardType: qf.const.LordPokerType.UNKOWNTYPE, isCanSend: false, canSendCards: null, }; let ret = []; for (let k1 in cansend) { let v1 = cansend[k1]; let t = this.pa.unSerialization(v1) let n = 0; for (let k2 in t) { let v2 = t[k2]; n = n + v2; } if (n === _nowcards.length) ret.push(v1); } if (ret.length === 0) { return retInfo; } retInfo.isCanSend = true; retInfo.canSendCards = ret; return retInfo; }, //提示功能 promit(selfCards, _lastCards, laizinumber) { let self = this; if (_lastCards.length === 0) return this.pa.promit(selfCards, _lastCards); //无提示 laizinumber = laizinumber || 0; let ltype = this.pa.getCardTypeWithFullId(_lastCards); //获取牌型 let cObj = self.seqCards(selfCards); //分离癞子和普通牌 let llcards = cObj.lCards, nncards = cObj.nCards; let tret = null; if (qf.const.LordPokerType.ZHADAN === ltype) { //炸弹 if (laizinumber > 0 && laizinumber < 4) { //软炸弹 logd("=====软炸弹====="); tret = self.getAllRuanZhaDan(llcards, nncards, Math.floor(_lastCards[0] / 4) + 3); //添加软炸 self.contact(tret, self.getAllNormallZhaDan(selfCards)); //添加普通炸弹 self.contact(tret, self.getWangZha(selfCards)); //添加王炸 return tret; } else if (laizinumber === 4 || (Math.floor(_lastCards[0] / 4) + 3) === self.laizi) { //硬炸弹 return self.getWangZha(selfCards); //硬炸弹只有王炸能解决 } else { //普通炸弹,只能由硬炸弹上 logd("=====普通炸弹====="); tret = self.getAllYingZhadan(selfCards); self.contact(tret, self.getAllNormallZhaDan(selfCards, Math.floor(_lastCards[0] / 4) + 3)); self.contact(tret, self.getWangZha(selfCards)); return tret; } } if (qf.const.LordPokerType.DANZHANG === ltype) { tret = this.pa.promit(selfCards, _lastCards); self.contact(tret, self.getAllRuanZhaDan(llcards, nncards, 2)); self.contact(tret, self.getAllNormallZhaDan(selfCards)); self.contact(tret, self.getAllYingZhadan(selfCards)); self.contact(tret, self.getWangZha(selfCards)); tret = self.makeSet(tret); return tret; } if (qf.const.LordPokerType.DUIZI === ltype) { //对子,把其中一个癞子变成最大的牌 logd("=====对子提示====="); tret = this.pa.promit(self.promitLaiziWithDuizi(llcards, nncards), _lastCards); self.contact(tret, self.getAllRuanZhaDan(llcards, nncards, 2)); self.contact(tret, self.getAllNormallZhaDan(selfCards)); self.contact(tret, self.getAllYingZhadan(selfCards)); self.contact(tret, self.getWangZha(selfCards)); tret = self.makeSet(tret); return tret; } //这种需要找连续的 //按如下思路 //假设对方是从456789 /* 1.从5到A遍历,寻找是否有连续大于的,寻找过程中,使用癞子插空 2.添加软炸弹和硬炸弹(王炸和普通炸弹前面已经判断过) */ if (qf.const.LordPokerType.SHUNZI === ltype || qf.const.LordPokerType.SHUNZIDUIZI === ltype || qf.const.LordPokerType.FEIJI === ltype || qf.const.LordPokerType.FEIJI1 === ltype || qf.const.LordPokerType.FEIJI2 === ltype || qf.const.LordPokerType.SAN === ltype || qf.const.LordPokerType.SANDAI1 === ltype || qf.const.LordPokerType.SANDAIDUIZI === ltype || qf.const.LordPokerType.ZHADAN2 === ltype || qf.const.LordPokerType.ZHADAN4 === ltype) { logd("======提示连续的情况======"); tret = self.promitLaiziWithContinuous(llcards, nncards, _lastCards); self.contact(tret, self.getAllRuanZhaDan(llcards, nncards, 2)); //添加软炸弹 self.contact(tret, self.getAllNormallZhaDan(selfCards)); self.contact(tret, self.getAllYingZhadan(selfCards)); self.contact(tret, self.getWangZha(selfCards)); tret = self.makeSet(tret); return tret; } return []; }, getAllNormallZhaDan(cards, start) { let self = this; start = start || 2; let tPreTable = this.pa.genPreTable(this.pa.getShortIDByLong(cards)); let tb = tPreTable.buckets, th = tPreTable.maxBucketHeight, tl = tPreTable.bucketLen; let ret = []; for (let k in tb) { let v = tb[k]; if (v === 4 && k !== self.laizi && k > start) { //ret.splice(ret.length - 1, 1, this.pa._serialization(4, k)); ret.push(this.pa._serialization(4, k)); } } return ret; }, getWangZha(cards) { let self = this; let tPreTable = this.pa.genPreTable(this.pa.getShortIDByLong(cards)); let tb = tPreTable.buckets, th = tPreTable.maxBucketHeight, tl = tPreTable.bucketLen; if (tb[qf.pokerconfig.pokerSJ] && tb[qf.pokerconfig.pokerBJ]) return [this.pa._serialization(1, qf.pokerconfig.pokerSJ) + this.pa._serialization(1, qf.pokerconfig.pokerBJ)]; return []; }, getAllRuanZhaDan(llcards, nncards, start) { let self = this; let tPreTable = this.pa.genPreTable(this.pa.getShortIDByLong(llcards)); let tb = tPreTable.buckets, th = tPreTable.maxBucketHeight, tl = tPreTable.bucketLen; let ret = []; for (let i = start + 1; i <= qf.pokerconfig.poker2; i++) { let vv = tb[i] || 0; if (llcards.length + vv >= 4) ret.push(this.pa._serialization(4, i)); } return ret; }, getAllYingZhadan(cards) { let self = this; let tPreTable = this.pa.genPreTable(this.pa.getShortIDByLong(cards)); let tb = tPreTable.buckets, th = tPreTable.maxBucketHeight, tl = tPreTable.bucketLen; let ret = []; for (let k in tb) { let v = tb[k]; if (v === 4 && k === self.laizi) ret.push(this.pa._serialization(4, k)); } return ret; }, promitLaiziWithDuizi(llcards, nncards) { let self = this; if (llcards.length === 0) return nncards; //如果没有癞子,直接返回 nncards.sort(qf.utils.compareNumByIncrs); for (let i = nncards.length - 1; i <= 0; i--) { let v = nncards[i]; if (!self.isJoker(self.convertCardsToValue(v))) { let tnncards = []; self.contact(tnncards, nncards); self.contact(tnncards, llcards); tnncards[tnncards.length - 1] = v; //改变一个癞子为最大的非王手牌 return tnncards; } } return nncards; }, promitLaiziWithContinuous(_llcards, _nncards, _lastCards) { let self = this; let llcards = self.convertCardsToValueArray(_llcards); let nncards = self.convertCardsToValueArray(_nncards); let lastCards = self.convertCardsToValueArray(_lastCards); nncards.sort(qf.utils.compareNumByIncrs); lastCards.sort(qf.utils.compareNumByIncrs); let nowPreTable = this.pa.genPreTable(nncards); let prePreTable = this.pa.genPreTable(lastCards); //buckets[k] = v, k为点数, v为张数 let nb = nowPreTable.buckets, nh = nowPreTable.maxBucketHeight, nl = nowPreTable.bucketLen; let lb = prePreTable.buckets, lh = prePreTable.maxBucketHeight, ll = prePreTable.bucketLen; let fisrt = 0; let continuousLen = 0; for (let i in lb) { let v = lb[i]; let k = qf.func.checkint(i); if (v === lh) { if (0 === fisrt) fisrt = k; //找第一次 else if (k <= fisrt) fisrt = k; continuousLen = continuousLen + 1; } } continuousLen = continuousLen - 1; //lua 循环闭区间 logd("======Continuous fisrt======" + (fisrt + 1)); logd("======continuousLen======" + continuousLen); let endflag = continuousLen === 0 ? qf.pokerconfig.poker2 : qf.pokerconfig.pokerA; //如果连续为0,也就是三带1,一堆啥的,可以查找到2 let ret = []; for (let i = fisrt + 1; i <= endflag; i++) { let needLaiziNumber = 0; if (i + continuousLen <= endflag) { for (let j = i; j <= i + continuousLen; j++) { if (!nb[j]) needLaiziNumber = needLaiziNumber + lh; else needLaiziNumber = needLaiziNumber + (lh - nb[j] < 0 ? 0 : lh - nb[j]); } logd("======needLaiziNumber======" + needLaiziNumber); if (needLaiziNumber <= llcards.length) { let newcards = []; self.contact(newcards, _nncards); self.contact(newcards, _llcards); let laiziindex = newcards.length - 1; for (let j = i; j <= i + continuousLen; j++) { let tv2 = nb[j] || 0; let count = ((lh - tv2) < 0 ? 0 : lh - tv2); for (let k = 1; k < count; k++) { newcards[laiziindex] = (j - 3) * 4; laiziindex = laiziindex - 1; } } if (continuousLen === 0 && needLaiziNumber === lh && lh === 3) { } else { self.contact(ret, this.pa.promit(newcards, _lastCards)); } } } } ret = self.makeSet(ret); let result = []; if (ret && ret.length > 0) { result = self.checkWangZhaSet(ret); } else { result = ret; } return result; }, //去掉王炸和其他牌型组合 checkWangZhaSet(ret) { let self = this; let result = []; for (let k in ret) { let v = ret[k]; let tt = self.unSerialization(v); let num = 0; for (let i in tt) { num = num + 1; } if (num > 2 && tt[qf.pokerconfig.pokerSJ] && tt[qf.pokerconfig.pokerBJ]) { //王炸和其他组合不能出牌 } else { result.push(v); } } return result; }, //去重 makeSet(ttt) { let self = this; let hh = {}; let ret = []; for (let k in ttt) { let v = ttt[k]; if (!hh[v]) { ret.push(v); hh[v] = 1; } } return ret; }, convertCardsToValueArray(cards) { let self = this; let r = []; for (let k in cards) { let v = cards[k]; r.push(self.convertCardsToValue(v)); } return r; }, convertCardsToValue(v) { let self = this; return Math.floor(v / 4) + 3; }, isJoker(v) { let self = this; return v === qf.pokerconfig.pokerSJ || v === qf.pokerconfig.pokerBJ; }, getCardTypeWithFullId(cards) { let self = this; return this.pa.getCardTypeWithFullId(cards); }, serialization(hash, start, endd, number) { let self = this; return this.pa.serialization(hash, start, endd, number) }, unSerialization(str) { let self = this; return this.pa.unSerialization(str) }, copy(ttt) { let self = this; let ret = []; for (let k in ttt) { let v = ttt[k]; ret.push(v); } return ret; }, //分离牌,到癞子和普通牌 seqCards(cards) { let self = this; let retInfo = { nCards: [], lCards: [] }; for (let k in cards) { let v = cards[k]; if ((Math.floor(v / 4) + 3) === self.laizi) retInfo.lCards.push(v); else retInfo.nCards.push(v); } return retInfo; }, //比对长数组和序列化的短串 getLaiziHash(origincards, laizistr) { let self = this; let origin = self.values(this.pa.getShortIDByLong(origincards)); let laizic = self.values(this.pa.getShortIDBySerialization(laizistr)); return self._getLaiziHash(origin, laizic); }, //比对两个数组,得出癞子牌 _getLaiziHash(origin, laizic) { let self = this; let ret = []; for (let k in laizic) { let v = laizic[k]; if (!origin[k]) { for (let i = 1; i <= v; i++) { ret.push(k); } } else if (origin[k] < v) { for (let i = 1; i <= v - origin[k]; i++) { ret.push(k); } } } return ret; }, //对比两个长数组,得出癞子牌 getLaiziHash2(longorigin, longlaizi) { let self = this; let origin = self.values(this.pa.getShortIDByLong(longorigin)); let laizic = self.values(this.pa.getShortIDByLong(longlaizi)); return self._getLaiziHash(origin, laizic); }, //把序列化的癞子牌变成长id数组 seriStrToLongCards(origincards, laizistr) { let self = this; let origin = self.values(this.pa.getShortIDByLong(origincards)); let laizic = self.values(this.pa.getShortIDBySerialization(laizistr)); let laizicards = self._getLaiziHash(origin, laizic); if (laizicards.length === 0) return []; //dump(laizicards) let laiziindex = 0; let ret = self.copy(origincards); for (let k in ret) { let v = ret[k]; if (self.convertCardsToValue(v) === self.laizi && laizicards.length >= laiziindex) { let to = laizicards[laiziindex]; laiziindex = laiziindex + 1; ret.push(qf.pokerconfig.shortIDToLong(to)); } } //dump(origincards); //dump(ret); return ret; }, values(t) { let self = this; let ret = {}; for (let k in t) { let v = t[k]; ret[v] = (ret[v] || 0) + 1; } return ret; }, contact(a, b) { let self = this; if (b instanceof Array) { for (let k in b) { let v = b[k]; a.push(v); } } else { a.push(b); } return a; }, });
import React from 'react'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; import {userService} from '../services/UserService'; import {Redirect} from 'react-router-dom'; class Login extends React.Component { constructor() { super(); this.state = { username: '', password: '', message: '' } this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); } handleChange(event) { const { name, value } = event.target; this.setState({ [name]: value } ); } async handleSubmit(event) { event.preventDefault(); var res = await userService.login(this.state.username, this.state.password); this.setState({ message: res ? 'Success' : 'Failed to login' }); } render(){ const { username, password } = this.state; return( <div> <h2>Login</h2> <p>{this.state.message}</p> {this.state.message === 'Success' ? <Redirect to='/models'/> : null} <form> <div> <TextField label = "Username" type="text" name="username" value={username} onChange={this.handleChange} /> </div> <div> <TextField label="Password" type="password" name="password" value={password} onChange={this.handleChange} /> </div> <div> <br/> <Button onClick={this.handleSubmit}>Submit</Button> </div> </form> </div> ) } } export default Login;
import React, {Component} from 'react' import './../index.css' import uuid from 'uuid'; import PropTypes from 'prop-types'; class Form extends Component { petNameRef = React.createRef(); ownerNameRef = React.createRef(); dateRef = React.createRef(); hourRef = React.createRef(); symRef = React.createRef(); state = { error: false } createNewAppointment = (e) =>{ e.preventDefault(); const pet = this.petNameRef.current.value, owner = this.ownerNameRef.current.value, date = this.dateRef.current.value, hour = this.hourRef.current.value, symtoms = this.symRef.current.value if(pet === '' || owner === '' || date === '' || hour === '' || symtoms === '') { this.setState({ error: true, }) } else { const newAppointment = { id: uuid(), pet : pet, owner : owner, date: date, hour: hour, symtoms: symtoms } this.props.createNewAppointment(newAppointment); e.currentTarget.reset(); this.setState({ error: false, }) } } render(){ const error = this.state.error; return( <div className= "card mt-5"> <div className="card-body"> <h2 className= "card-title text-center mb-5"> Add your appointments here: </h2> <form onSubmit={this.createNewAppointment}> <div className="form-group row"> <label className="col-sm-4 col-lg-2 col-form-label">Pet's name</label> <div className="col-sm-8 col-lg-10"> <input ref={this.petNameRef} type="text" className="form-control" placeholder="Pet's name" /> </div> </div> <div className="form-group row"> <label className="col-sm-4 col-lg-2 col-form-label">Owner's name</label> <div className="col-sm-8 col-lg-10"> <input ref={this.ownerNameRef} type="text" className="form-control" placeholder="Owner's name"/> </div> </div> <div className="form-group row"> <label className="col-sm-4 col-lg-2 col-form-label">Date</label> <div className="col-sm-8 col-lg-4 mb-4 mb-lg-0"> <input ref={this.dateRef} type="date" className="form-control" /> </div> <label className="col-sm-4 col-lg-2 col-form-label">Hour</label> <div className="col-sm-8 col-lg-4"> <input ref={this.hourRef} type="time" className="form-control" /> </div> </div> <div className="form-group row"> <label className="col-sm-4 col-lg-2 col-form-label">Sympthoms</label> <div className="col-sm-8 col-lg-10"> <textarea ref={this.symRef} className="form-control"></textarea> </div> </div> <div className="form-group row justify-content-end"> <div className="col-sm-3"> <button type="submit" className="btn btn-success w-100">Add</button> </div> </div> </form> {error ? <div className='alert alert-danger text-center'>Please, fill the fields! </div>: ''} </div> </div> ); } } Form.proptype = { createNewAppointment : PropTypes.func.isRequired } export default Form;
'use strict'; function Login(){} Login.prototype.loginLinkText = function(){ element(by.linkText("login")).click(); }; Login.prototype.loginAuthenticate = function(){ element(by.buttonText('Authenticate')).click(); }; Login.prototype.enterUsernamePassword = function() { element(by.id('username')).sendKeys('admin'); element(by.id('password')).sendKeys('admin'); }; Login.prototype.loginAccountTab = function(){ element(by.cssContainingText('span.hidden-tablet.ng-scope','Account')).click().then(function(){ element(by.cssContainingText('span.ng-scope', 'Authenticate')).click(); }); }; Login.prototype.logoutFinal = function () { element(by.cssContainingText('span.hidden-tablet.ng-scope','Account')).click().then(function(){ element(by.cssContainingText('span.ng-scope', 'Log out')).click(); }); }; Login.prototype.loginFromRegisterTab = function(){ element(by.cssContainingText('span.hidden-tablet.ng-scope','Account')).click().then(function(){ element(by.cssContainingText('span.ng-scope', 'Register')).click(); }); }; Login.prototype.loginRegisterLink = function(){ element(by.linkText("Register a new account")).click(); }; Login.prototype.expectRememberUser = function() { expect(element(by.id('rememberMe')).getAttribute('class')).toEqual('ng-pristine ng-untouched ng-valid'); }; Login.prototype.redirectToHome = function () { element(by.cssContainingText('span.ng-scope', 'Home')).click(); }; Login.prototype.expectLogout = function(){ element(by.cssContainingText('span.hidden-tablet.ng-scope','Account')).click().then(function(){ expect(element(by.cssContainingText('span.ng-scope', 'Log out')).isPresent()).toBe(true); }); }; Login.prototype.expectRemeberUnchecked = function () { element(by.id('rememberMe')).click(); element(by.id('password')).click(); expect(element(by.id('rememberMe')).getAttribute('class')).toEqual('ng-valid ng-dirty ng-valid-parse ng-touched'); }; Login.prototype.expectForgotPassword = function(){ expect(element(by.cssContainingText('p.ng-scope', 'Enter the e-mail address you used to register')).isPresent()).toBe(true); }; Login.prototype.expectResetPassword = function(){ element(by.name('email')).sendKeys('admin@localhost'); element(by.buttonText('Reset password')).click(); expect(element(by.buttonText('Reset password')).isPresent()).toBe(true); }; Login.prototype.forgotPasswordLink = function(){ element(by.linkText("Did you forget your password?")).click(); }; Login.prototype.expectEmailLessCharacters = function(){ element(by.name('email')).sendKeys('admi'); expect(element(by.cssContainingText('p.help-block.ng-scope','Your e-mail is invalid.')).isPresent()).toBe(true); expect(element(by.cssContainingText('p.help-block.ng-scope','Your e-mail is required to be at least 5 characters.')).isPresent()).toBe(true); }; Login.prototype.expectEmailLongerCharacters = function () { element(by.name('email')).sendKeys('admikjhdkjhkhzhhfhfdhkjfhjdhfjdfhjkhkfhjdfhjkfhkjdhfzjkdfhkjzdfhzjkdfhzjkdfhkjzfhzkjhfkjzfhzkjfhkjdfdf'); expect(element(by.cssContainingText('p.help-block.ng-scope','Your e-mail is invalid.')).isPresent()).toBe(true); expect(element(by.cssContainingText('p.help-block.ng-scope','Your e-mail cannot be longer than 50 characters.')).isPresent()).toBe(true); }; Login.prototype.expectWrongEmail = function () { element(by.name('email')).sendKeys('adminst'); expect(element(by.cssContainingText('p.help-block.ng-scope','Your e-mail is invalid.')).isPresent()).toBe(true); }; Login.prototype.registerNewUser = function () { element(by.linkText("Register a new account")).click(); element(by.model('registerAccount.login')).sendKeys('krishna'); element(by.model('registerAccount.email')).sendKeys('krishna@localhost'); element(by.model('registerAccount.password')).sendKeys('krishna'); }; Login.prototype.expectConfirmPassword = function(){ element(by.model('confirmPassword')).sendKeys('krishna'); expect(element(by.buttonText('Register')).isPresent()).toBe(true); }; Login.prototype.expectWrongConfirmPassword = function () { element(by.model('confirmPassword')).sendKeys('kris'); expect(element(by.buttonText('Register')).isEnabled()).toBe(false); expect(element(by.cssContainingText('p.help-block.ng-scope.ng-hide', 'Your confirmation password is required.')).isPresent()).toBe(true); }; Login.prototype.expectPasswordStrength = function(){ element(by.model('confirmPassword')).sendKeys('krishna'); expect(element(by.css('#strengthBar li:nth-child(1)')).getAttribute('style')).toEqual('background: rgb(255, 0, 0);'); expect(element(by.buttonText('Register')).isPresent()).toBe(true); }; module.exports = new Login();
async function getTampaWeather(city) { var response = await fetch("https://api.openweathermap.org/data/2.5/weather?q=Tampa&units=imperial&appid={}") var CityWeather = await response.json() var currTemp = CityWeather.main['temp'] var maxTemp = CityWeather.main['temp_max'] var minTemp = CityWeather.main['temp_min'] var weather = CityWeather.weather['0']['description'] var city = CityWeather.name variables = [currTemp,maxTemp,minTemp, weather] // var displayVariable = document.createElement("p") // displayVariable.innerText =currTemp document.querySelector(".city").innerText = city console.log(currTemp) document.querySelector(".city_weather_temp").innerText = "CURRENT TEMP: " + currTemp + "degrees F" document.querySelector(".city_weather_temp_range").innerText ="TEMP RANGE: " + minTemp + "degrees F" + " - " + maxTemp + "degrees F" document.querySelector(".city_weather").innerText = "WEATHER: " + weather return CityWeather } async function getChicagoWeather(city) { var response = await fetch("https://api.openweathermap.org/data/2.5/weather?q=Chicago&units=imperial&appid=") var CityWeather = await response.json() var currTemp = CityWeather.main['temp'] var maxTemp = CityWeather.main['temp_max'] var minTemp = CityWeather.main['temp_min'] var weather = CityWeather.weather['0']['description'] var city = CityWeather.name variables = [currTemp,maxTemp,minTemp, weather] // var displayVariable = document.createElement("p") // displayVariable.innerText =currTemp document.querySelector(".city").innerText = city document.querySelector(".city_weather_temp").innerText = "CURRENT TEMP: " + currTemp + "degrees F" document.querySelector(".city_weather_temp_range").innerText ="TEMP RANGE: " + minTemp + "degrees F" + " - " + maxTemp + "degrees F" document.querySelector(".city_weather").innerText = "WEATHER: " + weather return CityWeather } async function getBurbankWeather(city) { var response = await fetch("https://api.openweathermap.org/data/2.5/weather?q=Burbank&units=imperial&appid=") var CityWeather = await response.json() var currTemp = CityWeather.main['temp'] var maxTemp = CityWeather.main['temp_max'] var minTemp = CityWeather.main['temp_min'] var weather = CityWeather.weather['0']['description'] var city = CityWeather.name variables = [currTemp,maxTemp,minTemp, weather] // var displayVariable = document.createElement("p") // displayVariable.innerText =currTemp document.querySelector(".city").innerText = city document.querySelector(".city_weather_temp").innerText = "CURRENT TEMP: " + currTemp + "degrees F" document.querySelector(".city_weather_temp_range").innerText ="TEMP RANGE: " + minTemp + "degrees F" + " - " + maxTemp + "degrees F" document.querySelector(".city_weather").innerText = "WEATHER: " + weather return CityWeather } async function getDallasWeather(city) { var response = await fetch("https://api.openweathermap.org/data/2.5/weather?q=Dallas&units=imperial&appid=") var CityWeather = await response.json() var currTemp = CityWeather.main['temp'] var maxTemp = CityWeather.main['temp_max'] var minTemp = CityWeather.main['temp_min'] var weather = CityWeather.weather['0']['description'] var city = CityWeather.name variables = [currTemp,maxTemp,minTemp, weather] // var displayVariable = document.createElement("p") // displayVariable.innerText =currTemp document.querySelector(".city").innerText = city document.querySelector(".city_weather_temp").innerText = "CURRENT TEMP: " + currTemp + "degrees F" document.querySelector(".city_weather_temp_range").innerText ="TEMP RANGE: " + minTemp + "degrees F" + " - " + maxTemp + "degrees F" document.querySelector(".city_weather").innerText = "WEATHER: " + weather return CityWeather }
(function(){ "use strict"; var App = function() { if(App.instance) { return App.instance; } this.rememberDocs = []; this.currentActive = 0; this.currentData = ""; this.currentDocuments = ""; this.rememberDocLinks = []; this.runDouble = false; this.usergroup = "0"; App.instance = this; this.init(); }; window.App = App; App.prototype = { init: function() { window.setTimeout(function() { $(".alert").fadeTo(1500, 0).slideUp(500, function(){ $(this).remove(); }); }, 5000); if(document.querySelector("#save_new_pg")) { var playground = new Playground(); } if(document.querySelector("#mobile-data")) { var mobile = new Mobile(); var mobedit = new MobEdit(); } if(document.querySelector("#properties_select") || document.querySelector("#go-tenant")) { var properties = new Properties(); } if(document.querySelector("#object_select")) { var objects = new Objects(); } if(document.querySelector("#businesses_select")) { var business = new Business(); } if(document.querySelector("#problemtable") || document.querySelector("#my_tasks")) { var tasks = new Tasks(); } if(document.querySelector("#service")) { var service = new Service(); } if(document.querySelector("#inspection")) { var inspection = new Inspection(); } if(document.querySelector("#loggingtable")) { this.getLogData(); } if(document.querySelector("#itsupporttable")) { var it_support = new IT_support(); } if(document.querySelector("#calendar") && document.querySelector("#reserv_start") || document.querySelector("#next_events")) { var calendar = new Calendar(); } this.listenEvents(); }, listenEvents: function() { if(document.querySelector("#property-filter")) { $('#ending-fil').on('ifChecked', function(event){ Properties.instance.filterList.push("ending"); Properties.instance.updatePropertySelect(); }); $('#ending-fil').on('ifUnchecked', function(event){ for(var j = 0; j < Properties.instance.filterList.length; j++) { if(Properties.instance.filterList[j] === "ending") { Properties.instance.filterList.splice(j, 1); Properties.instance.updatePropertySelect(); } } }); $('#sale-fil').on('ifChecked', function(event){ Properties.instance.filterList.push("sale"); Properties.instance.updatePropertySelect(); }); $('#sale-fil').on('ifUnchecked', function(event){ for(var j = 0; j < Properties.instance.filterList.length; j++) { if(Properties.instance.filterList[j] === "sale") { Properties.instance.filterList.splice(j, 1); Properties.instance.updatePropertySelect(); } } }); $('#free-fil').on('ifChecked', function(event){ Properties.instance.filterList.push("free"); Properties.instance.updatePropertySelect(); }); $('#free-fil').on('ifUnchecked', function(event){ for(var j = 0; j < Properties.instance.filterList.length; j++) { if(Properties.instance.filterList[j] === "free") { Properties.instance.filterList.splice(j, 1); Properties.instance.updatePropertySelect(); } } }); } document.addEventListener("click", function(e) { if(document.querySelector("#usermodal")) { //console.log(e.target.parentElement.dataset.firstname); if(e.target.parentElement.className === "edit-user") { document.querySelector("#user_id").value = e.target.parentElement.dataset.id; document.querySelector("#user_name").value = e.target.parentElement.dataset.name; document.querySelector("#user_firstname").value = e.target.parentElement.dataset.firstname; document.querySelector("#user_lastname").value = e.target.parentElement.dataset.lastname; document.querySelector("#user_email").value = e.target.parentElement.dataset.email; document.querySelector("#user_group").value = e.target.parentElement.dataset.group; document.querySelector("#user_password").value = ""; App.instance.getSelectedValues(); } } /*if(e.target.parentElement.className === "filter-type") { e.target.parentElement.className += " active"; Properties.instance.filterList.push(e.target.dataset.id); Properties.instance.updatePropertySelect(); } else if(e.target.parentElement.className === "filter-type active") { e.target.parentElement.className = "filter-type"; for(var j = 0; j < Properties.instance.filterList.length; j++) { if(Properties.instance.filterList[j] === e.target.dataset.id) { Properties.instance.filterList.splice(j, 1); } } Properties.instance.updatePropertySelect(); }*/ if(e.target.className === "glyphicon glyphicon-remove rmv-doc") { for(var i = 0; i < App.instance.currentDocuments.length; i++) { if(App.instance.currentDocuments[i].id === parseInt(e.target.dataset.id)) { var conf = confirm("Oled kindel, et soovid kustutada dokumendi " + App.instance.currentDocuments[i].name + "?"); if(conf) { e.target.parentElement.parentElement.remove(); App.instance.removeDoc(App.instance.currentDocuments[i].id); } } } } }); /* Siin toimub üleslaadimise eventide kuulamised, juhul kui luua kaks üleslaadimist ühele lehele siis tuleb seda kopeerida */ if(document.querySelector("#attach-btn")) { document.querySelector("#attach-btn").addEventListener("click", function() { document.querySelector("#attach-new").click(); }); document.querySelector("#attach-new").addEventListener("change", function() { App.instance.showAttachments(); // Kogu seda funktsiooni tuleb kopeerida, et näitaks õiges kohas üles laetavaid faile }); //Frame listeniga katki midagi, upload viidud puhtale PHP kujule, ei lähe läbi iframe enam! /*document.querySelector("#add-attach").addEventListener("click", function() { document.querySelector("#doc_form").target = "my_iframe"; // Seda tõenäoliselt muutma ei pea document.querySelector("#doc_form").submit(); var my_iframe = document.querySelector("#my_iframe"); my_iframe.addEventListener("load", App.instance.frameListener()); my_iframe.removeEventListener("load", App.instance.frameListener()); });*/ document.querySelector("#attach-newname").addEventListener("keyup", function() { if(document.querySelector("#attach-newname").value.length !== 0) { document.querySelector("#add-attach").disabled = false; } else { document.querySelector("#add-attach").disabled = true; } }); } /* Üleslaadimise eventide lõpp */ }, getSelectedValues: function() { var id = document.querySelector("#user_id").value; console.log(id); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var data = JSON.parse(this.responseText); if(data.rights !== null) { data = data.rights.split(','); } $('#select_rights_editing').val(data).trigger('change'); } }; xmlhttp.open("GET", "../inc/ajax.php?getselectedvalues=" + id, true); xmlhttp.send(); }, frameListener: function() { this.runDouble = true; if(document.querySelector("#play_select")) { Playground.instance.getPlayDocs(App.instance.currentActive); } if(document.querySelector("#properties_select")) { Properties.instance.getPropertiesDocs(App.instance.currentActive); } }, // See funktsioon paneb kuvama üles laetavaid faile, mitme uploadi puhul kopeerida fn ja muuta ID'd showAttachments: function() { var files = document.querySelector("#attach-new").files; var names = document.querySelector("#attach-names"); console.log(files); names.innerHTML = ""; for (var i = 0; i < files.length; i++) { names.innerHTML += files[i].name; if(i !== files.length - 1) { names.innerHTML += ", "; } } }, removeDoc: function(id) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { } }; xmlhttp.open("GET", "../inc/ajax.php?removedoc=" + id, true); xmlhttp.send(); }, getLogData: function() { console.log("siin"); var neededURL = "../inc/ajax.php?getuserlog=1"; document.querySelector("#table_head").style.display = "table-header-group"; var myTable = $('#loggingtable').DataTable({ "language": { "decimal": "", "emptyTable": "Ei leitud vasteid", "info": "Näitan vasteid _START_ kuni _END_. Kokku _TOTAL_ vastet", "infoEmpty": "0 vastet leitud", "infoFiltered": "(Otsitud _MAX_ vaste seast)", "infoPostFix": "", "thousands": ",", "lengthMenu": "Näita _MENU_ vastet", "loadingRecords": "Laen...", "processing": "Töötlen...", "search": "Otsi:", "zeroRecords": "Ei leitud mitte ühtegi vastet", "paginate": { "first": "Esimene", "last": "Viimane", "next": "Järgmine", "previous": "Eelmine" } }, "ajax": { "url": neededURL, "dataSrc": "", }, "columns": [ { "render": function ( data, type, full, meta ) { return '<span class="Tasks_values" data-id="job-' + full.id + '">' + full.user + '</span>'; } }, { "render": function ( data, type, full, meta ) { return '<span class="Tasks_values" data-id="phone-' + full.id + '">' + full.ip + '</span>'; } }, { "render": function ( data, type, full, meta ) { return '<span class="Tasks_values" data-id="info-' + full.id + '">' + full.status + '</span>'; } }, { "render": function ( data, type, full, meta ) { return '<span class="Tasks_values" data-id="comment-' + full.id + '">' + full.logindate + '</span>'; } }, ] }); } }; }) ();
document.addEventListener("DOMContentLoaded", function() { const bookings = document.getElementById("bookings"); let staffMembers; let availableSchedules; let loadStaffMembers = function() { let request = new XMLHttpRequest(); request.open("GET", "./api/staff_members"); request.responseType = "json"; request.addEventListener("load", function(e) { staffMembers = request.response; loadSchedules(); }); request.send(); }; let loadSchedules = function() { let request = new XMLHttpRequest(); request.open("GET", "./api/schedules"); request.responseType = "json"; request.addEventListener("load", function(e) { availableSchedules = request.response; formatDropDown(); }); request.send(); }; let formatDropDown = function() { availableSchedules.forEach(schedule => { if (schedule.student_email) { let li = document.createElement("li"); li.textContent = schedule.date; let nestedUl = document.createElement("ul"); let nestedLi = document.createElement("li"); nestedLi.textContent = staffMembers[schedule.staff_id].name + " | " + schedule.student_email + " | " + schedule.time; nestedUl.classList.add("scheduling_info") nestedUl.append(nestedLi); li.append(nestedUl) nestedUl.style.display = "none"; bookings.append(li); } }); }; loadStaffMembers(); bookings.addEventListener("click", function(e) { e.preventDefault(); if (e.target.parentNode.classList.contains("scheduling_info")) { e.target.parentNode.style.display = "none"; } else { e.target.querySelector(".scheduling_info").style.display = ""; } }) });
const maxScore = (cardPoints, k) => { let leftSum =0; let rightSum =0; let f = 0; let rightCounter = 0; while(f < k){ leftSum += cardPoints[f++]; } let max = leftSum; --f; while(f >= 0){ rightSum += cardPoints[cardPoints.length - 1 -rightCounter++ ]; leftSum -= cardPoints[f]; max = Math.max(leftSum + rightSum, max); --f; } return max; } console.log(maxScore([11,49,100,20,86,29,72], 4));
import React, { Component } from 'react' import { Link, withRouter } from 'react-router-dom' import Button from '@material-ui/core/Button' import Logo from '../../assets/logoUNIESI.svg' import api from '../../services/api' import { login } from '../../services/auth' import './styles.css' import { Container, CssBaseline, TextField } from '@material-ui/core' class Login extends Component { state = { error: '', id: '', username: '', password: '' } componentDidMount () {} enter = async e => { e.preventDefault() const { username, password } = this.state if (!username || !password) { this.setState({ error: 'Preencha e-mail e senha para continuar!' }) } else { try { const response = await api.post('/api-token-auth/', { username, password }) login(response.data.token) // login(response.data.user.id, response.data.token, username) this.props.history.push('/') } catch (err) { this.setState({ error: 'Houve um problema com o login, verifique suas credenciais.' }) } } } clearError = () => { this.setState({ error: '' }) } render () { return ( <div> <Container component='main' maxWidth='xs'> <CssBaseline /> <form onSubmit={this.enter} id='login'> <Link to='/'> <img src={Logo} alt='Uniesi logo' /> </Link> <TextField variant='outlined' margin='normal' required fullWidth type='text' autoComplete='off' autoFocus id='username' value={this.state.username} onChange={e => this.setState({ username: e.target.value })} placeholder='USUÁRIO' /> <TextField variant='outlined' margin='normal' required fullWidth type='password' autoComplete='off' value={this.state.password} onChange={e => this.setState({ password: e.target.value })} placeholder='SENHA' /> <br /> <Button type='submit' size='large' fullWidth variant='contained' color='primary' > Entrar </Button> </form> </Container> {this.state.error && ( <div className='error-float' onClick={this.clearError}> <span>{this.state.error}</span> </div> )} </div> ) } } export default withRouter(Login)
require('dotenv/config') let mongoose = require('mongoose'); let optionSchema = new mongoose.Schema({ optionID: { type: Number, required: true }, questionID: { type: Number, required: true }, optionArray: { type: Array, required: false, default: 0 } }); let option = mongoose.model('options', optionSchema); module.exports = option;
import DS from "ember-data"; import Ember from 'ember'; import EmbedExtractor from "./embed-extractor"; // requestType values that indicate that we are loading a collection, not // a single resource var findManyRequestTypes = ["findMany", "findAll", "findHasMany", "findQuery"]; // Reserved keys, per the HAL spec var halReservedKeys = ['_embedded', '_links']; var reservedKeys = halReservedKeys.concat(['meta']); function extractLinksIntoMeta(payload, meta){ var links = payload._links; if (links) { meta.links = {}; Ember.keys(links).forEach(function(key){ // if(key === 'self') { // var href = links[key].href; // var id = href.substring(href.lastIndexOf('/') + 1, href.length); // payload.id = id; // } meta.links[key] = links[key].href; }); } return meta; } function setMeta(store, type, meta){ if (store.setMetadataFor) { // Ember Data after 1.14.1 adds this method store.setMetadataFor(type, meta); } else { store.metaForType(type, meta); } } export default DS.RESTSerializer.extend({ //ActiveModel /* `__requestType` is used to know if we are dealing with a list resource (i.e., GET /users) which may have meta data in the root of the payload, i.e.: { page: 1, // <-- metadata total_pages: 5, // <-- metadata _embedded: { users: [{...}, ...] } } If the requestType is for a single resource we cannot determine which properties are metadata and which are part of the payload for that resource because they are all at the root level of the payload, so punt on that here -- per-model serializers can override extractMeta if they need to. @return {Object} The payload, modified to remove metadata */ extractMeta: function(store, type, payload){ var requestType = this.__requestType; if ( findManyRequestTypes.indexOf(requestType) > -1 ) { var meta = {}; Ember.keys(payload).forEach(function(key){ if (reservedKeys.indexOf(key) > -1) { return; } meta[key] = payload[key]; delete payload[key]; }); meta = extractLinksIntoMeta(payload, meta); setMeta(store, type, meta); } this._super(store, type, payload); return payload; }, /* * Override `extract` so we can store the requestType for extractMeta */ extract: function(store, type, payload, id, requestType) { this.__requestType = requestType; // used by `extractMeta` return this._super(store, type, payload, id, requestType); }, /** * https://github.com/emberjs/data/blob/48c02654e8a524b390d1a28975416ee73f912d9e/packages/ember-data/lib/serializers/rest_serializer.js#L263 @method extractSingle @param {DS.Store} store @param {subclass of DS.Model} primaryType @param {Object} payload @param {String} recordId @return {Object} the primary response to the original request */ extractSingle: function(store, primaryType, rawPayload, recordId) { var extracted = new EmbedExtractor(rawPayload, store, this). extractSingle(primaryType); return this._super(store, primaryType, extracted, recordId); }, /* * https://github.com/emberjs/data/blob/48c02654e8a524b390d1a28975416ee73f912d9e/packages/ember-data/lib/serializers/rest_serializer.js#L417 @method extractArray @param {DS.Store} store @param {subclass of DS.Model} primaryType @param {Object} payload @return {Array} The primary array that was returned in response to the original query. */ extractArray: function(store, primaryType, rawPayload) { var extracted = new EmbedExtractor(rawPayload, store, this). extractArray(primaryType); return this._super(store, primaryType, extracted); }, normalizePayload: function(payload){ // top-level _links (such as 'self') can be ignored if (payload._links) { delete payload._links; } return this._super(payload); }, normalize: function(type, hash, property) { var links = hash._links || {}; delete hash._links; hash.links = hash.links || {}; Ember.keys(links).forEach(function(link){ // Do not include a link for a property that already // exists on the hash, because Ember-Data will fetch that // resource by the link instead of using the included data if(link === 'self') { var href = links[link].href; var id = href.substring(href.lastIndexOf('/') + 1, href.length); hash.id = id; } if (!hash[link]) { hash.links[link] = links[link].href; } }); return this._super(type, hash, property); } });
import Attributes from './attributes' import Children from './children' import ClassName from './className' import didMount from './didMount' import didUpdate from './didUpdate' import didUnmount from './didUnmount' import Events from './events' import Is from './is' import Key from './key' import paint from './paint' import reflow from './reflow' import render from './render' import repaint from './repaint' import revoke from '@kuba/revoke' import Slot from './slot' import willMount from './willMount' import willUpdate from './willUpdate' import willUnmount from './willUnmount' @revoke class Element { #attributes #children #className #events #is #key #node #nodeName #slot get attributes () { return this.#attributes } get children () { return this.#children } get className () { return this.#className } get events () { return this.#events } get is () { return this.#is.value } get key () { return this.#key.value } get nodeName () { return this.#nodeName } get slot () { return this.#slot.value } get __node__ () { return this.#node } constructor (nodeName, attrs, children) { this.#nodeName = nodeName this.#attributes = Attributes.create(attrs, this) this.#children = Children.create(children, this) this.#className = ClassName.create(attrs, this) this.#events = Events.create(attrs, this) this.#is = Is.create(attrs) this.#key = Key.create(attrs) this.#slot = Slot.create(attrs) } addEventListener (event) { Reflect.set(this.#node, ...event) return this } after (child) { const node = child[render.flow]() this.#node.after(node) return this } append (childList) { const nodeList = childList.map((child) => child[render.flow]()) this.#node.append(...nodeList) return this } appendChild (child) { const node = child[render.flow]() this.#node.appendChild(node) return this } @didUnmount @willUnmount remove () { this.#node.remove() return this } removeAttribute (attr) { this.#node.removeAttribute(attr.key) return this } removeEventListener (event) { delete this.#node[event.name] return this } replace (child, nChild) { child.after(nChild) child.remove() return this } setAttribute (attr) { this.#node.setAttribute(...attr) return this } [reflow.different] (nElement) { return ( this[paint.instance]?.() !== nElement[paint.instance]?.() || this.nodeName !== nElement.nodeName || this.is !== nElement.is || this.key !== nElement.key ) } @didMount @willMount [render.flow] () { this.#node ??= document.createElement(this.nodeName, { is: this.is }) this.events[render.flow]() this.attributes[render.flow]() this.className[render.flow]() this.children[render.flow]() return this.#node } @didUpdate @willUpdate [repaint.reflow] (nElement) { this.events[repaint.reflow](nElement.events) this.attributes[repaint.reflow](nElement.attributes) this.className[repaint.reflow](nElement.className) this.children[repaint.reflow](nElement.children) return this } static create (nodeName, attrs, children) { attrs = Object.entries(attrs) children = children.flat(Infinity) return new Element(nodeName, attrs, children) } static is (nodeName) { return typeof nodeName === 'string' } } export default Element
exports.get = function(request, response) { var sqlstr; var device = request.query.device; var location = request.query.location; var type = request.query.type; if (!type) { if (!device) device = "Boiler Control"; if (!location) location = "Boiler Rm"; sqlstr = sql.format("SELECT ROUND(value,1) AS value, sensorName, Type, units, scaleFactor "+ "FROM latestValues WHERE location = ? AND deviceName = ?"+ "ORDER BY Type, SensorName", [location, device]); db.query(sqlstr, function(err, result) { if (err) { console.log(err); } response.render('Dashboard', {map: result, device: device, location: location, loggedIn: request.loggedIn }); }); } else { if (type == 'Status') { sqlstr = sql.format("SELECT deviceID, Name, location "+ "FROM devices WHERE location NOT IN ('Test', 'Spare', 'Unknown') "+ "ORDER BY location, Name"); db.query(sqlstr, function(err, result) { if (err) { console.log(err); } response.render('SystemStatus', {map: result, dev: deviceState.list()}); }); } else { sqlstr = sql.format("SELECT value, sensorName, deviceName, location "+ "FROM latestValues WHERE type = ?"+ "ORDER BY deviceName, SensorName", [type]); db.query(sqlstr, function(err, result) { if (err) { console.log(err); } response.render('Controls', {map: result, control: type, loggedIn: request.loggedIn }); }); } } }
import R from 'ramda'; export default(store, {processLocalEvent, isConnected}) => next => action => { if (action.type === 'PROCESS_LOCAL_ONLY') { return isConnected().then(isConnected => { //console.log('First, is ' + (isConnected ? 'online' : 'offline')); if (isConnected) { const localOnlyEvents = R.sort((a1, a2) => a1.createdAt - a2.createdAt, R.values(store.getState().events).filter(R.prop('localOnly'))) if (localOnlyEvents.length < 1) { return } next({type: 'START_PROCESSING_LOCAL'}); //console.log(localOnlyEvents); return (async () => { for (const event of localOnlyEvents) { try { await processLocalEvent(event, progress => { next({type: 'START_PROCESSING_LOCAL', progress}); }); next({ type: 'UPDATE_EVENT', doc: { ...event, draft: "true", localOnly: undefined } }); } catch (e) { console.log(e); } finally { next({type: 'END_PROCESSING_LOCAL'}); } } })(); } }); } else { return next(action); } }
import React from "react"; import PropTypes from "prop-types"; import * as sharedService from "./../../../../SharedService/"; import * as sharedData from "./../../../../SharedData"; import { Card, CardHeader, CardText } from "material-ui/Card"; import CircularProgress from "material-ui/CircularProgress"; const getFormattedDate = date => { let formattedDate = sharedService.getFormattedDate(date); return formattedDate; }; const DisplaySharedCard = props => { return ( <Card expanded={props.showCardsSharedUrlFlag}> <CardHeader style={{ paddingBottom: 5 }} title={ <span> <h3 style={{ marginBottom: 0 }}> {props.feed.actor} |{" "} <span style={{ fontSize: 16, fontWeight: 200 }}>Shared</span> </h3> </span> } subtitle={`Published: ${getFormattedDate(props.feed.created_at)}`} actAsExpander={true} showExpandableButton={false} /> <div className={"actor-bio"}> {props.feed.actor} is an English writer and social critic. He created some of the world's best-known fictional characters and is regarded by many as the greatest novelist. </div> {props.showLoader ? ( <div className={"loader"}> <CircularProgress /> </div> ) : ( "" )} {props.showCardsSharedUrlFlag ? ( <CardText expandable={true}> <span> Shared:{" "} <a href={props.cardsSharedUrl} target="_blank"> {props.cardsSharedUrl} </a> </span> <span className={"feed-updated-date"}> Updated: {getFormattedDate(props.feed.updated_at)} </span> <span className={"feed-card-show-less"}>show less</span> </CardText> ) : ( <div className={"feed-card-show-more"}> {!props.showLoader ? "show more" : ""} </div> )} </Card> ); }; DisplaySharedCard.propTypes = { feed: PropTypes.shape(sharedData.FeedStruct).isRequired, cardsSharedUrl: PropTypes.string.isRequired, showCardsSharedUrlFlag: PropTypes.bool.isRequired, showLoader: PropTypes.bool.isRequired }; export default DisplaySharedCard;
import React, {Fragment, PureComponent} from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, Image, TouchableOpacity, // Dimensions, } from 'react-native'; import Footer from './FooterScreen'; //slide 추가 import Carousel, {Pagination} from 'react-native-snap-carousel'; import {URL} from '../Constant'; //slide 추가(데이터) const IMAGESLIDE = [ { url: 'https://interiorssa.com/neo2/testImage/EVENT_banner (5).png', title: '소중한 우리아이 피부', tag: '입소문PICK', }, { url: 'https://interiorssa.com/neo2/testImage/EVENT_banner (5).png', title: '신제품입니다.', tag: '추라이추라이', }, ]; //slide추가 end export default class Post extends PureComponent { constructor(props) { super(props); this.state = { modal: false, //slide 추가(상단 슬라이드) images: [], activeSlide: 0, slide02: [], //slide 추가 end }; } //slide 추가(slide데이터 받아오기&slide하단 동그라미 표현) componentWillMount() { this.setState({images: IMAGESLIDE}); console.log('시작'); fetch(URL + '/product/') .then((res) => res.json()) .then((resJson) => { console.log('데이터 받아오기', resJson); this.setState({ slide02: resJson, }); }); } pagination = () => { const {images, activeSlide} = this.state; return ( <Pagination dotsLength={images.length} activeDotIndex={activeSlide} containerStyle={{ backgroundColor: 'transparent', paddingVertical: 10, }} dotStyle={{ backgroundColor: '#32cc73', marginHorizontal: -3, }} inactiveDotStyle={{ backgroundColor: '#fff', }} inactiveDotOpacity={1} inactiveDotScale={0.9} /> ); }; _renderItem = ({item, index}) => { return ( <View style={{ justifyContent: 'center', alignItems: 'center', position: 'relative', }} key={index}> <Image source={{uri: item.url}} resizeMode={'cover'} style={{ width: Dimensions.get('screen').width, height: '100%', }} /> <View style={{position: 'absolute', top: 40, left: 40}}> <Text style={{fontSize: 20, fontWeight: '500', marginBottom: 3}}> {item.title} </Text> <Text style={{fontSize: 20, fontWeight: '500'}}>#{item.tag}</Text> </View> {/* <Text>{item.url}</Text> */} </View> ); }; //slide 추가 end componentDidMount() {} _intoDetail = () => { this.props.navigation.navigate('Detail'); }; _goDetail = () => { this.props.navigation.navigate('PostDetail'); }; render() { return ( <Fragment> <StatusBar barStyle="dark-content" /> <SafeAreaView /> <ScrollView style={{backgroundColor: 'white'}} showsVerticalScrollIndicator={false}> {/* 전체padding추가 */} <View style={{ backgroundColor: '#f9f9f9', paddingRight: 16, paddingLeft: 16, }}> {/* slide 추가 */} <View style={{paddingTop: 9}}> <View style={{height: 128, backgroundColor: 'white'}}> <Carousel ref={(c) => { this._carousel = c; }} data={this.state.images} renderItem={this._renderItem} sliderWidth={Dimensions.get('screen').width - 32} itemWidth={Dimensions.get('screen').width} onSnapToItem={(index) => this.setState({activeSlide: index})} removeClippedSubviews={false} inactiveSlideOpacity={1} inactiveSlideScale={1} borderRadius={7} loop={true} loopClonesPerSide={2} /> </View> <View style={{marginTop: -20}}>{this.pagination()}</View> </View> {/* slide 추가 end */} {/* 포스팅 */} {/* marginTop추가 */} <View style={{marginTop: 30}}></View> <View style={[posting.titleBox]}> {/* */} <View style={posting.title}> <View style={{ flex: 9, }}> <Text style={posting.titleText}>주간 베스트</Text> </View> <TouchableOpacity onPress={() => { this.props.navigation.navigate('PostList'); }}> <Text style={{fontSize: 11, color: 'gray'}}>더보기</Text> </TouchableOpacity> </View> {/* */} <TouchableOpacity style={posting.textBox} onPress={this._goDetail}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> 임산부는 반드시 피하세요! </Text> <Text style={{marginTop: 10}}>베블링 | 육아꿀팁</Text> </View> <View></View> </View> </TouchableOpacity> {/* */} <View style={posting.textBox}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> 임산부는 반드시 피하세요! </Text> <Text style={{marginTop: 10}}>베블링 | 육아꿀팁</Text> </View> <View></View> </View> </View> {/* */} <View style={posting.textBox}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> 임산부는 반드시 피하세요! </Text> <Text style={{marginTop: 10}}>베블링 | 육아꿀팁</Text> </View> <View></View> </View> </View> </View> {/* */} {/* youtube */} <View style={posting.titleBox}> {/* */} <View style={posting.title}> <View style={{ flex: 9, }}> <Text style={posting.titleText}>Youtube</Text> </View> </View> {/* */} <View style={posting.textBox}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> [베블링 크리스마스 특집]크리스마스 모빌 만들기 </Text> </View> <View></View> </View> </View> {/* */} <View style={posting.textBox}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> [베블링 리뷰]제 7탄 유아간식 </Text> </View> <View></View> </View> </View> {/* */} <View style={posting.textBox}> <View style={{backgroundColor: 'lightgray', height: 200}}></View> <View style={{padding: 15, paddingLeft: 20}}> <View> <Text style={{fontSize: 16}}> [베블링 리뷰]제 8탄 유아 젤리 </Text> </View> <View></View> </View> </View> </View> {/* view위치 변경 */} </View> {/* footer */} <Footer /> {/* */} </ScrollView> </Fragment> ); } } const posting = StyleSheet.create({ titleBox: { shadowColor: '#000', shadowOffset: { width: 0, height: 5, }, shadowOpacity: 0.1, shadowRadius: 3.84, elevation: 5, }, //margin변경 title: { flexDirection: 'row', paddingLeft: 10, paddingRight: 14, height: 30, }, titleText: {fontSize: 16, fontWeight: 'bold'}, titleMore: {fontSize: 12, color: 'gray'}, textBox: { backgroundColor: 'white', marginBottom: 35, borderRadius: 10, overflow: 'hidden', }, });
const fs = require("fs-extra"); const path = require("path"); const EventEmitter = require("events"); const defaultOptions = { theme: { style: 'light' }, localDataFolder: "~/.nyaa", import: { musicFolder: "/home/{user}/Music", copyToMusicFolder: true, deleteAfterMove: false, }, podcasts: { podcastsFolder: "/home/{user}/Podcasts", autoDownloadNewPodcasts: false, autoDownloadPodcastCount: 5, autoSyncToDevice: false, autoUpdate: true, runOnLoad: true, updateFrequency: 900000, }, history: { saveHistory: true, }, device: { discovery: { http: true } } }; class Options extends EventEmitter { constructor(filepath, opts=defaultOptions) { super(); this.path = path.join(filepath, "options.json"); this.opts = opts; } static Load(filepath) { const p = path.join(filepath, "options.json"); return fs.readFile(p).then(function(data) { const data2 = JSON.parse(data) const opts = new Options(filepath, data2) return opts }).catch((err) => { console.log("no default options, creating new file now"); const opts = new Options(filepath) return opts.save().then(() => { return opts }).catch() }) } save() { const data = JSON.stringify(this.opts) return fs.writeFile(this.path, data) } Update(options) { this.opts = options; return this.save().then(() => { this.emit('update', this.opts); }) } } module.exports = Options
/* * ProGade API * Copyright 2012, Hans-Peter Wandura (ProGade) * Last changes of this file: Aug 21 2012 */ /* @start class @param extends classPG_ClassBasics */ function classPG_Update() { // Declarations... this.oDatabaseUpdate = null; this.oFolderUpdate = null; // Construct... this.setID({'sID': 'PGUpdate'}); if (typeof(oPGDatabaseUpdate) != 'undefined') {this.oDatabaseUpdate = oPGDatabaseUpdate;} if (typeof(oPGFolderUpdate) != 'undefined') {this.oFolderUpdate = oPGFolderUpdate;} // Methods... /*this.build = function() { if (this.oDatabaseUpdate != null) {this.oDatabaseUpdate.init({'asDBChunks': this.asDBChunks, 'asTables': this.asTables, 'sUpdateScriptPath': , _sProgressBarID)} if (this.oFolderUpdate != null) {} }*/ } /* @end class */ classPG_Update.prototype = new classPG_ClassBasics(); var oPGUpdate = new classPG_Update();
const logger = require('../../services/loggerService'); const utilService = require('../../services/utilService'); const collectorService = require('../../services/collectorService'); Page({ data: { isAuth: false, userInfo: { avatarUrl: '../../assets/images/icons/webcat-logo.png', city: '', country: '', telephone: '', gender: 1, language: "zh_CN", nickName: "访客", province: "Shanghai" } }, // 每次加载用户信息 onLoad: function () { // 查看是否授权 utilService.getSetting.call(this).then(data => { // 已授权 if (data && data.authSetting && data.authSetting['scope.userInfo']) { this.setData({ isAuth: true, userInfo: utilService.getStorage('userInfo') }); this.toIndex(); } }).catch(err => { utilService.showToast(err); }) }, //获取用户信息,并存入本地缓存 bindGetUserInfo: function (e) { let userInfo = e.detail.userInfo; // 用户授权 if (userInfo) { this.setData({ isAuth: true, userInfo: userInfo }); utilService.saveStorage('userInfo', userInfo); // 查询是否有该微信用户 collectorService.getCollectorByNickName.call(this, userInfo.nickName).then(data => { let collector = data.data.collector; utilService.saveStorage('userInfo', collector); if (!collector) { collectorService.addWebcatUser.call(this, userInfo).then(data => { let collector = data.data.collector; utilService.saveStorage('userInfo', collector); // 手机未绑定 utilService.toPage({ url: '/pages/user/bindPhone/bindPhone?id=' + collector.id }); }).catch(err => { this.toIndex(); }) } else if (collector && !collector.telephone) { utilService.toPage({ url: '/pages/user/bindPhone/bindPhone?id=' + collector.id }); } else { this.toIndex(); } }).catch(err => { this.toIndex(); }) } else { this.toIndex(); } }, toIndex: function () { utilService.toPage({ url: '/pages/index/index' }, true); } })
window.addEventListener('load', function (e) { if ('serviceWorker' in navigator) { try { navigator.serviceWorker.register('sw.js'); } catch (error) { console.log("SOMETHING WENT WRONG!\n" + error); } } });
const express = require('express'); const Router = express.Router(); const asyncHandler = require('../middleware/async'); const { userValidation } = require('../middleware/validation'); const { getAllUsers, getAllRoles, getUser, postUser, putUser, deleteUser } = require('../controller/users'); const { uploadFile } = require('../middleware/files'); Router .get('/', getAllUsers) .get('/roles', getAllRoles) .get('/:id', getUser) .post('/', uploadFile('image'), asyncHandler(userValidation), postUser) .put('/:id', uploadFile('image'), putUser) .delete('/:id', deleteUser); module.exports = Router;
import React from 'react' class SingleComment extends React.Component { render () { return ( <li className='single-comment'> <a className='ico ico-delete' onClick={() => this.props.onShowPopup('confirm', this.props.commentData.id, this.props.commentKey, this.props.commentData.comment)} href='#'> </a> <a className='ico ico-edit' onClick={() => this.props.onShowPopup('edit', this.props.commentData.id, this.props.commentKey, this.props.commentData.comment)} href='#'> </a> <h4>{this.props.commentData.email}</h4> <p>{this.props.commentData.comment}</p> </li> ) } } SingleComment.propTypes = { onShowPopup: React.PropTypes.func.isRequired, commentData: React.PropTypes.shape({ email: React.PropTypes.string, comment: React.PropTypes.string }) } export default SingleComment
var ctx = document.getElementsByTagName("canvas")[0].getContext("2d"); var seedField = document.getElementById("seed_field"); var pixelSizeField = document.getElementById("pixelSize_field"); var mouseDown = false; var justReleasedMouse = false; var mousePos = {x: 0, y: 0}; var mouseDiff = {x: 0, y: 0}; window.addEventListener("mousedown", function(e){ mouseDown = true; }); window.addEventListener("mouseup", function(e){ mouseDown = false; justReleasedMouse = true; }); window.addEventListener("mousemove", function(e){ mouseDiff.x = e.clientX-mousePos.x; mouseDiff.y = e.clientY-mousePos.y; mousePos.x = e.clientX; mousePos.y = e.clientY; }); function map(c, a1, a2, b1, b2){ return b1 + ((c-a1)/(a2-a1))*(b2-b1); } function setColor(data, x, y, w, r, g, b, a, pixelSize){ pixelSize = pixelSize || 1; for(var xx = x; xx < x+pixelSize; xx++){ for(var yy = y; yy < y+pixelSize; yy++){ data[(xx + yy*w)*4] = r; data[(xx + yy*w)*4 + 1] = g; data[(xx + yy*w)*4 + 2] = b; data[(xx + yy*w)*4 + 3] = a; } } } function generateRedTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize){ if(n < 150){ n = n < 110 ? 110 : n; //So the earth is not too dark setColor(texture_data, x, y, heightmap_width, n, Math.round(n*0.6), Math.round(n/2), n, pixelSize); } else if(n < 210) setColor(texture_data, x, y, heightmap_width, Math.round(n*0.8), Math.round(n*0.4), Math.round(n/2), n, pixelSize); else setColor(texture_data, x, y, heightmap_width, n, Math.round(n/2), Math.round(n/3), n, pixelSize); } function generateEarthTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize){ if(n < 140){ n = n < 70 ? 70 : n; //So the water is not too dark setColor(texture_data, x, y, heightmap_width, 0, 0, n, n, pixelSize); } else if(n < 210) setColor(texture_data, x, y, heightmap_width, 0, n, Math.round(n/2), n, pixelSize); else setColor(texture_data, x, y, heightmap_width, n, n, n, n, pixelSize); } function generateGasTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize){ if(n < 210){ n = n < 120 ? 120 : n; //So the gas is not too dark setColor(texture_data, x, y, heightmap_width, Math.round(n/3), Math.round(n/2), n, n, pixelSize); } else setColor(texture_data, x, y, heightmap_width, Math.round(n/3), Math.round(n*0.6), n, n, pixelSize); } //Link (in french) //https://fr.wikipedia.org/wiki/G%C3%A9n%C3%A9rateur_congruentiel_lin%C3%A9aire#Exemples function RNG(seed){ this.seed = this.getSeed(seed) * 394875498754986; //394875498754986 could be any big number this.a = 16807; this.c = 0; this.m = Math.pow(2, 31)-1; } RNG.prototype.getSeed = function(seed){ var s = 34737; for(var i = 0; i < seed.length; i++){ s += (i+1)*seed.charCodeAt(i); } return s; } RNG.prototype.unit = function(){ this.seed = (this.a * this.seed + this.c) % this.m; return this.seed / (this.m-1); } var rng; var withAsteroids; var asteroidColors = [[130, 72, 41], [96, 60, 39], [91, 73, 64]]; var asteroids; var orbitRadius; var orbitAngle; var numAsteroids; var orbitInclinationAngle; var heightmap_width = 700; var heightmap_height = 400; //var pixelSize = 5; var dphi = 0.0; var planetRotationDiff; var rotationMomentum = 0.0; var radius = 100; var planetType; var RED_TYPE = 0, EARTH_TYPE = 1, GAS_TYPE = 2; var noise; var imageData = ctx.createImageData(heightmap_width, heightmap_height); var texture_data = imageData.data; var stars; generate(false); function randomSeed(){ //Size of the seed between 1 and 20 character var n = Math.ceil(Math.random()*20); var seed = ""; for(var i = 0; i < n; i++){ //Concatenate a character form '!' (code 33) to '~' (code 126) seed += String.fromCharCode(Math.round(Math.random()*(126-33))+33); } seedField.value = seed; generate(); } var id = null; //If wait is true, it will wait a little bit (300ms) //before calling the function, so that if the user //types a seed super fast, it will not call the function //for every key pressed. If not, a lot of lags function generate(wait){ if(wait){ if(id !== null) window.clearTimeout(id); id = window.setTimeout(function(){ generate(false); }, 300); return; } var seed = seedField.value; rng = new RNG(seed); pixelSize = parseInt(pixelSizeField.value) || 5; withAsteroids = false; if(rng.unit() < 0.5) withAsteroids = true; asteroids = []; var orbitRadiusInner = rng.unit()*100 + 110; var orbitRadiusOuter = orbitRadiusInner + 50; var diffRadius = orbitRadiusOuter - orbitRadiusInner; orbitAngle = 0.0; numAsteroids = rng.unit()*200 + 75; orbitInclinationAngle = -rng.unit()*Math.PI/10.0; if(withAsteroids){ for(var a = 0; a < numAsteroids; a++){ var angle = rng.unit()*Math.PI*2.0; var rad = orbitRadiusInner + rng.unit()*diffRadius; var x = rad*Math.cos(angle), y = (rng.unit()*2.0-1.0) * 10.0, z = rad*Math.sin(angle), c = Math.round(rng.unit()*2), size = Math.round(rng.unit()*5+5); asteroids.push([x, y, z, angle, asteroidColors[c][0], asteroidColors[c][1], asteroidColors[c][2], size]); } } planetRotationDiff = rng.unit() * 0.03; noise = new PerlinNoise(seed); planetType = Math.round(rng.unit()*2); for(var x = 0; x < heightmap_width; x+=pixelSize){ for(var y = 0; y < heightmap_height; y+=pixelSize){ var phi = map(x, 0, heightmap_width-1, (3.0/2.0)*Math.PI+dphi, -Math.PI/2.0+dphi), theta = map(y, 0, heightmap_height-1, Math.PI, 0); var xx = radius*Math.abs(Math.sin(theta))*Math.cos(phi), yy = radius*Math.cos(theta), zz = radius*Math.abs(Math.sin(theta))*Math.sin(phi); var amplitude = 1.0, frequency = 0.01; var n = 0.0; for(var o = 0; o < 3; o++){ n += amplitude*noise.noise(xx*frequency, yy*frequency, zz*frequency); amplitude *= 0.5; frequency *= 2.0; } n += 1.0; n *= 0.5; n = Math.round(n*255); if(planetType === RED_TYPE) generateRedTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize); else if(planetType === EARTH_TYPE) generateEarthTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize); else if(planetType === GAS_TYPE) generateGasTypePlanet(n, texture_data, x, y, heightmap_width, pixelSize); } } console.log(planetType); stars = []; for(var x = 0; x < 500; x++){ for(var y = 0; y < 500; y++){ var r = rng.unit(); if(r < 0.0005){ stars.push([x, y]); } } } ctx.putImageData(imageData, 0, 0); } animate(texture_data, radius); function animate(texture_data, radius){ ctx.fillStyle = "black"; ctx.fillRect(0, 0, 500, 500); var w = heightmap_width, h = heightmap_height; var imageData = ctx.createImageData(500, 500); var data = imageData.data; //Draw space and stars for(var x = 0; x < 500; x++){ for(var y = 0; y < 500; y++){ setColor(data, x, y, 500, 0, 0, 0, 255); } } for(var s = 0; s < stars.length; s++){ var star = stars[s]; setColor(data, star[0], star[1], 500, 255, 255, 255, 255); } if(withAsteroids){ var orbitAnglePerFrame = -0.03; var astXYZ = []; for(var a = 0; a < asteroids.length; a++){ var asteroid = asteroids[a]; var astX = asteroid[0]*Math.cos(orbitAngle) - asteroid[2]*Math.sin(orbitAngle); var astZ = asteroid[0]*Math.sin(orbitAngle) + asteroid[2]*Math.cos(orbitAngle); astX = Math.round(astX) + 250; var astY = Math.round(asteroid[1]*Math.cos(orbitInclinationAngle) - astZ*Math.sin(orbitInclinationAngle)) + 250; astZ = Math.round(asteroid[1]*Math.sin(orbitInclinationAngle) + astZ*Math.cos(orbitInclinationAngle)); astXYZ.push(astX, astY, astZ); } orbitAngle += orbitAnglePerFrame; for(var a = 0; a < astXYZ.length; a+=3){ if(astXYZ[a+2] < 0){ setColor(data, astXYZ[a], astXYZ[a+1], 500, asteroids[a/3][4], asteroids[a/3][5], asteroids[a/3][6], 255, asteroids[a/3][7]); } } } render_planet(data, texture_data, radius, w, h, 0, w, (3.0/2.0)*Math.PI, -Math.PI/2.0); //render_planet(data, texture_data, radius, w, h, 0, Math.round(w/4), (3.0/2.0)*Math.PI, Math.PI); //render_planet(data, texture_data, radius, w, h, w-Math.round(w/4), w, 0, -Math.PI/2.0); //render_planet(data, texture_data, radius, w, h, Math.round(w/4), w-Math.round(w/4), Math.PI, 0); if(withAsteroids){ for(var a = 0; a < astXYZ.length; a+=3){ if(astXYZ[a+2] >= 0){ setColor(data, astXYZ[a], astXYZ[a+1], 500, asteroids[a/3][4], asteroids[a/3][5], asteroids[a/3][6], 255, asteroids[a/3][7]); } } } ctx.putImageData(imageData, 0, 0); dphi -= planetRotationDiff+rotationMomentum; //rotationMomentum *= 0.90; if(mouseDown){ dphi -= mouseDiff.x*0.005; } //if(justReleasedMouse){ // rotationMomentum = mouseDiff.x > 0 ? 1 : -1; // justReleasedMouse = false; //} window.requestAnimationFrame(function(){ animate(texture_data, radius); }); } function render_planet(canvas_data, texture_data, radius, w, h, x1, x2, angle1, angle2){ for(var x = x1; x < x2; x++){ for(var y = 0; y < h; y++){ var phi = map(x, x1, x2, angle1+dphi, angle2+dphi), theta = map(y, 0, h-1, Math.PI, 0); var r = texture_data[(x + y*w)*4], g = texture_data[(x + y*w)*4 + 1], b = texture_data[(x + y*w)*4 + 2], a = texture_data[(x + y*w)*4 + 3]; var rad = radius; var zz = rad*Math.abs(Math.sin(theta))*Math.sin(phi), xx = Math.round(rad*Math.abs(Math.sin(theta))*Math.cos(phi)) + 250, yy = Math.round(rad*Math.cos(theta)) + 250; if(zz >= 0){ setColor(canvas_data, xx, yy, 500, r, g, b, 255); } } } }
'use strict'; module.exports = { name: 'close', classNames: ['spin', 'alt'] };
import React from 'react'; import styled from 'styled-components'; import PropTypes from 'prop-types'; import { below } from '../../utilities'; const Container = styled.div` position: relative; text-align: center; height: 80vh; ${below.xsmall` max-width: 100vw; `}; `; const HeroImage = styled.img` object-fit: cover; width: 100%; height: 100%; -webkit-filter: brightness(0.4); filter: brightness(0.4); `; const HereContainer = ({ className, imageSource, imageAlt, children }) => { return ( <Container className={className}> <HeroImage src={imageSource} loading="lazy" alt={imageAlt} /> {children} </Container> ); }; HereContainer.propTypes = { className: PropTypes.string, imageSource: PropTypes.string.isRequired, imageAlt: PropTypes.string.isRequired, }; HereContainer.defaultProps = { className: '', }; export default styled(HereContainer)``;
var tool={ getUrlStringId: function (name) {//用法 tool.getUrlStringId("地址栏参数名"); var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return decodeURI(r[2],'utf-8'); return null; }, Verification:function($parameter){//需要layer.js var statusver=true; var code=$parameter.val().trim(); switch ($parameter.attr("Fv")) { case ("1")://身份证 var city={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "}; var tip = ""; var pass= true; if(!code || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code)){ tip = "身份证号格式错误"; pass = false; } else if(!city[code.substr(0,2)]){ tip = "地址编码错误"; pass = false; } else{ //18位身份证需要验证最后一位校验位 if(code.length == 18){ code = code.split(''); //加权因子 var factor = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 ]; //校验位 var parity = [ 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 ]; var sum = 0; var ai = 0; var wi = 0; for (var i = 0; i < 17; i++) { ai = code[i]; wi = factor[i]; sum += ai * wi; } var last = parity[sum % 11]; if(parity[sum % 11] != code[17]){ tip = "身份证号错误"; pass =false; } } } if(!pass) {layer.msg(tip);statusver=false;} break; case ("2")://手机号 var re=/^1[0-9]{10}$/; if (!re.test(code)) {layer.msg("手机号格式不正确");statusver=false;} break; case ("3")://车牌 var re=/^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}$/; if (!re.test(code)) {layer.msg("车牌号格式不正确");statusver=false;} break; case ("4")://数字 if (isNaN(code)) {layer.msg("格式为数字格式");statusver=false;} break; case ("5")://姓名 var re=/^[\u4e00-\u9fa5]{2,4}$/; if (!re.test(code)) {layer.msg("姓名格式不正确");statusver=false;} break; case ("6")://邮箱 var re=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; if (!re.test(code)) {layer.msg("邮箱格式不正确");statusver=false;} break; case("7"): var rePhone = /^(0[0-9]{2,3}[-]{0,1})?[0-9]{7,8}$/; var reTel=/^1[0-9]{10}$/; if (!reTel.test(code)&&!rePhone.test(code)) {layer.msg("电话号码格式不正确");statusver=false;} break; case ("101")://文本框可以为空,不为空时验证手机号 var re=/^1[0-9]{10}$/; if (code!="") { if (!re.test(code)) {layer.msg("手机号格式不正确");statusver=false;} } break; case ("102")://文本框可以为空,不为空时验证电话号码 var rePhone = /^(0[0-9]{2,3}[-]{0,1})?[0-9]{7,8}$/; var reTel=/^1[0-9]{10}$/; if (code!="") { if (!reTel.test(code)&&!rePhone.test(code)) {layer.msg("电话号码格式不正确");statusver=false;} } break; default://为空 if(!code){layer.msg($parameter.attr("FvInfo"));statusver=false;}; } !statusver ? $parameter.focus() : ""; return statusver; }, formVerification:function(){ var zhen=false; var Fv=$("input[Fv]"); for (var i = 0; i < Fv.length; i++) { if (!tool.Verification(Fv.eq(i))) { break; } i==Fv.length-1 ? zhen=true : zhen=false; } return zhen; }, formatDate:function(date,ymd) { if(date==""||date==null){return ""; } date=new Date(date); var year = date.getFullYear() ,month = date.getMonth() + 1 ,day = date.getDate() ,hour = date.getHours() ,minute = date.getMinutes() ,second = date.getSeconds(); if (10 > month) { month = "0" + month; } if (10 > day) { day = "0" + day; } if (10 > hour) { hour = "0" + hour; } if (10 > minute) { minute = "0" + minute; } if (10 > second) { second = "0" + second; } if(ymd=="ss"){ return year + "-" + month + "-" + day+ " " + hour+ ":" + minute + ":" + second; }else if(ymd) { return year + "-" + month + "-" + day; }else{ return year + "-" + month + "-" + day+ " " + hour+ ":" + minute; } }, officeClerk:function(title,url,w,h){ layer_show(title,url,w,h); }, retainDecimal:function(num){//保留3位小数,没有小数则返回原本数值 if (num==""||num==null) {num=0} var ex = /^\d+$/; return !ex.test(Number(num)) ?Number(num).toFixed(2)*1000/1000:num; }, returnBack:function(d,s){ for(var D in d){ if(!D){D="";} if (s!==undefined&&s.length>0) { for (var i = 0; i < s.length; i++) { if(D==s[i]){ $("select[name="+D+"]").val(d[D]); }else{ $("input[name="+D+"]").val(d[D]); } } }else{ $("input[name="+D+"]").val(d[D]); } } }, asyncFalse:function(url ,data ,success_ ){//mobile 接口 参数 /*tool.asyncFalse("../task/modifyStatus.do",data,function(r,getLayer){ layer.open({content:lcon ,skin: 'msg',time: 2}); setTimeout(function(){location.reload();}, 1000); });*/ var dtd = $.Deferred(),layerLoad=null; // 新建一个deferred对象 var wait = function(dtd){ layerLoad= layer.open({type: 2,shadeClose: false});       setTimeout(function(){dtd.resolve();/* 改变deferred对象的执行状态*/},500);       return dtd; }; $.when(wait(dtd)).done(function(){ $.ajax({ url:url, type:"post", dataType:"json", data:data, async:false }).done(function(r){ if (r.status==0) { success_(r,layerLoad); }else{layer.open({content:r.msg,skin: 'msg',time: 2}); } }).fail(function(){ layer.open({content:url+"接口错误",skin: 'msg',time: 2}); }); }); }, Pastdate:function(type,time){ /* ct=current time 当前时间 cy=current year 当前年份 cm=current month 当前月份 st=storage 存储字段 */ time=parseInt(time); time=time>0&&!isNaN(time)?time:1; var day=null ,ct=new Date() ,cy=ct.getFullYear() ,cm=ct.getMonth() ,st=null; switch(type){ case 0: day=ct.getTime()-(24*60*60*1000*time); break; case 1: storage=(new Date(cy,cm-time+1,1).getTime()-new Date(cy,cm-time,1).getTime())/(24*60*60*1000); day=new Date(cy,cm-time,storage).getTime(); break; } return { oDate:day, cDate:ct.getTime() } } } //调用tool.js 用法为:tool.方法名();
var express = require('express'); var router = express.Router(); var dataBike = [ {name:"BIK045", url:"/images/bike-1.jpg", price:679}, {name:"ZOOK07", url:"/images/bike-2.jpg", price:999}, {name:"TITANS", url:"/images/bike-3.jpg", price:799}, {name:"CEWO", url:"/images/bike-4.jpg", price:1300}, {name:"AMIG039", url:"/images/bike-5.jpg", price:479}, {name:"LIK099", url:"/images/bike-6.jpg", price:869}, ] var dataCardBike = [ {name:"BIK045", url:"/images/bike-1.jpg", price:679, quantity:1}, {name:"ZOOK07", url:"/images/bike-2.jpg", price:999, quantity:2}, ] /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', {dataBike:dataBike}); }); router.get('/shop', function(req, res, next) { dataCardBike.push({ name: req.query.bikeNameFromFront, url: req.query.bikeImageFromFront, price: req.query.bikePriceFromFront, quantity: 1 }) res.render('shop', {dataCardBike:dataCardBike}); }); router.get('/delete-shop', function(req, res, next){ dataCardBike.splice(req.query.position,1) res.render('shop',{dataCardBike:dataCardBike}) }) router.post('/update-shop', function(req, res, next){ var position = req.body.position; var newQuantity = req.body.quantity; dataCardBike[position].quantity = newQuantity; res.render('shop',{dataCardBike:dataCardBike}) }) module.exports = router;
// Chiedi all’utente il suo nome, poi chiedi il suo cognome, poi chiedi il suo colore preferito // Scrivi sulla pagina nomecognomecolorepreferito19 var nome = prompt("Ciao! Inserisci per favore il tuo nome:"); var cognome = prompt("Inserisci ora il tuo cognome:"); var colore = prompt("Qual è il tuo colore preferito?"); var numero = 19; document.getElementById('pwd').innerHTML = nome + cognome + colore + numero;
#!/usr/bin/env node const inliner = require('html-inline'); const bootprint = require('bootprint'); const bootprintSwagger = require('bootprint-swagger'); const fs = require('fs'); const path = require('path'); var input = process.argv[2]; const tmpDir = path.join(__dirname, 'tmp'); bootprint .load(bootprintSwagger) .build(input, tmpDir) .generate() .done(combine); function combine() { var tmpPath = path.join(tmpDir, 'index.html'); var outPath = path.join(path.dirname(input), 'API.html') var converter = inliner({basedir: tmpDir}); var inStream = fs.createReadStream(tmpPath); var outStream = fs.createWriteStream(outPath); inStream.pipe(converter); converter.pipe(outStream); }
import _ from 'lodash'; import classnames from 'classnames'; export default { classnames: (prefix, styles) => { const cx = classnames.bind(styles); return (...names) => cx(_.map(names, name => { if (typeof name === 'string') { return `${prefix}-${name}`; } else if (typeof name === 'object') { const returnObj = {}; for (const key in name) { if (Object.prototype.hasOwnProperty.call(name, key)) { const element = name[key]; returnObj[`${prefix}-${key}`] = element; } } return returnObj; } return ''; })); }, number: { localize(num, precision = 2) { if (!_.isFinite(num)) { return '--'; } const flag = num < 0 ? '-' : ''; const number = Math.abs(num); if (number > 100000000) { return `${flag}${(number / 100000000).toFixed(precision)}亿`; } else if (number > 10000) { return `${flag}${(number / 10000).toFixed(precision)}万`; } return num; }, comma(num) { if (_.isNil(num)) { return '--'; } const nStr = `${num}`; const x = nStr.split('.'); let x1 = x[0]; const x2 = x.length > 1 ? `.${x[1]}` : ''; const rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1,$2'); } return x1 + x2; }, toPercent(value, precision = 2) { if (_.isNumber(value) && _.isFinite(value)) { const percentValue = (Math.abs(value) * 100).toFixed(precision); return `${percentValue}%`; } return '--'; }, numberFormatter(value) { const reg = /^(-)*(\d+)\.(\d*).*$/; return !isNaN(parseFloat(value)) ? value.toString().replace(reg, '$1$2.$3') : ''; /* eslint no-restricted-globals:0 */ }, }, url: { parse(realurl) { const url = realurl.replace('#', ''); const arr = url.split('?'); if (arr.length === 1) { return {}; } const kvStr = arr[1]; const kv = kvStr.split('&'); return kv.reduce((params, item) => { const kvArr = item.split('='); const newParams = params; if (kvArr.length === 2) { newParams[kvArr[0]] = kvArr[1]; } return newParams; }, {}); }, }, highlight: { escape(escapeText) { return escapeText .replace(/&lt;em&gt;/g, '<em>') .replace(/&lt;\/em&gt;/g, '</em>') .replace(/<em>/g, '<em>') .replace(/<\/em>/g, '</em>'); }, removeHighlight(escapeText) { return escapeText .replace(/&lt;em&gt;/g, '') .replace(/&lt;\/em&gt;/g, '') .replace(/<em>/g, '') .replace(/<\/em>/g, ''); }, }, cutstr: (str, num, suffix = '...') => { const len = str.length; const result = str.slice(0, num) + (num < len ? suffix : ''); return result; }, navTo: (pathName, history) => { history.push(pathName); }, formatNum: n => { const unit = [{ text: '万', limit: 6, hide: 4 }, { text: '亿', limit: 5, hide: 4 }]; let num = `${n}`; let unitStr = ''; for (let i = 0; i < unit.length; i += 1) { const item = unit[i]; if (num.length > item.limit) { num = num.substr(0, num.length - item.hide); unitStr = item.text; } else break; } const re = /(-?\d+)(\d{3})/; while (re.test(num)) { num = num.replace(re, '$1,$2'); } return `${num}${unitStr}`; }, smartDayDiff: (moment1, moment2) => { const year1 = moment1.year(); let year2 = moment2.year(); const month1 = moment1.month(); let month2 = moment2.month(); const date1 = moment1.date(); const date2 = moment2.date(); if (month2 < month1) { year2 -= 1; month2 += 12; } let year = year2 - year1; let month = month2 - month1 + (date2 - date1 > 15 ? 1 : date2 - date1 < -15 ? -1 : 0); if (month < 0) { year -= 1; month += 12; } else if (month >= 12) { year += 1; month -= 12; } return { text: year > 0 || month > 0 ? `约${year > 0 ? `${year}年` : ''}${month > 0 ? `${month}个月` : ''}` : '', value: parseInt((moment2.unix() - moment1.unix()) / 24 / 3600), }; }, isObjectEmpty: (obj, except) => { for (const key in obj) { if (!except || !_.includes(except, key)) { if (obj[key] != null && obj[key] !== '') { return false; } } } return true; }, calcPriv:(component,privs)=>{ console.log('计算组件权限',component,privs); return component; } };
var books = [ {title: "Egri csillagok", year: 1901, authors: ["Gardonyi Geza"], genres:["Drama", "Romance"]}, {title: "Három sors", year: 1967, authors: ["David Lytton", "E.R. Braithwaite", "Langston Hughes"], genres:[]}, {title: "Negy sors", year: 1965, authors: ["David Lytton", "E.R. Braithwaite", "Langston Hughes"], genres:["novel"]}, {title: "Emberi sors", year: 1956, authors: ["Mihail Alekszandrovics Solohov"], genres:["novel", "Drama"]}, {title: "Modern munkakörnyezet építése", year: 2012, authors: ["Borbély Balázs", "Filkor Csaba", "Szentgyörgyi Tibor"], genres:["educational", "computer science"]}, {title: "Otthoni és irodai hálózatok zsebkönyve", year: 1901, authors: ["Borbély Balázs", "Filkor Csaba"], genres:["educational"]}, {title: "Láthatatlan ember", year: 1902, authors: ["Gardonyi Geza"], genres:[]}, {title: "Isten rabjai", year: 1908, authors: ["Gardonyi Geza"], genres:["Drama"]}, ]; /* Adott az alabbi struktura (ertelemszeruen ennel tobb elemmel): [ { title: "Egri csillagok", year: 1901, authors: ["Gardonyi Geza"], genres: [ "Drama", "Romance" ] }, …. ] Feladatok: a, listazd ki a szerzoket, es mellejuk a konyveik szamat, csokkeno sorrendben b, listazd ki a szerzoparosokat, es mellejuk, hogy hany kozos konyvuk volt c, listazd ki a mufajokat, mellejuk, hogy hany konyv keszult ilyen mufajban, csokkeno sorrendben d, listazd ki a szerzoket, es mindegyik melle a legkorabbi konyve evszamat d,bonusz: evszam szerint novekvo sorrendben) e, listazd ki azokat a szerzoparosokat, akiknek kulon-kulon vett elso konyveik evszama kozott tobb, mint 10 ev telt el, a kulonbseget is kiirva, a kulonbseg szerint csokkeno sorrendben */
const fetch_urls = { root_url: 'http://13.92.168.44:8000', }; export default fetch_urls;
import {emit, humanizeDate} from "../../../utilities/tools"; import {template, createElement} from "../../../utilities/travrs"; require('./toolbar.scss'); const scaffold = ` div.cnxb-toolbar > @label @buttons`; const buttonScaffols = ` div.cnxb-merge-btns > button.accept[title="Accept all changes" data-action="accept"] > "Accept All" button.reject[title="Reject all changes" data-action="reject"] > "Reject All"`; // ------------------------------------------------ // ---- TOOLBAR CORE ---------------- // ------------------------ export default (function Toolbar () { // Toolbox API. const API = {}; // UI References. const refs = { label: createElement('div.cnxb-toolbar-prompter', 'Legacy content'), buttons: template(buttonScaffols) }; // Create UI element. const element = template(refs, scaffold); API.element = element; // Detect click action. const clickHandle = (event) => { const {action} = event.target.dataset; action && element.dispatchEvent(emit('revision', { action })); }; // Set Toolbar label. API.label = (title, ctv, cpv) => { const part1 = `<span>${title}</span>`; const part2 = ctv ? ` <span class="cnxb-label" title="Content version">${humanizeDate(ctv)}</span>` : ''; const part3 = cpv ? ` ⇌ <span class="cnxb-label" title="Compare verion">${humanizeDate(cpv)}</span>` : ''; refs.label.innerHTML = part1 + part2 + part3; return API; }; // Show/Hide Revision toolbar. API.revision = (flag = true) => { flag ? refs.buttons.classList.add('active') : refs.buttons.classList.remove('active'); return API; }; // Add listeners. element.addEventListener('click', clickHandle); // Public API. return API; }());
import React, { Component } from 'react'; import Video from "./Video"; import VidList from "./VidList"; function vid(title,pubdate,description,channel, views,comments,imgSrc){ this.title = title; this.channel=channel; this.pubdate=pubdate; this.description=description; this.views= views; this.subs="1.2M"; this.comments=comments; this.likes="6.9K"; this.dislikes= "202"; this.imgSrc = imgSrc; //hardcoded for now this.vidSrc = "./Assets/Brainstation Sample Video.mp4"; this.length='4:45'; } class ContentBody extends Component{ //create object of videos in an array to be passed to lower elements as props //let object; render(){ //hardcoded array let vidArray=[]; //hardcoded data vidArray.push( new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning","Oct 14, 2015", "10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"], "./Assets/Images/920x920.jpg")); vidArray.push(new vid("Jose Bautista hammers go-ahead three-run shot in ALDS Game 5, delivers epic bat flip","Oct 14, 2015", "10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","2,304,189 views",["wow","ye-haw"],"./Assets/Images/maxresdefault.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views",["wow","ye-haw"],"./Assets/Images/american-league-wild-card-game---minnesota-twins-v-new-york-yankees-8119099224ebf5b5.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views",["wow","ye-haw"],"./Assets/Images/BASEBALL-MLB-HOU-LAD-.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views",["wow","ye-haw"],"./Assets/Images/Big-Read-Vladimir-Guerrero-Jr-Swings-470x264.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/donaldson.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/hqdefault.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/maxresdefault.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/PR6AGOQ7XREI5B7UMKM3KAGWFA.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/r241851_600x400_3-2.jpg")); vidArray.push(new vid("TEX @ TOR Gm5: Blue Jays take lead in wild 7th inning", "Oct 14, 2015","10/14/15: Jose Bautista crushes a long go-ahead three-run homer in the 7th inning of ALDS Game 5", "MLB","1.1M views", ["wow","ye-haw"] ,"./Assets/Images/THKMOYWFLWJCPXQ.20170430201114.jpg")); //index of current video let currentVid = 1; let current = vidArray.splice(currentVid,1); // return( <div className="video-container margin"> <Video current={current[0]}></Video> <VidList vidArray={vidArray}></VidList> </div> ); } } export default ContentBody;
var searchData= [ ['block_5fsize',['block_size',['../classDCCTransfer.html#ae0db2aef906ae1e7704bae66a39b0f9f',1,'DCCTransfer']]] ];
import React, { useState, useEffect } from 'react' import { BACKGROUND_SYNC_TASK_NAME } from './../global/backgroundSync' import { BACKGROUND_TRACKING_TASK_NAME } from './../global/backgroundLocationTracking' import * as TaskManager from 'expo-task-manager' import * as BackgroundFetch from 'expo-background-fetch' const BackgroundScriptContext = React.createContext() export const { Provider, Consumer } = BackgroundScriptContext /** * Ensures the background tracking script is installed and pases a boolean value * down through the context. */ export var BackgroundScriptWrapper = props => { var [locationTrackingInstalled, setLocationTrackingInstalled] = useState() useEffect(() => { TaskManager.getRegisteredTasksAsync() .then(tasks => { var existsSync = tasks.some( t => t['taskName'] == BACKGROUND_SYNC_TASK_NAME) var existsTrack = tasks.some( t => t['taskName'] == BACKGROUND_TRACKING_TASK_NAME) setLocationTrackingInstalled(existsSync && existsTrack) }) }) return ( <Provider value={locationTrackingInstalled}> {props.children} </Provider> ) }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.models = exports.modelBase = undefined; var _Products = require('./Products'); var _Products2 = _interopRequireDefault(_Products); var _Users = require('./Users'); var _Users2 = _interopRequireDefault(_Users); var _Images = require('./Images'); var _Images2 = _interopRequireDefault(_Images); var _listPosts = require('./listPosts'); var _listPosts2 = _interopRequireDefault(_listPosts); var _detailPost = require('./detailPost'); var _detailPost2 = _interopRequireDefault(_detailPost); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var modelBase = exports.modelBase = ['Products', 'Users', 'Images', 'listPosts', 'detailPost']; var models = exports.models = { Products: _Products2.default, Users: _Users2.default, Images: _Images2.default, listPosts: _listPosts2.default, detailPost: _detailPost2.default };
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bigfoot_ui__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bigfoot_ui___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_bigfoot_ui__); /***/ }), /* 1 */ /***/ (function(module, exports) { /******/(function (modules) { // webpackBootstrap /******/ // The module cache /******/var installedModules = {}; /******/ /******/ // The require function /******/function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/if (installedModules[moduleId]) { /******/return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/var module = installedModules[moduleId] = { /******/i: moduleId, /******/l: false, /******/exports: {} /******/ }; /******/ /******/ // Execute the module function /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/module.l = true; /******/ /******/ // Return the exports of the module /******/return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/__webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/__webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/__webpack_require__.d = function (exports, name, getter) { /******/if (!__webpack_require__.o(exports, name)) { /******/Object.defineProperty(exports, name, { /******/configurable: false, /******/enumerable: true, /******/get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/__webpack_require__.n = function (module) { /******/var getter = module && module.__esModule ? /******/function getDefault() { return module['default']; } : /******/function getModuleExports() { return module; }; /******/__webpack_require__.d(getter, 'a', getter); /******/return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/__webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/__webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/return __webpack_require__(__webpack_require__.s = 1); /******/ })( /************************************************************************/ /******/[ /* 0 */ /***/function (module, exports) { var g; // This works in non-strict mode g = function () { return this; }(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1, eval)("this"); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }, /* 1 */ /***/function (module, exports, __webpack_require__) { const supportsShadowDOMV1 = !!HTMLElement.prototype.attachShadow; console.log(supportsShadowDOMV1); if (!supportsShadowDOMV1) { __webpack_require__(2); __webpack_require__(3); __webpack_require__(4); __webpack_require__(5); __webpack_require__(6); } __webpack_require__(7); /***/ }, /* 2 */ /***/function (module, exports) { (function () { 'use strict'; var h = new function () {}();var aa = new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function n(b) { var a = aa.has(b);b = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(b);return !a && b; }function p(b) { var a = b.isConnected;if (void 0 !== a) return a;for (; b && !(b.__CE_isImportDocument || b instanceof Document);) b = b.parentNode || (window.ShadowRoot && b instanceof ShadowRoot ? b.host : void 0);return !(!b || !(b.__CE_isImportDocument || b instanceof Document)); } function q(b, a) { for (; a && a !== b && !a.nextSibling;) a = a.parentNode;return a && a !== b ? a.nextSibling : null; } function t(b, a, c) { c = c ? c : new Set();for (var d = b; d;) { if (d.nodeType === Node.ELEMENT_NODE) { var e = d;a(e);var f = e.localName;if ("link" === f && "import" === e.getAttribute("rel")) { d = e.import;if (d instanceof Node && !c.has(d)) for (c.add(d), d = d.firstChild; d; d = d.nextSibling) t(d, a, c);d = q(b, e);continue; } else if ("template" === f) { d = q(b, e);continue; }if (e = e.__CE_shadowRoot) for (e = e.firstChild; e; e = e.nextSibling) t(e, a, c); }d = d.firstChild ? d.firstChild : q(b, d); } }function u(b, a, c) { b[a] = c; };function v() { this.a = new Map();this.o = new Map();this.f = [];this.b = !1; }function ba(b, a, c) { b.a.set(a, c);b.o.set(c.constructor, c); }function w(b, a) { b.b = !0;b.f.push(a); }function x(b, a) { b.b && t(a, function (a) { return y(b, a); }); }function y(b, a) { if (b.b && !a.__CE_patched) { a.__CE_patched = !0;for (var c = 0; c < b.f.length; c++) b.f[c](a); } }function z(b, a) { var c = [];t(a, function (b) { return c.push(b); });for (a = 0; a < c.length; a++) { var d = c[a];1 === d.__CE_state ? b.connectedCallback(d) : A(b, d); } } function B(b, a) { var c = [];t(a, function (b) { return c.push(b); });for (a = 0; a < c.length; a++) { var d = c[a];1 === d.__CE_state && b.disconnectedCallback(d); } } function C(b, a, c) { c = c ? c : {};var d = c.w || new Set(), e = c.s || function (a) { return A(b, a); }, f = [];t(a, function (a) { if ("link" === a.localName && "import" === a.getAttribute("rel")) { var c = a.import;c instanceof Node && (c.__CE_isImportDocument = !0, c.__CE_hasRegistry = !0);c && "complete" === c.readyState ? c.__CE_documentLoadHandled = !0 : a.addEventListener("load", function () { var c = a.import;if (!c.__CE_documentLoadHandled) { c.__CE_documentLoadHandled = !0;var f = new Set(d);f.delete(c);C(b, c, { w: f, s: e }); } }); } else f.push(a); }, d);if (b.b) for (a = 0; a < f.length; a++) y(b, f[a]);for (a = 0; a < f.length; a++) e(f[a]); } function A(b, a) { if (void 0 === a.__CE_state) { var c = a.ownerDocument;if (c.defaultView || c.__CE_isImportDocument && c.__CE_hasRegistry) if (c = b.a.get(a.localName)) { c.constructionStack.push(a);var d = c.constructor;try { try { if (new d() !== a) throw Error("The custom element constructor did not produce the element being upgraded."); } finally { c.constructionStack.pop(); } } catch (m) { throw a.__CE_state = 2, m; }a.__CE_state = 1;a.__CE_definition = c;if (c.attributeChangedCallback) for (c = c.observedAttributes, d = 0; d < c.length; d++) { var e = c[d], f = a.getAttribute(e);null !== f && b.attributeChangedCallback(a, e, null, f, null); }p(a) && b.connectedCallback(a); } } }v.prototype.connectedCallback = function (b) { var a = b.__CE_definition;a.connectedCallback && a.connectedCallback.call(b); };v.prototype.disconnectedCallback = function (b) { var a = b.__CE_definition;a.disconnectedCallback && a.disconnectedCallback.call(b); }; v.prototype.attributeChangedCallback = function (b, a, c, d, e) { var f = b.__CE_definition;f.attributeChangedCallback && -1 < f.observedAttributes.indexOf(a) && f.attributeChangedCallback.call(b, a, c, d, e); };function D(b, a) { this.c = b;this.a = a;this.b = void 0;C(this.c, this.a);"loading" === this.a.readyState && (this.b = new MutationObserver(this.f.bind(this)), this.b.observe(this.a, { childList: !0, subtree: !0 })); }function E(b) { b.b && b.b.disconnect(); }D.prototype.f = function (b) { var a = this.a.readyState;"interactive" !== a && "complete" !== a || E(this);for (a = 0; a < b.length; a++) for (var c = b[a].addedNodes, d = 0; d < c.length; d++) C(this.c, c[d]); };function ca() { var b = this;this.b = this.a = void 0;this.f = new Promise(function (a) { b.b = a;b.a && a(b.a); }); }function F(b) { if (b.a) throw Error("Already resolved.");b.a = void 0;b.b && b.b(void 0); };function G(b) { this.i = !1;this.c = b;this.m = new Map();this.j = function (b) { return b(); };this.g = !1;this.l = [];this.u = new D(b, document); } G.prototype.define = function (b, a) { var c = this;if (!(a instanceof Function)) throw new TypeError("Custom element constructors must be functions.");if (!n(b)) throw new SyntaxError("The element name '" + b + "' is not valid.");if (this.c.a.get(b)) throw Error("A custom element with name '" + b + "' has already been defined.");if (this.i) throw Error("A custom element is already being defined.");this.i = !0;var d, e, f, m, l;try { var g = function (b) { var a = k[b];if (void 0 !== a && !(a instanceof Function)) throw Error("The '" + b + "' callback must be a function."); return a; }, k = a.prototype;if (!(k instanceof Object)) throw new TypeError("The custom element constructor's prototype is not an object.");d = g("connectedCallback");e = g("disconnectedCallback");f = g("adoptedCallback");m = g("attributeChangedCallback");l = a.observedAttributes || []; } catch (r) { return; } finally { this.i = !1; }a = { localName: b, constructor: a, connectedCallback: d, disconnectedCallback: e, adoptedCallback: f, attributeChangedCallback: m, observedAttributes: l, constructionStack: [] };ba(this.c, b, a);this.l.push(a);this.g || (this.g = !0, this.j(function () { return da(c); })); };function da(b) { if (!1 !== b.g) { b.g = !1;for (var a = b.l, c = [], d = new Map(), e = 0; e < a.length; e++) d.set(a[e].localName, []);C(b.c, document, { s: function (a) { if (void 0 === a.__CE_state) { var e = a.localName, f = d.get(e);f ? f.push(a) : b.c.a.get(e) && c.push(a); } } });for (e = 0; e < c.length; e++) A(b.c, c[e]);for (; 0 < a.length;) { for (var f = a.shift(), e = f.localName, f = d.get(f.localName), m = 0; m < f.length; m++) A(b.c, f[m]);(e = b.m.get(e)) && F(e); } } }G.prototype.get = function (b) { if (b = this.c.a.get(b)) return b.constructor; }; G.prototype.whenDefined = function (b) { if (!n(b)) return Promise.reject(new SyntaxError("'" + b + "' is not a valid custom element name."));var a = this.m.get(b);if (a) return a.f;a = new ca();this.m.set(b, a);this.c.a.get(b) && !this.l.some(function (a) { return a.localName === b; }) && F(a);return a.f; };G.prototype.v = function (b) { E(this.u);var a = this.j;this.j = function (c) { return b(function () { return a(c); }); }; };window.CustomElementRegistry = G;G.prototype.define = G.prototype.define;G.prototype.get = G.prototype.get; G.prototype.whenDefined = G.prototype.whenDefined;G.prototype.polyfillWrapFlushCallback = G.prototype.v;var H = window.Document.prototype.createElement, ea = window.Document.prototype.createElementNS, fa = window.Document.prototype.importNode, ga = window.Document.prototype.prepend, ha = window.Document.prototype.append, ia = window.DocumentFragment.prototype.prepend, ja = window.DocumentFragment.prototype.append, I = window.Node.prototype.cloneNode, J = window.Node.prototype.appendChild, K = window.Node.prototype.insertBefore, L = window.Node.prototype.removeChild, M = window.Node.prototype.replaceChild, N = Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"), O = window.Element.prototype.attachShadow, P = Object.getOwnPropertyDescriptor(window.Element.prototype, "innerHTML"), Q = window.Element.prototype.getAttribute, R = window.Element.prototype.setAttribute, S = window.Element.prototype.removeAttribute, T = window.Element.prototype.getAttributeNS, U = window.Element.prototype.setAttributeNS, ka = window.Element.prototype.removeAttributeNS, la = window.Element.prototype.insertAdjacentElement, ma = window.Element.prototype.prepend, na = window.Element.prototype.append, V = window.Element.prototype.before, oa = window.Element.prototype.after, pa = window.Element.prototype.replaceWith, qa = window.Element.prototype.remove, ra = window.HTMLElement, W = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML"), sa = window.HTMLElement.prototype.insertAdjacentElement;function ta() { var b = X;window.HTMLElement = function () { function a() { var a = this.constructor, d = b.o.get(a);if (!d) throw Error("The custom element being constructed was not registered with `customElements`.");var e = d.constructionStack;if (!e.length) return e = H.call(document, d.localName), Object.setPrototypeOf(e, a.prototype), e.__CE_state = 1, e.__CE_definition = d, y(b, e), e;var d = e.length - 1, f = e[d];if (f === h) throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); e[d] = h;Object.setPrototypeOf(f, a.prototype);y(b, f);return f; }a.prototype = ra.prototype;return a; }(); };function Y(b, a, c) { function d(a) { return function (d) { for (var c = [], e = 0; e < arguments.length; ++e) c[e - 0] = arguments[e];for (var e = [], f = [], k = 0; k < c.length; k++) { var r = c[k];r instanceof Element && p(r) && f.push(r);if (r instanceof DocumentFragment) for (r = r.firstChild; r; r = r.nextSibling) e.push(r);else e.push(r); }a.apply(this, c);for (c = 0; c < f.length; c++) B(b, f[c]);if (p(this)) for (c = 0; c < e.length; c++) f = e[c], f instanceof Element && z(b, f); }; }c.h && (a.prepend = d(c.h));c.append && (a.append = d(c.append)); };function ua() { var b = X;u(Document.prototype, "createElement", function (a) { if (this.__CE_hasRegistry) { var c = b.a.get(a);if (c) return new c.constructor(); }a = H.call(this, a);y(b, a);return a; });u(Document.prototype, "importNode", function (a, c) { a = fa.call(this, a, c);this.__CE_hasRegistry ? C(b, a) : x(b, a);return a; });u(Document.prototype, "createElementNS", function (a, c) { if (this.__CE_hasRegistry && (null === a || "http://www.w3.org/1999/xhtml" === a)) { var d = b.a.get(c);if (d) return new d.constructor(); }a = ea.call(this, a, c);y(b, a);return a; }); Y(b, Document.prototype, { h: ga, append: ha }); };function va() { var b = X;function a(a, d) { Object.defineProperty(a, "textContent", { enumerable: d.enumerable, configurable: !0, get: d.get, set: function (a) { if (this.nodeType === Node.TEXT_NODE) d.set.call(this, a);else { var c = void 0;if (this.firstChild) { var e = this.childNodes, l = e.length;if (0 < l && p(this)) for (var c = Array(l), g = 0; g < l; g++) c[g] = e[g]; }d.set.call(this, a);if (c) for (a = 0; a < c.length; a++) B(b, c[a]); } } }); }u(Node.prototype, "insertBefore", function (a, d) { if (a instanceof DocumentFragment) { var c = Array.prototype.slice.apply(a.childNodes); a = K.call(this, a, d);if (p(this)) for (d = 0; d < c.length; d++) z(b, c[d]);return a; }c = p(a);d = K.call(this, a, d);c && B(b, a);p(this) && z(b, a);return d; });u(Node.prototype, "appendChild", function (a) { if (a instanceof DocumentFragment) { var c = Array.prototype.slice.apply(a.childNodes);a = J.call(this, a);if (p(this)) for (var e = 0; e < c.length; e++) z(b, c[e]);return a; }c = p(a);e = J.call(this, a);c && B(b, a);p(this) && z(b, a);return e; });u(Node.prototype, "cloneNode", function (a) { a = I.call(this, a);this.ownerDocument.__CE_hasRegistry ? C(b, a) : x(b, a); return a; });u(Node.prototype, "removeChild", function (a) { var c = p(a), e = L.call(this, a);c && B(b, a);return e; });u(Node.prototype, "replaceChild", function (a, d) { if (a instanceof DocumentFragment) { var e = Array.prototype.slice.apply(a.childNodes);a = M.call(this, a, d);if (p(this)) for (B(b, d), d = 0; d < e.length; d++) z(b, e[d]);return a; }var e = p(a), c = M.call(this, a, d), m = p(this);m && B(b, d);e && B(b, a);m && z(b, a);return c; });N && N.get ? a(Node.prototype, N) : w(b, function (b) { a(b, { enumerable: !0, configurable: !0, get: function () { for (var a = [], b = 0; b < this.childNodes.length; b++) a.push(this.childNodes[b].textContent);return a.join(""); }, set: function (a) { for (; this.firstChild;) L.call(this, this.firstChild);J.call(this, document.createTextNode(a)); } }); }); };function wa(b) { var a = Element.prototype;function c(a) { return function (c) { for (var d = [], e = 0; e < arguments.length; ++e) d[e - 0] = arguments[e];for (var e = [], l = [], g = 0; g < d.length; g++) { var k = d[g];k instanceof Element && p(k) && l.push(k);if (k instanceof DocumentFragment) for (k = k.firstChild; k; k = k.nextSibling) e.push(k);else e.push(k); }a.apply(this, d);for (d = 0; d < l.length; d++) B(b, l[d]);if (p(this)) for (d = 0; d < e.length; d++) l = e[d], l instanceof Element && z(b, l); }; }V && (a.before = c(V));V && (a.after = c(oa));pa && u(a, "replaceWith", function (a) { for (var d = [], c = 0; c < arguments.length; ++c) d[c - 0] = arguments[c];for (var c = [], m = [], l = 0; l < d.length; l++) { var g = d[l];g instanceof Element && p(g) && m.push(g);if (g instanceof DocumentFragment) for (g = g.firstChild; g; g = g.nextSibling) c.push(g);else c.push(g); }l = p(this);pa.apply(this, d);for (d = 0; d < m.length; d++) B(b, m[d]);if (l) for (B(b, this), d = 0; d < c.length; d++) m = c[d], m instanceof Element && z(b, m); });qa && u(a, "remove", function () { var a = p(this);qa.call(this);a && B(b, this); }); };function xa() { var b = X;function a(a, c) { Object.defineProperty(a, "innerHTML", { enumerable: c.enumerable, configurable: !0, get: c.get, set: function (a) { var d = this, e = void 0;p(this) && (e = [], t(this, function (a) { a !== d && e.push(a); }));c.set.call(this, a);if (e) for (var f = 0; f < e.length; f++) { var k = e[f];1 === k.__CE_state && b.disconnectedCallback(k); }this.ownerDocument.__CE_hasRegistry ? C(b, this) : x(b, this);return a; } }); }function c(a, c) { u(a, "insertAdjacentElement", function (a, d) { var e = p(d);a = c.call(this, a, d);e && B(b, d);p(a) && z(b, d); return a; }); }O && u(Element.prototype, "attachShadow", function (a) { return this.__CE_shadowRoot = a = O.call(this, a); });P && P.get ? a(Element.prototype, P) : W && W.get ? a(HTMLElement.prototype, W) : w(b, function (b) { a(b, { enumerable: !0, configurable: !0, get: function () { return I.call(this, !0).innerHTML; }, set: function (a) { var b = "template" === this.localName, d = b ? this.content : this, c = H.call(document, this.localName);for (c.innerHTML = a; 0 < d.childNodes.length;) L.call(d, d.childNodes[0]);for (a = b ? c.content : c; 0 < a.childNodes.length;) J.call(d, a.childNodes[0]); } }); });u(Element.prototype, "setAttribute", function (a, c) { if (1 !== this.__CE_state) return R.call(this, a, c);var d = Q.call(this, a);R.call(this, a, c);c = Q.call(this, a);b.attributeChangedCallback(this, a, d, c, null); });u(Element.prototype, "setAttributeNS", function (a, c, f) { if (1 !== this.__CE_state) return U.call(this, a, c, f);var d = T.call(this, a, c);U.call(this, a, c, f);f = T.call(this, a, c);b.attributeChangedCallback(this, c, d, f, a); });u(Element.prototype, "removeAttribute", function (a) { if (1 !== this.__CE_state) return S.call(this, a);var c = Q.call(this, a);S.call(this, a);null !== c && b.attributeChangedCallback(this, a, c, null, null); });u(Element.prototype, "removeAttributeNS", function (a, c) { if (1 !== this.__CE_state) return ka.call(this, a, c);var d = T.call(this, a, c);ka.call(this, a, c);var e = T.call(this, a, c);d !== e && b.attributeChangedCallback(this, c, d, e, a); });sa ? c(HTMLElement.prototype, sa) : la ? c(Element.prototype, la) : console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");Y(b, Element.prototype, { h: ma, append: na });wa(b); }; /* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ var Z = window.customElements;if (!Z || Z.forcePolyfill || "function" != typeof Z.define || "function" != typeof Z.get) { var X = new v();ta();ua();Y(X, DocumentFragment.prototype, { h: ia, append: ja });va();xa();document.__CE_hasRegistry = !0;var customElements = new G(X);Object.defineProperty(window, "customElements", { configurable: !0, enumerable: !0, value: customElements }); }; }).call(self); //# sourceMappingURL=custom-elements.min.js.map /***/ }, /* 3 */ /***/function (module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function (global) { (function () { /* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict'; var aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function (a, b, c) { a != Array.prototype && a != Object.prototype && (a[b] = c.value); }, n = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this;function ba() { ba = function () {};n.Symbol || (n.Symbol = ca); }var ca = function () { var a = 0;return function (b) { return "jscomp_symbol_" + (b || "") + a++; }; }(); function p() { ba();var a = n.Symbol.iterator;a || (a = n.Symbol.iterator = n.Symbol("iterator"));"function" != typeof Array.prototype[a] && aa(Array.prototype, a, { configurable: !0, writable: !0, value: function () { return da(this); } });p = function () {}; }function da(a) { var b = 0;return ea(function () { return b < a.length ? { done: !1, value: a[b++] } : { done: !0 }; }); }function ea(a) { p();a = { next: a };a[n.Symbol.iterator] = function () { return this; };return a; }function fa(a) { p();var b = a[Symbol.iterator];return b ? b.call(a) : da(a); } function ha(a) { for (var b, c = []; !(b = a.next()).done;) c.push(b.value);return c; }function r(a, b) { return { index: a, j: [], m: b }; } function ia(a, b, c, d) { var e = 0, f = 0, h = 0, g = 0, l = Math.min(b - e, d - f);if (0 == e && 0 == f) a: { for (h = 0; h < l; h++) if (a[h] !== c[h]) break a;h = l; }if (b == a.length && d == c.length) { g = a.length;for (var k = c.length, m = 0; m < l - h && ja(a[--g], c[--k]);) m++;g = m; }e += h;f += h;b -= g;d -= g;if (0 == b - e && 0 == d - f) return [];if (e == b) { for (b = r(e, 0); f < d;) b.j.push(c[f++]);return [b]; }if (f == d) return [r(e, b - e)];l = e;h = f;d = d - h + 1;g = b - l + 1;b = Array(d);for (k = 0; k < d; k++) b[k] = Array(g), b[k][0] = k;for (k = 0; k < g; k++) b[0][k] = k;for (k = 1; k < d; k++) for (m = 1; m < g; m++) if (a[l + m - 1] === c[h + k - 1]) b[k][m] = b[k - 1][m - 1];else { var q = b[k - 1][m] + 1, z = b[k][m - 1] + 1;b[k][m] = q < z ? q : z; }l = b.length - 1;h = b[0].length - 1;d = b[l][h];for (a = []; 0 < l || 0 < h;) 0 == l ? (a.push(2), h--) : 0 == h ? (a.push(3), l--) : (g = b[l - 1][h - 1], k = b[l - 1][h], m = b[l][h - 1], q = k < m ? k < g ? k : g : m < g ? m : g, q == g ? (g == d ? a.push(0) : (a.push(1), d = g), l--, h--) : q == k ? (a.push(3), l--, d = k) : (a.push(2), h--, d = m));a.reverse();b = void 0;l = [];for (h = 0; h < a.length; h++) switch (a[h]) {case 0: b && (l.push(b), b = void 0);e++;f++;break;case 1: b || (b = r(e, 0));b.m++;e++;b.j.push(c[f]);f++;break;case 2: b || (b = r(e, 0)); b.m++;e++;break;case 3: b || (b = r(e, 0)), b.j.push(c[f]), f++;}b && l.push(b);return l; }function ja(a, b) { return a === b; };var t = window.ShadyDOM || {};t.R = !(!Element.prototype.attachShadow || !Node.prototype.getRootNode);var u = Object.getOwnPropertyDescriptor(Node.prototype, "firstChild");t.h = !!(u && u.configurable && u.get);t.H = t.force || !t.R;function v(a) { return a.__shady && void 0 !== a.__shady.firstChild; }function w(a) { return "ShadyRoot" === a.K; }function x(a) { a = a.getRootNode();if (w(a)) return a; }var y = Element.prototype, ka = y.matches || y.matchesSelector || y.mozMatchesSelector || y.msMatchesSelector || y.oMatchesSelector || y.webkitMatchesSelector; function A(a, b) { if (a && b) for (var c = Object.getOwnPropertyNames(b), d = 0, e; d < c.length && (e = c[d]); d++) { var f = Object.getOwnPropertyDescriptor(b, e);f && Object.defineProperty(a, e, f); } }function B(a, b) { for (var c = [], d = 1; d < arguments.length; ++d) c[d - 1] = arguments[d];for (d = 0; d < c.length; d++) A(a, c[d]);return a; }function la(a, b) { for (var c in b) a[c] = b[c]; }var C = document.createTextNode(""), ma = 0, D = [];new MutationObserver(function () { for (; D.length;) try { D.shift()(); } catch (a) { throw C.textContent = ma++, a; } }).observe(C, { characterData: !0 }); function na(a) { D.push(a);C.textContent = ma++; }var oa = !!document.contains;function pa(a, b) { for (; b;) { if (b == a) return !0;b = b.parentNode; }return !1; };var qa = /[&\u00A0"]/g, ra = /[&\u00A0<>]/g;function ta(a) { switch (a) {case "&": return "&amp;";case "<": return "&lt;";case ">": return "&gt;";case '"': return "&quot;";case "\u00a0": return "&nbsp;";} }function ua(a) { for (var b = {}, c = 0; c < a.length; c++) b[a[c]] = !0;return b; }var va = ua("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")), wa = ua("style script xmp iframe noembed noframes plaintext noscript".split(" ")); function E(a, b) { "template" === a.localName && (a = a.content);for (var c = "", d = b ? b(a) : a.childNodes, e = 0, f = d.length, h; e < f && (h = d[e]); e++) { a: { var g = h;var l = a;var k = b;switch (g.nodeType) {case Node.ELEMENT_NODE: for (var m = g.localName, q = "<" + m, z = g.attributes, sa = 0; l = z[sa]; sa++) q += " " + l.name + '="' + l.value.replace(qa, ta) + '"';q += ">";g = va[m] ? q : q + E(g, k) + "</" + m + ">";break a;case Node.TEXT_NODE: g = g.data;g = l && wa[l.localName] ? g : g.replace(ra, ta);break a;case Node.COMMENT_NODE: g = "\x3c!--" + g.data + "--\x3e";break a;default: throw window.console.error(g), Error("not implemented");} }c += g; }return c; };var F = {}, G = document.createTreeWalker(document, NodeFilter.SHOW_ALL, null, !1), H = document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, null, !1);function xa(a) { var b = [];G.currentNode = a;for (a = G.firstChild(); a;) b.push(a), a = G.nextSibling();return b; }F.parentNode = function (a) { G.currentNode = a;return G.parentNode(); };F.firstChild = function (a) { G.currentNode = a;return G.firstChild(); };F.lastChild = function (a) { G.currentNode = a;return G.lastChild(); };F.previousSibling = function (a) { G.currentNode = a;return G.previousSibling(); }; F.nextSibling = function (a) { G.currentNode = a;return G.nextSibling(); };F.childNodes = xa;F.parentElement = function (a) { H.currentNode = a;return H.parentNode(); };F.firstElementChild = function (a) { H.currentNode = a;return H.firstChild(); };F.lastElementChild = function (a) { H.currentNode = a;return H.lastChild(); };F.previousElementSibling = function (a) { H.currentNode = a;return H.previousSibling(); };F.nextElementSibling = function (a) { H.currentNode = a;return H.nextSibling(); }; F.children = function (a) { var b = [];H.currentNode = a;for (a = H.firstChild(); a;) b.push(a), a = H.nextSibling();return b; };F.innerHTML = function (a) { return E(a, function (a) { return xa(a); }); };F.textContent = function (a) { switch (a.nodeType) {case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE: a = document.createTreeWalker(a, NodeFilter.SHOW_TEXT, null, !1);for (var b = "", c; c = a.nextNode();) b += c.nodeValue;return b;default: return a.nodeValue;} };var I = {}, ya = Element.prototype.insertBefore, za = Element.prototype.removeChild, Aa = Element.prototype.setAttribute, Ba = Element.prototype.removeAttribute, Ca = Element.prototype.cloneNode, Da = Document.prototype.importNode, Ea = Element.prototype.addEventListener, Fa = Element.prototype.removeEventListener, Ga = Window.prototype.addEventListener, Ha = Window.prototype.removeEventListener, Ia = Element.prototype.dispatchEvent, Ja = Element.prototype.querySelector, Ka = Element.prototype.querySelectorAll, La = Node.prototype.contains || HTMLElement.prototype.contains;I.appendChild = Element.prototype.appendChild;I.insertBefore = ya;I.removeChild = za;I.setAttribute = Aa;I.removeAttribute = Ba;I.cloneNode = Ca;I.importNode = Da;I.addEventListener = Ea;I.removeEventListener = Fa;I.T = Ga;I.U = Ha;I.dispatchEvent = Ia;I.querySelector = Ja;I.querySelectorAll = Ka;I.contains = La;var J = Object.getOwnPropertyDescriptor(Element.prototype, "innerHTML") || Object.getOwnPropertyDescriptor(HTMLElement.prototype, "innerHTML"), K = document.implementation.createHTMLDocument("inert").createElement("div"), L = Object.getOwnPropertyDescriptor(Document.prototype, "activeElement"), Ma = { parentElement: { get: function () { var a = this.__shady && this.__shady.parentNode;a && a.nodeType !== Node.ELEMENT_NODE && (a = null);return void 0 !== a ? a : F.parentElement(this); }, configurable: !0 }, parentNode: { get: function () { var a = this.__shady && this.__shady.parentNode;return void 0 !== a ? a : F.parentNode(this); }, configurable: !0 }, nextSibling: { get: function () { var a = this.__shady && this.__shady.nextSibling;return void 0 !== a ? a : F.nextSibling(this); }, configurable: !0 }, previousSibling: { get: function () { var a = this.__shady && this.__shady.previousSibling;return void 0 !== a ? a : F.previousSibling(this); }, configurable: !0 }, className: { get: function () { return this.getAttribute("class") || ""; }, set: function (a) { this.setAttribute("class", a); }, configurable: !0 }, nextElementSibling: { get: function () { if (this.__shady && void 0 !== this.__shady.nextSibling) { for (var a = this.nextSibling; a && a.nodeType !== Node.ELEMENT_NODE;) a = a.nextSibling;return a; }return F.nextElementSibling(this); }, configurable: !0 }, previousElementSibling: { get: function () { if (this.__shady && void 0 !== this.__shady.previousSibling) { for (var a = this.previousSibling; a && a.nodeType !== Node.ELEMENT_NODE;) a = a.previousSibling;return a; }return F.previousElementSibling(this); }, configurable: !0 } }, M = { childNodes: { get: function () { if (v(this)) { if (!this.__shady.childNodes) { this.__shady.childNodes = [];for (var a = this.firstChild; a; a = a.nextSibling) this.__shady.childNodes.push(a); }var b = this.__shady.childNodes; } else b = F.childNodes(this);b.item = function (a) { return b[a]; };return b; }, configurable: !0 }, childElementCount: { get: function () { return this.children.length; }, configurable: !0 }, firstChild: { get: function () { var a = this.__shady && this.__shady.firstChild;return void 0 !== a ? a : F.firstChild(this); }, configurable: !0 }, lastChild: { get: function () { var a = this.__shady && this.__shady.lastChild;return void 0 !== a ? a : F.lastChild(this); }, configurable: !0 }, textContent: { get: function () { if (v(this)) { for (var a = [], b = 0, c = this.childNodes, d; d = c[b]; b++) d.nodeType !== Node.COMMENT_NODE && a.push(d.textContent);return a.join(""); }return F.textContent(this); }, set: function (a) { switch (this.nodeType) {case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE: for (; this.firstChild;) this.removeChild(this.firstChild);(0 < a.length || this.nodeType === Node.ELEMENT_NODE) && this.appendChild(document.createTextNode(a));break;default: this.nodeValue = a;} }, configurable: !0 }, firstElementChild: { get: function () { if (this.__shady && void 0 !== this.__shady.firstChild) { for (var a = this.firstChild; a && a.nodeType !== Node.ELEMENT_NODE;) a = a.nextSibling;return a; }return F.firstElementChild(this); }, configurable: !0 }, lastElementChild: { get: function () { if (this.__shady && void 0 !== this.__shady.lastChild) { for (var a = this.lastChild; a && a.nodeType !== Node.ELEMENT_NODE;) a = a.previousSibling;return a; }return F.lastElementChild(this); }, configurable: !0 }, children: { get: function () { var a;v(this) ? a = Array.prototype.filter.call(this.childNodes, function (a) { return a.nodeType === Node.ELEMENT_NODE; }) : a = F.children(this);a.item = function (b) { return a[b]; };return a; }, configurable: !0 }, innerHTML: { get: function () { var a = "template" === this.localName ? this.content : this;return v(this) ? E(a) : F.innerHTML(a); }, set: function (a) { for (var b = "template" === this.localName ? this.content : this; b.firstChild;) b.removeChild(b.firstChild);for (J && J.set ? J.set.call(K, a) : K.innerHTML = a; K.firstChild;) b.appendChild(K.firstChild); }, configurable: !0 } }, Na = { shadowRoot: { get: function () { return this.__shady && this.__shady.S || null; }, configurable: !0 } }, N = { activeElement: { get: function () { var a = L && L.get ? L.get.call(document) : t.h ? void 0 : document.activeElement;if (a && a.nodeType) { var b = !!w(this);if (this === document || b && this.host !== a && I.contains.call(this.host, a)) { for (b = x(a); b && b !== this;) a = b.host, b = x(a);a = this === document ? b ? null : a : b === this ? a : null; } else a = null; } else a = null;return a; }, set: function () {}, configurable: !0 } }; function O(a, b, c) { for (var d in b) { var e = Object.getOwnPropertyDescriptor(a, d);e && e.configurable || !e && c ? Object.defineProperty(a, d, b[d]) : c && console.warn("Could not define", d, "on", a); } }function P(a) { O(a, Ma);O(a, M);O(a, N); }var Oa = t.h ? function () {} : function (a) { a.__shady && a.__shady.L || (a.__shady = a.__shady || {}, a.__shady.L = !0, O(a, Ma, !0)); }, Pa = t.h ? function () {} : function (a) { a.__shady && a.__shady.J || (a.__shady = a.__shady || {}, a.__shady.J = !0, O(a, M, !0), O(a, Na, !0)); };function Qa(a, b, c) { Oa(a);c = c || null;a.__shady = a.__shady || {};b.__shady = b.__shady || {};c && (c.__shady = c.__shady || {});a.__shady.previousSibling = c ? c.__shady.previousSibling : b.lastChild;var d = a.__shady.previousSibling;d && d.__shady && (d.__shady.nextSibling = a);(d = a.__shady.nextSibling = c) && d.__shady && (d.__shady.previousSibling = a);a.__shady.parentNode = b;c ? c === b.__shady.firstChild && (b.__shady.firstChild = a) : (b.__shady.lastChild = a, b.__shady.firstChild || (b.__shady.firstChild = a));b.__shady.childNodes = null; } function Q(a) { if (!a.__shady || void 0 === a.__shady.firstChild) { a.__shady = a.__shady || {};a.__shady.firstChild = F.firstChild(a);a.__shady.lastChild = F.lastChild(a);Pa(a);for (var b = a.__shady.childNodes = F.childNodes(a), c = 0, d; c < b.length && (d = b[c]); c++) d.__shady = d.__shady || {}, d.__shady.parentNode = a, d.__shady.nextSibling = b[c + 1] || null, d.__shady.previousSibling = b[c - 1] || null, Oa(d); } };function R(a, b, c) { if (b === a) throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if (c) { var d = c.__shady && c.__shady.parentNode;if (void 0 !== d && d !== a || void 0 === d && F.parentNode(c) !== a) throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node."); }if (c === b) return b;b.parentNode && Ra(b.parentNode, b);d = x(a);var e;if (e = d) a: { if (!b.__noInsertionPoint) { var f;"slot" === b.localName ? f = [b] : b.querySelectorAll && (f = b.querySelectorAll("slot"));if (f && f.length) { e = f;break a; } }e = void 0; }(f = e) && d.f.push.apply(d.f, [].concat(f instanceof Array ? f : ha(fa(f))));d && ("slot" === a.localName || f) && S(d);if (v(a)) { d = c;Pa(a);a.__shady = a.__shady || {};void 0 !== a.__shady.firstChild && (a.__shady.childNodes = null);if (b.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { f = b.childNodes;for (e = 0; e < f.length; e++) Qa(f[e], a, d);b.__shady = b.__shady || {};d = void 0 !== b.__shady.firstChild ? null : void 0;b.__shady.firstChild = b.__shady.lastChild = d; b.__shady.childNodes = d; } else Qa(b, a, d);if (Sa(a)) { S(a.__shady.root);var h = !0; } else a.__shady.root && (h = !0); }h || (h = w(a) ? a.host : a, c ? (c = Ta(c), I.insertBefore.call(h, b, c)) : I.appendChild.call(h, b));Ua(a, b);return b; } function Ra(a, b) { if (b.parentNode !== a) throw Error("The node to be removed is not a child of this node: " + b);var c = x(b);if (v(a)) { b.__shady = b.__shady || {};a.__shady = a.__shady || {};b === a.__shady.firstChild && (a.__shady.firstChild = b.__shady.nextSibling);b === a.__shady.lastChild && (a.__shady.lastChild = b.__shady.previousSibling);var d = b.__shady.previousSibling, e = b.__shady.nextSibling;d && (d.__shady = d.__shady || {}, d.__shady.nextSibling = e);e && (e.__shady = e.__shady || {}, e.__shady.previousSibling = d);b.__shady.parentNode = b.__shady.previousSibling = b.__shady.nextSibling = void 0;void 0 !== a.__shady.childNodes && (a.__shady.childNodes = null);if (Sa(a)) { S(a.__shady.root);var f = !0; } }Va(b);if (c) { (d = a && "slot" === a.localName) && (f = !0);Wa(c);e = c.a;for (var h in e) for (var g = e[h], l = 0; l < g.length; l++) { var k = g[l];if (pa(b, k)) { g.splice(l, 1);var m = c.b.indexOf(k);0 <= m && c.b.splice(m, 1);l--;if (m = k.__shady.g) for (k = 0; k < m.length; k++) { var q = m[k], z = F.parentNode(q);z && I.removeChild.call(z, q); }m = !0; } }(m || d) && S(c); }f || (f = w(a) ? a.host : a, (!a.__shady.root && "slot" !== b.localName || f === F.parentNode(b)) && I.removeChild.call(f, b));Ua(a, null, b);return b; }function Va(a) { if (a.__shady && void 0 !== a.__shady.B) for (var b = a.childNodes, c = 0, d = b.length, e; c < d && (e = b[c]); c++) Va(e);a.__shady && (a.__shady.B = void 0); }function Ta(a) { var b = a;a && "slot" === a.localName && (b = (b = a.__shady && a.__shady.g) && b.length ? b[0] : Ta(a.nextSibling));return b; }function Sa(a) { return (a = a && a.__shady && a.__shady.root) && Xa(a); } function Ya(a, b) { if ("slot" === b) a = a.parentNode, Sa(a) && S(a.__shady.root);else if ("slot" === a.localName && "name" === b && (b = x(a))) { var c = a.M, d = Za(a);if (d !== c) { c = b.a[c];var e = c.indexOf(a);0 <= e && c.splice(e, 1);c = b.a[d] || (b.a[d] = []);c.push(a);1 < c.length && (b.a[d] = $a(c)); }S(b); } }function Ua(a, b, c) { if (a = a.__shady && a.__shady.i) b && a.addedNodes.push(b), c && a.removedNodes.push(c), ab(a); } function bb(a) { if (a && a.nodeType) { a.__shady = a.__shady || {};var b = a.__shady.B;void 0 === b && (w(a) ? b = a : b = (b = a.parentNode) ? bb(b) : a, I.contains.call(document.documentElement, a) && (a.__shady.B = b));return b; } }function T(a, b, c) { var d = [];cb(a.childNodes, b, c, d);return d; }function cb(a, b, c, d) { for (var e = 0, f = a.length, h; e < f && (h = a[e]); e++) { var g;if (g = h.nodeType === Node.ELEMENT_NODE) { g = h;var l = b, k = c, m = d, q = l(g);q && m.push(g);k && k(q) ? g = q : (cb(g.childNodes, l, k, m), g = void 0); }if (g) break; } }var U = null; function db(a, b, c) { U || (U = window.ShadyCSS && window.ShadyCSS.ScopingShim);U && "class" === b ? U.setElementClass(a, c) : (I.setAttribute.call(a, b, c), Ya(a, b)); }function eb(a, b) { if (a.ownerDocument !== document) return I.importNode.call(document, a, b);var c = I.importNode.call(document, a, !1);if (b) { a = a.childNodes;b = 0;for (var d; b < a.length; b++) d = eb(a[b], !0), c.appendChild(d); }return c; };var V = [], fb;function gb(a) { fb || (fb = !0, na(W));V.push(a); }function W() { fb = !1;for (var a = !!V.length; V.length;) V.shift()();return a; }W.list = V;var hb = {};function X(a, b, c) { if (a !== hb) throw new TypeError("Illegal constructor");a = document.createDocumentFragment();a.__proto__ = X.prototype;a.K = "ShadyRoot";Q(b);Q(a);a.host = b;a.c = c && c.mode;b.__shady = b.__shady || {};b.__shady.root = a;b.__shady.S = "closed" !== a.c ? a : null;a.l = !1;a.b = [];a.a = {};a.f = [];c = F.childNodes(b);for (var d = 0, e = c.length; d < e; d++) I.removeChild.call(b, c[d]);return a; }X.prototype = Object.create(DocumentFragment.prototype);function S(a) { a.l || (a.l = !0, gb(function () { return ib(a); })); } function ib(a) { for (var b; a;) { a.l && (b = a);a: { var c = a;a = c.host.getRootNode();if (w(a)) for (var d = c.host.childNodes, e = 0; e < d.length; e++) if (c = d[e], "slot" == c.localName) break a;a = void 0; } }b && b._renderRoot(); } X.prototype._renderRoot = function () { this.l = !1;Wa(this);for (var a = 0, b; a < this.b.length; a++) { b = this.b[a];var c = b.__shady.assignedNodes;b.__shady.assignedNodes = [];b.__shady.g = [];if (b.__shady.G = c) for (var d = 0; d < c.length; d++) { var e = c[d];e.__shady.w = e.__shady.assignedSlot;e.__shady.assignedSlot === b && (e.__shady.assignedSlot = null); } }for (b = this.host.firstChild; b; b = b.nextSibling) jb(this, b);for (a = 0; a < this.b.length; a++) { b = this.b[a];if (!b.__shady.assignedNodes.length) for (c = b.firstChild; c; c = c.nextSibling) jb(this, c, b);c = b.parentNode;(c = c.__shady && c.__shady.root) && Xa(c) && c._renderRoot();kb(this, b.__shady.g, b.__shady.assignedNodes);if (c = b.__shady.G) { for (d = 0; d < c.length; d++) c[d].__shady.w = null;b.__shady.G = null;c.length > b.__shady.assignedNodes.length && (b.__shady.A = !0); }b.__shady.A && (b.__shady.A = !1, lb(this, b)); }a = this.b;b = [];for (c = 0; c < a.length; c++) d = a[c].parentNode, d.__shady && d.__shady.root || !(0 > b.indexOf(d)) || b.push(d);for (a = 0; a < b.length; a++) { c = b[a];d = c === this ? this.host : c;e = [];c = c.childNodes;for (var f = 0; f < c.length; f++) { var h = c[f];if ("slot" == h.localName) { h = h.__shady.g;for (var g = 0; g < h.length; g++) e.push(h[g]); } else e.push(h); }c = void 0;f = F.childNodes(d);h = ia(e, e.length, f, f.length);for (var l = g = 0; g < h.length && (c = h[g]); g++) { for (var k = 0, m; k < c.j.length && (m = c.j[k]); k++) F.parentNode(m) === d && I.removeChild.call(d, m), f.splice(c.index + l, 1);l -= c.m; }for (l = 0; l < h.length && (c = h[l]); l++) for (g = f[c.index], k = c.index; k < c.index + c.m; k++) m = e[k], I.insertBefore.call(d, m, g), f.splice(k, 0, m); } }; function jb(a, b, c) { b.__shady = b.__shady || {};var d = b.__shady.w;b.__shady.w = null;c || (c = (a = a.a[b.slot || "__catchall"]) && a[0]);c ? (c.__shady.assignedNodes.push(b), b.__shady.assignedSlot = c) : b.__shady.assignedSlot = void 0;d !== b.__shady.assignedSlot && b.__shady.assignedSlot && (b.__shady.assignedSlot.__shady.A = !0); }function kb(a, b, c) { for (var d = 0, e; d < c.length && (e = c[d]); d++) if ("slot" == e.localName) { var f = e.__shady.assignedNodes;f && f.length && kb(a, b, f); } else b.push(c[d]); } function lb(a, b) { I.dispatchEvent.call(b, new Event("slotchange"));b.__shady.assignedSlot && lb(a, b.__shady.assignedSlot); }function Wa(a) { if (a.f.length) { for (var b = a.f, c, d = 0; d < b.length; d++) { var e = b[d];e.__shady = e.__shady || {};Q(e);Q(e.parentNode);var f = Za(e);a.a[f] ? (c = c || {}, c[f] = !0, a.a[f].push(e)) : a.a[f] = [e];a.b.push(e); }if (c) for (var h in c) a.a[h] = $a(a.a[h]);a.f = []; } }function Za(a) { var b = a.name || a.getAttribute("name") || "__catchall";return a.M = b; } function $a(a) { return a.sort(function (a, c) { a = mb(a);for (var b = mb(c), e = 0; e < a.length; e++) { c = a[e];var f = b[e];if (c !== f) return a = Array.from(c.parentNode.childNodes), a.indexOf(c) - a.indexOf(f); } }); }function mb(a) { var b = [];do b.unshift(a); while (a = a.parentNode);return b; }function Xa(a) { Wa(a);return !!a.b.length; }X.prototype.addEventListener = function (a, b, c) { "object" !== typeof c && (c = { capture: !!c });c.v = this;this.host.addEventListener(a, b, c); }; X.prototype.removeEventListener = function (a, b, c) { "object" !== typeof c && (c = { capture: !!c });c.v = this;this.host.removeEventListener(a, b, c); };X.prototype.getElementById = function (a) { return T(this, function (b) { return b.id == a; }, function (a) { return !!a; })[0] || null; };var nb = X.prototype;O(nb, M, !0);O(nb, N, !0);function ob() { this.c = !1;this.addedNodes = [];this.removedNodes = [];this.o = new Set(); }function ab(a) { a.c || (a.c = !0, na(function () { pb(a); })); }function pb(a) { if (a.c) { a.c = !1;var b = a.takeRecords();b.length && a.o.forEach(function (a) { a(b); }); } }ob.prototype.takeRecords = function () { if (this.addedNodes.length || this.removedNodes.length) { var a = [{ addedNodes: this.addedNodes, removedNodes: this.removedNodes }];this.addedNodes = [];this.removedNodes = [];return a; }return []; }; function qb(a, b) { a.__shady = a.__shady || {};a.__shady.i || (a.__shady.i = new ob());a.__shady.i.o.add(b);var c = a.__shady.i;return { N: b, P: c, O: a, takeRecords: function () { return c.takeRecords(); } }; }function rb(a) { var b = a && a.P;b && (b.o.delete(a.N), b.o.size || (a.O.__shady.i = null)); } function sb(a, b) { var c = b.getRootNode();return a.map(function (a) { var b = c === a.target.getRootNode();if (b && a.addedNodes) { if (b = Array.from(a.addedNodes).filter(function (a) { return c === a.getRootNode(); }), b.length) return a = Object.create(a), Object.defineProperty(a, "addedNodes", { value: b, configurable: !0 }), a; } else if (b) return a; }).filter(function (a) { return a; }); };var Y = "__eventWrappers" + Date.now(), tb = { blur: !0, focus: !0, focusin: !0, focusout: !0, click: !0, dblclick: !0, mousedown: !0, mouseenter: !0, mouseleave: !0, mousemove: !0, mouseout: !0, mouseover: !0, mouseup: !0, wheel: !0, beforeinput: !0, input: !0, keydown: !0, keyup: !0, compositionstart: !0, compositionupdate: !0, compositionend: !0, touchstart: !0, touchend: !0, touchmove: !0, touchcancel: !0, pointerover: !0, pointerenter: !0, pointerdown: !0, pointermove: !0, pointerup: !0, pointercancel: !0, pointerout: !0, pointerleave: !0, gotpointercapture: !0, lostpointercapture: !0, dragstart: !0, drag: !0, dragenter: !0, dragleave: !0, dragover: !0, drop: !0, dragend: !0, DOMActivate: !0, DOMFocusIn: !0, DOMFocusOut: !0, keypress: !0 };function ub(a, b) { var c = [], d = a;for (a = a === window ? window : a.getRootNode(); d;) c.push(d), d = d.assignedSlot ? d.assignedSlot : d.nodeType === Node.DOCUMENT_FRAGMENT_NODE && d.host && (b || d !== a) ? d.host : d.parentNode;c[c.length - 1] === document && c.push(window);return c; } function vb(a, b) { if (!w) return a;a = ub(a, !0);for (var c = 0, d, e, f, h; c < b.length; c++) if (d = b[c], f = d === window ? window : d.getRootNode(), f !== e && (h = a.indexOf(f), e = f), !w(f) || -1 < h) return d; } var wb = { get composed() { !1 !== this.isTrusted && void 0 === this.s && (this.s = tb[this.type]);return this.s || !1; }, composedPath: function () { this.C || (this.C = ub(this.__target, this.composed));return this.C; }, get target() { return vb(this.currentTarget, this.composedPath()); }, get relatedTarget() { if (!this.D) return null;this.F || (this.F = ub(this.D, !0));return vb(this.currentTarget, this.F); }, stopPropagation: function () { Event.prototype.stopPropagation.call(this);this.u = !0; }, stopImmediatePropagation: function () { Event.prototype.stopImmediatePropagation.call(this); this.u = this.I = !0; } };function xb(a) { function b(b, d) { b = new a(b, d);b.s = d && !!d.composed;return b; }la(b, a);b.prototype = a.prototype;return b; }var yb = { focus: !0, blur: !0 };function zb(a, b, c) { if (c = b.__handlers && b.__handlers[a.type] && b.__handlers[a.type][c]) for (var d = 0, e; (e = c[d]) && a.target !== a.relatedTarget && (e.call(b, a), !a.I); d++); } function Ab(a) { var b = a.composedPath();Object.defineProperty(a, "currentTarget", { get: function () { return d; }, configurable: !0 });for (var c = b.length - 1; 0 <= c; c--) { var d = b[c];zb(a, d, "capture");if (a.u) return; }Object.defineProperty(a, "eventPhase", { get: function () { return Event.AT_TARGET; } });var e;for (c = 0; c < b.length; c++) { d = b[c];var f = d.__shady && d.__shady.root;if (0 === c || f && f === e) if (zb(a, d, "bubble"), d !== window && (e = d.getRootNode()), a.u) break; } } function Bb(a, b, c, d, e, f) { for (var h = 0; h < a.length; h++) { var g = a[h], l = g.type, k = g.capture, m = g.once, q = g.passive;if (b === g.node && c === l && d === k && e === m && f === q) return h; }return -1; } function Cb(a, b, c) { if (b) { if (c && "object" === typeof c) { var d = !!c.capture;var e = !!c.once;var f = !!c.passive; } else d = !!c, f = e = !1;var h = c && c.v || this, g = b[Y];if (g) { if (-1 < Bb(g, h, a, d, e, f)) return; } else b[Y] = [];g = function (d) { e && this.removeEventListener(a, b, c);d.__target || Db(d);if (h !== this) { var f = Object.getOwnPropertyDescriptor(d, "currentTarget");Object.defineProperty(d, "currentTarget", { get: function () { return h; }, configurable: !0 }); }if (d.composed || -1 < d.composedPath().indexOf(h)) if (d.target === d.relatedTarget) d.eventPhase === Event.BUBBLING_PHASE && d.stopImmediatePropagation();else if (d.eventPhase === Event.CAPTURING_PHASE || d.bubbles || d.target === h) { var g = "object" === typeof b && b.handleEvent ? b.handleEvent(d) : b.call(h, d);h !== this && (f ? (Object.defineProperty(d, "currentTarget", f), f = null) : delete d.currentTarget);return g; } };b[Y].push({ node: this, type: a, capture: d, once: e, passive: f, V: g });yb[a] ? (this.__handlers = this.__handlers || {}, this.__handlers[a] = this.__handlers[a] || { capture: [], bubble: [] }, this.__handlers[a][d ? "capture" : "bubble"].push(g)) : (this instanceof Window ? I.T : I.addEventListener).call(this, a, g, c); } } function Eb(a, b, c) { if (b) { if (c && "object" === typeof c) { var d = !!c.capture;var e = !!c.once;var f = !!c.passive; } else d = !!c, f = e = !1;var h = c && c.v || this, g = void 0;var l = null;try { l = b[Y]; } catch (k) {}l && (e = Bb(l, h, a, d, e, f), -1 < e && (g = l.splice(e, 1)[0].V, l.length || (b[Y] = void 0)));(this instanceof Window ? I.U : I.removeEventListener).call(this, a, g || b, c);g && yb[a] && this.__handlers && this.__handlers[a] && (a = this.__handlers[a][d ? "capture" : "bubble"], g = a.indexOf(g), -1 < g && a.splice(g, 1)); } } function Fb() { for (var a in yb) window.addEventListener(a, function (a) { a.__target || (Db(a), Ab(a)); }, !0); }function Db(a) { a.__target = a.target;a.D = a.relatedTarget;if (t.h) { var b = Object.getPrototypeOf(a);if (!b.hasOwnProperty("__patchProto")) { var c = Object.create(b);c.W = b;A(c, wb);b.__patchProto = c; }a.__proto__ = b.__patchProto; } else A(a, wb); }var Gb = xb(window.Event), Hb = xb(window.CustomEvent), Ib = xb(window.MouseEvent);function Jb(a) { var b = a.getRootNode();w(b) && ib(b);return a.__shady && a.__shady.assignedSlot || null; } var Kb = { addEventListener: Cb.bind(window), removeEventListener: Eb.bind(window) }, Lb = { addEventListener: Cb, removeEventListener: Eb, appendChild: function (a) { return R(this, a); }, insertBefore: function (a, b) { return R(this, a, b); }, removeChild: function (a) { return Ra(this, a); }, replaceChild: function (a, b) { R(this, a, b);Ra(this, b);return a; }, cloneNode: function (a) { if ("template" == this.localName) var b = I.cloneNode.call(this, a);else if (b = I.cloneNode.call(this, !1), a) { a = this.childNodes;for (var c = 0, d; c < a.length; c++) d = a[c].cloneNode(!0), b.appendChild(d); }return b; }, getRootNode: function () { return bb(this); }, contains: function (a) { return pa(this, a); }, get isConnected() { var a = this.ownerDocument;if (oa && I.contains.call(a, this) || a.documentElement && I.contains.call(a.documentElement, this)) return !0;for (a = this; a && !(a instanceof Document);) a = a.parentNode || (a instanceof X ? a.host : void 0);return !!(a && a instanceof Document); }, dispatchEvent: function (a) { W();return I.dispatchEvent.call(this, a); } }, Mb = { get assignedSlot() { return Jb(this); } }, Nb = { querySelector: function (a) { return T(this, function (b) { return ka.call(b, a); }, function (a) { return !!a; })[0] || null; }, querySelectorAll: function (a) { return T(this, function (b) { return ka.call(b, a); }); } }, Ob = { assignedNodes: function (a) { if ("slot" === this.localName) { var b = this.getRootNode();w(b) && ib(b);return this.__shady ? (a && a.flatten ? this.__shady.g : this.__shady.assignedNodes) || [] : []; } } }, Pb = B({ setAttribute: function (a, b) { db(this, a, b); }, removeAttribute: function (a) { I.removeAttribute.call(this, a);Ya(this, a); }, attachShadow: function (a) { if (!this) throw "Must provide a host."; if (!a) throw "Not enough arguments.";return new X(hb, this, a); }, get slot() { return this.getAttribute("slot"); }, set slot(a) { db(this, "slot", a); }, get assignedSlot() { return Jb(this); } }, Nb, Ob);Object.defineProperties(Pb, Na);var Qb = B({ importNode: function (a, b) { return eb(a, b); }, getElementById: function (a) { return T(this, function (b) { return b.id == a; }, function (a) { return !!a; })[0] || null; } }, Nb);Object.defineProperties(Qb, { _activeElement: N.activeElement }); var Rb = HTMLElement.prototype.blur, Sb = B({ blur: function () { var a = this.__shady && this.__shady.root;(a = a && a.activeElement) ? a.blur() : Rb.call(this); } });function Z(a, b) { for (var c = Object.getOwnPropertyNames(b), d = 0; d < c.length; d++) { var e = c[d], f = Object.getOwnPropertyDescriptor(b, e);f.value ? a[e] = f.value : Object.defineProperty(a, e, f); } };if (t.H) { window.ShadyDOM = { inUse: t.H, patch: function (a) { return a; }, isShadyRoot: w, enqueue: gb, flush: W, settings: t, filterMutations: sb, observeChildren: qb, unobserveChildren: rb, nativeMethods: I, nativeTree: F };window.Event = Gb;window.CustomEvent = Hb;window.MouseEvent = Ib;Fb();var Tb = window.customElements && window.customElements.nativeHTMLElement || HTMLElement;Z(window.Node.prototype, Lb);Z(window.Window.prototype, Kb);Z(window.Text.prototype, Mb);Z(window.DocumentFragment.prototype, Nb);Z(window.Element.prototype, Pb);Z(window.Document.prototype, Qb);window.HTMLSlotElement && Z(window.HTMLSlotElement.prototype, Ob);Z(Tb.prototype, Sb);t.h && (P(window.Node.prototype), P(window.Text.prototype), P(window.DocumentFragment.prototype), P(window.Element.prototype), P(Tb.prototype), P(window.Document.prototype), window.HTMLSlotElement && P(window.HTMLSlotElement.prototype));window.ShadowRoot = X; }; }).call(this); //# sourceMappingURL=shadydom.min.js.map /* WEBPACK VAR INJECTION */ }).call(exports, __webpack_require__(0)); /***/ }, /* 4 */ /***/function (module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function (global) { (function () { /* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict'; var l, aa = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this, m = {};function n() { this.end = this.start = 0;this.rules = this.parent = this.previous = null;this.cssText = this.parsedCssText = "";this.atRule = !1;this.type = 0;this.parsedSelector = this.selector = this.keyframesName = ""; } function p(a) { a = a.replace(ba, "").replace(ca, "");var b = da, c = a, e = new n();e.start = 0;e.end = c.length;for (var d = e, f = 0, h = c.length; f < h; f++) if ("{" === c[f]) { d.rules || (d.rules = []);var g = d, k = g.rules[g.rules.length - 1] || null;d = new n();d.start = f + 1;d.parent = g;d.previous = k;g.rules.push(d); } else "}" === c[f] && (d.end = f + 1, d = d.parent || e);return b(e, a); } function da(a, b) { var c = b.substring(a.start, a.end - 1);a.parsedCssText = a.cssText = c.trim();a.parent && (c = b.substring(a.previous ? a.previous.end : a.parent.start, a.start - 1), c = ea(c), c = c.replace(fa, " "), c = c.substring(c.lastIndexOf(";") + 1), c = a.parsedSelector = a.selector = c.trim(), a.atRule = 0 === c.indexOf("@"), a.atRule ? 0 === c.indexOf("@media") ? a.type = ha : c.match(ia) && (a.type = r, a.keyframesName = a.selector.split(fa).pop()) : a.type = 0 === c.indexOf("--") ? ja : ka);if (c = a.rules) for (var e = 0, d = c.length, f; e < d && (f = c[e]); e++) da(f, b); return a; }function ea(a) { return a.replace(/\\([0-9a-f]{1,6})\s/gi, function (a, c) { a = c;for (c = 6 - a.length; c--;) a = "0" + a;return "\\" + a; }); } function la(a, b, c) { c = void 0 === c ? "" : c;var e = "";if (a.cssText || a.rules) { var d = a.rules, f;if (f = d) f = d[0], f = !(f && f.selector && 0 === f.selector.indexOf("--"));if (f) { f = 0;for (var h = d.length, g; f < h && (g = d[f]); f++) e = la(g, b, e); } else b ? b = a.cssText : (b = a.cssText, b = b.replace(ma, "").replace(na, ""), b = b.replace(oa, "").replace(pa, "")), (e = b.trim()) && (e = " " + e + "\n"); }e && (a.selector && (c += a.selector + " {\n"), c += e, a.selector && (c += "}\n\n"));return c; } var ka = 1, r = 7, ha = 4, ja = 1E3, ba = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, ca = /@import[^;]*;/gim, ma = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, na = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, oa = /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, pa = /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, ia = /^@[^\s]*keyframes/, fa = /\s+/g;var qa = Promise.resolve();function ra(a) { if (a = m[a]) a._applyShimCurrentVersion = a._applyShimCurrentVersion || 0, a._applyShimValidatingVersion = a._applyShimValidatingVersion || 0, a._applyShimNextVersion = (a._applyShimNextVersion || 0) + 1; }function sa(a) { return a._applyShimCurrentVersion === a._applyShimNextVersion; }function ta(a) { a._applyShimValidatingVersion = a._applyShimNextVersion;a.b || (a.b = !0, qa.then(function () { a._applyShimCurrentVersion = a._applyShimNextVersion;a.b = !1; })); };var t = !(window.ShadyDOM && window.ShadyDOM.inUse), u;function ua(a) { u = a && a.shimcssproperties ? !1 : t || !(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) || !window.CSS || !CSS.supports || !CSS.supports("box-shadow", "0 0 0 var(--foo)")); }window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? u = window.ShadyCSS.nativeCss : window.ShadyCSS ? (ua(window.ShadyCSS), window.ShadyCSS = void 0) : ua(window.WebComponents && window.WebComponents.flags);var v = u;var w = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi, y = /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi, va = /(--[\w-]+)\s*([:,;)]|$)/gi, wa = /(animation\s*:)|(animation-name\s*:)/, xa = /@media\s(.*)/, ya = /\{[^}]*\}/g;var za = new Set();function z(a, b) { if (!a) return "";"string" === typeof a && (a = p(a));b && A(a, b);return la(a, v); }function B(a) { !a.__cssRules && a.textContent && (a.__cssRules = p(a.textContent));return a.__cssRules || null; }function Aa(a) { return !!a.parent && a.parent.type === r; }function A(a, b, c, e) { if (a) { var d = !1, f = a.type;if (e && f === ha) { var h = a.selector.match(xa);h && (window.matchMedia(h[1]).matches || (d = !0)); }f === ka ? b(a) : c && f === r ? c(a) : f === ja && (d = !0);if ((a = a.rules) && !d) { d = 0;f = a.length;for (var g; d < f && (g = a[d]); d++) A(g, b, c, e); } } } function C(a, b, c, e) { var d = document.createElement("style");b && d.setAttribute("scope", b);d.textContent = a;Ba(d, c, e);return d; }var D = null;function Ba(a, b, c) { b = b || document.head;b.insertBefore(a, c && c.nextSibling || b.firstChild);D ? a.compareDocumentPosition(D) === Node.DOCUMENT_POSITION_PRECEDING && (D = a) : D = a; } function Ca(a, b) { var c = a.indexOf("var(");if (-1 === c) return b(a, "", "", "");a: { var e = 0;var d = c + 3;for (var f = a.length; d < f; d++) if ("(" === a[d]) e++;else if (")" === a[d] && 0 === --e) break a;d = -1; }e = a.substring(c + 4, d);c = a.substring(0, c);a = Ca(a.substring(d + 1), b);d = e.indexOf(",");return -1 === d ? b(c, e.trim(), "", a) : b(c, e.substring(0, d).trim(), e.substring(d + 1).trim(), a); }function E(a, b) { t ? a.setAttribute("class", b) : window.ShadyDOM.nativeMethods.setAttribute.call(a, "class", b); } function F(a) { var b = a.localName, c = "";b ? -1 < b.indexOf("-") || (c = b, b = a.getAttribute && a.getAttribute("is") || "") : (b = a.is, c = a.extends);return { is: b, u: c }; };var G = null, Da = window.HTMLImports && window.HTMLImports.whenReady || null, H;function Ea(a) { requestAnimationFrame(function () { Da ? Da(a) : (G || (G = new Promise(function (a) { H = a; }), "complete" === document.readyState ? H() : document.addEventListener("readystatechange", function () { "complete" === document.readyState && H(); })), G.then(function () { a && a(); })); }); };function I() {}function J(a, b, c) { var e = K;a.__styleScoped ? a.__styleScoped = null : Fa(e, a, b || "", c); }function Fa(a, b, c, e) { b.nodeType === Node.ELEMENT_NODE && Ga(b, c, e);if (b = "template" === b.localName ? (b.content || b.R).childNodes : b.children || b.childNodes) for (var d = 0; d < b.length; d++) Fa(a, b[d], c, e); } function Ga(a, b, c) { if (b) if (a.classList) c ? (a.classList.remove("style-scope"), a.classList.remove(b)) : (a.classList.add("style-scope"), a.classList.add(b));else if (a.getAttribute) { var e = a.getAttribute(Ha);c ? e && (b = e.replace("style-scope", "").replace(b, ""), E(a, b)) : E(a, (e ? e + " " : "") + "style-scope " + b); } }function L(a, b, c) { var e = K, d = a.__cssBuild;t || "shady" === d ? b = z(b, c) : (a = F(a), b = Ia(e, b, a.is, a.u, c) + "\n\n");return b.trim(); } function Ia(a, b, c, e, d) { var f = M(c, e);c = c ? Ja + c : "";return z(b, function (b) { b.c || (b.selector = b.g = Ka(a, b, a.b, c, f), b.c = !0);d && d(b, c, f); }); }function M(a, b) { return b ? "[is=" + a + "]" : a; }function Ka(a, b, c, e, d) { var f = b.selector.split(La);if (!Aa(b)) { b = 0;for (var h = f.length, g; b < h && (g = f[b]); b++) f[b] = c.call(a, g, e, d); }return f.join(La); }function Ma(a) { return a.replace(Na, function (a, c, e) { -1 < e.indexOf("+") ? e = e.replace(/\+/g, "___") : -1 < e.indexOf("___") && (e = e.replace(/___/g, "+"));return ":" + c + "(" + e + ")"; }); } I.prototype.b = function (a, b, c) { var e = !1;a = a.trim();var d = Na.test(a);d && (a = a.replace(Na, function (a, b, c) { return ":" + b + "(" + c.replace(/\s/g, "") + ")"; }), a = Ma(a));a = a.replace(Oa, Pa + " $1");a = a.replace(Qa, function (a, d, g) { e || (a = Ra(g, d, b, c), e = e || a.stop, d = a.H, g = a.value);return d + g; });d && (a = Ma(a));return a; }; function Ra(a, b, c, e) { var d = a.indexOf(Sa);0 <= a.indexOf(Pa) ? a = Ta(a, e) : 0 !== d && (a = c ? Ua(a, c) : a);c = !1;0 <= d && (b = "", c = !0);if (c) { var f = !0;c && (a = a.replace(Va, function (a, b) { return " > " + b; })); }a = a.replace(Wa, function (a, b, c) { return '[dir="' + c + '"] ' + b + ", " + b + '[dir="' + c + '"]'; });return { value: a, H: b, stop: f }; }function Ua(a, b) { a = a.split(Xa);a[0] += b;return a.join(Xa); } function Ta(a, b) { var c = a.match(Ya);return (c = c && c[2].trim() || "") ? c[0].match(Za) ? a.replace(Ya, function (a, c, f) { return b + f; }) : c.split(Za)[0] === b ? c : $a : a.replace(Pa, b); }function ab(a) { a.selector === bb && (a.selector = "html"); }I.prototype.c = function (a) { return a.match(Sa) ? this.b(a, cb) : Ua(a.trim(), cb); };aa.Object.defineProperties(I.prototype, { a: { configurable: !0, enumerable: !0, get: function () { return "style-scope"; } } }); var Na = /:(nth[-\w]+)\(([^)]+)\)/, cb = ":not(.style-scope)", La = ",", Qa = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g, Za = /[[.:#*]/, Pa = ":host", bb = ":root", Sa = "::slotted", Oa = new RegExp("^(" + Sa + ")"), Ya = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/, Va = /(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/, Wa = /(.*):dir\((?:(ltr|rtl))\)/, Ja = ".", Xa = ":", Ha = "class", $a = "should_not_match", K = new I();function db() {} function eb(a) { for (var b = 0; b < a.length; b++) { var c = a[b];if (c.target !== document.documentElement && c.target !== document.head) for (var e = 0; e < c.addedNodes.length; e++) { var d = c.addedNodes[e];if (d.nodeType === Node.ELEMENT_NODE) { var f = d.getRootNode();var h = d;var g = [];h.classList ? g = Array.from(h.classList) : h instanceof window.SVGElement && h.hasAttribute("class") && (g = h.getAttribute("class").split(/\s+/));h = g;g = h.indexOf(K.a);if ((h = -1 < g ? h[g + 1] : "") && f === d.ownerDocument) J(d, h, !0);else if (f.nodeType === Node.DOCUMENT_FRAGMENT_NODE && (f = f.host)) if (f = F(f).is, h === f) for (d = window.ShadyDOM.nativeMethods.querySelectorAll.call(d, ":not(." + K.a + ")"), f = 0; f < d.length; f++) Ga(d[f], h);else h && J(d, h, !0), J(d, f); } } } } if (!t) { var fb = new MutationObserver(eb), gb = function (a) { fb.observe(a, { childList: !0, subtree: !0 }); };if (window.customElements && !window.customElements.polyfillWrapFlushCallback) gb(document);else { var hb = function () { gb(document.body); };window.HTMLImports ? window.HTMLImports.whenReady(hb) : requestAnimationFrame(function () { if ("loading" === document.readyState) { var a = function () { hb();document.removeEventListener("readystatechange", a); };document.addEventListener("readystatechange", a); } else hb(); }); }db = function () { eb(fb.takeRecords()); }; } var ib = db;function N(a, b, c, e, d) { this.j = a || null;this.b = b || null;this.B = c || [];this.s = null;this.u = d || "";this.a = this.h = this.m = null; }function O(a) { return a ? a.__styleInfo : null; }function jb(a, b) { return a.__styleInfo = b; }N.prototype.c = function () { return this.j; };N.prototype._getStyleRules = N.prototype.c;var Q = window.Element.prototype, kb = Q.matches || Q.matchesSelector || Q.mozMatchesSelector || Q.msMatchesSelector || Q.oMatchesSelector || Q.webkitMatchesSelector, lb = navigator.userAgent.match("Trident");function mb() {}function nb(a) { var b = {}, c = [], e = 0;A(a, function (a) { R(a);a.index = e++;a = a.f.cssText;for (var c; c = va.exec(a);) { var d = c[1];":" !== c[2] && (b[d] = !0); } }, function (a) { c.push(a); });a.b = c;a = [];for (var d in b) a.push(d);return a; } function R(a) { if (!a.f) { var b = {}, c = {};S(a, c) && (b.i = c, a.rules = null);b.cssText = a.parsedCssText.replace(ya, "").replace(w, "");a.f = b; } }function S(a, b) { var c = a.f;if (c) { if (c.i) return Object.assign(b, c.i), !0; } else { c = a.parsedCssText;for (var e; a = w.exec(c);) { e = (a[2] || a[3]).trim();if ("inherit" !== e || "unset" !== e) b[a[1].trim()] = e;e = !0; }return e; } } function T(a, b, c) { b && (b = 0 <= b.indexOf(";") ? ob(a, b, c) : Ca(b, function (b, d, f, h) { if (!d) return b + h;(d = T(a, c[d], c)) && "initial" !== d ? "apply-shim-inherit" === d && (d = "inherit") : d = T(a, c[f] || f, c) || f;return b + (d || "") + h; }));return b && b.trim() || ""; } function ob(a, b, c) { b = b.split(";");for (var e = 0, d, f; e < b.length; e++) if (d = b[e]) { y.lastIndex = 0;if (f = y.exec(d)) d = T(a, c[f[1]], c);else if (f = d.indexOf(":"), -1 !== f) { var h = d.substring(f);h = h.trim();h = T(a, h, c) || h;d = d.substring(0, f) + h; }b[e] = d && d.lastIndexOf(";") === d.length - 1 ? d.slice(0, -1) : d || ""; }return b.join(";"); } function pb(a, b) { var c = {}, e = [];A(a, function (a) { a.f || R(a);var d = a.g || a.parsedSelector;b && a.f.i && d && kb.call(b, d) && (S(a, c), a = a.index, d = parseInt(a / 32, 10), e[d] = (e[d] || 0) | 1 << a % 32); }, null, !0);return { i: c, key: e }; } function qb(a, b, c, e, d) { c.f || R(c);if (c.f.i) { b = F(b);a = b.is;b = b.u;b = a ? M(a, b) : "html";var f = c.parsedSelector, h = ":host > *" === f || "html" === f, g = 0 === f.indexOf(":host") && !h;"shady" === e && (h = f === b + " > *." + b || -1 !== f.indexOf("html"), g = !h && 0 === f.indexOf(b));"shadow" === e && (h = ":host > *" === f || "html" === f, g = g && !h);if (h || g) e = b, g && (t && !c.g && (c.g = Ka(K, c, K.b, a ? Ja + a : "", b)), e = c.g || b), d({ M: e, K: g, S: h }); } } function rb(a, b) { var c = {}, e = {}, d = U, f = b && b.__cssBuild;A(b, function (b) { qb(d, a, b, f, function (d) { kb.call(a.A || a, d.M) && (d.K ? S(b, c) : S(b, e)); }); }, null, !0);return { L: e, J: c }; } function sb(a, b, c, e) { var d = F(b), f = M(d.is, d.u), h = new RegExp("(?:^|[^.#[:])" + (b.extends ? "\\" + f.slice(0, -1) + "\\]" : f) + "($|[.:[\\s>+~])");d = O(b).j;var g = tb(d, e);return L(b, d, function (b) { var d = "";b.f || R(b);b.f.cssText && (d = ob(a, b.f.cssText, c));b.cssText = d;if (!t && !Aa(b) && b.cssText) { var k = d = b.cssText;null == b.C && (b.C = wa.test(d));if (b.C) if (null == b.w) { b.w = [];for (var q in g) k = g[q], k = k(d), d !== k && (d = k, b.w.push(q)); } else { for (q = 0; q < b.w.length; ++q) k = g[b.w[q]], d = k(d);k = d; }b.cssText = k;b.g = b.g || b.selector;d = "." + e;q = b.g.split(","); k = 0;for (var zb = q.length, P; k < zb && (P = q[k]); k++) q[k] = P.match(h) ? P.replace(f, d) : d + " " + P;b.selector = q.join(","); } }); }function tb(a, b) { a = a.b;var c = {};if (!t && a) for (var e = 0, d = a[e]; e < a.length; d = a[++e]) { var f = d, h = b;f.l = new RegExp(f.keyframesName, "g");f.a = f.keyframesName + "-" + h;f.g = f.g || f.selector;f.selector = f.g.replace(f.keyframesName, f.a);c[d.keyframesName] = ub(d); }return c; }function ub(a) { return function (b) { return b.replace(a.l, a.a); }; } function vb(a, b) { var c = U, e = B(a);a.textContent = z(e, function (a) { var d = a.cssText = a.parsedCssText;a.f && a.f.cssText && (d = d.replace(ma, "").replace(na, ""), a.cssText = ob(c, d, b)); }); }aa.Object.defineProperties(mb.prototype, { a: { configurable: !0, enumerable: !0, get: function () { return "x-scope"; } } });var U = new mb();var wb = {}, V = window.customElements;if (V && !t) { var xb = V.define;V.define = function (a, b, c) { var e = document.createComment(" Shady DOM styles for " + a + " "), d = document.head;d.insertBefore(e, (D ? D.nextSibling : null) || d.firstChild);D = e;wb[a] = e;return xb.call(V, a, b, c); }; };var W = new function () { this.cache = {};this.a = 100; }();function X() { var a = this;this.A = {};this.c = document.documentElement;var b = new n();b.rules = [];this.l = jb(this.c, new N(b));this.v = !1;this.b = this.a = null;Ea(function () { Y(a); }); }l = X.prototype;l.F = function () { ib(); };l.I = function (a) { return B(a); };l.O = function (a) { return z(a); }; l.prepareTemplate = function (a, b, c) { if (!a.l) { a.l = !0;a.name = b;a.extends = c;m[b] = a;var e = (e = a.content.querySelector("style")) ? e.getAttribute("css-build") || "" : "";var d = [];for (var f = a.content.querySelectorAll("style"), h = 0; h < f.length; h++) { var g = f[h];if (g.hasAttribute("shady-unscoped")) { if (!t) { var k = g.textContent;za.has(k) || (za.add(k), k = g.cloneNode(!0), document.head.appendChild(k));g.parentNode.removeChild(g); } } else d.push(g.textContent), g.parentNode.removeChild(g); }d = d.join("").trim();c = { is: b, extends: c, P: e }; t || J(a.content, b);Y(this);f = y.test(d) || w.test(d);y.lastIndex = 0;w.lastIndex = 0;d = p(d);f && v && this.a && this.a.transformRules(d, b);a._styleAst = d;a.v = e;e = [];v || (e = nb(a._styleAst));if (!e.length || v) d = t ? a.content : null, b = wb[b], f = L(c, a._styleAst), b = f.length ? C(f, c.is, d, b) : void 0, a.a = b;a.c = e; } }; function yb(a) { !a.b && window.ShadyCSS && window.ShadyCSS.CustomStyleInterface && (a.b = window.ShadyCSS.CustomStyleInterface, a.b.transformCallback = function (b) { a.D(b); }, a.b.validateCallback = function () { requestAnimationFrame(function () { (a.b.enqueued || a.v) && a.o(); }); }); }function Y(a) { !a.a && window.ShadyCSS && window.ShadyCSS.ApplyShim && (a.a = window.ShadyCSS.ApplyShim, a.a.invalidCallback = ra);yb(a); } l.o = function () { Y(this);if (this.b) { var a = this.b.processStyles();if (this.b.enqueued) { if (v) for (var b = 0; b < a.length; b++) { var c = this.b.getStyleForCustomStyle(a[b]);if (c && v && this.a) { var e = B(c);Y(this);this.a.transformRules(e);c.textContent = z(e); } } else for (Ab(this, this.c, this.l), b = 0; b < a.length; b++) (c = this.b.getStyleForCustomStyle(a[b])) && vb(c, this.l.m);this.b.enqueued = !1;this.v && !v && this.styleDocument(); } } }; l.styleElement = function (a, b) { var c = F(a).is, e = O(a);if (!e) { var d = F(a);e = d.is;d = d.u;var f = wb[e];e = m[e];if (e) { var h = e._styleAst;var g = e.c; }e = jb(a, new N(h, f, g, 0, d)); }a !== this.c && (this.v = !0);b && (e.s = e.s || {}, Object.assign(e.s, b));if (v) { if (e.s) { b = e.s;for (var k in b) null === k ? a.style.removeProperty(k) : a.style.setProperty(k, b[k]); }if (((k = m[c]) || a === this.c) && k && k.a && !sa(k)) { if (sa(k) || k._applyShimValidatingVersion !== k._applyShimNextVersion) Y(this), this.a && this.a.transformRules(k._styleAst, c), k.a.textContent = L(a, e.j), ta(k);t && (c = a.shadowRoot) && (c.querySelector("style").textContent = L(a, e.j));e.j = k._styleAst; } } else if (Ab(this, a, e), e.B && e.B.length) { c = e;k = F(a).is;a: { if (b = W.cache[k]) for (h = b.length - 1; 0 <= h; h--) { g = b[h];b: { e = c.B;for (d = 0; d < e.length; d++) if (f = e[d], g.i[f] !== c.m[f]) { e = !1;break b; }e = !0; }if (e) { b = g;break a; } }b = void 0; }e = b ? b.styleElement : null;h = c.h;(g = b && b.h) || (g = this.A[k] = (this.A[k] || 0) + 1, g = k + "-" + g);c.h = g;g = c.h;d = U;d = e ? e.textContent || "" : sb(d, a, c.m, g);f = O(a);var x = f.a;x && !t && x !== e && (x._useCount--, 0 >= x._useCount && x.parentNode && x.parentNode.removeChild(x));t ? f.a ? (f.a.textContent = d, e = f.a) : d && (e = C(d, g, a.shadowRoot, f.b)) : e ? e.parentNode || (lb && -1 < d.indexOf("@media") && (e.textContent = d), Ba(e, null, f.b)) : d && (e = C(d, g, null, f.b));e && (e._useCount = e._useCount || 0, f.a != e && e._useCount++, f.a = e);g = e;t || (e = c.h, f = d = a.getAttribute("class") || "", h && (f = d.replace(new RegExp("\\s*x-scope\\s*" + h + "\\s*", "g"), " ")), f += (f ? " " : "") + "x-scope " + e, d !== f && E(a, f));b || (a = W.cache[k] || [], a.push({ i: c.m, styleElement: g, h: c.h }), a.length > W.a && a.shift(), W.cache[k] = a); } };function Bb(a, b) { return (b = b.getRootNode().host) ? O(b) ? b : Bb(a, b) : a.c; }function Ab(a, b, c) { a = Bb(a, b);var e = O(a);a = Object.create(e.m || null);var d = rb(b, c.j);b = pb(e.j, b).i;Object.assign(a, d.J, b, d.L);b = c.s;for (var f in b) if ((d = b[f]) || 0 === d) a[f] = d;f = U;b = Object.getOwnPropertyNames(a);for (d = 0; d < b.length; d++) e = b[d], a[e] = T(f, a[e], a);c.m = a; }l.styleDocument = function (a) { this.styleSubtree(this.c, a); }; l.styleSubtree = function (a, b) { var c = a.shadowRoot;(c || a === this.c) && this.styleElement(a, b);if (b = c && (c.children || c.childNodes)) for (a = 0; a < b.length; a++) this.styleSubtree(b[a]);else if (a = a.children || a.childNodes) for (b = 0; b < a.length; b++) this.styleSubtree(a[b]); };l.D = function (a) { var b = this, c = B(a);A(c, function (a) { if (t) ab(a);else { var c = K;a.selector = a.parsedSelector;ab(a);a.selector = a.g = Ka(c, a, c.c, void 0, void 0); }v && (Y(b), b.a && b.a.transformRule(a)); });v ? a.textContent = z(c) : this.l.j.rules.push(c); }; l.getComputedStyleValue = function (a, b) { var c;v || (c = (O(a) || O(Bb(this, a))).m[b]);return (c = c || window.getComputedStyle(a).getPropertyValue(b)) ? c.trim() : ""; };l.N = function (a, b) { var c = a.getRootNode();b = b ? b.split(/\s/) : [];c = c.host && c.host.localName;if (!c) { var e = a.getAttribute("class");if (e) { e = e.split(/\s/);for (var d = 0; d < e.length; d++) if (e[d] === K.a) { c = e[d + 1];break; } } }c && b.push(K.a, c);v || (c = O(a)) && c.h && b.push(U.a, c.h);E(a, b.join(" ")); };l.G = function (a) { return O(a); };X.prototype.flush = X.prototype.F; X.prototype.prepareTemplate = X.prototype.prepareTemplate;X.prototype.styleElement = X.prototype.styleElement;X.prototype.styleDocument = X.prototype.styleDocument;X.prototype.styleSubtree = X.prototype.styleSubtree;X.prototype.getComputedStyleValue = X.prototype.getComputedStyleValue;X.prototype.setElementClass = X.prototype.N;X.prototype._styleInfoForNode = X.prototype.G;X.prototype.transformCustomStyleForDocument = X.prototype.D;X.prototype.getStyleAst = X.prototype.I;X.prototype.styleAstToString = X.prototype.O; X.prototype.flushCustomStyles = X.prototype.o;Object.defineProperties(X.prototype, { nativeShadow: { get: function () { return t; } }, nativeCss: { get: function () { return v; } } });var Z = new X(), Cb, Db;window.ShadyCSS && (Cb = window.ShadyCSS.ApplyShim, Db = window.ShadyCSS.CustomStyleInterface);window.ShadyCSS = { ScopingShim: Z, prepareTemplate: function (a, b, c) { Z.o();Z.prepareTemplate(a, b, c); }, styleSubtree: function (a, b) { Z.o();Z.styleSubtree(a, b); }, styleElement: function (a) { Z.o();Z.styleElement(a); }, styleDocument: function (a) { Z.o();Z.styleDocument(a); }, getComputedStyleValue: function (a, b) { return Z.getComputedStyleValue(a, b); }, nativeCss: v, nativeShadow: t };Cb && (window.ShadyCSS.ApplyShim = Cb); Db && (window.ShadyCSS.CustomStyleInterface = Db); }).call(this); //# sourceMappingURL=scoping-shim.min.js.map /* WEBPACK VAR INJECTION */ }).call(exports, __webpack_require__(0)); /***/ }, /* 5 */ /***/function (module, exports) { (function () { /* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict'; var k = {};function n() { this.end = this.start = 0;this.rules = this.parent = this.previous = null;this.cssText = this.parsedCssText = "";this.atRule = !1;this.type = 0;this.parsedSelector = this.selector = this.keyframesName = ""; } function p(a) { a = a.replace(aa, "").replace(ba, "");var c = q, b = a, d = new n();d.start = 0;d.end = b.length;for (var e = d, f = 0, h = b.length; f < h; f++) if ("{" === b[f]) { e.rules || (e.rules = []);var g = e, m = g.rules[g.rules.length - 1] || null;e = new n();e.start = f + 1;e.parent = g;e.previous = m;g.rules.push(e); } else "}" === b[f] && (e.end = f + 1, e = e.parent || d);return c(d, a); } function q(a, c) { var b = c.substring(a.start, a.end - 1);a.parsedCssText = a.cssText = b.trim();a.parent && (b = c.substring(a.previous ? a.previous.end : a.parent.start, a.start - 1), b = ca(b), b = b.replace(r, " "), b = b.substring(b.lastIndexOf(";") + 1), b = a.parsedSelector = a.selector = b.trim(), a.atRule = 0 === b.indexOf("@"), a.atRule ? 0 === b.indexOf("@media") ? a.type = t : b.match(da) && (a.type = u, a.keyframesName = a.selector.split(r).pop()) : a.type = 0 === b.indexOf("--") ? v : x);if (b = a.rules) for (var d = 0, e = b.length, f; d < e && (f = b[d]); d++) q(f, c);return a; } function ca(a) { return a.replace(/\\([0-9a-f]{1,6})\s/gi, function (a, b) { a = b;for (b = 6 - a.length; b--;) a = "0" + a;return "\\" + a; }); } function y(a, c, b) { b = void 0 === b ? "" : b;var d = "";if (a.cssText || a.rules) { var e = a.rules, f;if (f = e) f = e[0], f = !(f && f.selector && 0 === f.selector.indexOf("--"));if (f) { f = 0;for (var h = e.length, g; f < h && (g = e[f]); f++) d = y(g, c, d); } else c ? c = a.cssText : (c = a.cssText, c = c.replace(ea, "").replace(fa, ""), c = c.replace(ha, "").replace(ia, "")), (d = c.trim()) && (d = " " + d + "\n"); }d && (a.selector && (b += a.selector + " {\n"), b += d, a.selector && (b += "}\n\n"));return b; } var x = 1, u = 7, t = 4, v = 1E3, aa = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, ba = /@import[^;]*;/gim, ea = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, fa = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, ha = /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, ia = /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, da = /^@[^\s]*keyframes/, r = /\s+/g;var ja = Promise.resolve();function ka(a) { if (a = k[a]) a._applyShimCurrentVersion = a._applyShimCurrentVersion || 0, a._applyShimValidatingVersion = a._applyShimValidatingVersion || 0, a._applyShimNextVersion = (a._applyShimNextVersion || 0) + 1; }function z(a) { return a._applyShimCurrentVersion === a._applyShimNextVersion; }function la(a) { a._applyShimValidatingVersion = a._applyShimNextVersion;a.b || (a.b = !0, ja.then(function () { a._applyShimCurrentVersion = a._applyShimNextVersion;a.b = !1; })); };var A = !(window.ShadyDOM && window.ShadyDOM.inUse), B;function C(a) { B = a && a.shimcssproperties ? !1 : A || !(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) || !window.CSS || !CSS.supports || !CSS.supports("box-shadow", "0 0 0 var(--foo)")); }window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? B = window.ShadyCSS.nativeCss : window.ShadyCSS ? (C(window.ShadyCSS), window.ShadyCSS = void 0) : C(window.WebComponents && window.WebComponents.flags);var D = B;var F = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi, G = /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi, ma = /@media\s(.*)/;var H = new Set();function I(a) { if (!a) return "";"string" === typeof a && (a = p(a));return y(a, D); }function J(a) { !a.__cssRules && a.textContent && (a.__cssRules = p(a.textContent));return a.__cssRules || null; }function K(a, c, b, d) { if (a) { var e = !1, f = a.type;if (d && f === t) { var h = a.selector.match(ma);h && (window.matchMedia(h[1]).matches || (e = !0)); }f === x ? c(a) : b && f === u ? b(a) : f === v && (e = !0);if ((a = a.rules) && !e) { e = 0;f = a.length;for (var g; e < f && (g = a[e]); e++) K(g, c, b, d); } } } function L(a, c) { var b = a.indexOf("var(");if (-1 === b) return c(a, "", "", "");a: { var d = 0;var e = b + 3;for (var f = a.length; e < f; e++) if ("(" === a[e]) d++;else if (")" === a[e] && 0 === --d) break a;e = -1; }d = a.substring(b + 4, e);b = a.substring(0, b);a = L(a.substring(e + 1), c);e = d.indexOf(",");return -1 === e ? c(b, d.trim(), "", a) : c(b, d.substring(0, e).trim(), d.substring(e + 1).trim(), a); };var na = /;\s*/m, oa = /^\s*(initial)|(inherit)\s*$/;function M() { this.a = {}; }M.prototype.set = function (a, c) { a = a.trim();this.a[a] = { h: c, i: {} }; };M.prototype.get = function (a) { a = a.trim();return this.a[a] || null; };var N = null;function O() { this.b = this.c = null;this.a = new M(); }O.prototype.o = function (a) { a = G.test(a) || F.test(a);G.lastIndex = 0;F.lastIndex = 0;return a; }; O.prototype.m = function (a, c) { if (void 0 === a.a) { var b = [];for (var d = a.content.querySelectorAll("style"), e = 0; e < d.length; e++) { var f = d[e];if (f.hasAttribute("shady-unscoped")) { if (!A) { var h = f.textContent;H.has(h) || (H.add(h), h = f.cloneNode(!0), document.head.appendChild(h));f.parentNode.removeChild(f); } } else b.push(f.textContent), f.parentNode.removeChild(f); }(b = b.join("").trim()) ? (d = document.createElement("style"), d.textContent = b, a.content.insertBefore(d, a.content.firstChild), b = d) : b = null;a.a = b; }return (a = a.a) ? this.j(a, c) : null; };O.prototype.j = function (a, c) { c = void 0 === c ? "" : c;var b = J(a);this.l(b, c);a.textContent = I(b);return b; };O.prototype.f = function (a) { var c = this, b = J(a);K(b, function (a) { ":root" === a.selector && (a.selector = "html");c.g(a); });a.textContent = I(b);return b; };O.prototype.l = function (a, c) { var b = this;this.c = c;K(a, function (a) { b.g(a); });this.c = null; };O.prototype.g = function (a) { a.cssText = pa(this, a.parsedCssText);":root" === a.selector && (a.selector = ":host > *"); }; function pa(a, c) { c = c.replace(F, function (b, c, e, f) { return qa(a, b, c, e, f); });return P(a, c); }function P(a, c) { for (var b; b = G.exec(c);) { var d = b[0], e = b[1];b = b.index;var f = c.slice(0, b + d.indexOf("@apply"));c = c.slice(b + d.length);var h = Q(a, f);d = void 0;var g = a;e = e.replace(na, "");var m = [];var l = g.a.get(e);l || (g.a.set(e, {}), l = g.a.get(e));if (l) for (d in g.c && (l.i[g.c] = !0), l.h) g = h && h[d], l = [d, ": var(", e, "_-_", d], g && l.push(",", g), l.push(")"), m.push(l.join(""));d = m.join("; ");c = "" + f + d + c;G.lastIndex = b + d.length; }return c; } function Q(a, c) { c = c.split(";");for (var b, d, e = {}, f = 0, h; f < c.length; f++) if (b = c[f]) if (h = b.split(":"), 1 < h.length) { b = h[0].trim();var g = a;d = b;h = h.slice(1).join(":");var m = oa.exec(h);m && (m[1] ? (g.b || (g.b = document.createElement("meta"), g.b.setAttribute("apply-shim-measure", ""), g.b.style.all = "initial", document.head.appendChild(g.b)), d = window.getComputedStyle(g.b).getPropertyValue(d)) : d = "apply-shim-inherit", h = d);d = h;e[b] = d; }return e; }function ra(a, c) { if (N) for (var b in c.i) b !== a.c && N(b); } function qa(a, c, b, d, e) { d && L(d, function (c, b) { b && a.a.get(b) && (e = "@apply " + b + ";"); });if (!e) return c;var f = P(a, e), h = c.slice(0, c.indexOf("--")), g = f = Q(a, f), m = a.a.get(b), l = m && m.h;l ? g = Object.assign(Object.create(l), f) : a.a.set(b, g);var Y = [], w, Z = !1;for (w in g) { var E = f[w];void 0 === E && (E = "initial");!l || w in l || (Z = !0);Y.push("" + b + "_-_" + w + ": " + E); }Z && ra(a, m);m && (m.h = g);d && (h = c + ";" + h);return "" + h + Y.join("; ") + ";"; }O.prototype.detectMixin = O.prototype.o;O.prototype.transformStyle = O.prototype.j; O.prototype.transformCustomStyle = O.prototype.f;O.prototype.transformRules = O.prototype.l;O.prototype.transformRule = O.prototype.g;O.prototype.transformTemplate = O.prototype.m;O.prototype._separator = "_-_";Object.defineProperty(O.prototype, "invalidCallback", { get: function () { return N; }, set: function (a) { N = a; } });var R = null, sa = window.HTMLImports && window.HTMLImports.whenReady || null, S;function ta(a) { requestAnimationFrame(function () { sa ? sa(a) : (R || (R = new Promise(function (a) { S = a; }), "complete" === document.readyState ? S() : document.addEventListener("readystatechange", function () { "complete" === document.readyState && S(); })), R.then(function () { a && a(); })); }); };var T = new O();function U() { var a = this;this.a = null;ta(function () { V(a); });T.invalidCallback = ka; }function V(a) { a.a || (a.a = window.ShadyCSS.CustomStyleInterface, a.a && (a.a.transformCallback = function (a) { T.f(a); }, a.a.validateCallback = function () { requestAnimationFrame(function () { a.a.enqueued && W(a); }); })); }U.prototype.prepareTemplate = function (a, c) { V(this);k[c] = a;c = T.m(a, c);a._styleAst = c; }; function W(a) { V(a);if (a.a) { var c = a.a.processStyles();if (a.a.enqueued) { for (var b = 0; b < c.length; b++) { var d = a.a.getStyleForCustomStyle(c[b]);d && T.f(d); }a.a.enqueued = !1; } } }U.prototype.styleSubtree = function (a, c) { V(this);if (c) for (var b in c) null === b ? a.style.removeProperty(b) : a.style.setProperty(b, c[b]);if (a.shadowRoot) for (this.styleElement(a), a = a.shadowRoot.children || a.shadowRoot.childNodes, c = 0; c < a.length; c++) this.styleSubtree(a[c]);else for (a = a.children || a.childNodes, c = 0; c < a.length; c++) this.styleSubtree(a[c]); }; U.prototype.styleElement = function (a) { V(this);var c = a.localName, b;c ? -1 < c.indexOf("-") ? b = c : b = a.getAttribute && a.getAttribute("is") || "" : b = a.is;if ((c = k[b]) && !z(c)) { if (z(c) || c._applyShimValidatingVersion !== c._applyShimNextVersion) this.prepareTemplate(c, b), la(c);if (a = a.shadowRoot) if (a = a.querySelector("style")) a.__cssRules = c._styleAst, a.textContent = I(c._styleAst); } };U.prototype.styleDocument = function (a) { V(this);this.styleSubtree(document.body, a); }; if (!window.ShadyCSS || !window.ShadyCSS.ScopingShim) { var X = new U(), ua = window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;window.ShadyCSS = { prepareTemplate: function (a, c) { W(X);X.prepareTemplate(a, c); }, styleSubtree: function (a, c) { W(X);X.styleSubtree(a, c); }, styleElement: function (a) { W(X);X.styleElement(a); }, styleDocument: function (a) { W(X);X.styleDocument(a); }, getComputedStyleValue: function (a, c) { return (a = window.getComputedStyle(a).getPropertyValue(c)) ? a.trim() : ""; }, nativeCss: D, nativeShadow: A };ua && (window.ShadyCSS.CustomStyleInterface = ua); }window.ShadyCSS.ApplyShim = T; }).call(this); //# sourceMappingURL=apply-shim.min.js.map /***/ }, /* 6 */ /***/function (module, exports) { (function () { /* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict'; var c = !(window.ShadyDOM && window.ShadyDOM.inUse), f;function g(a) { f = a && a.shimcssproperties ? !1 : c || !(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) || !window.CSS || !CSS.supports || !CSS.supports("box-shadow", "0 0 0 var(--foo)")); }window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? f = window.ShadyCSS.nativeCss : window.ShadyCSS ? (g(window.ShadyCSS), window.ShadyCSS = void 0) : g(window.WebComponents && window.WebComponents.flags);var h = f;function k(a, b) { for (var d in b) null === d ? a.style.removeProperty(d) : a.style.setProperty(d, b[d]); };var l = null, m = window.HTMLImports && window.HTMLImports.whenReady || null, n;function p() { var a = q;requestAnimationFrame(function () { m ? m(a) : (l || (l = new Promise(function (a) { n = a; }), "complete" === document.readyState ? n() : document.addEventListener("readystatechange", function () { "complete" === document.readyState && n(); })), l.then(function () { a && a(); })); }); };var r = null, q = null;function t() { this.customStyles = [];this.enqueued = !1; }function u(a) { !a.enqueued && q && (a.enqueued = !0, p()); }t.prototype.c = function (a) { a.__seenByShadyCSS || (a.__seenByShadyCSS = !0, this.customStyles.push(a), u(this)); };t.prototype.b = function (a) { if (a.__shadyCSSCachedStyle) return a.__shadyCSSCachedStyle;var b;a.getStyle ? b = a.getStyle() : b = a;return b; }; t.prototype.a = function () { for (var a = this.customStyles, b = 0; b < a.length; b++) { var d = a[b];if (!d.__shadyCSSCachedStyle) { var e = this.b(d);e && (e = e.__appliedElement || e, r && r(e), d.__shadyCSSCachedStyle = e); } }return a; };t.prototype.addCustomStyle = t.prototype.c;t.prototype.getStyleForCustomStyle = t.prototype.b;t.prototype.processStyles = t.prototype.a; Object.defineProperties(t.prototype, { transformCallback: { get: function () { return r; }, set: function (a) { r = a; } }, validateCallback: { get: function () { return q; }, set: function (a) { var b = !1;q || (b = !0);q = a;b && u(this); } } });var v = new t();window.ShadyCSS || (window.ShadyCSS = { prepareTemplate: function () {}, styleSubtree: function (a, b) { v.a();k(a, b); }, styleElement: function () { v.a(); }, styleDocument: function (a) { v.a();k(document.body, a); }, getComputedStyleValue: function (a, b) { return (a = window.getComputedStyle(a).getPropertyValue(b)) ? a.trim() : ""; }, nativeCss: h, nativeShadow: c });window.ShadyCSS.CustomStyleInterface = v; }).call(this); //# sourceMappingURL=custom-style-interface.min.js.map /***/ }, /* 7 */ /***/function (module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__node_modules_lit_html_lit_html_js__ = __webpack_require__(8); const template = document.createElement('template'); template.innerHTML = ` <style> :host{ display: block; --width: 400px; --tw: 10px; --th: 15px; --bg: #25252B; --fill:#6C717E; --thumb: white; } #hz-range { position: relative; } input[type="range"] { position: absolute; height: 5px; width: var(--width); top: 0; left: 0px; padding: 10px 0px; margin: 0; -webkit-appearance: none; background: transparent; border: none; outline: none; } input[type="range"]:focus{ box-shadow: 0 0 2px; } input[type="range"]::-ms-track { width: 100%; /* Hides the slider so custom styles can be added */ background: transparent; border-color: transparent; color: transparent; } input[type=range]::-moz-range-track { width: 100%; background: transparent; } /* Special styling for WebKit/Blink */ input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: var(--tw); width: var(--th); background: transparent; } /* All the same stuff for Firefox */ input[type=range]::-moz-range-thumb { height: var(--tw); width: var(--th); background: transparent; border: none; } /* All the same stuff for IE */ input[type=range]::-ms-thumb { height: var(--tw); width: var(--th); background: transparent; border: none; } </style> <div id="hz-range"> <input type="range"> <div id="svg"> Sorry, your browser does not support inline SVG. </div> </div> `; let ShadyCSS = window["ShadyCSS"]; if (ShadyCSS) { ShadyCSS.prepareTemplate(template, 'hz-range'); } class HzRange extends HTMLElement { constructor() { super(); if (ShadyCSS) { ShadyCSS.styleElement(this); } this.attachShadow({ mode: 'open' }); if (this.shadowRoot) { this.shadowRoot.appendChild(template.content.cloneNode(true)); this.inputRange = this.shadowRoot.querySelector("input[type='range']"); this.svgRange = this.shadowRoot.querySelector("#svg"); this._x1 = 5; this._x2 = 400; this._y1 = 17; this._y2 = 7; this.addOnChange(); } } connectedCallback() { if (this.parentElement && this.inputRange) { this._x2 = this.parentElement.clientWidth - 10; this.style.setProperty('--width', this.parentElement.clientWidth + "px"); this.render(); } } addOnChange() { if (this.inputRange) { this._value = +this.inputRange.value; this.inputRange.addEventListener("input", e => { let target = e.currentTarget; this._value = +target.value; this.render(); this.dispatchEvent(new CustomEvent('range-change', { bubbles: true, composed: true, detail: this._value })); }); } } svgRangeTemplate() { const { _x1, _x2, _y1, _y2 } = this; let k = this._value / 100; const w = Math.max(_x2 * k, _x1); const h = _y1 - (_y1 - _y2) * k; const t = (5 + 5 * k) / 2; const basePoints = [[_x1, _y1], [_x2, _y1], [_x2, _y2]].join(" "); const rangePoints = [[_x1, _y1], [w, _y1], [w, h]].join(" "); const thumbPoints = [[w - t, _y1 + 4], [w + t, _y1 + 4], [w + t, h - 3], [w, h - 6], [w - t, h - 3]].join(" "); return __WEBPACK_IMPORTED_MODULE_0__node_modules_lit_html_lit_html_js__["a" /* html */]` <svg height="${_y1 + 5}" width="${_x2 + 7}"> <defs> <filter id="shadow"> <feDropShadow dx="0" dy="0" stdDeviation="1"/> </filter> </defs> <polygon points="${basePoints}" style="fill:var(--bg);stroke: var(--bg); stroke-width: 2; stroke-linecap: round" /> <polygon points="${rangePoints}" style="fill:var(--fill);stroke: var(--fill); stroke-width: 2;stroke-linecap: round"/> <polygon points="${thumbPoints}" style="fill:var(--thumb);" filter="url(#shadow)"/> </svg>`; } render() { if (this.svgRange) { Object(__WEBPACK_IMPORTED_MODULE_0__node_modules_lit_html_lit_html_js__["b" /* render */])(this.svgRangeTemplate(), this.svgRange); } } } /* harmony export (immutable) */__webpack_exports__["default"] = HzRange; window.customElements.define('hz-range', HzRange); //# sourceMappingURL=HzRange.js.map /***/ }, /* 8 */ /***/function (module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = render; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ /** * TypeScript has a problem with precompiling templates literals * https://github.com/Microsoft/TypeScript/issues/17956 * * TODO(justinfagnani): Run tests compiled to ES5 with both Babel and * TypeScript to verify correctness. */ const envCachesTemplates = (t => t() === t())(() => (s => s)``); // The first argument to JS template tags retain identity across multiple // calls to a tag for the same literal, so we can cache work done per literal // in a Map. const templates = new Map(); const svgTemplates = new Map(); /** * Interprets a template literal as an HTML template that can efficiently * render to and update a container. */ const html = (strings, ...values) => litTag(strings, values, templates, false); /* harmony export (immutable) */__webpack_exports__["a"] = html; /** * Interprets a template literal as an SVG template that can efficiently * render to and update a container. */ const svg = (strings, ...values) => litTag(strings, values, svgTemplates, true); /* unused harmony export svg */ function litTag(strings, values, templates, isSvg) { const key = envCachesTemplates ? strings : strings.join('{{--uniqueness-workaround--}}'); let template = templates.get(key); if (template === undefined) { template = new Template(strings, isSvg); templates.set(key, template); } return new TemplateResult(template, values); } /** * The return type of `html`, which holds a Template and the values from * interpolated expressions. */ class TemplateResult { constructor(template, values) { this.template = template; this.values = values; } } /* unused harmony export TemplateResult */ /** * Renders a template to a container. * * To update a container with new values, reevaluate the template literal and * call `render` with the new result. */ function render(result, container, partCallback = defaultPartCallback) { let instance = container.__templateInstance; // Repeat render, just call update() if (instance !== undefined && instance.template === result.template && instance._partCallback === partCallback) { instance.update(result.values); return; } // First render, create a new TemplateInstance and append it instance = new TemplateInstance(result.template, partCallback); container.__templateInstance = instance; const fragment = instance._clone(); instance.update(result.values); let child; while (child = container.lastChild) { container.removeChild(child); } container.appendChild(fragment); } /** * An expression marker with embedded unique key to avoid * https://github.com/PolymerLabs/lit-html/issues/62 */ const attributeMarker = `{{lit-${Math.random()}}}`; /** * Regex to scan the string preceding an expression to see if we're in a text * context, and not an attribute context. * * This works by seeing if we have a `>` not followed by a `<`. If there is a * `<` closer to the end of the strings, then we're inside a tag. */ const textRegex = />[^<]*$/; const hasTagsRegex = /[^<]*/; const textMarkerContent = '_-lit-html-_'; const textMarker = `<!--${textMarkerContent}-->`; const attrOrTextRegex = new RegExp(`${attributeMarker}|${textMarker}`); /** * A placeholder for a dynamic expression in an HTML template. * * There are two built-in part types: AttributePart and NodePart. NodeParts * always represent a single dynamic expression, while AttributeParts may * represent as many expressions are contained in the attribute. * * A Template's parts are mutable, so parts can be replaced or modified * (possibly to implement different template semantics). The contract is that * parts can only be replaced, not removed, added or reordered, and parts must * always consume the correct number of values in their `update()` method. * * TODO(justinfagnani): That requirement is a little fragile. A * TemplateInstance could instead be more careful about which values it gives * to Part.update(). */ class TemplatePart { constructor(type, index, name, rawName, strings) { this.type = type; this.index = index; this.name = name; this.rawName = rawName; this.strings = strings; } } /* unused harmony export TemplatePart */ class Template { constructor(strings, svg = false) { this.parts = []; this.svg = svg; this.element = document.createElement('template'); this.element.innerHTML = this._getHtml(strings, svg); // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null const walker = document.createTreeWalker(this.element.content, 133 /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT */, null, false); let index = -1; let partIndex = 0; const nodesToRemove = []; // The actual previous node, accounting for removals: if a node is removed // it will never be the previousNode. let previousNode; // Used to set previousNode at the top of the loop. let currentNode; while (walker.nextNode()) { index++; previousNode = currentNode; const node = currentNode = walker.currentNode; if (node.nodeType === 1 /* Node.ELEMENT_NODE */) { if (!node.hasAttributes()) { continue; } const attributes = node.attributes; for (let i = 0; i < attributes.length; i++) { const attribute = attributes.item(i); const attributeStrings = attribute.value.split(attrOrTextRegex); if (attributeStrings.length > 1) { // Get the template literal section leading up to the first // expression in this attribute attribute const attributeString = strings[partIndex]; // Trim the trailing literal value if this is an interpolation const rawNameString = attributeString.substring(0, attributeString.length - attributeStrings[0].length); // Find the attribute name const rawName = rawNameString.match(/((?:\w|[.\-_$])+)=["']?$/)[1]; this.parts.push(new TemplatePart('attribute', index, attribute.name, rawName, attributeStrings)); node.removeAttribute(attribute.name); partIndex += attributeStrings.length - 1; i--; } } } else if (node.nodeType === 3 /* Node.TEXT_NODE */) { const nodeValue = node.nodeValue; const strings = nodeValue.split(attributeMarker); if (strings.length > 1) { const parent = node.parentNode; const lastIndex = strings.length - 1; // We have a part for each match found partIndex += lastIndex; // We keep this current node, but reset its content to the last // literal part. We insert new literal nodes before this so that the // tree walker keeps its position correctly. node.textContent = strings[lastIndex]; // Generate a new text node for each literal section // These nodes are also used as the markers for node parts for (let i = 0; i < lastIndex; i++) { parent.insertBefore(document.createTextNode(strings[i]), node); this.parts.push(new TemplatePart('node', index++)); } } else { // Strip whitespace-only nodes, only between elements, or at the // beginning or end of elements. const previousSibling = node.previousSibling; const nextSibling = node.nextSibling; if ((previousSibling === null || previousSibling.nodeType === 1 /* Node.ELEMENT_NODE */) && (nextSibling === null || nextSibling.nodeType === 1 /* Node.ELEMENT_NODE */) && nodeValue.trim() === '') { nodesToRemove.push(node); currentNode = previousNode; index--; } } } else if (node.nodeType === 8 /* Node.COMMENT_NODE */ && node.nodeValue === textMarkerContent) { const parent = node.parentNode; // If we don't have a previous node add a marker node. // If the previousSibling is removed, because it's another part // placholder, or empty text, add a marker node. if (node.previousSibling === null || node.previousSibling !== previousNode) { parent.insertBefore(new Text(), node); } else { index--; } this.parts.push(new TemplatePart('node', index++)); nodesToRemove.push(node); // If we don't have a next node add a marker node. // We don't have to check if the next node is going to be removed, // because that node will induce a marker if so. if (node.nextSibling === null) { parent.insertBefore(new Text(), node); } else { index--; } currentNode = previousNode; partIndex++; } } // Remove text binding nodes after the walk to not disturb the TreeWalker for (const n of nodesToRemove) { n.parentNode.removeChild(n); } } /** * Returns a string of HTML used to create a <template> element. */ _getHtml(strings, svg) { const l = strings.length; const a = []; let isTextBinding = false; for (let i = 0; i < l - 1; i++) { const s = strings[i]; a.push(s); // We're in a text position if the previous string matches the // textRegex. If it doesn't and the previous string has no tags, then // we use the previous text position state. isTextBinding = s.match(textRegex) !== null || s.match(hasTagsRegex) !== null && isTextBinding; a.push(isTextBinding ? textMarker : attributeMarker); } a.push(strings[l - 1]); const html = a.join(''); return svg ? `<svg>${html}</svg>` : html; } } /* unused harmony export Template */ const getValue = (part, value) => { // `null` as the value of a Text node will render the string 'null' // so we convert it to undefined if (value != null && value.__litDirective === true) { value = value(part); } return value === null ? undefined : value; }; /* unused harmony export getValue */ const directive = f => { f.__litDirective = true; return f; }; /* unused harmony export directive */ class AttributePart { constructor(instance, element, name, strings) { this.instance = instance; this.element = element; this.name = name; this.strings = strings; this.size = strings.length - 1; } setValue(values, startIndex) { const strings = this.strings; let text = ''; for (let i = 0; i < strings.length; i++) { text += strings[i]; if (i < strings.length - 1) { const v = getValue(this, values[startIndex + i]); if (v && (Array.isArray(v) || typeof v !== 'string' && v[Symbol.iterator])) { for (const t of v) { // TODO: we need to recursively call getValue into iterables... text += t; } } else { text += v; } } } this.element.setAttribute(this.name, text); } } /* unused harmony export AttributePart */ class NodePart { constructor(instance, startNode, endNode) { this.instance = instance; this.startNode = startNode; this.endNode = endNode; this._previousValue = undefined; } setValue(value) { value = getValue(this, value); if (value === null || !(typeof value === 'object' || typeof value === 'function')) { // Handle primitive values // If the value didn't change, do nothing if (value === this._previousValue) { return; } this._setText(value); } else if (value instanceof TemplateResult) { this._setTemplateResult(value); } else if (Array.isArray(value) || value[Symbol.iterator]) { this._setIterable(value); } else if (value instanceof Node) { this._setNode(value); } else if (value.then !== undefined) { this._setPromise(value); } else { // Fallback, will render the string representation this._setText(value); } } _insert(node) { this.endNode.parentNode.insertBefore(node, this.endNode); } _setNode(value) { this.clear(); this._insert(value); this._previousValue = value; } _setText(value) { const node = this.startNode.nextSibling; if (node === this.endNode.previousSibling && node.nodeType === Node.TEXT_NODE) { // If we only have a single text node between the markers, we can just // set its value, rather than replacing it. // TODO(justinfagnani): Can we just check if _previousValue is // primitive? node.textContent = value; } else { this._setNode(document.createTextNode(value === undefined ? '' : value)); } this._previousValue = value; } _setTemplateResult(value) { let instance; if (this._previousValue && this._previousValue.template === value.template) { instance = this._previousValue; } else { instance = new TemplateInstance(value.template, this.instance._partCallback); this._setNode(instance._clone()); this._previousValue = instance; } instance.update(value.values); } _setIterable(value) { // For an Iterable, we create a new InstancePart per item, then set its // value to the item. This is a little bit of overhead for every item in // an Iterable, but it lets us recurse easily and efficiently update Arrays // of TemplateResults that will be commonly returned from expressions like: // array.map((i) => html`${i}`), by reusing existing TemplateInstances. // If _previousValue is an array, then the previous render was of an // iterable and _previousValue will contain the NodeParts from the previous // render. If _previousValue is not an array, clear this part and make a new // array for NodeParts. if (!Array.isArray(this._previousValue)) { this.clear(); this._previousValue = []; } // Lets us keep track of how many items we stamped so we can clear leftover // items from a previous render const itemParts = this._previousValue; let partIndex = 0; for (const item of value) { // Try to reuse an existing part let itemPart = itemParts[partIndex]; // If no existing part, create a new one if (itemPart === undefined) { // If we're creating the first item part, it's startNode should be the // container's startNode let itemStart = this.startNode; // If we're not creating the first part, create a new separator marker // node, and fix up the previous part's endNode to point to it if (partIndex > 0) { const previousPart = itemParts[partIndex - 1]; itemStart = previousPart.endNode = document.createTextNode(''); this._insert(itemStart); } itemPart = new NodePart(this.instance, itemStart, this.endNode); itemParts.push(itemPart); } itemPart.setValue(item); partIndex++; } if (partIndex === 0) { this.clear(); this._previousValue = undefined; } else if (partIndex < itemParts.length) { const lastPart = itemParts[partIndex - 1]; // Truncate the parts array so _previousValue reflects the current state itemParts.length = partIndex; this.clear(lastPart.endNode.previousSibling); lastPart.endNode = this.endNode; } } _setPromise(value) { value.then(v => { if (this._previousValue === value) { this.setValue(v); } }); this._previousValue = value; } clear(startNode = this.startNode) { let node; while ((node = startNode.nextSibling) !== this.endNode) { node.parentNode.removeChild(node); } } } /* unused harmony export NodePart */ const defaultPartCallback = (instance, templatePart, node) => { if (templatePart.type === 'attribute') { return new AttributePart(instance, node, templatePart.name, templatePart.strings); } else if (templatePart.type === 'node') { return new NodePart(instance, node, node.nextSibling); } throw new Error(`Unknown part type ${templatePart.type}`); }; /* unused harmony export defaultPartCallback */ /** * An instance of a `Template` that can be attached to the DOM and updated * with new values. */ class TemplateInstance { constructor(template, partCallback = defaultPartCallback) { this._parts = []; this.template = template; this._partCallback = partCallback; } update(values) { let valueIndex = 0; for (const part of this._parts) { if (part.size === undefined) { part.setValue(values[valueIndex]); valueIndex++; } else { part.setValue(values, valueIndex); valueIndex += part.size; } } } _clone() { const fragment = document.importNode(this.template.element.content, true); if (this.template.parts.length > 0) { // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be // null const walker = document.createTreeWalker(fragment, 133 /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT */, null, false); const parts = this.template.parts; let index = 0; let partIndex = 0; let templatePart = parts[0]; let node = walker.nextNode(); while (node != null && partIndex < parts.length) { if (index === templatePart.index) { this._parts.push(this._partCallback(this, templatePart, node)); templatePart = parts[++partIndex]; } else { index++; node = walker.nextNode(); } } } if (this.template.svg) { const svgElement = fragment.firstChild; fragment.removeChild(svgElement); const nodes = svgElement.childNodes; for (let i = 0; i < nodes.length; i++) { fragment.appendChild(nodes.item(i)); } } return fragment; } } /* unused harmony export TemplateInstance */ //# sourceMappingURL=lit-html.js.map /***/ }] /******/); /***/ }) /******/ ]);
import Ember from 'ember'; export default Ember.Component.extend({ updateAnswerShowing: false, actions: { showUpdateForm() { this.set('updateAnswerShowing', true); }, cancelUpdate() { this.set('updateAnswerShowing', false); }, update(answer) { var params = { body: this.get('body'), author: this.get('author'), date: this.get('date'), question: this.get('question') }; this.set('updateAnswerShowing', false); this.sendAction('updateAnswer', answer, params); } } });
import React from "react"; import { StyledHeading } from "../../styles/GlobalStyledComponents"; import * as sc from "./StyledChallengeArea"; const ChallengeArea = () => { return ( <sc.StyledChallengeContainer> <sc.StyledChallengeHeader> <StyledHeading>CHALLENGE #1</StyledHeading> <h1>Turn any Design into HTML</h1> </sc.StyledChallengeHeader> <div> <sc.StyledVideoWrapper> <sc.StyledVideo src="https://player.vimeo.com/video/477240959" frameBorder="0" width="640" height="360" allow="autoplay;encrypted-media; fullscreen;" title="Create an Anonymous Message Board" allowFullScreen ></sc.StyledVideo> </sc.StyledVideoWrapper> <div> <p> Welcome to the final challenge. You'll be using the knowledge built up in the challenges before this for building a server, a database, and a client to create an anonymous message board. </p> <p> The details and a general design to base your project off of are in the video. Deploy your project when it's done and submit both the link to the deployed project and your GitHub for it. </p> <p> Feel free to ask any question you want on this page, and it'll be answered either by me or my apprentice who built it. </p> <p> <strong>Good luck!</strong> </p> </div> </div> </sc.StyledChallengeContainer> ); }; export default ChallengeArea;
//1) a new datastructure which is very similar to array the basic difference is there is not indexing of elements and // 2) and set has no repetation of elements // 3) It works with all iterator ex- string, array const x = new Set(["Hello", "Hii", "How", "Do", "You", "Do"]); console.log(x.size); for (const y of x) console.log(y.size); // set methods console.log(x.add("Ramesh")); console.log(x.delete("Hii")); console.log(x.has("Ramesh")); console.log(x.entries("Ramesh", "how"));
/** * * * 清除 * @Author Jason * @Date 2017-5-11 * * */ ;(function() { function Clear(fn) { if(!this instanceof Clear) return new Clear(fn); this.name = "Clear"; fn.call(Object.create(null), this); } Clear.prototype = { constructor: Clear }; window.vm = window.vm || {}; window.vm.module = window.vm.module || {}; window.vm.module["clear"] = Clear; }(void(0)));
import { useEffect, useState } from "react"; import "./App.css"; import "bootstrap/dist/css/bootstrap.css"; import * as faceapi from "face-api.js"; import WebcamComponent from "./components/webcamComponent"; import ReferenceGrid from "./components/ReferenceGrid"; import UploadButtonGroup from "./components/UploadButtonGroup"; import FaceGrid from "./components/FaceGrid"; import ReferenceImage from "./components/ReferenceImage"; import ResultControls from "./components/ResultControls"; import FoundFace from "./components/FoundFace"; import Tips from "./components/tips"; import { FormatUnderlinedSharp } from "@material-ui/icons"; function App() { const [modelLoaded, setModelLoaded] = useState(false); const [faces, setFaces] = useState([]); const [referenceFaces, setReferenceFaces] = useState([]); const [referenceFace, setReferenceFace] = useState(-1); const [processing, setProcessing] = useState(false); const [queries, setQueries] = useState([]); const [imageDimensions, setImageDimensions] = useState([]); const [foundFace, setFoundFace] = useState(false); const [progressStatus, setProgressStatus] = useState({ fetchingResults: false, inputResource: "", inputTarget: "", foundFace: false, result: false, createDatabase: { label: "Create Database", status: 0 }, uploadReferenceImage: { label: "Upload Reference", status: 0 }, results: { label: "Results", status: 0 }, }); useEffect(() => { if (referenceFaces.length > 0 && referenceFace == -1) { setReferenceFace(0); } }, [referenceFaces]); /** * Load Model */ useEffect(() => { async function loadModel() { const MODEL_URL = process.env.PUBLIC_URL + "/models"; await faceapi.loadSsdMobilenetv1Model(MODEL_URL); setModelLoaded(true); } loadModel(); }, []); /** * Polling Function */ useEffect(() => { async function poll() { let temp = [...queries]; for (let i = 0; i < temp.length; i++) { if (!temp[i].result) { await new Promise((resolve) => setTimeout(resolve, 1000)); let res = await fetch( "https://api.skylarklabs.ai/face-recognition/" + temp[i].query + "?key=662b2a0adeb3bbc7388bb274fc735c98648f0c70e6ebde9aebb9b56784f05d33", { method: "GET", } ) .then((response) => response.json()) .then((data) => { console.log(data); return data; }); if (res.status == "success") { temp[i].result = res; temp[i].result.json = JSON.parse(temp[i].result.response_json); setQueries(temp); } else if (res.status == "pending") { setQueries([...temp]); } else { temp[i].result = "failed"; setQueries(temp); } } } } if ( queries.length > 0 && (queries[queries.length - 1].result.status == "success" || queries[queries.length - 1].result.status == "failed") ) { setProgressStatus({ ...progressStatus, result: true, }); } else poll(); }, [queries]); /** * Handles response from the queries * checks if a matched face is found */ useEffect(() => { if (progressStatus.result == true && foundFace === false) { let active = null; for (let i = 0; i < queries.length; i++) { console.log("here"); console.log(queries[i].result.json.recognitions); for (let j = 0; j < queries[i].result.json.recognitions.length; j++) { console.log(queries[i].result.json.recognitions[j]); if (queries[i].result.json.recognitions[j][0] != -1) { if ( active == null || active.prob < queries[i].result.json.recognitions[j][1] ) { active = {}; active.prob = queries[i].result.json.recognitions[j][1]; active.coordinates = queries[i].result.json.query_detections[j].coordinates; active.image = queries[i].img; } } } } console.log(active); if (active != null) { setFoundFace(active); setProgressStatus({ ...progressStatus, result: true }); } } }, [progressStatus]); console.log(foundFace); async function postRequest(image) { let c = document.getElementById("hiddenCanvas"); let ctx = c.getContext("2d"); let hiddenImage = document.getElementById("hiddenImage"); let hiddenImage2 = document.getElementById("hiddenImage2"); var data = new FormData(); hiddenImage.src = image; let imageBlob = await new Promise((resolve) => c.toBlob(resolve, "image/png") ); data.set("query_image", imageBlob, "file2.png"); c.width = 180; c.height = 320; hiddenImage.src = referenceFaces[referenceFace]; setTimeout(() => {}, 100); ctx.drawImage(hiddenImage, 0, 0, 180, 320); let imageBlob1 = await new Promise((resolve) => c.toBlob(resolve, "image/png") ); data.set("target_image", imageBlob1, "file1.png"); data.set( "key", "662b2a0adeb3bbc7388bb274fc735c98648f0c70e6ebde9aebb9b56784f05d33" ); hiddenImage.src = URL.createObjectURL(imageBlob); return fetch("https://api.skylarklabs.ai/face-recognition/", { method: "POST", body: data, }) .then((response) => response.json()) .then((data) => { console.log(data); // temp[i].query = data.id; // setQueries(temp); return data.id; }); } console.log(queries); /** * Functions * * handleFileInput * handles input from file * sends cropped faces to database or reference array * * handleWebcamInput * handles input from webcam * sends cropped faces to databse or reference array * * addFacesToDatabase * adds faces to database * * addFacesToReference * adds faces to reference * * removeFaceFromDatabse * input: index (number) * removes face from database * * removeFaceFromReference * input: index (number) * removes face from reference */ async function processFaces() { let aspect_ratio = 16 / 9; var options = new faceapi.SsdMobilenetv1Options({ minConfidence: 0.4, }); //console.log(faces); let predictions = await faceapi.detectAllFaces("hiddenImage", options); let temp = []; for (var i = 0; i < predictions.length; i++) { let width = predictions[i].box._width; let height = predictions[i].box.height; let adjustmentx = 0; let adjustmenty = 0; if (width * aspect_ratio > height) { adjustmenty = width * aspect_ratio - height; } else if (height > width * aspect_ratio) { adjustmentx = height / aspect_ratio - width; } var canv = await faceapi.extractFaces("hiddenImage", [ new faceapi.Rect( predictions[i].box._x - adjustmentx / 2, predictions[i].box._y - adjustmenty / 2, predictions[i].box._width + adjustmentx, predictions[i].box._height + adjustmenty ), ]); predictions[i].url = canv[0].toDataURL(); temp.push(canv[0].toDataURL()); } return temp; } async function handleFileInput(addedImage, target) { setProcessing(true); document.getElementById("hiddenImage").src = addedImage; let newFaces = await processFaces(); if (target == "database") { setFaces([...faces, ...newFaces]); } else if (target == "reference") { setReferenceFaces([...referenceFaces, ...newFaces]); } setProcessing(false); } async function handleWebcamInput(addedImage) { setProcessing(true); document.getElementById("hiddenImage").src = addedImage; let newFaces = await processFaces(); if (progressStatus.inputTarget == "database") { setFaces([...faces, ...newFaces]); setProgressStatus({ ...progressStatus, inputResource: "", inputTarget: "", }); } else if (progressStatus.inputTarget == "reference") { setReferenceFaces([...referenceFaces, ...newFaces]); setProgressStatus({ ...progressStatus, inputResource: "", inputTarget: "", }); } setProcessing(false); } const removeFace = (index) => { var temp = []; for (var i = 0; i < faces.length; i++) { if (index != i) { temp.push(faces[i]); } else { URL.revokeObjectURL(faces[i]); } } setFaces(temp); }; const removeReferenceFace = (index) => { var temp = []; for (var i = 0; i < referenceFaces.length; i++) { if (index != i) { temp.push(referenceFaces[i]); } else { URL.revokeObjectURL(referenceFaces[i]); } } if (progressStatus.active_reference === index) { setProgressStatus({ ...progressStatus, active_reference: -1 }); } else if (progressStatus.active_reference > index) { setProgressStatus({ ...progressStatus, active_reference: progressStatus.active_reference - 1, }); } setReferenceFaces(temp); }; const closeWebcam = () => { console.log("yes"); if (progressStatus.inputResource === "camera") setProgressStatus({ ...progressStatus, inputResource: "", inputTarget: "", }); }; const startWebCam = (target) => { setProgressStatus({ ...progressStatus, inputResource: "camera", inputTarget: target, }); }; /** * prepares a grid for the target image (query) * */ async function prepareGridImage() { //prepares grid for query and sends request var c = document.getElementById("hiddenCanvas"); var hiddenImage = document.getElementById("hiddenImage2"); var ctx = c.getContext("2d"); //compute size of canvas var length_in_images = Math.ceil(Math.sqrt(faces.length)); var num_grids = 1; if (length_in_images > 12) { num_grids = Math.ceil(faces.length / 144); length_in_images = 12; } c.width = length_in_images * 90; c.height = length_in_images * 160; setImageDimensions([length_in_images * 90, length_in_images * 160]); let q = []; for (let i = 0; i < num_grids; i++) { ctx.fillStyle = "#ffffff"; ctx.fillRect(0, 0, length_in_images * 90, length_in_images * 160); for ( let j = 0; j < length_in_images * length_in_images && i * length_in_images + j < faces.length; j++ ) { let index = i * length_in_images * length_in_images + j; hiddenImage.src = faces[index]; ctx.drawImage( hiddenImage, (index % length_in_images) * 90, Math.floor(j / length_in_images) * 160, 90, 160 ); } var im = c.toDataURL(); await new Promise((resolve) => setTimeout(resolve, 1000)); let reqId = await postRequest(im); q.push({ img: im, query: reqId, result: false, index: i, }); } setQueries(q); } function reset() { setProgressStatus({ ...progressStatus, result: false }); setFoundFace(false); setQueries([]); } return ( <div className="App "> <div id="webcamBackdrop" className={ progressStatus.inputResource === "camera" ? "d-block" : "d-none" } style={{ width: window.innerWidth, height: window.innerHeight, }} > {progressStatus.inputResource === "camera" ? ( <WebcamComponent addImage={handleWebcamInput} closeWebcam={closeWebcam} processing={processing} /> ) : null} </div> <div id="navbar" className="shadow bg-dark text-light mb-2"> Face Recognition Demo </div> <div className="row mx-0 col-12"> <div id="databaseGridArea" className="row mx-0 bg-light px-0"> <div className={ "col-12 text-light " + (faces.length > 0 ? "bg-success " : "bg-secondary") } > Step 1: Create your database </div> <div className="col-12 px-0"> <FaceGrid result={progressStatus.result} images={faces} removeImage={removeFace} /> </div> {/* <Tips tips={[ { condition: faces.length == 0, text: "Faces can be added from a file or the database", }, { condition: faces.length == 1, text: "Database can have mutiple faces", }, ]} /> */} <div className="col-12 d-flex justify-content-center"> <UploadButtonGroup label="Import Faces" webcamFunction={() => startWebCam("database")} modelLoaded={modelLoaded} handleFileInput={(arg) => handleFileInput(arg, "database")} target="database" processing={processing} /> </div> </div> <div id="referenceArea" className="row mx-0 bg-light px-0"> <div className={ "col-12 text-light " + (referenceFaces.length > 0 ? "bg-success" : "bg-secondary") } > Step 2: Add a reference face </div> <ReferenceGrid result={progressStatus.result} images={referenceFaces} removeImage={removeReferenceFace} active={referenceFace} setActive={setReferenceFace} /> {/* <Tips tips={[ { condition: referenceFaces.length == 0, text: "Faces can be added from a file or the database", }, ]} /> */} <div className="col-12 d-flex justify-content-center pb-2"> <UploadButtonGroup label="Import Faces" webcamFunction={() => startWebCam("reference")} modelLoaded={modelLoaded} handleFileInput={(arg) => handleFileInput(arg, "reference")} target="reference" processing={processing} /> </div> </div> <div id="referenceEntryArea"></div> <div id="resultArea" className="row mx-0 bg-light px-0"> <div className={ "col-12 text-light " + (foundFace ? "bg-success" : "bg-secondary") } > Results </div> <Tips tips={[ { condition: !progressStatus.result, text: "Results will be displayed here", }, { condition: foundFace, text: "Found a Matching face, to run another query press the button below", }, { condition: !foundFace, text: "No face matched, try updating database or with better images", }, ]} /> <div className="row mx-0 col-12 bg-light"> <div className="col-4 d-flex mx-0 justify-content-center"> <ReferenceImage images={referenceFaces} index={referenceFace} label="Reference Image" que="Reference Image Will be displayed here" /> </div> <div className="col-4 d-flex justify-content-center align-items-center"> <ResultControls progressStatus={progressStatus} numFaces={faces.length} numReferences={referenceFaces.length} startQuery={() => { prepareGridImage(); }} foundFace={foundFace} inProgress={processing} reset={reset} /> {/* <button onClick={() => prepareGridImage()}>prepare</button> */} </div> <div className="col-4 d-flex mx-0 justify-content-center"> <FoundFace image={foundFace} label="Mached Image" que="Images Matched Will be displayed here" localDimensions={imageDimensions} faces={faces} /> </div> </div> </div> </div> <img id="hiddenImage" style={{ display: "none" }} src="" /> <img id="hiddenImage2" style={{ display: "none" }} src="" /> <canvas id="hiddenCanvas" style={{ display: "none" }} /> <canvas id="hiddenCanvas2" style={{ display: "none" }} /> </div> ); } export default App;
import Link from "next/link"; import React from "react"; function PostItemImg() { return ( <div className="card post-item"> <div className="card-header"> <div className="d-flex justify-content-between align-items-center"> <div className="d-flex justify-content-between align-items-center"> <div className="mr-2"> <img className="rounded-circle" width="45" src="/user.png" alt=""/> </div> <div className="ml-2 user-name"> <div className="name">Abraham Nwoke</div> <div className="time"><i className="fa fa-clock-o"></i>10 min ago </div> </div> </div> <div> <div className="dropdown"> <button className="btn btn-link dropdown-toggle" type="button" id="gedf-drop1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i className="fa fa-ellipsis-h"></i> </button> <div className="dropdown-menu dropdown-menu-right" aria-labelledby="gedf-drop1"> <div className="h6 dropdown-header">Configuration</div> <a className="dropdown-item" href="#">Save</a> <a className="dropdown-item" href="#">Hide</a> <a className="dropdown-item" href="#">Report</a> </div> </div> </div> </div> </div> <div className="card-body"> <div className="row"> <div className="col-lg-4 "> <div className="row post-imgs"> <div className="col-lg-6 col-xl-6 col-md-6 col-sm-6 col-6"> <img className="small-img" src="/img/6.png" alt=""/> </div> <div className="col-lg-6 col-xl-6 col-md-6 col-sm-6 col-6"> <img className="small-img" src="/img/dffd7.png" alt=""/> </div> <div className="col-lg-12"> <img className="large-img" src="/img/4ww.png" alt=""/> </div> <div className="col-lg-6 col-xl-6 col-md-6 col-sm-6 col-6"> <img className="small-img" src="/img/8.png" alt=""/> </div> <div className="col-lg-6 col-xl-6 col-md-6 col-sm-6 col-6"> <img className="small-img" src="/img/2.png" alt=""/> </div> </div> </div> <div className="col-lg-8"> <div className="body"> <p className="card-text"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo recusandae nulla rem eos ipsa praesentium esse magnam nemo dolor sequi fuga quia quaerat cum, obcaecati hic, molestias minima iste voluptates. </p> <button className="btn tag-btn ">Hello Button</button> </div> <div className="card-footer d-flex justify-content-between align-items-center"> <div className="actions"> <a href="#" className="card-link"><i className="fa fa-heart orange"></i> Like 100</a> <a href="#" className="card-link"><i className="fa fa-comment pink"></i> Comment</a> <a href="#" className="card-link"><i className="fa fa-share-alt blue"></i> Share</a> </div> <div className=""> <ul> <li><a href="#"><img src="/users/1.jpg" className="img-fluid rounded-circle" alt="User"/></a></li> <li><a href="#"><img src="/users/5.jpg" className="img-fluid rounded-circle" alt="User"/></a></li> <li><a href="#"><img src="/users/2.jpg" className="img-fluid rounded-circle" alt="User"/></a></li> </ul> </div> </div> </div> </div> </div> </div> ) } export default PostItemImg
import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import axios from 'axios'; import React, { useState, useEffect } from 'react'; function Edit (){ const dispatch = useDispatch(); const history = useHistory(); const [name, setName] = useState(''); //const editName = useSelector((store) => store.rootReducer.rename; /*function handleChange(event) { dispatch({ type: 'EDIT_ONCHANGE', payload: { property: 'name', value: event.target.value } }); } */ function handleSubmit(event, playlistId) { event.preventDefault(); // PUT REQUEST to /students/:id axios.put(`/spotify/${playlist.id}`) .then( response => { // refresh will happen with useEffect on Home history.push('/favorites'); // back to list }) .catch(error => { console.log('error on PUT: ', error); }) }; return ( <> <h2>Edit playlist name</h2> <form onSubmit={handleSubmit}> <input placeholder="Rename this playlist" onChange={(event) => {setName(event.target.value)}}></input> <input type='submit' value='Rename!' /> </form> </> ); } export default Edit;
var connect =require("connect"), serveStatic=require('serve-static'); var app=connect(); app.use(serveStatic("./sports")); app.listen(5000);