text
stringlengths
3
1.05M
"use strict"; var assert = require("assert"); var stringmap = require("stringmap"); var stringset = require("stringset"); var is = require("simple-is"); var fmt = require("simple-fmt"); var error = require("./error"); var options = require("./options"); function Scope(args) { assert(is.someof(args.kind, ["hoist", "block", "catch-block"])); assert(is.object(args.node)); assert(args.parent === null || is.object(args.parent)); // kind === "hoist": function scopes, program scope, injected globals // kind === "block": ES6 block scopes // kind === "catch-block": catch block scopes this.kind = args.kind; // the AST node the block corresponds to this.node = args.node; // parent scope this.parent = args.parent; // children scopes for easier traversal (populated internally) this.children = []; // scope declarations. decls[variable_name] = { // kind: "fun" for functions, // "param" for function parameters, // "caught" for catch parameter // "var", // "const", // "let" // node: the AST node the declaration corresponds to // from: source code index from which it is visible at earliest // (only stored for "const", "let" [and "var"] nodes) // } this.decls = stringmap(); // names of all declarations within this scope that was ever written // TODO move to decls.w? // TODO create corresponding read? this.written = stringset(); // names of all variables declared outside this hoist scope but // referenced in this scope (immediately or in child). // only stored on hoist scopes for efficiency // (because we currently generate lots of empty block scopes) this.propagates = (this.kind === "hoist" ? stringset() : null); // scopes register themselves with their parents for easier traversal if (this.parent) { this.parent.children.push(this); } } Scope.prototype.print = function(indent) { indent = indent || 0; var scope = this; var names = this.decls.keys().map(function(name) { return fmt("{0} [{1}]", name, scope.decls.get(name).kind); }).join(", "); var propagates = this.propagates ? this.propagates.items().join(", ") : ""; console.log(fmt("{0}{1}: {2}. propagates: {3}", fmt.repeat(" ", indent), this.node.type, names, propagates)); this.children.forEach(function(c) { c.print(indent + 2); }); }; Scope.prototype.add = function(name, kind, node, referableFromPos) { assert(is.someof(kind, ["fun", "param", "var", "caught", "const", "let"])); function isConstLet(kind) { return is.someof(kind, ["const", "let"]); } var scope = this; // search nearest hoist-scope for fun, param and var's // const, let and caught variables go directly in the scope (which may be hoist, block or catch-block) if (is.someof(kind, ["fun", "param", "var"])) { while (scope.kind !== "hoist") { if (scope.decls.has(name) && isConstLet(scope.decls.get(name).kind)) { // could be caught return error(node.loc.start.line, "{0} is already declared", name); } scope = scope.parent; } } // name exists in scope and either new or existing kind is const|let => error if (scope.decls.has(name) && (options.disallowDuplicated || isConstLet(scope.decls.get(name).kind) || isConstLet(kind))) { return error(node.loc.start.line, "{0} is already declared", name); } var declaration = { kind: kind, node: node, }; if (referableFromPos) { assert(is.someof(kind, ["var", "const", "let"])); declaration.from = referableFromPos; } scope.decls.set(name, declaration); }; Scope.prototype.getKind = function(name) { assert(is.string(name)); var decl = this.decls.get(name); return decl ? decl.kind : null; }; Scope.prototype.getNode = function(name) { assert(is.string(name)); var decl = this.decls.get(name); return decl ? decl.node : null; }; Scope.prototype.getFromPos = function(name) { assert(is.string(name)); var decl = this.decls.get(name); return decl ? decl.from : null; }; Scope.prototype.hasOwn = function(name) { return this.decls.has(name); }; Scope.prototype.remove = function(name) { return this.decls.remove(name); }; Scope.prototype.doesPropagate = function(name) { return this.propagates.has(name); }; Scope.prototype.markPropagates = function(name) { this.propagates.add(name); }; Scope.prototype.closestHoistScope = function() { var scope = this; while (scope.kind !== "hoist") { scope = scope.parent; } return scope; }; Scope.prototype.hasFunctionScopeBetween = function(outer) { function isFunction(node) { return is.someof(node.type, ["FunctionDeclaration", "FunctionExpression"]); } for (var scope = this; scope; scope = scope.parent) { if (scope === outer) { return false; } if (isFunction(scope.node)) { return true; } } throw new Error("wasn't inner scope of outer"); }; Scope.prototype.lookup = function(name) { for (var scope = this; scope; scope = scope.parent) { if (scope.decls.has(name)) { return scope; } else if (scope.kind === "hoist") { scope.propagates.add(name); } } return null; }; Scope.prototype.markWrite = function(name) { assert(is.string(name)); this.written.add(name); }; // detects let variables that are never modified (ignores top-level) Scope.prototype.detectUnmodifiedLets = function() { var outmost = this; function detect(scope) { if (scope !== outmost) { scope.decls.keys().forEach(function(name) { if (scope.getKind(name) === "let" && !scope.written.has(name)) { return error(scope.getNode(name).loc.start.line, "{0} is declared as let but never modified so could be const", name); } }); } scope.children.forEach(function(childScope) { detect(childScope);; }); } detect(this); }; Scope.prototype.traverse = function(options) { options = options || {}; var pre = options.pre; var post = options.post; function visit(scope) { if (pre) { pre(scope); } scope.children.forEach(function(childScope) { visit(childScope); }); if (post) { post(scope); } } visit(this); }; module.exports = Scope;
const fas = 'ad,address-book,address-card,adjust,air-freshener,align-center,align-justify,align-left,align-right,allergies,ambulance,american-sign-language-interpreting,anchor,angle-double-down,angle-double-left,angle-double-right,angle-double-up,angle-down,angle-left,angle-right,angle-up,angry,ankh,apple-alt,archive,archway,arrow-alt-circle-down,arrow-alt-circle-left,arrow-alt-circle-right,arrow-alt-circle-up,arrow-circle-down,arrow-circle-left,arrow-circle-right,arrow-circle-up,arrow-down,arrow-left,arrow-right,arrow-up,arrows-alt,arrows-alt-h,arrows-alt-v,assistive-listening-systems,asterisk,at,atlas,atom,audio-description,award,baby,baby-carriage,backspace,backward,bacon,bahai,balance-scale,balance-scale-left,balance-scale-right,ban,band-aid,barcode,bars,baseball-ball,basketball-ball,bath,battery-empty,battery-full,battery-half,battery-quarter,battery-three-quarters,bed,beer,bell,bell-slash,bezier-curve,bible,bicycle,biking,binoculars,biohazard,birthday-cake,blender,blender-phone,blind,blog,bold,bolt,bomb,bone,bong,book,book-dead,book-medical,book-open,book-reader,bookmark,border-all,border-none,border-style,bowling-ball,box,box-open,box-tissue,boxes,braille,brain,bread-slice,briefcase,briefcase-medical,broadcast-tower,broom,brush,bug,building,bullhorn,bullseye,burn,bus,bus-alt,business-time,calculator,calendar,calendar-alt,calendar-check,calendar-day,calendar-minus,calendar-plus,calendar-times,calendar-week,camera,camera-retro,campground,candy-cane,cannabis,capsules,car,car-alt,car-battery,car-crash,car-side,caravan,caret-down,caret-left,caret-right,caret-square-down,caret-square-left,caret-square-right,caret-square-up,caret-up,carrot,cart-arrow-down,cart-plus,cash-register,cat,certificate,chair,chalkboard,chalkboard-teacher,charging-station,chart-area,chart-bar,chart-line,chart-pie,check,check-circle,check-double,check-square,cheese,chess,chess-bishop,chess-board,chess-king,chess-knight,chess-pawn,chess-queen,chess-rook,chevron-circle-down,chevron-circle-left,chevron-circle-right,chevron-circle-up,chevron-down,chevron-left,chevron-right,chevron-up,child,church,circle,circle-notch,city,clinic-medical,clipboard,clipboard-check,clipboard-list,clock,clone,closed-captioning,cloud,cloud-download-alt,cloud-meatball,cloud-moon,cloud-moon-rain,cloud-rain,cloud-showers-heavy,cloud-sun,cloud-sun-rain,cloud-upload-alt,cocktail,code,code-branch,coffee,cog,cogs,coins,columns,comment,comment-alt,comment-dollar,comment-dots,comment-medical,comment-slash,comments,comments-dollar,compact-disc,compass,compress,compress-alt,compress-arrows-alt,concierge-bell,cookie,cookie-bite,copy,copyright,couch,credit-card,crop,crop-alt,cross,crosshairs,crow,crown,crutch,cube,cubes,cut,database,deaf,democrat,desktop,dharmachakra,diagnoses,dice,dice-d20,dice-d6,dice-five,dice-four,dice-one,dice-six,dice-three,dice-two,digital-tachograph,directions,disease,divide,dizzy,dna,dog,dollar-sign,dolly,dolly-flatbed,donate,door-closed,door-open,dot-circle,dove,download,drafting-compass,dragon,draw-polygon,drum,drum-steelpan,drumstick-bite,dumbbell,dumpster,dumpster-fire,dungeon,edit,egg,eject,ellipsis-h,ellipsis-v,envelope,envelope-open,envelope-open-text,envelope-square,equals,eraser,ethernet,euro-sign,exchange-alt,exclamation,exclamation-circle,exclamation-triangle,expand,expand-alt,expand-arrows-alt,external-link-alt,external-link-square-alt,eye,eye-dropper,eye-slash,fan,fast-backward,fast-forward,faucet,fax,feather,feather-alt,female,fighter-jet,file,file-alt,file-archive,file-audio,file-code,file-contract,file-csv,file-download,file-excel,file-export,file-image,file-import,file-invoice,file-invoice-dollar,file-medical,file-medical-alt,file-pdf,file-powerpoint,file-prescription,file-signature,file-upload,file-video,file-word,fill,fill-drip,film,filter,fingerprint,fire,fire-alt,fire-extinguisher,first-aid,fish,fist-raised,flag,flag-checkered,flag-usa,flask,flushed,folder,folder-minus,folder-open,folder-plus,font,football-ball,forward,frog,frown,frown-open,funnel-dollar,futbol,gamepad,gas-pump,gavel,gem,genderless,ghost,gift,gifts,glass-cheers,glass-martini,glass-martini-alt,glass-whiskey,glasses,globe,globe-africa,globe-americas,globe-asia,globe-europe,golf-ball,gopuram,graduation-cap,greater-than,greater-than-equal,grimace,grin,grin-alt,grin-beam,grin-beam-sweat,grin-hearts,grin-squint,grin-squint-tears,grin-stars,grin-tears,grin-tongue,grin-tongue-squint,grin-tongue-wink,grin-wink,grip-horizontal,grip-lines,grip-lines-vertical,grip-vertical,guitar,h-square,hamburger,hammer,hamsa,hand-holding,hand-holding-heart,hand-holding-medical,hand-holding-usd,hand-holding-water,hand-lizard,hand-middle-finger,hand-paper,hand-peace,hand-point-down,hand-point-left,hand-point-right,hand-point-up,hand-pointer,hand-rock,hand-scissors,hand-sparkles,hand-spock,hands,hands-helping,hands-wash,handshake,handshake-alt-slash,handshake-slash,hanukiah,hard-hat,hashtag,hat-cowboy,hat-cowboy-side,hat-wizard,hdd,head-side-cough,head-side-cough-slash,head-side-mask,head-side-virus,heading,headphones,headphones-alt,headset,heart,heart-broken,heartbeat,helicopter,highlighter,hiking,hippo,history,hockey-puck,holly-berry,home,horse,horse-head,hospital,hospital-alt,hospital-symbol,hospital-user,hot-tub,hotdog,hotel,hourglass,hourglass-end,hourglass-half,hourglass-start,house-damage,house-user,hryvnia,i-cursor,ice-cream,icicles,icons,id-badge,id-card,id-card-alt,igloo,image,images,inbox,indent,industry,infinity,info,info-circle,italic,jedi,joint,journal-whills,kaaba,key,keyboard,khanda,kiss,kiss-beam,kiss-wink-heart,kiwi-bird,landmark,language,laptop,laptop-code,laptop-house,laptop-medical,laugh,laugh-beam,laugh-squint,laugh-wink,layer-group,leaf,lemon,less-than,less-than-equal,level-down-alt,level-up-alt,life-ring,lightbulb,link,lira-sign,list,list-alt,list-ol,list-ul,location-arrow,lock,lock-open,long-arrow-alt-down,long-arrow-alt-left,long-arrow-alt-right,long-arrow-alt-up,low-vision,luggage-cart,lungs,lungs-virus,magic,magnet,mail-bulk,male,map,map-marked,map-marked-alt,map-marker,map-marker-alt,map-pin,map-signs,marker,mars,mars-double,mars-stroke,mars-stroke-h,mars-stroke-v,mask,medal,medkit,meh,meh-blank,meh-rolling-eyes,memory,menorah,mercury,meteor,microchip,microphone,microphone-alt,microphone-alt-slash,microphone-slash,microscope,minus,minus-circle,minus-square,mitten,mobile,mobile-alt,money-bill,money-bill-alt,money-bill-wave,money-bill-wave-alt,money-check,money-check-alt,monument,moon,mortar-pestle,mosque,motorcycle,mountain,mouse,mouse-pointer,mug-hot,music,network-wired,neuter,newspaper,not-equal,notes-medical,object-group,object-ungroup,oil-can,om,otter,outdent,pager,paint-brush,paint-roller,palette,pallet,paper-plane,paperclip,parachute-box,paragraph,parking,passport,pastafarianism,paste,pause,pause-circle,paw,peace,pen,pen-alt,pen-fancy,pen-nib,pen-square,pencil-alt,pencil-ruler,people-arrows,people-carry,pepper-hot,percent,percentage,person-booth,phone,phone-alt,phone-slash,phone-square,phone-square-alt,phone-volume,photo-video,piggy-bank,pills,pizza-slice,place-of-worship,plane,plane-arrival,plane-departure,plane-slash,play,play-circle,plug,plus,plus-circle,plus-square,podcast,poll,poll-h,poo,poo-storm,poop,portrait,pound-sign,power-off,pray,praying-hands,prescription,prescription-bottle,prescription-bottle-alt,print,procedures,project-diagram,pump-medical,pump-soap,puzzle-piece,qrcode,question,question-circle,quidditch,quote-left,quote-right,quran,radiation,radiation-alt,rainbow,random,receipt,record-vinyl,recycle,redo,redo-alt,registered,remove-format,reply,reply-all,republican,restroom,retweet,ribbon,ring,road,robot,rocket,route,rss,rss-square,ruble-sign,ruler,ruler-combined,ruler-horizontal,ruler-vertical,running,rupee-sign,sad-cry,sad-tear,satellite,satellite-dish,save,school,screwdriver,scroll,sd-card,search,search-dollar,search-location,search-minus,search-plus,seedling,server,shapes,share,share-alt,share-alt-square,share-square,shekel-sign,shield-alt,shield-virus,ship,shipping-fast,shoe-prints,shopping-bag,shopping-basket,shopping-cart,shower,shuttle-van,sign,sign-in-alt,sign-language,sign-out-alt,signal,signature,sim-card,sitemap,skating,skiing,skiing-nordic,skull,skull-crossbones,slash,sleigh,sliders-h,smile,smile-beam,smile-wink,smog,smoking,smoking-ban,sms,snowboarding,snowflake,snowman,snowplow,soap,socks,solar-panel,sort,sort-alpha-down,sort-alpha-down-alt,sort-alpha-up,sort-alpha-up-alt,sort-amount-down,sort-amount-down-alt,sort-amount-up,sort-amount-up-alt,sort-down,sort-numeric-down,sort-numeric-down-alt,sort-numeric-up,sort-numeric-up-alt,sort-up,spa,space-shuttle,spell-check,spider,spinner,splotch,spray-can,square,square-full,square-root-alt,stamp,star,star-and-crescent,star-half,star-half-alt,star-of-david,star-of-life,step-backward,step-forward,stethoscope,sticky-note,stop,stop-circle,stopwatch,stopwatch-20,store,store-alt,store-alt-slash,store-slash,stream,street-view,strikethrough,stroopwafel,subscript,subway,suitcase,suitcase-rolling,sun,superscript,surprise,swatchbook,swimmer,swimming-pool,synagogue,sync,sync-alt,syringe,table,table-tennis,tablet,tablet-alt,tablets,tachometer-alt,tag,tags,tape,tasks,taxi,teeth,teeth-open,temperature-high,temperature-low,tenge,terminal,text-height,text-width,th,th-large,th-list,theater-masks,thermometer,thermometer-empty,thermometer-full,thermometer-half,thermometer-quarter,thermometer-three-quarters,thumbs-down,thumbs-up,thumbtack,ticket-alt,times,times-circle,tint,tint-slash,tired,toggle-off,toggle-on,toilet,toilet-paper,toilet-paper-slash,toolbox,tools,tooth,torah,torii-gate,tractor,trademark,traffic-light,trailer,train,tram,transgender,transgender-alt,trash,trash-alt,trash-restore,trash-restore-alt,tree,trophy,truck,truck-loading,truck-monster,truck-moving,truck-pickup,tshirt,tty,tv,umbrella,umbrella-beach,underline,undo,undo-alt,universal-access,university,unlink,unlock,unlock-alt,upload,user,user-alt,user-alt-slash,user-astronaut,user-check,user-circle,user-clock,user-cog,user-edit,user-friends,user-graduate,user-injured,user-lock,user-md,user-minus,user-ninja,user-nurse,user-plus,user-secret,user-shield,user-slash,user-tag,user-tie,user-times,users,users-cog,utensil-spoon,utensils,vector-square,venus,venus-double,venus-mars,vial,vials,video,video-slash,vihara,virus,virus-slash,viruses,voicemail,volleyball-ball,volume-down,volume-mute,volume-off,volume-up,vote-yea,vr-cardboard,walking,wallet,warehouse,water,wave-square,weight,weight-hanging,wheelchair,wifi,wind,window-close,window-maximize,window-minimize,window-restore,wine-bottle,wine-glass,wine-glass-alt,won-sign,wrench,x-ray,yen-sign,yin-yang' const far = 'address-book,address-card,angry,arrow-alt-circle-down,arrow-alt-circle-left,arrow-alt-circle-right,arrow-alt-circle-up,bell,bell-slash,bookmark,building,calendar,calendar-alt,calendar-check,calendar-minus,calendar-plus,calendar-times,caret-square-down,caret-square-left,caret-square-right,caret-square-up,chart-bar,check-circle,check-square,circle,clipboard,clock,clone,closed-captioning,comment,comment-alt,comment-dots,comments,compass,copy,copyright,credit-card,dizzy,dot-circle,edit,envelope,envelope-open,eye,eye-slash,file,file-alt,file-archive,file-audio,file-code,file-excel,file-image,file-pdf,file-powerpoint,file-video,file-word,flag,flushed,folder,folder-open,frown,frown-open,futbol,gem,grimace,grin,grin-alt,grin-beam,grin-beam-sweat,grin-hearts,grin-squint,grin-squint-tears,grin-stars,grin-tears,grin-tongue,grin-tongue-squint,grin-tongue-wink,grin-wink,hand-lizard,hand-paper,hand-peace,hand-point-down,hand-point-left,hand-point-right,hand-point-up,hand-pointer,hand-rock,hand-scissors,hand-spock,handshake,hdd,heart,hospital,hourglass,id-badge,id-card,image,images,keyboard,kiss,kiss-beam,kiss-wink-heart,laugh,laugh-beam,laugh-squint,laugh-wink,lemon,life-ring,lightbulb,list-alt,map,meh,meh-blank,meh-rolling-eyes,minus-square,money-bill-alt,moon,newspaper,object-group,object-ungroup,paper-plane,pause-circle,play-circle,plus-square,question-circle,registered,sad-cry,sad-tear,save,share-square,smile,smile-beam,smile-wink,snowflake,square,star,star-half,sticky-note,stop-circle,sun,surprise,thumbs-down,thumbs-up,times-circle,tired,trash-alt,user,user-circle,window-close,window-maximize,window-minimize,window-restore' const fab = '500px,accessible-icon,accusoft,acquisitions-incorporated,adn,adobe,adversal,affiliatetheme,airbnb,algolia,alipay,amazon,amazon-pay,amilia,android,angellist,angrycreative,angular,app-store,app-store-ios,apper,apple,apple-pay,artstation,asymmetrik,atlassian,audible,autoprefixer,avianex,aviato,aws,bandcamp,battle-net,behance,behance-square,bimobject,bitbucket,bitcoin,bity,black-tie,blackberry,blogger,blogger-b,bluetooth,bluetooth-b,bootstrap,btc,buffer,buromobelexperte,buy-n-large,canadian-maple-leaf,cc-amazon-pay,cc-amex,cc-apple-pay,cc-diners-club,cc-discover,cc-jcb,cc-mastercard,cc-paypal,cc-stripe,cc-visa,centercode,centos,chrome,chromecast,cloudscale,cloudsmith,cloudversify,codepen,codiepie,confluence,connectdevelop,contao,cotton-bureau,cpanel,creative-commons,creative-commons-by,creative-commons-nc,creative-commons-nc-eu,creative-commons-nc-jp,creative-commons-nd,creative-commons-pd,creative-commons-pd-alt,creative-commons-remix,creative-commons-sa,creative-commons-sampling,creative-commons-sampling-plus,creative-commons-share,creative-commons-zero,critical-role,css3,css3-alt,cuttlefish,d-and-d,d-and-d-beyond,dailymotion,dashcube,delicious,deploydog,deskpro,dev,deviantart,dhl,diaspora,digg,digital-ocean,discord,discourse,dochub,docker,draft2digital,dribbble,dribbble-square,dropbox,drupal,dyalog,earlybirds,ebay,edge,elementor,ello,ember,empire,envira,erlang,ethereum,etsy,evernote,expeditedssl,facebook,facebook-f,facebook-messenger,facebook-square,fantasy-flight-games,fedex,fedora,figma,firefox,firefox-browser,first-order,first-order-alt,firstdraft,flickr,flipboard,fly,font-awesome,font-awesome-alt,font-awesome-flag,fonticons,fonticons-fi,fort-awesome,fort-awesome-alt,forumbee,foursquare,free-code-camp,freebsd,fulcrum,galactic-republic,galactic-senate,get-pocket,gg,gg-circle,git,git-alt,git-square,github,github-alt,github-square,gitkraken,gitlab,gitter,glide,glide-g,gofore,goodreads,goodreads-g,google,google-drive,google-play,google-plus,google-plus-g,google-plus-square,google-wallet,gratipay,grav,gripfire,grunt,gulp,hacker-news,hacker-news-square,hackerrank,hips,hire-a-helper,hooli,hornbill,hotjar,houzz,html5,hubspot,ideal,imdb,instagram,instagram-square,intercom,internet-explorer,invision,ioxhost,itch-io,itunes,itunes-note,java,jedi-order,jenkins,jira,joget,joomla,js,js-square,jsfiddle,kaggle,keybase,keycdn,kickstarter,kickstarter-k,korvue,laravel,lastfm,lastfm-square,leanpub,less,line,linkedin,linkedin-in,linode,linux,lyft,magento,mailchimp,mandalorian,markdown,mastodon,maxcdn,mdb,medapps,medium,medium-m,medrt,meetup,megaport,mendeley,microblog,microsoft,mix,mixcloud,mixer,mizuni,modx,monero,napster,neos,nimblr,node,node-js,npm,ns8,nutritionix,odnoklassniki,odnoklassniki-square,old-republic,opencart,openid,opera,optin-monster,orcid,osi,page4,pagelines,palfed,patreon,paypal,penny-arcade,periscope,phabricator,phoenix-framework,phoenix-squadron,php,pied-piper,pied-piper-alt,pied-piper-hat,pied-piper-pp,pied-piper-square,pinterest,pinterest-p,pinterest-square,playstation,product-hunt,pushed,python,qq,quinscape,quora,r-project,raspberry-pi,ravelry,react,reacteurope,readme,rebel,red-river,reddit,reddit-alien,reddit-square,redhat,renren,replyd,researchgate,resolving,rev,rocketchat,rockrms,safari,salesforce,sass,schlix,scribd,searchengin,sellcast,sellsy,servicestack,shirtsinbulk,shopify,shopware,simplybuilt,sistrix,sith,sketch,skyatlas,skype,slack,slack-hash,slideshare,snapchat,snapchat-ghost,snapchat-square,soundcloud,sourcetree,speakap,speaker-deck,spotify,squarespace,stack-exchange,stack-overflow,stackpath,staylinked,steam,steam-square,steam-symbol,sticker-mule,strava,stripe,stripe-s,studiovinari,stumbleupon,stumbleupon-circle,superpowers,supple,suse,swift,symfony,teamspeak,telegram,telegram-plane,tencent-weibo,the-red-yeti,themeco,themeisle,think-peaks,trade-federation,trello,tripadvisor,tumblr,tumblr-square,twitch,twitter,twitter-square,typo3,uber,ubuntu,uikit,umbraco,uniregistry,unity,untappd,ups,usb,usps,ussunnah,vaadin,viacoin,viadeo,viadeo-square,viber,vimeo,vimeo-square,vimeo-v,vine,vk,vnv,vuejs,waze,weebly,weibo,weixin,whatsapp,whatsapp-square,whmcs,wikipedia-w,windows,wix,wizards-of-the-coast,wolf-pack-battalion,wordpress,wordpress-simple,wpbeginner,wpexplorer,wpforms,wpressr,xbox,xing,xing-square,y-combinator,yahoo,yammer,yandex,yandex-international,yarn,yelp,yoast,youtube,youtube-square,zhihu' export default { fas: fas.split(','), far: far.split(','), fab: fab.split(',') }
import React, { useState, useEffect } from "react"; import { useHistory, useParams } from "react-router-dom"; import { createTimesheet, getTimesheet, updateTimesheet, } from "../../axios/timesheetServices"; import { useGlobalState } from "../../utils/stateContext"; import "./NewTimesheetElements.css"; // create new timesheet form export default function NewTimesheet() { // sets the initial state of the form when the add timesheet page is first loaded const initialFormState = { name: "", date: "", start_time: "", end_time: "", total_hours: "", comments: "", }; // calls use state (which returns an array with 2 elements [first is list of the formState that is set above, and the 2nd is a function) const [formState, setFormState] = useState(initialFormState); // useGlobalState gives us the value of stateContext in '../../utils/stateContext.js' // dispatch pass's the reducer action. const { store, dispatch } = useGlobalState(); const { loggedInUser } = store; let history = useHistory(); let { id } = useParams(); useEffect(() => { if (id) { getTimesheet(id).then((timesheet) => { console.log(timesheet); setFormState({ name: timesheet.name, date: timesheet.date, start_time: timesheet.start_time, end_time: timesheet.end_time, total_hours: timesheet.total_hours, comments: timesheet.comments, processed: timesheet.processed, }); }); } }, [id]); function handleChange(e) { setFormState({ // update whats currently in our form data state ...formState, [e.target.name]: e.target.value, }); // key/value pair: target name key for target value // if the checkbox called processed value is changed if (e.target.name === "processed") { if (formState.processed == false) { setFormState(Object.assign({}, formState, { processed: true })); // if the formState of the boolean was false, assign a true value to that boolean } else { setFormState(Object.assign({}, formState, { processed: false })); // and vice-verca } } else { setFormState( Object.assign({}, formState, { [e.target.name]: e.target.value }) ); } console.log(e.target.value); } // When the user clicks the submit button a put request is sent to the server to update the timesheet with the correct id function handleClick(e) { e.preventDefault(); if (id) { updateTimesheet({ id: id, ...formState }) // updateTimesheet is the request to the server found in '../../axios/timesheetServices' if a timesheet id is found .then(() => { dispatch({ type: "updateTimesheet", data: { id: id, ...formState } }); // "updateTimesheet" is the reducer case statement found in '../../utils/stateReducer' history.push(`/portal/${id}`); console.log(formState); }) .catch((err) => { setFormState({ errorMessage: err.message }); }); } else { createTimesheet({ ...formState }) .then((timesheet) => { dispatch({ type: "addTimesheet", data: timesheet }); // "addTimesheet" is the request to the server found in '../../axios/timesheetServices' if a timesheet id ISN'T found history.push("/portal"); }) .catch((err) => { setFormState( Object.assign({}, formState, { errorMessage: err.message }) // attach the jsx error below to the form if incorrect details are received. Object.assign and formState keeps the correct fields populated ); }); } } return ( <> <div className="formContainer"> <h3 className="formHeader">New Timesheet</h3> <form> <div className="contact-form"> <div className="input-fields"> <input type="text" name="name" value={formState.name} onChange={handleChange} // updates the state when the field gets updated by the user className="input" placeholder="Your Name" required /> <input type="date" name="date" value={formState.date} onChange={handleChange} className="input" required /> <input type="text" name="start_time" value={formState.start_time} onChange={handleChange} className="input" placeholder="Enter Start Time" /> <input type="text" name="end_time" value={formState.end_time} onChange={handleChange} className="input" placeholder="Enter End Time" /> <input type="integer" name="total_hours" value={formState.total_hours} onChange={handleChange} className="input" placeholder="Enter Total Hours" /> </div> </div> <div className="msg"> <textarea placeholder="Enter any comments here..." name="comments" value={formState.comments} onChange={handleChange} cols="3" /> </div> <div className="labelContainer"> {loggedInUser === "Xinyu" && ( <div> <label className="labelText">Processed</label> <input type="checkbox" name="processed" value={!formState.processed} onChange={handleChange} className="input" id="processed" ></input> </div> )} </div> <div className="buttonContainer"> <input type="submit" onClick={handleClick} value={id ? "Update" : "Create"} className="btn" id="btn" /> </div> <div className="buttonContainer"> <input type="submit" onClick={() => history.push(`/portal`)} value="Back" className="btn" id="btn" /> </div> <br /> {/* attach the jsx error below to the form if incorrect details are received. Object.assign and formState keeps the correct fields populated */} {formState.errorMessage && ( <p className="error" style={{ color: "white" }}> {" "} {"Oops! Please check your details and try again"}{" "} </p> )} </form> </div> </> ); }
define({ _action_query_label: 'Interogare după extindere', listSource: 'Sursă listă', maxItems: 'Număr maxim de elemente', itemPerPage: 'Elemente per pagină', selectMode: 'Selectați modul', verticalAlignment: 'Aliniere verticală', horizontalAlignment: 'Aliniere orizontală', verticalSpacing: 'Spațiere verticală', horizontalSpacing: 'Spațiere orizontală', differentOddEvenItems: 'Diferite elemente pare și impare', mouseOverStyle: 'Stil de trecere cu mouse-ul', selectedStyle: 'Stil selectat', pagingStyle: 'Stil de paginație', scroll: 'Derulare', multiPage: 'Mai multe pagini', pageTransition: 'Tranziție pagină', off: 'Inactiv', on: 'Activ', start: 'Începere', chooseTemplateTip: 'Selectați un șablon', listUseGuide: 'Pentru a personaliza designul listei, modificați configurația widgeturilor din primul element de listă prin deplasarea pozițiilor widgeturilor implicite și glisați și fixați noile widgeturi din panoul Inserați un widget. După ce sunt selectate datele listei, widgeturile din primul element vor prelua aceleași date și va trebui să configurați individual tema pentru a popula textul sau imaginea.', customListDesign: 'sau personalizați-vă designul listei', resettingTheTemplate: 'Selectați un alt șablon ', emptyTemplate: 'Șablon gol', waitingForDatasource: 'Se așteaptă sursa de date', zeroHint: 'Zero este infinit', selectSortFields: 'Selectați câmpuri de sortare', sortSelected: '{selectedCount} elemente selectate', chooseSearchingFields: 'Selectați câmpuri de căutare', selectSearchFields: 'Selectați câmpuri de căutare', searchSelected: '{selectedCount} elemente selectate', exactMatch: 'Potrivire exactă', scrollBar: 'Bară de derulare', navigator: 'Navigator', itemHeight: 'Înălțimea elementului', itemWidth: 'Lățimea elementului', lockItemRatio: 'Blocare raport lățime/înălțime', listStep: 'Etapă', listShowSelectedOnly: 'Afișare selectate', enableStatus: 'Activare {status}', itemStyle: 'Stil de element', outputDsLabel: '{label} obiecte spațiale încărcate', setFilters: 'Setare filtre', arrangement: 'Aranjament', clearSelected: 'Ștergere obiecte selectate', listAnimation: 'Animaţie', listTransition: 'Tranziţie', // action setting triggerLayer: 'Date despre declanșator', actionLayer: 'Date despre acțiune', conditions: 'Condiții', relateMessage: 'Conexiune acțiune/declanșator', autoBind: 'Legătură automată', triggerLayerField: 'Selectați un câmp declanșator', equals: 'Este egal cu', actionLayerField: 'Selectați un câmp de acțiune', moreConditions: 'Mai multe condiții', queryWithCurrentExtent: 'Interogare după extinderea actuală', setExprTip: 'Mai întâi, setați expresiile', setLayer: 'Selectare date', noLayer: 'Nu există date', //template textPlaceholder: 'Faceți dublu clic pentru a edita textul', buttonText: 'Buton', contentTextPlaceholder: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod', searctHint: 'Sugestie' });
/** * Created by Pawan on 5/24/2017. */ /** * Created by Veery Team on 9/8/2016. */ agentApp.factory("templateService", function ($http, baseUrls, authService) { var getMyChatTemplates = function () { return $http({ method: 'get', url: baseUrls.templateUrl + "TemplateService/MyChatTemplates" }).then(function (response) { if (response.data && response.data.IsSuccess) { return response.data.Result; } else { return undefined; } }); }; var getAvailableChatTemplates = function () { return $http({ method: 'get', url: baseUrls.templateUrl + "TemplateService/AvailableChatTemplates" }).then(function (response) { if (response.data && response.data.IsSuccess) { return response.data.Result; } else { return undefined; } }); }; var addNewChatTemplate = function (saveValues) { return $http({ method: 'POST', url: baseUrls.templateUrl + "TemplateService/ChatTemplate", data: JSON.stringify(saveValues) }).then(function (response) { if (response.data && response.data.IsSuccess) { return response.data.Result; } else { return undefined; } }); }; var RemoveChatTemplate = function (tempID) { return $http({ method: 'DELETE', url: baseUrls.templateUrl + "TemplateService/ChatTemplate/"+tempID }).then(function (response) { if (response.data && response.data.IsSuccess) { return response.data.Result; } else { return undefined; } }); }; var getTemplatesByType = function () { return $http({ method: 'get', url: baseUrls.templateUrl + "/RenderService/TemplateByType/text" }).then(function (response) { if (response.data && response.data.IsSuccess) { return response.data.Result; } else { return undefined; } }); } return { getMyChatTemplates: getMyChatTemplates, addNewChatTemplate: addNewChatTemplate, RemoveChatTemplate: RemoveChatTemplate, getAvailableChatTemplates: getAvailableChatTemplates, getTemplatesByType: getTemplatesByType } });
#!/usr/bin/python3 # -*- coding: utf-8 -*- from .permission_resolver import main if __name__ == "__main__": main()
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 14 14:02:28 2021 @author: wil9fd @organisation: CSIRO @detail: Take bathymetry geotiffs and output hillshade and optimised geotiffs @version: 1.0 @changes: N/A @todo: Improve speed """ import os # Prompt for entering voyage name VOYAGE_ID = input('\nPLEASE ENTER THE VOYAGE ID:\n').lower() ROOT = "/datasets/work/ncmi-gsm/reference/AusSeabed/" os.mkdir(ROOT + VOYAGE_ID) for folders in ["ASCII","Backscatter","BAG","Caris CSAR data","FP Geotiff","Metadata","Shapefile"]: os.mkdir(ROOT + VOYAGE_ID + "/" + folders)
/* * * Backpack - Skyscanner's Design System * * Copyright 2018 Skyscanner Ltd * * 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. * */ export const autosuggestListBackgroundColor = "rgb(255, 255, 255)"; export const autosuggestListItemActiveBackgroundColor = "rgb(230, 228, 235)"; export const autosuggestListItemHighlightedBackgroundColor = "rgb(243, 242, 245)"; export const badgeBackgroundColor = "rgb(255, 187, 0)"; export const badgeCenteredVerticalAlign = "text-bottom"; export const badgePaddingX = ".375rem"; export const badgePaddingY = "0"; export const bannerAlertBackgroundColor = "rgb(255, 255, 255)"; export const bannerAlertChildrenColor = "rgb(129, 123, 143)"; export const bannerAlertChildrenPaddingX = ".75rem"; export const bannerAlertChildrenPaddingY = ".375rem"; export const bannerAlertErrorColor = "rgb(255, 84, 82)"; export const bannerAlertExpandIconFill = "rgb(82, 76, 97)"; export const bannerAlertHeaderExpandableActiveBackgroundColor = "rgb(230, 228, 235)"; export const bannerAlertHeaderExpandableHoverBackgroundColor = "rgb(243, 242, 245)"; export const bannerAlertHeaderPaddingX = ".75rem"; export const bannerAlertHeaderPaddingY = ".375rem"; export const bannerAlertNeutralColor = "rgb(129, 123, 143)"; export const bannerAlertSuccessColor = "rgb(0, 215, 117)"; export const bannerAlertWarnColor = "rgb(255, 187, 0)"; export const borderRadiusPill = "1.125rem"; export const borderRadiusPillLg = "1.3125rem"; export const borderRadiusSm = ".375rem"; export const borderRadiusXs = ".1875rem"; export const borderSizeLg = "2px"; export const borderSizeSm = "1px"; export const borderSizeXl = "3px"; export const boxShadowLg = "0px 4px 14px 0px rgba(37,32,31,.25)"; export const boxShadowSm = "0px 1px 3px 0px rgba(37,32,31,.3)"; export const boxShadowXl = "0px 12px 50px 0px rgba(37,32,31,.25)"; export const breakpointDesktop = "71.25rem"; export const breakpointMobile = "32.25rem"; export const breakpointQueryAboveMobile = "(min-width: 32.3125rem)"; export const breakpointQueryAboveTablet = "(min-width: 50.3125rem)"; export const breakpointQueryMobile = "(max-width: 32.25rem)"; export const breakpointQueryTablet = "(max-width: 50.25rem)"; export const breakpointQueryTabletOnly = "(min-width: 32.3125rem) and (max-width: 50.25rem)"; export const breakpointTablet = "50.25rem"; export const buttonActiveBackgroundColor = "rgb(0, 168, 93)"; export const buttonActiveBackgroundImage = "none"; export const buttonActiveBoxShadow = "none"; export const buttonActiveColor = "rgb(255, 255, 255)"; export const buttonBackgroundColor = "rgb(0, 215, 117)"; export const buttonBackgroundImage = "linear-gradient(-180deg, #00d775 0%, #00bd68 100%)"; export const buttonBorderRadius = "1.125rem"; export const buttonBorderRadiusLg = "1.3125rem"; export const buttonBoxShadow = "none"; export const buttonColor = "rgb(255, 255, 255)"; export const buttonDestructiveActiveBoxShadow = "0 0 0 3px #ff5452 inset"; export const buttonDestructiveActiveColor = "rgb(255, 84, 82)"; export const buttonDestructiveBoxShadow = "0 0 0 2px #E6E4EB inset"; export const buttonDestructiveColor = "rgb(255, 84, 82)"; export const buttonDestructiveDisabledBackgroundColor = "rgb(230, 228, 235)"; export const buttonDestructiveDisabledBackgroundImage = "none"; export const buttonDestructiveDisabledBoxShadow = "none"; export const buttonDestructiveDisabledColor = "rgb(178, 174, 189)"; export const buttonDestructiveHoverBoxShadow = "0 0 0 2px #ff5452 inset"; export const buttonDestructiveHoverColor = "rgb(255, 84, 82)"; export const buttonDisabledBackgroundColor = "rgb(230, 228, 235)"; export const buttonDisabledBackgroundImage = "none"; export const buttonDisabledBoxShadow = "none"; export const buttonDisabledColor = "rgb(178, 174, 189)"; export const buttonFeaturedActiveBackgroundColor = "rgb(197, 15, 82)"; export const buttonFeaturedActiveBackgroundImage = "none"; export const buttonFeaturedActiveColor = "rgb(255, 255, 255)"; export const buttonFeaturedBackgroundImage = "linear-gradient(-180deg, #FA488A 0%, #D92B6B 100%)"; export const buttonFeaturedColor = "rgb(255, 255, 255)"; export const buttonFeaturedDisabledBackgroundColor = "rgb(230, 228, 235)"; export const buttonFeaturedDisabledBackgroundImage = "none"; export const buttonFeaturedHoverBackgroundColor = "rgb(217, 43, 107)"; export const buttonFeaturedHoverColor = "rgb(255, 255, 255)"; export const buttonFontSize = "1rem"; export const buttonFontWeight = "700"; export const buttonGradientEndColor = "rgb(0, 189, 104)"; export const buttonGradientStartColor = "rgb(0, 215, 117)"; export const buttonHoverBackgroundColor = "rgb(0, 189, 104)"; export const buttonHoverBackgroundImage = "none"; export const buttonHoverBoxShadow = "none"; export const buttonHoverColor = "rgb(255, 255, 255)"; export const buttonLargeFontSize = "1.5rem"; export const buttonLargeLineHeight = "1.875rem"; export const buttonLargePaddingX = "1.5rem"; export const buttonLargePaddingXIconOnly = ".5625rem"; export const buttonLargePaddingY = ".375rem"; export const buttonLineHeight = "1.5rem"; export const buttonPaddingX = "1.125rem"; export const buttonPaddingXIconOnly = ".5625rem"; export const buttonPaddingY = ".375rem"; export const buttonSecondaryActiveBackgroundColor = "rgb(255, 255, 255)"; export const buttonSecondaryActiveBackgroundImage = "none"; export const buttonSecondaryActiveBorderColor = "rgb(0, 178, 214)"; export const buttonSecondaryActiveBoxShadow = "0 0 0 3px #00b2d6 inset"; export const buttonSecondaryActiveColor = "rgb(0, 178, 214)"; export const buttonSecondaryBackgroundColor = "rgb(255, 255, 255)"; export const buttonSecondaryBackgroundImage = "none"; export const buttonSecondaryBorderColor = "rgb(230, 228, 235)"; export const buttonSecondaryBoxShadow = "0 0 0 2px #E6E4EB inset"; export const buttonSecondaryColor = "rgb(0, 178, 214)"; export const buttonSecondaryDisabledBackgroundColor = "rgb(230, 228, 235)"; export const buttonSecondaryDisabledBackgroundImage = "none"; export const buttonSecondaryDisabledBoxShadow = "none"; export const buttonSecondaryDisabledColor = "rgb(178, 174, 189)"; export const buttonSecondaryHoverBackgroundColor = "rgb(255, 255, 255)"; export const buttonSecondaryHoverBackgroundImage = "none"; export const buttonSecondaryHoverBorderColor = "rgb(0, 178, 214)"; export const buttonSecondaryHoverBoxShadow = "0 0 0 2px #00b2d6 inset"; export const buttonSecondaryHoverColor = "rgb(0, 178, 214)"; export const buttonSelectedActiveBackgroundColor = "rgb(0, 117, 140)"; export const buttonSelectedActiveBackgroundImage = "none"; export const buttonSelectedActiveBoxShadow = "none"; export const buttonSelectedActiveColor = "rgb(255, 255, 255)"; export const buttonSelectedBackgroundColor = "rgb(0, 178, 214)"; export const buttonSelectedBackgroundImage = "linear-gradient(-180deg, #009dbd 0%, #008ca8 100%)"; export const buttonSelectedBoxShadow = "none"; export const buttonSelectedColor = "rgb(255, 255, 255)"; export const buttonSelectedDisabledBoxShadow = "none"; export const buttonSelectedHoverBackgroundColor = "rgb(0, 140, 168)"; export const buttonSelectedHoverBackgroundImage = "none"; export const buttonSelectedHoverBoxShadow = "none"; export const buttonSelectedHoverColor = "rgb(255, 255, 255)"; export const buttonTextAlign = "center"; export const calendarDayActiveBackgroundColor = "rgb(230, 228, 235)"; export const calendarDayActiveColor = "rgb(37, 32, 51)"; export const calendarDayBackgroundColor = "rgb(255, 255, 255)"; export const calendarDayColor = "rgb(0, 178, 214)"; export const calendarDayDisabledBackgroundColor = "rgb(255, 255, 255)"; export const calendarDayDisabledColor = "rgb(230, 228, 235)"; export const calendarDayHoverBackgroundColor = "rgb(243, 242, 245)"; export const calendarDayHoverColor = "rgb(82, 76, 97)"; export const calendarDayOutsideBackgroundColor = "rgb(255, 255, 255)"; export const calendarDayOutsideColor = "rgb(178, 174, 189)"; export const calendarDaySelectedBackgroundColor = "rgb(0, 140, 168)"; export const calendarDaySelectedColor = "rgb(255, 255, 255)"; export const calendarDaySize = "2.250rem"; export const calendarDaySpacing = ".375rem"; export const calendarNavIconActiveFill = "rgb(0, 140, 168)"; export const calendarNavIconDisabledFill = "rgb(230, 228, 235)"; export const calendarNavIconFill = "rgb(0, 178, 214)"; export const calendarNavIconHoverFill = "rgb(0, 157, 189)"; export const calendarPadding = ".75rem"; export const cardBackgroundColor = "rgb(255, 255, 255)"; export const cardColor = "rgb(82, 76, 97)"; export const cardPadding = ".75rem"; export const checkboxCheckedTickColor = "rgb(0, 140, 168)"; export const colorBlue100 = "rgb(203, 238, 245)"; export const colorBlue200 = "rgb(176, 228, 238)"; export const colorBlue300 = "rgb(127, 215, 232)"; export const colorBlue400 = "rgb(64, 196, 223)"; export const colorBlue50 = "rgb(225, 244, 248)"; export const colorBlue500 = "rgb(0, 178, 214)"; export const colorBlue600 = "rgb(0, 157, 189)"; export const colorBlue700 = "rgb(0, 140, 168)"; export const colorBlue800 = "rgb(0, 117, 140)"; export const colorBlue900 = "rgb(0, 85, 103)"; export const colorGray100 = "rgb(230, 228, 235)"; export const colorGray200 = "rgb(204, 201, 212)"; export const colorGray300 = "rgb(178, 174, 189)"; export const colorGray400 = "rgb(154, 149, 167)"; export const colorGray50 = "rgb(243, 242, 245)"; export const colorGray500 = "rgb(129, 123, 143)"; export const colorGray600 = "rgb(105, 97, 121)"; export const colorGray700 = "rgb(82, 76, 97)"; export const colorGray800 = "rgb(59, 52, 75)"; export const colorGray900 = "rgb(37, 32, 51)"; export const colorGreen100 = "rgb(203, 245, 226)"; export const colorGreen200 = "rgb(175, 237, 209)"; export const colorGreen300 = "rgb(128, 232, 185)"; export const colorGreen400 = "rgb(64, 222, 151)"; export const colorGreen50 = "rgb(223, 247, 236)"; export const colorGreen500 = "rgb(0, 215, 117)"; export const colorGreen600 = "rgb(0, 189, 104)"; export const colorGreen700 = "rgb(0, 168, 93)"; export const colorGreen800 = "rgb(0, 140, 77)"; export const colorGreen900 = "rgb(0, 102, 56)"; export const colorRed100 = "rgb(255, 214, 213)"; export const colorRed200 = "rgb(255, 187, 186)"; export const colorRed300 = "rgb(255, 150, 148)"; export const colorRed400 = "rgb(254, 116, 113)"; export const colorRed50 = "rgb(252, 242, 242)"; export const colorRed500 = "rgb(255, 84, 82)"; export const colorRed600 = "rgb(235, 66, 63)"; export const colorRed700 = "rgb(222, 50, 47)"; export const colorRed800 = "rgb(204, 31, 29)"; export const colorRed900 = "rgb(168, 3, 0)"; export const colorWhite = "rgb(255, 255, 255)"; export const colorYellow100 = "rgb(255, 243, 207)"; export const colorYellow200 = "rgb(255, 236, 184)"; export const colorYellow300 = "rgb(255, 225, 140)"; export const colorYellow400 = "rgb(255, 207, 74)"; export const colorYellow50 = "rgb(255, 249, 230)"; export const colorYellow500 = "rgb(255, 187, 0)"; export const colorYellow600 = "rgb(240, 176, 0)"; export const colorYellow700 = "rgb(225, 165, 0)"; export const colorYellow800 = "rgb(194, 142, 0)"; export const colorYellow900 = "rgb(156, 114, 0)"; export const durationBase = "400ms"; export const durationSm = "200ms"; export const durationXs = "50ms"; export const fontColorBase = "rgb(82, 76, 97)"; export const fontFamilyBase = "-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Arial', sans-serif"; export const fontSizeBase = "1rem"; export const fontSizeLg = "1.5rem"; export const fontSizeRoot = "100%"; export const fontSizeSm = ".75rem"; export const fontSizeXl = "1.75rem"; export const fontSizeXxl = "2.625rem"; export const fontWeightBold = "700"; export const formValidationArrowSize = ".375rem"; export const formValidationBackgroundColor = "rgb(255, 84, 82)"; export const formValidationCheckboxArrowLeft = "1.5rem"; export const formValidationColor = "rgb(255, 255, 255)"; export const formValidationMargin = "0"; export const formValidationPaddingX = ".75rem"; export const formValidationPaddingY = ".375rem"; export const gridColumns = "12"; export const gridContainerMobilePadding = ".75rem"; export const gridContainerPadding = "1.5rem"; export const gridGutter = "1.5rem"; export const h1FontSize = "2.625rem"; export const h1FontWeight = "400"; export const h1LineHeight = "3.375rem"; export const h2FontSize = "1.75rem"; export const h2FontWeight = "400"; export const h2LineHeight = "2.625rem"; export const h3FontSize = "1.5rem"; export const h3FontWeight = "400"; export const h3LineHeight = "1.875rem"; export const h4FontSize = "1rem"; export const h4FontWeight = "700"; export const h4LineHeight = "1.5rem"; export const h5FontSize = ".75rem"; export const h5FontWeight = "700"; export const h5LineHeight = "1.125rem"; export const h6FontSize = ".75rem"; export const h6FontWeight = "700"; export const h6LineHeight = "1.125rem"; export const headingContentMarginTop = "1.875rem"; export const headingMarginBottom = ".75rem"; export const headingMarginTop = "0"; export const horizontalNavBarSelectedColor = "rgb(0, 178, 214)"; export const horizontalNavLinkActiveColor = "rgb(37, 32, 51)"; export const horizontalNavLinkColor = "rgb(82, 76, 97)"; export const horizontalNavLinkHoverColor = "rgb(59, 52, 75)"; export const horizontalNavLinkSelectedColor = "rgb(0, 178, 214)"; export const iconSizeLg = "1.5rem"; export const iconSizeSm = "1.125rem"; export const inputBackground = "#ffffff"; export const inputBorder = "solid .0625rem #E6E4EB"; export const inputBorderRadius = ".1875rem"; export const inputBorderWidth = ".0625rem"; export const inputColor = "rgb(82, 76, 97)"; export const inputDisabledBorderColor = "rgb(243, 242, 245)"; export const inputDisabledColor = "rgb(178, 174, 189)"; export const inputHeight = "2.250rem"; export const inputLargeHeight = "2.625rem + .375rem"; export const inputPaddingX = ".75rem"; export const inputPaddingY = ".375rem"; export const inputPlaceholderColor = "rgb(129, 123, 143)"; export const inputPlaceholderFontStyle = "italic"; export const labelColor = "rgb(82, 76, 97)"; export const labelDisabledColor = "rgb(178, 174, 189)"; export const labelFontSize = ".75rem"; export const labelLineHeight = "1.125rem"; export const lineHeightBase = "1.5rem"; export const lineHeightLg = "1.875rem"; export const lineHeightSm = "1.125rem"; export const lineHeightXl = "2.625rem"; export const lineHeightXxl = "3.375rem"; export const linkActiveColor = "rgb(37, 32, 51)"; export const linkAlternateActiveColor = "rgb(230, 228, 235)"; export const linkAlternateColor = "rgb(255, 255, 255)"; export const linkAlternateHoverColor = "rgb(255, 255, 255)"; export const linkAlternateVisitedColor = "rgb(255, 255, 255)"; export const linkColor = "rgb(0, 178, 214)"; export const linkHoverColor = "rgb(82, 76, 97)"; export const linkHoverTextDecoration = "underline"; export const linkTextDecoration = "none"; export const linkVisitedColor = "rgb(0, 140, 168)"; export const linkWhiteActiveColor = "rgb(230, 228, 235)"; export const linkWhiteColor = "rgb(255, 255, 255)"; export const linkWhiteHoverColor = "rgb(255, 255, 255)"; export const linkWhiteVisitedColor = "rgb(255, 255, 255)"; export const listItemMarginBottom = "0"; export const listItemMarginTop = "0"; export const listMarginBottom = ".75rem"; export const listMarginTop = "0"; export const listNestedMarginBottom = "0"; export const listNestedMarginTop = "0"; export const modalBackgroundColor = "rgb(255, 255, 255)"; export const modalCloseIconFill = "rgb(129, 123, 143)"; export const modalCloseIconHoverFill = "rgb(82, 76, 97)"; export const modalContentPadding = ".75rem"; export const modalHeaderPadding = ".75rem"; export const modalInitialOpacity = "0"; export const modalMaxWidth = "32.25rem"; export const modalOpacity = "1"; export const modalScrimBackgroundColor = "rgb(178, 174, 189)"; export const modalScrimInitialOpacity = "0"; export const modalScrimMobileOpacity = "1"; export const modalScrimOpacity = ".7"; export const modalWideMaxWidth = "50.25rem"; export const onePixelRem = ".0625rem"; export const panelBackgroundColor = "rgb(255, 255, 255)"; export const panelBorderColor = "rgb(230, 228, 235)"; export const panelPadding = ".75rem"; export const primaryGradient = "linear-gradient(135deg, #00b2d6 0%, #02DDD8 100%)"; export const pMarginBottom = ".75rem"; export const pMarginTop = "0"; export const radioCheckedCircleColor = "rgb(0, 140, 168)"; export const requiredColor = "rgb(255, 84, 82)"; export const scrimBackgroundColor = "rgb(178, 174, 189)"; export const scrimInitialOpacity = "0"; export const scrimMobileOpacity = "1"; export const scrimOpacity = ".7"; export const selectBorder = "solid .0625rem #E6E4EB"; export const selectBorderRadius = ".1875rem"; export const selectBorderWidth = ".0625rem"; export const selectColor = "rgb(82, 76, 97)"; export const selectDisabledBorderColor = "rgb(243, 242, 245)"; export const selectDisabledColor = "rgb(178, 174, 189)"; export const selectHeight = "2.250rem"; export const selectLargeHeight = "2.625rem + .375rem"; export const selectPaddingBottom = ".375rem"; export const selectPaddingLeft = ".75rem"; export const selectPaddingRight = "1.875rem"; export const selectPaddingTop = ".375rem"; export const spacingBase = "1.5rem"; export const spacingLg = "1.875rem"; export const spacingMd = "1.125rem"; export const spacingSm = ".75rem"; export const spacingXl = "2.250rem"; export const spacingXs = ".375rem"; export const spacingXxl = "2.625rem"; export const stateSelectedBackgroundColor = "rgb(0, 140, 168)"; export const textareaMinHeight = "2.625rem * 2"; export const textBaseFontSize = "1rem"; export const textBaseFontWeight = "400"; export const textBaseLetterSpacing = "normal"; export const textBaseLineHeight = "1.5rem"; export const textLgFontSize = "1.5rem"; export const textLgFontWeight = "400"; export const textLgLetterSpacing = "normal"; export const textLgLineHeight = "1.875rem"; export const textSmFontSize = ".75rem"; export const textSmFontWeight = "400"; export const textSmLetterSpacing = "normal"; export const textSmLineHeight = "1.125rem"; export const textXlFontSize = "1.75rem"; export const textXlFontWeight = "400"; export const textXlLetterSpacing = "normal"; export const textXlLineHeight = "2.625rem"; export const textXsFontSize = ".75rem"; export const textXsFontWeight = "400"; export const textXsLetterSpacing = "normal"; export const textXsLineHeight = "1.125rem"; export const textXxlFontSize = "2.625rem"; export const textXxlFontWeight = "400"; export const textXxlLetterSpacing = "normal"; export const textXxlLineHeight = "3.375rem"; export const zindexAutosuggest = "900"; export const zindexDrawer = "1100"; export const zindexModal = "1100"; export const zindexModalScrim = "1000"; export const zindexPopover = "900"; export const zindexScrim = "1000"; export const zindexTooltip = "900"; export const animations = { durationBase, durationSm, durationXs, }; export const autosuggest = { autosuggestListBackgroundColor, autosuggestListItemActiveBackgroundColor, autosuggestListItemHighlightedBackgroundColor, }; export const badges = { badgeBackgroundColor, badgeCenteredVerticalAlign, badgePaddingX, badgePaddingY, }; export const borders = { borderSizeLg, borderSizeSm, borderSizeXl, }; export const boxShadows = { boxShadowLg, boxShadowSm, boxShadowXl, }; export const breakpoints = { breakpointDesktop, breakpointMobile, breakpointQueryAboveMobile, breakpointQueryAboveTablet, breakpointQueryMobile, breakpointQueryTablet, breakpointQueryTabletOnly, breakpointTablet, }; export const buttons = { buttonActiveBackgroundColor, buttonActiveBackgroundImage, buttonActiveBoxShadow, buttonActiveColor, buttonBackgroundColor, buttonBackgroundImage, buttonBorderRadius, buttonBorderRadiusLg, buttonBoxShadow, buttonColor, buttonDestructiveActiveBoxShadow, buttonDestructiveActiveColor, buttonDestructiveBoxShadow, buttonDestructiveColor, buttonDestructiveDisabledBackgroundColor, buttonDestructiveDisabledBackgroundImage, buttonDestructiveDisabledBoxShadow, buttonDestructiveDisabledColor, buttonDestructiveHoverBoxShadow, buttonDestructiveHoverColor, buttonDisabledBackgroundColor, buttonDisabledBackgroundImage, buttonDisabledBoxShadow, buttonDisabledColor, buttonFeaturedActiveBackgroundColor, buttonFeaturedActiveBackgroundImage, buttonFeaturedActiveColor, buttonFeaturedBackgroundImage, buttonFeaturedColor, buttonFeaturedDisabledBackgroundColor, buttonFeaturedDisabledBackgroundImage, buttonFeaturedHoverBackgroundColor, buttonFeaturedHoverColor, buttonFontSize, buttonFontWeight, buttonGradientEndColor, buttonGradientStartColor, buttonHoverBackgroundColor, buttonHoverBackgroundImage, buttonHoverBoxShadow, buttonHoverColor, buttonLargeFontSize, buttonLargeLineHeight, buttonLargePaddingX, buttonLargePaddingXIconOnly, buttonLargePaddingY, buttonLineHeight, buttonPaddingX, buttonPaddingXIconOnly, buttonPaddingY, buttonSecondaryActiveBackgroundColor, buttonSecondaryActiveBackgroundImage, buttonSecondaryActiveBorderColor, buttonSecondaryActiveBoxShadow, buttonSecondaryActiveColor, buttonSecondaryBackgroundColor, buttonSecondaryBackgroundImage, buttonSecondaryBorderColor, buttonSecondaryBoxShadow, buttonSecondaryColor, buttonSecondaryDisabledBackgroundColor, buttonSecondaryDisabledBackgroundImage, buttonSecondaryDisabledBoxShadow, buttonSecondaryDisabledColor, buttonSecondaryHoverBackgroundColor, buttonSecondaryHoverBackgroundImage, buttonSecondaryHoverBorderColor, buttonSecondaryHoverBoxShadow, buttonSecondaryHoverColor, buttonSelectedActiveBackgroundColor, buttonSelectedActiveBackgroundImage, buttonSelectedActiveBoxShadow, buttonSelectedActiveColor, buttonSelectedBackgroundColor, buttonSelectedBackgroundImage, buttonSelectedBoxShadow, buttonSelectedColor, buttonSelectedDisabledBoxShadow, buttonSelectedHoverBackgroundColor, buttonSelectedHoverBackgroundImage, buttonSelectedHoverBoxShadow, buttonSelectedHoverColor, buttonTextAlign, }; export const calendar = { calendarDayActiveBackgroundColor, calendarDayActiveColor, calendarDayBackgroundColor, calendarDayColor, calendarDayDisabledBackgroundColor, calendarDayDisabledColor, calendarDayHoverBackgroundColor, calendarDayHoverColor, calendarDayOutsideBackgroundColor, calendarDayOutsideColor, calendarDaySelectedBackgroundColor, calendarDaySelectedColor, calendarDaySize, calendarDaySpacing, calendarNavIconActiveFill, calendarNavIconDisabledFill, calendarNavIconFill, calendarNavIconHoverFill, calendarPadding, }; export const cards = { cardBackgroundColor, cardColor, cardPadding, }; export const colors = { colorBlue100, colorBlue200, colorBlue300, colorBlue400, colorBlue50, colorBlue500, colorBlue600, colorBlue700, colorBlue800, colorBlue900, colorGray100, colorGray200, colorGray300, colorGray400, colorGray50, colorGray500, colorGray600, colorGray700, colorGray800, colorGray900, colorGreen100, colorGreen200, colorGreen300, colorGreen400, colorGreen50, colorGreen500, colorGreen600, colorGreen700, colorGreen800, colorGreen900, colorRed100, colorRed200, colorRed300, colorRed400, colorRed50, colorRed500, colorRed600, colorRed700, colorRed800, colorRed900, colorWhite, colorYellow100, colorYellow200, colorYellow300, colorYellow400, colorYellow50, colorYellow500, colorYellow600, colorYellow700, colorYellow800, colorYellow900, primaryGradient, }; export const fontSizes = { h1FontSize, h2FontSize, h3FontSize, h4FontSize, h5FontSize, h6FontSize, textBaseFontSize, textLgFontSize, textSmFontSize, textXlFontSize, textXsFontSize, textXxlFontSize, }; export const fontWeights = { fontWeightBold, h1FontWeight, h2FontWeight, h3FontWeight, h4FontWeight, h5FontWeight, h6FontWeight, textBaseFontWeight, textLgFontWeight, textSmFontWeight, textXlFontWeight, textXsFontWeight, textXxlFontWeight, }; export const forms = { checkboxCheckedTickColor, formValidationArrowSize, formValidationBackgroundColor, formValidationCheckboxArrowLeft, formValidationColor, formValidationMargin, formValidationPaddingX, formValidationPaddingY, inputBackground, inputBorder, inputBorderRadius, inputBorderWidth, inputColor, inputDisabledBorderColor, inputDisabledColor, inputHeight, inputLargeHeight, inputPaddingX, inputPaddingY, inputPlaceholderColor, inputPlaceholderFontStyle, labelColor, labelDisabledColor, labelFontSize, labelLineHeight, radioCheckedCircleColor, requiredColor, selectBorder, selectBorderRadius, selectBorderWidth, selectColor, selectDisabledBorderColor, selectDisabledColor, selectHeight, selectLargeHeight, selectPaddingBottom, selectPaddingLeft, selectPaddingRight, selectPaddingTop, textareaMinHeight, }; export const grids = { gridColumns, gridContainerMobilePadding, gridContainerPadding, gridGutter, }; export const horizontalNav = { horizontalNavBarSelectedColor, horizontalNavLinkActiveColor, horizontalNavLinkColor, horizontalNavLinkHoverColor, horizontalNavLinkSelectedColor, }; export const icons = { iconSizeLg, iconSizeSm, }; export const letterSpacings = { textBaseLetterSpacing, textLgLetterSpacing, textSmLetterSpacing, textXlLetterSpacing, textXsLetterSpacing, textXxlLetterSpacing, }; export const lineHeights = { h1LineHeight, h2LineHeight, h3LineHeight, h4LineHeight, h5LineHeight, h6LineHeight, textBaseLineHeight, textLgLineHeight, textSmLineHeight, textXlLineHeight, textXsLineHeight, textXxlLineHeight, }; export const modals = { modalBackgroundColor, modalCloseIconFill, modalCloseIconHoverFill, modalContentPadding, modalHeaderPadding, modalInitialOpacity, modalMaxWidth, modalOpacity, modalScrimBackgroundColor, modalScrimInitialOpacity, modalScrimMobileOpacity, modalScrimOpacity, modalWideMaxWidth, }; export const notifications = { bannerAlertBackgroundColor, bannerAlertChildrenColor, bannerAlertChildrenPaddingX, bannerAlertChildrenPaddingY, bannerAlertErrorColor, bannerAlertExpandIconFill, bannerAlertHeaderExpandableActiveBackgroundColor, bannerAlertHeaderExpandableHoverBackgroundColor, bannerAlertHeaderPaddingX, bannerAlertHeaderPaddingY, bannerAlertNeutralColor, bannerAlertSuccessColor, bannerAlertWarnColor, }; export const panels = { panelBackgroundColor, panelBorderColor, panelPadding, }; export const radii = { borderRadiusPill, borderRadiusPillLg, borderRadiusSm, borderRadiusXs, }; export const scrims = { scrimBackgroundColor, scrimInitialOpacity, scrimMobileOpacity, scrimOpacity, }; export const spacings = { headingContentMarginTop, headingMarginBottom, headingMarginTop, listItemMarginBottom, listItemMarginTop, listMarginBottom, listMarginTop, listNestedMarginBottom, listNestedMarginTop, onePixelRem, pMarginBottom, pMarginTop, spacingBase, spacingLg, spacingMd, spacingSm, spacingXl, spacingXs, spacingXxl, }; export const states = { stateSelectedBackgroundColor, }; export const textColors = { fontColorBase, linkActiveColor, linkAlternateActiveColor, linkAlternateColor, linkAlternateHoverColor, linkAlternateVisitedColor, linkColor, linkHoverColor, linkVisitedColor, linkWhiteActiveColor, linkWhiteColor, linkWhiteHoverColor, linkWhiteVisitedColor, }; export const textDecorations = { linkHoverTextDecoration, linkTextDecoration, }; export const typesettings = { fontFamilyBase, fontSizeBase, fontSizeLg, fontSizeRoot, fontSizeSm, fontSizeXl, fontSizeXxl, lineHeightBase, lineHeightLg, lineHeightSm, lineHeightXl, lineHeightXxl, }; export const zIndices = { zindexAutosuggest, zindexDrawer, zindexModal, zindexModalScrim, zindexPopover, zindexScrim, zindexTooltip, };
n = int(input()) i=1 a = 0 while i < n: i *= 2 a += 1 print(a)
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],o):e.dayjs_locale_it=o(e.dayjs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"da %s",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(e){return e+"º"}};return e.locale(o,null,!0),o});
$( document ).ready(function() { $("#date_transfer_picker").datepicker({ prevText : "ก่อนหน้า", nextText: "ถัดไป", currentText: "Today", changeMonth: true, changeYear: true, isBuddhist: true, monthNamesShort: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], dayNamesMin: ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'], constrainInput: true, dateFormat: "dd/mm/yy", yearRange: "c-50:c+10", autoclose: true, }); $('#time_transfer').datetimepicker({ format: 'HH:mm', icons: { up: 'icon icon-chevron-up', down: 'icon icon-chevron-down' }, }); $(".modal").on("hidden.bs.modal", function(){ $('#return_profile_id').val(""); $('#member_id').val(""); $('#member_name').val(""); $('#total_return_amount').val(""); $('#dividend_bank_id').val(""); $('#dividend_bank_branch_id').val(""); $('#dividend_acc_num').val(""); $("input:radio").removeAttr("checked"); $('.pay_type_1').hide(); $('.pay_type_2').hide(); }); }); function format_the_number(ele){ var value = $('#'+ele.id).val(); if(value!=''){ value = value.replace(',',''); value = parseInt(value); value = value.toLocaleString(); if(value == 'NaN'){ $('#'+ele.id).val(''); }else{ $('#'+ele.id).val(value); } }else{ $('#'+ele.id).val(''); } } function chkNumber(ele){ var vchar = String.fromCharCode(event.keyCode); if ((vchar<'0' || vchar>'9') && (vchar != '.')) return false; ele.onKeyPress=vchar; } function get_account_list(member_id, account_id){ $.post(base_url+"/ajax/get_account_list", { member_id: member_id, account_id : account_id } , function(result){ $('#account_list_space').html(result); }); } function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#ImgPreview').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } function check_form(){ if($('#file_attach').val() == ''){ swal('กรุณาแนบหลักฐานการโอนเงิน'); }else{ $('#form_loan_transfer').submit(); } } function change_account(){ $('#account_id').val($('#account_list :selected').val()); $('#account_name').val($('#account_list :selected').attr('account_name')); } function open_transfer_modal(return_profile_id){ $.ajax({ url:base_url+"/finance/get_return_data", method:"post", data:{return_profile_id:return_profile_id}, dataType:"text", success:function(data) { var obj = JSON.parse(data); //console.log(obj); $('#return_profile_id').val(return_profile_id); $('#member_id').val(obj.member_id); $('#member_name').val(obj.prename_short+obj.firstname_th+" "+obj.lastname_th); $('#total_return_amount').val(addCommas(obj.total_return_amount)); $('#dividend_bank_id').val(obj.dividend_bank_id); $('#dividend_bank_branch_id').val(obj.dividend_bank_branch_id); $('#dividend_acc_num').val(obj.dividend_acc_num); list_account(); $('#transfer_modal').modal('show'); } }); } function change_pay_type(){ if($('#pay_type_1').is(':checked')){ $('.pay_type_1').show(); $('.pay_type_2').hide(); }else if($('#pay_type_2').is(':checked')){ $('.pay_type_1').hide(); $('.pay_type_2').show(); }else{ $('.pay_type_1').hide(); $('.pay_type_2').hide(); } } function cash_submit(){ var text_alert = ""; if($('input[name=pay_type]').is(":checked") == false){ text_alert += "กรุณาเลือกวิธีการชำระเงิน \n"; } if(text_alert != ''){ swal(text_alert); }else{ $('#form_return_transfer').submit(); } } function list_account(){ var member_id = $("#member_id").val(); $.ajax({ method: 'POST', url: base_url+'loan/get_account_list', data: { member_id : member_id }, success: function(msg){ //console.log(msg); $('#account_list_space').html(msg); } }); } function removeCommas(str) { return(str.replace(/,/g,'')); } function addCommas(x){ return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }
import React from "react"; import ReactDOM from "react-dom"; import ReactTestUtils from "react-dom/test-utils"; import makeAsyncScriptLoader from "../src/async-script-loader"; class MockedComponent extends React.Component { callsACallback(fn) { assert.equal(this.constructor.name, "MockedComponent"); fn(); } render() { return <span/>; } } const hasScript = () => { const scripTags = document.getElementsByTagName("script"); for (let i = 0; i < scripTags.length; i += 1) { if (scripTags[i].src.indexOf("http://example.com") > -1) { return true; } } return false; } describe("AsyncScriptLoader", () => { it("should be imported successfully", () => { assert.isNotNull(makeAsyncScriptLoader); }); it("should return a component that contains the passed component", () => { let ComponentWrapper = makeAsyncScriptLoader(MockedComponent, "http://example.com"); assert.equal(ComponentWrapper.displayName, "AsyncScriptLoader(MockedComponent)"); let instance = ReactTestUtils.renderIntoDocument( <ComponentWrapper /> ); assert.ok(ReactTestUtils.isCompositeComponent(instance)); assert.ok(ReactTestUtils.isCompositeComponentWithType(instance, ComponentWrapper)); assert.isNotNull(ReactTestUtils.findRenderedComponentWithType(instance, MockedComponent)); }); it("should handle successfully already loaded global object", () => { let globalName = "SomeGlobal"; window[globalName] = {}; let ComponentWrapper = makeAsyncScriptLoader(MockedComponent, "http://example.com", { globalName: globalName }); let instance = ReactTestUtils.renderIntoDocument( <ComponentWrapper /> ); ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(instance)); instance.componentWillUnmount(); delete window[globalName]; }); it("should expose functions with scope correctly", (done) => { let ComponentWrapper = makeAsyncScriptLoader(MockedComponent, "http://example.com", { exposeFuncs: ["callsACallback"], }); let instance = ReactTestUtils.renderIntoDocument( <ComponentWrapper /> ); instance.callsACallback(done); }); it("should not remove tag script on removeOnUnmount option not set", () => { let ComponentWrapper = makeAsyncScriptLoader(MockedComponent, "http://example.com"); let instance = ReactTestUtils.renderIntoDocument( <ComponentWrapper /> ); assert.equal(hasScript(), true); ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(instance)); instance.componentWillUnmount(); assert.equal(hasScript(), true); }); it("should remove tag script on removeOnUnmount option set to true", () => { let ComponentWrapper = makeAsyncScriptLoader(MockedComponent, "http://example.com", { removeOnUnmount: true }); let instance = ReactTestUtils.renderIntoDocument( <ComponentWrapper /> ); assert.equal(hasScript(), true); ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(instance)); instance.componentWillUnmount(); assert.equal(hasScript(), false); }); });
const axios = require('axios') const link = 'https://arugaz.herokuapp.com' const fileyt = 'https://raw.githubusercontent.com/ArugaZ/scraper-results/main/20201111_230923.jpg' const eroryt = 'https://raw.githubusercontent.com/ArugaZ/scraper-results/main/20201111_234624.jpg' const dewabatch = async (judul) => new Promise((resolve, reject) => { axios.get(`${link}/api/dewabatch?q=${judul}`) .then((res) => { const textdew = `${res.data.result}\n\nSinopsis: ${res.data.sinopsis}` resolve({link: res.data.thumb, text: textdew}) }) .catch((err) => { reject(err) }) }) const cekzodiak = async (nama,tgl,bln,thn) => new Promise((resolve, reject) => { axios.get(`${link}/api/getzodiak?nama=${nama}&tgl-bln-thn=${tgl}-${bln}-${thn}`) .then((res) => { const text = `Nama: ${res.data.nama}\nUltah: ${res.data.ultah}\nZodiak: ${res.data.zodiak}` resolve(text) }) .catch((err) =>{ reject(err) }) }) const cooltext = async (teks) => new Promise((resolve, reject) => { axios.get(`https://api.haipbis.xyz/randomcooltext?text=${teks}`) .then((res) => { const textc = `Teks: ${res.data.text}\nGambar: ${res.data.image}` resolve({link: res.data.image, text: textc}) }) .catch((err) => { reject(err) }) }) const cerpen = async () => new Promise((resolve, reject) => { axios.get(`${link}/api/cerpen`) .then((res) => { resolve(res.data) }) .catch((err) => { reject(err) }) }) const cersex = async () => new Promise((resolve, reject) => { const ransex = Math.floor(Math.random() * 2) + 1 axios.get(`${link}/api/cersex${ransex}`) .then((res) => { resolve(res.data) }) .catch((err) => { reject(err) }) }) const puisi = async () => new Promise((resolve, reject) => { const puiti = ['1','3'] const ranisi = puiti[Math.floor(Math.random() * puiti.length)] axios.get(`${link}/api/puisi${ranisi}`) .then((res) => { resolve(res.data) }) .catch((err) => { reject(err) }) }) const ytmp3 = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/yta?url=${url}`) .then((res) => { resolve(res.data) }) .catch((err) =>{ reject(err) }) }) const ytmp4 = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/ytv?url=${url}`) .then((res) => { resolve(res.data) }) .catch((err) =>{ reject(err) }) }) const fb = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/fb?url=${url}`) .then((res) => { if (res.data.error) resolve({status: 'error', link: res.data.result}) resolve({linkhd: res.data.result.hd, linksd: res.data.result.sd}) }) .catch((err) =>{ reject(err) }) }) const stalkig = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/stalk?username=${url}`) .then((res) => { if (res.data.error) resolve(res.data.error) const text = `User: ${res.data.Username}\nName: ${res.data.Name}\nBio: ${res.data.Biodata}\nFollower: ${res.data.Jumlah_Followers}\nFollowing: ${res.data.Jumlah_Following}\nPost: ${res.data.Jumlah_Post}` resolve(text) }) .catch((err) =>{ reject(err) }) }) const stalkigpict = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/stalk?username=${url}`) .then((res) => { if (res.data.error) resolve('https://c4.wallpaperflare.com/wallpaper/976/117/318/anime-girls-404-not-found-glowing-eyes-girls-frontline-wallpaper-preview.jpg') resolve(`${res.data.Profile_pic}`) }) .catch((err) =>{ reject(err) }) }) const quote = async () => new Promise((resolve, reject) => { axios.get(`${link}/api/randomquotes`) .then((res) => { const text = `Author: ${res.data.author}\n\nQuote: ${res.data.quotes}` resolve(text) }) .catch((err) =>{ reject(err) }) }) const wiki = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/wiki?q=${url}`) .then((res) => { resolve(res.data.result) }) .catch((err) =>{ reject(err) }) }) const daerah = async () => new Promise((resolve, reject) => { axios.get(`${link}/daerah`) .then((res) => { resolve(res.data.result) }) .catch((err) =>{ reject(err) }) }) const jadwaldaerah = async (url) => new Promise((resolve, reject) => { axios.get(`https://api.haipbis.xyz/jadwalsholat?daerah=${url}`) .then((res) => { if (res.data.error) resolve(res.data.error) const text = `Jadwal Sholat ${url}\n\nImsyak: ${res.data.Imsyak}\nSubuh: ${res.data.Subuh}\nDzuhur: ${res.data.Dzuhur}\nAshar: ${res.data.Ashar}\nMaghrib: ${res.data.Maghrib}\nIsya: ${res.data.Isya}` resolve(text) }) .catch((err) =>{ reject(err) }) }) const cuaca = async (url) => new Promise((resolve, reject) => { axios.get(`https://rest.farzain.com/api/cuaca.php?id=${url}&apikey=O8mUD3YrHIy9KM1fMRjamw8eg`) .then((res) => { if (res.data.respon.cuaca == null) resolve('Maaf daerah kamu tidak tersedia') const text = `Cuaca di: ${res.data.respon.tempat}\n\nCuaca: ${res.data.respon.cuaca}\nAngin: ${res.data.respon.angin}\nDesk: ${res.data.respon.deskripsi}\nKelembapan: ${res.data.respon.kelembapan}\nSuhu: ${res.data.respon.suhu}\nUdara: ${res.data.respon.udara}` resolve(text) }) .catch((err) =>{ reject(err) }) }) const chord = async (url) => new Promise((resolve, reject) => { axios.get(`${link}/api/chord?q=${url}`) .then((res) => { if (res.data.error) resolve(res.data.error) resolve(res.data.result) }) .catch((err) =>{ reject(err) }) }) const tulis = async (teks) => new Promise((resolve, reject) => { axios.get(`${link}/api/nulis?text=${encodeURIComponent(teks)}`) .then((res) => { resolve(`${res.data.result}`) }) .catch((err) => { reject(err) }) }) const artinama = async (nama) => new Promise((resolve, reject) => { axios.get(`${link}/api/artinama?nama=${nama}`) .then((res) => { resolve(res.data.result) }) .catch((err) => { reject(err) }) }) const cekjodoh = async (nama,pasangan) => new Promise((resolve, reject) => { axios.get(`${link}/api/jodohku?nama=${nama}&pasangan=${pasangan}`) .then((res) => { const textc = `Nama : ${res.data.nama}\nPasangan : ${res.data.pasangan}\nPositif: ${res.data.positif}\nNegatif : ${res.data.negatif}` resolve({link: res.data.gambar, text: textc}) }) .catch((err) => { reject(err) }) }) const covidindo = async () => new Promise((resolve, reject) => { axios.get(`${link}/api/coronaindo`) .then((res) => { const textv = `Info Covid-19 ${res.data.negara}\n\nKasus Baru: ${res.data.kasus_baru}\nTotal Kasus: ${res.data.kasus_total}\nSembuh: ${res.data.sembuh}\nPenanganan: ${res.data.penanganan}\nMeninggoy: ${res.data.meninggal}\n\nUpdate: ${res.data.terakhir}` resolve(textv) }) .catch((err) => { reject(err) }) }) const bapakfont = async (kalimat) => new Promise((resolve, reject) => { axios.get(`${link}/api/bapakfont?kata=${kalimat}`) .then((res) => { resolve(res.data.result) }) .catch((err) => { reject(err) }) }) const lirik = async (judul) => new Promise((resolve, reject) => { axios.get(`${link}/api/lirik?judul=${judul}`) .then((res) => { resolve(res.data.result) }) .catch((err) => { reject(err) }) }) const movie = async (judul) => new Promise((resolve, reject) => { axios.get(`${link}/api/sdmovie?film=${encodeURIComponent(judul)}`) .then((res) => { if (res.data.error) return resolve({status: 'error', hasil: res.data.result}) const teksmov = `Judul: ${res.data.result.title}\nRating: ${res.data.result.rating}\nSinopsis: ${res.data.result.sinopsis}\nLink: ${res.data.result.video}` resolve({status: 'success', hasil: teksmov, link: res.data.result.thumb}) }) .catch((err) => { reject(err) }) }) module.exports = { ytmp3, ytmp4, fb, stalkig, stalkigpict, quote, wiki, daerah, jadwaldaerah, cuaca, chord, tulis, artinama, cekjodoh, covidindo, bapakfont, lirik, movie, cerpen, cersex, puisi, cooltext, cekzodiak, dewabatch }
Clazz.declarePackage ("J.popup"); Clazz.load (["J.popup.PopupResource"], "J.popup.MainPopupResourceBundle", ["J.i18n.GT", "J.util.SB", "$.TextFormat"], function () { c$ = Clazz.declareType (J.popup, "MainPopupResourceBundle", J.popup.PopupResource); Clazz.overrideMethod (c$, "getMenuName", function () { return "popupMenu"; }); Clazz.overrideMethod (c$, "buildStructure", function (menuStructure) { this.addItems (J.popup.MainPopupResourceBundle.menuContents); this.addItems (J.popup.MainPopupResourceBundle.structureContents); this.setStructure (menuStructure); }, "~S"); c$.Box = $_M(c$, "Box", ($fz = function (cmd) { return "if (showBoundBox or showUnitcell) {" + cmd + "} else {boundbox on;" + cmd + ";boundbox off}"; }, $fz.isPrivate = true, $fz), "~S"); Clazz.overrideMethod (c$, "getWordContents", function () { var wasTranslating = J.i18n.GT.setDoTranslate (true); var words = ["modelSetMenu", J.i18n.GT._ ("No atoms loaded"), "configurationComputedMenu", J.i18n.GT._ ("Configurations"), "elementsComputedMenu", J.i18n.GT._ ("Element"), "FRAMESbyModelComputedMenu", J.i18n.GT._ ("Model/Frame"), "languageComputedMenu", J.i18n.GT._ ("Language"), "PDBaaResiduesComputedMenu", J.i18n.GT._ ("By Residue Name"), "PDBnucleicResiduesComputedMenu", J.i18n.GT._ ("By Residue Name"), "PDBcarboResiduesComputedMenu", J.i18n.GT._ ("By Residue Name"), "PDBheteroComputedMenu", J.i18n.GT._ ("By HETATM"), "surfMoComputedMenuText", J.i18n.GT._ ("Molecular Orbitals ({0})"), "SYMMETRYSelectComputedMenu", J.i18n.GT._ ("Symmetry"), "SYMMETRYShowComputedMenu", J.i18n.GT._ ("Space Group"), "SYMMETRYhide", J.i18n.GT._ ("Hide Symmetry"), "hiddenModelSetText", J.i18n.GT._ ("Model information"), "selectMenuText", J.i18n.GT._ ("Select ({0})"), "allModelsText", J.i18n.GT._ ("All {0} models"), "configurationMenuText", J.i18n.GT._ ("Configurations ({0})"), "modelSetCollectionText", J.i18n.GT._ ("Collection of {0} models"), "atomsText", J.i18n.GT._ ("atoms: {0}"), "bondsText", J.i18n.GT._ ("bonds: {0}"), "groupsText", J.i18n.GT._ ("groups: {0}"), "chainsText", J.i18n.GT._ ("chains: {0}"), "polymersText", J.i18n.GT._ ("polymers: {0}"), "modelMenuText", J.i18n.GT._ ("model {0}"), "viewMenuText", J.i18n.GT._ ("View {0}"), "mainMenuText", J.i18n.GT._ ("Main Menu"), "biomoleculesMenuText", J.i18n.GT._ ("Biomolecules"), "biomoleculeText", J.i18n.GT._ ("biomolecule {0} ({1} atoms)"), "loadBiomoleculeText", J.i18n.GT._ ("load biomolecule {0} ({1} atoms)"), "selectAll", J.i18n.GT._ ("All"), "selectNone", J.i18n.GT._ ("None"), "hideNotSelectedCB", J.i18n.GT._ ("Display Selected Only"), "invertSelection", J.i18n.GT._ ("Invert Selection"), "viewMenu", J.i18n.GT._ ("View"), "best", J.i18n.GT._ ("Best"), "front", J.i18n.GT._ ("Front"), "left", J.i18n.GT._ ("Left"), "right", J.i18n.GT._ ("Right"), "top", J.util.TextFormat.split (J.i18n.GT._ ("Top[as in \"view from the top, from above\" - (translators: remove this bracketed part]"), '[')[0], "bottom", J.i18n.GT._ ("Bottom"), "back", J.i18n.GT._ ("Back"), "sceneComputedMenu", J.i18n.GT._ ("Scenes"), "PDBproteinMenu", J.i18n.GT._ ("Protein"), "allProtein", J.i18n.GT._ ("All"), "proteinBackbone", J.i18n.GT._ ("Backbone"), "proteinSideChains", J.i18n.GT._ ("Side Chains"), "polar", J.i18n.GT._ ("Polar Residues"), "nonpolar", J.i18n.GT._ ("Nonpolar Residues"), "positiveCharge", J.i18n.GT._ ("Basic Residues (+)"), "negativeCharge", J.i18n.GT._ ("Acidic Residues (-)"), "noCharge", J.i18n.GT._ ("Uncharged Residues"), "PDBnucleicMenu", J.i18n.GT._ ("Nucleic"), "allNucleic", J.i18n.GT._ ("All"), "DNA", J.i18n.GT._ ("DNA"), "RNA", J.i18n.GT._ ("RNA"), "nucleicBackbone", J.i18n.GT._ ("Backbone"), "nucleicBases", J.i18n.GT._ ("Bases"), "atPairs", J.i18n.GT._ ("AT pairs"), "gcPairs", J.i18n.GT._ ("GC pairs"), "auPairs", J.i18n.GT._ ("AU pairs"), "PDBheteroMenu", J.i18n.GT._ ("Hetero"), "allHetero", J.i18n.GT._ ("All PDB \"HETATM\""), "Solvent", J.i18n.GT._ ("All Solvent"), "Water", J.i18n.GT._ ("All Water"), "nonWaterSolvent", J.i18n.GT._ ("Nonaqueous Solvent") + " (solvent and not water)", "exceptWater", J.i18n.GT._ ("Nonaqueous HETATM") + " (hetero and not water)", "Ligand", J.i18n.GT._ ("Ligand"), "allCarbo", J.i18n.GT._ ("All"), "PDBcarboMenu", J.i18n.GT._ ("Carbohydrate"), "PDBnoneOfTheAbove", J.i18n.GT._ ("None of the above"), "renderMenu", J.i18n.GT._ ("Style"), "renderSchemeMenu", J.i18n.GT._ ("Scheme"), "renderCpkSpacefill", J.i18n.GT._ ("CPK Spacefill"), "renderBallAndStick", J.i18n.GT._ ("Ball and Stick"), "renderSticks", J.i18n.GT._ ("Sticks"), "renderWireframe", J.i18n.GT._ ("Wireframe"), "PDBrenderCartoonsOnly", J.i18n.GT._ ("Cartoon"), "PDBrenderTraceOnly", J.i18n.GT._ ("Trace"), "atomMenu", J.i18n.GT._ ("Atoms"), "atomNone", J.i18n.GT._ ("Off"), "atom15", J.i18n.GT._ ("{0}% van der Waals", "15"), "atom20", J.i18n.GT._ ("{0}% van der Waals", "20"), "atom25", J.i18n.GT._ ("{0}% van der Waals", "25"), "atom50", J.i18n.GT._ ("{0}% van der Waals", "50"), "atom75", J.i18n.GT._ ("{0}% van der Waals", "75"), "atom100", J.i18n.GT._ ("{0}% van der Waals", "100"), "bondMenu", J.i18n.GT._ ("Bonds"), "bondNone", J.i18n.GT._ ("Off"), "bondWireframe", J.i18n.GT._ ("On"), "bond100", J.i18n.GT._ ("{0} \u00C5", "0.10"), "bond150", J.i18n.GT._ ("{0} \u00C5", "0.15"), "bond200", J.i18n.GT._ ("{0} \u00C5", "0.20"), "bond250", J.i18n.GT._ ("{0} \u00C5", "0.25"), "bond300", J.i18n.GT._ ("{0} \u00C5", "0.30"), "hbondMenu", J.i18n.GT._ ("Hydrogen Bonds"), "hbondNone", J.i18n.GT._ ("Off"), "hbondCalc", J.i18n.GT._ ("Calculate"), "hbondWireframe", J.i18n.GT._ ("On"), "PDBhbondSidechain", J.i18n.GT._ ("Set H-Bonds Side Chain"), "PDBhbondBackbone", J.i18n.GT._ ("Set H-Bonds Backbone"), "hbond100", J.i18n.GT._ ("{0} \u00C5", "0.10"), "hbond150", J.i18n.GT._ ("{0} \u00C5", "0.15"), "hbond200", J.i18n.GT._ ("{0} \u00C5", "0.20"), "hbond250", J.i18n.GT._ ("{0} \u00C5", "0.25"), "hbond300", J.i18n.GT._ ("{0} \u00C5", "0.30"), "ssbondMenu", J.i18n.GT._ ("Disulfide Bonds"), "ssbondNone", J.i18n.GT._ ("Off"), "ssbondWireframe", J.i18n.GT._ ("On"), "PDBssbondSidechain", J.i18n.GT._ ("Set SS-Bonds Side Chain"), "PDBssbondBackbone", J.i18n.GT._ ("Set SS-Bonds Backbone"), "ssbond100", J.i18n.GT._ ("{0} \u00C5", "0.10"), "ssbond150", J.i18n.GT._ ("{0} \u00C5", "0.15"), "ssbond200", J.i18n.GT._ ("{0} \u00C5", "0.20"), "ssbond250", J.i18n.GT._ ("{0} \u00C5", "0.25"), "ssbond300", J.i18n.GT._ ("{0} \u00C5", "0.30"), "PDBstructureMenu", J.i18n.GT._ ("Structures"), "structureNone", J.i18n.GT._ ("Off"), "backbone", J.i18n.GT._ ("Backbone"), "cartoon", J.i18n.GT._ ("Cartoon"), "cartoonRockets", J.i18n.GT._ ("Cartoon Rockets"), "ribbons", J.i18n.GT._ ("Ribbons"), "rockets", J.i18n.GT._ ("Rockets"), "strands", J.i18n.GT._ ("Strands"), "trace", J.i18n.GT._ ("Trace"), "VIBRATIONMenu", J.i18n.GT._ ("Vibration"), "vibrationOff", J.i18n.GT._ ("Off"), "vibrationOn", J.i18n.GT._ ("On"), "vibration20", "*2", "vibration05", "/2", "VIBRATIONvectorMenu", J.i18n.GT._ ("Vectors"), "spectraMenu", J.i18n.GT._ ("Spectra"), "hnmrMenu", J.i18n.GT._ ("1H-NMR"), "cnmrMenu", J.i18n.GT._ ("13C-NMR"), "vectorOff", J.i18n.GT._ ("Off"), "vectorOn", J.i18n.GT._ ("On"), "vector3", J.i18n.GT._ ("{0} pixels", "3"), "vector005", J.i18n.GT._ ("{0} \u00C5", "0.05"), "vector01", J.i18n.GT._ ("{0} \u00C5", "0.10"), "vectorScale02", J.i18n.GT._ ("Scale {0}", "0.2"), "vectorScale05", J.i18n.GT._ ("Scale {0}", "0.5"), "vectorScale1", J.i18n.GT._ ("Scale {0}", "1"), "vectorScale2", J.i18n.GT._ ("Scale {0}", "2"), "vectorScale5", J.i18n.GT._ ("Scale {0}", "5"), "stereoMenu", J.i18n.GT._ ("Stereographic"), "stereoNone", J.i18n.GT._ ("None"), "stereoRedCyan", J.i18n.GT._ ("Red+Cyan glasses"), "stereoRedBlue", J.i18n.GT._ ("Red+Blue glasses"), "stereoRedGreen", J.i18n.GT._ ("Red+Green glasses"), "stereoCrossEyed", J.i18n.GT._ ("Cross-eyed viewing"), "stereoWallEyed", J.i18n.GT._ ("Wall-eyed viewing"), "labelMenu", J.i18n.GT._ ("Labels"), "labelNone", J.i18n.GT._ ("None"), "labelSymbol", J.i18n.GT._ ("With Element Symbol"), "labelName", J.i18n.GT._ ("With Atom Name"), "labelNumber", J.i18n.GT._ ("With Atom Number"), "labelPositionMenu", J.i18n.GT._ ("Position Label on Atom"), "labelCentered", J.i18n.GT._ ("Centered"), "labelUpperRight", J.i18n.GT._ ("Upper Right"), "labelLowerRight", J.i18n.GT._ ("Lower Right"), "labelUpperLeft", J.i18n.GT._ ("Upper Left"), "labelLowerLeft", J.i18n.GT._ ("Lower Left"), "colorMenu", J.i18n.GT._ ("Color"), "[color_atoms]Menu", J.i18n.GT._ ("Atoms"), "schemeMenu", J.i18n.GT._ ("By Scheme"), "cpk", J.i18n.GT._ ("Element (CPK)"), "altloc#PDB", J.i18n.GT._ ("Alternative Location"), "molecule", J.i18n.GT._ ("Molecule"), "formalcharge", J.i18n.GT._ ("Formal Charge"), "partialcharge#CHARGE", J.i18n.GT._ ("Partial Charge"), "relativeTemperature#BFACTORS", J.i18n.GT._ ("Temperature (Relative)"), "fixedTemperature#BFACTORS", J.i18n.GT._ ("Temperature (Fixed)"), "amino#PDB", J.i18n.GT._ ("Amino Acid"), "structure#PDB", J.i18n.GT._ ("Secondary Structure"), "chain#PDB", J.i18n.GT._ ("Chain"), "group#PDB", J.i18n.GT._ ("Group"), "monomer#PDB", J.i18n.GT._ ("Monomer"), "shapely#PDB", J.i18n.GT._ ("Shapely"), "none", J.i18n.GT._ ("Inherit"), "black", J.i18n.GT._ ("Black"), "white", J.i18n.GT._ ("White"), "cyan", J.i18n.GT._ ("Cyan"), "red", J.i18n.GT._ ("Red"), "orange", J.i18n.GT._ ("Orange"), "yellow", J.i18n.GT._ ("Yellow"), "green", J.i18n.GT._ ("Green"), "blue", J.i18n.GT._ ("Blue"), "indigo", J.i18n.GT._ ("Indigo"), "violet", J.i18n.GT._ ("Violet"), "salmon", J.i18n.GT._ ("Salmon"), "olive", J.i18n.GT._ ("Olive"), "maroon", J.i18n.GT._ ("Maroon"), "gray", J.i18n.GT._ ("Gray"), "slateblue", J.i18n.GT._ ("Slate Blue"), "gold", J.i18n.GT._ ("Gold"), "orchid", J.i18n.GT._ ("Orchid"), "opaque", J.i18n.GT._ ("Make Opaque"), "translucent", J.i18n.GT._ ("Make Translucent"), "[color_bonds]Menu", J.i18n.GT._ ("Bonds"), "[color_hbonds]Menu", J.i18n.GT._ ("Hydrogen Bonds"), "[color_ssbonds]Menu", J.i18n.GT._ ("Disulfide Bonds"), "colorPDBStructuresMenu", J.i18n.GT._ ("Structures"), "[color_backbone]Menu", J.i18n.GT._ ("Backbone"), "[color_trace]Menu", J.i18n.GT._ ("Trace"), "[color_cartoon]sMenu", J.i18n.GT._ ("Cartoon"), "[color_ribbon]sMenu", J.i18n.GT._ ("Ribbons"), "[color_rockets]Menu", J.i18n.GT._ ("Rockets"), "[color_strands]Menu", J.i18n.GT._ ("Strands"), "[color_labels]Menu", J.i18n.GT._ ("Labels"), "[color_background]Menu", J.i18n.GT._ ("Background"), "[color_isosurface]Menu", J.i18n.GT._ ("Surfaces"), "[color_vectors]Menu", J.i18n.GT._ ("Vectors"), "[color_axes]Menu", J.i18n.GT._ ("Axes"), "[color_boundbox]Menu", J.i18n.GT._ ("Boundbox"), "[color_UNITCELL]Menu", J.i18n.GT._ ("Unit cell"), "zoomMenu", J.i18n.GT._ ("Zoom"), "zoom50", "50%", "zoom100", "100%", "zoom150", "150%", "zoom200", "200%", "zoom400", "400%", "zoom800", "800%", "zoomIn", J.i18n.GT._ ("Zoom In"), "zoomOut", J.i18n.GT._ ("Zoom Out"), "spinMenu", J.i18n.GT._ ("Spin"), "spinOn", J.i18n.GT._ ("On"), "spinOff", J.i18n.GT._ ("Off"), "[set_spin_X]Menu", J.i18n.GT._ ("Set X Rate"), "[set_spin_Y]Menu", J.i18n.GT._ ("Set Y Rate"), "[set_spin_Z]Menu", J.i18n.GT._ ("Set Z Rate"), "[set_spin_FPS]Menu", J.i18n.GT._ ("Set FPS"), "s0", "0", "s5", "5", "s10", "10", "s20", "20", "s30", "30", "s40", "40", "s50", "50", "FRAMESanimateMenu", J.i18n.GT._ ("Animation"), "animModeMenu", J.i18n.GT._ ("Animation Mode"), "onceThrough", J.i18n.GT._ ("Play Once"), "palindrome", J.i18n.GT._ ("Palindrome"), "loop", J.i18n.GT._ ("Loop"), "play", J.i18n.GT._ ("Play"), "pause", J.i18n.GT._ ("Pause"), "resume", J.i18n.GT._ ("Resume"), "stop", J.i18n.GT._ ("Stop"), "nextframe", J.i18n.GT._ ("Next Frame"), "prevframe", J.i18n.GT._ ("Previous Frame"), "rewind", J.i18n.GT._ ("Rewind"), "playrev", J.i18n.GT._ ("Reverse"), "restart", J.i18n.GT._ ("Restart"), "FRAMESanimFpsMenu", J.i18n.GT._ ("Set FPS"), "animfps5", "5", "animfps10", "10", "animfps20", "20", "animfps30", "30", "animfps50", "50", "measureMenu", J.i18n.GT._ ("Measurements"), "measureOff", J.i18n.GT._ ("Double-Click begins and ends all measurements"), "measureDistance", J.i18n.GT._ ("Click for distance measurement"), "measureAngle", J.i18n.GT._ ("Click for angle measurement"), "measureTorsion", J.i18n.GT._ ("Click for torsion (dihedral) measurement"), "PDBmeasureSequence", J.i18n.GT._ ("Click two atoms to display a sequence in the console"), "measureDelete", J.i18n.GT._ ("Delete measurements"), "measureList", J.i18n.GT._ ("List measurements"), "distanceNanometers", J.i18n.GT._ ("Distance units nanometers"), "distanceAngstroms", J.i18n.GT._ ("Distance units Angstroms"), "distancePicometers", J.i18n.GT._ ("Distance units picometers"), "pickingMenu", J.i18n.GT._ ("Set picking"), "pickOff", J.i18n.GT._ ("Off"), "pickCenter", J.i18n.GT._ ("Center"), "pickIdent", J.i18n.GT._ ("Identity"), "pickLabel", J.i18n.GT._ ("Label"), "pickAtom", J.i18n.GT._ ("Select atom"), "PDBpickChain", J.i18n.GT._ ("Select chain"), "pickElement", J.i18n.GT._ ("Select element"), "PDBpickGroup", J.i18n.GT._ ("Select group"), "pickMolecule", J.i18n.GT._ ("Select molecule"), "SYMMETRYpickSite", J.i18n.GT._ ("Select site"), "SYMMETRYpickSymmetry", J.i18n.GT._ ("Show symmetry operation"), "pickSpin", J.i18n.GT._ ("Spin"), "showMenu", J.i18n.GT._ ("Show"), "showConsole", J.i18n.GT._ ("Console"), "JSConsole", "JavaScript Console", "showFile", J.i18n.GT._ ("File Contents"), "showFileHeader", J.i18n.GT._ ("File Header"), "showHistory", J.i18n.GT._ ("History"), "showIsosurface", J.i18n.GT._ ("Isosurface JVXL data"), "showMeasure", J.i18n.GT._ ("Measurements"), "showMo", J.i18n.GT._ ("Molecular orbital JVXL data"), "showModel", J.i18n.GT._ ("Model"), "showOrient", J.i18n.GT._ ("Orientation"), "showSpacegroup", J.i18n.GT._ ("Space group"), "SYMMETRYshowSymmetry", J.i18n.GT._ ("Symmetry"), "showState", J.i18n.GT._ ("Current state"), "fileMenu", J.i18n.GT._ ("File"), "reload", J.i18n.GT._ ("Reload"), "SIGNEDloadPdb", J.i18n.GT._ ("Open from PDB"), "SIGNEDloadFileOrUrl", J.i18n.GT._ ("Open file or URL"), "SIGNEDloadFileUnitCell", J.i18n.GT._ ("Load full unit cell"), "SIGNEDloadScript", J.i18n.GT._ ("Open script"), "writeFileTextVARIABLE", J.i18n.GT._ ("Save a copy of {0}"), "writeState", J.i18n.GT._ ("Save script with state"), "writeHistory", J.i18n.GT._ ("Save script with history"), "SIGNEDNOGLwriteJpg", J.i18n.GT._ ("Export {0} image", "JPG"), "SIGNEDNOGLwritePng", J.i18n.GT._ ("Export {0} image", "PNG"), "SIGNEDNOGLwritePngJmol", J.i18n.GT._ ("Export {0} image", "PNG+JMOL"), "SIGNEDJAVAwriteGif", J.i18n.GT._ ("Export {0} image", "GIF"), "SIGNEDJAVAwritePovray", J.i18n.GT._ ("Export {0} image", "POV-Ray"), "SIGNEDwriteJmol", J.i18n.GT._ ("Save all as JMOL file (zip)"), "SIGNEDwriteIsosurface", J.i18n.GT._ ("Save JVXL isosurface"), "SIGNEDJAVAwriteVrml", J.i18n.GT._ ("Export {0} 3D model", "VRML"), "SIGNEDJAVAwriteX3d", J.i18n.GT._ ("Export {0} 3D model", "X3D"), "SIGNEDJAVAwriteIdtf", J.i18n.GT._ ("Export {0} 3D model", "IDTF"), "SIGNEDJAVAwriteMaya", J.i18n.GT._ ("Export {0} 3D model", "Maya"), "computationMenu", J.i18n.GT._ ("Computation"), "minimize", J.i18n.GT._ ("Optimize structure"), "modelkit", J.i18n.GT._ ("Model kit"), "UNITCELLshow", J.i18n.GT._ ("Unit cell"), "extractMOL", J.i18n.GT._ ("Extract MOL data"), "surfaceMenu", J.i18n.GT._ ("Surfaces"), "surfDots", J.i18n.GT._ ("Dot Surface"), "surfVDW", J.i18n.GT._ ("van der Waals Surface"), "surfMolecular", J.i18n.GT._ ("Molecular Surface"), "surfSolvent14", J.i18n.GT._ ("Solvent Surface ({0}-Angstrom probe)", "1.4"), "surfSolventAccessible14", J.i18n.GT._ ("Solvent-Accessible Surface (VDW + {0} Angstrom)", "1.4"), "CHARGEsurfMEP", J.i18n.GT._ ("Molecular Electrostatic Potential (range ALL)"), "CHARGEsurf2MEP", J.i18n.GT._ ("Molecular Electrostatic Potential (range -0.1 0.1)"), "surfOpaque", J.i18n.GT._ ("Make Opaque"), "surfTranslucent", J.i18n.GT._ ("Make Translucent"), "surfOff", J.i18n.GT._ ("Off"), "FILEUNITMenu", J.i18n.GT._ ("Symmetry"), "FILEMOLload", J.i18n.GT._ ("Reload {0}", "(molecular)"), "FILEUNITone", J.i18n.GT._ ("Reload {0}", "{1 1 1}"), "FILEUNITnine", J.i18n.GT._ ("Reload {0}", "{444 666 1}"), "FILEUNITnineRestricted", J.i18n.GT._ ("Reload {0} + Display {1}", ["{444 666 1}", "555"]), "FILEUNITninePoly", J.i18n.GT._ ("Reload + Polyhedra"), "[set_axes]Menu", J.i18n.GT._ ("Axes"), "[set_boundbox]Menu", J.i18n.GT._ ("Boundbox"), "[set_UNITCELL]Menu", J.i18n.GT._ ("Unit cell"), "off#axes", J.i18n.GT._ ("Hide"), "dotted", J.i18n.GT._ ("Dotted"), "byPixelMenu", J.i18n.GT._ ("Pixel Width"), "1p", J.i18n.GT._ ("{0} px", "1"), "3p", J.i18n.GT._ ("{0} px", "3"), "5p", J.i18n.GT._ ("{0} px", "5"), "10p", J.i18n.GT._ ("{0} px", "10"), "byAngstromMenu", J.i18n.GT._ ("Angstrom Width"), "10a", J.i18n.GT._ ("{0} \u00C5", "0.10"), "20a", J.i18n.GT._ ("{0} \u00C5", "0.20"), "25a", J.i18n.GT._ ("{0} \u00C5", "0.25"), "50a", J.i18n.GT._ ("{0} \u00C5", "0.50"), "100a", J.i18n.GT._ ("{0} \u00C5", "1.0"), "showSelectionsCB", J.i18n.GT._ ("Selection Halos"), "showHydrogensCB", J.i18n.GT._ ("Show Hydrogens"), "showMeasurementsCB", J.i18n.GT._ ("Show Measurements"), "perspectiveDepthCB", J.i18n.GT._ ("Perspective Depth"), "showBoundBoxCB", J.i18n.GT._ ("Boundbox"), "showAxesCB", J.i18n.GT._ ("Axes"), "showUNITCELLCB", J.i18n.GT._ ("Unit cell"), "colorrasmolCB", J.i18n.GT._ ("RasMol Colors"), "aboutComputedMenu", J.i18n.GT._ ("About..."), "APPLETjmolUrl", "http://www.jmol.org", "APPLETmouseManualUrl", J.i18n.GT._ ("Mouse Manual"), "APPLETtranslationUrl", J.i18n.GT._ ("Translations")]; J.i18n.GT.setDoTranslate (wasTranslating); return words; }); Clazz.overrideMethod (c$, "getMenuAsText", function (title) { return "# Jmol.mnu " + title + "\n\n" + "# Part I -- Menu Structure\n" + "# ------------------------\n\n" + this.dumpStructure (J.popup.MainPopupResourceBundle.menuContents) + "\n\n" + "# Part II -- Key Definitions\n" + "# --------------------------\n\n" + this.dumpStructure (J.popup.MainPopupResourceBundle.structureContents) + "\n\n" + "# Part III -- Word Translations\n" + "# -----------------------------\n\n" + this.dumpWords (); }, "~S"); $_M(c$, "dumpWords", ($fz = function () { var wordContents = this.getWordContents (); var s = new J.util.SB (); for (var i = 0; i < wordContents.length; i++) { var key = wordContents[i++]; if (this.structure.getProperty (key) == null) s.append (key).append (" | ").append (wordContents[i]).appendC ('\n'); } return s.toString (); }, $fz.isPrivate = true, $fz)); $_M(c$, "dumpStructure", ($fz = function (items) { var previous = ""; var s = new J.util.SB (); for (var i = 0; i < items.length; i++) { var key = items[i][0]; var label = this.words.getProperty (key); if (label != null) key += " | " + label; s.append (key).append (" = ").append (items[i][1] == null ? previous : (previous = items[i][1])).appendC ('\n'); } return s.toString (); }, $fz.isPrivate = true, $fz), "~A"); Clazz.defineStatics (c$, "MENU_NAME", "popupMenu"); c$.menuContents = c$.prototype.menuContents = [["@COLOR", "black white red orange yellow green cyan blue indigo violet"], ["@AXESCOLOR", "gray salmon maroon olive slateblue gold orchid"], ["popupMenu", "FRAMESbyModelComputedMenu configurationComputedMenu - selectMenuText viewMenu renderMenu colorMenu - surfaceMenu FILEUNITMenu - sceneComputedMenu zoomMenu spinMenu VIBRATIONMenu spectraMenu FRAMESanimateMenu - measureMenu pickingMenu - showConsole JSConsole showMenu fileMenu computationMenu - languageComputedMenu aboutComputedMenu"], ["selectMenuText", "hideNotSelectedCB showSelectionsCB - selectAll selectNone invertSelection - elementsComputedMenu SYMMETRYSelectComputedMenu - PDBproteinMenu PDBnucleicMenu PDBheteroMenu PDBcarboMenu PDBnoneOfTheAbove"], ["PDBproteinMenu", "PDBaaResiduesComputedMenu - allProtein proteinBackbone proteinSideChains - polar nonpolar - positiveCharge negativeCharge noCharge"], ["PDBcarboMenu", "PDBcarboResiduesComputedMenu - allCarbo"], ["PDBnucleicMenu", "PDBnucleicResiduesComputedMenu - allNucleic nucleicBackbone nucleicBases - DNA RNA - atPairs auPairs gcPairs"], ["PDBheteroMenu", "PDBheteroComputedMenu - allHetero Solvent Water - Ligand exceptWater nonWaterSolvent"], ["viewMenu", "best front left right top bottom back"], ["renderMenu", "perspectiveDepthCB showBoundBoxCB showUNITCELLCB showAxesCB stereoMenu - renderSchemeMenu - atomMenu labelMenu bondMenu hbondMenu ssbondMenu - PDBstructureMenu [set_axes]Menu [set_boundbox]Menu [set_UNITCELL]Menu"], ["renderSchemeMenu", "renderCpkSpacefill renderBallAndStick renderSticks renderWireframe PDBrenderCartoonsOnly PDBrenderTraceOnly"], ["atomMenu", "showHydrogensCB - atomNone - atom15 atom20 atom25 atom50 atom75 atom100"], ["bondMenu", "bondNone bondWireframe - bond100 bond150 bond200 bond250 bond300"], ["hbondMenu", "hbondCalc hbondNone hbondWireframe - PDBhbondSidechain PDBhbondBackbone - hbond100 hbond150 hbond200 hbond250 hbond300"], ["ssbondMenu", "ssbondNone ssbondWireframe - PDBssbondSidechain PDBssbondBackbone - ssbond100 ssbond150 ssbond200 ssbond250 ssbond300"], ["PDBstructureMenu", "structureNone - backbone cartoon cartoonRockets ribbons rockets strands trace"], ["VIBRATIONvectorMenu", "vectorOff vectorOn vibScale20 vibScale05 vector3 vector005 vector01 - vectorScale02 vectorScale05 vectorScale1 vectorScale2 vectorScale5"], ["stereoMenu", "stereoNone stereoRedCyan stereoRedBlue stereoRedGreen stereoCrossEyed stereoWallEyed"], ["labelMenu", "labelNone - labelSymbol labelName labelNumber - labelPositionMenu"], ["labelPositionMenu", "labelCentered labelUpperRight labelLowerRight labelUpperLeft labelLowerLeft"], ["colorMenu", "colorrasmolCB - [color_atoms]Menu [color_bonds]Menu [color_hbonds]Menu [color_ssbonds]Menu colorPDBStructuresMenu [color_isosurface]Menu - [color_labels]Menu [color_vectors]Menu - [color_axes]Menu [color_boundbox]Menu [color_UNITCELL]Menu [color_background]Menu"], ["[color_atoms]Menu", "schemeMenu - @COLOR - opaque translucent"], ["[color_bonds]Menu", "none - @COLOR - opaque translucent"], ["[color_hbonds]Menu", null], ["[color_ssbonds]Menu", null], ["[color_labels]Menu", null], ["[color_vectors]Menu", null], ["[color_backbone]Menu", "none - schemeMenu - @COLOR - opaque translucent"], ["[color_cartoon]sMenu", null], ["[color_ribbon]sMenu", null], ["[color_rockets]Menu", null], ["[color_strands]Menu", null], ["[color_trace]Menu", null], ["[color_background]Menu", "@COLOR"], ["[color_isosurface]Menu", "@COLOR - opaque translucent"], ["[color_axes]Menu", "@AXESCOLOR"], ["[color_boundbox]Menu", null], ["[color_UNITCELL]Menu", null], ["colorPDBStructuresMenu", "[color_backbone]Menu [color_cartoon]sMenu [color_ribbon]sMenu [color_rockets]Menu [color_strands]Menu [color_trace]Menu"], ["schemeMenu", "cpk - formalcharge partialcharge#CHARGE - altloc#PDB amino#PDB chain#PDB group#PDB molecule monomer#PDB shapely#PDB structure#PDB relativeTemperature#BFACTORS fixedTemperature#BFACTORS"], ["zoomMenu", "zoom50 zoom100 zoom150 zoom200 zoom400 zoom800 - zoomIn zoomOut"], ["spinMenu", "spinOn spinOff - [set_spin_X]Menu [set_spin_Y]Menu [set_spin_Z]Menu - [set_spin_FPS]Menu"], ["VIBRATIONMenu", "vibrationOff vibrationOn vibration20 vibration05 VIBRATIONvectorMenu"], ["spectraMenu", "hnmrMenu cnmrMenu"], ["FRAMESanimateMenu", "animModeMenu - play pause resume stop - nextframe prevframe rewind - playrev restart - FRAMESanimFpsMenu"], ["FRAMESanimFpsMenu", "animfps5 animfps10 animfps20 animfps30 animfps50"], ["measureMenu", "showMeasurementsCB - measureOff measureDistance measureAngle measureTorsion PDBmeasureSequence - measureDelete measureList - distanceNanometers distanceAngstroms distancePicometers"], ["pickingMenu", "pickOff pickCenter pickIdent pickLabel pickAtom pickMolecule pickElement PDBpickChain PDBpickGroup SYMMETRYpickSite pickSpin"], ["computationMenu", "minimize modelkit"], ["showMenu", "showHistory showFile showFileHeader - showOrient showMeasure - showSpacegroup showState SYMMETRYshowSymmetry UNITCELLshow - showIsosurface showMo - extractMOL"], ["fileMenu", "SIGNEDloadFileOrUrl SIGNEDloadPdb SIGNEDloadScript - reload SIGNEDloadFileUnitCell - writeFileTextVARIABLE writeState writeHistory SIGNEDwriteJmol SIGNEDwriteIsosurface - SIGNEDJAVAwriteGif SIGNEDNOGLwriteJpg SIGNEDNOGLwritePng SIGNEDNOGLwritePngJmol SIGNEDJAVAwritePovray - SIGNEDJAVAwriteVrml SIGNEDJAVAwriteX3d SIGNEDJAVAwriteIdtf SIGNEDJAVAwriteMaya"], ["[set_spin_X]Menu", "s0 s5 s10 s20 s30 s40 s50"], ["[set_spin_Y]Menu", null], ["[set_spin_Z]Menu", null], ["[set_spin_FPS]Menu", null], ["animModeMenu", "onceThrough palindrome loop"], ["surfaceMenu", "surfDots surfVDW surfSolventAccessible14 surfSolvent14 surfMolecular CHARGEsurf2MEP CHARGEsurfMEP surfMoComputedMenuText - surfOpaque surfTranslucent surfOff"], ["FILEUNITMenu", "SYMMETRYShowComputedMenu SYMMETRYhide FILEMOLload FILEUNITone FILEUNITnine FILEUNITnineRestricted FILEUNITninePoly"], ["[set_axes]Menu", "off#axes dotted - byPixelMenu byAngstromMenu"], ["[set_boundbox]Menu", null], ["[set_UNITCELL]Menu", null], ["byPixelMenu", "1p 3p 5p 10p"], ["byAngstromMenu", "10a 20a 25a 50a 100a"], ["aboutComputedMenu", "- "]]; c$.structureContents = c$.prototype.structureContents = [["colorrasmolCB", ""], ["hideNotSelectedCB", "set hideNotSelected true | set hideNotSelected false; hide(none)"], ["perspectiveDepthCB", ""], ["showAxesCB", "set showAxes true | set showAxes false;set axesMolecular"], ["showBoundBoxCB", ""], ["showHydrogensCB", ""], ["showMeasurementsCB", ""], ["showSelectionsCB", ""], ["showUNITCELLCB", ""], ["selectAll", "SELECT all"], ["selectNone", "SELECT none"], ["invertSelection", "SELECT not selected"], ["allProtein", "SELECT protein"], ["proteinBackbone", "SELECT protein and backbone"], ["proteinSideChains", "SELECT protein and not backbone"], ["polar", "SELECT protein and polar"], ["nonpolar", "SELECT protein and not polar"], ["positiveCharge", "SELECT protein and basic"], ["negativeCharge", "SELECT protein and acidic"], ["noCharge", "SELECT protein and not (acidic,basic)"], ["allCarbo", "SELECT carbohydrate"], ["allNucleic", "SELECT nucleic"], ["DNA", "SELECT dna"], ["RNA", "SELECT rna"], ["nucleicBackbone", "SELECT nucleic and backbone"], ["nucleicBases", "SELECT nucleic and not backbone"], ["atPairs", "SELECT a,t"], ["gcPairs", "SELECT g,c"], ["auPairs", "SELECT a,u"], ["A", "SELECT a"], ["C", "SELECT c"], ["G", "SELECT g"], ["T", "SELECT t"], ["U", "SELECT u"], ["allHetero", "SELECT hetero"], ["Solvent", "SELECT solvent"], ["Water", "SELECT water"], ["nonWaterSolvent", "SELECT solvent and not water"], ["exceptWater", "SELECT hetero and not water"], ["Ligand", "SELECT ligand"], ["PDBnoneOfTheAbove", "SELECT not(hetero,protein,nucleic,carbohydrate)"], ["best", "rotate best -1.0"], ["front", J.popup.MainPopupResourceBundle.Box ("moveto 2.0 front;delay 1")], ["left", J.popup.MainPopupResourceBundle.Box ("moveto 1.0 front;moveto 2.0 left;delay 1")], ["right", J.popup.MainPopupResourceBundle.Box ("moveto 1.0 front;moveto 2.0 right;delay 1")], ["top", J.popup.MainPopupResourceBundle.Box ("moveto 1.0 front;moveto 2.0 top;delay 1")], ["bottom", J.popup.MainPopupResourceBundle.Box ("moveto 1.0 front;moveto 2.0 bottom;delay 1")], ["back", J.popup.MainPopupResourceBundle.Box ("moveto 1.0 front;moveto 2.0 back;delay 1")], ["renderCpkSpacefill", "restrict bonds not selected;select not selected;spacefill 100%;color cpk"], ["renderBallAndStick", "restrict bonds not selected;select not selected;spacefill 23%AUTO;wireframe 0.15;color cpk"], ["renderSticks", "restrict bonds not selected;select not selected;wireframe 0.3;color cpk"], ["renderWireframe", "restrict bonds not selected;select not selected;wireframe on;color cpk"], ["PDBrenderCartoonsOnly", "restrict bonds not selected;select not selected;cartoons on;color structure"], ["PDBrenderTraceOnly", "restrict bonds not selected;select not selected;trace on;color structure"], ["atomNone", "cpk off"], ["atom15", "cpk 15%"], ["atom20", "cpk 20%"], ["atom25", "cpk 25%"], ["atom50", "cpk 50%"], ["atom75", "cpk 75%"], ["atom100", "cpk on"], ["bondNone", "wireframe off"], ["bondWireframe", "wireframe on"], ["bond100", "wireframe .1"], ["bond150", "wireframe .15"], ["bond200", "wireframe .2"], ["bond250", "wireframe .25"], ["bond300", "wireframe .3"], ["hbondCalc", "hbonds calculate"], ["hbondNone", "hbonds off"], ["hbondWireframe", "hbonds on"], ["PDBhbondSidechain", "set hbonds sidechain"], ["PDBhbondBackbone", "set hbonds backbone"], ["hbond100", "hbonds .1"], ["hbond150", "hbonds .15"], ["hbond200", "hbonds .2"], ["hbond250", "hbonds .25"], ["hbond300", "hbonds .3"], ["ssbondNone", "ssbonds off"], ["ssbondWireframe", "ssbonds on"], ["PDBssbondSidechain", "set ssbonds sidechain"], ["PDBssbondBackbone", "set ssbonds backbone"], ["ssbond100", "ssbonds .1"], ["ssbond150", "ssbonds .15"], ["ssbond200", "ssbonds .2"], ["ssbond250", "ssbonds .25"], ["ssbond300", "ssbonds .3"], ["structureNone", "backbone off;cartoons off;ribbons off;rockets off;strands off;trace off;"], ["backbone", "restrict not selected;select not selected;backbone 0.3"], ["cartoon", "restrict not selected;select not selected;set cartoonRockets false;cartoons on"], ["cartoonRockets", "restrict not selected;select not selected;set cartoonRockets;cartoons on"], ["ribbons", "restrict not selected;select not selected;ribbons on"], ["rockets", "restrict not selected;select not selected;rockets on"], ["strands", "restrict not selected;select not selected;strands on"], ["trace", "restrict not selected;select not selected;trace 0.3"], ["vibrationOff", "vibration off"], ["vibrationOn", "vibration on"], ["vibration20", "vibrationScale *= 2"], ["vibration05", "vibrationScale /= 2"], ["vectorOff", "vectors off"], ["vectorOn", "vectors on"], ["vector3", "vectors 3"], ["vector005", "vectors 0.05"], ["vector01", "vectors 0.1"], ["vectorScale02", "vector scale 0.2"], ["vectorScale05", "vector scale 0.5"], ["vectorScale1", "vector scale 1"], ["vectorScale2", "vector scale 2"], ["vectorScale5", "vector scale 5"], ["stereoNone", "stereo off"], ["stereoRedCyan", "stereo redcyan 3"], ["stereoRedBlue", "stereo redblue 3"], ["stereoRedGreen", "stereo redgreen 3"], ["stereoCrossEyed", "stereo -5"], ["stereoWallEyed", "stereo 5"], ["labelNone", "label off"], ["labelSymbol", "label %e"], ["labelName", "label %a"], ["labelNumber", "label %i"], ["labelCentered", "set labeloffset 0 0"], ["labelUpperRight", "set labeloffset 4 4"], ["labelLowerRight", "set labeloffset 4 -4"], ["labelUpperLeft", "set labeloffset -4 4"], ["labelLowerLeft", "set labeloffset -4 -4"], ["zoom50", "zoom 50"], ["zoom100", "zoom 100"], ["zoom150", "zoom 150"], ["zoom200", "zoom 200"], ["zoom400", "zoom 400"], ["zoom800", "zoom 800"], ["zoomIn", "move 0 0 0 40 0 0 0 0 1"], ["zoomOut", "move 0 0 0 -40 0 0 0 0 1"], ["spinOn", "spin on"], ["spinOff", "spin off"], ["s0", "0"], ["s5", "5"], ["s10", "10"], ["s20", "20"], ["s30", "30"], ["s40", "40"], ["s50", "50"], ["onceThrough", "anim mode once#"], ["palindrome", "anim mode palindrome#"], ["loop", "anim mode loop#"], ["play", "anim play#"], ["pause", "anim pause#"], ["resume", "anim resume#"], ["stop", "anim off#"], ["nextframe", "frame next#"], ["prevframe", "frame prev#"], ["playrev", "anim playrev#"], ["rewind", "anim rewind#"], ["restart", "anim on#"], ["animfps5", "anim fps 5#"], ["animfps10", "anim fps 10#"], ["animfps20", "anim fps 20#"], ["animfps30", "anim fps 30#"], ["animfps50", "anim fps 50#"], ["measureOff", "set pickingstyle MEASURE OFF; set picking OFF"], ["measureDistance", "set pickingstyle MEASURE; set picking MEASURE DISTANCE"], ["measureAngle", "set pickingstyle MEASURE; set picking MEASURE ANGLE"], ["measureTorsion", "set pickingstyle MEASURE; set picking MEASURE TORSION"], ["PDBmeasureSequence", "set pickingstyle MEASURE; set picking MEASURE SEQUENCE"], ["measureDelete", "measure delete"], ["measureList", "console on;show measurements"], ["distanceNanometers", "select *; set measure nanometers"], ["distanceAngstroms", "select *; set measure angstroms"], ["distancePicometers", "select *; set measure picometers"], ["pickOff", "set picking off"], ["pickCenter", "set picking center"], ["pickIdent", "set picking ident"], ["pickLabel", "set picking label"], ["pickAtom", "set picking atom"], ["PDBpickChain", "set picking chain"], ["pickElement", "set picking element"], ["PDBpickGroup", "set picking group"], ["pickMolecule", "set picking molecule"], ["SYMMETRYpickSite", "set picking site"], ["pickSpin", "set picking spin"], ["SYMMETRYpickSymmetry", "set picking symmetry"], ["showConsole", "console"], ["JSConsole", "JSCONSOLE"], ["showFile", "console on;show file"], ["showFileHeader", "console on;getProperty FileHeader"], ["showHistory", "console on;show history"], ["showIsosurface", "console on;show isosurface"], ["showMeasure", "console on;show measure"], ["showMo", "console on;show mo"], ["showModel", "console on;show model"], ["showOrient", "console on;show orientation"], ["showSpacegroup", "console on;show spacegroup"], ["showState", "console on;show state"], ["reload", "load \"\""], ["SIGNEDloadPdb", "load ?PdbId?"], ["SIGNEDloadFileOrUrl", "load ?"], ["SIGNEDloadFileUnitCell", "load ? {1 1 1}"], ["SIGNEDloadScript", "script ?.spt"], ["writeFileTextVARIABLE", "if (_applet && !_signedApplet) { console;show file } else { write file \"?FILE?\"}"], ["writeState", "if (_applet && !_signedApplet) { console;show state } else { write state \"?FILEROOT?.spt\"}"], ["writeHistory", "if (_applet && !_signedApplet) { console;show history } else { write history \"?FILEROOT?.his\"}"], ["SIGNEDwriteJmol", "write \"?FILEROOT?.jmol\""], ["SIGNEDwriteIsosurface", "write isosurface \"?FILEROOT?.jvxl\""], ["SIGNEDJAVAwriteGif", "write image \"?FILEROOT?.gif\""], ["SIGNEDNOGLwriteJpg", "write image \"?FILEROOT?.jpg\""], ["SIGNEDNOGLwritePng", "write image \"?FILEROOT?.png\""], ["SIGNEDNOGLwritePngJmol", "write PNGJ \"?FILEROOT?.png\""], ["SIGNEDJAVAwritePovray", "write POVRAY \"?FILEROOT?.pov\""], ["SIGNEDJAVAwriteVrml", "write VRML \"?FILEROOT?.wrl\""], ["SIGNEDJAVAwriteX3d", "write X3D \"?FILEROOT?.x3d\""], ["SIGNEDJAVAwriteIdtf", "write IDTF \"?FILEROOT?.idtf\""], ["SIGNEDJAVAwriteMaya", "write MAYA \"?FILEROOT?.ma\""], ["SYMMETRYshowSymmetry", "console on;show symmetry"], ["UNITCELLshow", "console on;show unitcell"], ["extractMOL", "console on;getproperty extractModel \"visible\" "], ["minimize", "minimize"], ["modelkit", "set modelkitmode"], ["surfDots", "dots on"], ["surfVDW", "isosurface delete resolution 0 solvent 0 translucent"], ["surfMolecular", "isosurface delete resolution 0 molecular translucent"], ["surfSolvent14", "isosurface delete resolution 0 solvent 1.4 translucent"], ["surfSolventAccessible14", "isosurface delete resolution 0 sasurface 1.4 translucent"], ["CHARGEsurfMEP", "isosurface delete resolution 0 vdw color range all map MEP translucent"], ["CHARGEsurf2MEP", "isosurface delete resolution 0 vdw color range -0.1 0.1 map MEP translucent"], ["surfOpaque", "mo opaque;isosurface opaque"], ["surfTranslucent", "mo translucent;isosurface translucent"], ["surfOff", "mo delete;isosurface delete;select *;dots off"], ["SYMMETRYhide", "draw sym_* delete"], ["FILEMOLload", "save orientation;load \"\";restore orientation;center"], ["FILEUNITone", "save orientation;load \"\" {1 1 1} ;restore orientation;center"], ["FILEUNITnine", "save orientation;load \"\" {444 666 1} ;restore orientation;center"], ["FILEUNITnineRestricted", "save orientation;load \"\" {444 666 1} ;restore orientation; unitcell on; display cell=555;center visible;zoom 200"], ["FILEUNITninePoly", "save orientation;load \"\" {444 666 1} ;restore orientation; unitcell on; display cell=555; polyhedra 4,6 (displayed);center (visible);zoom 200"], ["1p", "on"], ["3p", "3"], ["5p", "5"], ["10p", "10"], ["10a", "0.1"], ["20a", "0.20"], ["25a", "0.25"], ["50a", "0.50"], ["100a", "1.0"]]; });
import React, { Component } from 'react'; import logo from '../../logo.svg'; import bulma from '../../bulma-logo.png'; import '../../App.scss'; import { BrowserRouter as Router, Route, Link } from 'react-router-dom' class One extends Component { render() { return ( <div class="dropdown is-active"> <div class="dropdown-trigger"> <button class="button" aria-haspopup="true" aria-controls="dropdown-menu"> <span>Dropdown button</span> <span class="icon is-small"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> </button> </div> <div class="dropdown-menu" id="dropdown-menu" role="menu"> <div class="dropdown-content"> <a href="#" class="dropdown-item"> Dropdown item </a> <a class="dropdown-item"> Other dropdown item </a> <a href="#" class="dropdown-item is-active"> Active dropdown item </a> <a href="#" class="dropdown-item"> Other dropdown item </a> <hr class="dropdown-divider" /> <a href="#" class="dropdown-item"> With a divider </a> </div> </div> </div> ); } }
import React from 'react' const DEFAULT_SIZE = 24 export default ({ fill = 'currentColor', width = DEFAULT_SIZE, height = DEFAULT_SIZE, style = {}, ...props }) => ( <svg viewBox={ `0 0 ${ DEFAULT_SIZE } ${ DEFAULT_SIZE }` } style={{ fill, width, height, ...style }} { ...props } > <path d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M14.28,14.08L12.26,16.1C11.66,16.7 10.87,17 10.08,17C9.29,17 8.5,16.7 7.9,16.1C6.7,14.9 6.7,12.95 7.9,11.74L9.15,10.5L9.14,11.06C9.14,11.5 9.21,11.95 9.36,12.37L9.41,12.5L9.04,12.87C8.76,13.15 8.6,13.53 8.6,13.92C8.6,14.32 8.76,14.69 9.04,14.97C9.6,15.53 10.57,15.53 11.13,14.97L13.14,12.96C13.43,12.67 13.58,12.3 13.58,11.91C13.58,11.5 13.43,11.14 13.15,10.86C13,10.71 12.9,10.5 12.9,10.29C12.9,10.08 13,9.88 13.15,9.73C13.45,9.42 14,9.43 14.28,9.73C14.86,10.31 15.18,11.08 15.18,11.9C15.18,12.73 14.86,13.5 14.28,14.08M17.1,11.26L15.85,12.5L15.86,11.94C15.86,11.5 15.79,11.06 15.64,10.64L15.6,10.5L15.96,10.13C16.25,9.85 16.4,9.5 16.4,9.08C16.4,8.69 16.25,8.32 15.97,8.04C15.4,7.47 14.43,7.47 13.87,8.04L11.86,10.05C11.58,10.33 11.42,10.7 11.42,11.1C11.42,11.5 11.57,11.86 11.86,12.14C12,12.29 12.1,12.5 12.1,12.71C12.1,12.93 12,13.13 11.85,13.28C11.7,13.44 11.5,13.5 11.29,13.5C11.09,13.5 10.88,13.43 10.72,13.28C9.5,12.08 9.5,10.12 10.72,8.92L12.74,6.9C13.95,5.7 15.9,5.7 17.1,6.9C17.68,7.5 18,8.26 18,9.08C18,9.9 17.68,10.68 17.1,11.26Z" /> </svg> )
(function($) { var counter = 0; var DEFAULTS = { url: 'imageselect/server/upload.php', crop: { aspectRatio: null, minSize: null, maxSize: null, setSelect: null }, savingMessage: 'Saving...', loadingMessage: 'Loading...', uploadingMessage: 'Uploading...', invalidResponseMessage: 'Invalid server response.', cameraErrorMessage: 'Could not access the camera. ', cameraFallbackMessage: 'Your browser does not support camera.', minCropHeightMessage: 'Crop selection requires a height of :size.', maxCropWidthMessage: 'Crop selection exceeds maximum width of :size', maxCropHeightMessage: 'Crop selection exceeds maximum height of :size.', minCropWidthMessage: 'Crop selection requires a minimum width of :size.', }; window.ImgSelect = function(container, options) { this.options = $.extend({}, DEFAULTS, options || {}); this._container = container; this._alert = container.find('.imgs-alert'); this._crop = container.find('.imgs-crop-container'); this._camera = container.find('.imgs-webcam-container'); this._saveBtn = container.find('.imgs-save'); this._cancelBtn = container.find('.imgs-cancel'); this._captureBtn = container.find('.imgs-capture'); this.init(); } ImgSelect.prototype.init = function() { counter += 1; navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; // Upload btn event this._container.find('.imgs-upload').append('<input type="file" name="file">') .on('change', this.upload.bind(this)); // Camera btn event this._container.find('.imgs-webcam').on('click', this.camera.bind(this)); } ImgSelect.prototype.getData = function() { if (typeof this.options.data === 'function') { return this.options.data(); } return this.options.data || {}; } // Upload click event ImgSelect.prototype.upload = function(event) { var iframe, form, self = this, fileInput = $(event.target), fileInputClone = fileInput.clone(); this.removeCrop(); this.removeCamera(); this.alert(this.options.uploadingMessage, 2); // Create & add iframe to body iframe = $('<iframe name="iframe-transport-'+counter+'" style="display:none;"></iframe>'); iframe.appendTo('body'); // Add load event iframe.on('load', function() { var response = null; try { response = iframe.contents().find('body').html(); response = $.parseJSON(response); } catch (e) {} if (response) { self.uploadDone(response); } else { self.alert(self.options.invalidResponseMessage, 3); } window.setTimeout(function() { // Remove the iframe & form iframe.remove(); form.remove(); // Add the file button back $(event.currentTarget).append(fileInputClone); }, 100); }); // Create form form = $('<form style="display:none;"><form/>'); form.prop('method', 'POST'); form.prop('action', this.options.url); form.prop('target', iframe.prop('name')); form.prop('enctype', 'multipart/form-data'); form.prop('encoding', 'multipart/form-data'); form.append(fileInput); form.append('<input type="hidden" name="action" value="upload"/>'); // Add custom data to the form $.each(this.getData(), function(name, value) { $('<input type="hidden"/>') .prop('name', 'data['+name+']') .val(value) .appendTo(form); }); // Add & submit the form form.appendTo('body'); form.submit(); } // Camera click event ImgSelect.prototype.camera = function() { var self = this, captureCallback, saveImage = function(imageData) { self.alert(self.options.uploadingMessage, 2); $.ajax({ url: self.options.url, type: 'POST', dataType: 'json', data: { action: 'upload', file: imageData, data: self.getData(), } }) .done(function(response) { self.uploadDone(response) }) .fail(function() { self.alert(self.options.invalidResponseMessage, 3) }); }; this.removeCamera(); this.removeCrop(); this._camera.show(); this.alert(0); self._cancelBtn.on('click', self.removeCamera.bind(self)); if (!!navigator.getUserMedia && !!window.URL) { var video = $('<video autoplay style="display:none"></video>'); this._camera.html(video); navigator.getUserMedia({video: true}, function (stream) { this._stream = stream; video.attr('src', window.URL.createObjectURL(stream)); video.show(); self._captureBtn.show(); self._cancelBtn.show(); self._captureBtn.on('click', function() { var canvas = document.createElement('canvas'), ctx = canvas.getContext('2d'); canvas.width = video[0].videoWidth; canvas.height = video[0].videoHeight; ctx.drawImage(video[0], 0, 0); self.removeCamera(); saveImage( canvas.toDataURL('image/png').replace('data:image/png;base64,', '') ); }); }, function(error) { self.alert(self.options.cameraErrorMessage + error.name, 3); }); } else { self.alert(self.options.cameraFallbackMessage, 3); } } // Upload complete ImgSelect.prototype.uploadDone = function(response) { if (response.success) { this.alert(0); if (this.options.uploadComplete) { this.options.uploadComplete(response.data); } if (this.options.crop) { this.crop(response.data.url) } } else { this.alert(response.data || this.options.invalidResponseMessage, 3); } } // Show cropper ImgSelect.prototype.crop = function(imageUrl) { this.removeCrop(); this._cancelBtn.on('click', this.removeCrop.bind(this)); var self = this, img = new Image(), options = this.options.crop, coords, updateCoords = function(_coords) { coords = _coords; }, jcrop = { onChange: updateCoords, onRelease: updateCoords }; if (options.aspectRatio) jcrop.aspectRatio = options.aspectRatio; if (options.setSelect) jcrop.setSelect = options.setSelect; if (options.minSize) jcrop.minSize = options.minSize; if (options.maxSize) jcrop.maxSize = options.maxSize; self.alert(self.options.loadingMessage, 2); img.onload = function() { self.alert(0); self._cancelBtn.show(); jcrop.trueSize = [img.width, img.height]; var image = $('<img src="'+imageUrl+'?'+new Date().getTime()+'">').appendTo(self._crop); window.setTimeout(function() { image.Jcrop(jcrop); }, 100); self._crop.show(); self._saveBtn.on('click', function() { if (!self.validateCrop(coords||{})) return; self._saveBtn.prop('disabled', true); self.alert(self.options.savingMessage, 2); $.ajax({ url: self.options.url, type: 'POST', dataType: 'json', data: { action: 'crop', image: imageUrl.substr(imageUrl.lastIndexOf('/') + 1, imageUrl.length), coords: coords, data: self.getData(), } }) .done(function(response) { if (response.success) { self.alert(0); self.removeCrop(); if (self.options.cropComplete) self.options.cropComplete(response.data); } else { self.alert(response.data || self.options.invalidResponseMessage, 3); } }) .fail(function() { self.alert(self.options.invalidResponseMessage, 3) }) .always(function() { self._saveBtn.prop('disabled', false) }); }).show(); }; img.src = imageUrl; } // Crop validation ImgSelect.prototype.validateCrop = function(coords) { var o = this.options.crop, error = function(message, size) { return this.alert(message.replace(':size', size), 3); }; if (o.minSize) { if (o.minSize[0] && (coords.w||0) < o.minSize[0]) { return error(this.options.minCropWidthMessage, o.minSize[0]); } if (o.minSize[1] && (coords.h||0) < o.minSize[1]) { return error(this.options.minCropHeightMessage, o.minSize[1]); } } if (o.maxSize) { if (o.maxSize[0] && (coords.w||0) > o.maxSize[0]) { return error(this.options.maxCropWidthMessage, o.maxSize[0]); } if (o.maxSize[1] && (coords.h||0) > o.maxSize[1]) { return error(this.options.maxCropHeightMessage, o.maxSize[1]); } } return true; } // Remove camera ImgSelect.prototype.removeCamera = function() { try { this._stream.getTracks()[0].stop(); } catch (e) { } delete this._stream; this._camera.html(''); this._captureBtn.off('click').hide(); this._cancelBtn.off('click').hide(); } // Remove crop ImgSelect.prototype.removeCrop = function() { $(this._crop).html(''); this._saveBtn.off('click').hide(); this._cancelBtn.off('click').hide(); } ImgSelect.prototype.alert = function(message, type) { if (this.options.alert) { return this.options.alert(message, type); } if (!message) { return $(this._alert).hide(); } $(this._alert).html(message) .removeClass((type==1?'alert-danger alert-warning':type==2?'alert-danger alert-success':'alert-warning alert-danger')) .addClass('alert-'+(type==1?'success':type==2?'warning':'danger')) .show(); } })(jQuery);
import af from './translations/af' import ar from './translations/ar' import bg from './translations/bg' import bs from './translations/bs' import ca from './translations/ca' import cs from './translations/cs' import da from './translations/da' import de from './translations/de' import ee from './translations/ee' import el from './translations/el' import en from './translations/en' import es from './translations/es' import fa from './translations/fa' import fi from './translations/fi' import fo from './translations/fo' import fr from './translations/fr' import ge from './translations/ge' import gl from './translations/gl' import he from './translations/he' import hr from './translations/hr' import hi from './translations/hi' import hu from './translations/hu' import id from './translations/id' import is from './translations/is' import it from './translations/it' import ja from './translations/ja' import kk from './translations/kk' import ko from './translations/ko' import lb from './translations/lb' import lt from './translations/lt' import lv from './translations/lv' import mk from './translations/mk' import mn from './translations/mn' import nbNO from './translations/nb-NO' import nl from './translations/nl' import pl from './translations/pl' import ptBR from './translations/pt-BR' import ro from './translations/ro' import ru from './translations/ru' import sk from './translations/sk' import slSI from './translations/sl-SI' import srCYRL from './translations/sr-CYRL' import sr from './translations/sr' import sv from './translations/sv' import th from './translations/th' import tr from './translations/tr' import uk from './translations/uk' import ur from './translations/ur' import vi from './translations/vi' import zh from './translations/zh' import zhHK from './translations/zh-HK' export { af, ar, bg, bs, ca, cs, da, de, ee, el, en, es, fa, fi, fo, fr, ge, gl, he, hr, hi, hu, id, is, it, ja, kk, ko, lb, lt, lv, mk, mn, nbNO, nl, pl, ptBR, ro, ru, sk, slSI, srCYRL, sr, sv, th, tr, uk, ur, vi, zh, zhHK } // eslint-disable-next-line ;
class ItemsChangedEventArgs(EventArgs): """ Provides data for the System.Windows.Controls.ItemContainerGenerator.ItemsChanged event. """ Action=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the action that occurred on the items collection. Get: Action(self: ItemsChangedEventArgs) -> NotifyCollectionChangedAction """ ItemCount=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the number of items that were involved in the change. Get: ItemCount(self: ItemsChangedEventArgs) -> int """ ItemUICount=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the number of user interface (UI) elements involved in the change. Get: ItemUICount(self: ItemsChangedEventArgs) -> int """ OldPosition=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the position in the collection before the change occurred. Get: OldPosition(self: ItemsChangedEventArgs) -> GeneratorPosition """ Position=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the position in the collection where the change occurred. Get: Position(self: ItemsChangedEventArgs) -> GeneratorPosition """
let Matrix = require("./matrix.js") let Vector = require("./vector.js") class LinearAlgebra{ transpose(a){ let c; if(a instanceof Vector){ c = new Vector(a.dim); c.cols = a.rows; c.rows = a.cols; for(let i = 1; i <= c.dim; i++){ c.set(i, a.get(i)); } }else if(a instanceof Matrix){ c = new Matrix(a.cols, a.rows); for(let i = 1; i <= c.rows; i++){ for(let j = 1; j <= c.cols; j++){ c.set(i, j, a.get(j, i)); } } }else{ throw new Error("The parameter must be an object of class Vector or class Matrix."); } return c; } sum(a, b){ if(!(a instanceof Matrix) || !(b instanceof Matrix)){ throw new Error("Parameters must be Vector or Matrix class objects."); } if(a.rows != b.rows || a.cols != b.cols){ throw new Error("Arrays do not have the same dimension.") } let c; if(a instanceof Vector && b instanceof Vector){ c = new Vector(a.dim); c.rows = a.rows; c.cols = a.cols; for(let i = 1; i <= a.rows; i++){ c.set(i, a.get(i) + b.get(i)); } }else if(a instanceof Matrix && b instanceof Matrix){ c = new Matrix(a.rows, a.cols); for(let i = 1; i <= a.rows; i++){ for(let j = 1; j <= a.cols; j++){ c.set(i, j, a.get(i, j) + b.get(i, j)); } } } return c; } times(a, b){ let c; if(typeof(a) == "number"){ if(!(b instanceof Matrix)){ throw new Error("Parameter b must be an object of class Vector or class Matrix."); } if(b instanceof Vector){ c = new Vector(b.dim); c.rows = b.rows; c.cols = b.cols; for(let i = 1; i <= b.rows; i++){ c.set(i, a * b.get(i)); } }else if(b instanceof Matrix){ c = new Matrix(b.rows, b.cols); for(let i = 1; i <= b.rows; i++){ for(let j = 1; j <= b.cols; j++){ c.set(i, j, a * b.get(i, j)); } } }else{ } }else{ if(!(a instanceof Matrix) || !(b instanceof Matrix)){ throw new Error("Parameters must be Vector or Matrix class objects."); } if(a.rows != b.rows || a.cols != b.cols){ throw new Error("Arrays do not have the same dimension."); } if(a instanceof Vector && b instanceof Vector){ c = new Vector(a.dim); c.rows = a.rows; c.cols = a.cols; for(let i = 1; i <= a.rows; i++){ c.set(i, a.get(i) * b.get(i)); } }else if(a instanceof Matrix && b instanceof Matrix){ c = new Matrix(a.rows, a.cols); for(let i = 1; i <= a.rows; i++){ for(let j = 1; j <= a.cols; j++){ c.set(i, j, a.get(i, j) * b.get(i, j)); } } } } return c; } dot(a, b){ if(!(a instanceof Matrix) || !(b instanceof Matrix)){ throw new Error("Parameters must be Vector or Matrix class objects."); } if(a.cols != b.rows){ throw new Error("The number of columns in matrix A is not equal to the number of rows in matrix B.") } let c; if(a instanceof Vector && b instanceof Vector){ c = 0; for(let i = 1; i <= a.dim; i++){ c = c + a.get(i) * b.get(i); } }else{ c = new Matrix(a.rows, b.cols) for(let i = 1; i <= a.rows; i++){ for(let j = 1; j <= b.cols; j++){ for(let k = 1; k <= a.cols; k++){ c.set(i, j, c.get(i, j) + a.get(i, k) * b.get(k, j)); } } } } return c; } switchLine(a){ let c = new Matrix(a.rows, a.cols); let aux = 0; for(let j = pivotCoordinate; j <= pivotCoordinate; j++){ for(let i = pivotCoordinate; i < c.rows; i++){ if(c.get(i + 1, j) != 0){ for(let w = 1; w <= c.cols; w++){ aux = c.get(i + 1, w); c.set(i + 1, w, c.get(pivotCoordinate, w)); c.set(pivotCoordinate, w, aux); } return c; } } } } biggestFirstPivot(a){ let biggestNumber = 1; let finalLine = 1; let c = new Matrix(a.rows, a.cols); for(let i = 1; i <= c.rows; i++){ for(let j = 1; j <= 1; j++){ if(a.get(i, j) > biggestNumber){ biggestNumber = a.get(i, j); finalLine = i; } } } for(let i = 1; i <= c.rows; i++){ for(let j = 1; j <= c.cols; j++){ if(i == finalLine){ c.set(1, j, a.get(finalLine, j)); c.set(finalLine, j, a.get(1, j)); }else{ c.set(i, j, a.get(i, j)); } } } return c } gauss(a){ console.log("gauss begin"); console.timeLog(); if(!(a instanceof Matrix)){ throw new Error("Parameters must be Matrix class objects."); } let c = new Matrix(a.rows, a.cols); let k; let pivotCoordinate = 1; let aux2 = 1; let aux3 = 1; if(a.cols > a.rows){ c = this.biggestFirstPivot(a); } for(aux2; aux2 < c.rows; aux2++){ if(c.get(pivotCoordinate, pivotCoordinate) == 0){ c = this.switchLine(c); } if(c.get(aux2 + 1, pivotCoordinate) != 0){ if(aux2 + 1 == c.rows && c.get(aux2 + 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 + 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 + 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 + 1, j)); } pivotCoordinate++; }else if(aux2 + 1 < c.rows && c.get(aux2 + 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 + 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 + 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 + 1, j)); } } } if(pivotCoordinate > aux3){ aux3 = pivotCoordinate; aux2 = pivotCoordinate - 1; } } console.log("gauss end") console.timeLog(); return c; } solve(a){ console.time(); console.log("solve begin") console.timeLog(); if(!(a instanceof Matrix)){ throw new Error("Parameters must be Matrix class objects."); } let c = new Matrix(a.rows, a.cols); let vet = new Vector(a.rows); let k; let pivotCoordinate = c.rows; let aux2 = c.rows; let aux3 = c.rows; c = this.gauss(a); for(aux2; aux2 > 1; aux2--){ if(c.get(pivotCoordinate, pivotCoordinate) == 0){ c = this.switchLine(c); } if(c.get(aux2 - 1, pivotCoordinate) != 0){ if(aux2 - 1 == 1 && c.get(aux2 - 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 - 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 - 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 - 1, j)); } pivotCoordinate--; }else if(aux2 - 1 > 1 && c.get(aux2 - 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 - 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 - 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 - 1, j)); } } } if(pivotCoordinate < aux3){ aux3 = pivotCoordinate; aux2 = pivotCoordinate + 1; } } for(let i = 1; i <= c.rows; i++){ let k2 = 1 / c.get(i, i); for(let j = 1; j <= c.cols; j++){ c.set(i, j, k2 * c.get(i, j)); } } for(let j = c.cols; j <= c.cols; j++){ for(let i = 1; i <= c.rows; i++){ vet.elements[i - 1] = c.get(i, j); } } console.log("solve end"); console.timeLog(); console.timeEnd() return vet; } det(a){ if(!(a instanceof Matrix) && a instanceof Vector){ throw new Error("Parameters must be Matrix class objects."); } if(!(a.rows == a.cols)){ throw new Error("The number of rows and columns cannot be different."); } let c = this.gauss(a); let determinant = 1; for(let i = 1; i <= c.rows; i++){ determinant *= c.get(i, i); } return determinant; } gaussJordanInv(a){ if(!(a instanceof Matrix)){ throw new Error("Parameters must be Matrix class objects."); } let c = new Matrix(a.rows, a.cols); let k; let pivotCoordinate = c.rows; let aux2 = c.rows; let aux3 = c.rows; c = this.gauss(a); for(aux2; aux2 > 1; aux2--){ if(c.get(pivotCoordinate, pivotCoordinate) == 0){ c = this.switchLine(c); } if(c.get(aux2 - 1, pivotCoordinate) != 0){ if(aux2 - 1 == 1 && c.get(aux2 - 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 - 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 - 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 - 1, j)); } pivotCoordinate--; }else if(aux2 - 1 > 1 && c.get(aux2 - 1, pivotCoordinate) != 0){ k = -1 * (c.get(aux2 - 1, aux3) / c.get(pivotCoordinate,pivotCoordinate)); for(let j = 1; j <= c.cols; j++){ c.set(aux2 - 1, j, k * c.get(pivotCoordinate, j) + c.get(aux2 - 1, j)); } }else if(aux2 - 1 == 1 && c.get(aux2 - 1, pivotCoordinate) == 0){ pivotCoordinate--; } } if(pivotCoordinate < aux3){ aux3 = pivotCoordinate; aux2 = pivotCoordinate + 1; } } for(let i = 1; i <= c.rows; i++){ let k2 = 1 / c.get(i, i); for(let j = 1; j <= c.cols; j++){ c.set(i, j, k2 * c.get(i, j)); } } return c; } inverse(a){ let c = new Matrix(a.rows, a.cols); let id = new Matrix(a.rows, a.cols); let intm = new Matrix(a.rows, a.cols * 2); let inv = new Matrix(a.rows, a.cols); for(let i = 1; i <= a.rows; i++){ for(let j = 1; j <= a.cols; j++){ c.set(i, j, a.get(i, j)); } } id = this.gaussJordanInv(c); for(let i = 1; i <= c.rows; i++){ for(let j = 1; j <= intm.cols/2; j++){ intm.set(i, j, a.get(i, j)); } let counter = 1; for(let w = (intm.cols / 2) + 1; w <= intm.cols; w++){ intm.set(i, w, id.get(i, counter)); counter++; } } intm = this.gaussJordanInv(intm); for(let i = 1; i <= c.rows; i++){ let counter = (intm.cols / 2) + 1; for(let j = 1; j <= c.cols; j++){ inv.set(i, j, intm.get(i, counter)); counter++; } } return inv; } } module.exports = LinearAlgebra
import React from 'react'; import PropTypes from 'prop-types'; import { ActionBar, Breadcrumb, LayoutPanel } from 'fundamental-react'; import LuigiClient from '@luigi-project/client'; EntryNotFound.propTypes = { entryType: PropTypes.string.isRequired, entryId: PropTypes.string, navigate: PropTypes.func, }; export default function EntryNotFound({ entryType, entryId, navigate }) { const navigateToList = () => { navigate ? navigate() : LuigiClient.linkManager() .fromClosestContext() .navigate(''); }; return ( <> <header className="fd-has-background-color-background-2"> <section className="fd-has-padding-regular fd-has-padding-bottom-none"> <section> <Breadcrumb> <Breadcrumb.Item name={`${entryType}s`} url="#" onClick={() => navigateToList()} /> <Breadcrumb.Item /> </Breadcrumb> <ActionBar title={entryId || 'Loading name...'} /> </section> </section> </header> <LayoutPanel className="fd-has-padding-regular fd-margin--md"> {entryType} "{entryId}" doesn't exist. </LayoutPanel> </> ); }
/** * HYPERLOOP GENERATED - DO NOT MODIFY * * This source code is Copyright (c) 2018 by Appcelerator, Inc. * All Rights Reserved. This code contains patents and/or patents pending. */ var $dispatch = Hyperloop.dispatch, $init, $imports, $class; var NSObject = require('/hyperloop/foundation/nsobject'); /** * MapKit//Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/MapKit.framework/Headers/MKShape.h * @class */ function MKShape (pointer) { if (!(this instanceof MKShape)) { throw new TypeError('Cannot instantiate a class by calling it as a function'); } if (!$init) { $initialize(); } if (pointer) { var oldWrapper = Hyperloop.getWrapper(pointer.$native ? pointer.$native : pointer); if (oldWrapper) { if (oldWrapper.__proto__ !== this.__proto__) { oldWrapper = Object.setPrototypeOf(oldWrapper, this.__proto__); } return oldWrapper; } } if (!pointer) { pointer = Hyperloop.createProxy({ class: 'MKShape', alloc: true, init: 'init' }); } NSObject.call(this, pointer); Object.defineProperty(this, '$private', { value: {}, writable: true, enumerable: false, configurable: false }); } // superclass MKShape.prototype = Object.create(NSObject.prototype, { constructor: { value: MKShape, enumerable: false, writable: true, configurable: true } }); Object.setPrototypeOf(MKShape, NSObject); Object.defineProperty(MKShape, '$class', { get: function () { if (!$init) { $initialize(); } return $class; }, enumerable: false }); Object.defineProperty(MKShape, 'className', { value: 'MKShape', enumerable: false, writable: true }); Object.defineProperty(MKShape.prototype, 'className', { value: 'MKShape', enumerable: false, writable: true }); Object.defineProperty(MKShape.prototype, 'toString', { value: function () { return Hyperloop.stringValue(this.$native); }, enumerable: false, writable: true }); Object.defineProperty(MKShape, 'toString', { value: function () { return '[class MKShape]'; }, enumerable: false, writable: true }); function $initialize () { $imports = {}; $imports.NSString = require('/hyperloop/foundation/nsstring'); $class = Hyperloop.createProxy({ class: 'MKShape', alloc: false, init: 'class' }); Object.defineProperty(MKShape, '$imports', { value: $imports, writable: true, enumerable: false, configurable: false }); Object.defineProperty(MKShape, '$private', { value: {}, writable: true, enumerable: false, configurable: false }); // instance methods Object.defineProperty(MKShape.prototype, 'isEqual', { value: function (_object) { this.$private.isEqual = this.$private.isEqual || []; this.$private.isEqual.push(_object); var result = $dispatch(this.$native, 'isEqual:', [_object], true); return result; }, enumerable: false, writable: true }); Object.defineProperty(MKShape.prototype, 'release', { value: function () { var result = $dispatch(this.$native, 'release', null, true); return result; }, enumerable: false, writable: true }); Object.defineProperty(MKShape.prototype, 'self', { value: function () { var result = $dispatch(this.$native, 'self', null, true); if (result === undefined || result === null) return result; result = new this.constructor(result); var instance = result; return instance; }, enumerable: false, writable: true }); // instance properties Object.defineProperties(MKShape.prototype, { hash: { get: function () { if (!$init) { $initialize(); } return $dispatch(this.$native, 'hash'); }, enumerable: false }, title: { get: function () { if (!$init) { $initialize(); } return new $imports.NSString($dispatch(this.$native, 'title')); }, set: function (_title) { if (!$init) { $initialize(); } this.$private.title = _title; $dispatch(this.$native, 'setTitle:', _title); }, enumerable: false } }); $init = true; } /** * ticore compatibility with ES6 */ Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) { obj.__proto__ = proto; return obj; } module.exports = MKShape;
import './AudioComponent.html'; export default class AudioComponent { constructor() { this.playing = ''; this.audioCmp = ''; this.isAndroid = Ext.os.is.Android; } audioReady = (event) => { this.audioCmp = event.deatail.cmp; this.audioCmp.setControls(!this.isAndroid); } containerReady = (event) => { this.containerCmp = event.detail.cmp; this.containerCmp.setHidden(!this.isAndroid); } buttonReady = (event) => { this.buttonCmp = event.detail.cmp; let text; if (this.playing) { text = 'Play Audio'; } else { text = 'Pause Audio'; } this.buttonCmp.setText(text); this.buttonCmp.setHandler(this.toggleAudioAndroid); } toggleAudioAndroid = () => { if (this.playing) { this.audioCmp.pause(); } else { this.audioCmp.play(); } this.playing = !this.playing; } }
import redirect from "./redirect"; import firebaseManager from './firebaseManager' export const doGooglePopup = () => firebaseManager.sharedInstance.handleLogin() export const isAuthenticated = ctx => firebaseManager.sharedInstance.isLoggedIn() export const redirectIfAuthenticated = ctx => { if (isAuthenticated(ctx)) { redirect("/dashboard", ctx); return true; } return false; }; export const redirectIfNotAuthenticated = ctx => { if (!isAuthenticated(ctx)) { redirect("/login", ctx); return true; } return false; };
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=50) evaluation = dict(interval=50, metric='mAP', save_best='AP') optimizer = dict( type='Adam', lr=0.0015, ) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[200, 260]) total_epochs = 300 log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook'), # dict(type='TensorboardLoggerHook') ]) channel_cfg = dict( dataset_joints=17, dataset_channel=[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], ], inference_channel=[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]) data_cfg = dict( image_size=640, base_size=320, base_sigma=2, heatmap_size=[160], num_joints=channel_cfg['dataset_joints'], dataset_channel=channel_cfg['dataset_channel'], inference_channel=channel_cfg['inference_channel'], num_scales=1, scale_aware_sigma=False, ) # model settings model = dict( type='AssociativeEmbedding', pretrained='https://download.openmmlab.com/mmpose/' 'pretrain_models/hrnet_w48-8ef0771d.pth', backbone=dict( type='HRNet', in_channels=3, extra=dict( stage1=dict( num_modules=1, num_branches=1, block='BOTTLENECK', num_blocks=(4, ), num_channels=(64, )), stage2=dict( num_modules=1, num_branches=2, block='BASIC', num_blocks=(4, 4), num_channels=(48, 96)), stage3=dict( num_modules=4, num_branches=3, block='BASIC', num_blocks=(4, 4, 4), num_channels=(48, 96, 192)), stage4=dict( num_modules=3, num_branches=4, block='BASIC', num_blocks=(4, 4, 4, 4), num_channels=(48, 96, 192, 384))), ), keypoint_head=dict( type='AESimpleHead', in_channels=48, num_joints=17, num_deconv_layers=0, tag_per_joint=True, with_ae_loss=[True], extra=dict(final_conv_kernel=1, ), loss_keypoint=dict( type='MultiLossFactory', num_joints=17, num_stages=1, ae_loss_type='exp', with_ae_loss=[True], push_loss_factor=[0.001], pull_loss_factor=[0.001], with_heatmaps_loss=[True], heatmaps_loss_factor=[1.0])), train_cfg=dict( num_joints=channel_cfg['dataset_joints'], img_size=data_cfg['image_size']), test_cfg=dict( num_joints=channel_cfg['dataset_joints'], max_num_people=30, scale_factor=[1], with_heatmaps=[True], with_ae=[True], project2image=False, nms_kernel=5, nms_padding=2, tag_per_joint=True, detection_threshold=0.1, tag_threshold=1, use_detection_val=True, ignore_too_much=False, adjust=True, refine=True, flip_test=True, use_udp=True)) train_pipeline = [ dict(type='LoadImageFromFile'), dict( type='BottomUpRandomAffine', rot_factor=30, scale_factor=[0.75, 1.5], scale_type='short', trans_factor=40, use_udp=True), dict(type='BottomUpRandomFlip', flip_prob=0.5), dict(type='ToTensor'), dict( type='NormalizeTensor', mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), dict( type='BottomUpGenerateTarget', sigma=2, max_num_people=30, use_udp=True, ), dict( type='Collect', keys=['img', 'joints', 'targets', 'masks'], meta_keys=[]), ] val_pipeline = [ dict(type='LoadImageFromFile'), dict(type='BottomUpGetImgSize', test_scale_factor=[1], use_udp=True), dict( type='BottomUpResizeAlign', transforms=[ dict(type='ToTensor'), dict( type='NormalizeTensor', mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ], use_udp=True), dict( type='Collect', keys=['img'], meta_keys=[ 'image_file', 'aug_data', 'test_scale_factor', 'base_size', 'center', 'scale', 'flip_index' ]), ] test_pipeline = val_pipeline data_root = 'data/coco' data = dict( samples_per_gpu=8, workers_per_gpu=2, train=dict( type='BottomUpCocoDataset', ann_file=f'{data_root}/annotations/person_keypoints_train2017.json', img_prefix=f'{data_root}/train2017/', data_cfg=data_cfg, pipeline=train_pipeline), val=dict( type='BottomUpCocoDataset', ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', img_prefix=f'{data_root}/val2017/', data_cfg=data_cfg, pipeline=val_pipeline), test=dict( type='BottomUpCocoDataset', ann_file=f'{data_root}/annotations/person_keypoints_val2017.json', img_prefix=f'{data_root}/val2017/', data_cfg=data_cfg, pipeline=val_pipeline), )
import React from "react"; import PropTypes from "prop-types"; import Task from "./Task"; import { connect } from "react-redux"; import { archiveTask, pinTask } from "../lib/redux"; export function PureTaskList({ loading, tasks, onPinTask, onArchiveTask }) { const events = { onPinTask, onArchiveTask, }; const LoadingRow = ( <div className="loading-item"> <span className="glow-checkbox" /> <span className="glow-text"> <span>Loading</span> <span>cool</span> <span>state</span> </span> </div> ); if (loading) { return ( <div className="list-items"> {LoadingRow} {LoadingRow} {LoadingRow} {LoadingRow} {LoadingRow} {LoadingRow} </div> ); } if (tasks.length === 0) { return ( <div className="list-items"> <div className="wrapper-message"> <span className="icon-check" /> <div className="title-message">You have no tasks</div> <div className="subtitle-message">Sit back and relax</div> </div> </div> ); } const tasksInOrder = [ ...tasks.filter((t) => t.state === "TASK_PINNED"), ...tasks.filter((t) => t.state !== "TASK_PINNED"), ]; return ( <div className="list-items"> {tasksInOrder.map((task) => ( <Task key={task.id} task={task} {...events} /> ))} </div> ); } PureTaskList.propTypes = { /** Checks if it's in loading state */ loading: PropTypes.bool, /** The list of tasks */ tasks: PropTypes.arrayOf(Task.propTypes.task).isRequired, /** Event to change the task to pinned */ onPinTask: PropTypes.func.isRequired, /** Event to change the task to archived */ onArchiveTask: PropTypes.func.isRequired, }; PureTaskList.defaultProps = { loading: false, }; export default connect( ({ tasks }) => ({ tasks: tasks.filter( (t) => t.state === "TASK_INBOX" || t.state === "TASK_PINNED" ), }), (dispatch) => ({ onArchiveTask: (id) => dispatch(archiveTask(id)), onPinTask: (id) => dispatch(pinTask(id)), }) )(PureTaskList);
/* COPYRIGHT 2009 ESRI TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL Unpublished material - all rights reserved under the Copyright Laws of the United States and applicable international laws, treaties, and conventions. For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, 92373 USA email: [email protected] */ //>>built define("esri/dijit/InfoView","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/kernel dojo/has dojo/query dojo/dom dojo/dom-class dojo/dom-construct dojo/dom-geometry esri/kernel esri/dijit/_TouchBase".split(" "),function(h,m,n,d,p,q,u,r,k,e,l,s,t){h=h(null,{declaredClass:"esri.dijit.InfoView",_items:[],_top:null,_sections:[],_isDecelerate:!1,constructor:function(a,c){var b;this.container=r.byId(c);this._touchBase=t(this.container,null);this._slideDiv=e.create("div", null,this.container,"first");this.events=[];this._items=a.items;a.sections&&(this._sections=a.sections);k.add(this.container,"esriMobileInfoView");if(0===this._sections.length)e.create("div",{},this._slideDiv);else for(b=0;b<this._sections.length;b++){var d=e.create("div",{"class":"esriMobileInfoViewSection"},this._slideDiv);e.create("div",{innerHTML:this._sections[b].title},d)}for(b=0;b<this._items.length;b++){var f,d=0;this._items[b].section&&(d=this._items[b].section);switch(this._items[b].type){case "div":f= e.create("div",{"class":"esriMobileInfoViewItem",style:this._items[b].style},this._slideDiv.childNodes[d]),f=e.create("div",{innerHTML:this._items[b].text},f)}this._items[b].className&&k.add(f,this._items[b].className);f._index=b;f._item=this._items[b];this._items[b]._node=f}this.startTouchY=0},startup:function(){this.onCreate(this._items);this._animateTo(0)},destroy:function(){n.forEach(this.events,d.disconnect);this._touchBase=null;p.query("img",this.container).forEach(function(a){a._index=null; a._item=null;e.destroy(a)});this._items=null;e.destroy(this._slideDiv);e.destroy(this.container);this.container=this._slideDiv=null},getItems:function(){return this._items},setPreventDefault:function(a){this._touchBase.setPreventDefault(a)},enableTouchScroll:function(){this._touchBase.setPreventDefault(!0);this.events.push(d.connect(this._touchBase,"onTouchStart",this,this._onTouchStartHandler));this.events.push(d.connect(this._touchBase,"onTouchMove",this,this._onTouchMoveHandler));this.events.push(d.connect(this._touchBase, "onTouchEnd",this,this._onTouchEndHandler));this._slideDiv.style.webkitTransform="translate3d(0,"+this._top+"px, 0)"},disableTouchScroll:function(){d.disconnect(this.events.pop());d.disconnect(this.events.pop());d.disconnect(this.events.pop());this._touchBase.setPreventDefault(!1);this._slideDiv.style.webkitTransform="translate3d(0, 0px, 0)"},animateTo:function(){this._slideDiv.style.WebkitTransitionDuration="0s";this._animateTo(0)},onSelect:function(a){},onUnSelect:function(a){},onCreate:function(a){}, onClick:function(a){},onSwipeLeft:function(){},onSwipeRight:function(){},_onTouchStartHandler:function(a){this._slideDiv.style.WebkitTransitionDuration="0s";this._moveDirection=null;this._startTime=new Date;this.startTouchY=a.touches[0].clientY;this.contentStartOffsetY=this.contentOffsetY},_onTouchMoveHandler:function(a){this._moveDirection||(Math.abs(a.curY)>Math.abs(a.curX)?this._moveDirection="vertical":this._moveDirection="horizontal");"horizontal"!==this._moveDirection&&"vertical"===this._moveDirection&& this._animateTo(a.touches[0].clientY-this.startTouchY+this.contentStartOffsetY)},_onTouchEndHandler:function(a){this._endTime=new Date;this._deltaMovement=a.curY;if("vertical"===this._moveDirection)this._shouldStartMomentum()?this._doMomentum():this._snapToBounds();else if("horizontal"===this._moveDirection)if("left"===a.swipeDirection)this.onSwipeLeft();else if("right"===a.swipeDirection)this.onSwipeRight()},_shouldStartMomentum:function(){this._diff=this._endTime-this._startTime;this._velocity= this._deltaMovement/this._diff;return 0.2<Math.abs(this._velocity)&&200>this._diff?!0:!1},_pullToStop:function(a){80<Math.abs(a)&&(a=0<a?80:-contentBox.h+parentBox.h-10-80);console.log(a);this._slideDiv.style.webkitTransition="-webkit-transform 200ms cubic-bezier(0, 0, 1, 1)";var c=d.connect(this._slideDiv,"webkitTransitionEnd",this,function(){0<a?this._animateTo(0):this._animateTo(-contentBox.h+parentBox.h-10);d.disconnect(c)});this._animateTo(a)},_doMomentum:function(){var a,c;a=l.getContentBox(this.container); var b=0>this._velocity?0.0010:-0.0010;c=-(this._velocity*this._velocity)/(2*b);var d=-this._velocity/b,b=3*0.6-0,f=1-b,g=0,e=0;if(a.h>this._slideDiv.scrollHeight)this.contentOffsetY=0,e=300;else if(0<this.contentOffsetY+c){a=0;for(c=Math.floor(d/20);a<c;a++)if(g=(f*20*a^3)+(b*20*a^2)+0*20*a+0,g=0>this._velocity?-g:g,0<this.contentOffsetY+g){e=20*a;break}0===e&&(e=300);this.contentOffsetY=0}else if(Math.abs(this.contentOffsetY+c)+a.h>this._slideDiv.scrollHeight){this.contentOffsetY=a.h-this._slideDiv.scrollHeight; a=0;for(c=Math.floor(d/20);a<c;a++)if(g=(f*20*a^3)+(b*20*a^2)+0*20*a+0,g=0>this._velocity?-g:g,Math.abs(this.contentOffsetY+g)>this._slideDiv.scrollHeight){e=20*a;break}}else e=d,this.contentOffsetY+=c;this._slideDiv.style.webkitTransition="-webkit-transform "+e+"ms cubic-bezier(0, 0.3, 0.6, 1)";this._animateTo(this.contentOffsetY)},_snapToBounds:function(){var a=l.getContentBox(this.container);a.h>this._slideDiv.scrollHeight?this.contentOffsetY=0:0<this.contentOffsetY?this.contentOffsetY=0:Math.abs(this.contentOffsetY)+ a.h>this._slideDiv.scrollHeight&&(this.contentOffsetY=a.h-this._slideDiv.scrollHeight);this._slideDiv.style.WebkitTransitionDuration="0.5s";this._animateTo(this.contentOffsetY)},_animateTo:function(a){this.contentOffsetY=a;this._slideDiv.style.webkitTransform="translate3d(0, "+a+"px, 0)"},_stopMomentum:function(){if(this._isDecelerating()){var a=document.defaultView.getComputedStyle(this._slideDiv,null),a=new WebKitCSSMatrix(a.webkitTransform);this._slideDiv.style.webkitTransition="";this.animateTo(a.m42)}}, _isDecelerating:function(){return this.isDecelerate?!0:!1},_toggleNode:function(a,c){"ON"===c.toggleState?(c.toggleState="OFF",c.src&&(a.src=c.src.toString()),this.onUnSelect(c)):(c.toggleState="ON",c.srcAlt&&(a.src=c.srcAlt),this.onSelect(c))}});q("extend-esri")&&m.setObject("dijit.InfoView",h,s);return h});
/** * Copyright 2015 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {BaseElement} from './base-element'; import {BaseTemplate, registerExtendedTemplate} from './service/template-impl'; import {CommonSignals} from './common-signals'; import { LogLevel, // eslint-disable-line no-unused-vars dev, devAssert, initLogConstructor, overrideLogLevel, setReportError, user, } from './log'; import {Services} from './services'; import {VisibilityState} from './visibility-state'; import {cssText as ampDocCss} from '../build/ampdoc.css'; import {cssText as ampSharedCss} from '../build/ampshared.css'; import { childElementsByTag, isConnectedNode, waitForBodyOpenPromise, } from './dom'; import {config} from './config'; import { createShadowDomWriter, createShadowRoot, importShadowBody, } from './shadow-embed'; import {disposeServicesForDoc} from './service'; import {getMode} from './mode'; import {hasRenderDelayingServices} from './render-delaying-services'; import { installAmpdocServices, installRuntimeServices, } from './service/core-services'; import { installExtensionsService, stubLegacyElements, } from './service/extensions-impl'; import {installStylesForDoc} from './style-installer'; import {internalRuntimeVersion} from './internal-version'; import {isExperimentOn, toggleExperiment} from './experiments'; import {parseUrlDeprecated} from './url'; import {reportErrorForWin} from './error'; import {setStyle} from './style'; import {startupChunk} from './chunk'; import {stubElementsForDoc} from './service/custom-element-registry'; initLogConstructor(); setReportError(reportErrorForWin.bind(null, self)); /** @const @private {string} */ const TAG = 'runtime'; /** * Applies the runtime to a given global scope for a single-doc mode. Multi * frame support is currently incomplete. * @param {!Window} global Global scope to adopt. * @param {function(!Window, !./service/extensions-impl.Extensions):!Promise} callback * @return {!Promise} */ function adoptShared(global, callback) { // Tests can adopt the same window twice. sigh. if (global.AMP_TAG) { return Promise.resolve(); } global.AMP_TAG = true; // If there is already a global AMP object we assume it is an array // of functions /** @const {!Array<function(!Object)|!ExtensionPayload>} */ const preregisteredExtensions = global.AMP || []; installExtensionsService(global); /** @const {!./service/extensions-impl.Extensions} */ const extensions = Services.extensionsFor(global); installRuntimeServices(global); stubLegacyElements(global); global.AMP = { win: global, // Might not be available in tests. '_': global.AMP ? global.AMP['_'] : undefined, }; // `AMP.extension()` function is only installed in a non-minified mode. // This function is meant to play the same role for development and testing // as `AMP.push()` in production. if (!getMode().minified) { /** * @param {string} unusedName * @param {string} unusedVersion * @param {function(!Object)} installer * @const */ global.AMP.extension = function(unusedName, unusedVersion, installer) { installer(global.AMP); }; } /** @const */ global.AMP.config = config; global.AMP.BaseElement = BaseElement; global.AMP.BaseTemplate = BaseTemplate; /** * Registers an extended element and installs its styles. * @param {string} name * @param {function(new:BaseElement, !Element)} implementationClass * @param {?string|undefined} css */ global.AMP.registerElement = extensions.addElement.bind(extensions); /** * Registers an extended template. * @param {string} name * @param {function(new:BaseTemplate)} implementationClass */ global.AMP.registerTemplate = function(name, implementationClass) { registerExtendedTemplate(global, name, implementationClass); }; /** * Registers an ampdoc service. * @param {string} name * @param {function(new:Object, !./service/ampdoc-impl.AmpDoc)} implementationClass */ global.AMP.registerServiceForDoc = extensions.addService.bind(extensions); // Experiments. /** * @param {string} experimentId * @return {boolean} */ global.AMP.isExperimentOn = isExperimentOn.bind(null, global); /** * @param {string} experimentId * @param {boolean=} opt_on * @return {boolean} */ global.AMP.toggleExperiment = toggleExperiment.bind(null, global); /** * @param {!LogLevel} level */ global.AMP.setLogLevel = overrideLogLevel.bind(null); /** * Sets the function to forward tick events to. * @param {function(string,?string=,number=)} unusedFn * @param {function()=} opt_flush * @deprecated * @export */ global.AMP.setTickFunction = (unusedFn, opt_flush) => {}; // Run specific setup for a single-doc or shadow-doc mode. const iniPromise = callback(global, extensions); /** * @param {function(!Object,!Object)|!ExtensionPayload} fnOrStruct */ function installExtension(fnOrStruct) { const register = () => { iniPromise.then(() => { if (typeof fnOrStruct == 'function') { fnOrStruct(global.AMP, global.AMP._); } else { extensions.registerExtension(fnOrStruct.n, fnOrStruct.f, global.AMP); } }); }; // We support extension declarations which declare they have an // "intermediate" dependency that needs to be loaded before they // can execute. if (!(typeof fnOrStruct == 'function') && fnOrStruct.i) { preloadDeps(extensions, fnOrStruct).then(function() { return startRegisterOrChunk(global, fnOrStruct, register); }); } else { startRegisterOrChunk(global, fnOrStruct, register); } } // Handle high priority extensions now, and if necessary issue // requests for new extensions (used for experimental version // locking). for (let i = 0; i < preregisteredExtensions.length; i++) { const fnOrStruct = preregisteredExtensions[i]; if (maybeLoadCorrectVersion(global, fnOrStruct)) { preregisteredExtensions.splice(i--, 1); } else if (typeof fnOrStruct == 'function' || fnOrStruct.p == 'high') { try { installExtension(fnOrStruct); } catch (e) { // Throw errors outside of loop in its own micro task to // avoid on error stopping other extensions from loading. dev().error(TAG, 'Extension failed: ', e, fnOrStruct.n); } // We handled the entry. Remove from set for future execution. preregisteredExtensions.splice(i--, 1); } } maybePumpEarlyFrame(global, () => { /** * Registers a new custom element. * @param {function(!Object, !Object)|!ExtensionPayload} fnOrStruct */ global.AMP.push = function(fnOrStruct) { if (maybeLoadCorrectVersion(global, fnOrStruct)) { return; } installExtension(fnOrStruct); }; // Execute asynchronously scheduled elements. for (let i = 0; i < preregisteredExtensions.length; i++) { const fnOrStruct = preregisteredExtensions[i]; if (maybeLoadCorrectVersion(global, fnOrStruct)) { continue; } try { installExtension(fnOrStruct); } catch (e) { // Throw errors outside of loop in its own micro task to // avoid on error stopping other extensions from loading. dev().error(TAG, 'Extension failed: ', e, fnOrStruct.n); } } // Make sure we empty the array of preregistered extensions. // Technically this is only needed for testing, as everything should // go out of scope here, but just making sure. preregisteredExtensions.length = 0; }); // If the closure passed to maybePumpEarlyFrame didn't execute // immediately we need to keep pushing onto preregisteredExtensions if (!global.AMP.push) { global.AMP.push = /** @type {function((ExtensionPayload|function(!Object, !Object): ?))} */ (preregisteredExtensions.push.bind( preregisteredExtensions )); } // For iOS we need to set `cursor:pointer` to ensure that click events are // delivered. if (Services.platformFor(global).isIos()) { setStyle(global.document.documentElement, 'cursor', 'pointer'); } return iniPromise; } /** * @param {!./service/extensions-impl.Extensions} extensions * @param {function(!Object, !Object)|!ExtensionPayload} fnOrStruct * @return {!Promise} */ function preloadDeps(extensions, fnOrStruct) { // Allow a single string as the intermediate dependency OR allow // for an array if intermediate dependencies that needs to be // resolved first before executing this current extension. if (Array.isArray(fnOrStruct.i)) { const promises = fnOrStruct.i.map(dep => { return extensions.preloadExtension(dep); }); return Promise.all(promises); } else if (typeof fnOrStruct.i == 'string') { return extensions.preloadExtension(fnOrStruct.i); } dev().error( 'RUNTIME', 'dependency is neither an array or a string', fnOrStruct.i ); return Promise.resolve(); } /** * @param {!Window} global Global scope to adopt. * @param {function(!Object, !Object)|!ExtensionPayload} fnOrStruct * @param {function()} register */ function startRegisterOrChunk(global, fnOrStruct, register) { if (typeof fnOrStruct == 'function' || fnOrStruct.p == 'high') { // "High priority" extensions do not go through chunking. // This should be used for extensions that need to run early. // One example would be viewer communication that is required // to transition document from pre-render to visible (which // affects chunking itself). // We consider functions as high priority, because // - if in doubt, that is a better default // - the only actual user is a viewer integration that should // be high priority. Promise.resolve().then(register); } else { register.displayName = fnOrStruct.n; startupChunk(global.document, register); } } /** * Applies the runtime to a given global scope for a single-doc mode. * Multi frame support is currently incomplete. * @param {!Window} global Global scope to adopt. * @return {!Promise} */ export function adopt(global) { return adoptShared(global, global => { const {documentElement} = global.document; const ampdocService = Services.ampdocServiceFor(global); const ampdoc = ampdocService.getSingleDoc(); global.AMP.ampdoc = ampdoc; const viewer = Services.viewerForDoc(documentElement); global.AMP.viewer = viewer; if (getMode().development) { global.AMP.toggleRuntime = viewer.toggleRuntime.bind(viewer); global.AMP.resources = Services.resourcesForDoc(documentElement); } const viewport = Services.viewportForDoc(documentElement); global.AMP.viewport = {}; global.AMP.viewport.getScrollLeft = viewport.getScrollLeft.bind(viewport); global.AMP.viewport.getScrollWidth = viewport.getScrollWidth.bind(viewport); global.AMP.viewport.getWidth = viewport.getWidth.bind(viewport); return waitForBodyOpenPromise(global.document).then(() => { // Ensure that all declared extensions are marked and stubbed. stubElementsForDoc(ampdoc); }); }); } /** * Applies the runtime to a given global scope for shadow mode. * @param {!Window} global Global scope to adopt. * @return {!Promise} */ export function adoptShadowMode(global) { return adoptShared(global, (global, extensions) => { const manager = new MultidocManager( global, Services.ampdocServiceFor(global), extensions, Services.timerFor(global) ); /** * Registers a shadow root document via a fully fetched document. * @param {!Element} hostElement * @param {!Document} doc * @param {string} url * @param {!Object<string, string>=} opt_initParams * @return {!Object} */ global.AMP.attachShadowDoc = manager.attachShadowDoc.bind(manager); /** * Registers a shadow root document via a stream. * @param {!Element} hostElement * @param {string} url * @param {!Object<string, string>=} opt_initParams * @return {!Object} */ global.AMP.attachShadowDocAsStream = manager.attachShadowDocAsStream.bind( manager ); return waitForBodyOpenPromise(global.document); }); } /** * A manager for documents in the multi-doc environment. */ export class MultidocManager { /** * @param {!Window} win * @param {!./service/ampdoc-impl.AmpDocService} ampdocService * @param {!./service/extensions-impl.Extensions} extensions * @param {!./service/timer-impl.Timer} timer */ constructor(win, ampdocService, extensions, timer) { /** @const */ this.win = win; /** @private @const */ this.ampdocService_ = ampdocService; /** @private @const */ this.extensions_ = extensions; /** @private @const */ this.timer_ = timer; /** @private @const {!Array<!ShadowRoot>} */ this.shadowRoots_ = []; } /** * Attaches the shadow root and calls the supplied DOM builder. * @param {!Element} hostElement * @param {string} url * @param {!Object<string, string>|undefined} params * @param {function(!Object, !ShadowRoot, * !./service/ampdoc-impl.AmpDocShadow):!Promise} builder * @return {!Object} * @private */ attachShadowDoc_(hostElement, url, params, builder) { params = params || Object.create(null); this.purgeShadowRoots_(); setStyle(hostElement, 'visibility', 'hidden'); const shadowRoot = createShadowRoot(hostElement); if (shadowRoot.AMP) { user().warn(TAG, "Shadow doc wasn't previously closed"); this.closeShadowRoot_(shadowRoot); } const amp = {}; shadowRoot.AMP = amp; amp.url = url; const {origin} = parseUrlDeprecated(url); const ampdoc = this.ampdocService_.installShadowDoc(url, shadowRoot, { params, }); /** @const {!./service/ampdoc-impl.AmpDocShadow} */ amp.ampdoc = ampdoc; dev().fine(TAG, 'Attach to shadow root:', shadowRoot, ampdoc); // Install runtime CSS. installStylesForDoc( ampdoc, ampDocCss + ampSharedCss, /* callback */ null, /* opt_isRuntimeCss */ true ); // Instal doc services. installAmpdocServices(ampdoc); const viewer = Services.viewerForDoc(ampdoc); /** * Sets the document's visibility state. * @param {!VisibilityState} state */ amp['setVisibilityState'] = function(state) { ampdoc.overrideVisibilityState(state); }; // Messaging pipe. /** * Posts message to the ampdoc. * @param {string} eventType * @param {!JsonObject} data * @param {boolean} unusedAwaitResponse * @return {(!Promise<*>|undefined)} */ amp['postMessage'] = viewer.receiveMessage.bind(viewer); /** @type {function(string, *, boolean):(!Promise<*>|undefined)} */ let onMessage; /** * Provides a message delivery mechanism by which AMP document can send * messages to the viewer. * @param {function(string, *, boolean):(!Promise<*>|undefined)} callback */ amp['onMessage'] = function(callback) { onMessage = callback; }; viewer.setMessageDeliverer((eventType, data, awaitResponse) => { // Special messages. if (eventType == 'broadcast') { this.broadcast_(data, shadowRoot); return awaitResponse ? Promise.resolve() : undefined; } // All other messages. if (onMessage) { return onMessage(eventType, data, awaitResponse); } }, origin); /** * Closes the document. The document can no longer be activated again. */ amp['close'] = () => { this.closeShadowRoot_(shadowRoot); }; if (getMode().development) { amp.toggleRuntime = viewer.toggleRuntime.bind(viewer); amp.resources = Services.resourcesForDoc(ampdoc); } // Start building the shadow doc DOM. builder(amp, shadowRoot, ampdoc).then(() => { // Document is ready. ampdoc.setReady(); ampdoc.signals().signal(CommonSignals.RENDER_START); setStyle(hostElement, 'visibility', 'visible'); }); // Store reference. if (!this.shadowRoots_.includes(shadowRoot)) { this.shadowRoots_.push(shadowRoot); } dev().fine(TAG, 'Shadow root initialization is done:', shadowRoot, ampdoc); return amp; } /** * Implementation for `attachShadowDoc` function. Attaches the shadow doc and * configures ampdoc for it. * @param {!Element} hostElement * @param {!Document} doc * @param {string} url * @param {!Object<string, string>=} opt_initParams * @return {!Object} */ attachShadowDoc(hostElement, doc, url, opt_initParams) { dev().fine(TAG, 'Attach shadow doc:', doc); // TODO(dvoytenko, #9490): once stable, port full document case to emulated // stream. return this.attachShadowDoc_( hostElement, url, opt_initParams, (amp, shadowRoot, ampdoc) => { // Install extensions. const extensionIds = this.mergeShadowHead_(ampdoc, shadowRoot, doc); this.extensions_.installExtensionsInDoc(ampdoc, extensionIds); // Append body. if (doc.body) { const body = importShadowBody(shadowRoot, doc.body, /* deep */ true); body.classList.add('amp-shadow'); ampdoc.setBody(body); } // TODO(dvoytenko): find a better and more stable way to make content // visible. E.g. integrate with dynamic classes. In shadow case // specifically, we have to wait for stubbing to complete, which may // take awhile due to importNode. setTimeout(() => { ampdoc.signals().signal(CommonSignals.RENDER_START); setStyle(hostElement, 'visibility', 'visible'); }, 50); return Promise.resolve(); } ); } /** * Implementation for `attachShadowDocAsStream` function. Attaches the shadow * doc and configures ampdoc for it. * @param {!Element} hostElement * @param {string} url * @param {!Object<string, string>=} opt_initParams * @return {!Object} */ attachShadowDocAsStream(hostElement, url, opt_initParams) { dev().fine(TAG, 'Attach shadow doc as stream'); return this.attachShadowDoc_( hostElement, url, opt_initParams, (amp, shadowRoot, ampdoc) => { // Start streaming. let renderStarted = false; const writer = createShadowDomWriter(this.win); amp['writer'] = writer; writer.onBody(doc => { // Install extensions. const extensionIds = this.mergeShadowHead_(ampdoc, shadowRoot, doc); // Apply all doc extensions. this.extensions_.installExtensionsInDoc(ampdoc, extensionIds); // Append shallow body. const body = importShadowBody( shadowRoot, dev().assertElement(doc.body), /* deep */ false ); body.classList.add('amp-shadow'); ampdoc.setBody(body); return body; }); writer.onBodyChunk(() => { // TODO(dvoytenko): find a better and more stable way to make // content visible. E.g. integrate with dynamic classes. In shadow // case specifically, we have to wait for stubbing to complete, // which may take awhile due to node importing. if (!renderStarted) { renderStarted = true; setTimeout(() => { ampdoc.signals().signal(CommonSignals.RENDER_START); setStyle(hostElement, 'visibility', 'visible'); }, 50); } }); return new Promise(resolve => { writer.onEnd(() => { resolve(); amp.writer = null; }); }); } ); } /** * Processes the contents of the shadow document's head. * @param {!./service/ampdoc-impl.AmpDoc} ampdoc * @param {!ShadowRoot} shadowRoot * @param {!Document} doc * @return {!Array<string>} * @private */ mergeShadowHead_(ampdoc, shadowRoot, doc) { const extensionIds = []; if (doc.head) { shadowRoot.AMP.head = doc.head; const parentLinks = {}; const links = childElementsByTag( dev().assertElement(this.win.document.head), 'link' ); for (let i = 0; i < links.length; i++) { const href = links[i].getAttribute('href'); if (href) { parentLinks[href] = true; } } for (let n = doc.head.firstElementChild; n; n = n.nextElementSibling) { const {tagName} = n; const name = n.getAttribute('name'); const rel = n.getAttribute('rel'); switch (tagName) { case 'TITLE': shadowRoot.AMP.title = n.textContent; dev().fine(TAG, '- set title: ', shadowRoot.AMP.title); break; case 'META': if (n.hasAttribute('charset')) { // Ignore. } else if (name == 'viewport') { // Ignore. } else { // TODO(dvoytenko): copy other meta tags. dev().warn(TAG, 'meta ignored: ', n); } break; case 'LINK': /** @const {string} */ const href = n.getAttribute('href'); if (rel == 'canonical') { shadowRoot.AMP.canonicalUrl = href; dev().fine(TAG, '- set canonical: ', shadowRoot.AMP.canonicalUrl); } else if (rel == 'stylesheet') { // Must be a font definition: no other stylesheets are allowed. if (parentLinks[href]) { dev().fine(TAG, '- stylesheet already included: ', href); } else { parentLinks[href] = true; const el = this.win.document.createElement('link'); el.setAttribute('rel', 'stylesheet'); el.setAttribute('type', 'text/css'); el.setAttribute('href', href); this.win.document.head.appendChild(el); dev().fine(TAG, '- import font to parent: ', href, el); } } else { dev().fine(TAG, '- ignore link rel=', rel); } break; case 'STYLE': if (n.hasAttribute('amp-boilerplate')) { // Ignore. dev().fine(TAG, '- ignore boilerplate style: ', n); } else if (n.hasAttribute('amp-custom')) { installStylesForDoc( ampdoc, n.textContent, /* callback */ null, /* isRuntimeCss */ false, 'amp-custom' ); dev().fine(TAG, '- import style: ', n); } else if (n.hasAttribute('amp-keyframes')) { installStylesForDoc( ampdoc, n.textContent, /* callback */ null, /* isRuntimeCss */ false, 'amp-keyframes' ); dev().fine(TAG, '- import style: ', n); } break; case 'SCRIPT': if (n.hasAttribute('src')) { dev().fine(TAG, '- src script: ', n); const src = n.getAttribute('src'); const isRuntime = src.indexOf('/amp.js') != -1 || src.indexOf('/v0.js') != -1; const customElement = n.getAttribute('custom-element'); const customTemplate = n.getAttribute('custom-template'); const versionRe = /-(\d+.\d+)(.max)?\.js$/; const match = versionRe.exec(src); const version = match ? match[1] : '0.1'; if (isRuntime) { dev().fine(TAG, '- ignore runtime script: ', src); } else if (customElement || customTemplate) { // This is an extension. this.extensions_.installExtensionForDoc( ampdoc, customElement || customTemplate, version ); dev().fine( TAG, '- load extension: ', customElement || customTemplate, ' ', version ); if (customElement) { extensionIds.push(customElement); } } else if (!n.hasAttribute('data-amp-report-test')) { user().error(TAG, '- unknown script: ', n, src); } } else { // Non-src version of script. const type = n.getAttribute('type') || 'application/javascript'; if (type.indexOf('javascript') == -1) { shadowRoot.appendChild(this.win.document.importNode(n, true)); dev().fine(TAG, '- non-src script: ', n); } else { user().error(TAG, '- unallowed inline javascript: ', n); } } break; case 'NOSCRIPT': // Ignore. break; default: user().error(TAG, '- UNKNOWN head element:', n); break; } } } return extensionIds; } /** * @param {*} data * @param {!ShadowRoot} sender * @private */ broadcast_(data, sender) { this.purgeShadowRoots_(); this.shadowRoots_.forEach(shadowRoot => { if (shadowRoot == sender) { // Don't broadcast to the sender. return; } // Broadcast message asynchronously. const viewer = Services.viewerForDoc(shadowRoot.AMP.ampdoc); this.timer_.delay(() => { viewer.receiveMessage( 'broadcast', /** @type {!JsonObject} */ (data), /* awaitResponse */ false ); }, 0); }); } /** * @param {!ShadowRoot} shadowRoot * @private */ closeShadowRoot_(shadowRoot) { this.removeShadowRoot_(shadowRoot); const amp = shadowRoot.AMP; delete shadowRoot.AMP; const {ampdoc} = amp; ampdoc.overrideVisibilityState(VisibilityState.INACTIVE); disposeServicesForDoc(ampdoc); } /** * @param {!ShadowRoot} shadowRoot * @private */ removeShadowRoot_(shadowRoot) { const index = this.shadowRoots_.indexOf(shadowRoot); if (index != -1) { this.shadowRoots_.splice(index, 1); } } /** * @param {!ShadowRoot} shadowRoot * @private */ closeShadowRootAsync_(shadowRoot) { this.timer_.delay(() => { this.closeShadowRoot_(shadowRoot); }, 0); } /** @private */ purgeShadowRoots_() { this.shadowRoots_.forEach(shadowRoot => { // The shadow root has been disconnected. Force it closed. if (!shadowRoot.host || !isConnectedNode(shadowRoot.host)) { user().warn(TAG, "Shadow doc wasn't previously closed"); this.removeShadowRoot_(shadowRoot); this.closeShadowRootAsync_(shadowRoot); } }); } } /** * For a given extension, checks that its version is the same * as the version of the main AMP binary. * If yes, returns false and does nothing else. * If they are different, returns false, and initiates a load * of the respective extension via a versioned URL. * * This is currently guarded by the 'version-locking' experiment. * With this active, all scripts in a given page are guaranteed * to have the same AMP release version. * * @param {!Window} win * @param {function(!Object, !Object)|!ExtensionPayload} fnOrStruct * @return {boolean} */ function maybeLoadCorrectVersion(win, fnOrStruct) { if (!isExperimentOn(win, 'version-locking')) { return false; } if (typeof fnOrStruct == 'function') { return false; } const {v} = fnOrStruct; // This is non-obvious, but we only care about the release version, // not about the full rtv version, because these only differ // in the config that is fully determined by the primary binary. if (internalRuntimeVersion() == v) { return false; } // The :not is an extra prevention of recursion because it will be // added to script tags that go into the code path below. const scriptInHead = win.document.head./*OK*/ querySelector( `[custom-element="${fnOrStruct.n}"]:not([i-amphtml-inserted])` ); devAssert( scriptInHead, 'Expected to find script for extension: %s', fnOrStruct.n ); if (!scriptInHead) { return false; } // Mark the element as being replaced, so that the installExtension code // assumes it as not-present. Services.extensionsFor(win).reloadExtension(fnOrStruct.n, scriptInHead); return true; } /** * If it makes sense, let the browser paint the current frame before * executing the callback. * @param {!Window} win * @param {function()} cb Callback that should run after a frame was * pumped. */ function maybePumpEarlyFrame(win, cb) { if (!isExperimentOn(win, 'pump-early-frame')) { cb(); return; } // There is definitely nothing to draw yet, so we might as well // proceed. if (!win.document.body) { cb(); return; } if (hasRenderDelayingServices(win)) { cb(); return; } Services.timerFor(win).delay(cb, 1); }
(function(e){const i=e["he"]=e["he"]||{};i.dictionary=Object.assign(i.dictionary||{},{"%0 of %1":"0% מתוך %1","Align center":"יישור באמצע","Align left":"יישור לשמאל","Align right":"יישור לימין",Aquamarine:"",Big:"",Black:"","Block quote":"בלוק ציטוט",Blue:"","Blue marker":"סימון כחול",Bold:"מודגש","Bulleted List":"רשימה מנוקדת",Cancel:"ביטול","Cannot upload file:":"לא ניתן להעלות את הקובץ הבא:","Centered image":"תמונה ממרוכזת","Change image text alternative":"שינוי טקסט אלטרנטיבי לתמונה","Characters: %0":"מס' תווים: %0","Choose heading":"בחר סוג כותרת",Code:"קוד","Could not insert image at the current position.":"לא ניתן להוסיף תמונה במיקום הנוכחי","Could not obtain resized image URL.":"לא ניתן להשיג תמונה מוקטנת",Default:"ברירת מחדל","Dim grey":"","Document colors":"",Downloadable:"","Dropdown toolbar":"סרגל כלים נפתח","Edit link":"עריכת קישור","Editor toolbar":"סרגל הכלים","Enter image caption":"הזן כותרת תמונה","Font Color":"","Font Family":"","Font Size":"גודל טקסט","Full size image":"תמונה בפריסה מלאה",Green:"","Green marker":"סימון ירוק","Green pen":"עט ירוק",Grey:"",Heading:"כותרת","Heading 1":"כותרת 1","Heading 2":"כותרת 2","Heading 3":"כותרת 3","Heading 4":"כותרת 4","Heading 5":"כותרת 5","Heading 6":"כותרת 6",Highlight:"הדגשה",Huge:"","Image toolbar":"סרגל תמונה","image widget":"תמונה","Insert image":"הוספת תמונה","Insert image or file":"הוסף תמונה או קובץ","Insert paragraph after block":"","Insert paragraph before block":"","Inserting image failed":"הוספת תמונה נכשלה",Italic:"נטוי",Justify:"מרכוז גבולות","Left aligned image":"תמונה מיושרת לשמאל","Light blue":"","Light green":"","Light grey":"",Link:"קישור","Link URL":"קישור כתובת אתר",Next:"הבא","Numbered List":"רשימה ממוספרת","Open in a new tab":"","Open link in new tab":"פתח קישור בכרטיסייה חדשה",Orange:"",Paragraph:"פיסקה","Pink marker":"סימון וורוד",Previous:"הקודם",Purple:"",Red:"","Red pen":"עט אדום",Redo:"ביצוע מחדש","Remove color":"","Remove highlight":"הסר הדגשה","Rich Text Editor":"עורך טקסט עשיר","Rich Text Editor, %0":"עורך טקסט עשיר, %0","Right aligned image":"תמונה מיושרת לימין",Save:"שמירה","Selecting resized image failed":"בחירת תמונה מוקטנת נכשלה","Show more items":"הצד פריטים נוספים","Side image":"תמונת צד",Small:"","Text alignment":"יישור טקסט","Text alignment toolbar":"סרגל כלים יישור טקסט","Text alternative":"טקסט אלטרנטיבי","Text highlight toolbar":"סרגל הדגשת טקסט","This link has no URL":"לקישור זה אין כתובת אתר",Tiny:"",Turquoise:"",Undo:"ביטול",Unlink:"ביטול קישור","Upload failed":"העלאה נכשלה","Upload in progress":"העלאה מתבצעת",White:"","Widget toolbar":"סרגל יישומון","Words: %0":"מס' מילים: %0",Yellow:"","Yellow marker":"סימון צהוב"});i.getPluralForm=function(e){return e==1&&e%1==0?0:e==2&&e%1==0?1:e%10==0&&e%1==0&&e>10?2:3}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import frappe import unittest from bs4 import BeautifulSoup import re from frappe.utils import set_request from frappe.website.serve import get_response from frappe.utils import random_string from frappe.website.doctype.blog_post.blog_post import get_blog_list from frappe.website.utils import clear_website_cache from frappe.website.website_generator import WebsiteGenerator from frappe.custom.doctype.customize_form.customize_form import reset_customization test_dependencies = ['Blog Post'] class TestBlogPost(unittest.TestCase): def setUp(self): reset_customization('Blog Post') def test_generator_view(self): pages = frappe.get_all('Blog Post', fields=['name', 'route'], filters={'published': 1, 'route': ('!=', '')}, limit =1) set_request(path=pages[0].route) response = get_response() self.assertTrue(response.status_code, 200) html = response.get_data().decode() self.assertTrue('<article class="blog-content" itemscope itemtype="http://schema.org/BlogPosting">' in html) def test_generator_not_found(self): pages = frappe.get_all('Blog Post', fields=['name', 'route'], filters={'published': 0}, limit =1) route = f'test-route-{frappe.generate_hash(length=5)}' frappe.db.set_value('Blog Post', pages[0].name, 'route', route) set_request(path=route) response = get_response() self.assertTrue(response.status_code, 404) def test_category_link(self): # Make a temporary Blog Post (and a Blog Category) blog = make_test_blog('Test Category Link') # Visit the blog post page set_request(path=blog.route) blog_page_response = get_response() blog_page_html = frappe.safe_decode(blog_page_response.get_data()) # On blog post page find link to the category page soup = BeautifulSoup(blog_page_html, "lxml") category_page_link = list(soup.find_all('a', href=re.compile(blog.blog_category)))[0] category_page_url = category_page_link["href"] cached_value = frappe.db.value_cache[('DocType', 'Blog Post', 'name')] frappe.db.value_cache[('DocType', 'Blog Post', 'name')] = (('Blog Post',),) # Visit the category page (by following the link found in above stage) set_request(path=category_page_url) category_page_response = get_response() category_page_html = frappe.safe_decode(category_page_response.get_data()) # Category page should contain the blog post title self.assertIn(blog.title, category_page_html) # Cleanup frappe.db.value_cache[('DocType', 'Blog Post', 'name')] = cached_value frappe.delete_doc("Blog Post", blog.name) frappe.delete_doc("Blog Category", blog.blog_category) def test_blog_pagination(self): # Create some Blog Posts for a Blog Category category_title, blogs, BLOG_COUNT = "List Category", [], 4 for index in range(BLOG_COUNT): blog = make_test_blog(category_title) blogs.append(blog) filters = frappe._dict({"blog_category": scrub(category_title)}) # Assert that get_blog_list returns results as expected self.assertEqual(len(get_blog_list(None, None, filters, 0, 3)), 3) self.assertEqual(len(get_blog_list(None, None, filters, 0, BLOG_COUNT)), BLOG_COUNT) self.assertEqual(len(get_blog_list(None, None, filters, 0, 2)), 2) self.assertEqual(len(get_blog_list(None, None, filters, 2, BLOG_COUNT)), 2) # Cleanup Blog Post and linked Blog Category for blog in blogs: frappe.delete_doc(blog.doctype, blog.name) frappe.delete_doc("Blog Category", blogs[0].blog_category) def test_caching(self): # to enable caching frappe.flags.force_website_cache = True print(frappe.session.user) clear_website_cache() # first response no-cache pages = frappe.get_all('Blog Post', fields=['name', 'route'], filters={'published': 1, 'title': "_Test Blog Post"}, limit=1) route = pages[0].route set_request(path=route) # response = get_response() response = get_response() # TODO: enable this assert # self.assertIn(('X-From-Cache', 'False'), list(response.headers)) set_request(path=route) response = get_response() self.assertIn(('X-From-Cache', 'True'), list(response.headers)) frappe.flags.force_website_cache = True def test_spam_comments(self): # Make a temporary Blog Post (and a Blog Category) blog = make_test_blog('Test Spam Comment') # Create a spam comment frappe.get_doc( doctype="Comment", comment_type="Comment", reference_doctype="Blog Post", reference_name=blog.name, comment_email="<a href=\"https://example.com/spam/\">spam</a>", comment_by="<a href=\"https://example.com/spam/\">spam</a>", published=1, content="More spam content. <a href=\"https://example.com/spam/\">spam</a> with link.", ).insert() # Visit the blog post page set_request(path=blog.route) blog_page_response = get_response() blog_page_html = frappe.safe_decode(blog_page_response.get_data()) self.assertNotIn('<a href="https://example.com/spam/">spam</a>', blog_page_html) self.assertIn("More spam content. spam with link.", blog_page_html) # Cleanup frappe.delete_doc("Blog Post", blog.name) frappe.delete_doc("Blog Category", blog.blog_category) def scrub(text): return WebsiteGenerator.scrub(None, text) def make_test_blog(category_title="Test Blog Category"): category_name = scrub(category_title) if not frappe.db.exists('Blog Category', category_name): frappe.get_doc(dict( doctype = 'Blog Category', title=category_title)).insert() if not frappe.db.exists('Blogger', 'test-blogger'): frappe.get_doc(dict( doctype = 'Blogger', short_name='test-blogger', full_name='Test Blogger')).insert() test_blog = frappe.get_doc(dict( doctype = 'Blog Post', blog_category = category_name, blogger = 'test-blogger', title = random_string(20), route = random_string(20), content = random_string(20), published = 1 )).insert() return test_blog
# -*- coding: utf-8 -*- ''' Classes that manage file clients ''' from __future__ import absolute_import # Import python libs import contextlib import logging import hashlib import os import shutil import ftplib from tornado.httputil import parse_response_start_line, HTTPInputError # Import salt libs from salt.exceptions import ( CommandExecutionError, MinionError ) import salt.client import salt.crypt import salt.loader import salt.payload import salt.transport import salt.fileserver import salt.utils import salt.utils.files import salt.utils.templates import salt.utils.url import salt.utils.gzip_util import salt.utils.http import salt.utils.s3 from salt.utils.locales import sdecode from salt.utils.openstack.swift import SaltSwift # pylint: disable=no-name-in-module,import-error import salt.ext.six.moves.BaseHTTPServer as BaseHTTPServer from salt.ext.six.moves.urllib.error import HTTPError, URLError from salt.ext.six.moves.urllib.parse import urlparse, urlunparse # pylint: enable=no-name-in-module,import-error log = logging.getLogger(__name__) def get_file_client(opts, pillar=False): ''' Read in the ``file_client`` option and return the correct type of file server ''' client = opts.get('file_client', 'remote') if pillar and client == 'local': client = 'pillar' return { 'remote': RemoteClient, 'local': FSClient, 'pillar': LocalClient, }.get(client, RemoteClient)(opts) class Client(object): ''' Base class for Salt file interactions ''' def __init__(self, opts): self.opts = opts self.serial = salt.payload.Serial(self.opts) # Add __setstate__ and __getstate__ so that the object may be # deep copied. It normally can't be deep copied because its # constructor requires an 'opts' parameter. # The TCP transport needs to be able to deep copy this class # due to 'salt.utils.context.ContextDict.clone'. def __setstate__(self, state): # This will polymorphically call __init__ # in the derived class. self.__init__(state['opts']) def __getstate__(self): return {'opts': self.opts} def _check_proto(self, path): ''' Make sure that this path is intended for the salt master and trim it ''' if not path.startswith('salt://'): raise MinionError(u'Unsupported path: {0}'.format(path)) file_path, saltenv = salt.utils.url.parse(path) return file_path def _file_local_list(self, dest): ''' Helper util to return a list of files in a directory ''' if os.path.isdir(dest): destdir = dest else: destdir = os.path.dirname(dest) filelist = set() for root, dirs, files in os.walk(destdir, followlinks=True): for name in files: path = os.path.join(root, name) filelist.add(path) return filelist @contextlib.contextmanager def _cache_loc(self, path, saltenv='base', env=None): ''' Return the local location to cache the file, cache dirs will be made ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env dest = salt.utils.path_join(self.opts['cachedir'], 'files', saltenv, path) destdir = os.path.dirname(dest) cumask = os.umask(63) if not os.path.isdir(destdir): # remove destdir if it is a regular file to avoid an OSError when # running os.makedirs below if os.path.isfile(destdir): os.remove(destdir) os.makedirs(destdir) yield dest os.umask(cumask) def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, env=None): ''' Copies a file from the local files or master depending on implementation ''' raise NotImplementedError def file_list_emptydirs(self, saltenv='base', prefix='', env=None): ''' List the empty dirs ''' raise NotImplementedError def cache_file(self, path, saltenv='base', env=None): ''' Pull a file down from the file server and store it in the minion file cache ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env return self.get_url(path, '', True, saltenv) def cache_files(self, paths, saltenv='base', env=None): ''' Download a list of files stored on the master and put them in the minion file cache ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] if isinstance(paths, str): paths = paths.split(',') for path in paths: ret.append(self.cache_file(path, saltenv)) return ret def cache_master(self, saltenv='base', env=None): ''' Download and cache all files on a master in a specified environment ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] for path in self.file_list(saltenv): ret.append(self.cache_file(salt.utils.url.create(path), saltenv)) return ret def cache_dir(self, path, saltenv='base', include_empty=False, include_pat=None, exclude_pat=None, env=None): ''' Download all of the files in a subdir of the master ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] path = self._check_proto(sdecode(path)) # We want to make sure files start with this *directory*, use # '/' explicitly because the master (that's generating the # list of files) only runs on POSIX if not path.endswith('/'): path = path + '/' log.info( 'Caching directory \'{0}\' for environment \'{1}\''.format( path, saltenv ) ) # go through the list of all files finding ones that are in # the target directory and caching them for fn_ in self.file_list(saltenv): fn_ = sdecode(fn_) if fn_.strip() and fn_.startswith(path): if salt.utils.check_include_exclude( fn_, include_pat, exclude_pat): fn_ = self.cache_file(salt.utils.url.create(fn_), saltenv) if fn_: ret.append(fn_) if include_empty: # Break up the path into a list containing the bottom-level # directory (the one being recursively copied) and the directories # preceding it # separated = string.rsplit(path, '/', 1) # if len(separated) != 2: # # No slashes in path. (So all files in saltenv will be copied) # prefix = '' # else: # prefix = separated[0] dest = salt.utils.path_join( self.opts['cachedir'], 'files', saltenv ) for fn_ in self.file_list_emptydirs(saltenv): fn_ = sdecode(fn_) if fn_.startswith(path): minion_dir = '{0}/{1}'.format(dest, fn_) if not os.path.isdir(minion_dir): os.makedirs(minion_dir) ret.append(minion_dir) return ret def cache_local_file(self, path, **kwargs): ''' Cache a local file on the minion in the localfiles cache ''' dest = os.path.join(self.opts['cachedir'], 'localfiles', path.lstrip('/')) destdir = os.path.dirname(dest) if not os.path.isdir(destdir): os.makedirs(destdir) shutil.copyfile(path, dest) return dest def file_local_list(self, saltenv='base', env=None): ''' List files in the local minion files and localfiles caches ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env filesdest = os.path.join(self.opts['cachedir'], 'files', saltenv) localfilesdest = os.path.join(self.opts['cachedir'], 'localfiles') fdest = self._file_local_list(filesdest) ldest = self._file_local_list(localfilesdest) return sorted(fdest.union(ldest)) def file_list(self, saltenv='base', prefix='', env=None): ''' This function must be overwritten ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env return [] def dir_list(self, saltenv='base', prefix='', env=None): ''' This function must be overwritten ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env return [] def symlink_list(self, saltenv='base', prefix='', env=None): ''' This function must be overwritten ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env return {} def is_cached(self, path, saltenv='base', env=None): ''' Returns the full path to a file if it is cached locally on the minion otherwise returns a blank string ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env if path.startswith('salt://'): path, senv = salt.utils.url.parse(path) if senv: saltenv = senv escaped = True if salt.utils.url.is_escaped(path) else False # also strip escape character '|' localsfilesdest = os.path.join( self.opts['cachedir'], 'localfiles', path.lstrip('|/')) filesdest = os.path.join( self.opts['cachedir'], 'files', saltenv, path.lstrip('|/')) extrndest = self._extrn_path(path, saltenv) if os.path.exists(filesdest): return salt.utils.url.escape(filesdest) if escaped else filesdest elif os.path.exists(localsfilesdest): return salt.utils.url.escape(localsfilesdest) if escaped else localsfilesdest elif os.path.exists(extrndest): return extrndest return '' def list_states(self, saltenv): ''' Return a list of all available sls modules on the master for a given environment ''' limit_traversal = self.opts.get('fileserver_limit_traversal', False) states = [] if limit_traversal: if saltenv not in self.opts['file_roots']: log.warning( 'During an attempt to list states for saltenv \'{0}\', ' 'the environment could not be found in the configured ' 'file roots'.format(saltenv) ) return states for path in self.opts['file_roots'][saltenv]: for root, dirs, files in os.walk(path, topdown=True): log.debug('Searching for states in dirs {0} and files ' '{1}'.format(dirs, files)) if not [filename.endswith('.sls') for filename in files]: # Use shallow copy so we don't disturb the memory used by os.walk. Otherwise this breaks! del dirs[:] else: for found_file in files: stripped_root = os.path.relpath(root, path).replace('/', '.') if salt.utils.is_windows(): stripped_root = stripped_root.replace('\\', '/') if found_file.endswith(('.sls')): if found_file.endswith('init.sls'): if stripped_root.endswith('.'): stripped_root = stripped_root.rstrip('.') states.append(stripped_root) else: if not stripped_root.endswith('.'): stripped_root += '.' if stripped_root.startswith('.'): stripped_root = stripped_root.lstrip('.') states.append(stripped_root + found_file[:-4]) else: for path in self.file_list(saltenv): if salt.utils.is_windows(): path = path.replace('\\', '/') if path.endswith('.sls'): # is an sls module! if path.endswith('{0}init.sls'.format('/')): states.append(path.replace('/', '.')[:-9]) else: states.append(path.replace('/', '.')[:-4]) return states def get_state(self, sls, saltenv): ''' Get a state file from the master and store it in the local minion cache; return the location of the file ''' if '.' in sls: sls = sls.replace('.', '/') sls_url = salt.utils.url.create(sls + '.sls') init_url = salt.utils.url.create(sls + '/init.sls') for path in [sls_url, init_url]: dest = self.cache_file(path, saltenv) if dest: return {'source': path, 'dest': dest} return {} def get_dir(self, path, dest='', saltenv='base', gzip=None, env=None): ''' Get a directory recursively from the salt-master ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] # Strip trailing slash path = self._check_proto(path).rstrip('/') # Break up the path into a list containing the bottom-level directory # (the one being recursively copied) and the directories preceding it separated = path.rsplit('/', 1) if len(separated) != 2: # No slashes in path. (This means all files in env will be copied) prefix = '' else: prefix = separated[0] # Copy files from master for fn_ in self.file_list(saltenv, prefix=path): # Prevent files in "salt://foobar/" (or salt://foo.sh) from # matching a path of "salt://foo" try: if fn_[len(path)] != '/': continue except IndexError: continue # Remove the leading directories from path to derive # the relative path on the minion. minion_relpath = fn_[len(prefix):].lstrip('/') ret.append( self.get_file( salt.utils.url.create(fn_), '{0}/{1}'.format(dest, minion_relpath), True, saltenv, gzip ) ) # Replicate empty dirs from master try: for fn_ in self.file_list_emptydirs(saltenv, prefix=path): # Prevent an empty dir "salt://foobar/" from matching a path of # "salt://foo" try: if fn_[len(path)] != '/': continue except IndexError: continue # Remove the leading directories from path to derive # the relative path on the minion. minion_relpath = fn_[len(prefix):].lstrip('/') minion_mkdir = '{0}/{1}'.format(dest, minion_relpath) if not os.path.isdir(minion_mkdir): os.makedirs(minion_mkdir) ret.append(minion_mkdir) except TypeError: pass ret.sort() return ret def get_url(self, url, dest, makedirs=False, saltenv='base', env=None, no_cache=False): ''' Get a single file from a URL. ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env url_data = urlparse(url) if url_data.scheme in ('file', ''): # Local filesystem if not os.path.isabs(url_data.path): raise CommandExecutionError( 'Path \'{0}\' is not absolute'.format(url_data.path) ) return url_data.path if url_data.scheme == 'salt': return self.get_file(url, dest, makedirs, saltenv) if dest: destdir = os.path.dirname(dest) if not os.path.isdir(destdir): if makedirs: os.makedirs(destdir) else: return '' elif not no_cache: dest = self._extrn_path(url, saltenv) destdir = os.path.dirname(dest) if not os.path.isdir(destdir): os.makedirs(destdir) if url_data.scheme == 's3': try: def s3_opt(key, default=None): '''Get value of s3.<key> from Minion config or from Pillar''' if 's3.' + key in self.opts: return self.opts['s3.' + key] try: return self.opts['pillar']['s3'][key] except (KeyError, TypeError): return default salt.utils.s3.query(method='GET', bucket=url_data.netloc, path=url_data.path[1:], return_bin=False, local_file=dest, action=None, key=s3_opt('key'), keyid=s3_opt('keyid'), service_url=s3_opt('service_url'), verify_ssl=s3_opt('verify_ssl', True), location=s3_opt('location')) return dest except Exception as exc: raise MinionError('Could not fetch from {0}. Exception: {1}'.format(url, exc)) if url_data.scheme == 'ftp': try: ftp = ftplib.FTP(url_data.hostname) ftp.login() with salt.utils.fopen(dest, 'wb') as fp_: ftp.retrbinary('RETR {0}'.format(url_data.path), fp_.write) return dest except Exception as exc: raise MinionError('Could not retrieve {0} from FTP server. Exception: {1}'.format(url, exc)) if url_data.scheme == 'swift': try: def swift_opt(key, default): '''Get value of <key> from Minion config or from Pillar''' if key in self.opts: return self.opts[key] try: return self.opts['pillar'][key] except (KeyError, TypeError): return default swift_conn = SaltSwift(swift_opt('keystone.user', None), swift_opt('keystone.tenant', None), swift_opt('keystone.auth_url', None), swift_opt('keystone.password', None)) swift_conn.get_object(url_data.netloc, url_data.path[1:], dest) return dest except Exception: raise MinionError('Could not fetch from {0}'.format(url)) get_kwargs = {} if url_data.username is not None \ and url_data.scheme in ('http', 'https'): netloc = url_data.netloc at_sign_pos = netloc.rfind('@') if at_sign_pos != -1: netloc = netloc[at_sign_pos + 1:] fixed_url = urlunparse( (url_data.scheme, netloc, url_data.path, url_data.params, url_data.query, url_data.fragment)) get_kwargs['auth'] = (url_data.username, url_data.password) else: fixed_url = url destfp = None try: # Tornado calls streaming_callback on redirect response bodies. # But we need streaming to support fetching large files (> RAM avail). # Here we working this around by disabling recording the body for redirections. # The issue is fixed in Tornado 4.3.0 so on_header callback could be removed # when we'll deprecate Tornado<4.3.0. # See #27093 and #30431 for details. # Use list here to make it writable inside the on_header callback. Simple bool doesn't # work here: on_header creates a new local variable instead. This could be avoided in # Py3 with 'nonlocal' statement. There is no Py2 alternative for this. write_body = [False] def on_header(hdr): try: hdr = parse_response_start_line(hdr) except HTTPInputError: # Not the first line, do nothing return write_body[0] = hdr.code not in [301, 302, 303, 307] if no_cache: result = [] def on_chunk(chunk): if write_body[0]: result.append(chunk) else: dest_tmp = "{0}.part".format(dest) destfp = salt.utils.fopen(dest_tmp, 'wb') def on_chunk(chunk): if write_body[0]: destfp.write(chunk) query = salt.utils.http.query( fixed_url, stream=True, streaming_callback=on_chunk, header_callback=on_header, username=url_data.username, password=url_data.password, **get_kwargs ) if 'handle' not in query: raise MinionError('Error: {0}'.format(query['error'])) if no_cache: return ''.join(result) else: destfp.close() destfp = None salt.utils.files.rename(dest_tmp, dest) return dest except HTTPError as exc: raise MinionError('HTTP error {0} reading {1}: {3}'.format( exc.code, url, *BaseHTTPServer.BaseHTTPRequestHandler.responses[exc.code])) except URLError as exc: raise MinionError('Error reading {0}: {1}'.format(url, exc.reason)) finally: if destfp is not None: destfp.close() def get_template( self, url, dest, template='jinja', makedirs=False, saltenv='base', env=None, **kwargs): ''' Cache a file then process it as a template ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env kwargs['saltenv'] = saltenv url_data = urlparse(url) sfn = self.cache_file(url, saltenv) if not os.path.exists(sfn): return '' if template in salt.utils.templates.TEMPLATE_REGISTRY: data = salt.utils.templates.TEMPLATE_REGISTRY[template]( sfn, **kwargs ) else: log.error('Attempted to render template with unavailable engine ' '{0}'.format(template)) return '' if not data['result']: # Failed to render the template log.error( 'Failed to render template with error: {0}'.format( data['data'] ) ) return '' if not dest: # No destination passed, set the dest as an extrn_files cache dest = self._extrn_path(url, saltenv) # If Salt generated the dest name, create any required dirs makedirs = True destdir = os.path.dirname(dest) if not os.path.isdir(destdir): if makedirs: os.makedirs(destdir) else: salt.utils.safe_rm(data['data']) return '' shutil.move(data['data'], dest) return dest def _extrn_path(self, url, saltenv): ''' Return the extn_filepath for a given url ''' url_data = urlparse(url) if salt.utils.is_windows(): netloc = salt.utils.sanitize_win_path_string(url_data.netloc) else: netloc = url_data.netloc return salt.utils.path_join( self.opts['cachedir'], 'extrn_files', saltenv, netloc, url_data.path ) class LocalClient(Client): ''' Use the local_roots option to parse a local file root ''' def __init__(self, opts): Client.__init__(self, opts) def _find_file(self, path, saltenv='base'): ''' Locate the file path ''' fnd = {'path': '', 'rel': ''} if saltenv not in self.opts['file_roots']: return fnd if salt.utils.url.is_escaped(path): # The path arguments are escaped path = salt.utils.url.unescape(path) for root in self.opts['file_roots'][saltenv]: full = os.path.join(root, path) if os.path.isfile(full): fnd['path'] = full fnd['rel'] = path return fnd return fnd def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, env=None): ''' Copies a file from the local files directory into :param:`dest` gzip compression settings are ignored for local files ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env path = self._check_proto(path) fnd = self._find_file(path, saltenv) if not fnd['path']: return '' return fnd['path'] def file_list(self, saltenv='base', prefix='', env=None): ''' Return a list of files in the given environment with optional relative prefix path to limit directory traversal ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] if saltenv not in self.opts['file_roots']: return ret prefix = prefix.strip('/') for path in self.opts['file_roots'][saltenv]: for root, dirs, files in os.walk( os.path.join(path, prefix), followlinks=True ): for fname in files: relpath = os.path.relpath(os.path.join(root, fname), path) ret.append(sdecode(relpath)) return ret def file_list_emptydirs(self, saltenv='base', prefix='', env=None): ''' List the empty dirs in the file_roots with optional relative prefix path to limit directory traversal ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] prefix = prefix.strip('/') if saltenv not in self.opts['file_roots']: return ret for path in self.opts['file_roots'][saltenv]: for root, dirs, files in os.walk( os.path.join(path, prefix), followlinks=True ): if len(dirs) == 0 and len(files) == 0: ret.append(sdecode(os.path.relpath(root, path))) return ret def dir_list(self, saltenv='base', prefix='', env=None): ''' List the dirs in the file_roots with optional relative prefix path to limit directory traversal ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = [] if saltenv not in self.opts['file_roots']: return ret prefix = prefix.strip('/') for path in self.opts['file_roots'][saltenv]: for root, dirs, files in os.walk( os.path.join(path, prefix), followlinks=True ): ret.append(sdecode(os.path.relpath(root, path))) return ret def hash_file(self, path, saltenv='base', env=None): ''' Return the hash of a file, to get the hash of a file in the file_roots prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env ret = {} try: path = self._check_proto(path) except MinionError: if not os.path.isfile(path): err = 'Specified file {0} is not present to generate hash' log.warning(err.format(path)) return ret else: opts_hash_type = self.opts.get('hash_type', 'md5') hash_type = getattr(hashlib, opts_hash_type) ret['hsum'] = salt.utils.get_hash( path, form=hash_type) ret['hash_type'] = opts_hash_type return ret path = self._find_file(path, saltenv)['path'] if not path: return {} ret = {} ret['hsum'] = salt.utils.get_hash(path, self.opts['hash_type']) ret['hash_type'] = self.opts['hash_type'] return ret def list_env(self, saltenv='base', env=None): ''' Return a list of the files in the file server's specified environment ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env return self.file_list(saltenv) def master_opts(self): ''' Return the master opts data ''' return self.opts def envs(self): ''' Return the available environments ''' ret = [] for saltenv in self.opts['file_roots']: ret.append(saltenv) return ret def ext_nodes(self): ''' Originally returned information via the external_nodes subsystem. External_nodes was deprecated and removed in 2014.1.6 in favor of master_tops (which had been around since pre-0.17). salt-call --local state.show_top ends up here, but master_tops has not been extended to support show_top in a completely local environment yet. It's worth noting that originally this fn started with if 'external_nodes' not in opts: return {} So since external_nodes is gone now, we are just returning the empty dict. ''' return {} class RemoteClient(Client): ''' Interact with the salt master file server. ''' def __init__(self, opts): Client.__init__(self, opts) self.channel = salt.transport.Channel.factory(self.opts) if hasattr(self.channel, 'auth'): self.auth = self.channel.auth else: self.auth = '' def _refresh_channel(self): ''' Reset the channel, in the event of an interruption ''' self.channel = salt.transport.Channel.factory(self.opts) return self.channel def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, env=None): ''' Get a single file from the salt-master path must be a salt server location, aka, salt://path/to/file, if dest is omitted, then the downloaded file will be placed in the minion cache ''' path, senv = salt.utils.url.split_env(path) if senv: saltenv = senv # Check if file exists on server, before creating files and # directories hash_server = self.hash_file(path, saltenv) if hash_server == '': log.debug( 'Could not find file from saltenv \'{0}\', \'{1}\''.format( saltenv, path ) ) return False if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env # Hash compare local copy with master and skip download # if no difference found. dest2check = dest if not dest2check: rel_path = self._check_proto(path) log.debug( 'In saltenv \'{0}\', looking at rel_path \'{1}\' to resolve ' '\'{2}\''.format(saltenv, rel_path, path) ) with self._cache_loc(rel_path, saltenv) as cache_dest: dest2check = cache_dest log.debug( 'In saltenv \'{0}\', ** considering ** path \'{1}\' to resolve ' '\'{2}\''.format(saltenv, dest2check, path) ) if dest2check and os.path.isfile(dest2check): hash_local = self.hash_file(dest2check, saltenv) if hash_local == hash_server: log.info( 'Fetching file from saltenv \'{0}\', ** skipped ** ' 'latest already in cache \'{1}\''.format( saltenv, path ) ) return dest2check log.debug( 'Fetching file from saltenv \'{0}\', ** attempting ** ' '\'{1}\''.format(saltenv, path) ) d_tries = 0 transport_tries = 0 path = self._check_proto(path) load = {'path': path, 'saltenv': saltenv, 'cmd': '_serve_file'} if gzip: gzip = int(gzip) load['gzip'] = gzip fn_ = None if dest: destdir = os.path.dirname(dest) if not os.path.isdir(destdir): if makedirs: os.makedirs(destdir) else: return False fn_ = salt.utils.fopen(dest, 'wb+') else: log.debug('No dest file found {0}'.format(dest)) while True: if not fn_: load['loc'] = 0 else: load['loc'] = fn_.tell() data = self.channel.send(load) try: if not data['data']: if not fn_ and data['dest']: # This is a 0 byte file on the master with self._cache_loc(data['dest'], saltenv) as cache_dest: dest = cache_dest with salt.utils.fopen(cache_dest, 'wb+') as ofile: ofile.write(data['data']) if 'hsum' in data and d_tries < 3: # Master has prompted a file verification, if the # verification fails, re-download the file. Try 3 times d_tries += 1 hsum = salt.utils.get_hash(dest, data.get('hash_type', 'md5')) if hsum != data['hsum']: log.warn('Bad download of file {0}, attempt {1} ' 'of 3'.format(path, d_tries)) continue break if not fn_: with self._cache_loc(data['dest'], saltenv) as cache_dest: dest = cache_dest # If a directory was formerly cached at this path, then # remove it to avoid a traceback trying to write the file if os.path.isdir(dest): salt.utils.rm_rf(dest) fn_ = salt.utils.fopen(dest, 'wb+') if data.get('gzip', None): data = salt.utils.gzip_util.uncompress(data['data']) else: data = data['data'] fn_.write(data) except (TypeError, KeyError) as e: transport_tries += 1 log.warning('Data transport is broken, got: {0}, type: {1}, ' 'exception: {2}, attempt {3} of 3'.format( data, type(data), e, transport_tries) ) self._refresh_channel() if transport_tries > 3: log.error('Data transport is broken, got: {0}, type: {1}, ' 'exception: {2}, ' 'Retry attempts exhausted'.format( data, type(data), e) ) break if fn_: fn_.close() log.info( 'Fetching file from saltenv \'{0}\', ** done ** ' '\'{1}\''.format(saltenv, path) ) else: log.debug( 'In saltenv \'{0}\', we are ** missing ** the file ' '\'{1}\''.format(saltenv, path) ) return dest def file_list(self, saltenv='base', prefix='', env=None): ''' List the files on the master ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_file_list'} return [sdecode(fn_) for fn_ in self.channel.send(load)] def file_list_emptydirs(self, saltenv='base', prefix='', env=None): ''' List the empty dirs on the master ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_file_list_emptydirs'} self.channel.send(load) def dir_list(self, saltenv='base', prefix='', env=None): ''' List the dirs on the master ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_dir_list'} return self.channel.send(load) def symlink_list(self, saltenv='base', prefix='', env=None): ''' List symlinked files and dirs on the master ''' load = {'saltenv': saltenv, 'prefix': prefix, 'cmd': '_symlink_list'} return self.channel.send(load) def hash_file(self, path, saltenv='base', env=None): ''' Return the hash of a file, to get the hash of a file on the salt master file server prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file. ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env try: path = self._check_proto(path) except MinionError: if not os.path.isfile(path): err = 'Specified file {0} is not present to generate hash' log.warning(err.format(path)) return {} else: ret = {} hash_type = self.opts.get('hash_type', 'md5') ret['hsum'] = salt.utils.get_hash( path, form=hash_type) ret['hash_type'] = hash_type return ret load = {'path': path, 'saltenv': saltenv, 'cmd': '_file_hash'} return self.channel.send(load) def list_env(self, saltenv='base', env=None): ''' Return a list of the files in the file server's specified environment ''' if env is not None: salt.utils.warn_until( 'Boron', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This functionality will be removed in Salt ' 'Boron.' ) # Backwards compatibility saltenv = env load = {'saltenv': saltenv, 'cmd': '_file_list'} return self.channel.send(load) def envs(self): ''' Return a list of available environments ''' load = {'cmd': '_file_envs'} return self.channel.send(load) def master_opts(self): ''' Return the master opts data ''' load = {'cmd': '_master_opts'} return self.channel.send(load) def ext_nodes(self): ''' Return the metadata derived from the external nodes system on the master. ''' load = {'cmd': '_ext_nodes', 'id': self.opts['id'], 'opts': self.opts} if self.auth: load['tok'] = self.auth.gen_token('salt') return self.channel.send(load) class FSClient(RemoteClient): ''' A local client that uses the RemoteClient but substitutes the channel for the FSChan object ''' def __init__(self, opts): # pylint: disable=W0231 self.opts = opts self.channel = salt.fileserver.FSChan(opts) self.auth = DumbAuth() class DumbAuth(object): ''' The dumbauth class is used to stub out auth calls fired from the FSClient subsystem ''' def gen_token(self, clear_tok): return clear_tok
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const moment = require("moment"); const lodash_1 = require("lodash"); const objection_1 = require("objection"); const Media_1 = require("./Media"); class Entry extends objection_1.Model { static get tableName() { return 'entry'; } static get relationMappings() { return { entryType: { relation: objection_1.Model.BelongsToOneRelation, modelClass: `${__dirname}/EntryType`, join: { from: 'entry.entryTypeId', to: 'entryType.id' } }, user: { relation: objection_1.Model.BelongsToOneRelation, modelClass: `${__dirname}/User`, join: { from: 'entry.userId', to: 'user.id' } }, modifiedByUser: { relation: objection_1.Model.BelongsToOneRelation, modelClass: `${__dirname}/User`, join: { from: 'entry.modifiedByUserId', to: 'user.id' } }, tags: { relation: objection_1.Model.ManyToManyRelation, modelClass: `${__dirname}/EntryTag`, join: { from: 'entry.id', through: { from: 'entry_entryTag.entryId', to: 'entry_entryTag.entryTagId' }, to: 'entryTag.id' } } }; } static get jsonSchema() { return { type: 'object', additionalProperties: false, properties: { id: { type: 'integer' }, entryTypeId: { type: 'integer' }, userId: { type: 'integer' }, modifiedByUserId: { type: 'integer' }, name: { type: 'string', maxLength: 128 }, published: { type: 'string', format: 'date-time' }, fields: { type: 'array' }, createdAt: { type: 'string', format: 'date-time' }, modifiedAt: { type: 'string', format: 'date-time' } }, required: [ 'entryTypeId', 'userId', 'modifiedByUserId', 'name', 'published', 'fields' ] }; } static async create(data, trx) { const fieldNames = Object.keys(Entry.jsonSchema.properties); return Entry .query(trx) .insert(lodash_1.pick(data, fieldNames)) .returning('*') .first(); } static getInProject(projectId, trx) { return Entry .query(trx) .joinRelation('entryType') .where('entryType.projectId', projectId); } static getInProjectWithRelations(projectId, trx) { return Entry .getInProject(projectId, trx) .eager('[user, modifiedByUser, tags, entryType]'); } static async bulkDelete(arrayOfIds, projectId, trx) { const entries = await Entry.query(trx) .join('entryType', 'entry.entryTypeId', 'entryType.id') .join('project', 'project.id', 'entryType.projectId') .whereIn('entry.id', arrayOfIds) .andWhere('project.id', projectId); const entryIds = entries.map(entry => entry.id); const numDeleted = await Entry.query(trx) .whereIn('entry.id', entryIds) .delete(); return numDeleted; } static externalFieldsToInternal(entryTypeFields, entryFields, existingFields) { return entryTypeFields .map(entryTypeField => { const { name, fieldType, disabled } = entryTypeField; if (disabled && existingFields) { const existingField = existingFields.find(f => f.name === name); if (existingField) return existingField; } const obj = { name, fieldType, value: null }; if (fieldType === 'TEXT' || fieldType === 'LONGTEXT') { obj.value = lodash_1.get(entryFields, entryTypeField.name, ''); } else if (fieldType === 'BOOLEAN') { obj.value = !!lodash_1.get(entryFields, entryTypeField.name, null); } else if (fieldType === 'NUMBER') { obj.value = lodash_1.get(entryFields, entryTypeField.name, null); } else if (fieldType === 'DATE') { const date = lodash_1.get(entryFields, entryTypeField.name, null); obj.value = date ? moment.utc(date).format() : null; } else if (fieldType === 'CHOICE') { obj.value = lodash_1.get(entryFields, entryTypeField.name, []) || []; } else if (fieldType === 'COLOR') { obj.value = lodash_1.get(entryFields, entryTypeField.name, ''); } else if (fieldType === 'MEDIA') { const media = lodash_1.get(entryFields, entryTypeField.name, []) || []; obj.value = media.map(m => m.id); } else if (fieldType === 'LINK') { const entires = lodash_1.get(entryFields, entryTypeField.name, []) || []; obj.value = entires.map(entry => entry.id); } else if (fieldType === 'LIST') { obj.value = lodash_1.get(entryFields, entryTypeField.name, []) || []; } return obj; }); } static async deleteAll(trx) { const num = await Entry .query(trx) .delete(); return num; } getFieldValue(fieldName, fieldType) { const field = this.fields.find(f => f.name === fieldName && f.fieldType === fieldType); return lodash_1.get(field, 'value'); } async internalFieldsToExternal(entryTypeFields, trx) { const obj = {}; for (const entryTypeField of entryTypeFields) { if (entryTypeField.disabled) continue; let value = this.getFieldValue(entryTypeField.name, entryTypeField.fieldType); if (lodash_1.isArray(value)) { // Note for MEDIA and LINK types we order the query results to match // the order of the ids stored in the field's value. if (entryTypeField.fieldType === 'MEDIA') { const mediaResult = await Media_1.default.query(trx).whereIn('id', value); const orderedMedia = []; value.forEach(id => { const media = mediaResult.find(m => m.id === id); if (media) orderedMedia.push(media); }); value = orderedMedia; } else if (entryTypeField.fieldType === 'LINK') { const entryResult = await Entry .query(trx) .select('id', 'name', 'entryTypeId') .whereIn('id', value); const orderedEntries = []; value.forEach(id => { const entry = entryResult.find(e => e.id === id); if (entry) orderedEntries.push(entry); }); value = orderedEntries; } } obj[entryTypeField.name] = value || null; } return obj; } getTags(trx) { return this.$relatedQuery('tags', trx); } async setTags(entryTags, trx) { const incomingTagIds = entryTags.map(entryTag => entryTag.id); const existingTags = await this.getTags(trx); const existingTagIds = existingTags.map(entryTag => entryTag.id); const idsToUnrelate = lodash_1.difference(existingTagIds, incomingTagIds); const idsToRelate = lodash_1.difference(incomingTagIds, existingTagIds); // Unrelate any existing tags not in entryTags const p1 = this.$relatedQuery('tags', trx).unrelate().whereIn('id', idsToUnrelate); // Relate incoming entryTags const p2 = this.$relatedQuery('tags', trx).relate(idsToRelate); await Promise.all([p1, p2]); return entryTags; } } exports.default = Entry;
/* eslint-env mocha */ 'use strict' const IPFS = require('..') const IPFSFactory = require('ipfsd-ctl') const bootstrapList = require('../src/core/runtime/config-browser.js')().Bootstrap const waitFor = require('./utils/wait-for') /* * These tests were graciously made for lgierth, so that he can test the * WebSockets Bootstrappers easily <3 */ describe('Check that a js-ipfs node can indeed contact the bootstrappers', () => { let ipfsd before(async () => { this.timeout(30 * 1000) const factory = IPFSFactory.create({ type: 'proc', exec: IPFS, IpfsClient: require('ipfs-http-client') }) ipfsd = await factory.spawn({ config: { Addresses: { Swarm: [] } } }) }) after(() => ipfsd.stop()) it('a node connects to bootstrappers', function (done) { this.timeout(2 * 60 * 1000) const test = (cb) => { ipfsd.api.swarm.peers((err, peers) => { if (err) return cb(err) const peerList = peers.map((peer) => peer.addr.toString()) if (peerList.length !== bootstrapList.length) { return cb(null, false) } cb(null, bootstrapList.every(addr => peerList.includes(addr))) }) } waitFor(test, { name: 'connect to all bootstrap nodes', timeout: 60 * 1000 }, done) }) })
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'indent', 'zh-cn', { indent: '增加缩进量', outdent: '减少缩进量' } );
var db = require('../src/db').sequelize; module.exports = { up: function() { return db.query(` ALTER TABLE users ADD phoneNumber varchar(64) DEFAULT null AFTER zipcode, ADD streetName varchar(64) DEFAULT null AFTER zipcode, ADD city varchar(64) DEFAULT null AFTER zipcode, ADD houseNumber varchar(64) DEFAULT null AFTER zipcode, ADD suffix varchar(64) DEFAULT null AFTER zipcode, ADD postcode varchar(64) DEFAULT null AFTER zipcode ; `); }, down: function() { return db.query(`ALTER TABLE user DROP phoneNumber, streetName, city, houseNumber, suffix, postcode;`); } }
import flask import logging import rcs_chatbot chatbot = rcs_chatbot.Chatbot( "API_URL", "BOT_ID", "TOKEN", None, logging.DEBUG ) app = flask.Flask(__name__) @app.route('/', methods=['POST']) def event(): try: chatbot.processEvent(flask.request.get_json()) return "ok", 200 except maap.RequestFailed as ex: print("Request failed: " + str(ex)) return "ok", 200 @chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGE) def messageHandler(event): userContact = None chatId = None if "userContact" in event["messageContact"]: userContact = event["messageContact"]["userContact"] if "chatId" in event["messageContact"]: chatId = event["messageContact"]["chatId"] contact = rcs_chatbot.MessageContact(userContact, chatId) suggestions = rcs_chatbot.Suggestions() suggestions.addReply("reply", "reply") suggestions.addUrlAction("url", "url", "http://example.com") chatbot.sendMessage( contact, "You wrote: " + event["RCSMessage"]["textMessage"], suggestions ) @chatbot.registerEventHandler(rcs_chatbot.EventType.ISTYPING) def isTypingHandler(event): print("isTypingHandler") @chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGESTATUS) def messageStatusHandler(event): print("messageStatusHandler") @chatbot.registerEventHandler(rcs_chatbot.EventType.FILESTATUS) def fileStatusHandler(event): print("fileStatusHandler") @chatbot.registerEventHandler(rcs_chatbot.EventType.RESPONSE) def responseHandler(event): print("responseHandler") @chatbot.registerEventHandler(rcs_chatbot.EventType.ALIAS) def aliasHandler(event): print("aliasHandler") @chatbot.registerEventHandler(rcs_chatbot.EventType.NEWUSER) def newUserHandler(event): print("newUserHandler") if __name__ == '__main__': app.run(port=5000, debug=False)
import { a } from "x"; import b from "y"; const arr = (a, b());
class ValidateComment: """validates the comments added to a course Returns: [boolean] -- [returns true for valid fields and false for invalid fields] """ def __init__(self, data): self.data = data def validate_comment_body(self): """validates the comment body Returns: [boolean] -- [True if course name is valid else False] """ if not isinstance(self.data['comment_body'], str) or self.data['comment_body'] == "": return False else: return True
Potree.Measure = class Measure extends THREE.Object3D { constructor () { super(); this.constructor.counter = (this.constructor.counter === undefined) ? 0 : this.constructor.counter + 1; this.name = 'Measure_' + this.constructor.counter; this.points = []; this._showDistances = true; this._showCoordinates = false; this._showArea = false; this._closed = true; this._showAngles = false; this._showHeight = false; this.maxMarkers = Number.MAX_SAFE_INTEGER; this.sphereGeometry = new THREE.SphereGeometry(0.4, 10, 10); this.color = new THREE.Color(0xff0000); this.lengthUnit = {code: 'm'}; this.spheres = []; this.edges = []; this.sphereLabels = []; this.edgeLabels = []; this.angleLabels = []; this.coordinateLabels = []; // this.heightEdge; // this.heightLabel; { // height stuff { // height line let lineGeometry = new THREE.Geometry(); lineGeometry.vertices.push( new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()); lineGeometry.colors.push(this.color, this.color, this.color); let lineMaterial = new THREE.LineDashedMaterial( { color: 0xff0000, dashSize: 5, gapSize: 2 }); lineMaterial.depthTest = false; this.heightEdge = new THREE.Line(lineGeometry, lineMaterial); this.heightEdge.visible = false; this.add(this.heightEdge); } { // height label this.heightLabel = new Potree.TextSprite(''); this.heightLabel.setBorderColor({r: 0, g: 0, b: 0, a: 0.8}); this.heightLabel.setBackgroundColor({r: 0, g: 0, b: 0, a: 0.3}); this.heightLabel.setTextColor({r: 180, g: 220, b: 180, a: 1.0}); this.heightLabel.material.depthTest = false; this.heightLabel.material.opacity = 1; this.heightLabel.visible = false; ; this.add(this.heightLabel); } } this.areaLabel = new Potree.TextSprite(''); this.areaLabel.setBorderColor({r: 0, g: 0, b: 0, a: 0.8}); this.areaLabel.setBackgroundColor({r: 0, g: 0, b: 0, a: 0.3}); this.areaLabel.setTextColor({r: 180, g: 220, b: 180, a: 1.0}); this.areaLabel.material.depthTest = false; this.areaLabel.material.opacity = 1; this.areaLabel.visible = false; ; this.add(this.areaLabel); } createSphereMaterial () { let sphereMaterial = new THREE.MeshLambertMaterial({ shading: THREE.SmoothShading, color: this.color, depthTest: false, depthWrite: false} ); return sphereMaterial; }; addMarker (point) { if (point instanceof THREE.Vector3) { point = {position: point}; }else if(point instanceof Array){ point = {position: new THREE.Vector3(...point)}; } this.points.push(point); // sphere let sphere = new THREE.Mesh(this.sphereGeometry, this.createSphereMaterial()); this.add(sphere); this.spheres.push(sphere); { // edges let lineGeometry = new THREE.Geometry(); lineGeometry.vertices.push(new THREE.Vector3(), new THREE.Vector3()); lineGeometry.colors.push(this.color, this.color, this.color); let lineMaterial = new THREE.LineBasicMaterial({ linewidth: 1 }); lineMaterial.depthTest = false; let edge = new THREE.Line(lineGeometry, lineMaterial); edge.visible = true; this.add(edge); this.edges.push(edge); } { // edge labels let edgeLabel = new Potree.TextSprite(); edgeLabel.setBorderColor({r: 0, g: 0, b: 0, a: 0.8}); edgeLabel.setBackgroundColor({r: 0, g: 0, b: 0, a: 0.3}); edgeLabel.material.depthTest = false; edgeLabel.visible = false; this.edgeLabels.push(edgeLabel); this.add(edgeLabel); } { // angle labels let angleLabel = new Potree.TextSprite(); angleLabel.setBorderColor({r: 0, g: 0, b: 0, a: 0.8}); angleLabel.setBackgroundColor({r: 0, g: 0, b: 0, a: 0.3}); angleLabel.material.depthTest = false; angleLabel.material.opacity = 1; angleLabel.visible = false; this.angleLabels.push(angleLabel); this.add(angleLabel); } { // coordinate labels let coordinateLabel = new Potree.TextSprite(); coordinateLabel.setBorderColor({r: 0, g: 0, b: 0, a: 0.8}); coordinateLabel.setBackgroundColor({r: 0, g: 0, b: 0, a: 0.3}); coordinateLabel.material.depthTest = false; coordinateLabel.material.opacity = 1; coordinateLabel.visible = false; this.coordinateLabels.push(coordinateLabel); this.add(coordinateLabel); } { // Event Listeners let drag = (e) => { let I = Potree.utils.getMousePointCloudIntersection( e.drag.end, e.viewer.scene.getActiveCamera(), e.viewer, e.viewer.scene.pointclouds, {pickClipped: true}); if (I) { let i = this.spheres.indexOf(e.drag.object); if (i !== -1) { let point = this.points[i]; for (let key of Object.keys(I.point).filter(e => e !== 'position')) { point[key] = I.point[key]; } this.setPosition(i, I.location); } } }; let drop = e => { let i = this.spheres.indexOf(e.drag.object); if (i !== -1) { this.dispatchEvent({ 'type': 'marker_dropped', 'measurement': this, 'index': i }); } }; let mouseover = (e) => e.object.material.emissive.setHex(0x888888); let mouseleave = (e) => e.object.material.emissive.setHex(0x000000); sphere.addEventListener('drag', drag); sphere.addEventListener('drop', drop); sphere.addEventListener('mouseover', mouseover); sphere.addEventListener('mouseleave', mouseleave); } let event = { type: 'marker_added', measurement: this, sphere: sphere }; this.dispatchEvent(event); this.setMarker(this.points.length - 1, point); }; removeMarker (index) { this.points.splice(index, 1); this.remove(this.spheres[index]); let edgeIndex = (index === 0) ? 0 : (index - 1); this.remove(this.edges[edgeIndex]); this.edges.splice(edgeIndex, 1); this.remove(this.edgeLabels[edgeIndex]); this.edgeLabels.splice(edgeIndex, 1); this.coordinateLabels.splice(index, 1); this.spheres.splice(index, 1); this.update(); this.dispatchEvent({type: 'marker_removed', measurement: this}); }; setMarker (index, point) { this.points[index] = point; let event = { type: 'marker_moved', measure: this, index: index, position: point.position.clone() }; this.dispatchEvent(event); this.update(); } setPosition (index, position) { let point = this.points[index]; point.position.copy(position); let event = { type: 'marker_moved', measure: this, index: index, position: position.clone() }; this.dispatchEvent(event); this.update(); }; getArea () { let area = 0; let j = this.points.length - 1; for (let i = 0; i < this.points.length; i++) { let p1 = this.points[i].position; let p2 = this.points[j].position; area += (p2.x + p1.x) * (p1.y - p2.y); j = i; } return Math.abs(area / 2); }; getTotalDistance () { if (this.points.length === 0) { return 0; } let distance = 0; for (let i = 1; i < this.points.length; i++) { let prev = this.points[i - 1].position; let curr = this.points[i].position; let d = prev.distanceTo(curr); distance += d; } if (this.closed && this.points.length > 1) { let first = this.points[0].position; let last = this.points[this.points.length - 1].position; let d = last.distanceTo(first); distance += d; } return distance; } getAngleBetweenLines (cornerPoint, point1, point2) { let v1 = new THREE.Vector3().subVectors(point1.position, cornerPoint.position); let v2 = new THREE.Vector3().subVectors(point2.position, cornerPoint.position); return v1.angleTo(v2); }; getAngle (index) { if (this.points.length < 3 || index >= this.points.length) { return 0; } let previous = (index === 0) ? this.points[this.points.length - 1] : this.points[index - 1]; let point = this.points[index]; let next = this.points[(index + 1) % (this.points.length)]; return this.getAngleBetweenLines(point, previous, next); }; update () { if (this.points.length === 0) { return; } else if (this.points.length === 1) { let point = this.points[0]; let position = point.position; this.spheres[0].position.copy(position); { // coordinate labels let coordinateLabel = this.coordinateLabels[0]; let msg = position.toArray().map(p => Potree.utils.addCommas(p.toFixed(2))).join(", "); //let msg = Potree.utils.addCommas(position.z.toFixed(2) + " " + this.lengthUnit.code); coordinateLabel.setText(msg); coordinateLabel.visible = this.showCoordinates; } return; } let lastIndex = this.points.length - 1; let centroid = new THREE.Vector3(); for (let i = 0; i <= lastIndex; i++) { let point = this.points[i]; centroid.add(point.position); } centroid.divideScalar(this.points.length); for (let i = 0; i <= lastIndex; i++) { let index = i; let nextIndex = (i + 1 > lastIndex) ? 0 : i + 1; let previousIndex = (i === 0) ? lastIndex : i - 1; let point = this.points[index]; let nextPoint = this.points[nextIndex]; let previousPoint = this.points[previousIndex]; let sphere = this.spheres[index]; // spheres sphere.position.copy(point.position); sphere.material.color = this.color; { // edges let edge = this.edges[index]; edge.material.color = this.color; edge.position.copy(point.position); edge.geometry.vertices[0].set(0, 0, 0); edge.geometry.vertices[1].copy(nextPoint.position).sub(point.position); edge.geometry.verticesNeedUpdate = true; edge.geometry.computeBoundingSphere(); edge.visible = index < lastIndex || this.closed; } { // edge labels let edgeLabel = this.edgeLabels[i]; let center = new THREE.Vector3().add(point.position); center.add(nextPoint.position); center = center.multiplyScalar(0.5); let distance = point.position.distanceTo(nextPoint.position); edgeLabel.position.copy(center); const formattedDistance = Potree.utils.formatToUnit(distance, this.lengthUnit.code); edgeLabel.setText(Potree.utils.addCommas(formattedDistance.value) + ' ' + formattedDistance.code); edgeLabel.visible = this.showDistances && (index < lastIndex || this.closed) && this.points.length >= 2 && distance > 0; } { // angle labels let angleLabel = this.angleLabels[i]; let angle = this.getAngleBetweenLines(point, previousPoint, nextPoint); let dir = nextPoint.position.clone().sub(previousPoint.position); dir.multiplyScalar(0.5); dir = previousPoint.position.clone().add(dir).sub(point.position).normalize(); let dist = Math.min(point.position.distanceTo(previousPoint.position), point.position.distanceTo(nextPoint.position)); dist = dist / 9; let labelPos = point.position.clone().add(dir.multiplyScalar(dist)); angleLabel.position.copy(labelPos); let msg = Potree.utils.addCommas((angle * (180.0 / Math.PI)).toFixed(1)) + '\u00B0'; angleLabel.setText(msg); angleLabel.visible = this.showAngles && (index < lastIndex || this.closed) && this.points.length >= 3 && angle > 0; } } { // update height stuff let heightEdge = this.heightEdge; heightEdge.visible = this.showHeight; this.heightLabel.visible = this.showHeight; if (this.showHeight) { let sorted = this.points.slice().sort((a, b) => a.position.z - b.position.z); let lowPoint = sorted[0].position.clone(); let highPoint = sorted[sorted.length - 1].position.clone(); let min = lowPoint.z; let max = highPoint.z; let height = max - min; let start = new THREE.Vector3(highPoint.x, highPoint.y, min); let end = new THREE.Vector3(highPoint.x, highPoint.y, max); heightEdge.position.copy(lowPoint); heightEdge.geometry.vertices[0].set(0, 0, 0); heightEdge.geometry.vertices[1].copy(start).sub(lowPoint); heightEdge.geometry.vertices[2].copy(start).sub(lowPoint); heightEdge.geometry.vertices[3].copy(end).sub(lowPoint); heightEdge.geometry.verticesNeedUpdate = true; // heightEdge.geometry.computeLineDistances(); // heightEdge.geometry.lineDistancesNeedUpdate = true; heightEdge.geometry.computeBoundingSphere(); // heightEdge.material.dashSize = height / 40; // heightEdge.material.gapSize = height / 40; let heightLabelPosition = start.clone().add(end).multiplyScalar(0.5); this.heightLabel.position.copy(heightLabelPosition); const formattedHeight = Potree.utils.formatToUnit(height, this.lengthUnit.code); let msg = Potree.utils.addCommas(formattedHeight.value) + ' ' + formattedHeight.code; this.heightLabel.setText(msg); } } { // update area label this.areaLabel.position.copy(centroid); this.areaLabel.visible = this.showArea && this.points.length >= 3; let msg = Potree.utils.addCommas(this.getArea().toFixed(1)) + ' ' + this.lengthUnit.code + '\u00B2'; this.areaLabel.setText(msg); } }; raycast (raycaster, intersects) { for (let i = 0; i < this.points.length; i++) { let sphere = this.spheres[i]; sphere.raycast(raycaster, intersects); } // recalculate distances because they are not necessarely correct // for scaled objects. // see https://github.com/mrdoob/three.js/issues/5827 // TODO: remove this once the bug has been fixed for (let i = 0; i < intersects.length; i++) { let I = intersects[i]; I.distance = raycaster.ray.origin.distanceTo(I.point); } intersects.sort(function (a, b) { return a.distance - b.distance; }); }; get showCoordinates () { return this._showCoordinates; } set showCoordinates (value) { this._showCoordinates = value; this.update(); } get showAngles () { return this._showAngles; } set showAngles (value) { this._showAngles = value; this.update(); } get showHeight () { return this._showHeight; } set showHeight (value) { this._showHeight = value; this.update(); } get showArea () { return this._showArea; } set showArea (value) { this._showArea = value; this.update(); } get closed () { return this._closed; } set closed (value) { this._closed = value; this.update(); } get showDistances () { return this._showDistances; } set showDistances (value) { this._showDistances = value; this.update(); } };
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = tslib_1.__importStar(require("react")); var styled_icon_1 = require("@styled-icons/styled-icon"); exports.DirectionsSubway = React.forwardRef(function (props, ref) { var attrs = { "fill": "currentColor", "xmlns": "http://www.w3.org/2000/svg", }; return (React.createElement(styled_icon_1.StyledIconBase, tslib_1.__assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }), React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z", key: "k0" }), React.createElement("path", { d: "M12 2c-4.42 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19l-1.15 1.15a.5.5 0 00.36.85H17.3c.45 0 .67-.54.35-.85L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-6H6V6h5v5zm5.5 6c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm1.5-6h-5V6h5v5z", key: "k1" }))); }); exports.DirectionsSubway.displayName = 'DirectionsSubway'; exports.DirectionsSubwayDimensions = { height: 24, width: 24 };
'use strict'; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.addColumn('EDDLiens', 'certifiedDoctor', { type: Sequelize.STRING, allowNull: true }); await queryInterface.addColumn('EDDLiens', 'certifiedBodyParts', { type: Sequelize.STRING, allowNull: true }); await queryInterface.addColumn('EDDLiens', 'doctor', { type: Sequelize.STRING, allowNull: true }); await queryInterface.addColumn('EDDLiens', 'bodyParts', { type: Sequelize.STRING, allowNull: true }); }, down: (queryInterface, Sequelize) => { return queryInterface.removeColumn('EDDLiens', 'certifiedDoctor').then(() => ( queryInterface.removeColumn('EDDLiens', 'certifiedBodyParts') )).then(() => ( queryInterface.removeColumn('EDDLiens', 'doctor') )).then(() => ( queryInterface.removeColumn('EDDLiens', 'bodyParts') )); } };
from rest_framework import serializers from base.models import Resource, Organization class ResourceSerializer(serializers.ModelSerializer): class Meta: model = Resource fields = ('id', \ 'source', \ 'source_path', \ 'path', \ 'name', \ 'size', \ 'owner', \ 'is_active', \ 'originated_from_upload', \ 'total_downloads', \ 'date_added', \ 'expiration_date' \ ) class OrganizationSerializer(serializers.ModelSerializer): class Meta: model = Organization fields = '__all__' class TreeObjectSerializer(serializers.BaseSerializer): ''' This provides a read-only serialization that is used by a view providing a data structure to the front-end. This uses the gui_representation method defined in the object we are serializing ''' def to_representation(self, obj): return obj.gui_representation()
'use strict'; const common = require('../../common'); // Refs: https://github.com/nodejs/node/issues/34731 // Refs: https://github.com/nodejs/node/pull/35777 // Refs: https://github.com/nodejs/node/issues/35778 const { Worker, isMainThread } = require('worker_threads'); if (isMainThread) { const worker = new Worker(__filename); worker.on('error', common.mustNotCall()); } else { const { Test } = require(`./build/${common.buildType}/test_worker_terminate_finalization`); // Spin up thread and call add-on create the right sequence // of rerences to hit the case reported in // https://github.com/nodejs/node-addon-api/issues/722 // will crash if run under debug and its not possible to // create object in the specific finalizer Test(new Object()); }
from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract.api_resource import APIResource class DeletableAPIResource(APIResource): def delete(self, **params): self.refresh_from(self.request("delete", self.instance_url(), params)) return self
import { useLayoutEffect, useState } from "react"; import { getBanners } from "@service"; import Swiper from "../../components/swiper"; export default function Banner({ customClassName }) { const [banners, setBanner] = useState([]); useLayoutEffect(() => { const fetchData = async () => { const banners = await getBanners(); setBanner(banners); // console.log("++ banner", banners); }; fetchData(); }, []); if (banners.length) { return ( <Swiper customClassName={customClassName}> {banners.map((banner) => ( <img key={banner.encodeId} src={banner.imageUrl} alt={banner.typeTitle} ></img> ))} </Swiper> ); } return null; }
const PhoneToken = artifacts.require('PhoneToken'); const PreSale = artifacts.require('PreSale'); const IPhoneToken = artifacts.require('IPhoneToken'); const Factory = artifacts.require('Factory'); const MasterFactory = artifacts.require('MasterFactory'); const Devices = artifacts.require('Devices'); const Store = artifacts.require('Store'); module.exports = async function (deployer) { try { await deployer.deploy(PhoneToken); await deployer.deploy(PreSale, PhoneToken.address); const instanceIphone = await deployer.deploy(IPhoneToken); // await deployer.deploy( // Factory, // IPhoneToken.address, // process.env.OPERATOR_ADDRESS, // '100000000000000000000', // '8823360', // '8823400' // ); const masterFactory = await deployer.deploy( MasterFactory, IPhoneToken.address, process.env.OPERATOR_ADDRESS, '100000000000000000000', '8823360', '8823400' ); const instanceDevice = await deployer.deploy(Devices); const instanceStore = await deployer.deploy( Store, instanceDevice.address, instanceIphone.address ); await instanceDevice.approveStore(instanceStore.address); await masterFactory.add(5, PhoneToken.address, false); } catch (error) { console.log(error); } return; };
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { withRouter } from 'react-router'; import axios from 'axios'; import { Button, Container, Menu, Sidebar, Segment } from 'semantic-ui-react'; class Navbar extends Component { constructor(props) { super(props); // initial active values of menu buttons this.state = { activeStates: { homeActive: true, searchActive: false, proposeActive: false, manageActive: false, updateActive: false, exportActive: false, transformActive: false, loginActive: false, signupActive: false, logoutActive: false } }; } // componentWillReceiveProps() { // this.setState({ // authenticated: this.props.authenticated // }); // } // handle navbar buttons to change active state to clicked button handleNavbarButtonClick = event => { let activeStates = this.state.activeStates; // reset all active states to false for (let prop in activeStates) { activeStates[prop] = false; } // set currently clicked button to true activeStates[event.target.id + 'Active'] = true; this.setState(activeStates); }; handleLogoutButtonClick = event => { let activeStates = this.state.activeStates; // reset all active states to false for (let prop in activeStates) { activeStates[prop] = false; } // set currently clicked button to true activeStates[event.target.id + 'Active'] = true; this.setState(activeStates); const self = this; // check if user is logged in axios.get('/api/user/logout') .then(function(res) { console.log(res.data); self.props.checkIfUserLoggedIn(); self.props.history.push('/'); }) .catch(function (error) { console.log(error); }); }; render() { const authenticated = this.props.authenticated; if (authenticated) { // show a different nav bar if logged in const usertype = this.props.usertype; if (usertype === 'admin') { // if admin, dont' revert colors and show /manage button return ( <Sidebar as={Menu} animation='overlay' width='thin' visible={true} icon='labeled' vertical inverted> <Menu.Item as={ Link } to='/' header onClick={ this.handleNavbarButtonClick } name="asdf"> Bedes Manager </Menu.Item> <Menu.Item as={ Link } to='/search' active={ this.state.searchActive } onClick={ this.handleNavbarButtonClick } id="search">Search</Menu.Item> <Menu.Item as={ Link } to='/propose' active={ this.state.proposeActive } onClick={ this.handleNavbarButtonClick } id="propose">Propose</Menu.Item> <Menu.Item as={ Link } to='/manage' active={ this.state.manageActive } onClick={ this.handleNavbarButtonClick } id="list">List</Menu.Item> <Menu.Item as={ Link } to='/update' active={ this.state.updateActive } onClick={ this.handleNavbarButtonClick } id="update">Update</Menu.Item> <Menu.Item as={ Link } to='/export' active={ this.state.exportActive } onClick={ this.handleNavbarButtonClick } id="export">Export</Menu.Item> <Menu.Item as={ Link } to='/transform' active={ this.state.transformActive } onClick={ this.handleNavbarButtonClick } id="transform">New Transform</Menu.Item> </Sidebar> ); } else if (usertype === 'normal') { return ( <Sidebar as={Menu} animation='overlay' width='thin' visible={true} icon='labeled' vertical inverted> <Menu.Item as={ Link } to='/' header onClick={ this.handleNavbarButtonClick } name="asdf"> Bedes Manager </Menu.Item> <Menu.Item as={ Link } to='/search' active={ this.state.searchActive } onClick={ this.handleNavbarButtonClick } id="search">Search</Menu.Item> <Menu.Item as={ Link } to='/propose' active={ this.state.proposeActive } onClick={ this.handleNavbarButtonClick } id="propose">Propose</Menu.Item> <Menu.Item as={ Link } to='/update' active={ this.state.updateActive } onClick={ this.handleNavbarButtonClick } id="update">Update</Menu.Item> <Menu.Item as={ Link } to='/export' active={ this.state.exportActive } onClick={ this.handleNavbarButtonClick } id="export">Export</Menu.Item> <Menu.Item as={ Link } to='/transform' active={ this.state.transformActive } onClick={ this.handleNavbarButtonClick } id="transform">New Transform</Menu.Item> </Sidebar> ); } } // not authenticated return ( <Sidebar as={Menu} animation='overlay' width='thin' visible={true} icon='labeled' vertical inverted> <Menu.Item as={ Link } to='/' header onClick={ this.handleNavbarButtonClick } name="asdf"> Bedes Manager </Menu.Item> <Menu.Menu position='right'> <Menu.Item className='item'> <Button as={ Link } to='/login' active={ this.state.loginActive } onClick={ this.handleNavbarButtonClick } id="login">Log in</Button> </Menu.Item> <Menu.Item> <Button as={ Link } to='/signup' active={ this.state.signupActive } onClick={ this.handleNavbarButtonClick } id="signup" primary>Sign Up</Button> </Menu.Item> </Menu.Menu> </Sidebar> ); } } // Create a new component that is "connected" to the router. export default withRouter(Navbar)
var assert = require('assert'), cb = require('assert-called'), wtfos = require('../'); wtfos.result = { distribution: 'ubuntu' }; wtfos(cb(function (err, data) { assert(!err); assert.deepEqual(data, { distribution: 'ubuntu' }); }));
module.exports = { // where it all starts -- the site's root Notion page (required) rootNotionPageId: '57758ac572924056bfd87669ee5b422f', // if you want to restrict pages to a single notion workspace (optional) // (this should be a Notion ID; see the docs for how to extract this) rootNotionSpaceId: null, // basic site info (required) name: 'Dagobah', domain: 'https://alive-clownfish-ac7.notion.site/Personal-Home-57758ac572924056bfd87669ee5b422f', author: 'Haoyu.bian', // open graph metadata (optional) description: 'Example site description', socialImageTitle: 'Transitive Bullshit', socialImageSubtitle: 'Hello World! 👋', // social usernames (optional) twitter: '', github: 'MerlinBHy', linkedin: '', // default notion icon and cover images for site-wide consistency (optional) // page-specific values will override these site-wide defaults defaultPageIcon: null, defaultPageCover: null, defaultPageCoverPosition: 0.5, // image CDN host to proxy all image requests through (optional) // NOTE: this requires you to set up an external image proxy imageCDNHost: null, // Utteranc.es comments via GitHub issue comments (optional) utterancesGitHubRepo: null, // whether or not to enable support for LQIP preview images (optional) // NOTE: this requires you to set up Google Firebase and add the environment // variables specified in .env.example isPreviewImageSupportEnabled: false, // map of notion page IDs to URL paths (optional) // any pages defined here will override their default URL paths // example: // // pageUrlOverrides: { // '/foo': '067dd719a912471ea9a3ac10710e7fdf', // '/bar': '0be6efce9daf42688f65c76b89f8eb27' // } pageUrlOverrides: null }
var _ = require('lodash'); const caspersdk = require("casper-js-sdk"); const CasperClient = caspersdk.CasperClient; const CLValueBuilder = caspersdk.CLValueBuilder; const DeployUtil = caspersdk.DeployUtil; const Keys = caspersdk.Keys; const RuntimeArgs = caspersdk.RuntimeArgs; const CasperServiceByJsonRPC = caspersdk.CasperServiceByJsonRPC; const { CONTRACT_DID_HASH, DEPLOY_NODE_ADDRESS, DEPLOY_CHAIN_NAME, IPPOLIT_KEY_SECRET_PATH, IPPOLIT_KEY_PUBLIC_PATH, TRENT_KEY_SECRET_PATH, TRENT_KEY_PUBLIC_PATH, VICTOR_KEY_SECRET_PATH, VICTOR_KEY_PUBLIC_PATH } = require("../constants"); const DEPLOY_GAS_PRICE = 10; const DEPLOY_GAS_PAYMENT = 50000000000; const DEPLOY_TTL_MS = 3600000; const addDelegate = async (identity, delegateKey, delegateValue, expire) => { // Step 1: Set casper node client. const client = new CasperClient(DEPLOY_NODE_ADDRESS); // Step 2: Set contract operator key pair. const contractHashAsByteArray = [...Buffer.from(CONTRACT_DID_HASH.slice(5), "hex")]; // Step 5.0: Form input parametrs. // Step 5.1: Form the deploy. let deploy = DeployUtil.makeDeploy( new DeployUtil.DeployParams( identity.publicKey, DEPLOY_CHAIN_NAME, DEPLOY_GAS_PRICE, DEPLOY_TTL_MS ), DeployUtil.ExecutableDeployItem.newStoredContractByHash( contractHashAsByteArray, "addDelegate", RuntimeArgs.fromMap({ identity: CLValueBuilder.byteArray(identity.accountHash()), delegateKey: CLValueBuilder.string(delegateKey), delegateValue: CLValueBuilder.string(delegateValue), expire: CLValueBuilder.u64(expire), }) ), DeployUtil.standardPayment(DEPLOY_GAS_PAYMENT) ); // Step 5.2: Sign deploy. deploy = client.signDeploy(deploy, identity); // console.log("signed deploy:"); // console.log(deploy); // Step 5.3: Dispatch deploy to node. let deployResult = await client.putDeploy(deploy); console.log("Deploy result"); console.log(deployResult); }; const main = async () => { const ippolit = Keys.Ed25519.parseKeyFiles( IPPOLIT_KEY_PUBLIC_PATH, IPPOLIT_KEY_SECRET_PATH ); let trent = Keys.Ed25519.parseKeyFiles( TRENT_KEY_PUBLIC_PATH, TRENT_KEY_SECRET_PATH ); let victor = Keys.Ed25519.parseKeyFiles( VICTOR_KEY_PUBLIC_PATH, VICTOR_KEY_SECRET_PATH ); let identity = trent; let delegateKey = "did/ether/0xdeadbeef"; let delegateValue = "abracadabra"; let expire = new Date("2025-10-17T11:42:46.430Z").getTime();//unix timestamp in miliseconds await addDelegate(identity,delegateKey,delegateValue,expire); }; const getAccountInfo = async (client, stateRootHash, keyPair) => { const accountHash = Buffer.from(keyPair.accountHash()).toString('hex'); const { Account: accountInfo } = await client.nodeClient.getBlockState( stateRootHash, `account-hash-${accountHash}`, [] ); // console.log("account info:"); // console.log(accountInfo); return accountInfo; }; const getAccountNamedKeyValue = async (client, stateRootHash, keyPair, namedKey) => { // Chain query: get account information. const accountInfo = await getAccountInfo(client, stateRootHash, keyPair); // Get value of contract v1 named key. let res = _.find(accountInfo.namedKeys, (i) => { return i.name === namedKey }); return res.key; }; main();
import React, { useState } from "react"; import Button from "../Button/Button"; import { headingSecondary as HeadingSecondary } from "../Text/Text"; import { headingTertiary as HeadingTertiary } from "../Text/Text"; import PropTypes from "prop-types"; import Technology from "../Technology/Technology"; import styles from "./Card.module.scss"; import { useEffect } from "react"; const Card = ({ description, handler, id, title, tech, ...props }) => { const [isWordy, setWordy] = useState(false); // 250 useEffect(() => { if (description.length > 250) { setWordy(true); } else { setWordy(false); } }, [description]); const desc = isWordy ? ( <p className={styles.card__descriptionText}> {description.substring(0, 250)}...{" "} <span onClick={(event) => handler(event, id)} className={styles.card__descriptionSeemore} > see more </span> </p> ) : ( <p className={styles.card__descriptionText}>{description}</p> ); return ( <div className={styles.card}> <div className={styles.card__heading}> <div className={styles.card__headingTitle} onClick={(event) => handler(event, id)} > <HeadingSecondary>{title}</HeadingSecondary> </div> <Button handler={(event) => handler(event, id)} category='tertiary--outline' size='small' label='Explore' type='button' /> </div> <div className={styles.card__description}> <HeadingTertiary>Description</HeadingTertiary> {desc} </div> <div className={styles.card__tech}> <Technology tech={tech} /> </div> </div> ); }; Card.propTypes = { description: PropTypes.string.isRequired, tech: PropTypes.array.isRequired, title: PropTypes.string.isRequired }; Card.defaultProps = { handler: null }; export default Card;
export const UNMERGE_DATA = 'UNMERGE_DATA'; const unmergeData = ({ mergedData, previousState, currentState }) => ({ type: UNMERGE_DATA, payload: { mergedData, previousState }, meta: { currentState, shouldPost: true, timestamp: Date.now(), }, }); export default unmergeData;
import _ from 'lodash/fp'; const generateFetchListOnMount = (fetchRequest) => { return { componentDidMount() { const { actions, match } = this.props; const userId = _.get('params.userId', match); if (userId) actions[fetchRequest]({ userId }); }, componentWillReceiveProps(nextProps) { const { actions, match } = this.props; const nextUserId = _.get('match.params.userId', nextProps); const userId = _.get('params.userId', match); if (nextUserId !== userId) { actions[fetchRequest]({ userId: nextUserId }); } }, } }; const generateFetchDetailOnMount = (fetchRequest) => { return { componentDidMount() { const { actions, match } = this.props; const userId = _.get('params.userId', match); const sourceId = _.get('params.sourceId', match); if (userId && sourceId) actions[fetchRequest]({ userId, sourceId }); }, } }; export const fetchPatientsOnMount = ({ componentDidMount() { this.props.actions.fetchPatientsRequest(); }, }); export const fetchPatientsCountsOnMountAndUpdate = ({ componentDidMount() { const { actions, currentPagePatients } = this.props; actions.fetchPatientCountsRequest(currentPagePatients); }, componentWillReceiveProps({ currentPagePatients, actions, offset }) { const isNewPatients = _.negate(_.isEqual(this.props.currentPagePatients)); return _.cond([ [isNewPatients, actions.fetchPatientCountsRequest], ])(currentPagePatients) }, }); export const fetchPatientDemographicsOnMount = (generateFetchListOnMount('fetchPatientDemographicsRequest')); export const fetchPatientAllergiesOnMount = (generateFetchListOnMount('fetchPatientAllergiesRequest')); export const fetchPatientAllergiesSynopsisOnMount = (generateFetchListOnMount('fetchPatientAllergiesSynopsisRequest')); export const fetchPatientAllergiesDetailOnMount = (generateFetchDetailOnMount('fetchPatientAllergiesDetailRequest')); export const fetchPatientProblemsSynopsisOnMount = (generateFetchListOnMount('fetchPatientDiagnosesSynopsisRequest')); export const fetchPatientDiagnosesOnMount = (generateFetchListOnMount('fetchPatientDiagnosesRequest')); export const fetchPatientDiagnosesDetailOnMount = (generateFetchDetailOnMount('fetchPatientDiagnosesDetailRequest')); export const fetchPatientContactsOnMount = (generateFetchListOnMount('fetchPatientContactsRequest')); export const fetchPatientContactsSynopsisOnMount = (generateFetchListOnMount('fetchPatientContactsSynopsisRequest')); export const fetchPatientContactsDetailOnMount = (generateFetchDetailOnMount('fetchPatientContactsDetailRequest')); export const fetchPatientMedicationsOnMount = (generateFetchListOnMount('fetchPatientMedicationsRequest')); export const fetchPatientMedicationsSynopsisOnMount = (generateFetchListOnMount('fetchPatientMedicationsSynopsisRequest')); export const fetchPatientMedicationsDetailOnMount = (generateFetchDetailOnMount('fetchPatientMedicationsDetailRequest'));
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, // session persistence, api calls, and more. const Alexa = require('ask-sdk-core'); const LaunchRequestHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest'; }, handle(handlerInput) { const speakOutput = 'Welcome, you can say Hello or Help. Which would you like to try?'; return handlerInput.responseBuilder .speak(speakOutput) .reprompt(speakOutput) .getResponse(); } }; const HelloWorldIntentHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' && Alexa.getIntentName(handlerInput.requestEnvelope) === 'HelloWorldIntent'; }, handle(handlerInput) { const speakOutput = 'Hello Jane!'; return handlerInput.responseBuilder .speak(speakOutput) //.reprompt('add a reprompt if you want to keep the session open for the user to respond') .getResponse(); } }; const HelpIntentHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' && Alexa.getIntentName(handlerInput.requestEnvelope) === 'AMAZON.HelpIntent'; }, handle(handlerInput) { const speakOutput = 'You can say hello to me! How can I help?'; return handlerInput.responseBuilder .speak(speakOutput) .reprompt(speakOutput) .getResponse(); } }; const CancelAndStopIntentHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' && (Alexa.getIntentName(handlerInput.requestEnvelope) === 'AMAZON.CancelIntent' || Alexa.getIntentName(handlerInput.requestEnvelope) === 'AMAZON.StopIntent'); }, handle(handlerInput) { const speakOutput = 'Goodbye!'; return handlerInput.responseBuilder .speak(speakOutput) .getResponse(); } }; const SessionEndedRequestHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'SessionEndedRequest'; }, handle(handlerInput) { // Any cleanup logic goes here. return handlerInput.responseBuilder.getResponse(); } }; // The intent reflector is used for interaction model testing and debugging. // It will simply repeat the intent the user said. You can create custom handlers // for your intents by defining them above, then also adding them to the request // handler chain below. const IntentReflectorHandler = { canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'; }, handle(handlerInput) { const intentName = Alexa.getIntentName(handlerInput.requestEnvelope); const speakOutput = `You just triggered ${intentName}`; return handlerInput.responseBuilder .speak(speakOutput) //.reprompt('add a reprompt if you want to keep the session open for the user to respond') .getResponse(); } }; // Generic error handling to capture any syntax or routing errors. If you receive an error // stating the request handler chain is not found, you have not implemented a handler for // the intent being invoked or included it in the skill builder below. const ErrorHandler = { canHandle() { return true; }, handle(handlerInput, error) { console.log(`~~~~ Error handled: ${error.stack}`); const speakOutput = `Sorry, I had trouble doing what you asked. Please try again.`; return handlerInput.responseBuilder .speak(speakOutput) .reprompt(speakOutput) .getResponse(); } }; // The SkillBuilder acts as the entry point for your skill, routing all request and response // payloads to the handlers above. Make sure any new handlers or interceptors you've // defined are included below. The order matters - they're processed top to bottom. exports.handler = Alexa.SkillBuilders.custom() .addRequestHandlers( LaunchRequestHandler, HelloWorldIntentHandler, HelpIntentHandler, CancelAndStopIntentHandler, SessionEndedRequestHandler, IntentReflectorHandler, // make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers ) .addErrorHandlers( ErrorHandler, ) .lambda();
import os import subprocess import pytest def run_make(sub_command): cmd = ['make', sub_command] return subprocess.run(cmd, check=True) def has_uncommited_changes(): cmd = ['git', 'diff'] result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True) if result.stdout: return True return False class TestMake: @staticmethod @pytest.mark.skipif( os.getuid() != 0, reason="This test is only for CI environments", ) def test_make_generate(): assert not has_uncommited_changes(), ('No uncommited changes must ' 'exists') result = run_make('generate') # Just to make sure the command does not fail assert not result.returncode assert not has_uncommited_changes(), ('No uncommited changes must ' 'exists after "make generate"')
// Copyright 2022 Google LLC // // 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 // // https://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. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** 'use strict'; function main(name) { // [START secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format * `projects/* /secrets/* /versions/*`. * `projects/* /secrets/* /versions/latest` is an alias to the most recently * created SecretVersion google.cloud.secretmanager.v1.SecretVersion. */ // const name = 'abc123' // Imports the Secretmanager library const {SecretManagerServiceClient} = require('@google-cloud/secret-manager').v1; // Instantiates a client const secretmanagerClient = new SecretManagerServiceClient(); async function callAccessSecretVersion() { // Construct request const request = { name, }; // Run request const response = await secretmanagerClient.accessSecretVersion(request); console.log(response); } callAccessSecretVersion(); // [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_async] } process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); main(...process.argv.slice(2));
import { getBusinessObject } from 'bpmn-js/lib/util/ModelUtil'; import { sortBy } from 'min-dash'; import { TextFieldEntry, isTextFieldEntryEdited, isSelectEntryEdited } from '@bpmn-io/properties-panel'; import ReferenceSelect from '../../../entries/ReferenceSelect'; import { useService } from '../../../hooks'; import { getMessage, getMessageEventDefinition, isMessageSupported } from '../utils/EventDefinitionUtil'; import { createElement, findRootElementById, findRootElementsByType, getRoot, nextId } from '../../../utils/ElementUtil'; export const EMPTY_OPTION = ''; export const CREATE_NEW_OPTION = 'create-new'; /** * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry */ /** * @returns {Array<Entry>} entries */ export function MessageProps(props) { const { element } = props; if (!isMessageSupported(element)) { return []; } const message = getMessage(element); let entries = [ { id: 'messageRef', component: <MessageRef element={ element } />, isEdited: isSelectEntryEdited } ]; if (message) { entries = [ ...entries, { id: 'messageName', component: <MessageName element={ element } />, isEdited: isTextFieldEntryEdited }, ]; } return entries; } function MessageRef(props) { const { element } = props; const bpmnFactory = useService('bpmnFactory'); const commandStack = useService('commandStack'); const translate = useService('translate'); const messageEventDefinition = getMessageEventDefinition(element); const getValue = () => { const message = getMessage(element); if (message) { return message.get('id'); } return EMPTY_OPTION; }; const setValue = (value) => { const root = getRoot(messageEventDefinition); const commands = []; let message; // (1) create new message if (value === CREATE_NEW_OPTION) { const id = nextId('Message_'); message = createElement( 'bpmn:Message', { id, name: id }, root, bpmnFactory ); value = message.get('id'); commands.push({ cmd: 'element.updateModdleProperties', context: { element, moddleElement: root, properties: { rootElements: [ ...root.get('rootElements'), message ] } } }); } // (2) update (or remove) messageRef message = message || findRootElementById(messageEventDefinition, 'bpmn:Message', value); commands.push({ cmd: 'element.updateModdleProperties', context: { element, moddleElement: messageEventDefinition, properties: { messageRef: message } } }); // (3) commit all updates return commandStack.execute('properties-panel.multi-command-executor', commands); }; const getOptions = () => { let options = [ { value: EMPTY_OPTION, label: translate('<none>') }, { value: CREATE_NEW_OPTION, label: translate('Create new ...') } ]; const messages = findRootElementsByType(getBusinessObject(element), 'bpmn:Message'); sortByName(messages).forEach(message => { options.push({ value: message.get('id'), label: message.get('name') }); }); return options; }; return ReferenceSelect({ element, id: 'messageRef', label: translate('Global message reference'), autoFocusEntry: 'messageName', getValue, setValue, getOptions }); } function MessageName(props) { const { element } = props; const commandStack = useService('commandStack'); const translate = useService('translate'); const debounce = useService('debounceInput'); const message = getMessage(element); const getValue = () => { return message.get('name'); }; const setValue = (value) => { return commandStack.execute( 'element.updateModdleProperties', { element, moddleElement: message, properties: { name: value } } ); }; return TextFieldEntry({ element, id: 'messageName', label: translate('Name'), getValue, setValue, debounce }); } // helper ///////////////////////// function sortByName(elements) { return sortBy(elements, e => (e.name || '').toLowerCase()); }
import { combineReducers } from 'redux'; import Library from './list'; import SelectLib from './select'; export default combineReducers({ libraries: Library, sellib: SelectLib });
const withCSS = require('@zeit/next-css') const withMDX = require('@zeit/next-mdx') const config = { cssModules: true, cssLoaderOptions: { importLoaders: 1, localIdentName: '[name]_[local]' }, pageExtensions: ['js', 'jsx', 'mdx'], webpack: config => { config.resolve.extensions.push('.mdx') return config } } module.exports = withMDX({ })( withCSS(config) )
import os import csv import numpy as np import matplotlib.pyplot as plt paths = [r".\data\archive\attack\Parasite Chain Attack\IOTA",r"..\G-IOTA",r"..\E-IOTA"] res = [] for path in paths: os.chdir(path) temp = dict() with open('DiffTxChain.txt', 'r',) as file: reader = csv.reader(file, delimiter = ';') for row in reader: if row[0] != "null": if not row[0] in temp: temp[row[0]] = [0,0] if int(row[2]) > 0: temp[row[0]][0] += 1 else: temp[row[0]][1] += 1 res.append(temp) tsa = ["IOTA","G-IOTA","E-IOTA"] L = [] LG = [] LE = [] for i in range(0,3): print("*" + tsa[i] + ":") TSA = res[i] if not TSA: print("No result") else: for k,v in TSA.items(): sr = float(v[0]) fr = float(v[1]) print("PropComputingPower value: {}, Success rate: {:.2f}%, Fail rate: {:.2f}%".format(k,100.0*sr/(sr+fr),100.0*fr/(sr+fr))) if k != "0.5": if i == 0: L.append(100.0*fr/(sr+fr)) elif i == 1: LG.append(100.0*fr/(sr+fr)) else: LE.append(100.0*fr/(sr+fr)) print('\n') os.chdir(r"..\.") x = np.arange(0.01,0.11,0.01) L.reverse() LG.reverse() LE.reverse() plt.figure(figsize=(8,5)) plt.plot(x,L,label="IOTA") plt.plot(x,LG,label="G-IOTA") plt.plot(x,LE,label="E-OTA") plt.xticks(x) plt.gca().invert_xaxis() plt.xlabel(r"PCP value") plt.ylabel(r"Resistance in %") plt.legend() plt.savefig('ResistancePCA.png',bbox_inches='tight')
// Underscore.js 1.8.2 // http://underscorejs.org // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function() { // Baseline setup // -------------- // Establish the root object, `window` in the browser, or `exports` on the server. var root = this; // Save the previous value of the `_` variable. var previousUnderscore = root._; // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; // Create quick reference variables for speed access to core prototypes. var push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty; // All **ECMAScript 5** native function implementations that we hope to use // are declared here. var nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind, nativeCreate = Object.create; // Naked function reference for surrogate-prototype-swapping. var Ctor = function() {}; // Create a safe reference to the Underscore object for use below. var _ = function(obj) { if (obj instanceof _) return obj; if (!(this instanceof _)) return new _(obj); this._wrapped = obj; }; // Export the Underscore object for **Node.js**, with // backwards-compatibility for the old `require()` API. If we're in // the browser, add `_` as a global object. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; } exports._ = _; } else { root._ = _; } // Current version. _.VERSION = '1.8.2'; // Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. var optimizeCb = function(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; case 2: return function(value, other) { return func.call(context, value, other); }; case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; }; // A mostly-internal function to generate callbacks that can be applied // to each element in a collection, returning the desired result — either // identity, an arbitrary callback, a property matcher, or a property accessor. var cb = function(value, context, argCount) { if (value == null) return _.identity; if (_.isFunction(value)) return optimizeCb(value, context, argCount); if (_.isObject(value)) return _.matcher(value); return _.property(value); }; _.iteratee = function(value, context) { return cb(value, context, Infinity); }; // An internal function for creating assigner functions. var createAssigner = function(keysFunc, undefinedOnly) { return function(obj) { var length = arguments.length; if (length < 2 || obj == null) return obj; for (var index = 1; index < length; index++) { var source = arguments[index], keys = keysFunc(source), l = keys.length; for (var i = 0; i < l; i++) { var key = keys[i]; if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; } } return obj; }; }; // An internal function for creating a new object that inherits from another. var baseCreate = function(prototype) { if (!_.isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; }; // Helper for collection methods to determine whether a collection // should be iterated as an array or as an object // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; var isArrayLike = function(collection) { var length = collection != null && collection.length; return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; }; // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. _.each = _.forEach = function(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var keys = _.keys(obj); for (i = 0, length = keys.length; i < length; i++) { iteratee(obj[keys[i]], keys[i], obj); } } return obj; }; // Return the results of applying the iteratee to each element. _.map = _.collect = function(obj, iteratee, context) { iteratee = cb(iteratee, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; }; // Create a reducing function iterating left or right. function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; // Determine the initial value if none is provided. if (arguments.length < 3) { memo = obj[keys ? keys[index] : index]; index += dir; } return iterator(obj, iteratee, memo, keys, index, length); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. _.reduce = _.foldl = _.inject = createReduce(1); // The right-associative version of reduce, also known as `foldr`. _.reduceRight = _.foldr = createReduce(-1); // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function(obj, predicate, context) { var key; if (isArrayLike(obj)) { key = _.findIndex(obj, predicate, context); } else { key = _.findKey(obj, predicate, context); } if (key !== void 0 && key !== -1) return obj[key]; }; // Return all the elements that pass a truth test. // Aliased as `select`. _.filter = _.select = function(obj, predicate, context) { var results = []; predicate = cb(predicate, context); _.each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. _.reject = function(obj, predicate, context) { return _.filter(obj, _.negate(cb(predicate)), context); }; // Determine whether all of the elements match a truth test. // Aliased as `all`. _.every = _.all = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; }; // Determine if at least one element in the object matches a truth test. // Aliased as `any`. _.some = _.any = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; }; // Determine if the array or object contains a given value (using `===`). // Aliased as `includes` and `include`. _.contains = _.includes = _.include = function(obj, target, fromIndex) { if (!isArrayLike(obj)) obj = _.values(obj); return _.indexOf(obj, target, typeof fromIndex == 'number' && fromIndex) >= 0; }; // Invoke a method (with arguments) on every item in a collection. _.invoke = function(obj, method) { var args = slice.call(arguments, 2); var isFunc = _.isFunction(method); return _.map(obj, function(value) { var func = isFunc ? method : value[method]; return func == null ? func : func.apply(value, args); }); }; // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects // containing specific `key:value` pairs. _.where = function(obj, attrs) { return _.filter(obj, _.matcher(attrs)); }; // Convenience version of a common use case of `find`: getting the first object // containing specific `key:value` pairs. _.findWhere = function(obj, attrs) { return _.find(obj, _.matcher(attrs)); }; // Return the maximum element (or element-based computation). _.max = function(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value > result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed > lastComputed || computed === -Infinity && result === -Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Return the minimum element (or element-based computation). _.min = function(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value < result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed < lastComputed || computed === Infinity && result === Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Shuffle a collection, using the modern version of the // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { var set = isArrayLike(obj) ? obj : _.values(obj); var length = set.length; var shuffled = Array(length); for (var index = 0, rand; index < length; index++) { rand = _.random(0, index); if (rand !== index) shuffled[index] = shuffled[rand]; shuffled[rand] = set[index]; } return shuffled; }; // Sample **n** random values from a collection. // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `map`. _.sample = function(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = _.values(obj); return obj[_.random(obj.length - 1)]; } return _.shuffle(obj).slice(0, Math.max(0, n)); }; // Sort the object's values by a criterion produced by an iteratee. _.sortBy = function(obj, iteratee, context) { iteratee = cb(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { value: value, index: index, criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. var group = function(behavior) { return function(obj, iteratee, context) { var result = {}; iteratee = cb(iteratee, context); _.each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. _.groupBy = group(function(result, value, key) { if (_.has(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `groupBy`, but for // when you know that your index values will be unique. _.indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. _.countBy = group(function(result, value, key) { if (_.has(result, key)) result[key]++; else result[key] = 1; }); // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); if (isArrayLike(obj)) return _.map(obj, _.identity); return _.values(obj); }; // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : _.keys(obj).length; }; // Split a collection into two arrays: one whose elements all satisfy the given // predicate, and one whose elements all do not satisfy the predicate. _.partition = function(obj, predicate, context) { predicate = cb(predicate, context); var pass = [], fail = []; _.each(obj, function(value, key, obj) { (predicate(value, key, obj) ? pass : fail).push(value); }); return [pass, fail]; }; // Array Functions // --------------- // Get the first element of an array. Passing **n** will return the first N // values in the array. Aliased as `head` and `take`. The **guard** check // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; if (n == null || guard) return array[0]; return _.initial(array, array.length - n); }; // Returns everything but the last entry of the array. Especially useful on // the arguments object. Passing **n** will return all the values in // the array, excluding the last N. _.initial = function(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }; // Get the last element of an array. Passing **n** will return the last N // values in the array. _.last = function(array, n, guard) { if (array == null) return void 0; if (n == null || guard) return array[array.length - 1]; return _.rest(array, Math.max(0, array.length - n)); }; // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. // Especially useful on the arguments object. Passing an **n** will return // the rest N values in the array. _.rest = _.tail = _.drop = function(array, n, guard) { return slice.call(array, n == null || guard ? 1 : n); }; // Trim out all falsy values from an array. _.compact = function(array) { return _.filter(array, _.identity); }; // Internal implementation of a recursive `flatten` function. var flatten = function(input, shallow, strict, startIndex) { var output = [], idx = 0; for (var i = startIndex || 0, length = input && input.length; i < length; i++) { var value = input[i]; if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { //flatten current level of array or arguments object if (!shallow) value = flatten(value, shallow, strict); var j = 0, len = value.length; output.length += len; while (j < len) { output[idx++] = value[j++]; } } else if (!strict) { output[idx++] = value; } } return output; }; // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { return flatten(array, shallow, false); }; // Return a version of the array that does not contain the specified value(s). _.without = function(array) { return _.difference(array, slice.call(arguments, 1)); }; // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. _.uniq = _.unique = function(array, isSorted, iteratee, context) { if (array == null) return []; if (!_.isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; isSorted = false; } if (iteratee != null) iteratee = cb(iteratee, context); var result = []; var seen = []; for (var i = 0, length = array.length; i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; if (isSorted) { if (!i || seen !== computed) result.push(value); seen = computed; } else if (iteratee) { if (!_.contains(seen, computed)) { seen.push(computed); result.push(value); } } else if (!_.contains(result, value)) { result.push(value); } } return result; }; // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { return _.uniq(flatten(arguments, true, true)); }; // Produce an array that contains every item shared between all the // passed-in arrays. _.intersection = function(array) { if (array == null) return []; var result = []; var argsLength = arguments.length; for (var i = 0, length = array.length; i < length; i++) { var item = array[i]; if (_.contains(result, item)) continue; for (var j = 1; j < argsLength; j++) { if (!_.contains(arguments[j], item)) break; } if (j === argsLength) result.push(item); } return result; }; // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. _.difference = function(array) { var rest = flatten(arguments, true, true, 1); return _.filter(array, function(value) { return !_.contains(rest, value); }); }; // Zip together multiple lists into a single array -- elements that share // an index go together. _.zip = function() { return _.unzip(arguments); }; // Complement of _.zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices _.unzip = function(array) { var length = array && _.max(array, 'length').length || 0; var result = Array(length); for (var index = 0; index < length; index++) { result[index] = _.pluck(array, index); } return result; }; // Converts lists into objects. Pass either a single array of `[key, value]` // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. _.object = function(list, values) { var result = {}; for (var i = 0, length = list && list.length; i < length; i++) { if (values) { result[list[i]] = values[i]; } else { result[list[i][0]] = list[i][1]; } } return result; }; // Return the position of the first occurrence of an item in an array, // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. _.indexOf = function(array, item, isSorted) { var i = 0, length = array && array.length; if (typeof isSorted == 'number') { i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; } else if (isSorted && length) { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } if (item !== item) { return _.findIndex(slice.call(array, i), _.isNaN); } for (; i < length; i++) if (array[i] === item) return i; return -1; }; _.lastIndexOf = function(array, item, from) { var idx = array ? array.length : 0; if (typeof from == 'number') { idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); } if (item !== item) { return _.findLastIndex(slice.call(array, 0, idx), _.isNaN); } while (--idx >= 0) if (array[idx] === item) return idx; return -1; }; // Generator function to create the findIndex and findLastIndex functions function createIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = array != null && array.length; var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; } // Returns the first index on an array-like that passes a predicate test _.findIndex = createIndexFinder(1); _.findLastIndex = createIndexFinder(-1); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. _.sortedIndex = function(array, obj, iteratee, context) { iteratee = cb(iteratee, context, 1); var value = iteratee(obj); var low = 0, high = array.length; while (low < high) { var mid = Math.floor((low + high) / 2); if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; }; // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See // [the Python documentation](http://docs.python.org/library/functions.html#range). _.range = function(start, stop, step) { if (arguments.length <= 1) { stop = start || 0; start = 0; } step = step || 1; var length = Math.max(Math.ceil((stop - start) / step), 0); var range = Array(length); for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; } return range; }; // Function (ahem) Functions // ------------------ // Determines whether to execute a function as a constructor // or a normal function with the provided arguments var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype); var result = sourceFunc.apply(self, args); if (_.isObject(result)) return result; return self; }; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if // available. _.bind = function(func, context) { if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); var args = slice.call(arguments, 2); var bound = function() { return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); }; return bound; }; // Partially apply a function by creating a version that has had some of its // arguments pre-filled, without changing its dynamic `this` context. _ acts // as a placeholder, allowing any combination of arguments to be pre-filled. _.partial = function(func) { var boundArgs = slice.call(arguments, 1); var bound = function() { var position = 0, length = boundArgs.length; var args = Array(length); for (var i = 0; i < length; i++) { args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; } while (position < arguments.length) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }; // Bind a number of an object's methods to that object. Remaining arguments // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. _.bindAll = function(obj) { var i, length = arguments.length, key; if (length <= 1) throw new Error('bindAll must be passed function names'); for (i = 1; i < length; i++) { key = arguments[i]; obj[key] = _.bind(obj[key], obj); } return obj; }; // Memoize an expensive function by storing its results. _.memoize = function(func, hasher) { var memoize = function(key) { var cache = memoize.cache; var address = '' + (hasher ? hasher.apply(this, arguments) : key); if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); return cache[address]; }; memoize.cache = {}; return memoize; }; // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function(func, wait) { var args = slice.call(arguments, 2); return setTimeout(function() { return func.apply(null, args); }, wait); }; // Defers a function, scheduling it to run after the current call stack has // cleared. _.defer = _.partial(_.delay, _, 1); // Returns a function, that, when invoked, will only be triggered at most once // during a given window of time. Normally, the throttled function will run // as much as it can, without ever going more than once per `wait` duration; // but if you'd like to disable the execution on the leading edge, pass // `{leading: false}`. To disable execution on the trailing edge, ditto. _.throttle = function(func, wait, options) { var context, args, result; var timeout = null; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; return function() { var now = _.now(); if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; }; // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function(func, wait, immediate) { var timeout, args, context, timestamp, result; var later = function() { var last = _.now() - timestamp; if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); if (!timeout) context = args = null; } } }; return function() { context = this; args = arguments; timestamp = _.now(); var callNow = immediate && !timeout; if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; }; // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. _.wrap = function(func, wrapper) { return _.partial(wrapper, func); }; // Returns a negated version of the passed-in predicate. _.negate = function(predicate) { return function() { return !predicate.apply(this, arguments); }; }; // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. _.compose = function() { var args = arguments; var start = args.length - 1; return function() { var i = start; var result = args[start].apply(this, arguments); while (i--) result = args[i].call(this, result); return result; }; }; // Returns a function that will only be executed on and after the Nth call. _.after = function(times, func) { return function() { if (--times < 1) { return func.apply(this, arguments); } }; }; // Returns a function that will only be executed up to (but not including) the Nth call. _.before = function(times, func) { var memo; return function() { if (--times > 0) { memo = func.apply(this, arguments); } if (times <= 1) func = null; return memo; }; }; // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. _.once = _.partial(_.before, 2); // Object Functions // ---------------- // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. var hasEnumBug = !{ toString: null }.propertyIsEnumerable('toString'); var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString' ]; function collectNonEnumProps(obj, keys) { var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; // Constructor is a special case. var prop = 'constructor'; if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); while (nonEnumIdx--) { prop = nonEnumerableProps[nonEnumIdx]; if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { keys.push(prop); } } } // Retrieve the names of an object's own properties. // Delegates to **ECMAScript 5**'s native `Object.keys` _.keys = function(obj) { if (!_.isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) if (_.has(obj, key)) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; }; // Retrieve all the property names of an object. _.allKeys = function(obj) { if (!_.isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; }; // Retrieve the values of an object's properties. _.values = function(obj) { var keys = _.keys(obj); var length = keys.length; var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[keys[i]]; } return values; }; // Returns the results of applying the iteratee to each element of the object // In contrast to _.map it returns an object _.mapObject = function(obj, iteratee, context) { iteratee = cb(iteratee, context); var keys = _.keys(obj), length = keys.length, results = {}, currentKey; for (var index = 0; index < length; index++) { currentKey = keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; }; // Convert an object into a list of `[key, value]` pairs. _.pairs = function(obj) { var keys = _.keys(obj); var length = keys.length; var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [keys[i], obj[keys[i]]]; } return pairs; }; // Invert the keys and values of an object. The values must be serializable. _.invert = function(obj) { var result = {}; var keys = _.keys(obj); for (var i = 0, length = keys.length; i < length; i++) { result[obj[keys[i]]] = keys[i]; } return result; }; // Return a sorted list of the function names available on the object. // Aliased as `methods` _.functions = _.methods = function(obj) { var names = []; for (var key in obj) { if (_.isFunction(obj[key])) names.push(key); } return names.sort(); }; // Extend a given object with all the properties in passed-in object(s). _.extend = createAssigner(_.allKeys); // Assigns a given object with all the own properties in the passed-in object(s) // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) _.extendOwn = _.assign = createAssigner(_.keys); // Returns the first key on an object that passes a predicate test _.findKey = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = _.keys(obj), key; for (var i = 0, length = keys.length; i < length; i++) { key = keys[i]; if (predicate(obj[key], key, obj)) return key; } }; // Return a copy of the object only containing the whitelisted properties. _.pick = function(object, oiteratee, context) { var result = {}, obj = object, iteratee, keys; if (obj == null) return result; if (_.isFunction(oiteratee)) { keys = _.allKeys(obj); iteratee = optimizeCb(oiteratee, context); } else { keys = flatten(arguments, false, false, 1); iteratee = function(value, key, obj) { return key in obj; }; obj = Object(obj); } for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i]; var value = obj[key]; if (iteratee(value, key, obj)) result[key] = value; } return result; }; // Return a copy of the object without the blacklisted properties. _.omit = function(obj, iteratee, context) { if (_.isFunction(iteratee)) { iteratee = _.negate(iteratee); } else { var keys = _.map(flatten(arguments, false, false, 1), String); iteratee = function(value, key) { return !_.contains(keys, key); }; } return _.pick(obj, iteratee, context); }; // Fill in a given object with default properties. _.defaults = createAssigner(_.allKeys, true); // Creates an object that inherits from the given prototype object. // If additional properties are provided then they will be added to the // created object. _.create = function(prototype, props) { var result = baseCreate(prototype); if (props) _.extendOwn(result, props); return result; }; // Create a (shallow-cloned) duplicate of an object. _.clone = function(obj) { if (!_.isObject(obj)) return obj; return _.isArray(obj) ? obj.slice() : _.extend({}, obj); }; // Invokes interceptor with the obj, and then returns obj. // The primary purpose of this method is to "tap into" a method chain, in // order to perform operations on intermediate results within the chain. _.tap = function(obj, interceptor) { interceptor(obj); return obj; }; // Returns whether an object has a given set of `key:value` pairs. _.isMatch = function(object, attrs) { var keys = _.keys(attrs), length = keys.length; if (object == null) return !length; var obj = Object(object); for (var i = 0; i < length; i++) { var key = keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; }; // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a === 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; // Unwrap any wrapped objects. if (a instanceof _) a = a._wrapped; if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); if (className !== toString.call(b)) return false; switch (className) { // Strings, numbers, regular expressions, dates, and booleans are compared by value. case '[object RegExp]': // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. return '' + a === '' + b; case '[object Number]': // `NaN`s are equivalent, but non-reflexive. // Object(NaN) is equivalent to NaN if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values. return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; } var areArrays = className === '[object Array]'; if (!areArrays) { if (typeof a != 'object' || typeof b != 'object') return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && ('constructor' in a && 'constructor' in b)) { return false; } } // Assume equality for cyclic structures. The algorithm for detecting cyclic // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. // Initializing stack of traversed objects. // It's done here since we only need them for objects and arrays comparison. aStack = aStack || []; bStack = bStack || []; var length = aStack.length; while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. if (aStack[length] === a) return bStack[length] === b; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); // Recursively compare objects and arrays. if (areArrays) { // Compare array lengths to determine if a deep comparison is necessary. length = a.length; if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties. while (length--) { if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { // Deep compare objects. var keys = _.keys(a), key; length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality. if (_.keys(b).length !== length) return false; while (length--) { // Deep compare each member key = keys[length]; if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; } } // Remove the first object from the stack of traversed objects. aStack.pop(); bStack.pop(); return true; }; // Perform a deep comparison to check if two objects are equal. _.isEqual = function(a, b) { return eq(a, b); }; // Is a given array, string, or object empty? // An "empty" object has no enumerable own-properties. _.isEmpty = function(obj) { if (obj == null) return true; if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; return _.keys(obj).length === 0; }; // Is a given value a DOM element? _.isElement = function(obj) { return !!(obj && obj.nodeType === 1); }; // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { return toString.call(obj) === '[object Array]'; }; // Is a given variable an object? _.isObject = function(obj) { var type = typeof obj; return type === 'function' || type === 'object' && !! obj; }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { _['is' + name] = function(obj) { return toString.call(obj) === '[object ' + name + ']'; }; }); // Define a fallback version of the method in browsers (ahem, IE < 9), where // there isn't any inspectable "Arguments" type. if (!_.isArguments(arguments)) { _.isArguments = function(obj) { return _.has(obj, 'callee'); }; } // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, // IE 11 (#1621), and in Safari 8 (#1929). if (typeof / . / != 'function' && typeof Int8Array != 'object') { _.isFunction = function(obj) { return typeof obj == 'function' || false; }; } // Is a given object a finite number? _.isFinite = function(obj) { return isFinite(obj) && !isNaN(parseFloat(obj)); }; // Is the given value `NaN`? (NaN is the only number which does not equal itself). _.isNaN = function(obj) { return _.isNumber(obj) && obj !== +obj; }; // Is a given value a boolean? _.isBoolean = function(obj) { return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; }; // Is a given value equal to null? _.isNull = function(obj) { return obj === null; }; // Is a given variable undefined? _.isUndefined = function(obj) { return obj === void 0; }; // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function(obj, key) { return obj != null && hasOwnProperty.call(obj, key); }; // Utility Functions // ----------------- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its // previous owner. Returns a reference to the Underscore object. _.noConflict = function() { root._ = previousUnderscore; return this; }; // Keep the identity function around for default iteratees. _.identity = function(value) { return value; }; // Predicate-generating functions. Often useful outside of Underscore. _.constant = function(value) { return function() { return value; }; }; _.noop = function() {}; _.property = function(key) { return function(obj) { return obj == null ? void 0 : obj[key]; }; }; // Generates a function for a given object that returns a given property. _.propertyOf = function(obj) { return obj == null ? function() {} : function(key) { return obj[key]; }; }; // Returns a predicate for checking whether an object has a given set of // `key:value` pairs. _.matcher = _.matches = function(attrs) { attrs = _.extendOwn({}, attrs); return function(obj) { return _.isMatch(obj, attrs); }; }; // Run a function **n** times. _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; // Return a random integer between min and max (inclusive). _.random = function(min, max) { if (max == null) { max = min; min = 0; } return min + Math.floor(Math.random() * (max - min + 1)); }; // A (possibly faster) way to get the current timestamp as an integer. _.now = Date.now || function() { return new Date().getTime(); }; // List of HTML entities for escaping. var escapeMap = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '`': '&#x60;' }; var unescapeMap = _.invert(escapeMap); // Functions for escaping and unescaping strings to/from HTML interpolation. var createEscaper = function(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped var source = '(?:' + _.keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; }; _.escape = createEscaper(escapeMap); _.unescape = createEscaper(unescapeMap); // If the value of the named `property` is a function then invoke it with the // `object` as context; otherwise, return it. _.result = function(object, property, fallback) { var value = object == null ? void 0 : object[property]; if (value === void 0) { value = fallback; } return _.isFunction(value) ? value.call(object) : value; }; // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; _.uniqueId = function(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; }; // By default, Underscore uses ERB-style template delimiters, change the // following template settings to use alternative delimiters. _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; // When customizing `templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }; var escaper = /\\|'|\r|\n|\u2028|\u2029/g; var escapeChar = function(match) { return '\\' + escapes[match]; }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. _.template = function(text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escaper, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; // If a variable is not specified, place data values in local scope. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; try { var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } var template = function(data) { return render.call(this, data, _); }; // Provide the compiled source as a convenience for precompilation. var argument = settings.variable || 'obj'; template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; // Add a "chain" function. Start chaining a wrapped Underscore object. _.chain = function(obj) { var instance = _(obj); instance._chain = true; return instance; }; // OOP // --------------- // If Underscore is called as a function, it returns a wrapped object that // can be used OO-style. This wrapper holds altered versions of all the // underscore functions. Wrapped objects may be chained. // Helper function to continue chaining intermediate results. var result = function(instance, obj) { return instance._chain ? _(obj).chain() : obj; }; // Add your own custom functions to the Underscore object. _.mixin = function(obj) { _.each(_.functions(obj), function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [this._wrapped]; push.apply(args, arguments); return result(this, func.apply(_, args)); }; }); }; // Add all of the Underscore functions to the wrapper object. _.mixin(_); // Add all mutator Array functions to the wrapper. _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; method.apply(obj, arguments); if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; return result(this, obj); }; }); // Add all accessor Array functions to the wrapper. _.each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result(this, method.apply(this._wrapped, arguments)); }; }); // Extracts the result from a wrapped and chained object. _.prototype.value = function() { return this._wrapped; }; // Provide unwrapping proxy for some methods used in engine operations // such as arithmetic and JSON stringification. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; _.prototype.toString = function() { return '' + this._wrapped; }; // AMD registration happens at the end for compatibility with AMD loaders // that may not enforce next-turn semantics on modules. Even though general // practice for AMD registration is to be anonymous, underscore registers // as a named module because, like jQuery, it is a base library that is // popular enough to be bundled in a third party lib, but not be part of // an AMD load request. Those cases could generate an error when an // anonymous define() is called outside of a loader request. if (typeof define === 'function' && define.amd) { define('underscore', [], function() { return _; }); } module.exports = _; }.call(this));
(this["webpackJsonpsoft-mock-template"]=this["webpackJsonpsoft-mock-template"]||[]).push([[30],{1531:function(e,n,t){!function(e){"use strict";e.defineMode("apl",(function(){var e={".":"innerProduct","\\":"scan","/":"reduce","\u233f":"reduce1Axis","\u2340":"scan1Axis","\xa8":"each","\u2363":"power"},n={"+":["conjugate","add"],"\u2212":["negate","subtract"],"\xd7":["signOf","multiply"],"\xf7":["reciprocal","divide"],"\u2308":["ceiling","greaterOf"],"\u230a":["floor","lesserOf"],"\u2223":["absolute","residue"],"\u2373":["indexGenerate","indexOf"],"?":["roll","deal"],"\u22c6":["exponentiate","toThePowerOf"],"\u235f":["naturalLog","logToTheBase"],"\u25cb":["piTimes","circularFuncs"],"!":["factorial","binomial"],"\u2339":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"\u2264":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"\u2265":[null,"greaterThanOrEqual"],"\u2260":[null,"notEqual"],"\u2261":["depth","match"],"\u2262":[null,"notMatch"],"\u2208":["enlist","membership"],"\u2377":[null,"find"],"\u222a":["unique","union"],"\u2229":[null,"intersection"],"\u223c":["not","without"],"\u2228":[null,"or"],"\u2227":[null,"and"],"\u2371":[null,"nor"],"\u2372":[null,"nand"],"\u2374":["shapeOf","reshape"],",":["ravel","catenate"],"\u236a":[null,"firstAxisCatenate"],"\u233d":["reverse","rotate"],"\u2296":["axis1Reverse","axis1Rotate"],"\u2349":["transpose",null],"\u2191":["first","take"],"\u2193":[null,"drop"],"\u2282":["enclose","partitionWithAxis"],"\u2283":["diclose","pick"],"\u2337":[null,"index"],"\u234b":["gradeUp",null],"\u2352":["gradeDown",null],"\u22a4":["encode",null],"\u22a5":["decode",null],"\u2355":["format","formatByExample"],"\u234e":["execute",null],"\u22a3":["stop","left"],"\u22a2":["pass","right"]},t=/[\.\/\u233f\u2340\xa8\u2363]/,l=/\u236c/,r=/[\+\u2212\xd7\xf7\u2308\u230a\u2223\u2373\?\u22c6\u235f\u25cb!\u2339<\u2264=>\u2265\u2260\u2261\u2262\u2208\u2377\u222a\u2229\u223c\u2228\u2227\u2371\u2372\u2374,\u236a\u233d\u2296\u2349\u2191\u2193\u2282\u2283\u2337\u234b\u2352\u22a4\u22a5\u2355\u234e\u22a3\u22a2]/,a=/\u2190/,i=/[\u235d#].*$/,u=function(e){var n;return n=!1,function(t){return n=t,t!==e||"\\"===n}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(o,s){var c,p;return o.eatSpace()?null:'"'===(c=o.next())||"'"===c?(o.eatWhile(u(c)),o.next(),s.prev=!0,"string"):/[\[{\(]/.test(c)?(s.prev=!1,null):/[\]}\)]/.test(c)?(s.prev=!0,null):l.test(c)?(s.prev=!1,"niladic"):/[\xaf\d]/.test(c)?(s.func?(s.func=!1,s.prev=!1):s.prev=!0,o.eatWhile(/[\w\.]/),"number"):t.test(c)?"operator apl-"+e[c]:a.test(c)?"apl-arrow":r.test(c)?(p="apl-",null!=n[c]&&(s.prev?p+=n[c][1]:p+=n[c][0]),s.func=!0,s.prev=!1,"function "+p):i.test(c)?(o.skipToEnd(),"comment"):"\u2218"===c&&"."===o.peek()?(o.next(),"function jot-dot"):(o.eatWhile(/[\w\$_]/),s.prev=!0,"keyword")}}})),e.defineMIME("text/apl","apl")}(t(46))}}]); //# sourceMappingURL=30.c5c62238.chunk.js.map
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(React.createElement( 'g', null, React.createElement('path', { d: 'M13 16.12c3.47-.41 6.17-3.36 6.17-6.95 0-3.87-3.13-7-7-7s-7 3.13-7 7c0 3.47 2.52 6.34 5.83 6.89V20H5v2h14v-2h-6v-3.88z' }) ), 'Nature');
var Polygon = (function () { var color = { axis: '#ccc', side: { hover: { plain: '#dddfa4', special: '#9d9c64' }, final: { plain: '#b0c598', special: '#4f7337' } } }, display = {}, points = {}, canvas, context, origin = {}, turtle; function resize() { var g = Polygon, width = canvas.width = window.innerWidth, height = canvas.height = window.innerHeight; origin.left = Math.floor(width/2); origin.top = Math.floor(height/2); drawAxes(); } function drawAxes() { var g = Polygon; context.lineWidth = 2; context.strokeStyle = color.axis; context.beginPath(); context.moveTo(origin.left, 0); context.lineTo(origin.left, canvas.height); context.moveTo(0, origin.top); context.lineTo(canvas.width, origin.top); context.stroke(); } function drawPolygon(status) { var g = Polygon, n = parseInt(document.getElementById('numSides').innerHTML, 10), turn = 2*Math.PI / n, x1 = points.x1, y1 = points.y1, x2 = points.x2, y2 = points.y2, dx = x2 - x1, dy = y2 - y1, length = Math.sqrt(dx*dx + dy*dy); if (dy >= 0) { var angle = Math.acos(dx/length); } else { var angle = 2*Math.PI - Math.acos(dx/length); } context.clearRect(0, 0, canvas.width, canvas.height); drawAxes(); context.lineWidth = 4; context.lineCap = 'round'; context.beginPath(); context.strokeStyle = color.side[status].plain; turtle.setPosition(x1, y1); turtle.setAngle(angle); for (var i = 0; i < n; ++i) { turtle.forward(length); turtle.left(turn); } context.closePath(); context.stroke(); context.strokeStyle = color.side[status].special; context.beginPath(); turtle.setPosition(x1, y1); turtle.forward(length); context.stroke(); } function makeUnselectable(element) { element.className += ' unselectable'; element.ondragstart = element.onselectstart = function (event) { event.preventDefault(); }; } function getPosition (event) { event = event || window.event; var rect = canvas.getBoundingClientRect(), left = event.clientX - rect.left, top = event.clientY - rect.top, x = left - origin.left, y = origin.top - top; return { x: x, y: y }; } function load() { var numSides = document.getElementById('numSides'), minus = document.getElementById('minus'), plus = document.getElementById('plus'), controls, i; canvas = document.getElementById('surface'); context = canvas.getContext('2d'); display.begin = document.getElementById('begin'); display.end = document.getElementById('end'); resize(); turtle = new Turtle(canvas, origin); window.onresize = resize; makeUnselectable(canvas); minus.onmousedown = function () { var current = parseInt(numSides.innerHTML, 10); if (current == 3) { return; } numSides.innerHTML = current-1; drawPolygon('final'); }; plus.onmousedown = function () { var current = parseInt(numSides.innerHTML, 10); if (current == 20) { return; } numSides.innerHTML = current+1; drawPolygon('final'); }; controls = [ display.begin, display.end, numSides, minus, plus, document.getElementById('options') ]; for (i = 0; i < controls.length; ++i) { makeUnselectable(controls[i]); } canvas.onmousedown = function (event) { document.body.style.cursor = 'default'; var position = getPosition(event); points.x1 = points.x2 = position.x; points.y1 = points.y2 = position.y; display.begin.innerHTML = '<span class="label">x1, y1 =</span> ' + points.x1 + ', ' + points.y1; display.end.innerHTML = ''; drawPolygon('hover'); for (var i = 0; i < controls.length; ++i) { controls[i].style.zIndex = -10; } canvas.onmousemove = function (event) { var position = getPosition(event); points.x2 = position.x; points.y2 = position.y; display.end.innerHTML = '<span class="label">x2, y2 =</span> ' + points.x2 + ', ' + points.y2; drawPolygon('hover'); }; }; function noop() { } canvas.onmousemove = noop; canvas.onmouseup = canvas.onmouseout = function (event) { if (canvas.onmousemove === noop) { return; } canvas.onmousemove = noop; drawPolygon('final'); for (var i = 0; i < controls.length; ++i) { controls[i].style.zIndex = 0; } }; }; return { load: load }; })(); onload = Polygon.load;
import React from 'react'; import { createStackNavigator } from '@react-navigation/stack'; const CheckoutStack = createStackNavigator(); import CheckoutScreen from '../../features/checkout/screens/CheckoutScreen'; import CheckoutErrorScreen from '../../features/checkout/screens/CheckoutErrorScreen'; import CheckoutSuccessScreen from '../../features/checkout/screens/CheckoutSuccessScreen'; export default function CheckoutNavigator() { return ( <CheckoutStack.Navigator headerMode='none'> <CheckoutStack.Screen name='Checkout' component={CheckoutScreen} /> <CheckoutStack.Screen name='CheckoutSuccess' component={CheckoutSuccessScreen} /> <CheckoutStack.Screen name='CheckoutError' component={CheckoutErrorScreen} /> </CheckoutStack.Navigator> ); }
// For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html module.exports = { // All imported modules in your tests should be mocked automatically // automock: false, // Stop running tests after `n` failures // bail: 0, // Respect "browser" field in package.json when resolving modules // browser: false, // The directory where Jest should store its cached dependency information // cacheDirectory: "/private/var/folders/3_/yn5f7kmd67142_jpldbpyp7w0000gq/T/jest_dz", // Automatically clear mock calls and instances between every test // clearMocks: false, // Indicates whether the coverage information should be collected while executing the test // collectCoverage: false, // An array of glob patterns indicating a set of files for which coverage information should be collected // collectCoverageFrom: null, // The directory where Jest should output its coverage files coverageDirectory: 'coverage', // An array of regexp pattern strings used to skip coverage collection // coveragePathIgnorePatterns: [ // "/node_modules/" // ], // A list of reporter names that Jest uses when writing coverage reports // coverageReporters: [ // "json", // "text", // "lcov", // "clover" // ], // An object that configures minimum threshold enforcement for coverage results // coverageThreshold: null, // A path to a custom dependency extractor // dependencyExtractor: null, // Make calling deprecated APIs throw helpful error messages // errorOnDeprecated: false, // Force coverage collection from ignored files usin a array of glob patterns // forceCoverageMatch: [], // A path to a module which exports an async function that is triggered once before all test suites // globalSetup: null, // A path to a module which exports an async function that is triggered once after all test suites // globalTeardown: null, // A set of global variables that need to be available in all test environments // globals: {}, // An array of directory names to be searched recursively up from the requiring module's location // moduleDirectories: [ // "node_modules" // ], // An array of file extensions your modules use // moduleFileExtensions: [ // "js", // "json", // "jsx", // "ts", // "tsx", // "node" // ], // A map from regular expressions to module names that allow to stub out resources with a single module // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader // modulePathIgnorePatterns: [], // Activates notifications for test results // notify: false, // An enum that specifies notification mode. Requires { notify: true } // notifyMode: "failure-change", // A preset that is used as a base for Jest's configuration preset: 'ts-jest', // Run tests from one or more projects // projects: null, // Use this configuration option to add custom reporters to Jest // reporters: undefined, // Automatically reset mock state between every test // resetMocks: false, // Reset the module registry before running each individual test // resetModules: false, // A path to a custom resolver // resolver: null, // Automatically restore mock state between every test // restoreMocks: false, // The root directory that Jest should scan for tests and modules within // rootDir: null, // A list of paths to directories that Jest should use to search for files in // roots: [ // "<rootDir>" // ], // Allows you to use a custom runner instead of Jest's default test runner // runner: "jest-runner", // The paths to modules that run some code to configure or set up the testing environment before each test // setupFiles: ['./jest.setup.js'], // A list of paths to modules that run some code to configure or set up the testing framework before each test // setupFilesAfterEnv: [], // A list of paths to snapshot serializer modules Jest should use for snapshot testing // snapshotSerializers: [], // The test environment that will be used for testing testEnvironment: 'node', // Options that will be passed to the testEnvironment // testEnvironmentOptions: {}, // Adds a location field to test results // testLocationInResults: false, // The glob patterns Jest uses to detect test files // testMatch: [ // "**/__tests__/**/*.[jt]s?(x)", // "**/?(*.)+(spec|test).[tj]s?(x)" // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped testPathIgnorePatterns: ['/dist/', '/node_modules/'], // The regexp pattern or array of patterns that Jest uses to detect test files // testRegex: [], // This option allows the use of a custom results processor // testResultsProcessor: null, // This option allows use of a custom test runner // testRunner: "jasmine2", // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href // testURL: "http://localhost", // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" // timers: "real", // A map from regular expressions to paths to transformers // transform: null, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation // transformIgnorePatterns: [ // "/node_modules/" // ], // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them // unmockedModulePathPatterns: undefined, // Indicates whether each individual test should be reported during the run // verbose: null, // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode // watchPathIgnorePatterns: [], // Whether to use watchman for file crawling // watchman: true, };
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBlockByTimestamp = (service) => (timestamp, includeTransactions) => service.query('getBlock', { timestamp, includeTransactions }); //# sourceMappingURL=getBlockByTimestamp.js.map
/*! * ${copyright} */ //Provides control sap.ui.unified.Calendar. sap.ui.define([ 'sap/ui/core/Control', 'sap/ui/Device', 'sap/ui/core/delegate/ItemNavigation', 'sap/ui/unified/calendar/CalendarUtils', 'sap/ui/unified/calendar/CalendarDate', 'sap/ui/core/date/UniversalDate', "sap/ui/unified/DateRange", 'sap/ui/unified/library', 'sap/ui/core/format/DateFormat', 'sap/ui/core/library', "./YearPickerRenderer", "sap/ui/events/KeyCodes", "sap/ui/thirdparty/jquery" ], function( Control, Device, ItemNavigation, CalendarUtils, CalendarDate, UniversalDate, DateRange, library, DateFormat, coreLibrary, YearPickerRenderer, KeyCodes, jQuery ) { "use strict"; // shortcut for sap.ui.core.CalendarType var CalendarType = coreLibrary.CalendarType; /* * Inside the YearPicker CalendarDate objects are used. But in the API JS dates are used. * So conversion must be done on API functions. */ /** * Constructor for a new YearPicker. * * @param {string} [sId] id for the new control, generated automatically if no id is given * @param {object} [mSettings] initial settings for the new control * * @class * renders a YearPicker with ItemNavigation * This is used inside the calendar. Not for stand alone usage. * As in all date-time controls, all pubic JS Date objects that are given (e.g. <code>setDate()</code>) or read * (e.g. <code>getFirstRenderedDate</code>) with values which are considered as date objects in browser(local) timezone. * @extends sap.ui.core.Control * @version ${version} * * @constructor * @public * @since 1.28.0 * @alias sap.ui.unified.calendar.YearPicker * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var YearPicker = Control.extend("sap.ui.unified.calendar.YearPicker", /** @lends sap.ui.unified.calendar.YearPicker.prototype */ { metadata : { library : "sap.ui.unified", properties : { /** * The year is initial focused and selected * The value must be between 0 and 9999 * @deprecated as of version 1.34.0, replaced by <code>date</code> property */ year : {type : "int", group : "Data", defaultValue : 2000}, /** * number of displayed years * @since 1.30.0 */ years : {type : "int", group : "Appearance", defaultValue : 20}, /** * If set, interval selection is allowed * @since 1.74 */ intervalSelection : {type : "boolean", group : "Behavior", defaultValue : false}, /** * number of years in each row * 0 means just to have all years in one row, independent of the number * @since 1.30.0 */ columns : {type : "int", group : "Appearance", defaultValue : 4}, /** * Date as JavaScript Date object. For this date a <code>YearPicker</code> is rendered. If a Year is selected the * date is updated with the start date of the selected year (depending on the calendar type). * @since 1.34.0 */ date : {type : "object", group : "Data"}, /** * If set, the calendar type is used for display. * If not set, the calendar type of the global configuration is used. * @since 1.34.0 */ primaryCalendarType : {type : "sap.ui.core.CalendarType", group : "Appearance"}, /** * Date as CalendarDate object. Holds the rendered date in the middle of the grid. * @since 1.84.0 */ _middleDate : {type : "object", group : "Data", visibility: "hidden"} }, aggregations : { /** * Date Ranges for selected dates of the YearPicker * @since 1.74 */ selectedDates : {type : "sap.ui.unified.DateRange", multiple : true, singularName : "selectedDate" } }, events : { /** * Year selection changed */ select : {}, /** * The <code>pageChange</code> event is fired if the displayed years are changed by user navigation. * @since 1.38.0 */ pageChange : {} } }}); /* eslint-disable no-lonely-if */ YearPicker.prototype.init = function(){ // set default calendar type from configuration var sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType(); this.setProperty("primaryCalendarType", sCalendarType); // to format year with era in Japanese this._oYearFormat = DateFormat.getDateInstance({format: "y", calendarType: sCalendarType}); this._oFormatYyyymmdd = DateFormat.getInstance({pattern: "yyyyMMdd", calendarType: CalendarType.Gregorian}); this._oMinDate = CalendarUtils._minDate(this.getPrimaryCalendarType()); this._oMaxDate = CalendarUtils._maxDate(this.getPrimaryCalendarType()); }; YearPicker.prototype.onAfterRendering = function(){ _initItemNavigation.call(this); this.focus(); }; YearPicker.prototype.exit = function () { if (this._aMPSelectedDates && this._aMPSelectedDates.length) { this._aMPSelectedDates.forEach(function(oDateRange) { oDateRange.destroy(); }); this._aMPSelectedDates = undefined; } }; YearPicker.prototype.getFocusDomRef = function(){ return this.getDomRef() && this._oItemNavigation.getItemDomRefs()[this._iSelectedIndex]; }; YearPicker.prototype.setYear = function(iYear){ // no rerendering needed, just select new year or update years this.setProperty("year", iYear); iYear = this.getProperty("year"); // to have type conversion, validation.... var oDate = new CalendarDate(iYear, 0, 1, this.getPrimaryCalendarType()), oSelectedDates = this._getSelectedDates()[0], oYearPickerSelectedDates = this.getAggregation("selectedDates"); if (!oSelectedDates || this.getIntervalSelection()) { return this; } if (!this._oSelectedDatesControlOrigin) { if (!oYearPickerSelectedDates || !oYearPickerSelectedDates.length) { this.addAggregation("selectedDates", oSelectedDates); } !this.getIntervalSelection() && oSelectedDates.setStartDate(oDate.toLocalJSDate()); } this.setDate(oDate.toLocalJSDate()); return this; }; /** * Sets a date. * @param {Date} oDate a JavaScript date * @return {sap.ui.unified.YearPicker} <code>this</code> for method chaining */ YearPicker.prototype.setDate = function(oDate){ var oCalDate, iYear, iYears, iHalfRange; // check the given object if it's a JS Date object // null is a default value so it should not throw error but set it instead oDate && CalendarUtils._checkJSDateObject(oDate); iYear = oDate.getFullYear(); CalendarUtils._checkYearInValidRange(iYear); oCalDate = CalendarDate.fromLocalJSDate(oDate, this.getPrimaryCalendarType()); oCalDate.setMonth(0, 1); this.setProperty("date", oDate); this.setProperty("year", oCalDate.getYear()); this._oDate = oCalDate; iYears = this.getYears(); iHalfRange = Math.floor(iYears / 2); this._iSelectedIndex = iHalfRange; this.setProperty("_middleDate", oCalDate); return this; }; /** * @return {sap.ui.unified.calendar.CalendarDate} The date, representing the year * @private */ YearPicker.prototype._getDate = function(){ if (!this._oDate) { var iYear = this.getYear(); this._oDate = new CalendarDate(iYear, 0, 1, this.getPrimaryCalendarType()); } return this._oDate; }; /** * Sets the control instance which contains the selectedDates * to the YearPicker control instance * @ui5-restricted sap.m.DateRangeSelection * @private * @param {sap.ui.core.Control} oControl containing the selected dates */ YearPicker.prototype._setSelectedDatesControlOrigin = function (oControl) { this._oSelectedDatesControlOrigin = oControl; }; YearPicker.prototype.getSelectedDates = function(){ if (this._oSelectedDatesControlOrigin) { return this._oSelectedDatesControlOrigin.getSelectedDates(); } return this.getAggregation("selectedDates"); }; YearPicker.prototype._getSelectedDates = function() { var oSelectedDates = this.getSelectedDates(); if (oSelectedDates) { return oSelectedDates; } else if (!this._aMPSelectedDates || !this._aMPSelectedDates.length) { this._aMPSelectedDates = [new DateRange()]; this._aMPSelectedDates[0].setStartDate(this._getDate().toLocalJSDate()); return this._aMPSelectedDates; } else { return this._aMPSelectedDates; } }; YearPicker.prototype.setPrimaryCalendarType = function(sCalendarType){ this.setProperty("primaryCalendarType", sCalendarType); this._oYearFormat = DateFormat.getDateInstance({format: "y", calendarType: sCalendarType}); if (this._oDate) { this._oDate = new CalendarDate(this._oDate, sCalendarType); this._oDate.setMonth(0, 1); } //The min and max dates are given in gregorian values, but when getters are called they are calendar relevant - //i.e. maxdate date for islamic corresponds to 9666/3/30. //This is why we need to reinstantiate min/max date. If we don't we would again return the same dates for min/max this._oMinDate = new CalendarDate(this._oMinDate, sCalendarType); this._oMaxDate = new CalendarDate(this._oMaxDate, sCalendarType); return this; }; /** * displays the next page * * @returns {this} <code>this</code> to allow method chaining * @public * @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel */ YearPicker.prototype.nextPage = function(){ this._updatePage(true, this._oItemNavigation.getFocusedIndex()); return this; }; /** * displays the previous page * * @returns {this} <code>this</code> to allow method chaining * @public * @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel */ YearPicker.prototype.previousPage = function(){ this._updatePage(false, this._oItemNavigation.getFocusedIndex()); return this; }; YearPicker.prototype.onsapspace = function(oEvent) { oEvent.preventDefault(); }; YearPicker.prototype.onsapselect = function(oEvent){ // focused item must be selected var iIndex = this._oItemNavigation.getFocusedIndex(); var bSelected = this._selectYear(iIndex); if (bSelected) { this.fireSelect(); } }; YearPicker.prototype.onmouseover = function(oEvent) { var oTarget = oEvent.target, oSelectedDates = this._getSelectedDates()[0], oStartDate, oFocusedDate, sYyyymmdd; if (!oSelectedDates) { return; } if (oSelectedDates.getStartDate()) { oStartDate = CalendarDate.fromLocalJSDate(oSelectedDates.getStartDate(), this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); } if (oTarget.classList.contains("sapUiCalItem")) { sYyyymmdd = oTarget.getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); if (this._isSelectionInProgress()) { this._markInterval(oStartDate, oFocusedDate); } } }; YearPicker.prototype.onmousedown = function(oEvent) { this._oMousedownPosition = { clientX: oEvent.clientX, clientY: oEvent.clientY }; }; YearPicker.prototype.onmouseup = function(oEvent){ var oTarget = oEvent.target, oSelectedDates = this._getSelectedDates()[0], iIndex, sYyyymmdd, oStartDate, oFocusedDate, $DomRefs = this._oItemNavigation.getItemDomRefs(); // fire select event on mouseup to prevent closing MonthPicker during click if (this._bMousedownChange) { this._bMousedownChange = false; if (this.getIntervalSelection() && oTarget.classList.contains("sapUiCalItem") && oSelectedDates) { sYyyymmdd = oTarget.getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); oStartDate = CalendarDate.fromLocalJSDate(oSelectedDates.getStartDate(), this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); if (!oFocusedDate.isSame(oStartDate) && !oSelectedDates.getEndDate()) { iIndex = $DomRefs.index(oTarget); this._selectYear.call(this, iIndex); this._oItemNavigation.focusItem(iIndex); } } this.fireSelect(); } else if (Device.support.touch && this._isValueInThreshold(this._oMousedownPosition.clientX, oEvent.clientX, 10) && this._isValueInThreshold(this._oMousedownPosition.clientY, oEvent.clientY, 10) ) { iIndex = this._oItemNavigation.getFocusedIndex(); if (!$DomRefs[iIndex].classList.contains("sapUiCalItemDsbl")) { this._selectYear(iIndex); this.fireSelect(); } } }; YearPicker.prototype._markInterval = function(oStartDate, oEndDate) { var aDomRefs = this._oItemNavigation.getItemDomRefs(), oFocusedDate, sYyyymmdd, i; //swap if necessary if (oStartDate.isAfter(oEndDate)) { oEndDate = [oStartDate, oStartDate = oEndDate][0]; } for (i = 0; i < aDomRefs.length; ++i) { sYyyymmdd = aDomRefs[i].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); if (this._bMousedownChange) { if (oFocusedDate.isSame(oStartDate) || oFocusedDate.isSame(oEndDate)) { jQuery(aDomRefs[i]).addClass("sapUiCalItemSel"); } else { jQuery(aDomRefs[i]).removeClass("sapUiCalItemSel"); } } if (CalendarUtils._isBetween(oFocusedDate, oStartDate, oEndDate)) { jQuery(aDomRefs[i]).addClass("sapUiCalItemSelBetween"); } else { jQuery(aDomRefs[i]).removeClass("sapUiCalItemSelBetween"); } } }; /** * return the first date of the first rendered year * <b>Note:</b> If the YearPicker is not rendered no date is returned * * @returns {object} JavaScript Date Object * @public * @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel * @since 1.38.0 */ YearPicker.prototype.getFirstRenderedDate = function(){ var oFirstDate; if (this.getDomRef()) { var aDomRefs = this._oItemNavigation.getItemDomRefs(); oFirstDate = this._oFormatYyyymmdd.parse(jQuery(aDomRefs[0]).attr("data-sap-year-start")); } return oFirstDate; }; /** * Returns if value is in predefined threshold. * * @private */ YearPicker.prototype._isValueInThreshold = function (iReference, iValue, iThreshold) { var iLowerThreshold = iReference - iThreshold, iUpperThreshold = iReference + iThreshold; return iValue >= iLowerThreshold && iValue <= iUpperThreshold; }; /** * Calculated which is the first year to be rendered and changes the given date to it if needed. * * @param {sap.ui.unified.calendar.CalendarDate} oDate The date to be checked whether it is outside min and max date * @return {sap.ui.unified.calendar.CalendarDate} The checked date or min or max date if the checked one is outside * @private */ YearPicker.prototype._checkFirstDate = function(oDate){ // check if first date is outside of min and max date var iYears = this.getYears(), oMaxStartYear = new CalendarDate(this._oMaxDate, this.getPrimaryCalendarType()); oMaxStartYear.setYear(oMaxStartYear.getYear() - iYears + 1); if (oDate.isAfter(oMaxStartYear) && oDate.getYear() != oMaxStartYear.getYear()) { oDate = new CalendarDate(oMaxStartYear, this.getPrimaryCalendarType()); oDate.setMonth(0, 1); } else if (oDate.isBefore(this._oMinDate) && oDate.getYear() != this._oMinDate.getYear()) { oDate = new CalendarDate(this._oMinDate, this.getPrimaryCalendarType()); oDate.setMonth(0, 1); } return oDate; }; /** * @param {sap.ui.unified.calendar.CalendarDate} oDate The date do be checked * @returns {boolean} Whether the date is enabled * @private */ YearPicker.prototype._checkDateEnabled = function(oDate){ var bEnabled = true; if ((oDate.isAfter(this._oMaxDate) && oDate.getYear() != this._oMaxDate.getYear()) || (oDate.isBefore(this._oMinDate) && oDate.getYear() != this._oMinDate.getYear())) { bEnabled = false; } return bEnabled; }; YearPicker.prototype._updatePage = function (bForward, iSelectedIndex, bFireEvent){ var aDomRefs = this._oItemNavigation.getItemDomRefs(); var oFirstDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(jQuery(aDomRefs[0]).attr("data-sap-year-start")), this.getPrimaryCalendarType()); var iYears = this.getYears(); if (bForward) { var oMaxDate = new CalendarDate(this._oMaxDate, this.getPrimaryCalendarType()); oMaxDate.setYear(oMaxDate.getYear() - iYears + 1); if (oFirstDate.isBefore(oMaxDate)) { oFirstDate.setYear(oFirstDate.getYear() + iYears); if (oFirstDate.isAfter(oMaxDate)){ iSelectedIndex = iSelectedIndex + (oFirstDate.getYear() - oMaxDate.getYear()); if (iSelectedIndex > iYears - 1) { iSelectedIndex = iYears - 1; } oFirstDate = new CalendarDate(this._oMaxDate, this.getPrimaryCalendarType()); this._oDate.setMonth(0, 1); } } else { return; } } else { if (oFirstDate.isAfter(this._oMinDate)) { oFirstDate.setYear(oFirstDate.getYear() - iYears); if (oFirstDate.isBefore(this._oMinDate)) { iSelectedIndex = iSelectedIndex - (this._oMinDate.getYear() - oFirstDate.getYear()); if (iSelectedIndex < 0) { iSelectedIndex = 0; } oFirstDate = new CalendarDate(this._oMinDate, this.getPrimaryCalendarType()); } } else { return; } } oFirstDate.setYear(oFirstDate.getYear() + Math.floor(iYears / 2)); this._iSelectedIndex = iSelectedIndex; this.setProperty("_middleDate", oFirstDate); if (bFireEvent) { this.firePageChange(); } }; YearPicker.prototype._selectYear = function (iIndex) { var aDomRefs = this._oItemNavigation.getItemDomRefs(), $DomRef = jQuery(aDomRefs[iIndex]), sYyyymmdd = $DomRef.attr("data-sap-year-start"), oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()), oSelectedDates = this._getSelectedDates()[0], oYearPickerSelectedDates = this.getAggregation("selectedDates"), oStartDate; if ($DomRef.hasClass("sapUiCalItemDsbl")) { return false; // don't select disabled items } if (!this._isSelectionInProgress()) { // do not re-render in the middle of selection interval // if rendering happens, the year picker will immediately render the beginning of the interval in the middle var bSuppressInvalidate = true; } this.setProperty("year", oFocusedDate.getYear(), bSuppressInvalidate); this.setProperty("date", oFocusedDate.toLocalJSDate(), bSuppressInvalidate); if (!oSelectedDates) { return true; } if (!this._oSelectedDatesControlOrigin) { if (!oYearPickerSelectedDates || !oYearPickerSelectedDates.length) { this.addAggregation("selectedDates", oSelectedDates); } !this.getIntervalSelection() && oSelectedDates.setStartDate(oFocusedDate.toLocalJSDate(), bSuppressInvalidate); } if (this.getIntervalSelection()) { if (!oSelectedDates.getStartDate()) { oSelectedDates.setStartDate(oFocusedDate.toLocalJSDate(), bSuppressInvalidate); } else if (!oSelectedDates.getEndDate()) { oStartDate = CalendarDate.fromLocalJSDate(oSelectedDates.getStartDate(), this.getPrimaryCalendarType()); if (oFocusedDate.isBefore(oStartDate)) { oSelectedDates.setEndDate(oStartDate.toLocalJSDate(), bSuppressInvalidate); oSelectedDates.setStartDate(oFocusedDate.toLocalJSDate(), bSuppressInvalidate); } else { oSelectedDates.setEndDate(oFocusedDate.toLocalJSDate(), bSuppressInvalidate); } } else { oSelectedDates.setStartDate(oFocusedDate.toLocalJSDate(), bSuppressInvalidate); oSelectedDates.setEndDate(undefined, bSuppressInvalidate); } } if (bSuppressInvalidate) { for (var i = 0; i < aDomRefs.length; i++) { $DomRef = jQuery(aDomRefs[i]); sYyyymmdd = $DomRef.attr("data-sap-year-start"); var oCurrentDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); var bApplySelection = this._fnShouldApplySelection(oCurrentDate); var bApplySelectionBetween = this._fnShouldApplySelectionBetween(oCurrentDate); if (bApplySelection) { $DomRef.addClass("sapUiCalItemSel"); $DomRef.removeClass("sapUiCalItemSelBetween"); $DomRef.attr("aria-selected", "true"); } if (bApplySelectionBetween) { $DomRef.addClass("sapUiCalItemSelBetween"); $DomRef.attr("aria-selected", "true"); } if (!bApplySelection && !bApplySelectionBetween) { $DomRef.removeClass("sapUiCalItemSel"); $DomRef.removeClass("sapUiCalItemSelBetween"); $DomRef.attr("aria-selected", "false"); } } } return true; }; YearPicker.prototype._isSelectionInProgress = function() { var oSelectedDates = this._getSelectedDates()[0]; if (!oSelectedDates) { return false; } return this.getIntervalSelection() && oSelectedDates.getStartDate() && !oSelectedDates.getEndDate(); }; function _initItemNavigation(){ var oFocusedDate = this.getDate() ? CalendarDate.fromLocalJSDate(this.getDate(), this.getPrimaryCalendarType()) : this._getDate(), oRootDomRef = this.getDomRef(), aDomRefs = this.$().find(".sapUiCalItem"), iIndex, sYyyymmdd, oCurrentDate, i; for (i = 0; i < aDomRefs.length; ++i) { sYyyymmdd = aDomRefs[i].getAttribute("data-sap-year-start"); oCurrentDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); if (oCurrentDate.isSame(oFocusedDate)) { iIndex = i; break; } } if (!this._oItemNavigation) { this._oItemNavigation = new ItemNavigation(); this._oItemNavigation.attachEvent(ItemNavigation.Events.AfterFocus, _handleAfterFocus, this); this._oItemNavigation.attachEvent(ItemNavigation.Events.FocusAgain, _handleFocusAgain, this); this._oItemNavigation.attachEvent(ItemNavigation.Events.BorderReached, _handleBorderReached, this); this.addDelegate(this._oItemNavigation); this._oItemNavigation.setHomeEndColumnMode(true, true); this._oItemNavigation.setDisabledModifiers({ sapnext: ["alt", "meta"], sapprevious: ["alt", "meta"], saphome : ["alt", "meta"], sapend : ["meta"] }); } this._oItemNavigation.setRootDomRef(oRootDomRef); this._oItemNavigation.setItemDomRefs(aDomRefs); this._oItemNavigation.setCycling(false); this._oItemNavigation.setColumns(this.getColumns(), true); if (CalendarUtils._isBetween(oFocusedDate, this._oMinDate, this._oMaxDate, true)) { this._oItemNavigation.setFocusedIndex(iIndex); } this._oItemNavigation.setPageSize(aDomRefs.length); // to make sure that pageup/down goes out of month } function _handleAfterFocus(oControlEvent){ var iIndex = oControlEvent.getParameter("index"), oEvent = oControlEvent.getParameter("event"), oTarget = this._oItemNavigation.aItemDomRefs[iIndex], oSelectedDates = this._getSelectedDates()[0], oStartDate, oFocusedDate, sYyyymmdd; if (!oEvent) { return; // happens if focus is set via ItemNavigation.focusItem directly } if (oEvent.type === "mousedown") { // as no click event is fired in some cases this._handleMousedown(oEvent, iIndex); } else if (oEvent.type === "sapnext" || oEvent.type === "sapprevious") { if (!oSelectedDates) { return; } if (oSelectedDates.getStartDate()) { oStartDate = CalendarDate.fromLocalJSDate(oSelectedDates.getStartDate(), this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); } sYyyymmdd = oTarget.getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); if (this._isSelectionInProgress()) { this._markInterval(oStartDate, oFocusedDate); } } } function _handleFocusAgain(oControlEvent){ _handleAfterFocus.call(this, oControlEvent); } YearPicker.prototype._handleMousedown = function(oEvent, iIndex){ if (oEvent.button || Device.support.touch) { // only use left mouse button or not touch return; } var bSelected = this._selectYear(iIndex); if (bSelected) { this._bMousedownChange = true; } oEvent.preventDefault(); // to prevent focus set outside of DatePicker oEvent.setMark("cancelAutoClose"); }; function _handleBorderReached(oControlEvent){ var oEvent = oControlEvent.getParameter("event"), iIndex = this._oItemNavigation.getFocusedIndex(), iYears = this.getYears(), iColumns = this.getColumns(), oSelectedDates = this._getSelectedDates()[0], aDomRefs = this._oItemNavigation.getItemDomRefs(), oStartDate, oFocusedDate, sYyyymmdd; if (oSelectedDates && oSelectedDates.getStartDate()) { oStartDate = CalendarDate.fromLocalJSDate(oSelectedDates.getStartDate(), this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); } if (oEvent.type) { if (iColumns === 0) { iColumns = iYears; } switch (oEvent.type) { case "sapnext": case "sapnextmodifiers": if (oEvent.keyCode === KeyCodes.ARROW_DOWN && iColumns < iYears) { sYyyymmdd = aDomRefs[iIndex - iYears + iColumns].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); //same column in first row of next group (only if more than one row) this._updatePage(true, iIndex - iYears + iColumns, true); this._iSelectedIndex = iIndex - iYears + iColumns; } else { sYyyymmdd = aDomRefs[0].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); // first year in next group this._updatePage(true, 0, true); } break; case "sapprevious": case "sappreviousmodifiers": if (oEvent.keyCode === KeyCodes.ARROW_UP && iColumns < iYears) { sYyyymmdd = aDomRefs[iYears - iColumns + iIndex].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); //same column in last row of previous group (only if more than one row) this._updatePage(false, iYears - iColumns + iIndex, true); this._iSelectedIndex = iYears - iColumns + iIndex; } else { sYyyymmdd = aDomRefs[iYears - 1].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); // last year in previous group this._updatePage(false, iYears - 1, true); } break; case "sappagedown": sYyyymmdd = aDomRefs[iIndex].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); // same index in next group this._updatePage(true, iIndex, true); break; case "sappageup": sYyyymmdd = aDomRefs[iIndex].getAttribute("data-sap-year-start"); oFocusedDate = CalendarDate.fromLocalJSDate(this._oFormatYyyymmdd.parse(sYyyymmdd), this.getPrimaryCalendarType()); // same index in previous group this._updatePage(false, iIndex, true); break; default: break; } } this._isSelectionInProgress() && this._markInterval(oStartDate, oFocusedDate); } /** * Determines if a given date is the same as selected start or end date * * @private * @param {sap.ui.unified.calendar.CalendarDate} oCurrentDate */ YearPicker.prototype._fnShouldApplySelection = function(oCurrentDate) { var oSelectedDates = this._getSelectedDates()[0], oStartDate, oEndDate; if (!oSelectedDates) { return false; } oStartDate = oSelectedDates.getStartDate(); oEndDate = oSelectedDates.getEndDate(); if (oStartDate) { oStartDate = CalendarDate.fromLocalJSDate(oStartDate, this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); } if (this.getIntervalSelection() && oStartDate && oEndDate) { oEndDate = CalendarDate.fromLocalJSDate(oEndDate, this.getPrimaryCalendarType()); oEndDate.setMonth(0, 1); if (oCurrentDate.isSame(oStartDate) || oCurrentDate.isSame(oEndDate)) { return true; } } else if (oStartDate && oCurrentDate.isSame(oStartDate)) { return true; } return false; }; /** * Determines if a given date is between the selected start and end date * * @private * @param {sap.ui.unified.calendar.CalendarDate} oCurrentDate */ YearPicker.prototype._fnShouldApplySelectionBetween = function(oCurrentDate) { var oSelectedDates = this._getSelectedDates()[0], oStartDate, oEndDate; if (!oSelectedDates) { return false; } oStartDate = oSelectedDates.getStartDate(); oEndDate = oSelectedDates.getEndDate(); if (this.getIntervalSelection() && oStartDate && oEndDate) { oStartDate = CalendarDate.fromLocalJSDate(oStartDate, this.getPrimaryCalendarType()); oStartDate.setMonth(0, 1); oEndDate = CalendarDate.fromLocalJSDate(oEndDate, this.getPrimaryCalendarType()); oEndDate.setMonth(0, 1); if (CalendarUtils._isBetween(oCurrentDate, oStartDate, oEndDate)) { return true; } } return false; }; return YearPicker; });
/** * Implement Gatsby's Node APIs in this file. * * See: https://www.gatsbyjs.org/docs/node-apis/ */ const path = require('path'); const _ = require('lodash'); exports.createPages = async ({ actions, graphql, reporter }) => { const { createPage } = actions; const postTemplate = path.resolve(`src/templates/post.tsx`); const tagTemplate = path.resolve('src/templates/tag.tsx'); const result = await graphql(` { postsRemark: allMarkdownRemark( filter: { fileAbsolutePath: { regex: "/posts/" } } sort: { order: DESC, fields: [frontmatter___date] } limit: 1000 ) { edges { node { frontmatter { slug } } } } tagsGroup: allMarkdownRemark(limit: 2000) { group(field: frontmatter___tags) { fieldValue } } } `); // Handle errors if (result.errors) { reporter.panicOnBuild(`Error while running GraphQL query.`); return; } // Create post detail pages const posts = result.data.postsRemark.edges; posts.forEach(({ node }) => { createPage({ path: node.frontmatter.slug, component: postTemplate, context: {}, }); }); // Extract tag data from query const tags = result.data.tagsGroup.group; // Make tag pages tags.forEach(tag => { createPage({ path: `/pensieve/tags/${_.kebabCase(tag.fieldValue)}/`, component: tagTemplate, context: { tag: tag.fieldValue, }, }); }); }; // https://www.gatsbyjs.org/docs/node-apis/#onCreateWebpackConfig exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { // https://www.gatsbyjs.org/docs/debugging-html-builds/#fixing-third-party-modules if (stage === 'build-html' || stage === 'develop-html') { actions.setWebpackConfig({ module: { rules: [ { test: /scrollreveal/, use: loaders.null(), }, { test: /animejs/, use: loaders.null(), }, { test: /miniraf/, use: loaders.null(), }, ], }, }); } actions.setWebpackConfig({ resolve: { alias: { '@components': path.resolve(__dirname, 'src/components'), '@config': path.resolve(__dirname, 'src/config'), '@fonts': path.resolve(__dirname, 'src/fonts'), '@hooks': path.resolve(__dirname, 'src/hooks'), '@images': path.resolve(__dirname, 'src/images'), '@pages': path.resolve(__dirname, 'src/pages'), '@styles': path.resolve(__dirname, 'src/styles'), '@utils': path.resolve(__dirname, 'src/utils'), }, }, }); };
""" Get some sample version strings from the wild. """ # https://python-forum.io/Thread-pip-list-available-packages # download file # curl! # parse out version strings # https://pypi.org/simple/epicurus/ import requests import os import subprocess def execute_get_text(command): try: result = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) except subprocess.CalledProcessError as err: raise return result def download_package(rows): url = package_info(rows) if url == "nozips": print("no zips") return base = os.path.basename(url).split("#")[0] if os.path.isfile("packages/{0}".format(base)): print("Already have packages/{0}".format(base)) return command = "curl -0 {0} -o packages/{1}".format(url, base) print(command) result = execute_get_text(command) print(result) def package_info(rows): last = "nozips" for row in rows: try: url = row.split('"')[1] if ".zip" in url or ".gz" in url: print(url) last = url except: pass return last def done_packages(): packages = [] for dir in os.listdir("packages"): if dir.endswith(".gz") or dir.endswith(".zip"): continue packages.append(dir) print("Have " + str(len(packages)) + " packages") return packages def read_packages(): i = 0 done = done_packages() for row in open("packages.html"): try: url = "https://pypi.org" + row.split('"')[1] package_name = row.split('"')[1].replace("simple/", "").replace("/", "") if package_name in done: print(package_name + " done") continue print(url) except: continue response = requests.get(url) with open("meta/" + url.split("/")[-2], "w") as file: download_package(response.text.split("\n")) # file.write(response.text) i += 1 if i > 10000: exit(1) read_packages()
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _draftJs = require("draft-js"); exports.default = function (editorState) { var selection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : editorState.getSelection(); var styles = ["BOLD", "ITALIC", "STRIKETHROUGH", "CODE"]; var newEditorState = _draftJs.EditorState.push(editorState, styles.reduce(function (newContentState, style) { return _draftJs.Modifier.removeInlineStyle(newContentState, selection, style); }, editorState.getCurrentContent()), "change-inline-style"); return _draftJs.RichUtils.toggleLink(newEditorState, selection, null); };
"""`marketprice.messages.neo` namespace."""
function SvgFlashAuto(props) { return ( <svg xmlns='http://www.w3.org/2000/svg' height='1em' viewBox='0 0 24 24' width='1em' className='svg-icon' {...props}> <path d='M0 0h24v24H0z' fill='none' /> <path d='M3 2v12h3v9l7-12H9l4-9H3zm16 0h-2l-3.2 9h1.9l.7-2h3.2l.7 2h1.9L19 2zm-2.15 5.65L18 4l1.15 3.65h-2.3z' /> </svg> ); } export default SvgFlashAuto;
//========================================// // Main Fonts Included All Files // //========================================// // Main Fonts SASS File import './assets/scss/linkedfonts.scss';
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Wrapper around various loggers and progress bars (e.g., tqdm). """ import atexit import json import logging import os import sys from collections import OrderedDict from contextlib import contextmanager from numbers import Number from typing import Optional import torch from .meters import AverageMeter, StopwatchMeter, TimeMeter logger = logging.getLogger(__name__) def progress_bar( iterator, log_format: Optional[str] = None, log_interval: int = 100, log_file: Optional[str] = None, epoch: Optional[int] = None, prefix: Optional[str] = None, tensorboard_logdir: Optional[str] = None, default_log_format: str = "tqdm", wandb_project: Optional[str] = None, wandb_run_name: Optional[str] = None, azureml_logging: Optional[bool] = False, ): if log_format is None: log_format = default_log_format if log_file is not None: handler = logging.FileHandler(filename=log_file) logger.addHandler(handler) if log_format == "tqdm" and not sys.stderr.isatty(): log_format = "simple" if log_format == "json": bar = JsonProgressBar(iterator, epoch, prefix, log_interval) elif log_format == "none": bar = NoopProgressBar(iterator, epoch, prefix) elif log_format == "simple": bar = SimpleProgressBar(iterator, epoch, prefix, log_interval) elif log_format == "tqdm": bar = TqdmProgressBar(iterator, epoch, prefix) else: raise ValueError("Unknown log format: {}".format(log_format)) if tensorboard_logdir: try: # [FB only] custom wrapper for TensorBoard import palaas # noqa from .fb_tbmf_wrapper import FbTbmfWrapper bar = FbTbmfWrapper(bar, log_interval) except ImportError: bar = TensorboardProgressBarWrapper(bar, tensorboard_logdir) if wandb_project: bar = WandBProgressBarWrapper(bar, wandb_project, run_name=wandb_run_name) if azureml_logging: bar = AzureMLProgressBarWrapper(bar) return bar def build_progress_bar( args, iterator, epoch: Optional[int] = None, prefix: Optional[str] = None, default: str = "tqdm", no_progress_bar: str = "none", ): """Legacy wrapper that takes an argparse.Namespace.""" if getattr(args, "no_progress_bar", False): default = no_progress_bar if getattr(args, "distributed_rank", 0) == 0: tensorboard_logdir = getattr(args, "tensorboard_logdir", None) else: tensorboard_logdir = None return progress_bar( iterator, log_format=args.log_format, log_interval=args.log_interval, epoch=epoch, prefix=prefix, tensorboard_logdir=tensorboard_logdir, default_log_format=default, ) def format_stat(stat): if isinstance(stat, Number): stat = "{:g}".format(stat) elif isinstance(stat, AverageMeter): stat = "{:.3f}".format(stat.avg) elif isinstance(stat, TimeMeter): stat = "{:g}".format(round(stat.avg)) elif isinstance(stat, StopwatchMeter): stat = "{:g}".format(round(stat.sum)) elif torch.is_tensor(stat): stat = stat.tolist() return stat class BaseProgressBar(object): """Abstract class for progress bars.""" def __init__(self, iterable, epoch=None, prefix=None): self.iterable = iterable self.n = getattr(iterable, "n", 0) self.epoch = epoch self.prefix = "" if epoch is not None: self.prefix += "epoch {:03d}".format(epoch) if prefix is not None: self.prefix += (" | " if self.prefix != "" else "") + prefix def __len__(self): return len(self.iterable) def __enter__(self): return self def __exit__(self, *exc): return False def __iter__(self): raise NotImplementedError def log(self, stats, tag=None, step=None): """Log intermediate stats according to log_interval.""" raise NotImplementedError def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" raise NotImplementedError def update_config(self, config): """Log latest configuration.""" pass def _str_commas(self, stats): return ", ".join(key + "=" + stats[key].strip() for key in stats.keys()) def _str_pipes(self, stats): return " | ".join(key + " " + stats[key].strip() for key in stats.keys()) def _format_stats(self, stats): postfix = OrderedDict(stats) # Preprocess stats according to datatype for key in postfix.keys(): postfix[key] = str(format_stat(postfix[key])) return postfix @contextmanager def rename_logger(logger, new_name): old_name = logger.name if new_name is not None: logger.name = new_name yield logger logger.name = old_name class JsonProgressBar(BaseProgressBar): """Log output in JSON format.""" def __init__(self, iterable, epoch=None, prefix=None, log_interval=1000): super().__init__(iterable, epoch, prefix) self.log_interval = log_interval self.i = None self.size = None def __iter__(self): self.size = len(self.iterable) for i, obj in enumerate(self.iterable, start=self.n): self.i = i yield obj def log(self, stats, tag=None, step=None): """Log intermediate stats according to log_interval.""" step = step or self.i or 0 if step > 0 and self.log_interval is not None and step % self.log_interval == 0: update = ( self.epoch - 1 + (self.i + 1) / float(self.size) if self.epoch is not None else None ) stats = self._format_stats(stats, epoch=self.epoch, update=update) with rename_logger(logger, tag): logger.info(json.dumps(stats)) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" self.stats = stats if tag is not None: self.stats = OrderedDict( [(tag + "_" + k, v) for k, v in self.stats.items()] ) stats = self._format_stats(self.stats, epoch=self.epoch) with rename_logger(logger, tag): logger.info(json.dumps(stats)) def _format_stats(self, stats, epoch=None, update=None): postfix = OrderedDict() if epoch is not None: postfix["epoch"] = epoch if update is not None: postfix["update"] = round(update, 3) # Preprocess stats according to datatype for key in stats.keys(): postfix[key] = format_stat(stats[key]) return postfix class NoopProgressBar(BaseProgressBar): """No logging.""" def __init__(self, iterable, epoch=None, prefix=None): super().__init__(iterable, epoch, prefix) def __iter__(self): for obj in self.iterable: yield obj def log(self, stats, tag=None, step=None): """Log intermediate stats according to log_interval.""" pass def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" pass class SimpleProgressBar(BaseProgressBar): """A minimal logger for non-TTY environments.""" def __init__(self, iterable, epoch=None, prefix=None, log_interval=1000): super().__init__(iterable, epoch, prefix) self.log_interval = log_interval self.i = None self.size = None def __iter__(self): self.size = len(self.iterable) for i, obj in enumerate(self.iterable, start=self.n): self.i = i yield obj def log(self, stats, tag=None, step=None): """Log intermediate stats according to log_interval.""" step = step or self.i or 0 if step > 0 and self.log_interval is not None and step % self.log_interval == 0: stats = self._format_stats(stats) postfix = self._str_commas(stats) with rename_logger(logger, tag): logger.info( "{}: {:5d} / {:d} {}".format( self.prefix, self.i + 1, self.size, postfix ) ) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" postfix = self._str_pipes(self._format_stats(stats)) with rename_logger(logger, tag): logger.info("{} | {}".format(self.prefix, postfix)) class TqdmProgressBar(BaseProgressBar): """Log to tqdm.""" def __init__(self, iterable, epoch=None, prefix=None): super().__init__(iterable, epoch, prefix) from tqdm import tqdm self.tqdm = tqdm( iterable, self.prefix, leave=False, disable=(logger.getEffectiveLevel() > logging.INFO), ) def __iter__(self): return iter(self.tqdm) def log(self, stats, tag=None, step=None): """Log intermediate stats according to log_interval.""" self.tqdm.set_postfix(self._format_stats(stats), refresh=False) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" postfix = self._str_pipes(self._format_stats(stats)) with rename_logger(logger, tag): logger.info("{} | {}".format(self.prefix, postfix)) try: _tensorboard_writers = {} from torch.utils.tensorboard import SummaryWriter except ImportError: try: from tensorboardX import SummaryWriter except ImportError: SummaryWriter = None def _close_writers(): for w in _tensorboard_writers.values(): w.close() atexit.register(_close_writers) class TensorboardProgressBarWrapper(BaseProgressBar): """Log to tensorboard.""" def __init__(self, wrapped_bar, tensorboard_logdir): self.wrapped_bar = wrapped_bar self.tensorboard_logdir = tensorboard_logdir if SummaryWriter is None: logger.warning( "tensorboard not found, please install with: pip install tensorboard" ) def _writer(self, key): if SummaryWriter is None: return None _writers = _tensorboard_writers if key not in _writers: _writers[key] = SummaryWriter(os.path.join(self.tensorboard_logdir, key)) _writers[key].add_text("sys.argv", " ".join(sys.argv)) return _writers[key] def __iter__(self): return iter(self.wrapped_bar) def log(self, stats, tag=None, step=None): """Log intermediate stats to tensorboard.""" self._log_to_tensorboard(stats, tag, step) self.wrapped_bar.log(stats, tag=tag, step=step) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" self._log_to_tensorboard(stats, tag, step) self.wrapped_bar.print(stats, tag=tag, step=step) def update_config(self, config): """Log latest configuration.""" # TODO add hparams to Tensorboard self.wrapped_bar.update_config(config) def _log_to_tensorboard(self, stats, tag=None, step=None): writer = self._writer(tag or "") if writer is None: return if step is None: step = stats["num_updates"] for key in stats.keys() - {"num_updates"}: if isinstance(stats[key], AverageMeter): writer.add_scalar(key, stats[key].val, step) elif isinstance(stats[key], Number): writer.add_scalar(key, stats[key], step) elif torch.is_tensor(stats[key]) and stats[key].numel() == 1: writer.add_scalar(key, stats[key].item(), step) writer.flush() try: import wandb except ImportError: wandb = None class WandBProgressBarWrapper(BaseProgressBar): """Log to Weights & Biases.""" def __init__(self, wrapped_bar, wandb_project, run_name=None): self.wrapped_bar = wrapped_bar if wandb is None: logger.warning("wandb not found, pip install wandb") return # reinit=False to ensure if wandb.init() is called multiple times # within one process it still references the same run wandb.init(project=wandb_project, reinit=False, name=run_name) def __iter__(self): return iter(self.wrapped_bar) def log(self, stats, tag=None, step=None): """Log intermediate stats to tensorboard.""" self._log_to_wandb(stats, tag, step) self.wrapped_bar.log(stats, tag=tag, step=step) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats.""" self._log_to_wandb(stats, tag, step) self.wrapped_bar.print(stats, tag=tag, step=step) def update_config(self, config): """Log latest configuration.""" if wandb is not None: wandb.config.update(config) self.wrapped_bar.update_config(config) def _log_to_wandb(self, stats, tag=None, step=None): if wandb is None: return if step is None: step = stats["num_updates"] prefix = "" if tag is None else tag + "/" for key in stats.keys() - {"num_updates"}: if isinstance(stats[key], AverageMeter): wandb.log({prefix + key: stats[key].val}, step=step) elif isinstance(stats[key], Number): wandb.log({prefix + key: stats[key]}, step=step) try: from azureml.core import Run except ImportError: Run = None class AzureMLProgressBarWrapper(BaseProgressBar): """Log to Azure ML""" def __init__(self, wrapped_bar): self.wrapped_bar = wrapped_bar if Run is None: logger.warning("azureml.core not found, pip install azureml-core") return self.run = Run.get_context() def __exit__(self, *exc): if Run is not None: self.run.complete() return False def __iter__(self): return iter(self.wrapped_bar) def log(self, stats, tag=None, step=None): """Log intermediate stats to AzureML""" self._log_to_azureml(stats, tag, step) self.wrapped_bar.log(stats, tag=tag, step=step) def print(self, stats, tag=None, step=None): """Print end-of-epoch stats""" self._log_to_azureml(stats, tag, step) self.wrapped_bar.print(stats, tag=tag, step=step) def update_config(self, config): """Log latest configuration.""" self.wrapped_bar.update_config(config) def _log_to_azureml(self, stats, tag=None, step=None): if Run is None: return if step is None: step = stats["num_updates"] prefix = "" if tag is None else tag + "/" for key in stats.keys() - {"num_updates"}: name = prefix + key if isinstance(stats[key], AverageMeter): self.run.log_row(name=name, **{"step": step, key: stats[key].val}) elif isinstance(stats[key], Number): self.run.log_row(name=name, **{"step": step, key: stats[key]})
var express = require('express'); var router = express.Router(); var path = require('path'); /* GET home page. */ var isLogin = false; router.get('/', function(req, res,next) { // res.sendFile("E:\\WorkSpace\\JavaScriptProgram\\STAVisor\\app\\indexHome.html"); if(isLogin){ res.sendFile(path.resolve('app/indexHome.html')); }else{ res.sendFile(path.resolve('app/login.html')); } }); router.post('/login',function(req,res,next){ var data = req.body; if(data.userName=="[email protected]" && data.password=="123456"){ isLogin = true; res.send({success:true,info:"success ! "}); } else{ res.send({success:false,info:"userName or password is not right ! "}); } }); router.post('/signout',function(req,res,next){ isLogin = false; res.redirect('/'); }); module.exports = router;
exports.menu1 = (id, A187, tampilTanggal, whatsapp, youtube, tampilWaktu, instagram, nomer, aktif) => { return ` ❉──────────❉ FUBUKII 🤨 ❉──────────❉ FUBUKII DOMINA 🤠🤙 𝐎𝐋𝐇𝐄 𝐎𝐒 𝐂𝐎𝐌𝐀𝐍𝐃𝐎𝐒 𝐀𝐁𝐀𝐈𝐗𝐎 ╔════════════════════ ║ ╠════════════════════ ║╭──❉ *MEDIAS* ❉── ║│➸ _*!sticker*_ ║│➸ _*!foto menina*_ ║│➸ _*!foto cara*_ ║│➸ _*!pokemon*_ ║│➸ _*!loli*_ ║│➸ _*!fotoanime*_ ║│➸ _*!waifu*_ ║│➸ _*!ttp*_ <texto> ║│➸ _*!meme*_ ║│➸ _*!ssweb*_ <link> ║╰─────────── ╠════════════════════ ║╭──❉ *EDUCAÇÃO* ❉── ║│➸ _*!nulis*_ <texto> ║│➸ _*!pantun*_ ║│➸ _*!artinama*_ <Seu nome> ║│➸ _*!pasangan*_ <Aris e Cahya> ║│➸ _*!lirik*_ <nome da música> ║│➸ _*!chord*_ <nome da música> ║│➸ _*!bucin*_ ║│➸ _*!zodiak*_ <28-02-2002> ║│➸ _*#*_ <texto> ║│➸ _*!cooltext*_ <texto> ║╰─────────── ╠════════════════════ ║╭──❉ *INFORMAÇÕES* ❉── ║│➸ _*!sholat*_ <área> ║│➸ _*!covidID*_ ║│➸ _*!covidcountry*_ <país> ║│➸ _*!infogempa*_ ║│➸ _*!cektanggal*_ <Encontro> ║│➸ _*!infoanime*_ <Naruto> ║│➸ _*!filmanime*_ <Naruto> ║│➸ _*!wiki*_ <Crocodilo> ║│➸ _*!wikien*_ <cachorro> ║│➸ _*!resep*_ <Arroz cozido> ║│➸ _*!jadwalTVnow*_ <canal> ║╰─────────── ╠════════════════════ ║ FUBUKII DOMINA 🤠🤙 ╚════════════════════` }
"use strict" define("controller/app",["exports","controller/resolver","ember-load-initializers","controller/config/environment"],(function(e,t,n,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var u=function(e){function n(){var e,o;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n) for(var a=arguments.length,u=new Array(a),s=0;s<a;s++)u[s]=arguments[s] return(o=i(this,(e=l(n)).call.apply(e,[this].concat(u)))).modulePrefix=r.default.modulePrefix,o.podModulePrefix=r.default.podModulePrefix,o.Resolver=t.default,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,Ember.Application),n}() e.default=u,(0,n.default)(u,r.default.modulePrefix)})),define("controller/component-managers/glimmer",["exports","@glimmer/component/-private/ember-component-manager"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("controller/components/click-and-drag",["exports","@glimmer/component","lodash.throttle","controller/enums/input","controller/utils/math"],(function(e,t,n,r,o){var i,l function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var f,d,b,y,m,h,v=Ember.HTMLBars.template({id:"B4XRxnqx",block:'{"symbols":["@show","@color"],"statements":[[7,"div",false],[12,"class",[29,["click-and-drag ",[28,"unless",[[23,1,[]],"out-of-view"],null]]]],[3,"did-insert",[[23,0,["setup"]]]],[8],[0,"\\n "],[7,"svg",true],[10,"width","100%"],[10,"height","100%"],[10,"id","swipe-area"],[10,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[8],[0,"\\n "],[7,"line",true],[10,"stroke-dasharray","5, 5"],[10,"id","svg-line"],[10,"x1","0"],[10,"y1","0"],[10,"x2","0"],[10,"y2","0"],[10,"stroke","#FFFFFF"],[10,"stroke-width","2"],[8],[9],[0,"\\n "],[7,"circle",true],[10,"id","svg-finger"],[10,"cx","0"],[10,"cy","0"],[10,"r","0"],[10,"stroke","#FFFFFF"],[10,"stroke-width","2"],[11,"fill",[23,2,[]]],[8],[9],[0,"\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/click-and-drag.hbs"}}),g=200,w=(l=function(e){function t(){var e,r;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t) for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l] return(r=s(this,(e=c(t)).call.apply(e,[this].concat(i)))).swipeAnalog=void 0,r.circle=void 0,r.line=void 0,r.aiming=!1,r.maxX=0,r.maxY=0,r.fingerRadius=15,r.minSwipeDistance=20,r.throttledSendInput=(0,n.default)((function(e,t){r.sendInput(e,t)}),g,{trailing:!1}),r}var i,l,a return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),i=t,(l=[{key:"setup",value:function(e){var t=this this.line=e.querySelector("svg line"),this.circle=e.querySelector("svg circle") var n=window.getComputedStyle(e.querySelector("svg")) this.maxX=parseInt(n.width.replace("px","")),this.maxY=parseInt(n.height.replace("px","")),this.swipeAnalog=new SwipeAnalog(e,{touchstart:function(){return t.swipeAreaTouchStart()},touchmove:function(e){return t.swipeAreaTouchMove(e)},touchend:function(e){return t.swipeAreaTouchEnd(e)},min_swipe_distance:this.minSwipeDistance})}},{key:"sendInput",value:function(e,t){var n,r t&&t.distance>=this.minSwipeDistance&&this.args.onInput({t:e,d:null!==(n=t.distance)&&void 0!==n?n:0,a:null!==(r=t.angle)&&void 0!==r?r:0})}},{key:"swipeAreaTouchStart",value:function(){var e,t,n,r,i,l,a !this.aiming&&this.args.show&&(this.aiming=!0,null===(e=this.circle)||void 0===e||e.setAttribute("cx",(0,o.clamp)(this.swipeAnalog.start_position.x,0,this.maxX).toString()),null===(t=this.circle)||void 0===t||t.setAttribute("cy",(0,o.clamp)(this.swipeAnalog.start_position.y,0,this.maxY).toString()),null===(n=this.circle)||void 0===n||n.setAttribute("r",this.fingerRadius.toString()),null===(r=this.line)||void 0===r||r.setAttribute("x1",(0,o.clamp)(this.swipeAnalog.start_position.x,0,this.maxX).toString()),null===(i=this.line)||void 0===i||i.setAttribute("y1",(0,o.clamp)(this.swipeAnalog.start_position.y,0,this.maxY).toString()),null===(l=this.line)||void 0===l||l.setAttribute("x2",(0,o.clamp)(this.swipeAnalog.start_position.x,0,this.maxX).toString()),null===(a=this.line)||void 0===a||a.setAttribute("y2",(0,o.clamp)(this.swipeAnalog.start_position.y,0,this.maxY).toString()))}},{key:"swipeAreaTouchMove",value:function(e){var t,n this.aiming&&this.args.show&&(null===(t=this.line)||void 0===t||t.setAttribute("x1",(0,o.clamp)(this.swipeAnalog.end_position.x,0,this.maxX).toString()),null===(n=this.line)||void 0===n||n.setAttribute("y1",(0,o.clamp)(this.swipeAnalog.end_position.y,0,this.maxY).toString()),this.throttledSendInput(r.ClickAndDragInputType.Move,e))}},{key:"swipeAreaTouchEnd",value:function(e){var t,n,i,l,a this.aiming&&this.args.show&&(null===(t=this.circle)||void 0===t||t.setAttribute("cx","0"),null===(n=this.circle)||void 0===n||n.setAttribute("cy","0"),null===(i=this.circle)||void 0===i||i.setAttribute("r","0"),null===(l=this.line)||void 0===l||l.setAttribute("x2",(0,o.clamp)(this.swipeAnalog.end_position.x,0,this.maxX).toString()),null===(a=this.line)||void 0===a||a.setAttribute("y2",(0,o.clamp)(this.swipeAnalog.end_position.y,0,this.maxY).toString()),this.sendInput(r.ClickAndDragInputType.End,e),this.aiming=!1)}}])&&u(i.prototype,l),a&&u(i,a),t}(t.default),f=(i=l).prototype,d="setup",b=[Ember._action],y=Object.getOwnPropertyDescriptor(i.prototype,"setup"),m=i.prototype,h={},Object.keys(y).forEach((function(e){h[e]=y[e]})),h.enumerable=!!h.enumerable,h.configurable=!!h.configurable,("value"in h||h.initializer)&&(h.writable=!0),h=b.slice().reverse().reduce((function(e,t){return t(f,d,e)||e}),h),m&&void 0!==h.initializer&&(h.value=h.initializer?h.initializer.call(m):void 0,h.initializer=void 0),void 0===h.initializer&&(Object.defineProperty(f,d,h),h=null),i) e.default=w,Ember._setComponentTemplate(v,w)})),define("controller/components/d-pad",["exports","@glimmer/component"],(function(e,t){var n,r,o,i,l,a,u function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var m=Ember.HTMLBars.template({id:"eXbuycGC",block:'{"symbols":["@show"],"statements":[[7,"div",true],[11,"class",[29,["direction-pad ",[28,"unless",[[23,1,[]],"out-of-view"],null]]]],[8],[0,"\\n "],[7,"svg",true],[10,"version","1.1"],[10,"viewBox","0 0 90 90"],[10,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[8],[0,"\\n "],[7,"g",false],[12,"id","up"],[12,"class",[28,"if",[[23,0,["button0Pressed"]],"pressed"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["buttonPress"]],0,true],null]]],[3,"on",["touchend",[28,"fn",[[23,0,["buttonPress"]],0,false],null]]],[8],[0,"\\n "],[7,"rect",true],[10,"x","30"],[10,"width","30"],[10,"height","30"],[10,"style",""],[8],[9],[0,"\\n "],[7,"path",true],[10,"d","m54.682 23.385h-19.365l9.6825-16.771z"],[10,"style",""],[8],[9],[0,"\\n "],[9],[0,"\\n "],[7,"g",false],[12,"id","down"],[12,"class",[28,"if",[[23,0,["button2Pressed"]],"pressed"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["buttonPress"]],2,true],null]]],[3,"on",["touchend",[28,"fn",[[23,0,["buttonPress"]],2,false],null]]],[8],[0,"\\n "],[7,"rect",true],[10,"transform","scale(-1)"],[10,"x","-60"],[10,"y","-90"],[10,"width","30"],[10,"height","30"],[8],[9],[0,"\\n "],[7,"path",true],[10,"transform","scale(-1)"],[10,"d","m-35.318-66.615h-19.365l9.6825-16.771z"],[8],[9],[0,"\\n "],[9],[0,"\\n "],[7,"g",false],[12,"id","left"],[12,"class",[28,"if",[[23,0,["button3Pressed"]],"pressed"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["buttonPress"]],3,true],null]]],[3,"on",["touchend",[28,"fn",[[23,0,["buttonPress"]],3,false],null]]],[8],[0,"\\n "],[7,"rect",true],[10,"transform","rotate(-90)"],[10,"x","-60"],[10,"y","-1.4921e-6"],[10,"width","30"],[10,"height","30"],[8],[9],[0,"\\n "],[7,"path",true],[10,"transform","rotate(-90 12.5 7.5)"],[10,"d","m-15.318 18.385h-19.365l9.6825-16.771z"],[8],[9],[0,"\\n "],[9],[0,"\\n "],[7,"g",false],[12,"id","right"],[12,"class",[28,"if",[[23,0,["button1Pressed"]],"pressed"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["buttonPress"]],1,true],null]]],[3,"on",["touchend",[28,"fn",[[23,0,["buttonPress"]],1,false],null]]],[8],[0,"\\n "],[7,"rect",true],[10,"transform","rotate(90)"],[10,"x","30"],[10,"y","-90"],[10,"width","30"],[10,"height","30"],[8],[9],[0,"\\n "],[7,"path",true],[10,"transform","rotate(90 71.693 1.6926)"],[10,"d","m124.68 6.7705-19.365-1e-7 9.6825-16.771z"],[8],[9],[0,"\\n "],[9],[0,"\\n "],[7,"g",false],[12,"id","center"],[12,"class",[28,"if",[[23,0,["button4Pressed"]],"pressed"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["buttonPress"]],4,true],null]]],[3,"on",["touchend",[28,"fn",[[23,0,["buttonPress"]],4,false],null]]],[8],[0,"\\n "],[7,"rect",true],[10,"x","30"],[10,"y","30"],[10,"width","30"],[10,"height","30"],[8],[9],[0,"\\n "],[7,"circle",true],[10,"cx","45"],[10,"cy","45"],[10,"r","10"],[8],[9],[0,"\\n "],[9],[0,"\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/d-pad.hbs"}}),h=(u=function(e){function t(){var e,n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t) for(var u=arguments.length,p=new Array(u),b=0;b<u;b++)p[b]=arguments[b] return c(n=function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?d(e):t}(this,(e=f(t)).call.apply(e,[this].concat(p))),"button0Pressed",r,d(n)),c(n,"button1Pressed",o,d(n)),c(n,"button2Pressed",i,d(n)),c(n,"button3Pressed",l,d(n)),c(n,"button4Pressed",a,d(n)),n}var n,u,y return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,e),n=t,(u=[{key:"buttonPress",value:function(e,t){switch(e){case 0:this.button0Pressed=t break case 1:this.button1Pressed=t break case 2:this.button2Pressed=t break case 3:this.button3Pressed=t break case 4:this.button4Pressed=t}this.args.onPress(e,t)}}])&&p(n.prototype,u),y&&p(n,y),t}(t.default),r=y((n=u).prototype,"button0Pressed",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),o=y(n.prototype,"button1Pressed",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),i=y(n.prototype,"button2Pressed",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),l=y(n.prototype,"button3Pressed",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),a=y(n.prototype,"button4Pressed",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),y(n.prototype,"buttonPress",[Ember._action],Object.getOwnPropertyDescriptor(n.prototype,"buttonPress"),n.prototype),n) e.default=h,Ember._setComponentTemplate(m,h)})),define("controller/components/help-button",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=Ember.HTMLBars.template({id:"3ELncJsJ",block:'{"symbols":["@show","@onPress","@bgColor","@color"],"statements":[[7,"div",false],[12,"id","help-button"],[12,"class",[28,"unless",[[23,1,[]],"out-of-view"],null]],[3,"on",["touchstart",[23,2,[]]]],[8],[0,"\\n "],[7,"svg",true],[10,"id","help-icon"],[10,"viewBox","0 0 100 100"],[10,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[11,"fill",[23,3,[]]],[8],[0,"\\n "],[7,"circle",true],[10,"r","40"],[10,"cx","53"],[10,"cy","53"],[10,"fill","#000000"],[10,"opacity","0.4"],[8],[9],[0,"\\n "],[7,"circle",true],[10,"r","40"],[10,"cx","50"],[10,"cy","50"],[8],[9],[0,"\\n "],[7,"text",true],[10,"x","50"],[10,"y","62.5"],[10,"font-size","35"],[10,"text-anchor","middle"],[11,"fill",[23,4,[]]],[8],[0,"?"],[9],[0,"\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/help-button.hbs"}}),n=Ember._setComponentTemplate(t,Ember._templateOnlyComponent()) e.default=n})),define("controller/components/help-modal",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=Ember.HTMLBars.template({id:"InT2w+T3",block:'{"symbols":["@show","@bgColor","@color","@onClose"],"statements":[[7,"div",true],[11,"class",[29,["modal ",[28,"unless",[[23,1,[]],"out-of-view"],null]]]],[10,"id","help-modal"],[11,"style",[23,2,[]]],[8],[0,"\\n "],[7,"div",true],[10,"class","modal-content"],[11,"style",[23,3,[]]],[8],[0,"\\n "],[7,"div",false],[12,"class","modal-close"],[3,"on",["touchstart",[23,4,[]]]],[8],[0,"×"],[9],[0,"\\n "],[7,"h3",true],[10,"class","modal-title"],[8],[0,"Help"],[9],[0,"\\n "],[7,"p",true],[10,"class","modal-description"],[8],[0,"Game description here"],[9],[0,"\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/help-modal.hbs"}}),n=Ember._setComponentTemplate(t,Ember._templateOnlyComponent()) e.default=n})),define("controller/components/keyboard",["exports","@glimmer/component"],(function(e,t){var n,r,o function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var p=Ember.HTMLBars.template({id:"nzgKKurB",block:'{"symbols":["@show"],"statements":[[7,"div",true],[10,"class","airconsole_keyboard_component"],[8],[0,"\\n "],[7,"div",false],[12,"id","airconsole_keyboard_display"],[12,"class",[28,"unless",[[23,1,[]],"out-of-view"],null]],[3,"did-insert",[[23,0,["setup"]]]],[8],[9],[0,"\\n "],[7,"div",true],[10,"id","airconsole_keyboard"],[8],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/keyboard.hbs"}}),f=(o=function(e){function t(){var e,n,o,l,s,c;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t) for(var p=arguments.length,f=new Array(p),d=0;d<p;d++)f[d]=arguments[d] return n=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(e):t}(this,(e=a(t)).call.apply(e,[this].concat(f))),o=n,l="state",s=r,c=u(n),s&&Object.defineProperty(o,l,{enumerable:s.enumerable,configurable:s.configurable,writable:s.writable,value:s.initializer?s.initializer.call(c):void 0}),n.keyboard=void 0,n}var n,o,c return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(o=[{key:"setup",value:function(e){var t=new AirConsoleKeyboard("airconsole_keyboard") this.args.setup(t,"airconsole_keyboard_display",e)}}])&&l(n.prototype,o),c&&l(n,c),t}(t.default),r=c((n=o).prototype,"state",[Ember.inject.service],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c(n.prototype,"setup",[Ember._action],Object.getOwnPropertyDescriptor(n.prototype,"setup"),n.prototype),n) e.default=f,Ember._setComponentTemplate(p,f)})),define("controller/components/list-select",["exports","@glimmer/component"],(function(e,t){var n,r,o function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var p=Ember.HTMLBars.template({id:"rauWnbZJ",block:'{"symbols":["item","index","@show","@data"],"statements":[[7,"div",true],[11,"class",[29,["list-select ",[28,"unless",[[23,3,[]],"out-of-view"],null]]]],[8],[0,"\\n "],[7,"h3",true],[8],[0,"Select one:"],[9],[0,"\\n "],[7,"ul",true],[8],[0,"\\n"],[4,"each",[[23,4,[]]],null,{"statements":[[0," "],[7,"li",false],[12,"class",[28,"if",[[28,"eq",[[23,2,[]],[23,0,["selectedIndex"]]],null],"selected"],null]],[3,"on",["touchstart",[28,"fn",[[23,0,["select"]],[23,2,[]]],null]]],[8],[0,"\\n "],[1,[23,1,[]],false],[0,"\\n "],[9],[0,"\\n"]],"parameters":[1,2]},null],[0," "],[9],[0,"\\n "],[7,"button",false],[12,"disabled",[23,0,["disabled"]]],[3,"on",["touchstart",[23,0,["submit"]]]],[8],[0,"\\n Submit\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/list-select.hbs"}}),f=(o=function(e){function t(){var e,n,o,l,s,c;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t) for(var p=arguments.length,f=new Array(p),d=0;d<p;d++)f[d]=arguments[d] return n=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(e):t}(this,(e=a(t)).call.apply(e,[this].concat(f))),o=n,l="selectedIndex",s=r,c=u(n),s&&Object.defineProperty(o,l,{enumerable:s.enumerable,configurable:s.configurable,writable:s.writable,value:s.initializer?s.initializer.call(c):void 0}),n}var n,o,c return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(o=[{key:"select",value:function(e){this.selectedIndex=e,this.args.onSelect(this.selectedIndex,!1)}},{key:"submit",value:function(){this.disabled||this.args.onSelect(this.selectedIndex,!0)}},{key:"disabled",get:function(){return null===this.selectedIndex||void 0===this.selectedIndex}}])&&l(n.prototype,o),c&&l(n,c),t}(t.default),r=c((n=o).prototype,"selectedIndex",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c(n.prototype,"select",[Ember._action],Object.getOwnPropertyDescriptor(n.prototype,"select"),n.prototype),c(n.prototype,"submit",[Ember._action],Object.getOwnPropertyDescriptor(n.prototype,"submit"),n.prototype),n) e.default=f,Ember._setComponentTemplate(p,f)})),define("controller/components/press-anywhere-button",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=Ember.HTMLBars.template({id:"4mKSEumL",block:'{"symbols":["@show","@onPress"],"statements":[[7,"div",false],[12,"id","press-anywhere-button"],[12,"class",[28,"unless",[[23,1,[]],"out-of-view"],null]],[3,"on",["touchstart",[23,2,[]]]],[8],[9]],"hasEval":false}',meta:{moduleName:"controller/components/press-anywhere-button.hbs"}}),n=Ember._setComponentTemplate(t,Ember._templateOnlyComponent()) e.default=n})),define("controller/components/sound-button",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=Ember.HTMLBars.template({id:"FlUgXGvZ",block:'{"symbols":["@show","@onPress","@color"],"statements":[[7,"div",false],[12,"id","sound-button"],[12,"class",[28,"unless",[[23,1,[]],"out-of-view"],null]],[3,"on",["touchstart",[23,2,[]]]],[8],[0,"\\n "],[7,"svg",true],[10,"id","my-sound-color"],[10,"viewBox","0 0 100 100"],[10,"xmlns","http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/"],[11,"fill",[23,3,[]]],[8],[0,"\\n "],[7,"circle",true],[10,"r","40"],[10,"cx","53"],[10,"cy","53"],[10,"fill","#000000"],[10,"opacity","0.4"],[8],[9],[0,"\\n "],[7,"circle",true],[10,"r","40"],[10,"cx","50"],[10,"cy","50"],[8],[9],[0,"\\n "],[9],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/components/sound-button.hbs"}}),n=Ember._setComponentTemplate(t,Ember._templateOnlyComponent()) e.default=n})),define("controller/config/environment.d",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=config e.default=t})),define("controller/controllers/application",["exports","controller/utils/controller-to-screen-messages","controller/enums/input"],(function(e,t,n){var r,o,i function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var d=(o=f((r=function(e){function r(){var e return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),a(e=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?c(e):t}(this,s(r).apply(this,arguments)),"airconsole",o,c(e)),a(e,"state",i,c(e)),e.airconsole,e}var f,d,b return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(r,Ember.Controller),f=r,(d=[{key:"pressAnywhere",value:function(){this.airconsole.sendMessageToScreen(t.pressAnywhere)}},{key:"pressSoundButton",value:function(){this.airconsole.sendMessageToScreen(t.makeSound)}},{key:"openCloseHelp",value:function(e){this.airconsole.sendMessageToScreen((0,t.openCloseHelp)(e))}},{key:"dpadPress",value:function(e,r){this.airconsole.sendMessageToScreen((0,t.input)(n.InputType.Dpad,{d:r,dr:e}))}},{key:"listItemSelected",value:function(e,r){this.airconsole.sendMessageToScreen((0,t.input)(n.InputType.ListSelect,{i:e,f:r}))}},{key:"clickAndDragInput",value:function(e){this.airconsole.sendMessageToScreen((0,t.input)(n.InputType.ClickAndDrag,e))}}])&&u(f.prototype,d),b&&u(f,b),r}()).prototype,"airconsole",[Ember.inject.service],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),i=f(r.prototype,"state",[Ember.inject.service],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),f(r.prototype,"pressAnywhere",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"pressAnywhere"),r.prototype),f(r.prototype,"pressSoundButton",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"pressSoundButton"),r.prototype),f(r.prototype,"openCloseHelp",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"openCloseHelp"),r.prototype),f(r.prototype,"dpadPress",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"dpadPress"),r.prototype),f(r.prototype,"listItemSelected",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"listItemSelected"),r.prototype),f(r.prototype,"clickAndDragInput",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"clickAndDragInput"),r.prototype),r) e.default=d})),define("controller/enums/actions",["exports"],(function(e){var t,n Object.defineProperty(e,"__esModule",{value:!0}),e.ScreenToControllerActions=e.ControllerToScreenActions=void 0,e.ControllerToScreenActions=t,function(e){e[e.PressAnywhere=0]="PressAnywhere",e[e.MakeSound=1]="MakeSound",e[e.OpenCloseHelp=2]="OpenCloseHelp",e[e.Input=3]="Input"}(t||(e.ControllerToScreenActions=t={})),e.ScreenToControllerActions=n,function(e){e[e.UpdateState=0]="UpdateState",e[e.UpdateColor=1]="UpdateColor",e[e.UpdateMessage=2]="UpdateMessage",e[e.UpdateButtons=3]="UpdateButtons",e[e.UpdateInput=4]="UpdateInput"}(n||(e.ScreenToControllerActions=n={}))})),define("controller/enums/game-state",["exports"],(function(e){var t Object.defineProperty(e,"__esModule",{value:!0}),e.GameState=void 0,e.GameState=t,function(e){e[e.STATE_LOADING=0]="STATE_LOADING",e[e.STATE_SPECTATING=1]="STATE_SPECTATING",e[e.STATE_HELP=2]="STATE_HELP",e[e.STATE_READY=3]="STATE_READY",e[e.STATE_PRESS_ANYWHERE=4]="STATE_PRESS_ANYWHERE"}(t||(e.GameState=t={}))})),define("controller/enums/input",["exports"],(function(e){var t,n Object.defineProperty(e,"__esModule",{value:!0}),e.ClickAndDragInputType=e.InputType=void 0,e.InputType=t,function(e){e[e.Clear=-1]="Clear",e[e.Keyboard=0]="Keyboard",e[e.Dpad=1]="Dpad",e[e.ClickAndDrag=2]="ClickAndDrag",e[e.ListSelect=3]="ListSelect",e[e.Button=4]="Button",e[e.MultiButton=5]="MultiButton",e[e.TextDisplay=6]="TextDisplay",e[e.BottomButtonBar=7]="BottomButtonBar",e[e.TextDisplayWithButtonButtonBar=8]="TextDisplayWithButtonButtonBar"}(t||(e.InputType=t={})),e.ClickAndDragInputType=n,function(e){e[e.Move=0]="Move",e[e.End=1]="End"}(n||(e.ClickAndDragInputType=n={}))})),define("controller/helpers/and",["exports","ember-truth-helpers/helpers/and"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"and",{enumerable:!0,get:function(){return t.and}})})),define("controller/helpers/app-version",["exports","controller/config/environment","ember-cli-app-version/utils/regexp"],(function(e,t,n){function r(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.default.APP.version,i=r.versionOnly||r.hideSha,l=r.shaOnly||r.hideVersion,a=null return i&&(r.showExtended&&(a=o.match(n.versionExtendedRegExp)),a||(a=o.match(n.versionRegExp))),l&&(a=o.match(n.shaRegExp)),a?a[0]:o}Object.defineProperty(e,"__esModule",{value:!0}),e.appVersion=r,e.default=void 0 var o=Ember.Helper.helper(r) e.default=o})),define("controller/helpers/eq",["exports","ember-truth-helpers/helpers/equal"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"equal",{enumerable:!0,get:function(){return t.equal}})})),define("controller/helpers/gt",["exports","ember-truth-helpers/helpers/gt"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gt",{enumerable:!0,get:function(){return t.gt}})})),define("controller/helpers/gte",["exports","ember-truth-helpers/helpers/gte"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gte",{enumerable:!0,get:function(){return t.gte}})})),define("controller/helpers/is-array",["exports","ember-truth-helpers/helpers/is-array"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return t.isArray}})})),define("controller/helpers/is-empty",["exports","ember-truth-helpers/helpers/is-empty"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("controller/helpers/is-equal",["exports","ember-truth-helpers/helpers/is-equal"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isEqual",{enumerable:!0,get:function(){return t.isEqual}})})),define("controller/helpers/lt",["exports","ember-truth-helpers/helpers/lt"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lt",{enumerable:!0,get:function(){return t.lt}})})),define("controller/helpers/lte",["exports","ember-truth-helpers/helpers/lte"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lte",{enumerable:!0,get:function(){return t.lte}})})),define("controller/helpers/not-eq",["exports","ember-truth-helpers/helpers/not-equal"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"notEq",{enumerable:!0,get:function(){return t.notEq}})})),define("controller/helpers/not",["exports","ember-truth-helpers/helpers/not"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return t.not}})})),define("controller/helpers/or",["exports","ember-truth-helpers/helpers/or"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return t.or}})})),define("controller/helpers/xor",["exports","ember-truth-helpers/helpers/xor"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"xor",{enumerable:!0,get:function(){return t.xor}})})),define("controller/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","controller/config/environment"],(function(e,t,n){var r,o Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n.default.APP&&(r=n.default.APP.name,o=n.default.APP.version) var i={name:"App Version",initialize:(0,t.default)(r,o)} e.default=i})) define("controller/initializers/container-debug-adapter",["exports","ember-resolver/resolvers/classic/container-debug-adapter"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0] e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}} e.default=n})),define("controller/initializers/export-application-global",["exports","controller/config/environment"],(function(e,t){function n(){var e=arguments[1]||arguments[0] if(!1!==t.default.exportApplicationGlobal){var n if("undefined"!=typeof window)n=window else if("undefined"!=typeof global)n=global else{if("undefined"==typeof self)return n=self}var r,o=t.default.exportApplicationGlobal r="string"==typeof o?o:Ember.String.classify(t.default.modulePrefix),n[r]||(n[r]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete n[r]}}))}}Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=n,e.default=void 0 var r={name:"export-application-global",initialize:n} e.default=r})),define("controller/modifiers/did-insert",["exports","@ember/render-modifiers/modifiers/did-insert"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("controller/modifiers/did-update",["exports","@ember/render-modifiers/modifiers/did-update"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("controller/modifiers/will-destroy",["exports","@ember/render-modifiers/modifiers/will-destroy"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})})),define("controller/resolver",["exports","ember-resolver"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var n=t.default e.default=n})),define("controller/router",["exports","controller/config/environment"],(function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var l=function(e){function n(){var e,i;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n) for(var l=arguments.length,a=new Array(l),u=0;u<l;u++)a[u]=arguments[u] return(i=r(this,(e=o(n)).call.apply(e,[this].concat(a)))).location=t.default.locationType,i.rootURL=t.default.rootURL,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,Ember.Router),n}() e.default=l,l.map((function(){}))})),define("controller/services/airconsole",["exports","controller/enums/input","controller/utils/controller-to-screen-messages"],(function(e,t,n){var r,o function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var p=(o=c((r=function(e){function r(){var e,t,n,l,s return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),e=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?u(e):t}(this,a(r).apply(this,arguments)),t=e,n="state",l=o,s=u(e),l&&Object.defineProperty(t,n,{enumerable:l.enumerable,configurable:l.configurable,writable:l.writable,value:l.initializer?l.initializer.call(s):void 0}),e.airconsole=void 0,e.keyboard=void 0,e.keyboardDisplay=void 0,e.airconsole=new AirConsole,e.airconsole.onMessage=e.airconsole_onMessage.bind(u(e)),e.airconsole.onCustomDeviceStateChange=e.airconsole_onCustomDeviceStateChange.bind(u(e)),e}var c,p,f return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(r,Ember.Service),c=r,(p=[{key:"airconsole_onMessage",value:function(e,t){e===AirConsole.SCREEN&&(0===t.a&&this.airconsole.setCustomDeviceStateProperty("state",t.s),this.state.handleMessage(t))}},{key:"airconsole_onCustomDeviceStateChange",value:function(e,t){e===AirConsole.SCREEN&&this.state.handleCustomDeviceStateChange(t)}},{key:"sendMessageToScreen",value:function(e){this.airconsole.message(AirConsole.SCREEN,e)}},{key:"setupAirconsoleKeyboard",value:function(e,r,o){var i=this this.keyboard=e,this.keyboardDisplay=o,e.bind(r,{onHide:function(e,r){i.sendMessageToScreen((0,n.input)(t.InputType.Keyboard,{s:r,f:!0}))},onChange:function(e,r){i.sendMessageToScreen((0,n.input)(t.InputType.Keyboard,{s:r,f:!1}))}})}},{key:"showKeyboard",value:function(){null==this||this.keyboardDisplay.click()}},{key:"hideKeyboard",value:function(){null==this||this.keyboard.hide()}}])&&l(c.prototype,p),f&&l(c,f),r}()).prototype,"state",[Ember.inject.service],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c(r.prototype,"setupAirconsoleKeyboard",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"setupAirconsoleKeyboard"),r.prototype),c(r.prototype,"showKeyboard",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"showKeyboard"),r.prototype),c(r.prototype,"hideKeyboard",[Ember._action],Object.getOwnPropertyDescriptor(r.prototype,"hideKeyboard"),r.prototype),r) e.default=p})),define("controller/services/state",["exports","controller/utils/color","controller/enums/input","controller/enums/actions","controller/enums/game-state"],(function(e,t,n,r,o){var i,l,a,u,s,c,p,f,d,b,y,m,h,v function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n] r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") return e}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t,n,r,o){var i={} return Object.keys(r).forEach((function(e){i[e]=r[e]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(e,t,i),i=null),i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var E=(l=j((i=function(e){function i(){var e,t;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,i) for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o] return w(t=function(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?P(e):t}(this,(e=O(i)).call.apply(e,[this].concat(r))),"title",l,P(t)),w(t,"message",a,P(t)),w(t,"gameState",u,P(t)),w(t,"canJoin",s,P(t)),w(t,"loading",c,P(t)),w(t,"inputOpen",p,P(t)),w(t,"inputType",f,P(t)),w(t,"canShowHelpButton",d,P(t)),w(t,"canShowSoundButton",b,P(t)),w(t,"myColor",y,P(t)),w(t,"backgroundColor",m,P(t)),w(t,"listData",h,P(t)),w(t,"airconsole",v,P(t)),t}var j,E,k return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function") e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(i,Ember.Service),j=i,(E=[{key:"handleMessage",value:function(e){var o,i,l,a,u,s,c,p,f,d,b switch(e.a){case r.ScreenToControllerActions.UpdateState:this.gameState=null!==(o=e.s)&&void 0!==o?o:0 break case r.ScreenToControllerActions.UpdateColor:this.myColor=(0,t.rgbToCSS)(null!==(i=e.r)&&void 0!==i?i:0,null!==(l=e.g)&&void 0!==l?l:0,null!==(a=e.b)&&void 0!==a?a:0),this.backgroundColor=(0,t.rgbToCSS)(null!==(u=e.bgr)&&void 0!==u?u:0,null!==(s=e.bgg)&&void 0!==s?s:0,null!==(c=e.bgb)&&void 0!==c?c:0) break case r.ScreenToControllerActions.UpdateMessage:this.message=null!==(p=e.m)&&void 0!==p?p:"" break case r.ScreenToControllerActions.UpdateButtons:this.canShowHelpButton=null!==(f=e.h)&&void 0!==f&&f,this.canShowSoundButton=null!==(d=e.so)&&void 0!==d&&d break case r.ScreenToControllerActions.UpdateInput:if(e.i===n.InputType.Clear)this.inputOpen=!1,this.inputType=e.i,this.airconsole.hideKeyboard() else if(void 0!==e.i)switch(this.inputOpen=!0,this.inputType=e.i,e.i){case n.InputType.Keyboard:this.airconsole.showKeyboard() break case n.InputType.ListSelect:this.listData=e.d}break default:(b=console).log.apply(b,["unknown action, maybe you should implement it?",e.a].concat(Array.prototype.slice.call(arguments)))}}},{key:"handleCustomDeviceStateChange",value:function(e){e.hasOwnProperty("loaded")&&(this.loading=!e.loaded),e.hasOwnProperty("canJoin")&&(this.canJoin=e.canJoin)}},{key:"showTitle",get:function(){return this.gameState===o.GameState.STATE_LOADING||this.gameState===o.GameState.STATE_SPECTATING}},{key:"showHelpModal",get:function(){return this.gameState===o.GameState.STATE_HELP}},{key:"showHelpButton",get:function(){return!this.showHelpModal&&!this.inputOpen&&this.canShowHelpButton}},{key:"showSoundButton",get:function(){return!this.showHelpModal&&!this.inputOpen&&this.canShowSoundButton}},{key:"showPressAnywhere",get:function(){return this.gameState===o.GameState.STATE_PRESS_ANYWHERE}},{key:"showKeyboard",get:function(){return this.inputOpen&&this.inputType===n.InputType.Keyboard}},{key:"showDPad",get:function(){return this.inputOpen&&this.inputType===n.InputType.Dpad}},{key:"showClickAndDrag",get:function(){return this.inputOpen&&this.inputType===n.InputType.ClickAndDrag}},{key:"showListSelect",get:function(){return this.inputOpen&&this.inputType===n.InputType.ListSelect}},{key:"myColorStyle",get:function(){return Ember.String.htmlSafe("color:".concat(this.myColor))}},{key:"myBackgroundStyle",get:function(){return Ember.String.htmlSafe("background:".concat(this.myColor))}},{key:"bgColorStyle",get:function(){return Ember.String.htmlSafe("color:".concat(this.backgroundColor))}},{key:"bgBackgroundStyle",get:function(){return Ember.String.htmlSafe("background:".concat(this.backgroundColor))}}])&&_(j.prototype,E),k&&_(j,k),i}()).prototype,"title",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"Airconsole Unity Template"}}),a=j(i.prototype,"message",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"Loading..."}}),u=j(i.prototype,"gameState",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return o.GameState.STATE_LOADING}}),s=j(i.prototype,"canJoin",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),c=j(i.prototype,"loading",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),p=j(i.prototype,"inputOpen",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f=j(i.prototype,"inputType",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return n.InputType.Clear}}),d=j(i.prototype,"canShowHelpButton",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),b=j(i.prototype,"canShowSoundButton",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),y=j(i.prototype,"myColor",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"#FFFFFF"}}),m=j(i.prototype,"backgroundColor",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"#000000"}}),h=j(i.prototype,"listData",[Ember._tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),v=j(i.prototype,"airconsole",[Ember.inject.service],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),i) e.default=E})),define("controller/templates/application",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 var t=Ember.HTMLBars.template({id:"QxzJBuhu",block:'{"symbols":[],"statements":[[7,"div",true],[10,"id","airconsole-controller-app"],[8],[0,"\\n "],[7,"h1",true],[11,"class",[29,["title ",[28,"unless",[[23,0,["state","showTitle"]],"out-of-view"],null]]]],[11,"style",[23,0,["state","myColorStyle"]]],[8],[0,"\\n "],[1,[23,0,["state","title"]],false],[0,"\\n "],[9],[0,"\\n\\n "],[7,"p",true],[11,"class",[29,["message ",[28,"unless",[[23,0,["state","message"]],"out-of-view"],null]]]],[11,"style",[23,0,["state","myColorStyle"]]],[8],[0,"\\n "],[1,[23,0,["state","message"]],false],[0,"\\n "],[9],[0,"\\n\\n "],[5,"sound-button",[],[["@show","@color","@onPress"],[[23,0,["state","showSoundButton"]],[23,0,["state","myColor"]],[23,0,["pressSoundButton"]]]]],[0,"\\n\\n "],[5,"help-button",[],[["@show","@color","@bgColor","@onPress"],[[23,0,["state","showHelpButton"]],[23,0,["state","backgroundColor"]],[23,0,["state","myColor"]],[28,"fn",[[23,0,["openCloseHelp"]],true],null]]]],[0,"\\n\\n "],[5,"press-anywhere-button",[],[["@show","@onPress"],[[23,0,["state","showPressAnywhere"]],[23,0,["pressAnywhere"]]]]],[0,"\\n\\n "],[5,"help-modal",[],[["@show","@bgColor","@color","@onClose"],[[23,0,["state","showHelpModal"]],[23,0,["state","myBackgroundStyle"]],[23,0,["state","myColorStyle"]],[28,"fn",[[23,0,["openCloseHelp"]],false],null]]]],[0,"\\n\\n "],[5,"keyboard",[],[["@show","@setup"],[[23,0,["state","showKeyboard"]],[23,0,["airconsole","setupAirconsoleKeyboard"]]]]],[0,"\\n\\n "],[5,"d-pad",[],[["@show","@onPress"],[[23,0,["state","showDPad"]],[23,0,["dpadPress"]]]]],[0,"\\n\\n "],[5,"click-and-drag",[],[["@show","@color","@onInput"],[[23,0,["state","showClickAndDrag"]],[23,0,["state","myColor"]],[23,0,["clickAndDragInput"]]]]],[0,"\\n\\n "],[5,"list-select",[],[["@show","@data","@onSelect"],[[23,0,["state","showListSelect"]],[23,0,["state","listData"]],[23,0,["listItemSelected"]]]]],[0,"\\n"],[9]],"hasEval":false}',meta:{moduleName:"controller/templates/application.hbs"}}) e.default=t})),define("controller/utils/color",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToCSS=function(e,t,n){return"rgba("+e+","+t+","+n+",1)"}})),define("controller/utils/controller-to-screen-messages",["exports","controller/enums/actions"],(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.input=e.openCloseHelp=e.makeSound=e.pressAnywhere=void 0 var n={a:t.ControllerToScreenActions.PressAnywhere} e.pressAnywhere=n var r={a:t.ControllerToScreenActions.MakeSound} e.makeSound=r e.openCloseHelp=function(e){return{a:t.ControllerToScreenActions.OpenCloseHelp,o:e}} e.input=function(e,n){return{a:t.ControllerToScreenActions.Input,i:e,d:n}}})),define("controller/utils/math",["exports"],(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)}})),define("controller/config/environment",[],(function(){try{var e="controller/config/environment",t=document.querySelector('meta[name="'+e+'"]').getAttribute("content"),n={default:JSON.parse(decodeURIComponent(t))} return Object.defineProperty(n,"__esModule",{value:!0}),n}catch(r){throw new Error('Could not read config from meta tag with name "'+e+'".')}})),runningTests||require("controller/app").default.create({name:"controller",version:"0.0.0+a257adc4"})
# coding: utf-8 import pprint import re import six class EdgeImageRegionInfo: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ sensitive_list = [] openapi_types = { 'region_id': 'str', 'image_id': 'str' } attribute_map = { 'region_id': 'region_id', 'image_id': 'image_id' } def __init__(self, region_id=None, image_id=None): """EdgeImageRegionInfo - a model defined in huaweicloud sdk""" self._region_id = None self._image_id = None self.discriminator = None if region_id is not None: self.region_id = region_id if image_id is not None: self.image_id = image_id @property def region_id(self): """Gets the region_id of this EdgeImageRegionInfo. 区域ID :return: The region_id of this EdgeImageRegionInfo. :rtype: str """ return self._region_id @region_id.setter def region_id(self, region_id): """Sets the region_id of this EdgeImageRegionInfo. 区域ID :param region_id: The region_id of this EdgeImageRegionInfo. :type: str """ self._region_id = region_id @property def image_id(self): """Gets the image_id of this EdgeImageRegionInfo. 镜像ID :return: The image_id of this EdgeImageRegionInfo. :rtype: str """ return self._image_id @image_id.setter def image_id(self, image_id): """Sets the image_id of this EdgeImageRegionInfo. 镜像ID :param image_id: The image_id of this EdgeImageRegionInfo. :type: str """ self._image_id = image_id def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: if attr in self.sensitive_list: result[attr] = "****" else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, EdgeImageRegionInfo): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
$(function() { consoleInit(main) }); const OBERON_CHEF_ABI = [{"inputs":[{"internalType":"contract OberonToken","name":"_oberon","type":"address"},{"internalType":"uint256","name":"_oberonPerBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"EmissionRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"commissionAmount","type":"uint256"}],"name":"ReferralCommissionPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLockedUp","type":"uint256"}],"name":"RewardLockedUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_DEPOSIT_FEE_RATE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_HARVEST_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_REFERRAL_COMMISSION_RATE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_OBERON_PER_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IBEP20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"canHarvest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oberon","outputs":[{"internalType":"contract OberonToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oberonPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oberonReferral","outputs":[{"internalType":"contract IOberonReferral","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingOberon","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IBEP20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accOberonPerShare","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"internalType":"uint256","name":"totalLp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralCommissionRate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devAddress","type":"address"}],"name":"setDevAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IOberonReferral","name":"_oberonReferral","type":"address"}],"name":"setOberonReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_referralCommissionRate","type":"uint16"}],"name":"setReferralCommissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startFarming","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLockedUpRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalOberonInPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"transferOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"updateAllocPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_oberonPerBlock","type":"uint256"}],"name":"updateEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"nextHarvestUntil","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}] async function main() { const App = await init_ethers(); _print(`Initialized ${App.YOUR_ADDRESS}\n`); _print("Reading smart contracts...\n"); const OBERON_CHEF_ADDR = "0xAf5Ff8E51648847c0e94eDC855ddD364E72a66EF"; const OBERON_CHEF = new ethers.Contract(OBERON_CHEF_ADDR, OBERON_CHEF_ABI, App.provider); const rewardsPerWeek = await OBERON_CHEF.oberonPerBlock() / 1e18 * 604800 / 1; const tokens = {}; const prices = await getAvaxPrices(); await loadAvaxChefContract(App, tokens, prices, OBERON_CHEF, OBERON_CHEF_ADDR, OBERON_CHEF_ABI, "OBERON", "oberon", null, rewardsPerWeek, "pendingOberon"); hideLoading(); }
export { default as layer } from './layer'
import React from 'react' import PropTypes from 'prop-types' import createStyles from '../styles/createStyles' /** * A view for object property names. * * If the property name is enumerable (in Object.keys(object)), * the property name will be rendered normally. * * If the property name is not enumerable (`Object.prototype.propertyIsEnumerable()`), * the property name will be dimmed to show the difference. */ const ObjectName = ({name, dimmed, styles}, {theme}) => { const themeStyles = createStyles('ObjectName', theme) const appliedStyles = { ...themeStyles.base, ...(dimmed ? themeStyles['dimmed'] : {}), ...styles, } return <span style={appliedStyles}>{name}</span> } ObjectName.propTypes = { /** Property name */ name: PropTypes.string, /** Should property name be dimmed */ dimmed: PropTypes.bool, } ObjectName.defaultProps = { dimmed: false, } ObjectName.contextTypes = { theme: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), } export default ObjectName
let {parallel, watch, src} = require('gulp'); let connect = require('gulp-connect'); function serverLivereload(cb) { connect.server({livereload: true}); cb(); } function watchTemplates(cb) { watch('src/Controller/**/*.php', {interval: 1000, usePolling: true}, reload); watch('templates/**/*.twig', {interval: 1000, usePolling: true}, reload); watch('public/css/**/*.css', {interval: 1000, usePolling: true}, reload); watch('public/js/**/*.js', {interval: 1000, usePolling: true}, reload); watch('assets/**/*.*', {interval: 1000, usePolling: true}, reload); cb() } function reload(cb) { // Point src() to 1 file to keep unnecessary file streaming overhead to a minimum. // I used connect.reload() directly but that wasn't working, any advice on losing the src().pipe() portion? src('public/index.php').pipe(connect.reload()); cb(); } exports.default = parallel(serverLivereload, watchTemplates);
from preprocessing import process_embedding from preprocessing import subset_embedding from preprocessing import check_valid_file from preprocessing import check_valid_dir import multiprocessing as mp import tensorflow as tf import pandas as pd import numpy as np from progressbar import progressbar from tqdm import tqdm import pyemblib import scipy import queue import time import sys import os ''' save_first_n.py Script to save the first n most frequent words in an embedding file. ''' #========1=========2=========3=========4=========5=========6=========7== # RETURNS: a tuple of the script arguments def parse_args(): emb_path = sys.argv[1] first_n = int(sys.argv[2]) args = [emb_path, first_n, ] return args #========1=========2=========3=========4=========5=========6=========7== def saveflow(emb_path,first_n): check_valid_file(emb_path) subset_embedding(emb_path,first_n,None) #========1=========2=========3=========4=========5=========6=========7== if __name__ == "__main__": # stuff only to run when not called via 'import' here args = parse_args() emb_path = args[0] first_n = args[1] saveflow(emb_path,first_n)
!function(t,d){"object"==typeof exports&&"undefined"!=typeof module?d(exports):"function"==typeof define&&define.amd?define(["exports"],d):d((t=t||self).libphonenumber={})}(this,(function(t){"use strict";var d={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6],0,0,0,0,0,0,0,[0,["4\\d{4}",[5]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["690\\d{6}|[356]\\d{5}",[6,9]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[0,["5[024-68]\\d{7}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[0,["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268",[0,["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264",[0,["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[0,["6(?:[78][2-9]|9\\d)\\d{6}",[9]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[0,["9[1-49]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[0,["93888[013-9]\\d{5}|9(?:29(?:54|66)|3(?:777|865))[2-8]\\d{5}|93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|302|657|920)|3(?:4(?:8[27]|92)|541|755|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|32[03]|477|9(?:42|83))|3(?:329|4(?:[47]6|62|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-7]|[235][4-6]|84)|5(?:1[2-8]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:[03][45]|[17][2-6]|[58][3-6]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684",[0,["684(?:2(?:48|5[2468]|72)|7(?:3[13]|70|82))\\d{4}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[0,["6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}",[7,8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[0,["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[0,["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[0,["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[0,["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[0,["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246",[0,["246(?:2(?:[3568]\\d|4[0-57-9])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[0,["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[0,["4[5-9]\\d{7}",[9]]]],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]],0,0,0,0,0,0,[0,["(?:0[125-7]|5[1-8]|[67]\\d)\\d{6}"]]],BG:["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[0,["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]],0,0,0,0,0,0,[0,["(?:3(?:[1-79]\\d|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:3[03-9]|[69]\\d|7[0-6])))\\d{4}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[0,["(?:29|6[1257-9]|7[125-9])\\d{6}"]]],BJ:["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]],0,0,0,0,0,0,[0,["(?:5[1-8]|6\\d|9[013-9])\\d{6}"]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[0,["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441",[0,["441(?:[2378]\\d|5[0-39])\\d{5}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[0,["(?:22[89]|[78]\\d\\d)\\d{4}"]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[0,["[67]\\d{7}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[0,["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[0,["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242",[0,["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}"]]],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]],0,0,0,0,0,0,[0,["(?:1[67]|77)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["(?:321|7(?:[1-7]\\d|8[01]))\\d{5}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[0,["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[0,["6[0-35-7]\\d{5}",[7]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[0,["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[0,["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[0,["88\\d{5}|(?:8[0-59]|9[017-9])\\d{7}"]]],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]],0,0,0,0,0,0,[0,["7[02457]\\d{6}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[0,["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[0,["7[35-9]\\d{7}"]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[0,["0704[0-7]\\d{5}|0(?:[15]\\d\\d|7(?:0[0-37-9]|[4-9][7-9]))\\d{6}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[0,["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[0,["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[034]\\d|1[0-35-9]|2[1-9]|5[0-2])|600)|6469)|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[0,["(?:24[23]|6[5-9]\\d)\\d{6}",[9]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,[0,["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|5[0-35-9]|6[25-7]|7[0-35-8]|9[0135-9])\\d{8}",[11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|[36])\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[146][2-9]|[2578]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?",0,0,0,[0,["3333(?:0(?:0\\d|1[0-5])|[4-9]\\d\\d)\\d{3}|(?:3(?:24[1-9]|3(?:00|3[0-24-9]))|9101)\\d{6}|3(?:0[0-5]|1\\d|2[0-3]|5[01]|70)\\d{7}",[10]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[0,["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]]]],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[0,["5\\d{7}",[8]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[0,["(?:36|5[1-389]|9\\d)\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[0,["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[0,["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[0,["9[4-79]\\d{6}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[0,["(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}"]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:1\\d|2[02-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|[23]1|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[0,["15[0-25-9]\\d{8}|1(?:6[023]|7\\d)\\d{7,8}",[10,11]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[0,["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:[2-7]\\d|8[126-9]|9[1-46-9])\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767",[0,["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[0,["8[024]9[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:5(?:4[0-29]|5\\d|6[0-2])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[0,["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["(?:5\\d{5}|8(?:1(?:0(?:000|[3-9]\\d\\d)|(?:1(?:0[236]|1\\d)|(?:23|[3-79]\\d)\\d)\\d)|2(?:0(?:000|(?:19|[2-7]\\d)\\d)|(?:(?:[124-6]\\d|3[5-9])\\d|7(?:[679]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0",0,0,0,0,0,[0,["1[0-25]\\d{8}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]",[0,["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|6[0-367]))\\d{6}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]],0,0,0,0,0,0,[0,["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"]]],ET:["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0",0,0,0,0,0,[0,["9\\d{8}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[0,["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[0,["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[0,["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[0,["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[0,["(?:[27][1-9]|5\\d|91)\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7(?:00|[3-9]\\d))\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[0,["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[0,["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473",[0,["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0",0,0,0,0,0,[0,["5(?:(?:0555|1177)[5-9]|757(?:7[7-9]|8[01]))\\d{3}|5(?:0070|(?:11|33)33|[25]222)[0-4]\\d{3}|5(?:00(?:0\\d|50)|11(?:00|1\\d|2[0-4])|5200|75(?:00|[57]5)|8(?:0(?:[01]\\d|2[0-4])|58[89]|8(?:55|88)))\\d{4}|(?:5(?:[14]4|5[0157-9]|68|7[0147-9]|9[1-35-9])|790)\\d{6}"]]],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["694(?:[0-249]\\d|3[0-48])\\d{4}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[0,["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:2(?:[0346-8]\\d|5[67])|5(?:[0457]\\d|6[01]|9[1-9]))\\d{6}",[9]]]],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[0,["(?:5[146-8]\\d|606)\\d{5}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[0,["[245]\\d{5}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:[23679]\\d|5[0-389])\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[0,["6[0-356]\\d{7}",[9]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[0,["(?:222|55\\d)\\d{6}"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,["[3-5]\\d{7}",[8]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671",[0,["671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[0,["9(?:5\\d|6[569]|77)\\d{6}",[9]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]],0,0,0,0,0,0,[0,["(?:6\\d\\d|70[015-7])\\d{4}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[0,["(?:46(?:0[0-7]|1[0-6]|4[0-57-9]|6[0-4]|7[0-8])|573[0-6]|6(?:26[013-8]|66[0-3])|70(?:7[1-5]|8[0-4])|848[015-9]|929[013-9])\\d{4}|(?:4(?:40|6[2358])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-24679])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|84[09]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[0,["[37-9]\\d{7}",[8]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[0,["9(?:751\\d{5}|8\\d{6,7})|9(?:0[1-9]|[1259]\\d|7[0679])\\d{6}",[8,9]]]],HT:["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]],0,0,0,0,0,0,[0,["[34]\\d{7}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[0,["(?:[257]0|3[01])\\d{7}",[9]]]],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[0,["8[1-35-9]\\d{7,10}",[9,10,11,12]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["8(?:22|[35-9]\\d)\\d{6}",[9]]]],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[0,["5(?:(?:[02368]\\d|[19][2-9]|4[1-9])\\d|5(?:01|1[79]|2[2-9]|3[0-3]|4[34]|5[015689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24",[0,["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[0,["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}",[10]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[0,["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[0,["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[0,["9(?:(?:0(?:[0-35]\\d|4[4-6])|(?:[13]\\d|2[0-3])\\d)\\d|9(?:[0-46]\\d\\d|5[15]0|8(?:1\\d|88)|9(?:0[013]|[19]\\d|21|77|8[7-9])))\\d{5}",[10]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[0,["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[28]))\\d{4}"]],"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|55\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[0,["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[0,["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[0,["(?:658295|876(?:2(?:0[2-9]|[14-9]\\d|2[013-9]|3[3-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[0,["7(?:[78][0-25-9]|9\\d)\\d{6}",[9]]]],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,0,0,0,0,[0,["[7-9]0[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:1(?:0[0-6]|1[0-5]|2[014])|7\\d\\d)\\d{6}",[9]]]],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|7(?:[07]\\d|55)|880|99[05-9])\\d{6}",[9]]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[0,["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[0,["(?:63\\d{3}|73(?:0[0-5]\\d|140))\\d{3}|[67]200[01]\\d{3}",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[0,["[34]\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869",[0,["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[0,["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[0,["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[1-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[0,["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|111|222|333|444|7(?:0[013-9]|[67]\\d)|888|9(?:[069]\\d|3[039]))|9(?:(?:0[09]|22|[4679]\\d|8[057-9])\\d|1(?:1[01]|99)|3(?:00|33)|5(?:00|5\\d)))\\d{4}",[8]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345",[0,["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"]]],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",[0,["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:20(?:[239]\\d|5[24-9]|7[6-8]|88)|302\\d)\\d{6}",[10]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[0,["793(?:[01]\\d|2[0-4])\\d{3}|(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[12]))\\d{5}"]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758",[0,["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)",0,0,0,[0,["(?:6(?:(?:4[5-9]|5[0-4])\\d|6(?:[0245]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[0,["7(?:[0-25-8]\\d|4[0-4])\\d{6}"]]],LR:["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:(?:330|555|(?:77|88)\\d)\\d|4[67])\\d{5}|[56]\\d{6}",[7,9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[0,["[56]\\d{7}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]",0,0,0,[0,["6\\d{7}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[0,["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}",[9]]]],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]],0,0,0,0,0,0,[0,["2\\d{7}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[0,["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|6[0-367]))\\d{6}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0",0,0,0,0,0,[0,["4(?:[46]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[0,["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[0,["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]]]],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[0,["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1",0,0,[0,["3[2-489]\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[0,["(?:(?:23|54)5|329|45[56])\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[0,["7(?:3555|4(?:60\\d|747)|94(?:[01]\\d|2[0-4]))\\d{3}|7(?:[0-25-8]\\d|3[1-4]|42|9[23])\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[0,["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[239])\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[0,["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]]]],MN:["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:83[01]|920)\\d{5}|(?:5[05]|8[05689]|9[013-9])\\d{6}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[0,["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670",[0,["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"]]],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["69(?:6(?:[0-46-9]\\d|5[0-6])|727)\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[0,["[2-4][0-46-9]\\d{6}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664",[0,["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[0,["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[0,["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])\\d{5}",[8]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[0,["46[46]\\d{4}|(?:7\\d|9[13-9])\\d{5}",[7]]],"00"],MW:["265","00","(?:[129]\\d|31|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0",0,0,0,0,0,[0,["111\\d{6}|(?:31|77|88|9[89])\\d{7}",[9]]]],MX:["52","0[09]","1(?:(?:44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[017]\\d|[235][1-9]|4[0-35-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,[0,["6571\\d{6}|(?:1(?:2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))|2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[25-7][1-9]|3[1-8]|4\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|6[1-9]|7[12]|8[1-8]|9\\d))\\d{7}"]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[0,["1(?:1888[69]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0134]\\d|2[1-9]|5[0-6]))|(?:(?:[269]|59)\\d|[37][1-9]|4[235-9])\\d|8(?:1[23]|[236]\\d|4[06]|5[7-9]|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["8[2-79]\\d{7}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[0,["(?:60|8[1245])\\d{7}",[9]]]],NC:["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]],0,0,0,0,0,0,[0,["(?:5[0-4]|[79]\\d|8[0-79])\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]],0,0,0,0,0,0,[0,["(?:23|7[04]|[89]\\d)\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[0,["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:702[0-24-9]|8(?:01|19)[01])\\d{6}|(?:70[13-689]|8(?:0[2-9]|1[0-8])|9(?:0[1-9]|1[2356]))\\d{7}",[10]]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[0,["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0",0,0,0,0,0,[0,["6[1-58]\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[0,["(?:4[015-8]|59|9\\d)\\d{6}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[0,["9(?:6[0-3]|7[245]|8[0-24-68])\\d{7}",[10]]]],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]],0,0,0,0,0,0,[0,["(?:55[3-9]|666|8\\d\\d)\\d{4}"]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[0,["888[4-9]\\d{3}",[7]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,[0,["2[0-27-9]\\d{7,8}|21\\d{6}",[8,9,10]]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[0,["1505\\d{4}|(?:7(?:[1289]\\d|7[0-4])|9(?:0[1-9]|[1-9]\\d))\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]]]],PE:["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[0,["9\\d{8}",[9]]],0," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[0,["8[7-9]\\d{6}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[0,["(?:7\\d|8[18])\\d{6}",[8]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[0,["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[0,["3(?:[0-24]\\d|3[0-7]|55|64)\\d{7}",[10]]]],PL:["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[0,["21(?:1(?:[145]\\d|3[1-5])|2[0-4]\\d)\\d{4}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[0,["(?:4[02-4]|5[056])\\d{4}",[6]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[0,["(?:787|939)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[0,["5[69]\\d{7}",[9]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[0,["6[0356]92(?:30|9\\d)\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:46[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[0,["9(?:51|6[129]|[78][1-6]|9[1-5])\\d{6}",[9]]]],QA:["974","00","[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}",[7,8,9],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]],0,0,0,0,0,0,[0,["(?:2[89]|[35-7]\\d)\\d{6}",[8]]]],RE:["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]",[0,["(?:69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|6[0-6]|7[0-27]|8[0-8]|9[0-479]))|9769\\d)\\d{4}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,[0,["7020\\d{5}|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[019])\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[0,["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",[0,["9\\d{9}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0",0,0,0,0,0,[0,["7[2389]\\d{7}",[9]]]],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[0,["579[01]\\d{5}|5(?:[013-689]\\d|7[0-36-8])\\d{6}",[9]]]],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[0,["48\\d{3}|(?:(?:7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[0,["2[125-8]\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[0,["7[02369]\\d{7}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-5]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,["8(?:051|95[0-2])\\d{4}|(?:8(?:0[1-4]|[1-8]\\d|9[0-4])|9[0-8]\\d)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[0,["[56]\\d{4}",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[0,["65(?:1\\d|55|[67]0)\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79",[0,["(?:4[015-8]|59|9\\d)\\d{6}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[0,["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[0,["(?:25|3[0-5]|66|7[2-9]|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[0,["6[16]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[0,["75(?:01|[38]3)\\d{5}|7(?:[06-8]\\d|21|5[4-7]|90)\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0",0,0,0,0,0,[0,["(?:(?:15|(?:3[59]|4[89]|79|8[08])\\d|6(?:0[5-7]|[1-9]\\d)|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:6\\d|7[1-9])\\d{6}",[7,8,9]]]],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]],0,0,0,0,0,0,[0,["(?:7[124-7]|8[124-9])\\d{5}",[7]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[0,["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[0,["66(?:[02-9]\\d\\d|1(?:[02-9]\\d|16))\\d{3}|(?:6[0-57-9]|7\\d)\\d{6}",[8]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721",[0,["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"]]],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0",0,0,0,0,0,[0,["9(?:22|[3-689]\\d)\\d{6}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[0,["7[6-9]\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649",[0,["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"]]],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,[0,["(?:6[023568]|77|9\\d)\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[0,["(?:7[09]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[0,["671[0-8]\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}",[9]]]],TJ:["992","810","(?:00|[1-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,[0,["41[18]\\d{6}|(?:[034]0|[17][017]|2[02]|5[05]|8[08]|9\\d)\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[0,["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[0,["7[2-8]\\d{6}",[8]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,[0,["6\\d{7}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[0,["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-7])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[0,["(?:55[4-6]|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[0,["56161\\d{5}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868",[0,["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[0,["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[0,["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]]],0,"#"],TZ:["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[0,["77[2-9]\\d{6}|(?:6[1-9]|7[1-689])\\d{7}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:50|6[36-8]|7[1-3]|9[1-9])\\d{7}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0",0,0,0,0,0,[0,["726[01]\\d{5}|7(?:[0157-9]\\d|20|36|[46][0-4])\\d{6}"]]],US:["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[0,["5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|22|33)|4(?:00|4[24]|65|82)|5(?:00|29|58|83)|6(?:00|66|82)|7(?:58|77)|8(?:00|42|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","4\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,[0,["9[1-9]\\d{6}",[8]]],"00"," int. "],UZ:["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,[0,["(?:(?:33|88|9[0-57-9])\\d{3}|55(?:50[013]|90\\d)|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|3[01]|5\\d|7[0-4])|(?:5[67]|7\\d)\\d|6(?:2[0-26]|8\\d)))|7(?:[07]\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]],"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698",[0,["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784",[0,["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[0,["4(?:1[24-8]|2[46])\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284",[0,["284496[6-9]\\d{3}|284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|99)|5(?:4[0-7]|68|9[69]))\\d{4}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340",[0,["340(?:2(?:0[0-38]|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[0,["(?:5(?:2[238]|59)|89[689]|99[013-9])\\d{6}|(?:3\\d|5[689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[0,["(?:[58]\\d|7[013-7])\\d{5}",[7]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[0,["(?:72|8[23])\\d{4}",[6]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[0,["(?:7[1-35-7]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0",0,0,0,0,0,[0,["4[3-9]\\d{6}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[0,["7[0137]\\d{7}",[9]]]],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63",[0,["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[0,["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:6\\d|7[0-46-9])\\d{3}|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]]]],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:7[679]|9[5-8])\\d{7}"]]],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0",0,0,0,0,0,[0,["7(?:[178]\\d|3[1-9])\\d{6}",[9]]]]},nonGeographic:{800:["800",0,"(?:005|[1-9]\\d\\d)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:005|[1-9]\\d\\d)\\d{5}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],883:["883",0,"(?:210|370\\d\\d)\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[35]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|(?:370[1-9]|51[013]0)\\d)\\d{7}|5100\\d{5}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function e(t,e){var n=Array.prototype.slice.call(e);return n.push(d),t.apply(this,n)}var n=function t(d){!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=this.constructor.name,this.message=d,this.stack=new Error(d).stack};(n.prototype=Object.create(Error.prototype)).constructor=n;var r="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~");function i(t,d){t=t.split("-"),d=d.split("-");for(var e=t[0].split("."),n=d[0].split("."),r=0;r<3;r++){var i=Number(e[r]),a=Number(n[r]);if(i>a)return 1;if(a>i)return-1;if(!isNaN(i)&&isNaN(a))return 1;if(isNaN(i)&&!isNaN(a))return-1}return t[1]&&d[1]?t[1]>d[1]?1:t[1]<d[1]?-1:0:!t[1]&&d[1]?1:t[1]&&!d[1]?-1:0}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function o(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,d,e){return d&&o(t.prototype,d),e&&o(t,e),t}var l=/^\d+$/,s=function(){function t(d){$(this,t),function(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!y(t)||!y(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(y(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+v(t)+": "+t,"."))}(d),this.metadata=d,N.call(this,d)}return u(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(t){return"001"!==t}))}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var d=this.countryCallingCodes()[t];if(d&&1===d.length&&"001"===d[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,d){if(t&&l.test(t)&&(d=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new c(this.getCountryMetadata(t),this)}else if(d){if(!this.hasCallingCode(d))throw new Error("Unknown calling code: ".concat(d));this.numberingPlan=new c(this.getNumberingPlanMetadata(d),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var d=this.countryCallingCodes()[t];if(d){if(1===d.length&&3===d[0].length)return;return d}}},{key:"getCountryCodeForCallingCode",value:function(t){var d=this.getCountryCodesForCallingCode(t);if(d)return d[0]}},{key:"getNumberingPlanMetadata",value:function(t){var d=this.getCountryCodeForCallingCode(t);if(d)return this.getCountryMetadata(d);if(this.nonGeographic()){var e=this.nonGeographic()[t];if(e)return e}else{var n=this.countryCallingCodes()[t];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(t){return this.numberingPlan.type(t)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),t}(),c=function(){function t(d,e){$(this,t),this.globalMetadataObject=e,this.metadata=d,N.call(this,e.metadata)}return u(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this,d=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return d.map((function(d){return new f(d,t)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&m(this.types(),t))return new g(m(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?" ext. ":this.metadata[13]||" ext. "}}]),t}(),f=function(){function t(d,e){$(this,t),this._format=d,this.metadata=e}return u(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||h.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),h=/^\(?\$1\)?$/,g=function(){function t(d,e){$(this,t),this.type=d,this.metadata=e}return u(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function m(t,d){switch(d){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}var y=function(t){return"object"===a(t)},v=function(t){return a(t)};function p(t,d){return(d=new s(d)).hasCountry(t)?d.country(t).ext():" ext. "}function b(t,d){if((d=new s(d)).hasCountry(t))return d.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function C(t,d){return void 0!==d.countries[t]}function N(t){var d=t.version;"number"==typeof d?(this.v1=1===d,this.v2=2===d,this.v3=3===d,this.v4=4===d):d?-1===i(d,"1.2.0")?this.v2=!0:-1===i(d,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var x=function(t){return"([".concat("0-90-9٠-٩۰-۹","]{1,").concat(t,"})")};function P(t){return";ext="+x("20")+"|"+("[  \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[  \\t,-]*"+x("20")+"#?")+"|"+("[  \\t,]*(?:[xx##~~]|int|int)[:\\..]?[  \\t,-]*"+x("9")+"#?")+"|"+("[- ]+"+x("6")+"#")+"|"+("[  \\t]*(?:,{2}|;)[:\\..]?[  \\t,-]*"+x("15")+"#?")+"|"+("[  \\t]*(?:,)+[:\\..]?[  \\t,-]*"+x("9")+"#?")}var w="[++]{0,1}(?:["+r+"]*[0-90-9٠-٩۰-۹]){3,}["+r+"0-90-9٠-٩۰-۹]*",O=new RegExp("^[++]{0,1}(?:["+r+"]*[0-90-9٠-٩۰-۹]){1,2}$","i"),S=w+"(?:"+P()+")?",E=new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^"+S+"$","i");function I(t){return t.length>=2&&E.test(t)}var k=new RegExp("(?:"+P()+")$","i");var T={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function F(t){return T[t]}function A(t){var d="",e=t.split(""),n=Array.isArray(e),r=0;for(e=n?e:e[Symbol.iterator]();;){var i;if(n){if(r>=e.length)break;i=e[r++]}else{if((r=e.next()).done)break;i=r.value}var a=F(i);a&&(d+=a)}return d}function R(t){var d="",e=t.split(""),n=Array.isArray(e),r=0;for(e=n?e:e[Symbol.iterator]();;){var i;if(n){if(r>=e.length)break;i=e[r++]}else{if((r=e.next()).done)break;i=r.value}d+=D(i,d)||""}return d}function D(t,d){if("+"===t){if(d)return;return"+"}return F(t)}function M(t,d){return function t(d,e,n){var r=n.type(e),i=r&&r.possibleLengths()||n.possibleLengths();if(!i)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===e){if(!n.type("FIXED_LINE"))return t(d,"MOBILE",n);var a=n.type("MOBILE");a&&(i=function(t,d){var e=t.slice(),n=d,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var $=a;t.indexOf($)<0&&e.push($)}return e.sort((function(t,d){return t-d}))}(i,a.possibleLengths()))}else if(e&&!r)return"INVALID_LENGTH";var $=d.length,o=i[0];if(o===$)return"IS_POSSIBLE";if(o>$)return"TOO_SHORT";if(i[i.length-1]<$)return"TOO_LONG";return i.indexOf($,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,void 0,d)}function L(t,d){switch(M(t,d)){case"IS_POSSIBLE":return!0;default:return!1}}function _(t,d){return function(t){if(Array.isArray(t))return t}(t)||function(t,d){var e=[],n=!0,r=!1,i=void 0;try{for(var a,$=t[Symbol.iterator]();!(n=(a=$.next()).done)&&(e.push(a.value),!d||e.length!==d);n=!0);}catch(t){r=!0,i=t}finally{try{n||null==$.return||$.return()}finally{if(r)throw i}}return e}(t,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function G(t){var d,e,n=(t=t.replace(/^tel:/,"tel=")).split(";"),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var $=_(a.split("="),2),o=$[0],u=$[1];switch(o){case"tel":d=u;break;case"ext":e=u;break;case"phone-context":"+"===u[0]&&(d=u+d)}}if(!I(d))return{};var l={number:d};return e&&(l.ext=e),l}function j(t){var d=t.number,e=t.ext;if(!d)return"";if("+"!==d[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(d).concat(e?";ext="+e:"")}function B(t,d){return t=t||"",new RegExp("^(?:"+d+")$").test(t)}var U=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function W(t,d,e){if(d=d||{},t.country){(e=new s(e)).selectNumberingPlan(t.country,t.countryCallingCode);var n=d.v2?t.nationalNumber:t.phone;if(B(n,e.nationalNumberPattern())){if(V(n,"FIXED_LINE",e))return e.type("MOBILE")&&""===e.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":e.type("MOBILE")?V(n,"MOBILE",e)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var r=0,i=U;r<i.length;r++){var a=i[r];if(V(n,a,e))return a}}}}function V(t,d,e){return!(!(d=e.type(d))||!d.pattern())&&(!(d.possibleLengths()&&d.possibleLengths().indexOf(t.length)<0)&&B(t,d.pattern()))}function H(t,d,e){return d=d||{},e=new s(e),!!t.country&&(e.selectNumberingPlan(t.country,t.countryCallingCode),e.hasTypes()?void 0!==W(t,d,e.metadata):B(d.v2?t.nationalNumber:t.phone,e.nationalNumberPattern()))}function K(t){return t.replace(new RegExp("[".concat(r,"]+"),"g")," ").trim()}var Y=/(\$\d)/;function Z(t,d,e){var n=e.useInternationalFormat,r=e.withNationalPrefix,i=(e.carrierCode,e.metadata,t.replace(new RegExp(d.pattern()),n?d.internationalFormat():r&&d.nationalPrefixFormattingRule()?d.format().replace(Y,d.nationalPrefixFormattingRule()):d.format()));return n?K(i):i}var X=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function J(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}var z={formatExtension:function(t,d,e){return"".concat(t).concat(e.ext()).concat(d)}};function Q(t,d,e,n){if(e=e?function(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){J(t,d,e[d])}))}return t}({},z,e):z,n=new s(n),t.country&&"001"!==t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.country(t.country)}else{if(!t.countryCallingCode)return t.phone||"";n.selectNumberingPlan(t.countryCallingCode)}var r,i=n.countryCallingCode(),a=e.v2?t.nationalNumber:t.phone;switch(d){case"NATIONAL":return a?tt(r=q(a,t.carrierCode,"NATIONAL",n,e),t.ext,n,e.formatExtension):"";case"INTERNATIONAL":return a?(r=q(a,null,"INTERNATIONAL",n,e),tt(r="+".concat(i," ").concat(r),t.ext,n,e.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(a);case"RFC3966":return j({number:"+".concat(i).concat(a),ext:t.ext});case"IDD":if(!e.fromCountry)return;return tt(function(t,d,e,n,r){if(b(n,r.metadata)===e){var i=q(t,d,"NATIONAL",r);return"1"===e?e+" "+i:i}var a=function(t,d,e){var n=new s(e);return n.selectNumberingPlan(t,d),n.defaultIDDPrefix()?n.defaultIDDPrefix():X.test(n.IDDPrefix())?n.IDDPrefix():void 0}(n,void 0,r.metadata);if(a)return"".concat(a," ").concat(e," ").concat(q(t,null,"INTERNATIONAL",r))}(a,t.carrierCode,i,e.fromCountry,n),t.ext,n,e.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(d,'"'))}}function q(t,d,e,n,r){var i=function(t,d){var e=t,n=Array.isArray(e),r=0;for(e=n?e:e[Symbol.iterator]();;){var i;if(n){if(r>=e.length)break;i=e[r++]}else{if((r=e.next()).done)break;i=r.value}var a=i;if(a.leadingDigitsPatterns().length>0){var $=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(0!==d.search($))continue}if(B(d,a.pattern()))return a}}(n.formats(),t);return i?Z(t,i,{useInternationalFormat:"INTERNATIONAL"===e,withNationalPrefix:!i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r||!1!==r.nationalPrefix,carrierCode:d,metadata:n}):t}function tt(t,d,e,n){return d?n(t,d,e):t}function dt(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function et(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var nt=function(){function t(d,e,n){if(function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),!d)throw new TypeError("`country` or `countryCallingCode` not passed");if(!e)throw new TypeError("`nationalNumber` not passed");if(!n)throw new TypeError("`metadata` not passed");var r=new s(n);rt(d)&&(this.country=d,r.country(d),d=r.countryCallingCode()),this.countryCallingCode=d,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.metadata=n}var d,e,n;return d=t,(e=[{key:"setExt",value:function(t){this.ext=t}},{key:"isPossible",value:function(){return function(t,d,e){if(void 0===d&&(d={}),e=new s(e),d.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");e.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!e.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));e.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");e.selectNumberingPlan(t.countryCallingCode)}}if(e.possibleLengths())return L(t.phone||t.nationalNumber,e);if(t.countryCallingCode&&e.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.metadata)}},{key:"isValid",value:function(){return H(this,{v2:!0},this.metadata)}},{key:"isNonGeographic",value:function(){return new s(this.metadata).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return W(this,{v2:!0},this.metadata)}},{key:"format",value:function(t,d){return Q(this,t,d?function(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){dt(t,d,e[d])}))}return t}({},d,{v2:!0}):{v2:!0},this.metadata)}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])&&et(d.prototype,e),n&&et(d,n),t}(),rt=function(t){return/^[A-Z]{2}$/.test(t)},it=new RegExp("([0-90-9٠-٩۰-۹])");function at(t,d,e,n){if(d){var r=new s(n);r.selectNumberingPlan(d,e);var i=new RegExp(r.IDDPrefix());if(0===t.search(i)){var a=(t=t.slice(t.match(i)[0].length)).match(it);if(!(a&&null!=a[1]&&a[1].length>0&&"0"===a[1]))return t}}}function $t(t,d){if(t&&d.numberingPlan.nationalPrefixForParsing()){var e=new RegExp("^(?:"+d.numberingPlan.nationalPrefixForParsing()+")"),n=e.exec(t);if(n){var r,i,a,$=n.length-1,o=$>0&&n[$];if(d.nationalPrefixTransformRule()&&o)r=t.replace(e,d.nationalPrefixTransformRule()),$>1&&(i=n[1]);else{var u=n[0];r=t.slice(u.length),o&&(i=n[1])}if(o){var l=t.indexOf(n[1]);t.slice(0,l)===d.numberingPlan.nationalPrefix()&&(a=d.numberingPlan.nationalPrefix())}else a=n[0];return{nationalNumber:r,nationalPrefix:a,carrierCode:i}}}return{nationalNumber:t}}function ot(t,d){var e=$t(t,d),n=e.nationalNumber,r=e.carrierCode;if(!function(t,d,e){if(B(t,e.nationalNumberPattern())&&!B(d,e.nationalNumberPattern()))return!1;return!0}(t,n,d))return{nationalNumber:t};if(t.length!==n.length+(r?r.length:0)&&d.possibleLengths())switch(M(n,d)){case"TOO_SHORT":case"INVALID_LENGTH":return{nationalNumber:t}}return{nationalNumber:n,carrierCode:r}}function ut(t,d,e,n){var r=d?b(d,n):e;if(0===t.indexOf(r)){(n=new s(n)).selectNumberingPlan(d,e);var i=t.slice(r.length),a=ot(i,n).nationalNumber,$=ot(t,n).nationalNumber;if(!B($,n.nationalNumberPattern())&&B(a,n.nationalNumberPattern())||"TOO_LONG"===M($,n))return{countryCallingCode:r,number:i}}return{number:t}}function lt(t,d,e,n){if(!t)return{};if("+"!==t[0]){var r=at(t,d,e,n);if(!r||r===t){if(d||e){var i=ut(t,d,e,n),a=i.countryCallingCode,$=i.number;if(a)return{countryCallingCode:a,number:$}}return{number:t}}t="+"+r}if("0"===t[1])return{};n=new s(n);for(var o=2;o-1<=3&&o<=t.length;){var u=t.slice(1,o);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCode:u,number:t.slice(o)};o++}return{}}function st(t,d,e){var n=e.getCountryCodesForCallingCode(t);if(n)return 1===n.length?n[0]:function(t,d,e){e=new s(e);var n=t,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var $=a;if(e.country($),e.leadingDigits()){if(d&&0===d.search(e.leadingDigits()))return $}else if(W({phone:d,country:$},void 0,e.metadata))return $}}(n,d,e.metadata)}var ct=new RegExp("[++0-90-9٠-٩۰-۹]"),ft=new RegExp("[^0-90-9٠-٩۰-۹#]+$");function ht(t,d,e){if(d=d||{},e=new s(e),d.defaultCountry&&!e.hasCountry(d.defaultCountry)){if(d.v2)throw new n("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(d.defaultCountry))}var r=function(t,d,e){if(t&&0===t.indexOf("tel:"))return G(t);var r=function(t,d,e){if(!t)return;if(t.length>250){if(e)throw new n("TOO_LONG");return}if(!1===d)return t;var r=t.search(ct);if(r<0)return;return t.slice(r).replace(ft,"")}(t,e,d);if(!r)return{};if(!I(r))return function(t){return O.test(t)}(r)?{error:"TOO_SHORT"}:{};var i=function(t){var d=t.search(k);if(d<0)return{};for(var e=t.slice(0,d),n=t.match(k),r=1;r<n.length;){if(n[r])return{number:e,ext:n[r]};r++}}(r);if(i.ext)return i;return{number:r}}(t,d.v2,d.extract),i=r.number,a=r.ext,$=r.error;if(!i){if(d.v2){if("TOO_SHORT"===$)throw new n("TOO_SHORT");throw new n("NOT_A_NUMBER")}return{}}var o=function(t,d,e,n){var r,i=lt(R(t),d,e,n.metadata),a=i.countryCallingCode,$=i.number;if(a)n.selectNumberingPlan(a);else{if(!$||!d&&!e)return{};n.selectNumberingPlan(d,e),d&&(r=d),a=e||b(d,n.metadata)}if(!$)return{countryCallingCode:a};var o=ot(R($),n),u=o.nationalNumber,l=o.carrierCode,s=st(a,u,n);s&&(r=s,"001"===s||n.country(r));return{country:r,countryCallingCode:a,nationalNumber:u,carrierCode:l}}(i,d.defaultCountry,d.defaultCallingCode,e),u=o.country,l=o.nationalNumber,c=o.countryCallingCode,f=o.carrierCode;if(!e.hasSelectedNumberingPlan()){if(d.v2)throw new n("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(d.v2)throw new n("TOO_SHORT");return{}}if(l.length>17){if(d.v2)throw new n("TOO_LONG");return{}}if(d.v2){var h=new nt(c,l,e.metadata);return u&&(h.country=u),f&&(h.carrierCode=f),a&&(h.ext=a),h}var g=!(d.extended?!e.hasSelectedNumberingPlan():!u)&&B(l,e.nationalNumberPattern());return d.extended?{country:u,countryCallingCode:c,carrierCode:f,valid:g,possible:!!g||!(!0!==d.extended||!e.possibleLengths()||!L(l,e)),phone:l,ext:a}:g?function(t,d,e){var n={country:t,phone:d};e&&(n.ext=e);return n}(u,l,a):{}}function gt(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function mt(t,d,e){return ht(t,function(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){gt(t,d,e[d])}))}return t}({},d,{v2:!0}),e)}function yt(t){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vt(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function pt(t,d){return function(t){if(Array.isArray(t))return t}(t)||function(t,d){var e=[],n=!0,r=!1,i=void 0;try{for(var a,$=t[Symbol.iterator]();!(n=(a=$.next()).done)&&(e.push(a.value),!d||e.length!==d);n=!0);}catch(t){r=!0,i=t}finally{try{n||null==$.return||$.return()}finally{if(r)throw i}}return e}(t,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function bt(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata;return mt(d,e,n)}function Ct(t){var d,e,n,r=pt(Array.prototype.slice.call(t),4),i=r[0],a=r[1],$=r[2],o=r[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(d=i,a&&"string"!=typeof a){if(!Nt(a))throw new Error("Invalid second argument: ".concat(a));$?(e=a,n=$):n=a}else o?(e=$,n=o):(e=void 0,n=$),a&&(e=function(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){vt(t,d,e[d])}))}return t}({defaultCountry:a},e));return{text:d,options:e,metadata:n}}var Nt=function(t){return"object"===yt(t)};function xt(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Pt(t,d,e){d&&d.defaultCountry&&!C(d.defaultCountry,e)&&(d=function(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){xt(t,d,e[d])}))}return t}({},d,{defaultCountry:void 0}));try{return mt(t,d,e)}catch(t){if(!(t instanceof n))throw t}}function wt(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata;return Pt(d,e,n)}function Ot(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){St(t,d,e[d])}))}return t}function St(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Et(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata,r=Pt(d,e=Ot({},e,{extract:!1}),n);return r&&r.isValid()||!1}function It(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){kt(t,d,e[d])}))}return t}function kt(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Tt(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata,r=Pt(d,e=It({},e,{extract:!1}),n);return r&&r.isPossible()||!1}function Ft(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){At(t,d,e[d])}))}return t}function At(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Rt(){var t=Ct(arguments),d=t.text,e=t.options,r=t.metadata;e=Ft({},e,{extract:!1});try{var i=mt(d,e,r);(r=new s(r)).selectNumberingPlan(i.countryCallingCode);var a=M(i.nationalNumber,r);if("IS_POSSIBLE"!==a)return a}catch(t){if(t instanceof n)return t.message;throw t}}function Dt(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Mt(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}var Lt=function t(d,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Mt(this,t),this.key=d,this.value=e,this.next=n,this.prev=r},_t=function(){function t(){var d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;Mt(this,t),this.size=0,this.limit=d,this.head=null,this.tail=null,this.cache={}}var d,e,n;return d=t,(e=[{key:"put",value:function(t,d){if(this.ensureLimit(),this.head){var e=new Lt(t,d,this.head);this.head.prev=e,this.head=e}else this.head=this.tail=new Lt(t,d);this.cache[t]=this.head,this.size++}},{key:"get",value:function(t){if(this.cache[t]){var d=this.cache[t].value;return this.remove(t),this.put(t,d),d}console.log("Item not available in cache for key ".concat(t))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(t){var d=this.cache[t];null!==d.prev?d.prev.next=d.next:this.head=d.next,null!==d.next?d.next.prev=d.prev:this.tail=d.prev,delete this.cache[t],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}])&&Dt(d.prototype,e),n&&Dt(d,n),t}();function Gt(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var jt=function(){function t(d){!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache=new _t(d)}var d,e,n;return d=t,(e=[{key:"getPatternForRegExp",value:function(t){var d=this.cache.get(t);return d||(d=new RegExp("^"+t),this.cache.put(t,d)),d}}])&&Gt(d.prototype,e),n&&Gt(d,n),t}();function Bt(t,d){if(t<0||d<=0||d<t)throw new TypeError;return"{".concat(t,",").concat(d,"}")}function Ut(t,d){var e=d.search(t);return e>=0?d.slice(0,e):d}var Wt="   ᠎ - \u2028\u2029   ",Vt="[".concat(Wt,"]"),Ht="[^".concat(Wt,"]"),Kt="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),Yt="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Zt="[".concat(Yt,"]"),Xt=new RegExp(Zt),Jt="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),zt=new RegExp(Jt),Qt="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),qt=new RegExp(Qt),td=new RegExp("[\0-€-ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function dd(t){return!(!Xt.test(t)&&!qt.test(t))&&td.test(t)}function ed(t){return"%"===t||zt.test(t)}var nd={POSSIBLE:function(t,d,e){return!0},VALID:function(t,d,e){return!(!H(t,void 0,e)||!rd(t,d.toString()))},STRICT_GROUPING:function(t,d,e,n){var r=d.toString();return!(!H(t,void 0,e)||!rd(t,r)||ad(t,r)||!id(t))&&$d(t,d,e,ld,n)},EXACT_GROUPING:function(t,d,e,n){var r=d.toString();return!(!H(t,void 0,e)||!rd(t,r)||ad(t,r)||!id(t))&&$d(t,d,e,ud,n)}};function rd(t,d,e){for(var n=0;n<d.length-1;n++){var r=d.charAt(n);if("x"===r||"X"===r){var i=d.charAt(n+1);if("x"===i||"X"===i){if(n++,util.isNumberMatch(t,d.substring(n))!=MatchType.NSN_MATCH)return!1}else if(A(d.substring(n))!==t.ext)return!1}}return!0}function id(t,d){if("FROM_DEFAULT_COUNTRY"!=t.getCountryCodeSource())return!0;var e=util.getRegionCodeForCountryCode(t.getCountryCode()),n=util.getMetadataForRegion(e);if(null==n)return!0;var r=util.getNationalSignificantNumber(t),i=util.chooseFormattingPatternForNumber(n.numberFormats(),r);if(i&&i.getNationalPrefixFormattingRule().length>0){if(i.getNationalPrefixOptionalWhenFormatting())return!0;if(PhoneNumberUtil.formattingRuleHasFirstGroupOnly(i.getNationalPrefixFormattingRule()))return!0;var a=PhoneNumberUtil.normalizeDigitsOnly(t.getRawInput());return util.maybeStripNationalPrefixAndCarrierCode(a,n,null)}return!0}function ad(t,d){var e=d.indexOf("/");if(e<0)return!1;var n=d.indexOf("/",e+1);return!(n<0)&&(!(t.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN||t.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)||PhoneNumberUtil.normalizeDigitsOnly(d.substring(0,e))!==String(t.getCountryCode())||d.slice(n+1).indexOf("/")>=0)}function $d(t,d,e,n,r){var i=normalizeDigits(d,!0),a=od(e,t,null);if(n(e,t,i,a))return!0;var $=MetadataManager.getAlternateFormatsForCountry(t.getCountryCode()),o=util.getNationalSignificantNumber(t);if($){var u=$.numberFormats(),l=Array.isArray(u),s=0;for(u=l?u:u[Symbol.iterator]();;){var c;if(l){if(s>=u.length)break;c=u[s++]}else{if((s=u.next()).done)break;c=s.value}var f=c;if(f.leadingDigitsPatterns().length>0)if(!r.getPatternForRegExp("^"+f.leadingDigitsPatterns()[0]).test(o))continue;if(n(e,t,i,a=od(e,t,f)))return!0}}return!1}function od(t,d,e){if(e){var n=util.getNationalSignificantNumber(d);return util.formatNsnUsingPattern(n,e,"RFC3966",t).split("-")}var r=formatNumber(d,"RFC3966",t),i=r.indexOf(";");i<0&&(i=r.length);var a=r.indexOf("-")+1;return r.slice(a,i).split("-")}function ud(t,d,e,n){var r=e.split(NON_DIGITS_PATTERN),i=d.hasExtension()?r.length-2:r.length-1;if(1==r.length||r[i].contains(util.getNationalSignificantNumber(d)))return!0;for(var a,$,o=n.length-1;o>0&&i>=0;){if(r[i]!==n[o])return!1;o--,i--}return i>=0&&(a=r[i],$=n[0],a.indexOf($,a.length-$.length)===a.length-$.length)}function ld(t,d,e,n){var r,i,a=0;if(d.getCountryCodeSource()!==CountryCodeSource.FROM_DEFAULT_COUNTRY){var $=String(d.getCountryCode());a=e.indexOf($)+$.length()}for(var o=0;o<n.length;o++){if((a=e.indexOf(n[o],a))<0)return!1;if(a+=n[o].length(),0==o&&a<e.length()){var u=util.getRegionCodeForCountryCode(d.getCountryCode());if(null!=util.getNddPrefixForRegion(u,!0)&&Character.isDigit(e.charAt(a))){var l=util.getNationalSignificantNumber(d);return r=e.slice(a-n[o].length),i=l,0===r.indexOf(i)}}}return e.slice(a).contains(d.getExtension())}var sd=/[\\/] *x/;function cd(t){return Ut(sd,t)}var fd=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,hd=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,gd=/^:[0-5]\d/;function md(t,d,e){if(fd.test(t))return!1;if(hd.test(t)){var n=e.slice(d+t.length);if(gd.test(n))return!1}return!0}var yd="[^".concat("(\\[([").concat(")\\])]","]"),vd="[".concat("(\\[([").concat("++","]"),pd=new RegExp("^"+vd),bd=Bt(0,3),Cd=new RegExp("^(?:[(\\[([])?(?:"+yd+"+[)\\])]])?"+yd+"+(?:[(\\[([]"+yd+"+[)\\])]])"+bd+yd+"*$"),Nd=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function xd(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){Od(t,d,e[d])}))}return t}function Pd(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function wd(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Od(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}var Sd=P(),Ed=["\\/+(.*)/","(\\([^(]*)","(?:".concat(Vt,"-|-").concat(Vt,")").concat(Vt,"*(.+)"),"[‒-―-]".concat(Vt,"*(.+)"),"\\.+".concat(Vt,"*([^.]+)"),"".concat(Vt,"+(").concat(Ht,"+)")],Id=Bt(0,2),kd=Bt(0,4),Td=Bt(0,20),Fd="[".concat(r,"]")+kd,Ad=Kt+Bt(1,20),Rd="(?:"+vd+Fd+")"+Id+Ad+"(?:"+Fd+Ad+")"+Td+"(?:"+Sd+")?",Dd=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9").concat(Yt,"#]+$")),Md=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Ld=function(){function t(){var d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(Pd(this,t),Od(this,"state","NOT_READY"),Od(this,"searchIndex",0),Od(this,"regExpCache",new jt(32)),!(e=xd({},e,{defaultCallingCode:e.defaultCallingCode,defaultCountry:e.defaultCountry&&C(e.defaultCountry,n)?e.defaultCountry:void 0,leniency:e.leniency||e.extended?"POSSIBLE":"VALID",maxTries:e.maxTries||Md})).leniency)throw new TypeError("`Leniency` not supplied");if(e.maxTries<0)throw new TypeError("`maxTries` not supplied");if(this.text=d,this.options=e,this.metadata=n,this.leniency=nd[e.leniency],!this.leniency)throw new TypeError("Unknown leniency: ".concat(e.leniency,"."));this.maxTries=e.maxTries,this.PATTERN=new RegExp(Rd,"ig")}var d,e,n;return d=t,(e=[{key:"find",value:function(){for(var t;this.maxTries>0&&null!==(t=this.PATTERN.exec(this.text));){var d=t[0],e=t.index;if(md(d=cd(d),e,this.text)){var n=this.parseAndVerify(d,e,this.text)||this.extractInnerMatch(d,e,this.text);if(n){if(this.options.v2){var r=new nt(n.country||n.countryCallingCode,n.phone,this.metadata);return n.ext&&(r.ext=n.ext),{startsAt:n.startsAt,endsAt:n.endsAt,number:r}}return n}}this.maxTries--}}},{key:"extractInnerMatch",value:function(t,d,e){for(var n=0,r=Ed;n<r.length;n++)for(var i=!0,a=void 0,$=new RegExp(r[n],"g");this.maxTries>0&&null!==(a=$.exec(t));){if(i){var o=Ut(Dd,t.slice(0,a.index)),u=this.parseAndVerify(o,d,e);if(u)return u;this.maxTries--,i=!1}var l=Ut(Dd,a[1]),s=t.indexOf(l,a.index),c=this.parseAndVerify(l,d+s,e);if(c)return c;this.maxTries--}}},{key:"parseAndVerify",value:function(t,d,e){if(function(t,d,e,n){if(Cd.test(t)&&!Nd.test(t)){if("POSSIBLE"!==n){if(d>0&&!pd.test(t)){var r=e[d-1];if(ed(r)||dd(r))return!1}var i=d+t.length;if(i<e.length){var a=e[i];if(ed(a)||dd(a))return!1}}return!0}}(t,d,e,this.options.leniency)){var n=ht(t,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(n.possible&&this.leniency(n,t,this.metadata,this.regExpCache)){var r={startsAt:d,endsAt:d+t.length,phone:n.phone};return n.country&&"001"!==n.country?r.country=n.country:r.countryCallingCode=n.countryCallingCode,n.ext&&(r.ext=n.ext),r}}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(),this.lastMatch?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var t=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",t}}])&&wd(d.prototype,e),n&&wd(d,n),t}();function _d(t,d,e){for(var n=new Ld(t,d,e),r=[];n.hasNext();)r.push(n.next());return r}function Gd(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata;return _d(d,e,n)}function jd(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Bd(){var t=Ct(arguments),d=t.text,e=t.options,n=t.metadata,r=new Ld(d,e,n);return jd({},Symbol.iterator,(function(){return{next:function(){return r.hasNext()?{done:!1,value:r.next()}:{done:!0}}}}))}function Ud(t){return(Ud="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wd(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(d){Vd(t,d,e[d])}))}return t}function Vd(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function Hd(t,d,e,n){var r=Kd(d,e,n);return Gd(t,r.options,r.metadata)}function Kd(t,d,e){return e?t&&(d=Wd({},d,{defaultCountry:t})):d?(e=d,d=t?Yd(t)?t:{defaultCountry:t}:void 0):(e=t,d=void 0),{options:Wd({},d,{v2:!0}),metadata:e}}var Yd=function(t){return"object"===Ud(t)};function Zd(t,d,e,n){var r=Kd(d,e,n);return Bd(t,r.options,r.metadata)}function Xd(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Jd=function(){function t(d){var e=this,n=d.onCountryChange,r=d.onCallingCodeChange;!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,d,e){d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e}(this,"update",(function(t){for(var d=0,n=Object.keys(t);d<n.length;d++){var r=n[d];e[r]=t[r]}})),this.onCountryChange=n,this.onCallingCodeChange=r}var d,e,n;return d=t,(e=[{key:"reset",value:function(t,d){this.international=!1,this.IDDPrefix=void 0,this.missingPlus=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,d)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"initCountryAndCallingCode",value:function(t,d){this.setCountry(t),this.setCallingCode(d)}},{key:"setCountry",value:function(t){this.country=t,this.onCountryChange(t)}},{key:"setCallingCode",value:function(t){return this.callingCode=t,this.onCallingCodeChange(this.country,t)}},{key:"startInternationalNumber",value:function(){this.international=!0,this.initCountryAndCallingCode()}},{key:"appendDigits",value:function(t){this.digits+=t}},{key:"appendNationalSignificantNumberDigits",value:function(t){this.nationalSignificantNumber+=t}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&Xd(d.prototype,e),n&&Xd(d,n),t}(),zd=new RegExp("x");function Qd(t,d){if(d<1)return"";for(var e="";d>1;)1&d&&(e+=t),d>>=1,t+=t;return e+t}function qd(t,d){return")"===t[d]&&d++,function(t){var d=[],e=0;for(;e<t.length;)"("===t[e]?d.push(e):")"===t[e]&&d.pop(),e++;var n=0,r="";d.push(t.length);for(var i=0,a=d;i<a.length;i++){var $=a[i];r+=t.slice(n,$),n=$+1}return r}(t.slice(0,d))}function te(t,d,e){var n=e.metadata,r=e.shouldTryNationalPrefixFormattingRule,i=e.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(d.pattern(),")$")).test(t.nationalSignificantNumber))return function(t,d,e){var n=e.metadata,r=e.shouldTryNationalPrefixFormattingRule,i=e.getSeparatorAfterNationalPrefix;t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode;if(r(d)){var a=de(t,d,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:i,metadata:n});if(a)return a}return de(t,d,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:i,metadata:n})}(t,d,{metadata:n,shouldTryNationalPrefixFormattingRule:r,getSeparatorAfterNationalPrefix:i})}function de(t,d,e){var n=e.metadata,r=e.useNationalPrefixFormattingRule,i=e.getSeparatorAfterNationalPrefix,a=Z(t.nationalSignificantNumber,d,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:r,metadata:n});if(r||(t.nationalPrefix?a=t.nationalPrefix+i(d)+a:t.complexPrefixBeforeNationalSignificantNumber&&(a=t.complexPrefixBeforeNationalSignificantNumber+" "+a)),function(t,d){return A(t)===d.getNationalDigits()}(a,t))return a}function ee(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function ne(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function re(t,d,e){return d&&ne(t.prototype,d),e&&ne(t,e),t}var ie=function(){function t(d){ee(this,t),this.matchTree=(new ue).parse(d)}return re(t,[{key:"match",value:function(t){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=d.allowOverflow;if(!t)throw new Error("String is required");var n=ae(t.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||e)return n}}]),t}();function ae(t,d,e){if("string"==typeof d){if(e&&t.length>d.length)return{overflow:!0};var n=t.join("");return 0===d.indexOf(n)?t.length===d.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===n.indexOf(d)?{match:!0,matchedChars:t.slice(0,d.length)}:void 0}if(Array.isArray(d)){for(var r=t.slice(),i=0;i<d.length;){var a=ae(r,d[i],e&&i===d.length-1);if(!a)return;if(a.overflow)return a;if(!a.match){if(a.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(a,null,2)))}if(0===(r=r.slice(a.matchedChars.length)).length)return i===d.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};i++}return e?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-r.length)}}switch(d.op){case"|":var $,o=d.args,u=Array.isArray(o),l=0;for(o=u?o:o[Symbol.iterator]();;){var s;if(u){if(l>=o.length)break;s=o[l++]}else{if((l=o.next()).done)break;s=l.value}var c=ae(t,s,e);if(c){if(c.overflow)return c;if(c.match)return{match:!0,matchedChars:c.matchedChars};if(!c.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(c,null,2)));$=!0}}return $?{partialMatch:!0}:void 0;case"[]":var f=d.args,h=Array.isArray(f),g=0;for(f=h?f:f[Symbol.iterator]();;){var m;if(h){if(g>=f.length)break;m=f[g++]}else{if((g=f.next()).done)break;m=g.value}var y=m;if(t[0]===y)return 1===t.length?{match:!0,matchedChars:t}:e?{overflow:!0}:{match:!0,matchedChars:[y]}}return;default:throw new Error("Unsupported instruction tree: ".concat(d))}}var $e=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])"),oe=/[\(\)\[\]\?\:\|]/,ue=function(){function t(){ee(this,t)}return re(t,[{key:"parse",value:function(t){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(t),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var d=this.context[0],e=d.branches,n=d.instructions;if(e)return[{op:"|",args:e.concat([n])}];if(0===n.length)throw new Error("Pattern is required");return n}},{key:"startContext",value:function(t){this.context.push(t)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(t){if(!t)throw new Error("Pattern is required");var d=t.match($e);if(d){var e=d[1],n=t.slice(0,d.index),r=t.slice(d.index+e.length);switch(e){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var i=this.getContext().branches;i.push(this.getContext().instructions),this.endContext(),this.getContext().instructions.push({op:"|",args:i});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(this.getContext().instructions),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:le(n)});break;default:throw new Error("Unknown operator: ".concat(e))}r&&this.parsePattern(r)}else{if(oe.test(t))throw new Error("Illegal characters found in a pattern: ".concat(t));this.getContext().instructions=this.getContext().instructions.concat(t.split(""))}}}]),t}();function le(t){for(var d=[],e=0;e<t.length;){if("-"===t[e]){if(0===e||e===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var n=t[e-1].charCodeAt(0)+1,r=t[e+1].charCodeAt(0)-1,i=n;i<=r;)d.push(String.fromCharCode(i)),i++}else d.push(t[e]);e++}return d}function se(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ce(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}var fe=Qd("9",15),he=/[- ]/,ge=new RegExp("^["+r+"]*(\\$\\d["+r+"]*)+$"),me=function(){function t(d){var e=this,n=(d.state,d.metadata);!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),ce(this,"getSeparatorAfterNationalPrefix",(function(t){return e.isNANP?" ":t&&t.nationalPrefixFormattingRule()&&he.test(t.nationalPrefixFormattingRule())?" ":""})),ce(this,"shouldTryNationalPrefixFormattingRule",(function(t,d){var e=d.international,n=d.nationalPrefix;if(t.nationalPrefixFormattingRule()){var r=t.usesNationalPrefix();if(r&&n||!r&&!e)return!0}})),this.metadata=n,this.resetFormat()}var d,e,n;return d=t,(e=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(t,d){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),d.nationalSignificantNumber&&this.narrowDownMatchingFormats(d)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(t,d){var e=this;if(function(t,d){return"IS_POSSIBLE"===M(t,d)}(d.nationalSignificantNumber,this.metadata)){var n=this.matchingFormats,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var $=a,o=te(d,$,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(t){return e.shouldTryNationalPrefixFormattingRule(t,{international:d.international,nationalPrefix:d.nationalPrefix})},getSeparatorAfterNationalPrefix:this.getSeparatorAfterNationalPrefix});if(o)return this.resetFormat(),this.chosenFormat=$,this.setNationalNumberTemplate(o.replace(/\d/g,"x"),d),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),o}}return this.formatNationalNumberWithNextDigits(t,d)}},{key:"formatNationalNumberWithNextDigits",value:function(t,d){var e=this.chosenFormat,n=this.chooseFormat(d);if(n)return n===e?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(d.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(t){var d=this,e=t.nationalSignificantNumber,n=t.nationalPrefix,r=t.international,i=e,a=i.length-3;a<0&&(a=0),this.matchingFormats=this.matchingFormats.filter((function(t){return d.formatSuits(t,r,n)&&d.formatMatches(t,i,a)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(t,d,e){return!(e&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!d&&!e&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(t,d,e){var n=t.leadingDigitsPatterns().length;if(0===n)return!0;e=Math.min(e,n-1);var r=t.leadingDigitsPatterns()[e];if(d.length<3)try{return void 0!==new ie(r).match(d,{allowOverflow:!0})}catch(t){return console.error(t),!0}return new RegExp("^(".concat(r,")")).test(d)}},{key:"getFormatFormat",value:function(t,d){return d?t.internationalFormat():t.format()}},{key:"chooseFormat",value:function(t){var d=this,e=function(){if(r){if(i>=n.length)return"break";a=n[i++]}else{if((i=n.next()).done)return"break";a=i.value}var e=a;return d.chosenFormat===e?"break":ge.test(d.getFormatFormat(e,t.international))?d.createTemplateForFormat(e,t)?(d.chosenFormat=e,"break"):(d.matchingFormats=d.matchingFormats.filter((function(t){return t!==e})),"continue"):"continue"},n=this.matchingFormats.slice(),r=Array.isArray(n),i=0;t:for(n=r?n:n[Symbol.iterator]();;){var a;switch(e()){case"break":break t;case"continue":continue}}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(t,d){if(!(t.pattern().indexOf("|")>=0)){var e=this.getTemplateForFormat(t,d);return e?(this.setNationalNumberTemplate(e,d),!0):void 0}}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,d){var e=t.IDDPrefix,n=t.missingPlus;return e?d&&!1===d.spacing?e:e+" ":n?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var d=-1,e=0,n=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";e<n.length+t.getDigitsWithoutInternationalPrefix().length;)d=this.template.indexOf("x",d+1),e++;return qd(this.template,d+1)}}},{key:"setNationalNumberTemplate",value:function(t,d){this.nationalNumberTemplate=t,this.populatedNationalNumberTemplate=t,this.populatedNationalNumberTemplatePosition=-1,d.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(d).replace(/[\d\+]/g,"x")+Qd("x",d.callingCode.length)+" "+t:this.template=t}},{key:"getTemplateForFormat",value:function(t,d){var e=d.nationalSignificantNumber,n=d.international,r=d.nationalPrefix,i=d.complexPrefixBeforeNationalSignificantNumber,a=t.pattern();a=a.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var $=fe.match(a)[0];if(!(e.length>$.length)){var o=new RegExp("^"+a+"$"),u=e.replace(/\d/g,"9");o.test(u)&&($=u);var l,s=this.getFormatFormat(t,n);if(this.shouldTryNationalPrefixFormattingRule(t,{international:n,nationalPrefix:r})){var c=s.replace(Y,t.nationalPrefixFormattingRule());if(A(t.nationalPrefixFormattingRule())===(r||"")+A("$1")&&(s=c,l=!0,r))for(var f=r.length;f>0;)s=s.replace(/\d/,"x"),f--}var h=$.replace(new RegExp(a),s).replace(new RegExp("9","g"),"x");return l||(i?h=Qd("x",i.length)+" "+h:r&&(h=Qd("x",r.length)+this.getSeparatorAfterNationalPrefix(t)+h)),n&&(h=K(h)),h}}},{key:"formatNextNationalNumberDigits",value:function(t){var d=function(t,d,e){var n=e.split(""),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var $=a;if(t.slice(d+1).search(zd)<0)return;d=t.search(zd),t=t.replace(zd,$)}return[t,d]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(d)return this.populatedNationalNumberTemplate=d[0],this.populatedNationalNumberTemplatePosition=d[1],qd(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}}])&&se(d.prototype,e),n&&se(d,n),t}();function ye(t,d){return function(t){if(Array.isArray(t))return t}(t)||function(t,d){var e=[],n=!0,r=!1,i=void 0;try{for(var a,$=t[Symbol.iterator]();!(n=(a=$.next()).done)&&(e.push(a.value),!d||e.length!==d);n=!0);}catch(t){r=!0,i=t}finally{try{n||null==$.return||$.return()}finally{if(r)throw i}}return e}(t,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ve(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var pe=new RegExp("^"+("["+r+"0-90-9٠-٩۰-۹]+")+"$","i"),be="(?:[++]["+r+"0-90-9٠-٩۰-۹]*|["+r+"0-90-9٠-٩۰-۹]+)",Ce=new RegExp("[^"+r+"0-90-9٠-٩۰-۹]+.*$"),Ne=/[^\d\[\]]/,xe=function(){function t(d){var e=d.defaultCountry,n=d.defaultCallingCode,r=d.metadata,i=d.onNationalSignificantNumberChange;!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=e,this.defaultCallingCode=n,this.metadata=r,this.onNationalSignificantNumberChange=i}var d,e,n;return d=t,(e=[{key:"input",value:function(t,d){var e,n=function(t){var d=ye(function(t){var d=function(t){var d,e=t.search(be);if(!(e<0))return"+"===(t=t.slice(e))[0]&&(d=!0,t=t.slice("+".length)),t=t.replace(Ce,""),d&&(t="+"+t),t}(t)||"";return"+"===d[0]?[d.slice("+".length),!0]:[d]}(t),2),e=d[0],n=d[1];return pe.test(e)||(e=""),[e,n]}(t),r=ye(n,2),i=r[0],a=r[1],$=A(i);return a&&(d.digits||(d.startInternationalNumber(),$||(e=!0))),$&&this.inputDigits($,d),{digits:$,justLeadingPlus:e}}},{key:"inputDigits",value:function(t,d){var e=d.digits,n=e.length<3&&e.length+t.length>=3;if(d.appendDigits(t),n&&this.extractIddPrefix(d),this.isWaitingForCountryCallingCode(d)){if(!this.extractCountryCallingCode(d))return}else d.appendNationalSignificantNumberDigits(t);d.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(d.getNationalDigits(),d.update)}},{key:"isWaitingForCountryCallingCode",value:function(t){var d=t.international,e=t.callingCode;return d&&!e}},{key:"extractCountryCallingCode",value:function(t){var d=lt("+"+t.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),e=d.countryCallingCode,n=d.number;if(e)return t.setCallingCode(e),t.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var d=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=d&&Ne.test(d)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,d){if(this.hasSelectedNumberingPlan){var e=$t(t,this.metadata),n=e.nationalPrefix,r=e.nationalNumber,i=e.carrierCode;if(r!==t)return this.onExtractedNationalNumber(n,i,r,t,d),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,d,e){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,e);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=$t(t,this.metadata),r=n.nationalPrefix,i=n.nationalNumber,a=n.carrierCode;if(i!==d)return this.onExtractedNationalNumber(r,a,i,t,e),!0}}},{key:"onExtractedNationalNumber",value:function(t,d,e,n,r){var i,a,$=n.lastIndexOf(e);if($>=0&&$===n.length-e.length){a=!0;var o=n.slice(0,$);o!==t&&(i=o)}r({nationalPrefix:t,carrierCode:d,nationalSignificantNumber:e,nationalSignificantNumberMatchesInput:a,complexPrefixBeforeNationalSignificantNumber:i}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,t.update)||(this.extractIddPrefix(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var d=t.international,e=t.IDDPrefix,n=t.digits;if(t.nationalSignificantNumber,!d&&!e){var r=at(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==r&&r!==n?(t.update({IDDPrefix:n.slice(0,n.length-r.length)}),this.startInternationalNumber(t),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var d=ut(t.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),e=d.countryCallingCode;if(d.number,e)return t.update({missingPlus:!0}),this.startInternationalNumber(t),!0}}},{key:"startInternationalNumber",value:function(t){t.startInternationalNumber(),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),t.update)}}])&&ve(d.prototype,e),n&&ve(d,n),t}();function Pe(t){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function we(t,d){return function(t){if(Array.isArray(t))return t}(t)||function(t,d){var e=[],n=!0,r=!1,i=void 0;try{for(var a,$=t[Symbol.iterator]();!(n=(a=$.next()).done)&&(e.push(a.value),!d||e.length!==d);n=!0);}catch(t){r=!0,i=t}finally{try{n||null==$.return||$.return()}finally{if(r)throw i}}return e}(t,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Oe(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Se=function(){function t(d,e){!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.metadata=new s(e);var n=we(this.getCountryAndCallingCode(d),2),r=n[0],i=n[1];this.defaultCountry=r,this.defaultCallingCode=i,this.reset()}var d,e,n;return d=t,(e=[{key:"getCountryAndCallingCode",value:function(t){var d,e;return t&&("object"===Pe(t)?(d=t.defaultCountry,e=t.defaultCallingCode):d=t),d&&!this.metadata.hasCountry(d)&&(d=void 0),[d,e]}},{key:"input",value:function(t){var d=this.parser.input(t,this.state),e=d.digits;if(d.justLeadingPlus)this.formattedOutput="+";else if(e){var n;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(n=this.formatter.format(e,this.state)),void 0===n&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var r=this.state.getNationalDigits();r&&(n=this.formatter.format(r,this.state))}this.formattedOutput=n?this.getFullNumber(n):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var t=this;return this.state=new Jd({onCountryChange:function(d){t.country=d},onCallingCodeChange:function(d,e){t.metadata.selectNumberingPlan(d,e),t.formatter.reset(t.metadata.numberingPlan,t.state),t.parser.reset(t.metadata.numberingPlan)}}),this.formatter=new me({state:this.state,metadata:this.metadata}),this.parser=new xe({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){t.determineTheCountryIfNeeded(),t.formatter.reset(t.metadata.numberingPlan,t.state)}}),this.state.reset(this.defaultCountry,this.defaultCallingCode),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(t){var d=this;if(this.isInternational()){var e=function(t){return d.formatter.getInternationalPrefixBeforeCountryCallingCode(d.state,{spacing:!!t})+t},n=this.state.callingCode;return e(n?t?"".concat(n," ").concat(t):n:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return t}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var t=this.state,d=t.nationalSignificantNumber,e=t.complexPrefixBeforeNationalSignificantNumber,n=t.nationalPrefix,r=d,i=e||n;return i&&(r=i+r),r}},{key:"getNonFormattedNumber",value:function(){var t=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(t?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var t=this.getNonFormattedNumber();if(t)return t.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var t=this.state.callingCode,d=this.metadata.getCountryCodesForCallingCode(t);return d&&d.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(st(this.isInternational()?this.state.callingCode:this.defaultCallingCode,this.state.nationalSignificantNumber,this.metadata))}},{key:"getNumberValue",value:function(){var t=this.state,d=t.digits,e=t.callingCode,n=t.country,r=t.nationalSignificantNumber;if(d)return this.isInternational()?e?"+"+e+r:"+"+d:n||e?"+"+(n?this.metadata.countryCallingCode():e)+r:void 0}},{key:"getNumber",value:function(){var t=this.state,d=t.nationalSignificantNumber,e=t.carrierCode,n=t.callingCode,r=this._getCountry();if(d&&(r||n)){var i=new nt(r||n,d,this.metadata.metadata);return e&&(i.carrierCode=e),i}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])&&Oe(d.prototype,e),n&&Oe(d,n),t}();function Ee(t){return new s(t).getCountries()}function Ie(t,d,e){if(d[t])return new nt(t,d[t],e)}function ke(t,d,e){return e||(e=d,d=void 0),new Se(d,e).input(t)}function Te(){return e(bt,arguments)}function Fe(){return e(wt,arguments)}function Ae(t,e){return Ld.call(this,t,e,d)}function Re(t){return Se.call(this,t,d)}function De(){return s.call(this,d)}Ae.prototype=Object.create(Ld.prototype,{}),Ae.prototype.constructor=Ae,Re.prototype=Object.create(Se.prototype,{}),Re.prototype.constructor=Re,De.prototype=Object.create(s.prototype,{}),De.prototype.constructor=De,t.AsYouType=Re,t.DIGIT_PLACEHOLDER="x",t.Metadata=De,t.ParseError=n,t.PhoneNumberMatcher=Ae,t.default=Fe,t.findNumbers=function(){return e(Gd,arguments)},t.findPhoneNumbersInText=function(){return e(Hd,arguments)},t.formatIncompletePhoneNumber=function(){return e(ke,arguments)},t.formatRFC3966=j,t.getCountries=function(){return e(Ee,arguments)},t.getCountryCallingCode=function(){return e(b,arguments)},t.getExampleNumber=function(){return e(Ie,arguments)},t.getExtPrefix=function(){return e(p,arguments)},t.isPossiblePhoneNumber=function(){return e(Tt,arguments)},t.isSupportedCountry=function(){return e(C,arguments)},t.isValidPhoneNumber=function(){return e(Et,arguments)},t.parseDigits=A,t.parseIncompletePhoneNumber=R,t.parsePhoneNumber=Te,t.parsePhoneNumberCharacter=D,t.parsePhoneNumberFromString=Fe,t.parsePhoneNumberWithError=Te,t.parseRFC3966=G,t.searchNumbers=function(){return e(Bd,arguments)},t.searchPhoneNumbersInText=function(){return e(Zd,arguments)},t.validatePhoneNumberLength=function(){return e(Rt,arguments)},Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=libphonenumber-mobile.js.map
/** * @license * Copyright 2021 Google LLC. * SPDX-License-Identifier: Apache-2.0 */ function initMap() { const map = new google.maps.Map(document.getElementById("map"), { center: { lat: 37.7893719, lng: -122.3942, }, zoom: 16, heading: 320, tilt: 47.5, mapId: "90f87356969d889c", }); const buttons = [ ["Rotate Left", "rotate", 20, google.maps.ControlPosition.LEFT_CENTER], ["Rotate Right", "rotate", -20, google.maps.ControlPosition.RIGHT_CENTER], ["Tilt Down", "tilt", 20, google.maps.ControlPosition.TOP_CENTER], ["Tilt Up", "tilt", -20, google.maps.ControlPosition.BOTTOM_CENTER], ]; buttons.forEach(([text, mode, amount, position]) => { const controlDiv = document.createElement("div"); const controlUI = document.createElement("button"); controlUI.classList.add("ui-button"); controlUI.innerText = `${text}`; controlUI.addEventListener("click", () => { adjustMap(mode, amount); }); controlDiv.appendChild(controlUI); map.controls[position].push(controlDiv); }); const adjustMap = function (mode, amount) { switch (mode) { case "tilt": map.setTilt(map.getTilt() + amount); break; case "rotate": map.setHeading(map.getHeading() + amount); break; default: break; } }; } window.initMap = initMap;
import django try: from django.db.models.loading import get_model except ImportError: # Django 1.9 > from django.apps import apps get_model = apps.get_model
import Ember from 'ember'; import ajax from 'ic-ajax'; export default Ember.Route.extend({ model() { function addCrates(store, crates) { for (var i = 0; i < crates.length; i++) { crates[i] = store.push(store.normalize('crate', crates[i])); } } return ajax('/summary').then((data) => { addCrates(this.store, data.new_crates); addCrates(this.store, data.most_downloaded); addCrates(this.store, data.just_updated); return data; }); } });
DEFAULT_CORS_CONFIG = {"allow_origins": [], "allow_methods": ["GET"]}
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UsersTable = void 0; const typeorm_1 = require("typeorm"); class UsersTable { async up(QR) { await QR.createTable(new typeorm_1.Table({ name: 'users', columns: [ { name: 'id', type: 'int8', isPrimary: true, isGenerated: true, generationStrategy: 'increment', }, { name: 'userId', type: 'varchar', length: '20', isNullable: false, isUnique: true, }, { name: 'hashedPassword', type: 'varchar', isNullable: false, }, { name: 'salt', type: 'varchar', isNullable: false, }, { name: 'registeredAt', type: 'datetime', isGenerated: true, }, ], })); } async down(QR) { QR.query('DROP TABLE users'); } } exports.UsersTable = UsersTable; //# sourceMappingURL=users.table.js.map
const createState = ({ state, only }) => { const crudState = { entities: {}, list: [], entity: {} }; if (only.includes('FETCH_LIST')) { Object.assign(crudState, { isFetchingList: false, fetchListError: null }); } if (only.includes('FETCH_SINGLE')) { Object.assign(crudState, { isFetchingSingle: false, fetchSingleError: null }); } if (only.includes('CREATE')) { Object.assign(crudState, { isCreating: false, createError: null }); } if (only.includes('UPDATE')) { Object.assign(crudState, { isUpdating: false, updateError: null }); } if (only.includes('REPLACE')) { Object.assign(crudState, { isReplacing: false, replaceError: null }); } if (only.includes('DESTROY')) { Object.assign(crudState, { isDestroying: false, destroyError: null }); } return Object.assign(crudState, state); }; export default createState;
(function () { 'use strict'; angular.module('frontend.core.auth.forgotPassword', []); })();
import React, { Component } from 'react' import PropTypes from 'prop-types' import { FormattedMessage } from 'react-intl' import classNames from 'classnames' import _get from 'lodash/get' import _isFinite from 'lodash/isFinite' import { WidgetDataTarget, registerWidgetType } from '../../../services/Widget/Widget' import TaskInstructions from '../../TaskPane/TaskInstructions/TaskInstructions' import QuickWidget from '../../QuickWidget/QuickWidget' import messages from './Messages' import SvgSymbol from '../../SvgSymbol/SvgSymbol' const descriptor = { widgetKey: 'TaskInstructionsWidget', label: messages.label, targets: [WidgetDataTarget.task], minWidth: 3, defaultWidth: 3, minHeight: 2, defaultHeight: 6, } export default class TaskInstructionsWidget extends Component { /** * Invoked to toggle minimization of the challenge instructions. If the user * is working through a virtual challenge, we nevertheless set the preference * on the actual challenge being worked on (not the virtual challenge) as the * instructions will obviously vary from challenge to challenge if the user * works through tasks from multiple challenges. */ toggleMinimized = () => { const challengeId = _get(this.props.task, 'parent.id') if (_isFinite(challengeId)) { this.props.setInstructionsCollapsed(challengeId, false, !this.props.collapseInstructions) } } adjustHeightForMinimization = () => { if (this.props.collapseInstructions && this.props.widgetLayout.h > descriptor.minHeight) { this.props.updateWidgetHeight(this.props.widgetLayout.i, descriptor.minHeight) } else if (!this.props.collapseInstructions && this.props.widgetLayout.h === descriptor.minHeight) { this.props.updateWidgetHeight(this.props.widgetLayout.i, descriptor.defaultHeight) } } componentDidMount() { this.adjustHeightForMinimization() } componentDidUpdate() { this.adjustHeightForMinimization() } render() { const minimizeControl = ( /* // eslint-disable-next-line jsx-a11y/anchor-is-valid <a className="collapsible-icon" aria-label="more options" onClick={this.toggleMinimized}> <span className="icon"></span> </a> */ <button className="mr-text-green-lighter" onClick={this.toggleMinimized}> <SvgSymbol sym="icon-cheveron-down" viewBox="0 0 20 20" className="mr-transition mr-fill-current mr-min-w-6 mr-w-6 mr-h-6" /> </button> ) return ( <QuickWidget {...this.props} className={classNames( "task-instructions-widget", {"is-expanded": !this.props.collapseInstructions})} widgetTitle={<FormattedMessage {...messages.title} />} rightHeaderControls={minimizeControl}> {!this.props.collapseInstructions && <TaskInstructions {...this.props} />} </QuickWidget> ) } } TaskInstructionsWidget.propTypes = { collapseInstructions: PropTypes.bool, setInstructionsCollapsed: PropTypes.func.isRequired, } registerWidgetType(TaskInstructionsWidget, descriptor)
import { Text } from 'slate' export const input = { text: '', custom: true, } export const test = value => { return Text.isText(value) } export const output = true
import setupWeb3 from './setupWeb3'; import setupState from './setupState'; import setupDOM from './setupDOM'; async function init() { window.dapp = window.dapp || {}; await setupWeb3(); await setupState(); await setupDOM(); } window.addEventListener('load', () => { init(); });
window.Vue = require('vue'); //Vue.component('example-component', require('./components/ExampleComponent.vue').default); Vue.component('main-component', require('./components/MainComponent.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ const app = new Vue({ el: '#app', });
import { configureStore } from '@reduxjs/toolkit'; import authReducer from './slices/auth'; import notesReducer from './slices/notes'; // eslint-disable-next-line import/prefer-default-export export const createStore = () => configureStore({ reducer: { auth: authReducer, notes: notesReducer, }, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }), });
/* * Ext JS Library 2.2 * Copyright(c) 2006-2008, Ext JS, LLC. * [email protected] * * http://extjs.com/license */ Ext.onReady(function(){ Ext.QuickTips.init(); // Album toolbar var newIndex = 3; var tb = new Ext.Toolbar({ items:[{ text: 'New Album', iconCls: 'album-btn', handler: function(){ var node = root.appendChild(new Ext.tree.TreeNode({ text:'Album ' + (++newIndex), cls:'album-node', allowDrag:false })); tree.getSelectionModel().select(node); setTimeout(function(){ ge.editNode = node; ge.startEdit(node.ui.textNode); }, 10); } }] }); // set up the Album tree var tree = new Ext.tree.TreePanel({ // tree animate:true, enableDD:true, containerScroll: true, ddGroup: 'organizerDD', rootVisible:false, // layout region:'west', width:200, split:true, // panel title:'My Albums', autoScroll:true, tbar: tb, margins: '5 0 5 5' }); var root = new Ext.tree.TreeNode({ text: 'Albums', allowDrag:false, allowDrop:false }); tree.setRootNode(root); root.appendChild( new Ext.tree.TreeNode({text:'Album 1', cls:'album-node', allowDrag:false}), new Ext.tree.TreeNode({text:'Album 2', cls:'album-node', allowDrag:false}), new Ext.tree.TreeNode({text:'Album 3', cls:'album-node', allowDrag:false}) ); // add an inline editor for the nodes var ge = new Ext.tree.TreeEditor(tree, { allowBlank:false, blankText:'A name is required', selectOnFocus:true }); // Set up images view var view = new Ext.DataView({ itemSelector: 'div.thumb-wrap', style:'overflow:auto', multiSelect: true, plugins: new Ext.DataView.DragSelector({dragSafe:true}), store: new Ext.data.JsonStore({ url: '../view/get-images.php', autoLoad: true, root: 'images', id:'name', fields:[ 'name', 'url', {name: 'shortName', mapping: 'name', convert: shortName} ] }), tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="../view/{url}" class="thumb-img"></div>', '<span>{shortName}</span></div>', '</tpl>' ) }); var images = new Ext.Panel({ id:'images', title:'My Images', region:'center', margins: '5 5 5 0', layout:'fit', items: view }); var layout = new Ext.Panel({ layout: 'border', width:650, height:400, items: [tree, images] }); layout.render('layout'); var dragZone = new ImageDragZone(view, {containerScroll:true, ddGroup: 'organizerDD'}); }); /** * Create a DragZone instance for our JsonView */ ImageDragZone = function(view, config){ this.view = view; ImageDragZone.superclass.constructor.call(this, view.getEl(), config); }; Ext.extend(ImageDragZone, Ext.dd.DragZone, { // We don't want to register our image elements, so let's // override the default registry lookup to fetch the image // from the event instead getDragData : function(e){ var target = e.getTarget('.thumb-wrap'); if(target){ var view = this.view; if(!view.isSelected(target)){ view.onClick(e); } var selNodes = view.getSelectedNodes(); var dragData = { nodes: selNodes }; if(selNodes.length == 1){ dragData.ddel = target; dragData.single = true; }else{ var div = document.createElement('div'); // create the multi element drag "ghost" div.className = 'multi-proxy'; for(var i = 0, len = selNodes.length; i < len; i++){ div.appendChild(selNodes[i].firstChild.firstChild.cloneNode(true)); // image nodes only if((i+1) % 3 == 0){ div.appendChild(document.createElement('br')); } } var count = document.createElement('div'); // selected image count count.innerHTML = i + ' images selected'; div.appendChild(count); dragData.ddel = div; dragData.multi = true; } return dragData; } return false; }, // this method is called by the TreeDropZone after a node drop // to get the new tree node (there are also other way, but this is easiest) getTreeNode : function(){ var treeNodes = []; var nodeData = this.view.getRecords(this.dragData.nodes); for(var i = 0, len = nodeData.length; i < len; i++){ var data = nodeData[i].data; treeNodes.push(new Ext.tree.TreeNode({ text: data.name, icon: '../view/'+data.url, data: data, leaf:true, cls: 'image-node' })); } return treeNodes; }, // the default action is to "highlight" after a bad drop // but since an image can't be highlighted, let's frame it afterRepair:function(){ for(var i = 0, len = this.dragData.nodes.length; i < len; i++){ Ext.fly(this.dragData.nodes[i]).frame('#8db2e3', 1); } this.dragging = false; }, // override the default repairXY with one offset for the margins and padding getRepairXY : function(e){ if(!this.dragData.multi){ var xy = Ext.Element.fly(this.dragData.ddel).getXY(); xy[0]+=3;xy[1]+=3; return xy; } return false; } }); // Utility functions function shortName(name){ if(name.length > 15){ return name.substr(0, 12) + '...'; } return name; };
const path = require('path') const fs = require('fs') const spawn = require('child_process').spawn const lintStyles = ['standard', 'airbnb'] /** * Sorts dependencies in package.json alphabetically. * They are unsorted because they were grouped for the handlebars helpers * @param {object} data Data from questionnaire */ exports.sortDependencies = function sortDependencies(data) { const packageJsonFile = path.join( data.inPlace ? '' : data.destDirName, 'package.json' ) const packageJson = JSON.parse(fs.readFileSync(packageJsonFile)) packageJson.devDependencies = sortObject(packageJson.devDependencies) packageJson.dependencies = sortObject(packageJson.dependencies) fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2) + '\n') } /** * Runs `npm install` in the project directory * @param {string} cwd Path of the created project directory * @param {object} data Data from questionnaire */ exports.installDependencies = function installDependencies( cwd, executable = 'npm', color ) { console.log(`\n\n# ${color('Installing project dependencies ...')}`) console.log('# ========================\n') return runCommand(executable, ['install'], { cwd, }) } /** * Runs `npm run lint -- --fix` in the project directory * @param {string} cwd Path of the created project directory * @param {object} data Data from questionnaire */ exports.runLintFix = function runLintFix(cwd, data, color) { if (data.lint && lintStyles.indexOf(data.lintConfig) !== -1) { console.log( `\n\n${color( 'Running eslint --fix to comply with chosen preset rules...' )}` ) console.log('# ========================\n') const args = data.autoInstall === 'npm' ? ['run', 'lint', '--', '--fix'] : ['run', 'lint', '--fix'] return runCommand(data.autoInstall, args, { cwd, }) } return Promise.resolve() } /** * Prints the final message with instructions of necessary next steps. * @param {Object} data Data from questionnaire. */ exports.printMessage = function printMessage(data, { green, yellow }) { const message = ` # ${green('项目初始化完成!')} # ======================== To get started: ${yellow( `${data.inPlace ? '' : `cd ${data.destDirName}\n `}${installMsg( data )}${lintMsg(data)}npm run server` )} Documentation can be found at https://vuejs-templates.github.io/webpack ` console.log(message) } /** * If the user will have to run lint --fix themselves, it returns a string * containing the instruction for this step. * @param {Object} data Data from questionnaire. */ function lintMsg(data) { return !data.autoInstall && data.lint && lintStyles.indexOf(data.lintConfig) !== -1 ? 'npm run lint -- --fix (or for yarn: yarn run lint --fix)\n ' : '' } /** * If the user will have to run `npm install` or `yarn` themselves, it returns a string * containing the instruction for this step. * @param {Object} data Data from the questionnaire */ function installMsg(data) { return !data.autoInstall ? 'npm install (or if using yarn: yarn)\n ' : '' } /** * Spawns a child process and runs the specified command * By default, runs in the CWD and inherits stdio * Options are the same as node's child_process.spawn * @param {string} cmd * @param {array<string>} args * @param {object} options */ function runCommand(cmd, args, options) { return new Promise((resolve, reject) => { const spwan = spawn( cmd, args, Object.assign( { cwd: process.cwd(), stdio: 'inherit', shell: true, }, options ) ) spwan.on('exit', () => { resolve() }) }) } function sortObject(object) { // Based on https://github.com/yarnpkg/yarn/blob/v1.3.2/src/config.js#L79-L85 const sortedObject = {} Object.keys(object) .sort() .forEach(item => { sortedObject[item] = object[item] }) return sortedObject }
const mongoose = require('mongoose'), Schema = mongoose.Schema; const beverageModel = new Schema({ name: {type: String} }); module.exports.Beverage = mongoose.model('Beverage', beverageModel);